From gerrit-no-reply at lists.osmocom.org Mon Jan 1 19:59:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 1 Jan 2018 19:59:17 +0000 Subject: [PATCH] libosmocore[master]: MNCC: Add MNCC to string dumper Message-ID: Review at https://gerrit.osmocom.org/5625 MNCC: Add MNCC to string dumper As MNCC is rather hard to debug (wireshark cannot trace UNIX domain sockets), let's add our own decoder that we can use from related debug log statements in the respective programs. Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 --- M include/osmocom/gsm/mncc.h M src/gsm/Makefile.am M src/gsm/libosmogsm.map A src/gsm/mncc.c 4 files changed, 424 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/5625/1 diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index f2450d9..5ca2986 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -82,3 +82,12 @@ GSM_MNCC_BCAP_OTHER_ITC = 5, GSM_MNCC_BCAP_RESERVED = 7, }; + +struct msgb; +struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len); + +void _osmo_mncc_log(int subsys, int level, const char *file, int line, const char *prefix, + const uint8_t *msg, unsigned int len); + +#define osmo_mncc_log(ss, level, prefix, msg, len) \ + _osmo_mncc_log(ss, level, __BASE_FILE__, __LINE__, prefix, msg, len); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 12f56db..f85aba3 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -30,7 +30,7 @@ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ - gsm23003.c + gsm23003.c mncc.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..80fbe06 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -425,5 +425,8 @@ osmo_imsi_str_valid; osmo_msisdn_str_valid; +osmo_mncc_stringify; +_osmo_mncc_log; + local: *; }; diff --git a/src/gsm/mncc.c b/src/gsm/mncc.c new file mode 100644 index 0000000..acf4a82 --- /dev/null +++ b/src/gsm/mncc.c @@ -0,0 +1,411 @@ +/* mncc.c - utility routines for the MNCC API between the 04.08 + * message parsing and the actual Call Control logic */ + +/* (C) 2008-2017 by Harald Welte + * (C) 2009 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* FIXME FIXME FIXME FIXME FIXME START */ +#define MNCC_SETUP_REQ 0x0101 +#define MNCC_SETUP_IND 0x0102 +#define MNCC_SETUP_RSP 0x0103 +#define MNCC_SETUP_CNF 0x0104 +#define MNCC_SETUP_COMPL_REQ 0x0105 +#define MNCC_SETUP_COMPL_IND 0x0106 +/* MNCC_REJ_* is perfomed via MNCC_REL_* */ +#define MNCC_CALL_CONF_IND 0x0107 +#define MNCC_CALL_PROC_REQ 0x0108 +#define MNCC_PROGRESS_REQ 0x0109 +#define MNCC_ALERT_REQ 0x010a +#define MNCC_ALERT_IND 0x010b +#define MNCC_NOTIFY_REQ 0x010c +#define MNCC_NOTIFY_IND 0x010d +#define MNCC_DISC_REQ 0x010e +#define MNCC_DISC_IND 0x010f +#define MNCC_REL_REQ 0x0110 +#define MNCC_REL_IND 0x0111 +#define MNCC_REL_CNF 0x0112 +#define MNCC_FACILITY_REQ 0x0113 +#define MNCC_FACILITY_IND 0x0114 +#define MNCC_START_DTMF_IND 0x0115 +#define MNCC_START_DTMF_RSP 0x0116 +#define MNCC_START_DTMF_REJ 0x0117 +#define MNCC_STOP_DTMF_IND 0x0118 +#define MNCC_STOP_DTMF_RSP 0x0119 +#define MNCC_MODIFY_REQ 0x011a +#define MNCC_MODIFY_IND 0x011b +#define MNCC_MODIFY_RSP 0x011c +#define MNCC_MODIFY_CNF 0x011d +#define MNCC_MODIFY_REJ 0x011e +#define MNCC_HOLD_IND 0x011f +#define MNCC_HOLD_CNF 0x0120 +#define MNCC_HOLD_REJ 0x0121 +#define MNCC_RETRIEVE_IND 0x0122 +#define MNCC_RETRIEVE_CNF 0x0123 +#define MNCC_RETRIEVE_REJ 0x0124 +#define MNCC_USERINFO_REQ 0x0125 +#define MNCC_USERINFO_IND 0x0126 +#define MNCC_REJ_REQ 0x0127 +#define MNCC_REJ_IND 0x0128 + +#define MNCC_BRIDGE 0x0200 +#define MNCC_FRAME_RECV 0x0201 +#define MNCC_FRAME_DROP 0x0202 +#define MNCC_LCHAN_MODIFY 0x0203 +#define MNCC_RTP_CREATE 0x0204 +#define MNCC_RTP_CONNECT 0x0205 +#define MNCC_RTP_FREE 0x0206 + +#define GSM_TCHF_FRAME 0x0300 +#define GSM_TCHF_FRAME_EFR 0x0301 +#define GSM_TCHH_FRAME 0x0302 +#define GSM_TCH_FRAME_AMR 0x0303 +#define GSM_BAD_FRAME 0x03ff + +#define MNCC_SOCKET_HELLO 0x0400 + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +#define MNCC_F_BEARER_CAP 0x0001 +#define MNCC_F_CALLED 0x0002 +#define MNCC_F_CALLING 0x0004 +#define MNCC_F_REDIRECTING 0x0008 +#define MNCC_F_CONNECTED 0x0010 +#define MNCC_F_CAUSE 0x0020 +#define MNCC_F_USERUSER 0x0040 +#define MNCC_F_PROGRESS 0x0080 +#define MNCC_F_EMERGENCY 0x0100 +#define MNCC_F_FACILITY 0x0200 +#define MNCC_F_SSVERSION 0x0400 +#define MNCC_F_CCCAP 0x0800 +#define MNCC_F_KEYPAD 0x1000 +#define MNCC_F_SIGNAL 0x2000 + +struct gsm_mncc { + /* context based information */ + uint32_t msg_type; + uint32_t callref; + + /* which fields are present */ + uint32_t fields; + + /* data derived informations (MNCC_F_ based) */ + struct gsm_mncc_bearer_cap bearer_cap; + struct gsm_mncc_number called; + struct gsm_mncc_number calling; + struct gsm_mncc_number redirecting; + struct gsm_mncc_number connected; + struct gsm_mncc_cause cause; + struct gsm_mncc_progress progress; + struct gsm_mncc_useruser useruser; + struct gsm_mncc_facility facility; + struct gsm_mncc_cccap cccap; + struct gsm_mncc_ssversion ssversion; + struct { + int sup; + int inv; + } clir; + int signal; + + /* data derived information, not MNCC_F based */ + int keypad; + int more; + int notify; /* 0..127 */ + int emergency; + char imsi[16]; + + unsigned char lchan_type; + unsigned char lchan_mode; +}; + +struct gsm_data_frame { + uint32_t msg_type; + uint32_t callref; + unsigned char data[0]; +}; + +#define MNCC_SOCK_VERSION 5 +struct gsm_mncc_hello { + uint32_t msg_type; + uint32_t version; + + /* send the sizes of the structs */ + uint32_t mncc_size; + uint32_t data_frame_size; + + /* send some offsets */ + uint32_t called_offset; + uint32_t signal_offset; + uint32_t emergency_offset; + uint32_t lchan_type_offset; +}; + +struct gsm_mncc_rtp { + uint32_t msg_type; + uint32_t callref; + uint32_t ip; + uint16_t port; + uint32_t payload_type; + uint32_t payload_msg_type; +}; + +struct gsm_mncc_bridge { + uint32_t msg_type; + uint32_t callref[2]; +}; + +/* FIXME FIXME FIXME FIXME FIXME END */ + +const struct value_string osmo_mncc_names[] = { + { MNCC_SETUP_REQ, "MNCC_SETUP_REQ" }, + { MNCC_SETUP_IND, "MNCC_SETUP_IND" }, + { MNCC_SETUP_RSP, "MNCC_SETUP_RSP" }, + { MNCC_SETUP_CNF, "MNCC_SETUP_CNF" }, + { MNCC_SETUP_COMPL_REQ, "MNCC_SETUP_COMPL_REQ" }, + { MNCC_SETUP_COMPL_IND, "MNCC_SETUP_COMPL_IND" }, + { MNCC_CALL_CONF_IND, "MNCC_CALL_CONF_IND" }, + { MNCC_CALL_PROC_REQ, "MNCC_CALL_PROC_REQ" }, + { MNCC_PROGRESS_REQ, "MNCC_PROGRESS_REQ" }, + { MNCC_ALERT_REQ, "MNCC_ALERT_REQ" }, + { MNCC_ALERT_IND, "MNCC_ALERT_IND" }, + { MNCC_NOTIFY_REQ, "MNCC_NOTIFY_REQ" }, + { MNCC_NOTIFY_IND, "MNCC_NOTIFY_IND" }, + { MNCC_DISC_REQ, "MNCC_DISC_REQ" }, + { MNCC_DISC_IND, "MNCC_DISC_IND" }, + { MNCC_REL_REQ, "MNCC_REL_REQ" }, + { MNCC_REL_IND, "MNCC_REL_IND" }, + { MNCC_REL_CNF, "MNCC_REL_CNF" }, + { MNCC_FACILITY_REQ, "MNCC_FACILITY_REQ" }, + { MNCC_FACILITY_IND, "MNCC_FACILITY_IND" }, + { MNCC_START_DTMF_IND, "MNCC_START_DTMF_IND" }, + { MNCC_START_DTMF_RSP, "MNCC_START_DTMF_RSP" }, + { MNCC_START_DTMF_REJ, "MNCC_START_DTMF_REJ" }, + { MNCC_STOP_DTMF_IND, "MNCC_STOP_DTMF_IND" }, + { MNCC_STOP_DTMF_RSP, "MNCC_STOP_DTMF_RSP" }, + { MNCC_MODIFY_REQ, "MNCC_MODIFY_REQ" }, + { MNCC_MODIFY_IND, "MNCC_MODIFY_IND" }, + { MNCC_MODIFY_RSP, "MNCC_MODIFY_RSP" }, + { MNCC_MODIFY_CNF, "MNCC_MODIFY_CNF" }, + { MNCC_MODIFY_REJ, "MNCC_MODIFY_REJ" }, + { MNCC_HOLD_IND, "MNCC_HOLD_IND" }, + { MNCC_HOLD_CNF, "MNCC_HOLD_CNF" }, + { MNCC_HOLD_REJ, "MNCC_HOLD_REJ" }, + { MNCC_RETRIEVE_IND, "MNCC_RETRIEVE_IND" }, + { MNCC_RETRIEVE_CNF, "MNCC_RETRIEVE_CNF" }, + { MNCC_RETRIEVE_REJ, "MNCC_RETRIEVE_REJ" }, + { MNCC_USERINFO_REQ, "MNCC_USERINFO_REQ" }, + { MNCC_USERINFO_IND, "MNCC_USERINFO_IND" }, + { MNCC_REJ_REQ, "MNCC_REJ_REQ" }, + { MNCC_REJ_IND, "MNCC_REJ_IND" }, + { MNCC_BRIDGE, "MNCC_BRIDGE" }, + { MNCC_FRAME_RECV, "MNCC_FRAME_RECV" }, + { MNCC_FRAME_DROP, "MNCC_FRAME_DROP" }, + { MNCC_LCHAN_MODIFY, "MNCC_LCHAN_MODIFY" }, + { MNCC_RTP_CREATE, "MNCC_RTP_CREATE" }, + { MNCC_RTP_CONNECT, "MNCC_RTP_CONNECT" }, + { MNCC_RTP_FREE, "MNCC_RTP_FREE" }, + { GSM_TCHF_FRAME, "GSM_TCHF_FRAME" }, + { GSM_TCHF_FRAME_EFR, "GSM_TCHF_FRAME_EFR" }, + { GSM_TCHH_FRAME, "GSM_TCHH_FRAME" }, + { GSM_TCH_FRAME_AMR, "GSM_TCH_FRAME_AMR" }, + { GSM_BAD_FRAME, "GSM_BAD_FRAME" }, + { MNCC_SOCKET_HELLO, "MNCC_SOCKET_HELLO" }, + { 0, NULL }, +}; + +static inline const char *osmo_mncc_name(uint32_t msg_type) { + return get_value_string(osmo_mncc_names, msg_type); +} + +static void mncc_dump_rtp(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_rtp *rtp = (const struct gsm_mncc_rtp *) msg; + struct in_addr ia; + if (len < sizeof(*rtp)) { + msgb_printf(str, "short MNCC RTP message (%u bytes)", len); + return; + } + + ia.s_addr = rtp->ip; + msgb_printf(str, "%s(ref=0x%08x, ip=%s, port=%u, pt=%u, pt_mt=%u)", + osmo_mncc_name(rtp->msg_type), rtp->callref, inet_ntoa(ia), + ntohs(rtp->port), rtp->payload_type, rtp->payload_msg_type); +} + +static void mncc_dump_data(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_data_frame *data = (const struct gsm_data_frame *) msg; + if (len < sizeof(*data)) { + msgb_printf(str, "short MNCC DATA message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ref=0x%08x, data=%s)", osmo_mncc_name(data->msg_type), data->callref, + osmo_hexdump_nospc(data->data, len - sizeof(*data))); +} + +static void mncc_dump_hello(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_hello *hello = (const struct gsm_mncc_hello *) msg; + if (len < sizeof(*hello)) { + msgb_printf(str, "short MNCC HELLO message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ver=%u, mncc_sz=%u, data_size=%u called_off=%u, signal_off=%u, " + "emerg_off=%u, lchan_t_off=%u)\n", osmo_mncc_name(hello->msg_type), + hello->version, hello->mncc_size, hello->data_frame_size, hello->called_offset, + hello->signal_offset, hello->emergency_offset, hello->lchan_type_offset); +} + +static void msg_dump_number(struct msgb *str, const char *pfx, const struct gsm_mncc_number *num) +{ + msgb_printf(str, "%s(%d,%d,%d,%d,%s)", pfx, num->type, num->plan, num->present, num->screen, + num->number); +} + +static void mncc_dump_bridge(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_bridge *bridge = (const struct gsm_mncc_bridge *)msg; + if (len < sizeof(*bridge)) { + msgb_printf(str, "short MNCC BRIDGE message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(call_a=0x%08x, call_b=0x%08x)", osmo_mncc_name(bridge->msg_type), + bridge->callref[0], bridge->callref[1]); +} + +static void mncc_dump_sign(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc *sign = (const struct gsm_mncc *) msg; + if (len < sizeof(*sign)) { + msgb_printf(str, "short MNCC SIGN message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ref=0x%08x, imsi=%s", osmo_mncc_name(sign->msg_type), sign->callref, + sign->imsi); + //if (sign->fields & MNCC_F_BEARER_CAP) + // msgb_printf(str, ", bcap=%s", osmo_hexdump_nospc()); + if (sign->fields & MNCC_F_CALLED) + msg_dump_number(str, ", called=", &sign->called); + if (sign->fields & MNCC_F_CALLING) + msg_dump_number(str, ", calling=", &sign->calling); + if (sign->fields & MNCC_F_REDIRECTING) + msg_dump_number(str, ", redirecting=", &sign->redirecting); + if (sign->fields & MNCC_F_CONNECTED) + msg_dump_number(str, ", connected=", &sign->connected); + if (sign->fields & MNCC_F_CAUSE) { + msgb_printf(str, ", cause=(%d,%d,%d,%d,%d,'%s')", sign->cause.location, + sign->cause.coding, sign->cause.rec, sign->cause.rec_val, + sign->cause.value, sign->cause.diag_len ? sign->cause.diag : ""); + } + if (sign->fields & MNCC_F_USERUSER) { + msgb_printf(str, ", useruser=(%u, '%s')", sign->useruser.proto, + sign->useruser.info); + } + if (sign->fields & MNCC_F_PROGRESS) { + msgb_printf(str, ", progress=(%d, %d, %d)", sign->progress.coding, + sign->progress.location, sign->progress.descr); + } + if (sign->fields & MNCC_F_EMERGENCY) + msgb_printf(str, ", emergency=%d", sign->emergency); + if (sign->fields & MNCC_F_FACILITY) + msgb_printf(str, ", facility='%s'", sign->facility.info); + if (sign->fields & MNCC_F_SSVERSION) + msgb_printf(str, ", ssversion='%s'", sign->ssversion.info); + if (sign->fields & MNCC_F_CCCAP) + msgb_printf(str, ", cccap=(%d, %d)", sign->cccap.dtmf, sign->cccap.pcp); + if (sign->fields & MNCC_F_KEYPAD) + msgb_printf(str, ", keypad=%d", sign->keypad); + if (sign->fields & MNCC_F_SIGNAL) + msgb_printf(str, ", signal=%d", sign->signal); + + msgb_printf(str, ", clir.sup=%d, clir.inv=%d, more=%d, notify=%d)", sign->clir.sup, + sign->clir.inv, sign->more, sign->notify); + /* lchan_type/lchan_mode? */ +} + + +struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len) +{ + uint32_t msg_type; + struct msgb *str = msgb_alloc(2048, __func__); + + OSMO_ASSERT(str); + + if (len <= sizeof(msg_type)) { + msgb_printf(str, "short MNCC message (%d bytes)", len); + return NULL; + } + + msg_type = *(const uint32_t *)msg; + switch (msg_type) { + case MNCC_RTP_CREATE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_FREE: + mncc_dump_rtp(str, msg, len); + break; + case GSM_TCHF_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHH_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_BAD_FRAME: + mncc_dump_data(str, msg, len); + break; + case MNCC_SOCKET_HELLO: + mncc_dump_hello(str, msg, len); + break; + case MNCC_BRIDGE: + mncc_dump_bridge(str, msg, len); + break; + default: + mncc_dump_sign(str, msg, len); + break; + } + return str; +} + +void _osmo_mncc_log(int ss, int level, const char *file, int line, const char *prefix, + const uint8_t *msg, unsigned int len) +{ + struct msgb *str; + if (!log_check_level(ss, level)) + return; + + str = osmo_mncc_stringify(msg, len); + if (!str) + return; + + logp2(ss, level, file, line, 0, "%s%s\n", prefix, str->data); + msgb_free(str); +} -- To view, visit https://gerrit.osmocom.org/5625 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 2 07:20:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:20:49 +0000 Subject: pysim[master]: utils.py: dec_imsi: Fix ValueError In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5623 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7d3ecbf9edd190d1941816796cee60e3957d5943 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 2 07:20:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:20:57 +0000 Subject: [MERGED] pysim[master]: utils.py: dec_imsi: Fix ValueError In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: utils.py: dec_imsi: Fix ValueError ...................................................................... utils.py: dec_imsi: Fix ValueError It should fix the following observed error: ~/pysim$ ./pySim-read.py -p0 Reading ... ICCID: Traceback (most recent call last): File "./pySim-read.py", line 99, in print("IMSI: %s" % (dec_imsi(res),)) File "/home/lab434/pysim/pySim/utils.py", line 57, in dec_imsi l = int(ef[0:2]) * 2 # Length of the IMSI string ValueError: invalid literal for int() with base 10: 'ff' Change-Id: I7d3ecbf9edd190d1941816796cee60e3957d5943 --- M pySim/utils.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/pySim/utils.py b/pySim/utils.py index 011bd05..84b613f 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -54,7 +54,7 @@ """Converts an EF value to the imsi string representation""" if len(ef) < 4: return None - l = int(ef[0:2]) * 2 # Length of the IMSI string + l = int(ef[0:2], 16) * 2 # Length of the IMSI string swapped = swap_nibbles(ef[2:]) oe = (int(swapped[0])>>3) & 1 # Odd (1) / Even (0) if oe: -- To view, visit https://gerrit.osmocom.org/5623 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7d3ecbf9edd190d1941816796cee60e3957d5943 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 2 07:22:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:22:09 +0000 Subject: osmo-iuh[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90ca756691e4f644d93af519ed5d54d794d1d401 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 2 07:22:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:22:13 +0000 Subject: [MERGED] osmo-iuh[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Enable sanitize for CI tests ...................................................................... Enable sanitize for CI tests Change-Id: I90ca756691e4f644d93af519ed5d54d794d1d401 --- 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 01e3da2..c739f7f 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -34,7 +34,7 @@ set -x autoreconf --install --force -./configure +./configure --enable-sanitize # Verify that checked-in asn1 code is identical to regenerated asn1 code PATH="$inst/bin:$PATH" $MAKE $PARALLEL_MAKE -C src regen -- To view, visit https://gerrit.osmocom.org/5603 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90ca756691e4f644d93af519ed5d54d794d1d401 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 2 07:23:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:23:17 +0000 Subject: python/osmo-python-tests[master]: Improve python3 compatibility In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121 Gerrit-PatchSet: 8 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 2 07:25:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:25:28 +0000 Subject: osmo-pcu[master]: TBF: bail out for unknown timers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6ae564d41a5e03270685c6bafb3504278eb3551 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 Tue Jan 2 07:25:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:25:52 +0000 Subject: osmo-pcu[master]: TBF: unify timer handling In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63fb7e6f0695383a83472c836a381a055f64690b 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 Tue Jan 2 07:26:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:26:06 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: unify timer handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: unify timer handling ...................................................................... TBF: unify timer handling Use generic timer handling infrastracture to handle assignment/reject internal timer. Rename timer array accordingly. Use defines with explicit second/microsecond values to make it more readable. Change-Id: I63fb7e6f0695383a83472c836a381a055f64690b --- M src/bts.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp 4 files changed, 32 insertions(+), 68 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 3655567..d0ba768 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -554,7 +554,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Got IMM.ASS confirm for TLLI=%08x\n", tlli); if (dl_tbf->m_wait_confirm) - tbf_timer_start(dl_tbf, 0, Tassign_agch, "assignment (AGCH)"); + dl_tbf->t_start(T0, 0, T_ASS_AGCH_USEC, "assignment (AGCH)", true); return 0; } @@ -1041,7 +1041,7 @@ } new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ - new_tbf->stop_timer("control acked (DL-TBF)"); + new_tbf->t_stop(T0, "control acked (DL-TBF)"); if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { new_tbf->state_flags &= diff --git a/src/tbf.cpp b/src/tbf.cpp index dc0777f..ea27597 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -60,6 +60,7 @@ }; static const struct value_string tbf_timers_names[] = { + OSMO_VALUE_STRING(T0), OSMO_VALUE_STRING(T3169), OSMO_VALUE_STRING(T3191), OSMO_VALUE_STRING(T3193), @@ -170,7 +171,6 @@ poll_fn(0), poll_ts(0), n3105(0), - T(0), fT(0), num_fT_exp(0), state(GPRS_RLCMAC_NULL), @@ -191,8 +191,7 @@ /* The classes of these members do not have proper constructors yet. * Just set them to 0 like talloc_zero did */ memset(&pdch, 0, sizeof(pdch)); - memset(&timer, 0, sizeof(timer)); - memset(&T31, 0, sizeof(T31)); + memset(&T, 0, sizeof(T)); memset(&m_rlc, 0, sizeof(m_rlc)); memset(&gsm_timer, 0, sizeof(gsm_timer)); @@ -472,7 +471,7 @@ "be sure not to free in this state. PLEASE FIX!\n", get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, tbf->dl_ass_state)); - tbf->stop_timer("freeing TBF"); + tbf->stop_timers("freeing TBF"); /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); @@ -538,27 +537,6 @@ "RELEASING", }; -void tbf_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int T, - unsigned int seconds, unsigned int microseconds, const char *reason) -{ - LOGPC(DRLCMAC, (T != tbf->T) ? LOGL_ERROR : LOGL_DEBUG, - "%s %sstarting timer T%u [%s] with %u sec. %u microsec.", - tbf_name(tbf), osmo_timer_pending(&tbf->timer) ? "re" : "", T, reason, seconds, microseconds); - - if (T != tbf->T && osmo_timer_pending(&tbf->timer)) - LOGPC(DRLCMAC, LOGL_ERROR, " while old timer T%u pending", tbf->T); - - LOGPC(DRLCMAC, (T != tbf->T) ? LOGL_ERROR : LOGL_DEBUG, "\n"); - - tbf->T = T; - - /* Tunning timers can be safely re-scheduled. */ - tbf->timer.data = tbf; - tbf->timer.cb = &tbf_timer_cb; - - osmo_timer_schedule(&tbf->timer, seconds, microseconds); -} - void gprs_rlcmac_tbf::t_stop(enum tbf_timers t, const char *reason) { if (t >= T_MAX) { @@ -579,10 +557,11 @@ uint8_t i; if (t != T_MAX) - return osmo_timer_pending(&T31[t]); + return osmo_timer_pending(&T[t]); + /* we don't start with T0 because it's internal timer which requires special handling */ for (i = T3169; i < T_MAX; i++) - if (osmo_timer_pending(&T31[i])) + if (osmo_timer_pending(&T[i])) return true; return false; @@ -591,17 +570,9 @@ void gprs_rlcmac_tbf::stop_timers(const char *reason) { uint8_t i; - for (i = 0; i < T_MAX; i++) + /* we start with T0 because timer reset does not require any special handling */ + for (i = T0; i < T_MAX; i++) t_stop((enum tbf_timers)i, reason); -} - -void gprs_rlcmac_tbf::stop_timer(const char *reason) -{ - if (osmo_timer_pending(&timer)) { - LOGPTBF(this, LOGL_DEBUG, "stopping timer T%u [%s]\n", - T, reason); - osmo_timer_del(&timer); - } } static inline void tbf_timeout_free(struct gprs_rlcmac_tbf *tbf, enum tbf_timers t, bool run_diag) @@ -629,33 +600,36 @@ get_value_string(tbf_timers_names, t), reason); } - if (!force && osmo_timer_pending(&T31[t])) + if (!force && osmo_timer_pending(&T[t])) return; LOGPTBF(this, LOGL_DEBUG, "%sstarting timer %s [%s] with %u sec. %u microsec.\n", - osmo_timer_pending(&T31[t]) ? "re" : "", get_value_string(tbf_timers_names, t), reason, sec, microsec); + osmo_timer_pending(&T[t]) ? "re" : "", get_value_string(tbf_timers_names, t), reason, sec, microsec); - T31[t].data = this; + T[t].data = this; switch(t) { + case T0: + T[t].cb = tbf_timer_cb; + break; case T3169: - T31[t].cb = cb_T3169; + T[t].cb = cb_T3169; break; case T3191: - T31[t].cb = cb_T3191; + T[t].cb = cb_T3191; break; case T3193: - T31[t].cb = cb_T3193; + T[t].cb = cb_T3193; break; case T3195: - T31[t].cb = cb_T3195; + T[t].cb = cb_T3195; break; default: LOGPTBF(this, LOGL_ERROR, "attempting to set callback for unknown timer %s [%s]\n", get_value_string(tbf_timers_names, t), reason); } - osmo_timer_schedule(&T31[t], sec, microsec); + osmo_timer_schedule(&T[t], sec, microsec); } int gprs_rlcmac_tbf::check_polling(uint32_t fn, uint8_t ts, @@ -1102,12 +1076,7 @@ void gprs_rlcmac_tbf::handle_timeout() { - LOGPTBF(this, LOGL_DEBUG, "timer %u expired.\n", T); - - if (T) { - LOGPTBF(this, LOGL_ERROR, "%s timer expired in unknown mode: %u\n", T); - return; - } + LOGPTBF(this, LOGL_DEBUG, "timer 0 expired.\n"); /* assignment */ if ((state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) { @@ -1267,7 +1236,7 @@ new_dl_tbf->set_state(GPRS_RLCMAC_FLOW); tbf_assign_control_ts(new_dl_tbf); /* stop pending assignment timer */ - new_dl_tbf->stop_timer("assignment (DL-TBF)"); + new_dl_tbf->t_stop(T0, "assignment (DL-TBF)"); } @@ -1297,7 +1266,7 @@ /* Start Tmr only if it is UL TBF */ if (direction == GPRS_RLCMAC_UL_TBF) - tbf_timer_start(this, 0, Treject_pacch, "reject (PACCH)"); + t_start(T0, 0, T_REJ_PACCH_USEC, "reject (PACCH)", true); return msg; diff --git a/src/tbf.h b/src/tbf.h index 4489695..88f5d6a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -39,9 +39,9 @@ * TBF instance */ -#define Tassign_agch 0,200000 /* waiting after IMM.ASS confirm */ -#define Tassign_pacch 2,0 /* timeout for pacch assigment */ -#define Treject_pacch 0,2000 /* timeout for tbf reject for PRR*/ +#define T_ASS_AGCH_USEC 200000 /* waiting after IMM.ASS confirm */ +#define T_ASS_PACCH_SEC 2 /* timeout for pacch assigment */ +#define T_REJ_PACCH_USEC 2000 /* timeout for tbf reject for PRR*/ enum gprs_rlcmac_tbf_state { GPRS_RLCMAC_NULL = 0, /* new created TBF */ @@ -139,6 +139,9 @@ #define LOGPTBFDL(tbf, level, fmt, args...) LOGP(DRLCMACDL, level, "%s " fmt, tbf_name(tbf), ## args) enum tbf_timers { + /* internal assign/reject timer */ + T0, + /* Wait for reuse of USF and TFI(s) after the MS uplink assignment for this TBF is invalid. */ T3169, @@ -194,7 +197,6 @@ int update(); void handle_timeout(); - void stop_timer(const char *reason); void stop_timers(const char *reason); bool timers_pending(enum tbf_timers t); void t_stop(enum tbf_timers t, const char *reason); @@ -266,9 +268,6 @@ gprs_rlc m_rlc; uint8_t n3105; /* N3105 counter */ - - struct osmo_timer_list timer; - unsigned int T; /* Txxxx number */ struct osmo_gsm_timer_list gsm_timer; unsigned int fT; /* fTxxxx number */ @@ -328,7 +327,7 @@ LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; - struct osmo_timer_list T31[T_MAX]; + struct osmo_timer_list T[T_MAX]; mutable char m_name_buf[60]; }; @@ -351,9 +350,6 @@ GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); - -void tbf_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int T, - unsigned int seconds, unsigned int microseconds, const char *reason); inline bool gprs_rlcmac_tbf::state_is(enum gprs_rlcmac_tbf_state rhs) const { diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b043989..33eb75b 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -484,7 +484,6 @@ void gprs_rlcmac_dl_tbf::trigger_ass(struct gprs_rlcmac_tbf *old_tbf) { /* stop pending timer */ - stop_timer("assignment (DL-TBF)"); stop_timers("assignment (DL-TBF)"); /* check for downlink tbf: */ @@ -499,7 +498,7 @@ state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); /* start timer */ - tbf_timer_start(this, 0, Tassign_pacch, "assignment (PACCH)"); + t_start(T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); } else { LOGPTBFDL(this, LOGL_DEBUG, "Send dowlink assignment on PCH, no TBF exist (IMSI=%s)\n", imsi()); -- To view, visit https://gerrit.osmocom.org/5234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63fb7e6f0695383a83472c836a381a055f64690b Gerrit-PatchSet: 5 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 Tue Jan 2 07:26:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:26:06 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: bail out for unknown timers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: bail out for unknown timers ...................................................................... TBF: bail out for unknown timers Return right after logging error if attempting to start or stop unknown timer. Change-Id: Ie6ae564d41a5e03270685c6bafb3504278eb3551 Fixes: CID181512, CID181514 --- M src/tbf.cpp 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf.cpp b/src/tbf.cpp index 520f6c4..aec67e7 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -543,6 +543,7 @@ if (t >= T_MAX) { LOGPTBF(this, LOGL_ERROR, "attempting to stop unknown timer %s [%s]\n", get_value_string(tbf_timers_names, t), reason); + return; } if (osmo_timer_pending(&T[t])) { @@ -600,6 +601,7 @@ if (t >= T_MAX) { LOGPSRC(DRLCMAC, LOGL_ERROR, file, line, "%s attempting to start unknown timer %s [%s]\n", tbf_name(this), get_value_string(tbf_timers_names, t), reason); + return; } if (!force && osmo_timer_pending(&T[t])) -- To view, visit https://gerrit.osmocom.org/5547 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6ae564d41a5e03270685c6bafb3504278eb3551 Gerrit-PatchSet: 2 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 Tue Jan 2 07:26:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 2 Jan 2018 07:26:06 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: log timer invocation source In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: log timer invocation source ...................................................................... TBF: log timer invocation source When troubleshooting TBF timers we're not only interested in timer duration but also in the code which triggered it. Let's use LOGPSRC to log it: wrap t_start() in a macro for convenience. Change-Id: If5f883ae52c469e5158bad24da9904fdc455582f Related: OS#2407 --- 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, 29 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index d0ba768..4bc792a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -554,7 +554,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Got IMM.ASS confirm for TLLI=%08x\n", tlli); if (dl_tbf->m_wait_confirm) - dl_tbf->t_start(T0, 0, T_ASS_AGCH_USEC, "assignment (AGCH)", true); + T_START(dl_tbf, T0, 0, T_ASS_AGCH_USEC, "assignment (AGCH)", true); return 0; } @@ -687,7 +687,7 @@ tbf->set_ta(ta); tbf->set_state(GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - tbf->t_start(T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); + T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] RACH " "qbit-ta=%d ra=0x%02x, Fn=%d " diff --git a/src/tbf.cpp b/src/tbf.cpp index ea27597..520f6c4 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -35,6 +35,7 @@ #include #include #include +#include } #include @@ -403,7 +404,7 @@ tbf->m_contention_resolution_done = 1; tbf->set_state(GPRS_RLCMAC_ASSIGN); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - tbf->t_start(T3169, bts->t3169, 0, "allocation (UL-TBF)", true); + T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -544,10 +545,10 @@ get_value_string(tbf_timers_names, t), reason); } - if (osmo_timer_pending(&T31[t])) { + if (osmo_timer_pending(&T[t])) { LOGPTBF(this, LOGL_DEBUG, "stopping timer %s [%s]\n", get_value_string(tbf_timers_names, t), reason); - osmo_timer_del(&T31[t]); + osmo_timer_del(&T[t]); } } @@ -593,18 +594,20 @@ T_CBACK(T3193, false) T_CBACK(T3195, true) -void gprs_rlcmac_tbf::t_start(enum tbf_timers t, uint32_t sec, uint32_t microsec, const char *reason, bool force) +void gprs_rlcmac_tbf::t_start(enum tbf_timers t, uint32_t sec, uint32_t microsec, const char *reason, bool force, + const char *file, unsigned line) { if (t >= T_MAX) { - LOGPTBF(this, LOGL_ERROR, "attempting to start unknown timer %s [%s]\n", - get_value_string(tbf_timers_names, t), reason); + LOGPSRC(DRLCMAC, LOGL_ERROR, file, line, "%s attempting to start unknown timer %s [%s]\n", + tbf_name(this), get_value_string(tbf_timers_names, t), reason); } if (!force && osmo_timer_pending(&T[t])) return; - LOGPTBF(this, LOGL_DEBUG, "%sstarting timer %s [%s] with %u sec. %u microsec.\n", - osmo_timer_pending(&T[t]) ? "re" : "", get_value_string(tbf_timers_names, t), reason, sec, microsec); + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s %sstarting timer %s [%s] with %u sec. %u microsec.\n", + tbf_name(this), osmo_timer_pending(&T[t]) ? "re" : "", + get_value_string(tbf_timers_names, t), reason, sec, microsec); T[t].data = this; @@ -625,8 +628,8 @@ T[t].cb = cb_T3195; break; default: - LOGPTBF(this, LOGL_ERROR, "attempting to set callback for unknown timer %s [%s]\n", - get_value_string(tbf_timers_names, t), reason); + LOGPSRC(DRLCMAC, LOGL_ERROR, file, line, "%s attempting to set callback for unknown timer %s [%s]\n", + tbf_name(this), get_value_string(tbf_timers_names, t), reason); } osmo_timer_schedule(&T[t], sec, microsec); @@ -719,7 +722,7 @@ if (m_n3101 == bts->bts_data()->n3101) { LOGP(DRLCMAC, LOGL_NOTICE, " N3101 exceeded MAX (%u)\n", bts->bts_data()->n3101); set_state(GPRS_RLCMAC_RELEASING); - t_start(T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); + T_START(this, T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); return; } @@ -737,7 +740,7 @@ "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); - ul_tbf->t_start(T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); + T_START(ul_tbf, T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); return; } /* reschedule UL ack */ @@ -759,7 +762,7 @@ if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); - t_start(T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); + T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pua_poll_failed(); return; @@ -781,7 +784,7 @@ if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); - t_start(T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); + T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pda_poll_failed(); return; @@ -807,7 +810,7 @@ if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); - dl_tbf->t_start(T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); + T_START(dl_tbf, T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; @@ -1266,7 +1269,7 @@ /* Start Tmr only if it is UL TBF */ if (direction == GPRS_RLCMAC_UL_TBF) - t_start(T0, 0, T_REJ_PACCH_USEC, "reject (PACCH)", true); + T_START(this, T0, 0, T_REJ_PACCH_USEC, "reject (PACCH)", true); return msg; diff --git a/src/tbf.h b/src/tbf.h index 88f5d6a..40ed974 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -169,6 +169,8 @@ #define GPRS_RLCMAC_FLAG_TO_DL_ASS 7 #define GPRS_RLCMAC_FLAG_TO_MASK 0xf0 /* timeout bits */ +#define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) + struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -200,7 +202,8 @@ void stop_timers(const char *reason); bool timers_pending(enum tbf_timers t); void t_stop(enum tbf_timers t, const char *reason); - void t_start(enum tbf_timers t, uint32_t sec, uint32_t microsec, const char *reason, bool force); + void t_start(enum tbf_timers t, uint32_t sec, uint32_t microsec, const char *reason, bool force, + const char *file, unsigned line); int establish_dl_tbf_on_pacch(); int check_polling(uint32_t fn, uint8_t ts, diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 33eb75b..84f6166 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -498,7 +498,7 @@ state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); /* start timer */ - t_start(T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); + T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); } else { LOGPTBFDL(this, LOGL_DEBUG, "Send dowlink assignment on PCH, no TBF exist (IMSI=%s)\n", imsi()); @@ -854,7 +854,7 @@ m_tx_counter = 0; /* start timer whenever we send the final block */ if (is_final) - t_start(T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true); + T_START(this, T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true); clear_poll_timeout_flag(); @@ -1116,7 +1116,7 @@ set_state(GPRS_RLCMAC_WAIT_RELEASE); /* start T3193 */ - t_start(T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, + T_START(this, T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, "release (DL-TBF)", true); /* reset rlc states */ diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 8e4e57e..45de7cd 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -191,7 +191,7 @@ unsigned int block_idx; /* restart T3169 */ - t_start(T3169, bts_data()->t3169, 0, "acked (data)", true); + T_START(this, T3169, bts_data()->t3169, 0, "acked (data)", true); /* Increment RX-counter */ this->m_rx_counter++; -- To view, visit https://gerrit.osmocom.org/5208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5f883ae52c469e5158bad24da9904fdc455582f Gerrit-PatchSet: 4 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 Tue Jan 2 11:53:30 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 2 Jan 2018 11:53:30 +0000 Subject: [PATCH] osmo-bsc[master]: Remove obsolete ./configure option 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/5605 to look at the new patch set (#2). Remove obsolete ./configure option The '--enable-vty-tests' is just alias to '--enable-external-tests' anyway. Change-Id: I9492d8e988b464aa41f572611cbf2461bb8be3eb --- M README.vty-tests M configure.ac M contrib/jenkins.sh 3 files changed, 2 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5605/2 diff --git a/README.vty-tests b/README.vty-tests index ba1b87c..0669ea8 100644 --- a/README.vty-tests +++ b/README.vty-tests @@ -4,7 +4,7 @@ and pass the following configure options here: - ./configure --enable-vty-tests --enable-external-tests + ./configure --enable-external-tests The VTY tests are then included in the standard check target: diff --git a/configure.ac b/configure.ac index 433e3bf..d756970 100644 --- a/configure.ac +++ b/configure.ac @@ -122,11 +122,6 @@ CPPFLAGS="$CPPFLAGS -pg" fi -AC_ARG_ENABLE([vty_tests], - AC_HELP_STRING([--enable-vty-tests], - [Include the VTY/CTRL tests in make check (deprecated) - [default=no]]), - [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) AC_ARG_ENABLE([external_tests], AC_HELP_STRING([--enable-external-tests], [Include the VTY/CTRL tests in make check [default=no]]), diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 873d1a5..5b57532 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -40,7 +40,7 @@ cd "$base" autoreconf --install --force -./configure --enable-sanitize --enable-vty-tests --enable-external-tests +./configure --enable-sanitize --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/5605 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9492d8e988b464aa41f572611cbf2461bb8be3eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 2 13:25:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 2 Jan 2018 13:25:48 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5367 to look at the new patch set (#3). TBF: cleanup state flag handling * introduce generic function to check whether particular flag was set for'a TBF and clear it if necessary. Use this instead of clear_poll_timeout_flag() * add function to explicitly set assignment and appropriate state flags Overall this makes the code easier to read and debug. Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 --- 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, 36 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/5367/3 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..892ce19 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1031,7 +1031,7 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { /* We now know that the PACCH really existed */ LOGPTBF(new_tbf, LOGL_INFO, "The TBF has been confirmed on the PACCH, " @@ -1042,12 +1042,9 @@ new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - } + tbf_assign_control_ts(new_tbf); return; } @@ -1068,12 +1065,9 @@ 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 (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - } + tbf_assign_control_ts(new_tbf); /* there might be LLC packets waiting in the queue, but the DL * TBF might have been released while the UL TBF has been diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..625181f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,8 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -1511,8 +1510,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); + ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); 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 40ed974..26dce72 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,8 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state); + bool check_n_clear(uint8_t state_flag); + void set_assigned_on(uint8_t state_flag, bool check_ccch); const char *state_name() const; const char *name() const; @@ -371,12 +373,33 @@ return tbf_state_name[state]; } +/* Set assignment state and corrsponding flags */ +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +{ + set_state(GPRS_RLCMAC_ASSIGN); + if (check_ccch) { + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + state_flags |= (1 << state_flag); + } else + state_flags |= (1 << state_flag); +} + inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) { LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; +} + +inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) +{ + if ((state_flags & (1 << state_flag))) { + state_flags &= ~(1 << state_flag); + return true; + } + + return false; } inline LListHead& gprs_rlcmac_tbf::list() @@ -454,7 +477,7 @@ int rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn, struct bitvec *rbb); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); void trigger_ass(struct gprs_rlcmac_tbf *old_tbf); - void clear_poll_timeout_flag(); + bool handle_ack_nack(); void request_dl_ack(); bool need_control_ts() const; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 84f6166..c0ee806 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,9 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -505,8 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -634,18 +631,12 @@ return bsn; } -void gprs_rlcmac_dl_tbf::clear_poll_timeout_flag() -{ - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); -} - bool gprs_rlcmac_dl_tbf::handle_ack_nack() { bool ack_recovered = false; state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - clear_poll_timeout_flag(); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ACK)) { ack_recovered = true; } @@ -856,7 +847,7 @@ if (is_final) T_START(this, T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true); - clear_poll_timeout_flag(); + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); /* clear poll timeout flag */ /* Clear request flag */ m_dl_ack_requested = false; diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 45de7cd..6442b8f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -96,10 +96,8 @@ bool gprs_rlcmac_ul_tbf::ctrl_ack_to_toggle() { - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ACK)) return true; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was set, now cleared */ - } state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); return false; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was unset, now set */ -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 3 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 Tue Jan 2 13:39:09 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 2 Jan 2018 13:39:09 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: log source of state transitions 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/5209 to look at the new patch set (#3). TBF: log source of state transitions We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#2407 --- 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.cpp 6 files changed, 24 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/5209/3 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..60dc285 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -685,7 +685,7 @@ failure = true; } else { tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); @@ -1039,7 +1039,7 @@ new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); if ((new_tbf->state_flags & @@ -1067,7 +1067,7 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { new_tbf->state_flags &= diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..3f9ca70 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,7 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(tbf, GPRS_RLCMAC_ASSIGN); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); @@ -723,7 +723,7 @@ m_n3101++; if (m_n3101 == bts->bts_data()->n3101) { LOGP(DRLCMAC, LOGL_NOTICE, " N3101 exceeded MAX (%u)\n", bts->bts_data()->n3101); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); return; } @@ -741,7 +741,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); - ul_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_RELEASING); T_START(ul_tbf, T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); return; } @@ -763,7 +763,7 @@ bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pua_poll_failed(); @@ -785,7 +785,7 @@ bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pda_poll_failed(); @@ -811,7 +811,7 @@ } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - dl_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_RELEASING); T_START(dl_tbf, T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); @@ -1102,7 +1102,7 @@ if (!dl_tbf->upgrade_to_multislot) { /* change state to FLOW, so scheduler * will start transmission */ - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); return; } @@ -1238,7 +1238,7 @@ 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); + TBF_SET_STATE(new_dl_tbf, GPRS_RLCMAC_FLOW); tbf_assign_control_ts(new_dl_tbf); /* stop pending assignment timer */ new_dl_tbf->t_stop(T0, "assignment (DL-TBF)"); @@ -1511,7 +1511,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); - ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); ul_tbf->set_ms(ms); diff --git a/src/tbf.h b/src/tbf.h index 40ed974..9d932fe 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -171,6 +171,8 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) +#define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) + struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -179,7 +181,7 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; - void set_state(enum gprs_rlcmac_tbf_state new_state); + void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); const char *state_name() const; const char *name() const; @@ -371,9 +373,9 @@ return tbf_state_name[state]; } -inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) +inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line) { - LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 84f6166..080e778 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,7 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(this, GPRS_RLCMAC_ASSIGN); if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); @@ -505,7 +505,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(this, GPRS_RLCMAC_ASSIGN); state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); /* send immediate assignment */ @@ -617,7 +617,7 @@ if (is_final) { request_dl_ack(); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); } /* dequeue next LLC frame, if any */ @@ -1113,7 +1113,7 @@ /* report all outstanding packets as received */ gprs_rlcmac_received_lost(this, received, 0); - set_state(GPRS_RLCMAC_WAIT_RELEASE); + TBF_SET_STATE(this, GPRS_RLCMAC_WAIT_RELEASE); /* start T3193 */ T_START(this, T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, @@ -1147,7 +1147,7 @@ * (partly) encoded in chunk 1 of block V(A). (optional) */ } - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); /* reset rlc states */ m_window.reset(); diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 45de7cd..d8f460e 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -332,7 +332,7 @@ if (rdbi->cv == 0) { LOGP(DRLCMACUL, LOGL_DEBUG, "- Finished with UL " "TBF\n"); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); /* Reset N3103 counter. */ this->m_n3103 = 0; } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 18bbc76..94986f5 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -176,7 +176,7 @@ /* "Establish" the DL TBF */ dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 2 15:59:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 2 Jan 2018 15:59:35 +0000 Subject: osmo-bsc[master]: Check and handle SMS encoding failure In-Reply-To: References: Message-ID: Patch Set 2: > The imsi and/or tmsi would be nice. Also the field which is broken from/dest. Sorry, somehow missed it. Yes, would be nice indeed. Feel free to send follow-up patch with further log clarifications. -- To view, visit https://gerrit.osmocom.org/5615 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9fc16e24f7df5ebad6f4f1b389b2c5e861be95d7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: daniel Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 2 18:00:13 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 2 Jan 2018 18:00:13 +0000 Subject: libosmocore[master]: coding: move eB adjustement to appropriate place In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5614 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 03:09:25 2018 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Jan 2018 03:09:25 +0000 Subject: osmocom-bb[master]: mobile/gsm48_rr.c: fix ACCH System Information parsing In-Reply-To: References: Message-ID: Patch Set 3: Hi Vadim, Harald, >From captures taken from live networks it seems that SI5, SI5ter, SI5bis and SI6 messages actually do contain an L2 pseudo header. Here is one pcap from the redmine https://osmocom.org/attachments/download/2191/layer23-lapdm-gsmtap.pcap Here is a bug reported in Wireshark https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14105 And it is stated in "3GPP TS 04.08 version 7.21.0 Release 1998" http://www.etsi.org/deliver/etsi_ts/100900_100999/100940/07.21.00_60/ts_100940v072100p.pdf 9.1.37 System information type 5 ... This message has a L2 Pseudo Length of 18. 9.1.40 System information type 6 ... This message has a L2 Pseudo Length of 11. Thanks for looking into this. -- To view, visit https://gerrit.osmocom.org/5204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9166996f146af7973bf02a8a1c965581dc58a4a5 Gerrit-PatchSet: 3 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: Vasil Velichkov Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 09:11:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Jan 2018 09:11:38 +0000 Subject: osmocom-bb[master]: mobile/gsm48_rr.c: fix ACCH System Information parsing In-Reply-To: References: Message-ID: Patch Set 3: Hi, please have a look: http://lists.osmocom.org/pipermail/baseband-devel/2017-December/005459.html -- To view, visit https://gerrit.osmocom.org/5204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9166996f146af7973bf02a8a1c965581dc58a4a5 Gerrit-PatchSet: 3 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: Vasil Velichkov Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 11:03:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 11:03:01 +0000 Subject: [PATCH] osmo-pcu[master]: Fix llc_queue_size() type Message-ID: Review at https://gerrit.osmocom.org/5626 Fix llc_queue_size() type It either returns 0 or LLC queue size() which has size_t return type. This means it can never be negative - hence it's better to use size_t as return type. Change-Id: I2a6e849d349ab12854976bd0d68537a370a9c83d Fixes: CID181478 --- M src/tbf.cpp M src/tbf.h 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/26/5626/1 diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..9c1dac9 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -298,7 +298,7 @@ return m_ms ? m_ms->llc_queue() : NULL; } -int gprs_rlcmac_tbf::llc_queue_size() const +size_t gprs_rlcmac_tbf::llc_queue_size() const { /* m_ms->llc_queue() never returns NULL: GprsMs::m_llc_queue is a * member instance. */ diff --git a/src/tbf.h b/src/tbf.h index 40ed974..4a304af 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -228,7 +228,7 @@ uint8_t ms_class() const; void set_ms_class(uint8_t); GprsCodingScheme current_cs() const; - int llc_queue_size() const; + size_t llc_queue_size() const; time_t created_ts() const; uint8_t dl_slots() const; -- To view, visit https://gerrit.osmocom.org/5626 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2a6e849d349ab12854976bd0d68537a370a9c83d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 3 13:13:36 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 3 Jan 2018 13:13:36 +0000 Subject: [PATCH] osmo-bsc[master]: Fix "CTRL GET msc_connection_status" response. Message-ID: Review at https://gerrit.osmocom.org/5627 Fix "CTRL GET msc_connection_status" response. Since 39f62bbcbf4309492a6d5bc07213cd74f650d41e the msc_connection_status variable in osmo_bsc_ctrl.c is no longer updated. Query the connection's status from the is_connected flag in struct bsc_msc_connection instead. Makes test BSC_Tests.TC_ctrl_msc_connection_status in ttcn3-bsc-test pass. However, we only query the connection status of the first MSC. Adapting the control command to work with mulitple MSCs is left for future work. Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa Related: OS#2729 --- M src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/27/5627/1 diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 8c9dfe7..4460288 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -62,7 +62,10 @@ static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data) { - if (msc_connection_status) + struct gsm_network *gsmnet = data; + struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0); + + if (msc->msc_con->is_connected) cmd->reply = "connected"; else cmd->reply = "disconnected"; -- To view, visit https://gerrit.osmocom.org/5627 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Wed Jan 3 13:34:16 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 13:34:16 +0000 Subject: osmo-bsc[master]: Fix "CTRL GET msc_connection_status" response. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5627 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 14:08:56 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 14:08:56 +0000 Subject: [PATCH] libosmocore[master]: Add function to estimate elapsed time In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5103 to look at the new patch set (#5). Add function to estimate elapsed time * add function which uses monotonic clock for proper time estimation * add corresponding tests Change-Id: I83d865ff633a7ebda2c943477205fd31aceda277 Related: OS#2586 --- M TODO-RELEASE M include/osmocom/core/timer.h M src/timer.c M tests/timer/timer_test.c M tests/timer/timer_test.ok 5 files changed, 168 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/03/5103/5 diff --git a/TODO-RELEASE b/TODO-RELEASE index a5def79..82b2e34 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h +core osmo_time_elapsed() add function to estimate elapsed time diff --git a/include/osmocom/core/timer.h b/include/osmocom/core/timer.h index 4958efb..221709b 100644 --- a/include/osmocom/core/timer.h +++ b/include/osmocom/core/timer.h @@ -50,6 +50,31 @@ #define OSMO_SEC2HRS(sec) ((sec % (60 * 60 * 24)) / (60 * 60)) #define OSMO_SEC2DAY(sec) ((sec % (60 * 60 * 24 * 365)) / (60 * 60 * 24)) /* we ignore leap year for simplicity */ +#define OSMO_SEC2US(sec) (sec * 1000000) +#define OSMO_SEC2MS(sec) (sec * 1000) +#define OSMO_SEC2CS(sec) (sec * 100) + +#define OSMO_US2SEC(us) (us / 1000000) +#define OSMO_MS2SEC(ms) (ms / 1000) +#define OSMO_CS2SEC(cs) (cs / 100) + +#define OSMO_USEC2MS(us) (us / 1000) +#define OSMO_USEC2NS(us) (us * 1000) + +#define OSMO_NSEC2US(ns) (ns / 1000) +#define OSMO_NSEC2MS(ns) (ns / 1000000) +#define OSMO_NSEC2CS(ns) (ns / 10000000) + +/* how much time elapses between checks, in microsecs */ +#define OSMO_TIME_TEST_MAGIC 423210 + +enum osmo_elapsed { + T_SECS, + T_MILLIS, + T_CENTIS, + T_TEST +}; + /*! A structure representing a single instance of a timer */ struct osmo_timer_list { struct rb_node node; /*!< rb-tree node header */ @@ -61,6 +86,8 @@ void *data; /*!< user data for callback */ }; +time_t osmo_time_elapsed(const struct timespec *from, enum osmo_elapsed kind); + /* * timer management */ diff --git a/src/timer.c b/src/timer.c index 02160a1..75307c2 100644 --- a/src/timer.c +++ b/src/timer.c @@ -25,6 +25,7 @@ * */ +#include "config.h" /*! \addtogroup timer * @{ @@ -35,6 +36,10 @@ #include #include #include +#include +#include + +#include #include #include #include @@ -168,6 +173,62 @@ return 0; } +#if !defined(EMBEDDED) + +/* isolated nanoseconds clock difference */ +static inline long t_diff_nsec(const struct timespec *from, const struct timespec *to) +{ + return (from->tv_nsec > to->tv_nsec) ? (from->tv_nsec - to->tv_nsec) : (to->tv_nsec - from->tv_nsec); +} + +/* isolated seconds clock difference */ +static inline time_t t_diff_sec(const struct timespec *from, const struct timespec *to) +{ + return (from->tv_sec > to->tv_sec) ? difftime(from->tv_sec, to->tv_sec) : difftime(to->tv_sec, from->tv_sec); +} + +/*! Determine the time difference between now and the given time point + * \returns time difference + * + * \param[in] from timespec of a reference time point + * \param[in] kind expected return value type: milliseconds, centiseconds etc. + */ +time_t osmo_time_elapsed(const struct timespec *from, enum osmo_elapsed kind) +{ + struct timespec t_now; + long ns; + time_t sec; + + if (kind == T_TEST) { /* used for internal test only: */ + ns = 2 * from->tv_sec + OSMO_TIME_TEST_MAGIC; + t_now.tv_sec = OSMO_US2SEC(ns); + t_now.tv_nsec = OSMO_TIME_TEST_MAGIC + OSMO_USEC2NS(ns - t_now.tv_sec); + } else if (clock_gettime(CLOCK_MONOTONIC, &t_now) != 0) { + LOGP(DLGLOBAL, LOGL_ERROR, "Failed to get time for elapsed computation: %s\n", strerror(errno)); + return 0; + } + + ns = t_diff_nsec(&t_now, from); + sec = t_diff_sec(&t_now, from); + + switch (kind) { + case T_SECS: + return sec; + case T_MILLIS: + return OSMO_SEC2MS(sec) + OSMO_NSEC2MS(ns); + case T_CENTIS: + return OSMO_SEC2CS(sec) + OSMO_NSEC2CS(ns); + case T_TEST: + return OSMO_SEC2US(sec) + OSMO_NSEC2US(ns); + default: + LOGP(DLGLOBAL, LOGL_ERROR, "Unhandled kind in elapsed time computation: %u\n", kind); + } + + return 0; +} + +#endif /* !EMBEDDED */ + /*! Determine time between now and the nearest timer * \returns pointer to timeval of nearest timer, NULL if there is none * diff --git a/tests/timer/timer_test.c b/tests/timer/timer_test.c index d2b0204..03811e0 100644 --- a/tests/timer/timer_test.c +++ b/tests/timer/timer_test.c @@ -27,6 +27,9 @@ #include #include #include +#include +#include +#include #include #include @@ -35,7 +38,6 @@ #include "../config.h" -static void main_timer_fired(void *data); static void secondary_timer_fired(void *data); static unsigned int main_timer_step = 0; @@ -55,9 +57,6 @@ /* time between two steps, in secs. */ #define TIME_BETWEEN_STEPS 1 - -/* how much time elapses between checks, in microsecs */ -#define TIME_BETWEEN_TIMER_CHECKS 423210 static int timer_nsteps = MAIN_TIMER_NSTEPS; static unsigned int expired_timers = 0; @@ -109,7 +108,7 @@ { struct test_timer *v = data, *this, *tmp; struct timeval current, res; - struct timeval precision = { 0, TIME_BETWEEN_TIMER_CHECKS + 1}; + struct timeval precision = { 0, OSMO_TIME_TEST_MAGIC + 1}; int i, deleted; osmo_gettimeofday(¤t, NULL); @@ -162,10 +161,35 @@ total_timers - expired_timers); } +static inline void print_elapsed(struct timespec *t, int step) +{ + time_t us, ms, cs, sec; + + t->tv_sec = step; + + us = osmo_time_elapsed(t, T_TEST); + ms = OSMO_USEC2MS(us); + cs = OSMO_NSEC2CS(OSMO_USEC2NS(us)); + sec = OSMO_US2SEC(us); /* should be equal to step as long as OSMO_TIME_TEST_MAGIC < 1 second */ + + printf("[%d] Elapsed time: milliseconds %s, centiseconds %s => %s\n", step, + (OSMO_MS2SEC(ms) == sec) ? "OK" : "FAIL", + (OSMO_CS2SEC(cs) == sec) ? "OK" : "FAIL", + (step == sec) ? "OK" : "FAIL"); +} + int main(int argc, char *argv[]) { int c; int steps; + struct timespec t_start; + + printf("Running elapsed timer tests...\n"); + + if (clock_gettime(CLOCK_MONOTONIC, &t_start) != 0) + printf("failed to start timer: %s\n", strerror(errno)); + else + printf("monotonic timer started...\n"); osmo_gettimeofday_override = true; @@ -185,11 +209,11 @@ } steps = ((MAIN_TIMER_NSTEPS * TIME_BETWEEN_STEPS + 20) * 1e6) - / TIME_BETWEEN_TIMER_CHECKS; + / OSMO_TIME_TEST_MAGIC; printf("Running timer test for %d iterations," " %d steps of %d msecs each\n", - timer_nsteps, steps, TIME_BETWEEN_TIMER_CHECKS / 1000); + timer_nsteps, steps, OSMO_TIME_TEST_MAGIC / 1000); osmo_timer_setup(&main_timer, main_timer_fired, &main_timer_step); osmo_timer_schedule(&main_timer, 1, 0); @@ -200,10 +224,12 @@ (int)osmo_gettimeofday_override_time.tv_usec); osmo_timers_prepare(); osmo_timers_update(); - osmo_gettimeofday_override_add(0, TIME_BETWEEN_TIMER_CHECKS); + osmo_gettimeofday_override_add(0, OSMO_TIME_TEST_MAGIC); + print_elapsed(&t_start, steps); } #else printf("Select not supported on this platform!\n"); #endif + return 0; } diff --git a/tests/timer/timer_test.ok b/tests/timer/timer_test.ok index 75b11c7..c6cae2c 100644 --- a/tests/timer/timer_test.ok +++ b/tests/timer/timer_test.ok @@ -1,13 +1,21 @@ +Running elapsed timer tests... +monotonic timer started... Running timer test for 8 iterations, 66 steps of 423 msecs each 23.424242 +[65] Elapsed time: milliseconds OK, centiseconds OK => OK 23.847452 +[64] Elapsed time: milliseconds OK, centiseconds OK => OK 24.270662 +[63] Elapsed time: milliseconds OK, centiseconds OK => OK 24.693872 main_timer_fired() scheduled timer at 25.693872 added 1 timers in step 0 (expired=0) +[62] Elapsed time: milliseconds OK, centiseconds OK => OK 25.117082 +[61] Elapsed time: milliseconds OK, centiseconds OK => OK 25.540292 +[60] Elapsed time: milliseconds OK, centiseconds OK => OK 25.963502 main_timer_fired() scheduled timer at 26.963502 @@ -15,8 +23,11 @@ added 2 timers in step 1 (expired=0) timer fired on time: 25.693872 (+ 0.269630) early deleted 0 timers, 2 still active +[59] Elapsed time: milliseconds OK, centiseconds OK => OK 26.386712 +[58] Elapsed time: milliseconds OK, centiseconds OK => OK 26.809922 +[57] Elapsed time: milliseconds OK, centiseconds OK => OK 27.233132 main_timer_fired() scheduled timer at 28.233132 @@ -26,10 +37,13 @@ added 4 timers in step 2 (expired=1) timer fired on time: 26.963502 (+ 0.269630) early deleted 1 timers, 4 still active +[56] Elapsed time: milliseconds OK, centiseconds OK => OK 27.656342 +[55] Elapsed time: milliseconds OK, centiseconds OK => OK 28.079552 timer fired on time: 27.963502 (+ 0.116050) early deleted 0 timers, 3 still active +[54] Elapsed time: milliseconds OK, centiseconds OK => OK 28.502762 main_timer_fired() scheduled timer at 29.502762 @@ -41,10 +55,13 @@ scheduled timer at 35.502762 scheduled timer at 36.502762 added 8 timers in step 3 (expired=4) +[53] Elapsed time: milliseconds OK, centiseconds OK => OK 28.925972 +[52] Elapsed time: milliseconds OK, centiseconds OK => OK 29.349182 timer fired on time: 29.233132 (+ 0.116050) early deleted 2 timers, 8 still active +[51] Elapsed time: milliseconds OK, centiseconds OK => OK 29.772392 main_timer_fired() scheduled timer at 30.772392 @@ -64,12 +81,15 @@ scheduled timer at 36.772392 scheduled timer at 37.772392 added 16 timers in step 4 (expired=7) +[50] Elapsed time: milliseconds OK, centiseconds OK => OK 30.195602 +[49] Elapsed time: milliseconds OK, centiseconds OK => OK 30.618812 timer fired on time: 30.502762 (+ 0.116050) early deleted 5 timers, 18 still active timer fired on time: 30.233132 (+ 0.385680) early deleted 4 timers, 13 still active +[48] Elapsed time: milliseconds OK, centiseconds OK => OK 31.042022 main_timer_fired() scheduled timer at 32.042022 @@ -105,12 +125,15 @@ scheduled timer at 38.042022 scheduled timer at 39.042022 added 32 timers in step 5 (expired=18) +[47] Elapsed time: milliseconds OK, centiseconds OK => OK 31.465232 timer fired on time: 31.233132 (+ 0.232100) early deleted 11 timers, 33 still active +[46] Elapsed time: milliseconds OK, centiseconds OK => OK 31.888442 timer fired on time: 31.772392 (+ 0.116050) early deleted 8 timers, 24 still active +[45] Elapsed time: milliseconds OK, centiseconds OK => OK 32.311652 main_timer_fired() scheduled timer at 33.311652 @@ -178,12 +201,15 @@ scheduled timer at 39.311652 scheduled timer at 40.311652 added 64 timers in step 6 (expired=39) +[44] Elapsed time: milliseconds OK, centiseconds OK => OK 32.734862 +[43] Elapsed time: milliseconds OK, centiseconds OK => OK 33.158072 timer fired on time: 33.042022 (+ 0.116050) early deleted 21 timers, 66 still active timer fired on time: 33.042022 (+ 0.116050) early deleted 16 timers, 49 still active +[42] Elapsed time: milliseconds OK, centiseconds OK => OK 33.581282 main_timer_fired() scheduled timer at 34.581282 @@ -315,7 +341,9 @@ scheduled timer at 40.581282 scheduled timer at 41.581282 added 128 timers in step 7 (expired=78) +[41] Elapsed time: milliseconds OK, centiseconds OK => OK 34.004492 +[40] Elapsed time: milliseconds OK, centiseconds OK => OK 34.427702 timer fired on time: 34.311652 (+ 0.116050) early deleted 44 timers, 132 still active @@ -323,10 +351,13 @@ early deleted 32 timers, 99 still active timer fired on time: 34.311652 (+ 0.116050) early deleted 24 timers, 74 still active +[39] Elapsed time: milliseconds OK, centiseconds OK => OK 34.850912 main_timer_fired() Main timer has finished, please, wait a bit for the final report. +[38] Elapsed time: milliseconds OK, centiseconds OK => OK 35.274122 +[37] Elapsed time: milliseconds OK, centiseconds OK => OK 35.697332 timer fired on time: 35.581282 (+ 0.116050) early deleted 18 timers, 55 still active @@ -334,35 +365,49 @@ early deleted 13 timers, 41 still active timer fired on time: 35.581282 (+ 0.116050) early deleted 10 timers, 30 still active +[36] Elapsed time: milliseconds OK, centiseconds OK => OK 36.120542 +[35] Elapsed time: milliseconds OK, centiseconds OK => OK 36.543752 timer fired on time: 36.311652 (+ 0.232100) early deleted 7 timers, 22 still active timer fired on time: 36.311652 (+ 0.232100) early deleted 5 timers, 16 still active +[34] Elapsed time: milliseconds OK, centiseconds OK => OK 36.966962 timer fired on time: 36.581282 (+ 0.385680) early deleted 3 timers, 12 still active +[33] Elapsed time: milliseconds OK, centiseconds OK => OK 37.390172 timer fired on time: 37.042022 (+ 0.348150) early deleted 2 timers, 9 still active +[32] Elapsed time: milliseconds OK, centiseconds OK => OK 37.813382 timer fired on time: 37.581282 (+ 0.232100) early deleted 2 timers, 6 still active +[31] Elapsed time: milliseconds OK, centiseconds OK => OK 38.236592 +[30] Elapsed time: milliseconds OK, centiseconds OK => OK 38.659802 +[29] Elapsed time: milliseconds OK, centiseconds OK => OK 39.083012 +[28] Elapsed time: milliseconds OK, centiseconds OK => OK 39.506222 timer fired on time: 39.311652 (+ 0.194570) early deleted 1 timers, 4 still active +[27] Elapsed time: milliseconds OK, centiseconds OK => OK 39.929432 timer fired on time: 39.581282 (+ 0.348150) early deleted 0 timers, 3 still active +[26] Elapsed time: milliseconds OK, centiseconds OK => OK 40.352642 +[25] Elapsed time: milliseconds OK, centiseconds OK => OK 40.775852 timer fired on time: 40.581282 (+ 0.194570) early deleted 0 timers, 2 still active +[24] Elapsed time: milliseconds OK, centiseconds OK => OK 41.199062 +[23] Elapsed time: milliseconds OK, centiseconds OK => OK 41.622272 timer fired on time: 41.581282 (+ 0.040990) early deleted 0 timers, 1 still active -- To view, visit https://gerrit.osmocom.org/5103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I83d865ff633a7ebda2c943477205fd31aceda277 Gerrit-PatchSet: 5 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 Wed Jan 3 14:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 14:10:57 +0000 Subject: libosmocore[master]: Add function to estimate elapsed time In-Reply-To: References: Message-ID: Patch Set 5: > that applying this to gprs_ns in the next patch isn't breaking any tests that rely on artificial time? You probably refer to the next patch which actually changes NS-related code? I've tested it with OsmoPCU and OsmoSGSN - all tests work just fine. -- To view, visit https://gerrit.osmocom.org/5103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83d865ff633a7ebda2c943477205fd31aceda277 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 14:23:41 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 14:23:41 +0000 Subject: libosmocore[master]: Add function to estimate elapsed time In-Reply-To: References: Message-ID: Patch Set 5: Ah, I think I've got it - you refer to use of osmo_gettimeofday() inside libosmocore for elapsed time computations? I'd love to fix it as well but it's much bigger and more intrusive work. For now it'll live in parallel with NS (and later BSSGP) using monotonic clock for elapsed timing and osmo_timer using old non-monotonic clock. -- To view, visit https://gerrit.osmocom.org/5103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83d865ff633a7ebda2c943477205fd31aceda277 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 15:59:00 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 3 Jan 2018 15:59:00 +0000 Subject: [PATCH] libosmocore[master]: Add a control command node type for MSC-specific commands. Message-ID: Review at https://gerrit.osmocom.org/5628 Add a control command node type for MSC-specific commands. Change-Id: I6794b6173f5486d411e6728c324920b8e85f3db6 Related: OS#2729 --- M include/osmocom/ctrl/control_cmd.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/5628/1 diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index 865b006..bbffcda 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -22,6 +22,7 @@ CTRL_NODE_TS, /* TS specific (net.btsN.trxM.tsI.) */ CTRL_NODE_FSM, /* Finite State Machine (description) */ CTRL_NODE_FSM_INST, /* Finite State Machine (instance) */ + CTRL_NODE_MSC, /* MSC specific (net.mscN.) */ _LAST_CTRL_NODE }; -- To view, visit https://gerrit.osmocom.org/5628 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6794b6173f5486d411e6728c324920b8e85f3db6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:08:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 16:08:13 +0000 Subject: [PATCH] libosmocore[master]: BSSGP: use monotonic clock Message-ID: Review at https://gerrit.osmocom.org/5629 BSSGP: use monotonic clock Use monotonic clock to compute elapsed time to make sure it's not affected by system clock changes. Change-Id: If190a634aa8334cae55df8c41877400d2f5603a2 Related: OS#2586 --- M TODO-RELEASE M include/osmocom/gprs/gprs_bssgp.h M src/gb/gprs_bssgp.c M tests/gb/bssgp_fc_test.c 4 files changed, 18 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/5629/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index f7a08e8..8af8f48 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -11,3 +11,4 @@ coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h core osmo_time_elapsed() add function to estimate elapsed time gb struct gprs_nsvc add t_start parameter +gb struct bssgp_flow_control add t_last_pdu parameter diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index 2dead69..7b3ccec 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -66,7 +66,8 @@ uint32_t bucket_leak_rate; /*!< leak rate of the bucket (octets/sec) */ uint32_t bucket_counter; /*!< number of tokens in the bucket */ - struct timeval time_last_pdu; /*!< timestamp of last PDU sent */ + struct timeval time_last_pdu; /*!< deprecated! will be replaced by t_last_pdu eventually */ + struct timespec t_last_pdu; /*!< timestamp of last PDU sent */ /* the built-in queue */ uint32_t max_queue_depth; /*!< how many packets to queue (mgs) */ diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d27a94f..fa5d474 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -606,7 +607,6 @@ { struct bssgp_flow_control *fc = data; struct bssgp_fc_queue_element *fcqe; - struct timeval time_now; /* if the queue is empty, we return without sending something * and without re-starting the timer */ @@ -631,8 +631,8 @@ fc->queue_depth--; /* record the time we transmitted this PDU */ - osmo_gettimeofday(&time_now, NULL); - fc->time_last_pdu = time_now; + if (clock_gettime(CLOCK_MONOTONIC, &fc->t_last_pdu) != 0) + LOGP(DBSSGP, LOGL_ERROR, "Failed to record PDU time: %s\n", strerror(errno)); /* call the output callback for this FC instance */ fc->out_cb(fcqe->priv, fcqe->msg, fcqe->llc_pdu_len, NULL); @@ -666,7 +666,7 @@ * a sufficient number of bytes from the bucket to transmit * the first PDU in the queue */ msecs = (fcqe->llc_pdu_len * 1000) / fc->bucket_leak_rate; - /* FIXME: add that time to fc->time_last_pdu and subtract it from + /* FIXME: add that time to fc->t_last_pdu and subtract it from * current time */ osmo_timer_setup(&fc->timer, fc_timer_cb, fc); osmo_timer_schedule(&fc->timer, msecs / 1000, (msecs % 1000) * 1000); @@ -707,7 +707,6 @@ /* According to Section 8.2 */ static int bssgp_fc_needs_queueing(struct bssgp_flow_control *fc, uint32_t pdu_len) { - struct timeval time_now, time_diff; int64_t bucket_predicted; uint32_t csecs_elapsed, leaked; @@ -715,9 +714,7 @@ /* compute number of centi-seconds that have elapsed since transmitting * the last PDU (Tc - Tp) */ - osmo_gettimeofday(&time_now, NULL); - timersub(&time_now, &fc->time_last_pdu, &time_diff); - csecs_elapsed = time_diff.tv_sec*100 + time_diff.tv_usec/10000; + csecs_elapsed = osmo_time_elapsed(&fc->t_last_pdu, T_CENTIS); /* compute number of bytes that have leaked in the elapsed number * of centi-seconds */ @@ -753,8 +750,6 @@ int bssgp_fc_in(struct bssgp_flow_control *fc, struct msgb *msg, uint32_t llc_pdu_len, void *priv) { - struct timeval time_now; - if (llc_pdu_len > fc->bucket_size_max) { LOGP(DBSSGP, LOGL_NOTICE, "Single PDU (size=%u) is larger " "than maximum bucket size (%u)!\n", llc_pdu_len, @@ -771,8 +766,9 @@ return rc; } else { /* record the time we transmitted this PDU */ - osmo_gettimeofday(&time_now, NULL); - fc->time_last_pdu = time_now; + if (clock_gettime(CLOCK_MONOTONIC, &fc->t_last_pdu) != 0) + LOGP(DBSSGP, LOGL_ERROR, "Failed to record PDU time: %s\n", strerror(errno)); + return fc->out_cb(priv, msg, llc_pdu_len, NULL); } } @@ -790,7 +786,9 @@ fc->bucket_leak_rate = bucket_leak_rate; fc->max_queue_depth = max_queue_depth; INIT_LLIST_HEAD(&fc->queue); - osmo_gettimeofday(&fc->time_last_pdu, NULL); + + if (clock_gettime(CLOCK_MONOTONIC, &fc->t_last_pdu) != 0) + LOGP(DBSSGP, LOGL_ERROR, "Failed to start timer: %s\n", strerror(errno)); } /* Initialize the Flow Control parameters for a new MS according to diff --git a/tests/gb/bssgp_fc_test.c b/tests/gb/bssgp_fc_test.c index ac690a5..9eae9fd 100644 --- a/tests/gb/bssgp_fc_test.c +++ b/tests/gb/bssgp_fc_test.c @@ -96,11 +96,13 @@ while (1) { osmo_gettimeofday_override_add(0, 100000); - osmo_timers_check(); osmo_timers_prepare(); - osmo_timers_update(); + fc->t_last_pdu.tv_sec = 0; + fc->t_last_pdu.tv_nsec += OSMO_USEC2NS(100000); + + osmo_timers_update(); if (llist_empty(&fc->queue)) break; } -- To view, visit https://gerrit.osmocom.org/5629 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If190a634aa8334cae55df8c41877400d2f5603a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:10:26 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 3 Jan 2018 16:10:26 +0000 Subject: [PATCH] osmo-bsc[master]: Support control connection status query for a particular MSC. Message-ID: Review at https://gerrit.osmocom.org/5630 Support control connection status query for a particular MSC. Add a new control command 'msc.N.connection_status' which can be used to query the connection status of a particular MSC with number N. Keep the old control command 'msc_connection_status', which always queries MSC 0, for backwards compatibility. Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Related: OS#2729 --- M src/libbsc/bsc_ctrl_lookup.c M src/osmo-bsc/osmo_bsc_ctrl.c 2 files changed, 53 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/30/5630/1 diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index d1d9b0a..febf484 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -1,4 +1,4 @@ -/* SNMP-like status interface. Look-up of BTS/TRX +/* SNMP-like status interface. Look-up of BTS/TRX/MSC * * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves @@ -27,10 +27,11 @@ #include #include #include +#include extern vector ctrl_node_vec; -/*! \brief control interface lookup function for bsc/bts gsm_data +/*! \brief control interface lookup function for bsc/bts/msc gsm_data * \param[in] data Private data passed to controlif_setup() * \param[in] vline Vector of the line holding the command string * \param[out] node_type type (CTRL_NODE_) that was determined @@ -44,6 +45,7 @@ struct gsm_bts *bts = NULL; struct gsm_bts_trx *trx = NULL; struct gsm_bts_trx_ts *ts = NULL; + struct bsc_msc_data *msc = NULL; char *token = vector_slot(vline, *i); long num; @@ -89,6 +91,18 @@ goto err_missing; *node_data = ts; *node_type = CTRL_NODE_TS; + } else if (!strcmp(token, "msc")) { + if (*node_type != CTRL_NODE_ROOT || !net) + goto err_missing; + (*i)++; + if (!ctrl_parse_get_num(vline, *i, &num)) + goto err_index; + + msc = osmo_msc_data_find(net, num); + if (!msc) + goto err_missing; + *node_data = msc; + *node_type = CTRL_NODE_MSC; } else return 0; diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 4460288..8228c08 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -57,10 +57,39 @@ talloc_free(trap); } -CTRL_CMD_DEFINE_RO(msc_connection_status, "msc_connection_status"); -static int msc_connection_status = 0; - +CTRL_CMD_DEFINE(msc_connection_status, "connection_status"); static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data) +{ + struct bsc_msc_data *msc = (struct bsc_msc_data *)cmd->node; + if (msc == NULL) { + cmd->reply = "msc not found"; + return CTRL_CMD_ERROR; + } + + if (msc->msc_con->is_connected) + cmd->reply = "connected"; + else + cmd->reply = "disconnected"; + return CTRL_CMD_REPLY; +} + +static int set_msc_connection_status(struct ctrl_cmd *cmd, void *data) +{ + cmd->reply = "Read Only attribute"; + return CTRL_CMD_ERROR; +} + +static int verify_msc_connection_status(struct ctrl_cmd *cmd, const char *value, void *data) +{ + cmd->reply = "Read Only attribute"; + return 1; +} + +/* Backwards compat. */ +CTRL_CMD_DEFINE_RO(msc0_connection_status, "msc_connection_status"); +static int msc_connection_status = 0; /* XXX unused */ + +static int get_msc0_connection_status(struct ctrl_cmd *cmd, void *data) { struct gsm_network *gsmnet = data; struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0); @@ -96,7 +125,7 @@ cmd->id = "0"; cmd->variable = "msc_connection_status"; - get_msc_connection_status(cmd, NULL); + get_msc0_connection_status(cmd, NULL); ctrl_cmd_send_to_all(gsmnet->ctrl, cmd); @@ -627,7 +656,10 @@ rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_timezone); if (rc) goto end; - rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc_connection_status); + rc = ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); + if (rc) + goto end; + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc0_connection_status); if (rc) goto end; rc = osmo_signal_register_handler(SS_MSC, &msc_connection_status_trap_cb, net); -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:13:30 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 3 Jan 2018 16:13:30 +0000 Subject: [PATCH] osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5630 to look at the new patch set (#2). Support control connection status query for a particular MSC. Add a new control command 'msc.N.connection_status' which can be used to query the connection status of a particular MSC with number N. Keep the old control command 'msc_connection_status', which always queries MSC 0, for backwards compatibility. This needs libosmocore with the following change to compile: https://gerrit.osmocom.org/#/c/5628/ Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Related: OS#2729 --- M src/libbsc/bsc_ctrl_lookup.c M src/osmo-bsc/osmo_bsc_ctrl.c 2 files changed, 53 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/30/5630/2 diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index d1d9b0a..febf484 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -1,4 +1,4 @@ -/* SNMP-like status interface. Look-up of BTS/TRX +/* SNMP-like status interface. Look-up of BTS/TRX/MSC * * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves @@ -27,10 +27,11 @@ #include #include #include +#include extern vector ctrl_node_vec; -/*! \brief control interface lookup function for bsc/bts gsm_data +/*! \brief control interface lookup function for bsc/bts/msc gsm_data * \param[in] data Private data passed to controlif_setup() * \param[in] vline Vector of the line holding the command string * \param[out] node_type type (CTRL_NODE_) that was determined @@ -44,6 +45,7 @@ struct gsm_bts *bts = NULL; struct gsm_bts_trx *trx = NULL; struct gsm_bts_trx_ts *ts = NULL; + struct bsc_msc_data *msc = NULL; char *token = vector_slot(vline, *i); long num; @@ -89,6 +91,18 @@ goto err_missing; *node_data = ts; *node_type = CTRL_NODE_TS; + } else if (!strcmp(token, "msc")) { + if (*node_type != CTRL_NODE_ROOT || !net) + goto err_missing; + (*i)++; + if (!ctrl_parse_get_num(vline, *i, &num)) + goto err_index; + + msc = osmo_msc_data_find(net, num); + if (!msc) + goto err_missing; + *node_data = msc; + *node_type = CTRL_NODE_MSC; } else return 0; diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 4460288..8228c08 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -57,10 +57,39 @@ talloc_free(trap); } -CTRL_CMD_DEFINE_RO(msc_connection_status, "msc_connection_status"); -static int msc_connection_status = 0; - +CTRL_CMD_DEFINE(msc_connection_status, "connection_status"); static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data) +{ + struct bsc_msc_data *msc = (struct bsc_msc_data *)cmd->node; + if (msc == NULL) { + cmd->reply = "msc not found"; + return CTRL_CMD_ERROR; + } + + if (msc->msc_con->is_connected) + cmd->reply = "connected"; + else + cmd->reply = "disconnected"; + return CTRL_CMD_REPLY; +} + +static int set_msc_connection_status(struct ctrl_cmd *cmd, void *data) +{ + cmd->reply = "Read Only attribute"; + return CTRL_CMD_ERROR; +} + +static int verify_msc_connection_status(struct ctrl_cmd *cmd, const char *value, void *data) +{ + cmd->reply = "Read Only attribute"; + return 1; +} + +/* Backwards compat. */ +CTRL_CMD_DEFINE_RO(msc0_connection_status, "msc_connection_status"); +static int msc_connection_status = 0; /* XXX unused */ + +static int get_msc0_connection_status(struct ctrl_cmd *cmd, void *data) { struct gsm_network *gsmnet = data; struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0); @@ -96,7 +125,7 @@ cmd->id = "0"; cmd->variable = "msc_connection_status"; - get_msc_connection_status(cmd, NULL); + get_msc0_connection_status(cmd, NULL); ctrl_cmd_send_to_all(gsmnet->ctrl, cmd); @@ -627,7 +656,10 @@ rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_timezone); if (rc) goto end; - rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc_connection_status); + rc = ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); + if (rc) + goto end; + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc0_connection_status); if (rc) goto end; rc = osmo_signal_register_handler(SS_MSC, &msc_connection_status_trap_cb, net); -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:27:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 16:27:02 +0000 Subject: [PATCH] libosmocore[master]: Remove unused timeval parameters Message-ID: Review at https://gerrit.osmocom.org/5631 Remove unused timeval parameters Remove timeval parameters from NS and BSSGP structs which were replaced by timespec which is required for monotonic clocks. Change-Id: I16ffe9aca21be1fa71184abc57a5745923c5cfcb --- M TODO-RELEASE M include/osmocom/gprs/gprs_bssgp.h M include/osmocom/gprs/gprs_ns.h 3 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/5631/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 8af8f48..2c9d85c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -12,3 +12,5 @@ core osmo_time_elapsed() add function to estimate elapsed time gb struct gprs_nsvc add t_start parameter gb struct bssgp_flow_control add t_last_pdu parameter +gb struct gprs_nsvc remove timer_started parameter +gb struct bssgp_flow_control remove time_last_pdu parameter diff --git a/include/osmocom/gprs/gprs_bssgp.h b/include/osmocom/gprs/gprs_bssgp.h index 7b3ccec..efd2bc3 100644 --- a/include/osmocom/gprs/gprs_bssgp.h +++ b/include/osmocom/gprs/gprs_bssgp.h @@ -66,7 +66,6 @@ uint32_t bucket_leak_rate; /*!< leak rate of the bucket (octets/sec) */ uint32_t bucket_counter; /*!< number of tokens in the bucket */ - struct timeval time_last_pdu; /*!< deprecated! will be replaced by t_last_pdu eventually */ struct timespec t_last_pdu; /*!< timestamp of last PDU sent */ /* the built-in queue */ diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h index a303732..987d5dd 100644 --- a/include/osmocom/gprs/gprs_ns.h +++ b/include/osmocom/gprs/gprs_ns.h @@ -127,7 +127,6 @@ struct osmo_timer_list timer; enum nsvc_timer_mode timer_mode; - struct timeval timer_started; /* deprecated! will be replaced by t_start eventually */ struct timespec t_start; int alive_retries; -- To view, visit https://gerrit.osmocom.org/5631 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16ffe9aca21be1fa71184abc57a5745923c5cfcb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:28:17 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 3 Jan 2018 16:28:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Test control connection status query for MSC 0. Message-ID: Review at https://gerrit.osmocom.org/5632 Test control connection status query for MSC 0. This new test exercises the new 'msc.0.connection_status' control command which is added in https://gerrit.osmocom.org/#/c/5630/ Change-Id: I55faa1ec413629234e24831dbc05d8b0afec8099 Related: OS#2729 --- M bsc/BSC_Tests.ttcn 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/32/5632/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 4cf418e..0080fe0 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -871,6 +871,16 @@ setverdict(pass); } +testcase TC_ctrl_msc0_connection_status() runs on test_CT { + var charstring ctrl_resp; + + f_init(1); + f_bssap_reset(); + + f_ctrl_get_exp(IPA_CTRL, "msc.0.connection_status", "connected"); + setverdict(pass); +} + testcase TC_ctrl() runs on test_CT { var charstring ctrl_resp; @@ -1385,6 +1395,7 @@ control { execute( TC_ctrl_msc_connection_status() ); + execute( TC_ctrl_msc0_connection_status() ); execute( TC_ctrl() ); execute( TC_chan_act_noreply() ); execute( TC_chan_act_counter() ); -- To view, visit https://gerrit.osmocom.org/5632 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55faa1ec413629234e24831dbc05d8b0afec8099 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:39:46 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 16:39:46 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Improve python3 compatibility 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/5038 to look at the new patch set (#9). Improve python3 compatibility Use proper print() function to make scripts compatible with both python 2 and 3. This paves the way to deprecating python 2 support altogether. Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121 --- M contrib/jenkins.sh M scripts/osmodumpdoc.py M scripts/osmotestconfig.py M scripts/osmotestvty.py M setup.py 5 files changed, 31 insertions(+), 29 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/38/5038/9 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c4ddf7d..e2ff503 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,7 +16,7 @@ rm -rf ./build PY3=python3 -PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" +PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" $PY3 ./setup.py install $PY3 tests/test_py3.py for f in $PY3_LIST diff --git a/scripts/osmodumpdoc.py b/scripts/osmodumpdoc.py index 2464b05..d71edc8 100644 --- a/scripts/osmodumpdoc.py +++ b/scripts/osmodumpdoc.py @@ -4,7 +4,7 @@ # Fixes may need to be applied to both. """Start the process and dump the documentation to the doc dir.""" - +from __future__ import print_function import subprocess import time import os @@ -21,7 +21,7 @@ out = open(filename, 'w') out.write(xml) out.close() - print 'generated %r' % filename + print('generated %r' % filename) """Dump the config of all the apps. @@ -40,22 +40,22 @@ for app in apps: appname = app[3] - print "Starting app for %s" % appname + print("Starting app for %s" % appname) proc = None cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] - print 'cd', os.path.abspath(os.path.curdir), ';', ' '.join(cmd) + print('cd', os.path.abspath(os.path.curdir), ';', ' '.join(cmd)) try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) except OSError as e: # Probably a missing binary - print >> sys.stderr, e - print >> sys.stderr, "Skipping app %s" % appname + print(e, file=sys.stderr) + print("Skipping app %s" % appname, file=sys.stderr) failures += 1 else: try: dump_doc(app[2], app[0], 'doc/%s_vty_reference.xml' % appname) successes += 1 except IOError: # Generally a socket issue - print >> sys.stderr, "%s: couldn't connect, skipping" % appname + print("%s: couldn't connect, skipping" % appname, file=sys.stderr) failures += 1 finally: osmoutil.end_proc(proc) @@ -90,7 +90,7 @@ num_fails, num_sucs = dump_configs( osmoappdesc.apps, osmoappdesc.app_configs, confpath) if num_fails > 0: - print >> sys.stderr, "Warning: Skipped %s apps" % num_fails + print("Warning: Skipped %s apps" % num_fails, file=sys.stderr) if 0 == num_sucs: - print >> sys.stderr, "Nothing run, wrong working dir? Set with -w" + print("Nothing run, wrong working dir? Set with -w", file=sys.stderr) sys.exit(num_fails) diff --git a/scripts/osmotestconfig.py b/scripts/osmotestconfig.py index 2132c43..f227504 100644 --- a/scripts/osmotestconfig.py +++ b/scripts/osmotestconfig.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import print_function import os import os.path import time @@ -52,7 +52,7 @@ try: cmd = app_desc[1].split(' ') + [ "-c", config] if verbose: - print "Verifying %s, test %s" % (' '.join(cmd), run_test.__name__) + print("Verifying %s, test %s" % (' '.join(cmd), run_test.__name__)) proc = osmoutil.popen_devnull(cmd) end = app_desc[2] @@ -61,10 +61,10 @@ ret = run_test(vty) except IOError as se: - print >> sys.stderr, "Failed to verify %s" % ' '.join(cmd) - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Error was %s" % se - print >> sys.stderr, "Config was\n%s" % open(config).read() + print("Failed to verify %s" % ' '.join(cmd), file=sys.stderr) + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Error was %s" % se, file=sys.stderr) + print("Config was\n%s" % open(config).read(), file=sys.stderr) raise se finally: @@ -125,9 +125,8 @@ all_errs.append(err_lines) - print >> sys.stderr, \ - "Documentation error (missing docs): \n%s\n%s\n" % ( - cmd_line, '\n'.join(err_lines)) + print("Documentation error (missing docs): \n%s\n%s\n" % ( + cmd_line, '\n'.join(err_lines)), file=sys.stderr) return (len(all_errs), all_errs) @@ -157,7 +156,7 @@ if config in app_configs[app]: found = True if not found: - print >> sys.stderr, "Warning: %s is not being tested" % config + print("Warning: %s is not being tested" % config, file=sys.stderr) def test_all_apps(apps, app_configs, tmpdir="writtenconfig", verbose=True, @@ -166,7 +165,7 @@ errors = 0 for app in apps: if not app_exists(app): - print >> sys.stderr, "Skipping app %s (not found)" % app[1] + print("Skipping app %s (not found)" % app[1], file=sys.stderr) continue configs = app_configs[app[3]] @@ -178,7 +177,7 @@ remove_tmpdir(tmpdir) if errors: - print >> sys.stderr, "ERRORS: %d" % errors + print("ERRORS: %d" % errors, file=sys.stderr) return errors diff --git a/scripts/osmotestvty.py b/scripts/osmotestvty.py index e513c05..55017a5 100644 --- a/scripts/osmotestvty.py +++ b/scripts/osmotestvty.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import print_function import os import time import unittest @@ -36,11 +36,11 @@ osmo_vty_cmd[cfi] = os.path.join(confpath, osmo_vty_cmd[cfi]) try: - print "Launch: %s from %s" % (' '.join(osmo_vty_cmd), os.getcwd()) + print("Launch: %s from %s" % (' '.join(osmo_vty_cmd), os.getcwd())) self.proc = osmoutil.popen_devnull(osmo_vty_cmd) except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Consider setting -b", file=sys.stderr) appstring = osmoappdesc.vty_app[2] appport = osmoappdesc.vty_app[0] @@ -94,9 +94,9 @@ osmoappdesc = osmoutil.importappconf_or_quit(confpath, "osmoappdesc", args.p) - print "confpath %s, workdir %s" % (confpath, workdir) + print("confpath %s, workdir %s" % (confpath, workdir)) os.chdir(workdir) - print "Running tests for specific VTY commands" + print("Running tests for specific VTY commands") suite = unittest.TestLoader().loadTestsFromTestCase(TestVTY) res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) sys.exit(len(res.errors) + len(res.failures)) diff --git a/setup.py b/setup.py index 533272e..455650a 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,10 @@ scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", "scripts/osmotestvty.py"] elif sys.version_info.major == 3: - scripts = ["scripts/osmo_interact_vty.py", + scripts = ["scripts/osmodumpdoc.py", + "scripts/osmotestconfig.py", + "scripts/osmotestvty.py", + "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/soap.py", "scripts/twisted_ipa.py", -- To view, visit https://gerrit.osmocom.org/5038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121 Gerrit-PatchSet: 9 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:46:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 16:46:49 +0000 Subject: libosmocore[master]: Add a control command node type for MSC-specific commands. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5628 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6794b6173f5486d411e6728c324920b8e85f3db6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 16:53:03 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 3 Jan 2018 16:53:03 +0000 Subject: osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/5630/2/src/osmo-bsc/osmo_bsc_ctrl.c File src/osmo-bsc/osmo_bsc_ctrl.c: Line 75: It's better to use CTRL_CMD_DEFINE_RO to avoid boilerplate. Line 90: static int msc_connection_status = 0; /* XXX unused */ If it's unused than why not remove it? -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 3 17:47:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 17:47:35 +0000 Subject: osmo-pcu[master]: window: move encoding into functions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840 Gerrit-PatchSet: 3 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 Jan 3 19:12:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Jan 2018 19:12:02 +0000 Subject: [PATCH] openbsc[master]: configure.ac: Add subdir-objects Message-ID: Review at https://gerrit.osmocom.org/5633 configure.ac: Add subdir-objects And ignore some autoreconf generated files Change-Id: I7911669662f474ee60d211665fb87c3992589f11 --- M openbsc/.gitignore M openbsc/configure.ac 2 files changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/33/5633/1 diff --git a/openbsc/.gitignore b/openbsc/.gitignore index 3a811e7..683e5cf 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -37,6 +37,11 @@ stamp-h1 libtool ltmain.sh +m4/libtool.m4 +m4/ltoptions.m4 +m4/ltsugar.m4 +m4/ltversion.m4 +m4/lt~obsolete.m4 # git-version-gen magic .tarball-version diff --git a/openbsc/configure.ac b/openbsc/configure.ac index a0df05f..8b200dd 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -6,7 +6,7 @@ dnl *This* is the root dir, even if an install-sh exists in ../ or ../../ AC_CONFIG_AUX_DIR([.]) -AM_INIT_AUTOMAKE([dist-bzip2]) +AM_INIT_AUTOMAKE([dist-bzip2 subdir-objects]) AC_CONFIG_TESTDIR(tests) dnl kernel style compile messages -- To view, visit https://gerrit.osmocom.org/5633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7911669662f474ee60d211665fb87c3992589f11 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vasil Velichkov From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:15:26 2018 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Jan 2018 19:15:26 +0000 Subject: openbsc[master]: configure.ac: Add subdir-objects In-Reply-To: References: Message-ID: Patch Set 1: Hi, This fixes the followin automake 1.15 errors tests/bsc-nat-trie/Makefile.am:9: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c' is in a subdirectory, tests/bsc-nat-trie/Makefile.am:9: but option 'subdir-objects' is disabled automake: warning: possible forward-incompatibility. automake: At least a source file is in a subdirectory, but the 'subdir-objects' automake: automake option hasn't been enabled. For now, the corresponding output automake: object file(s) will be placed in the top-level directory. However, automake: this behaviour will change in future Automake versions: they will automake: unconditionally cause object files to be placed in the same subdirectory automake: of the corresponding sources. automake: You are advised to start using 'subdir-objects' option throughout your automake: project, to avoid future incompatibilities. tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_filter.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_sccp.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_nat_utils.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_nat_rewrite.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_nat_rewrite_trie.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_mgcp_utils.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc-nat/Makefile.am:34: warning: source file '$(top_srcdir)/src/osmo-bsc_nat/bsc_nat_filter.c' is in a subdirectory, tests/bsc-nat/Makefile.am:34: but option 'subdir-objects' is disabled tests/bsc/Makefile.am:28: warning: source file '$(top_srcdir)/src/osmo-bsc/osmo_bsc_filter.c' is in a subdirectory, tests/bsc/Makefile.am:28: but option 'subdir-objects' is disabled tests/smpp/Makefile.am:31: warning: source file '$(top_builddir)/src/libmsc/smpp_utils.c' is in a subdirectory, tests/smpp/Makefile.am:31: but option 'subdir-objects' is disabled -- To view, visit https://gerrit.osmocom.org/5633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7911669662f474ee60d211665fb87c3992589f11 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vasil Velichkov Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:47:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 19:47:23 +0000 Subject: [PATCH] gr-gsm[master]: README.md: Change mailing list address to osmocom.org Message-ID: Review at https://gerrit.osmocom.org/5634 README.md: Change mailing list address to osmocom.org Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 --- M README.md 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/34/5634/1 diff --git a/README.md b/README.md index 86ca1e8..94c20c8 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ============ Current gr-gsm project's mailing list address is following: -gr-gsm at googlegroups.com +gr-gsm at lists.osmocom.org Mailing list is a place for general discussions, questions about the usage and installation. In case of problem with installation please try to provide full information that will help reproducing it. Minimum information should contain: - operating system with version, @@ -20,9 +20,9 @@ - version of gnuradio (it can be obtained with: gnuradio-companion --version) - error messages (in case of pybombs installation they can be obtained after switching it to verbous mode with -v option). -To join the group with any e-mail addres (google account is not required) use this link: +To join the group with any e-mail addressi, use this link: -https://groups.google.com/forum/#!forum/gr-gsm/join +https://lists.osmocom.org/mailman/listinfo/gr-gsm Development =========== -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:47:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 19:47:23 +0000 Subject: [PATCH] gr-gsm[master]: README.md: Turn URLs into hyperlinks (video, mailing list) Message-ID: Review at https://gerrit.osmocom.org/5635 README.md: Turn URLs into hyperlinks (video, mailing list) Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f --- M README.md 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/35/5635/1 diff --git a/README.md b/README.md index 94c20c8..ce48a30 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To join the group with any e-mail addressi, use this link: -https://lists.osmocom.org/mailman/listinfo/gr-gsm + Development =========== @@ -34,7 +34,7 @@ ====== Short presentation of *Airprobe*'like application of *gr-gsm*: -https://www.youtube.com/watch?v=Eofnb7zr8QE + Credits ======= -- To view, visit https://gerrit.osmocom.org/5635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:50:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 19:50:53 +0000 Subject: osmo-bsc[master]: Fix "CTRL GET msc_connection_status" response. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5627 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:52:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 19:52:38 +0000 Subject: osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 I agree with both Max' comments. Also, build verification has failed to build the patch... -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:55:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 19:55:44 +0000 Subject: openbsc[master]: configure.ac: Add subdir-objects In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 We've had troubles with this in libosmocore in the past, see 7c942ba1475a366cc7c8a129fbdd335166ce21c6 and the subsequent 538ff49837c95e2ba6514356c863112569128532 Also, build verification has failed, as you can see. Furthermore, openbsc.git is the legacy code whcih is in "bugfix only" mode, i.e. only bug fix patches are accepted at this point. So unless you can show us what fails (beyond a autoconf warning, which is not an error) I'm reluctant to make such a change. Feel free to contribute to the new post-nitb repositories, though! Thanks! -- To view, visit https://gerrit.osmocom.org/5633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7911669662f474ee60d211665fb87c3992589f11 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vasil Velichkov Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 19:56:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 19:56:43 +0000 Subject: libosmocore[master]: Add a control command node type for MSC-specific commands. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 See the followign commit in libosmocore: commit ea66852a62319901dc198ea1dc8cbfbf77217347 Author: Neels Hofmeyr Date: Mon Oct 16 16:18:01 2017 +0200 ctrl: allow more nodes than those in enum ctrl_node_type Add ctrl_interface_setup_dynip2() to add a node_count parameter, which can be used to define more ctrl nodes without having to merge a patch to libosmocore. -- To view, visit https://gerrit.osmocom.org/5628 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6794b6173f5486d411e6728c324920b8e85f3db6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 20:10:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 20:10:22 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Add comments with short module description on top of each file Message-ID: Review at https://gerrit.osmocom.org/5636 Add comments with short module description on top of each file Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3 --- M library/BSSAP_CodecPort.ttcn M library/BSSMAP_Emulation.ttcn M library/BSSMAP_Templates.ttcn M library/GSUP_Types.ttcn M library/IPA_CodecPort.ttcn M library/IPA_Emulation.ttcn M library/IPA_Types.ttcn M library/IuUP_Emulation.ttcn M library/IuUP_Types.ttcn M library/L3_Templates.ttcn M library/MGCP_CodecPort.ttcn M library/MGCP_Templates.ttcn M library/MGCP_Types.ttcn M library/Osmocom_CTRL_Functions.ttcn M library/Osmocom_CTRL_Types.ttcn M library/RSL_Emulation.ttcn M library/RSL_Types.ttcn M library/RTP_CodecPort.ttcn 18 files changed, 233 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/5636/1 diff --git a/library/BSSAP_CodecPort.ttcn b/library/BSSAP_CodecPort.ttcn index 7470dd4..41bd171 100644 --- a/library/BSSAP_CodecPort.ttcn +++ b/library/BSSAP_CodecPort.ttcn @@ -1,5 +1,16 @@ module BSSAP_CodecPort { +/* Simple BSSAP Codec Port, translating between raw SCCP primitives with + * octetstring payload towards the SCCP provider, and BSSAP-SCCP primitives + * which carry the decoded BSSAP data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index ba7e27c..153fb86 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -1,5 +1,35 @@ module BSSMAP_Emulation { +/* BSSMAP Emulation, runs on top of BSSAP_CodecPort. It multiplexes/demultiplexes + * the individual connections, so there can be separate TTCN-3 components handling + * each of the connections. + * + * The BSSMAP_Emulation.main() function processes SCCP primitives from the SCCP + * stack via the BSSAP_CodecPort, and dispatches them to the per-connection components. + * + * Outbound BSSAP/SCCP connections are initiated by sending a BSSAP_Conn_Req primitive + * to the component running the BSSMAP_Emulation.main() function. + * + * For each new inbound connections, the BssmapOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound connection, it can + * do so by registering an "expect" with the expected Layer 3 (DTAP) payload. This is e.g. useful + * if you are simulating BTS + MSC, and first trigger a connection from BTS/RSL side in a + * component which then subsequently should also handle the MSC emulation. + * + * Inbound Unit Data messages (such as are dispatched to the BssmapOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from SCCP_Emulation all; import from SCCPasp_Types all; import from BSSAP_Types all; diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index bb1b537..cb6dde8 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -1,5 +1,14 @@ module BSSMAP_Templates { +/* BSSMAP Templates, building on top of BSSAP_Types from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index b994d1f..fc524a1 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -1,5 +1,17 @@ module GSUP_Types { +/* GSUP_Types, defining abstract TTCN-3 data types for the GSUP protocol. + * + * GSUP is a non-standard protocol used between OsmoMSC/OsmoSGSN and OsmoHLR + * in order to replace the complex TCAP/MAP protocol. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; diff --git a/library/IPA_CodecPort.ttcn b/library/IPA_CodecPort.ttcn index 9ba9d18..f9a242b 100644 --- a/library/IPA_CodecPort.ttcn +++ b/library/IPA_CodecPort.ttcn @@ -1,5 +1,16 @@ module IPA_CodecPort { +/* Simple IPA Codec Port, translating between raw TCP octetstring payload + * towards the IPL4asp port provider, and IPA primitives + * which carry the decoded IPA data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from IPL4asp_PortType all; import from IPL4asp_Types all; import from IPA_Types all; diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn index 9bad69f..b40818f 100644 --- a/library/IPA_Emulation.ttcn +++ b/library/IPA_Emulation.ttcn @@ -2,10 +2,18 @@ /* This module implements the IPA multiplex protocol on top of TCP, using the IPL4asp * test-port as provider. It implements both client and server roles, as well was the CCM - * handshake for establishing the identity of the client to the server. It already knows - * certain well-known sub-protocols such as A-bis RSL, MGCP and SCCP and transcodes messages - * so the user can work with abstract data types rather than binary messages. It handles - * multiple packets inside one TCP segment */ + * handshake for establishing the identity of the client to the server. + * + * It already knows certain well-known sub-protocols such as A-bis RSL, MGCP and SCCP and + * GSUP. IT hence transcodes messages so the user can work with abstract data types rather + * than binary messages. It handles multiple packets inside one TCP segment. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ import from IPA_Types all; import from IPA_CodecPort all; diff --git a/library/IPA_Types.ttcn b/library/IPA_Types.ttcn index 5522e87..933a3fe 100644 --- a/library/IPA_Types.ttcn +++ b/library/IPA_Types.ttcn @@ -1,7 +1,16 @@ -/* (C) 2017 by Harald Welte */ - module IPA_Types { +/* Definitions of abstract data types for the IPA multiplex protocol. + * Uses the TITAN "RAW" codec syntax to auto-generate encoder and decoder + * functions. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from Osmocom_Types all; type enumerated IpaStreamId { diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn index ec25e49..77cd739 100644 --- a/library/IuUP_Emulation.ttcn +++ b/library/IuUP_Emulation.ttcn @@ -1,5 +1,19 @@ module IuUP_Emulation { +/* IuUP emulation, uses the encoding/decoding from IuUP_Types. + * + * rather than running in a separate component with related primitives, + * we just implement a set of functions and data types which can be used + * by other code (such as an RTP endpoint) to implement IuUP support. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from Osmocom_Types all; import from IuUP_Types all; diff --git a/library/IuUP_Types.ttcn b/library/IuUP_Types.ttcn index 933b64f..b822ddf 100644 --- a/library/IuUP_Types.ttcn +++ b/library/IuUP_Types.ttcn @@ -1,5 +1,16 @@ module IuUP_Types { +/* Definition of abstract types for the IuUP protocol as specified in + * 3GPP TS 25.415. Uses the TITAN "RAW" codec to auto-generate encoder/decoder + * functions. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from Osmocom_Types all; import from General_Types all; diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index f0f3d38..19cb99f 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1,5 +1,14 @@ module L3_Templates { +/* L3 Templates, building on top of MobileL3*_Types from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; diff --git a/library/MGCP_CodecPort.ttcn b/library/MGCP_CodecPort.ttcn index 06072af..416ac36 100644 --- a/library/MGCP_CodecPort.ttcn +++ b/library/MGCP_CodecPort.ttcn @@ -1,5 +1,16 @@ module MGCP_CodecPort { +/* Simple MGCP Codec Port, translating between raw UDP primitives with + * octetstring payload towards the IPL4asp provider, and MGCP primitives + * which carry the decoded MGCP data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from IPL4asp_PortType all; import from IPL4asp_Types all; import from MGCP_Types all; diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 3fa7bd1..f4c6e0f 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -1,5 +1,15 @@ module MGCP_Templates { +/* MGCP Templates, building on top of MGCP_Types (Osmocom) and SDP_Types from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from MGCP_Types all; import from SDP_Types all; diff --git a/library/MGCP_Types.ttcn b/library/MGCP_Types.ttcn index 22141f4..9d1a4e1 100644 --- a/library/MGCP_Types.ttcn +++ b/library/MGCP_Types.ttcn @@ -1,4 +1,16 @@ module MGCP_Types { + +/* Definition of abstract types for the MGCP protocol as specified in + * IETF RFC 3435. Uses the TITAN "TEXT" codec to auto-generate encoder/decoder + * functions, as well as the SDP type definitions and coder from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from SDP_Types all; type charstring MgcpVerb ("EPCF", "CRCX", "MDCX", "DLCX", "RQNT", "NTFY", diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn index b8e68e3..70885c9 100644 --- a/library/Osmocom_CTRL_Functions.ttcn +++ b/library/Osmocom_CTRL_Functions.ttcn @@ -1,4 +1,25 @@ module Osmocom_CTRL_Functions { + +/* Definition of helper functions for the Osmocom CTRL interface. + * + * As opposed to many other parts of the Osmocom TTCN-3 code base, this module + * implements blocking functions, instead of asynchronous functions. The + * rationale for this is simple: One normally wants to inquire a value or set + * a value and not continue the main program until that operation is complete. + * + * CTRL is a machine-type protocol on how external programs can interact with + * an Osmocom program in a structured way. It is intended for programmatic + * access (by other software), as opposed to the VTY interface intended for + * human consumption. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from Osmocom_CTRL_Types all; import from IPA_Emulation all; diff --git a/library/Osmocom_CTRL_Types.ttcn b/library/Osmocom_CTRL_Types.ttcn index 4d2406d..1d77668 100644 --- a/library/Osmocom_CTRL_Types.ttcn +++ b/library/Osmocom_CTRL_Types.ttcn @@ -1,5 +1,15 @@ module Osmocom_CTRL_Types { +/* Definition of abstract types for the CTRL protocol as used in Osmocom. + * Uses the TITAN "TEXT" codec to auto-generate encoder/decoder functions. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + type charstring CtrlVerb ("GET", "SET") with { /* see https://www.eclipse.org/forums/index.php/t/1088893/ on why this * match expression is needed here */ diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index a42ca1e..7c5a168 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -1,5 +1,22 @@ module RSL_Emulation { +/* RSL Emulation, runs on top of IPA_Emulation. It multiplexes/demultiplexes + * the individual connections (logical channels), so there can be separate TTCN-3 components + * handling each of the connections. + * + * The RSL_Emulation.main() function processes RSL messages from the IPA demultiplex + * stack via the IPA_RSL_PT, and dispatches them to the per-connection components. + * + * Outbound RSL connections are initiated by sending a RSLDC_ChanRqd primitive + * to the component running the RSL_Emulation.main() function. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index 0604440..f42b7fd 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -1,5 +1,16 @@ module RSL_Types { +/* GSUP_Types, defining abstract TTCN-3 data types for the A-bis RSL protocol. + * + * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; diff --git a/library/RTP_CodecPort.ttcn b/library/RTP_CodecPort.ttcn index f9293f4..8f85fd9 100644 --- a/library/RTP_CodecPort.ttcn +++ b/library/RTP_CodecPort.ttcn @@ -1,5 +1,16 @@ module RTP_CodecPort { +/* Simple RTP Codec Port, translating between raw UDP primitives with + * octetstring payload towards the IPL4asp provider, and RTP primitives + * which carry the decoded abstract RTP data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from IPL4asp_PortType all; import from IPL4asp_Types all; import from RTP_Types all; -- To view, visit https://gerrit.osmocom.org/5636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 3 20:10:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 20:10:23 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Add a MNCC Socket implementation for TTCN-3 Message-ID: Review at https://gerrit.osmocom.org/5637 Add a MNCC Socket implementation for TTCN-3 Change-Id: I8c334d4c2e630b2b779e73404c44a8df3278c614 --- A library/MNCC_CodecPort.ttcn A library/MNCC_EncDec.cc A library/MNCC_Types.ttcn A library/mncc.h M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 6 files changed, 1,054 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/5637/1 diff --git a/library/MNCC_CodecPort.ttcn b/library/MNCC_CodecPort.ttcn new file mode 100644 index 0000000..ce62e39 --- /dev/null +++ b/library/MNCC_CodecPort.ttcn @@ -0,0 +1,50 @@ +module MNCC_CodecPort { + +import from MNCC_Types all; +import from UD_PortType all; +import from UD_Types all; + +type record MNCC_send_data { + MNCC_PDU data, + integer id +}; + +private function MNCC_to_UD(in MNCC_send_data pin, out UD_send_data pout) { + pout.id := pin.id; + pout.data := enc_MNCC_PDU(pin.data); +} with { extension "prototype(fast)" } + +private function UD_to_MNCC(in UD_send_data pin, out MNCC_send_data pout) { + pout.id := pin.id; + pout.data := dec_MNCC_PDU(pin.data); +} with { extension "prototype(fast)" } + + +type port MNCC_CODEC_PT message { + out UD_close; + out UD_listen; + in UD_listen_result; + out UD_shutdown; + out UD_connect; + in UD_connect_result; + inout MNCC_send_data; + in UD_connected; +} with { extension "user UD_PT + out ( + UD_close -> UD_close:simple; + UD_listen -> UD_listen:simple; + UD_shutdown -> UD_shutdown:simple; + UD_connect -> UD_connect:simple; + MNCC_send_data -> UD_send_data: function(MNCC_to_UD) + ) + in ( + UD_listen_result -> UD_listen_result:simple; + UD_connect_result -> UD_connect_result:simple; + UD_send_data -> MNCC_send_data: function(UD_to_MNCC); + UD_connected -> UD_connected:simple + )" + +}; + + +} diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc new file mode 100644 index 0000000..eec3897 --- /dev/null +++ b/library/MNCC_EncDec.cc @@ -0,0 +1,308 @@ +#include "mncc.h" +#include "MNCC_Types.hh" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +namespace MNCC__Types { + +static void enc_bcap(struct gsm_mncc_bearer_cap *out, const MNCC__bearer__cap& in) +{ + out->transfer = in.transfer(); + out->mode = in.mode(); + out->coding = in.coding(); + out->radio = in.radio(); + out->speech_ctm = in.speech__ctm(); + + for (int i = 0; i < in.speech__ver().lengthof(); i++) + out->speech_ver[i] = in.speech__ver()[i]; + + if (in.data().is_value()) { + MNCC__bearer__cap__data data = in.data(); + out->data.rate_adaption = (gsm48_bcap_ra) (int) data.rate__adaptation(); + out->data.sig_access = (gsm48_bcap_sig_access) (int) data.sig__access(); + out->data.async = data.async(); + out->data.nr_stop_bits = data.nr__stop__bits(); + out->data.nr_data_bits = data.nr__data__bits(); + out->data.user_rate = (gsm48_bcap_user_rate) (int) data.user__rate(); + out->data.parity = (gsm48_bcap_parity) (int) data.parity(); + out->data.interm_rate = (gsm48_bcap_interm_rate) (int) data.interm__rate(); + out->data.transp = (gsm48_bcap_transp) (int) data.transp(); + out->data.modem_type = (gsm48_bcap_modem_type) (int) data.modem__type(); + } + +} + +static MNCC__bearer__cap dec_bcap(const struct gsm_mncc_bearer_cap *in) +{ + MNCC__bearer__cap__data data; + MNCC__speech__vers vers; + data = MNCC__bearer__cap__data((GSM48__bcap__ra) in->data.rate_adaption, + (GSM48__bcap__sig__access) in->data.sig_access, + in->data.async, + in->data.nr_stop_bits, + in->data.nr_data_bits, + (GSM48__bcap__user__rate) in->data.user_rate, + (GSM48__bcap__parity) in->data.parity, + (GSM48__bcap__interm__rate) in->data.interm_rate, + (GSM48__bcap__transp) in->data.transp, + (GSM48__bcap__modem__type) in->data.modem_type); + + for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++) + vers[0] = in->speech_ver[0]; + + return MNCC__bearer__cap(in->transfer, in->mode, in->coding, in->radio, in->speech_ctm, + vers, data); +} + + +static void enc_number(struct gsm_mncc_number *num, const MNCC__number& in) +{ + num->type = in.number__type(); + num->plan = in.plan(); + num->present = in.presence(); + num->screen = in.screen(); + strncpy(num->number, in.number(), sizeof(num->number)); +} + +static MNCC__number dec_number(const struct gsm_mncc_number *num) +{ + return MNCC__number(num->type, num->plan,num->present, num->screen, num->number); +} + +OCTETSTRING enc__MNCC__PDU(const MNCC__PDU& in) +{ + const MNCC__PDU__Signal& in_sig = in.u().signal(); + struct gsm_mncc mncc; + OCTETSTRING ret_val; + + memset(&mncc, 0, sizeof(mncc)); + mncc.msg_type = in.msg__type(); + + if (in_sig.is_value()) { + mncc.callref = in_sig.callref(); + if (in_sig.bearer__cap().is_value()) { + enc_bcap(&mncc.bearer_cap, in_sig.bearer__cap()); + mncc.fields |= MNCC_F_BEARER_CAP; + } + if (in_sig.called().is_value()) { + enc_number(&mncc.called, in_sig.called()); + mncc.fields |= MNCC_F_CALLED; + } + if (in_sig.calling().is_value()) { + enc_number(&mncc.calling, in_sig.calling()); + mncc.fields |= MNCC_F_CALLING; + } + if (in_sig.redirecting().is_value()) { + enc_number(&mncc.redirecting, in_sig.redirecting()); + mncc.fields |= MNCC_F_REDIRECTING; + } + if (in_sig.connected().is_value()) { + enc_number(&mncc.connected, in_sig.connected()); + mncc.fields |= MNCC_F_CONNECTED; + } + if (in_sig.cause().is_value()) { + const MNCC__cause &cause = in_sig.cause(); + TTCN_Buffer ttcn_buffer(cause.diag()); + mncc.cause.location = cause.location(); + mncc.cause.coding = cause.coding(); + mncc.cause.rec = cause.rec(); + mncc.cause.rec_val = cause.rec__val(); + mncc.cause.value = cause.val(); + mncc.cause.diag_len = ttcn_buffer.get_len(); + if (mncc.cause.diag_len > (int) sizeof(mncc.cause.diag)) { + TTCN_error("MNCC diagnostics length %u too long", mncc.cause.diag_len); + mncc.cause.diag_len = sizeof(mncc.cause.diag); + } + memcpy(mncc.cause.diag, ttcn_buffer.get_data(), ttcn_buffer.get_len()); + mncc.fields |= MNCC_F_CAUSE; + } + if (in_sig.progress().is_value()) { + const MNCC__progress &progress = in_sig.progress(); + mncc.progress.coding = progress.coding(); + mncc.progress.location = progress.location(); + mncc.progress.descr = progress.descr(); + mncc.fields |= MNCC_F_PROGRESS; + } + if (in_sig.useruser().is_value()) { + const MNCC__useruser &useruser = in_sig.useruser(); + mncc.useruser.proto = useruser.proto(); + strncpy(mncc.useruser.info, useruser.info(), sizeof(mncc.useruser.info)); + mncc.fields |= MNCC_F_USERUSER; + } + if (in_sig.facility().is_value()) { + const CHARSTRING &fac = in_sig.facility(); + strncpy(mncc.facility.info, fac, sizeof(mncc.facility.info)); + mncc.facility.len = strlen(mncc.facility.info); + mncc.fields |= MNCC_F_FACILITY; + } + if (in_sig.cccap().is_value()) { + const MNCC__cccap &cccap = in_sig.cccap(); + mncc.cccap.dtmf = cccap.dtmf(); + mncc.cccap.pcp = cccap.pcp(); + mncc.fields |= MNCC_F_CCCAP; + } + if (in_sig.ssversion().is_value()) { + const CHARSTRING &ssv = in_sig.ssversion(); + strncpy(mncc.ssversion.info, ssv, sizeof(mncc.ssversion.info)); + mncc.ssversion.len = strlen(mncc.ssversion.info); + mncc.fields |= MNCC_F_SSVERSION; + } + mncc.clir.sup = in_sig.clir__sup(); + mncc.clir.inv = in_sig.clir__inv(); + if (in_sig.signal().is_value()) { + const INTEGER &sig = in_sig.signal(); + mncc.signal = sig; + mncc.fields |= MNCC_F_SIGNAL; + } + if (in_sig.keypad().is_value()) { + const INTEGER &kpd = in_sig.keypad(); + mncc.signal = kpd; + mncc.fields |= MNCC_F_KEYPAD; + } + mncc.more = in_sig.more(); + mncc.notify = in_sig.notify(); + if (in_sig.emergency().is_value()) { + const INTEGER &emerg = in_sig.emergency(); + mncc.emergency = emerg; + mncc.fields |= MNCC_F_EMERGENCY; + } + strncpy(mncc.imsi, in_sig.imsi(), sizeof(mncc.imsi)); + mncc.lchan_type = in_sig.lchan__type(); + mncc.lchan_mode = in_sig.lchan__mode(); + ret_val = OCTETSTRING(sizeof(mncc), (uint8_t *)&mncc); + } else if (in.u().data().is_value()) { + struct gsm_data_frame data; + memset(&data, 0, sizeof(data)); + data.msg_type = in.msg__type(); + ret_val = OCTETSTRING(sizeof(data), (uint8_t *)&data); + ret_val = ret_val & in.u().data().data(); + } else if (in.u().rtp().is_value()) { + struct gsm_mncc_rtp rtp; + memset(&rtp, 0, sizeof(rtp)); + rtp.msg_type = in.msg__type(); + rtp.callref = in.u().rtp().callref(); + rtp.ip = in.u().rtp().ip(); + rtp.port = in.u().rtp().rtp__port(); + rtp.payload_type = in.u().rtp().payload__type(); + rtp.payload_msg_type = in.u().rtp().payload__msg__type(); + ret_val = OCTETSTRING(sizeof(rtp), (uint8_t *) &rtp); + } else if (in.u().hello().is_value()) { + struct gsm_mncc_hello hello; + memset(&hello, 0, sizeof(hello)); + hello.msg_type = in.msg__type(); + hello.version = in.u().hello().version(); + hello.mncc_size = in.u().hello().mncc__size(); + hello.data_frame_size = in.u().hello().data__frame__size(); + hello.called_offset = in.u().hello().called__offset(); + hello.signal_offset = in.u().hello().signal__offset(); + hello.emergency_offset = in.u().hello().emergency__offset(); + hello.lchan_type_offset = in.u().hello().lchan__type__offset(); + ret_val = OCTETSTRING(sizeof(hello), (uint8_t *) &hello); + } + + return ret_val; +} + +MNCC__PDU dec__MNCC__PDU(const OCTETSTRING& in) +{ + TTCN_Buffer ttcn_buffer(in); + const struct gsm_mncc *in_mncc; + MNCC__PDU__Signal sign; + const struct gsm_mncc_hello *in_hello; + MNCC__PDU__Hello hello; + const struct gsm_data_frame *in_data; + MNCC__PDU__Data data; + const struct gsm_mncc_rtp *in_rtp; + MNCC__PDU__Rtp rtp; + MNCC__MsgUnion u; + + in_mncc = (struct gsm_mncc *) ttcn_buffer.get_read_data(); + + switch (in_mncc->msg_type) { + case MNCC_SOCKET_HELLO: + in_hello = (const struct gsm_mncc_hello *) in_mncc; + hello = MNCC__PDU__Hello(in_hello->version, + in_hello->mncc_size, + in_hello->data_frame_size, + in_hello->called_offset, + in_hello->signal_offset, + in_hello->emergency_offset, + in_hello->lchan_type_offset); + u.hello() = hello; + break; + case GSM_TCHF_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHH_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_BAD_FRAME: + in_data = (const struct gsm_data_frame *) in_mncc; + u.data() = MNCC__PDU__Data(in_data->callref, + substr(in, offsetof(struct gsm_data_frame, data), + in.lengthof() - offsetof(struct gsm_data_frame, data))); + break; + case MNCC_RTP_CREATE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_FREE: + in_rtp = (const struct gsm_mncc_rtp *) in_mncc; + rtp = MNCC__PDU__Rtp(in_rtp->callref, in_rtp->ip, in_rtp->port, in_rtp->payload_type, + in_rtp->payload_msg_type); + u.rtp() = rtp; + break; + default: + sign.callref() = in_mncc->callref; + if (in_mncc->fields & MNCC_F_BEARER_CAP) { + sign.bearer__cap() = dec_bcap(&in_mncc->bearer_cap); + } + if (in_mncc->fields & MNCC_F_CALLED) + sign.called() = dec_number(&in_mncc->called); + if (in_mncc->fields & MNCC_F_CALLING) + sign.calling() = dec_number(&in_mncc->calling); + if (in_mncc->fields & MNCC_F_REDIRECTING) + sign.redirecting() = dec_number(&in_mncc->redirecting); + if (in_mncc->fields & MNCC_F_CONNECTED) + sign.connected() = dec_number(&in_mncc->connected); + if (in_mncc->fields & MNCC_F_CAUSE) { + sign.cause() = MNCC__cause(in_mncc->cause.location, + in_mncc->cause.coding, + in_mncc->cause.rec, + in_mncc->cause.rec_val, + in_mncc->cause.value, + OCTETSTRING(in_mncc->cause.diag_len, + (const uint8_t *)in_mncc->cause.diag)); + } + if (in_mncc->fields & MNCC_F_USERUSER) { + sign.useruser() = MNCC__useruser(in_mncc->useruser.proto, + CHARSTRING(in_mncc->useruser.info)); + } + if (in_mncc->fields & MNCC_F_PROGRESS) { + sign.progress() = MNCC__progress(in_mncc->progress.coding, + in_mncc->progress.location, + in_mncc->progress.descr); + } + if (in_mncc->fields & MNCC_F_EMERGENCY) + sign.emergency() = in_mncc->emergency; + if (in_mncc->fields & MNCC_F_FACILITY) + sign.facility() = CHARSTRING(in_mncc->facility.info); + if (in_mncc->fields & MNCC_F_SSVERSION) + sign.ssversion() = CHARSTRING(in_mncc->ssversion.info); + if (in_mncc->fields & MNCC_F_CCCAP) + sign.cccap() = MNCC__cccap(in_mncc->cccap.dtmf, in_mncc->cccap.pcp); + if (in_mncc->fields & MNCC_F_KEYPAD) + sign.keypad() = in_mncc->keypad; + if (in_mncc->fields & MNCC_F_SIGNAL) + sign.signal() = in_mncc->signal; + + sign.clir__sup() = in_mncc->clir.sup; + sign.clir__inv() = in_mncc->clir.inv; + sign.more() = in_mncc->more; + sign.notify() = in_mncc->notify; + sign.imsi() = CHARSTRING(in_mncc->imsi); + sign.lchan__type() = in_mncc->lchan_type; + sign.lchan__mode() = in_mncc->lchan_mode; + u.signal() = sign; + break; + } + return MNCC__PDU(in_mncc->msg_type, u); +} + +} diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn new file mode 100644 index 0000000..956a1ae --- /dev/null +++ b/library/MNCC_Types.ttcn @@ -0,0 +1,387 @@ +module MNCC_Types { + +import from Osmocom_Types all; + +/* for architectures where 'int' is 32bit like x86_64 */ +type integer int with { variant "FIELDLENGTH(32)" }; + + +/* GSM 04.08 Bearer Capability: Rate Adaption */ +type enumerated GSM48_bcap_ra { + GSM48_BCAP_RA_NONE (0), + GSM48_BCAP_RA_V110_X30 (1), + GSM48_BCAP_RA_X31 (2), + GSM48_BCAP_RA_OTHER (3) +}; + +/* GSM 04.08 Bearer Capability: Signalling access protocol */ +type enumerated GSM48_bcap_sig_access { + GSM48_BCAP_SA_I440_I450 (1), + GSM48_BCAP_SA_X21 (2), + GSM48_BCAP_SA_X28_DP_IN (3), + GSM48_BCAP_SA_X28_DP_UN (4), + GSM48_BCAP_SA_X28_NDP (5), + GSM48_BCAP_SA_X32 (6) +}; + +/* GSM 04.08 Bearer Capability: User Rate */ +type enumerated GSM48_bcap_user_rate { + GSM48_BCAP_UR_300 (1), + GSM48_BCAP_UR_1200 (2), + GSM48_BCAP_UR_2400 (3), + GSM48_BCAP_UR_4800 (4), + GSM48_BCAP_UR_9600 (5), + GSM48_BCAP_UR_12000 (6), + GSM48_BCAP_UR_1200_75 (7) +}; + +/* GSM 04.08 Bearer Capability: Parity */ +type enumerated GSM48_bcap_parity { + GSM48_BCAP_PAR_ODD (0), + GSM48_BCAP_PAR_EVEN (2), + GSM48_BCAP_PAR_NONE (3), + GSM48_BCAP_PAR_ZERO (4), + GSM48_BCAP_PAR_ONE (5) +}; + +/* GSM 04.08 Bearer Capability: Intermediate Rate */ +type enumerated GSM48_bcap_interm_rate { + GSM48_BCAP_IR_8k (2), + GSM48_BCAP_IR_16k (3) +}; + +/* GSM 04.08 Bearer Capability: Transparency */ +type enumerated GSM48_bcap_transp { + GSM48_BCAP_TR_TRANSP (0), + GSM48_BCAP_TR_RLP (1), + GSM48_BCAP_TR_TR_PREF (2), + GSM48_BCAP_TR_RLP_PREF (3) +}; + +/* GSM 04.08 Bearer Capability: Modem Type */ +type enumerated GSM48_bcap_modem_type { + GSM48_BCAP_MT_NONE (0), + GSM48_BCAP_MT_V21 (1), + GSM48_BCAP_MT_V22 (2), + GSM48_BCAP_MT_V22bis (3), + GSM48_BCAP_MT_V23 (4), + GSM48_BCAP_MT_V26ter (5), + GSM48_BCAP_MT_V32 (6), + GSM48_BCAP_MT_UNDEF (7), + GSM48_BCAP_MT_AUTO_1 (8) +}; + +type enumerated MNCC_MsgType { + MNCC_SETUP_REQ ('0101'O), + MNCC_SETUP_IND ('0102'O), + MNCC_SETUP_RSP ('0103'O), + MNCC_SETUP_CNF ('0104'O), + MNCC_SETUP_COMPL_REQ ('0105'O), + MNCC_SETUP_COMPL_IND ('0106'O), + MNCC_CALL_CONF_IND ('0107'O), + MNCC_CALL_PROC_REQ ('0108'O), + MNCC_PROGRESS_REQ ('0109'O), + MNCC_ALERT_REQ ('010a'O), + MNCC_ALERT_IND ('010b'O), + MNCC_NOTIFY_REQ ('010c'O), + MNCC_NOTIFY_IND ('010d'O), + MNCC_DISC_REQ ('010e'O), + MNCC_DISC_IND ('010f'O), + MNCC_REL_REQ ('0110'O), + MNCC_REL_IND ('0111'O), + MNCC_REL_CNF ('0112'O), + MNCC_FACILITY_REQ ('0113'O), + MNCC_FACILITY_IND ('0114'O), + MNCC_START_DTMF_IND ('0115'O), + MNCC_START_DTMF_RSP ('0116'O), + MNCC_START_DTMF_REJ ('0117'O), + MNCC_STOP_DTMF_IND ('0118'O), + MNCC_STOP_DTMF_RSP ('0119'O), + MNCC_MODIFY_REQ ('011a'O), + MNCC_MODIFY_IND ('011b'O), + MNCC_MODIFY_RSP ('011c'O), + MNCC_MODIFY_CNF ('011d'O), + MNCC_MODIFY_REJ ('011e'O), + MNCC_HOLD_IND ('011f'O), + MNCC_HOLD_CNF ('0120'O), + MNCC_HOLD_REJ ('0121'O), + MNCC_RETRIEVE_IND ('0122'O), + MNCC_RETRIEVE_CNF ('0123'O), + MNCC_RETRIEVE_REJ ('0124'O), + MNCC_USERINFO_REQ ('0125'O), + MNCC_USERINFO_IND ('0126'O), + MNCC_REJ_REQ ('0127'O), + MNCC_REJ_IND ('0128'O), + + MNCC_BRIDGE ('0200'O), + MNCC_FRAME_RECV ('0201'O), + MNCC_FRAME_DROP ('0202'O), + MNCC_LCHAN_MODIFY ('0203'O), + MNCC_RTP_CREATE ('0204'O), + MNCC_RTP_CONNECT ('0205'O), + MNCC_RTP_FREE ('0206'O), + + GSM_TCHF_FRAME ('0300'O), + GSM_TCHF_FRAME_EFR ('0301'O), + GSM_TCHH_FRAME ('0302'O), + GSM_TCH_FRAME_AMR ('0303'O), + GSM_BAD_FRAME ('03ff'O), + + MNCC_SOCKET_HELLO ('0400'O) +}; + +const integer GSM_MAX_FACILITY := 128; +const integer GSM_MAX_SSVERSION := 128; +const integer GSM_MAX_USERUSER := 128; + +type record MNCC_bearer_cap_data { + GSM48_bcap_ra rate_adaptation, + GSM48_bcap_sig_access sig_access, + int async, + int nr_stop_bits, + int nr_data_bits, + GSM48_bcap_user_rate user_rate, + GSM48_bcap_parity parity, + GSM48_bcap_interm_rate interm_rate, + GSM48_bcap_transp transp, + GSM48_bcap_modem_type modem_type +}; + +type record length(0..8) of int MNCC_speech_vers; + +/* Expanded fields from GSM TS 04.08, Table 10.5.102 */ +type record MNCC_bearer_cap { + int transfer, + int mode, + int coding, + int radio, + int speech_ctm, + MNCC_speech_vers speech_ver, + MNCC_bearer_cap_data data optional +}; + +template MNCC_bearer_cap ts_MNCC_bcap_voice := { + transfer := 0, /* speech */ + mode := 0, /* circuit */ + coding := 0, /* GSM standard */ + radio := 3, /* FR/HR, FR preferred */ + speech_ctm := 0, /* not supported */ + speech_ver := { 0, 2, 4, 1, 5 }, + data := omit +}; + +type record MNCC_number { + GSM48_type_of_number number_type, + GSM48_num_plan_ind plan, + GSM48_present_ind presence, + GSM48_screening_ind screen, + charstring number +}; + +/* 24.008 10.5.118 */ +type enumerated GSM48_num_plan_ind { + GSM48_NUMPLAN_UNKNOWN (0), + GSM48_NUMPLAN_E164 (1), + GSM48_NUMPLAN_X121 (3), + GSM48_NUMPLAN_F69 (4), + GSM48_NUMPLAN_NATIONAL (8), + GSM48_NUMPLAN_PRIVATE (9), + GSM48_NUMPLAN_CTS (11), + GSM48_NUMPLAN_RESERVED (15) +}; + +/* 04.08 10.5.118 */ +type enumerated GSM48_type_of_number { + GSM48_TON_UNKNOWN (0), + GSM48_TON_INTERNATIONAL (1), + GSM48_TON_NATIONAL (2), + GSM48_TON_NETWORK_SPECIFIC (3), + GSM48_TON_SHORT_CODE (4) +}; + +/* 04.08 10.5.120 */ +type enumerated GSM48_present_ind { + GSM48_PRES_IND_ALLOWED (0), + GSM48_PRES_IND_RESTRICTED (1), + GSM48_PRES_IND_NUM_NOT_AVAIL (2), + GSM48_PRES_IND_RESERVED (3) +}; + +type enumerated GSM48_screening_ind { + GSM48_SCR_IND_NOT_SCREENED (0), + GSM48_SCR_IND_VERIF_PASSED (1), + GSM48_SCR_IND_VERIF_FAILED (2), + GSM48_SCR_IND_NETW_PROVIDED (3) +}; + + +template MNCC_number ts_MNCC_number(charstring number, + GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL, + GSM48_num_plan_ind npi := GSM48_NUMPLAN_E164, + GSM48_present_ind pres := GSM48_PRES_IND_ALLOWED, + GSM48_screening_ind screen := GSM48_SCR_IND_NOT_SCREENED) := { + number_type := ton, + plan := npi, + presence := pres, + screen := screen, + number := number +} + +type record MNCC_cause { + int location, + int coding, + int rec, + int rec_val, + int val, + octetstring diag +}; + +type record MNCC_useruser { + int proto, + charstring info +}; + +type record MNCC_progress { + int coding, + int location, + int descr +}; + +type record MNCC_cccap { + int dtmf, + int pcp +}; + +type enumerated MNCC_bcap { + GSM_MNCC_BCAP_SPEECH (0), + GSM_MNCC_BCAP_UNR_DIG (1), + GSM_MNCC_BCAP_AUDIO (2), + GSM_MNCC_BCAP_FAX_G3 (3), + GSM_MNCC_BCAP_OTHER_ITC (4), + GSM_MNCC_BCAP_RESERVED (7) +}; + + +type record MNCC_PDU_Signal { + uint32_t callref, + + MNCC_bearer_cap bearer_cap optional, + MNCC_number called optional, + MNCC_number calling optional, + MNCC_number redirecting optional, + MNCC_number connected optional, + MNCC_cause cause optional, + MNCC_progress progress optional, + MNCC_useruser useruser optional, + charstring facility optional, + MNCC_cccap cccap optional, + charstring ssversion optional, + + int clir_sup, + int clir_inv, + int signal optional, + + int keypad optional, + int more, + int notify (0..127), + int emergency optional, + charstring imsi, + + uint8_t lchan_type, /* empty in OSmoMSC */ + uint8_t lchan_mode /* empty in OsmoMSC */ +}; + + +type record MNCC_PDU_Data { + uint32_t callref, + octetstring data +}; + +type record MNCC_PDU_Rtp { + uint32_t callref, + uint32_t ip, + uint16_t rtp_port, + uint32_t payload_type, + uint32_t payload_msg_type +}; + +type record MNCC_PDU_Hello { + uint32_t version, + uint32_t mncc_size, + uint32_t data_frame_size, + uint32_t called_offset, + uint32_t signal_offset, + uint32_t emergency_offset, + uint32_t lchan_type_offset +}; + + +type union MNCC_MsgUnion { + MNCC_PDU_Signal signal, + MNCC_PDU_Data data, + MNCC_PDU_Rtp rtp, + MNCC_PDU_Hello hello +}; + + +type record MNCC_PDU { + MNCC_MsgType msg_type, + MNCC_MsgUnion u +} with { variant (u) "CROSSTAG( + hello, msg_type = MNCC_SOCKET_HELLO; + rtp, { msg_type = MNCC_RTP_CREATE, + msg_type = MNCC_RTP_CONNECT, + msg_type = MNCC_RTP_FREE }; + data, { msg_type = GSM_TCHF_FRAME, + msg_type = GSM_TCHF_FRAME_EFR, + msg_type = GSM_TCHH_FRAME, + msg_type = GSM_TCH_FRAME_AMR, + msg_type = GSM_BAD_FRAME }; + signal, OTHERWISE + )" +}; + +external function enc_MNCC_PDU(in MNCC_PDU pdu) return octetstring; + +external function dec_MNCC_PDU(in octetstring stream) return MNCC_PDU; + + +template MNCC_PDU ts_MNCC_Sign(MNCC_MsgType msg_type, MNCC_PDU_Signal sign) := { + msg_type := msg_type, + u := { + signal := sign + } +} + +template MNCC_PDU ts_MNCC_SETUP(uint32_t call_id, charstring called, charstring calling) := { + msg_type := MNCC_SETUP_REQ, + u := { + signal := { + callref := call_id, + bearer_cap := ts_MNCC_bcap_voice, + called := valueof(ts_MNCC_number(called)), + calling := valueof(ts_MNCC_number(calling)), + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "1234", + lchan_type := 0, + lchan_mode := 0 + } + } +}; + + +} with { encode "RAW" ; variant "FIELDORDER(msb)" } diff --git a/library/mncc.h b/library/mncc.h new file mode 100644 index 0000000..3e00db8 --- /dev/null +++ b/library/mncc.h @@ -0,0 +1,304 @@ +/* This file contains sections copied from + * libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h, + * libosmocore/include/osmocom/gsm/mncc.h and + * openbsc/include/openbsc/mncc.h + */ + +#include + +/* GSM 04.08 Bearer Capability: Rate Adaption */ +enum gsm48_bcap_ra { + GSM48_BCAP_RA_NONE = 0, + GSM48_BCAP_RA_V110_X30 = 1, + GSM48_BCAP_RA_X31 = 2, + GSM48_BCAP_RA_OTHER = 3, +}; + +/* GSM 04.08 Bearer Capability: Signalling access protocol */ +enum gsm48_bcap_sig_access { + GSM48_BCAP_SA_I440_I450 = 1, + GSM48_BCAP_SA_X21 = 2, + GSM48_BCAP_SA_X28_DP_IN = 3, + GSM48_BCAP_SA_X28_DP_UN = 4, + GSM48_BCAP_SA_X28_NDP = 5, + GSM48_BCAP_SA_X32 = 6, +}; + +/* GSM 04.08 Bearer Capability: User Rate */ +enum gsm48_bcap_user_rate { + GSM48_BCAP_UR_300 = 1, + GSM48_BCAP_UR_1200 = 2, + GSM48_BCAP_UR_2400 = 3, + GSM48_BCAP_UR_4800 = 4, + GSM48_BCAP_UR_9600 = 5, + GSM48_BCAP_UR_12000 = 6, + GSM48_BCAP_UR_1200_75 = 7, +}; + +/* GSM 04.08 Bearer Capability: Parity */ +enum gsm48_bcap_parity { + GSM48_BCAP_PAR_ODD = 0, + GSM48_BCAP_PAR_EVEN = 2, + GSM48_BCAP_PAR_NONE = 3, + GSM48_BCAP_PAR_ZERO = 4, + GSM48_BCAP_PAR_ONE = 5, +}; + +/* GSM 04.08 Bearer Capability: Intermediate Rate */ +enum gsm48_bcap_interm_rate { + GSM48_BCAP_IR_8k = 2, + GSM48_BCAP_IR_16k = 3, +}; + +/* GSM 04.08 Bearer Capability: Transparency */ +enum gsm48_bcap_transp { + GSM48_BCAP_TR_TRANSP = 0, + GSM48_BCAP_TR_RLP = 1, + GSM48_BCAP_TR_TR_PREF = 2, + GSM48_BCAP_TR_RLP_PREF = 3, +}; + +/* GSM 04.08 Bearer Capability: Modem Type */ +enum gsm48_bcap_modem_type { + GSM48_BCAP_MT_NONE = 0, + GSM48_BCAP_MT_V21 = 1, + GSM48_BCAP_MT_V22 = 2, + GSM48_BCAP_MT_V22bis = 3, + GSM48_BCAP_MT_V23 = 4, + GSM48_BCAP_MT_V26ter = 5, + GSM48_BCAP_MT_V32 = 6, + GSM48_BCAP_MT_UNDEF = 7, + GSM48_BCAP_MT_AUTO_1 = 8, +}; + + + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +/* Expanded fields from GSM TS 04.08, Table 10.5.102 */ +struct gsm_mncc_bearer_cap { + int transfer; /* Information Transfer Capability */ + int mode; /* Transfer Mode */ + int coding; /* Coding Standard */ + int radio; /* Radio Channel Requirement */ + int speech_ctm; /* CTM text telephony indication */ + int speech_ver[8]; /* Speech version indication */ + struct { + enum gsm48_bcap_ra rate_adaption; + enum gsm48_bcap_sig_access sig_access; + int async; + int nr_stop_bits; + int nr_data_bits; + enum gsm48_bcap_user_rate user_rate; + enum gsm48_bcap_parity parity; + enum gsm48_bcap_interm_rate interm_rate; + enum gsm48_bcap_transp transp; + enum gsm48_bcap_modem_type modem_type; + } data; +}; + +struct gsm_mncc_number { + int type; + int plan; + int present; + int screen; + char number[33]; +}; + +struct gsm_mncc_cause { + int location; + int coding; + int rec; + int rec_val; + int value; + int diag_len; + char diag[32]; +}; + +struct gsm_mncc_useruser { + int proto; + char info[GSM_MAX_USERUSER + 1]; /* + termination char */ +}; + +struct gsm_mncc_progress { + int coding; + int location; + int descr; +}; + +struct gsm_mncc_facility { + int len; + char info[GSM_MAX_FACILITY]; +}; + +struct gsm_mncc_ssversion { + int len; + char info[GSM_MAX_SSVERSION]; +}; + +struct gsm_mncc_cccap { + int dtmf; + int pcp; +}; + +enum { + GSM_MNCC_BCAP_SPEECH = 0, + GSM_MNCC_BCAP_UNR_DIG = 1, + GSM_MNCC_BCAP_AUDIO = 2, + GSM_MNCC_BCAP_FAX_G3 = 3, + GSM_MNCC_BCAP_OTHER_ITC = 5, + GSM_MNCC_BCAP_RESERVED = 7, +}; + + +#define MNCC_SETUP_REQ 0x0101 +#define MNCC_SETUP_IND 0x0102 +#define MNCC_SETUP_RSP 0x0103 +#define MNCC_SETUP_CNF 0x0104 +#define MNCC_SETUP_COMPL_REQ 0x0105 +#define MNCC_SETUP_COMPL_IND 0x0106 +/* MNCC_REJ_* is perfomed via MNCC_REL_* */ +#define MNCC_CALL_CONF_IND 0x0107 +#define MNCC_CALL_PROC_REQ 0x0108 +#define MNCC_PROGRESS_REQ 0x0109 +#define MNCC_ALERT_REQ 0x010a +#define MNCC_ALERT_IND 0x010b +#define MNCC_NOTIFY_REQ 0x010c +#define MNCC_NOTIFY_IND 0x010d +#define MNCC_DISC_REQ 0x010e +#define MNCC_DISC_IND 0x010f +#define MNCC_REL_REQ 0x0110 +#define MNCC_REL_IND 0x0111 +#define MNCC_REL_CNF 0x0112 +#define MNCC_FACILITY_REQ 0x0113 +#define MNCC_FACILITY_IND 0x0114 +#define MNCC_START_DTMF_IND 0x0115 +#define MNCC_START_DTMF_RSP 0x0116 +#define MNCC_START_DTMF_REJ 0x0117 +#define MNCC_STOP_DTMF_IND 0x0118 +#define MNCC_STOP_DTMF_RSP 0x0119 +#define MNCC_MODIFY_REQ 0x011a +#define MNCC_MODIFY_IND 0x011b +#define MNCC_MODIFY_RSP 0x011c +#define MNCC_MODIFY_CNF 0x011d +#define MNCC_MODIFY_REJ 0x011e +#define MNCC_HOLD_IND 0x011f +#define MNCC_HOLD_CNF 0x0120 +#define MNCC_HOLD_REJ 0x0121 +#define MNCC_RETRIEVE_IND 0x0122 +#define MNCC_RETRIEVE_CNF 0x0123 +#define MNCC_RETRIEVE_REJ 0x0124 +#define MNCC_USERINFO_REQ 0x0125 +#define MNCC_USERINFO_IND 0x0126 +#define MNCC_REJ_REQ 0x0127 +#define MNCC_REJ_IND 0x0128 + +#define MNCC_BRIDGE 0x0200 +#define MNCC_FRAME_RECV 0x0201 +#define MNCC_FRAME_DROP 0x0202 +#define MNCC_LCHAN_MODIFY 0x0203 +#define MNCC_RTP_CREATE 0x0204 +#define MNCC_RTP_CONNECT 0x0205 +#define MNCC_RTP_FREE 0x0206 + +#define GSM_TCHF_FRAME 0x0300 +#define GSM_TCHF_FRAME_EFR 0x0301 +#define GSM_TCHH_FRAME 0x0302 +#define GSM_TCH_FRAME_AMR 0x0303 +#define GSM_BAD_FRAME 0x03ff + +#define MNCC_SOCKET_HELLO 0x0400 + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +#define MNCC_F_BEARER_CAP 0x0001 +#define MNCC_F_CALLED 0x0002 +#define MNCC_F_CALLING 0x0004 +#define MNCC_F_REDIRECTING 0x0008 +#define MNCC_F_CONNECTED 0x0010 +#define MNCC_F_CAUSE 0x0020 +#define MNCC_F_USERUSER 0x0040 +#define MNCC_F_PROGRESS 0x0080 +#define MNCC_F_EMERGENCY 0x0100 +#define MNCC_F_FACILITY 0x0200 +#define MNCC_F_SSVERSION 0x0400 +#define MNCC_F_CCCAP 0x0800 +#define MNCC_F_KEYPAD 0x1000 +#define MNCC_F_SIGNAL 0x2000 + +struct gsm_mncc { + /* context based information */ + uint32_t msg_type; + uint32_t callref; + + /* which fields are present */ + uint32_t fields; + + /* data derived informations (MNCC_F_ based) */ + struct gsm_mncc_bearer_cap bearer_cap; + struct gsm_mncc_number called; + struct gsm_mncc_number calling; + struct gsm_mncc_number redirecting; + struct gsm_mncc_number connected; + struct gsm_mncc_cause cause; + struct gsm_mncc_progress progress; + struct gsm_mncc_useruser useruser; + struct gsm_mncc_facility facility; + struct gsm_mncc_cccap cccap; + struct gsm_mncc_ssversion ssversion; + struct { + int sup; + int inv; + } clir; + int signal; + + /* data derived information, not MNCC_F based */ + int keypad; + int more; + int notify; /* 0..127 */ + int emergency; + char imsi[16]; + + unsigned char lchan_type; + unsigned char lchan_mode; +}; + +struct gsm_data_frame { + uint32_t msg_type; + uint32_t callref; + unsigned char data[0]; +}; + +#define MNCC_SOCK_VERSION 5 +struct gsm_mncc_hello { + uint32_t msg_type; + uint32_t version; + + /* send the sizes of the structs */ + uint32_t mncc_size; + uint32_t data_frame_size; + + /* send some offsets */ + uint32_t called_offset; + uint32_t signal_offset; + uint32_t emergency_offset; + uint32_t lchan_type_offset; +}; + +struct gsm_mncc_rtp { + uint32_t msg_type; + uint32_t callref; + uint32_t ip; + uint16_t port; + uint32_t payload_type; + uint32_t payload_msg_type; +}; + +struct gsm_mncc_bridge { + uint32_t msg_type; + uint32_t callref[2]; +}; diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 62d8453..6625b11 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -11,9 +11,9 @@ done } -#DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src -#FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn" -#gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src +FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn" +gen_links $DIR $FILES DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h" @@ -54,5 +54,5 @@ DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h" gen_links $DIR $FILES diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index 132da3b..f271c88 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/5637 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c334d4c2e630b2b779e73404c44a8df3278c614 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 3 20:18:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 20:18:18 +0000 Subject: osmo-ttcn3-hacks[master]: Add comments with short module description on top of each file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 20:18:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 20:18:31 +0000 Subject: osmo-ttcn3-hacks[master]: Add a MNCC Socket implementation for TTCN-3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5637 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c334d4c2e630b2b779e73404c44a8df3278c614 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 20:18:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 20:18:33 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Add a MNCC Socket implementation for TTCN-3 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add a MNCC Socket implementation for TTCN-3 ...................................................................... Add a MNCC Socket implementation for TTCN-3 Change-Id: I8c334d4c2e630b2b779e73404c44a8df3278c614 --- A library/MNCC_CodecPort.ttcn A library/MNCC_EncDec.cc A library/MNCC_Types.ttcn A library/mncc.h M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 6 files changed, 1,054 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_CodecPort.ttcn b/library/MNCC_CodecPort.ttcn new file mode 100644 index 0000000..ce62e39 --- /dev/null +++ b/library/MNCC_CodecPort.ttcn @@ -0,0 +1,50 @@ +module MNCC_CodecPort { + +import from MNCC_Types all; +import from UD_PortType all; +import from UD_Types all; + +type record MNCC_send_data { + MNCC_PDU data, + integer id +}; + +private function MNCC_to_UD(in MNCC_send_data pin, out UD_send_data pout) { + pout.id := pin.id; + pout.data := enc_MNCC_PDU(pin.data); +} with { extension "prototype(fast)" } + +private function UD_to_MNCC(in UD_send_data pin, out MNCC_send_data pout) { + pout.id := pin.id; + pout.data := dec_MNCC_PDU(pin.data); +} with { extension "prototype(fast)" } + + +type port MNCC_CODEC_PT message { + out UD_close; + out UD_listen; + in UD_listen_result; + out UD_shutdown; + out UD_connect; + in UD_connect_result; + inout MNCC_send_data; + in UD_connected; +} with { extension "user UD_PT + out ( + UD_close -> UD_close:simple; + UD_listen -> UD_listen:simple; + UD_shutdown -> UD_shutdown:simple; + UD_connect -> UD_connect:simple; + MNCC_send_data -> UD_send_data: function(MNCC_to_UD) + ) + in ( + UD_listen_result -> UD_listen_result:simple; + UD_connect_result -> UD_connect_result:simple; + UD_send_data -> MNCC_send_data: function(UD_to_MNCC); + UD_connected -> UD_connected:simple + )" + +}; + + +} diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc new file mode 100644 index 0000000..eec3897 --- /dev/null +++ b/library/MNCC_EncDec.cc @@ -0,0 +1,308 @@ +#include "mncc.h" +#include "MNCC_Types.hh" + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +namespace MNCC__Types { + +static void enc_bcap(struct gsm_mncc_bearer_cap *out, const MNCC__bearer__cap& in) +{ + out->transfer = in.transfer(); + out->mode = in.mode(); + out->coding = in.coding(); + out->radio = in.radio(); + out->speech_ctm = in.speech__ctm(); + + for (int i = 0; i < in.speech__ver().lengthof(); i++) + out->speech_ver[i] = in.speech__ver()[i]; + + if (in.data().is_value()) { + MNCC__bearer__cap__data data = in.data(); + out->data.rate_adaption = (gsm48_bcap_ra) (int) data.rate__adaptation(); + out->data.sig_access = (gsm48_bcap_sig_access) (int) data.sig__access(); + out->data.async = data.async(); + out->data.nr_stop_bits = data.nr__stop__bits(); + out->data.nr_data_bits = data.nr__data__bits(); + out->data.user_rate = (gsm48_bcap_user_rate) (int) data.user__rate(); + out->data.parity = (gsm48_bcap_parity) (int) data.parity(); + out->data.interm_rate = (gsm48_bcap_interm_rate) (int) data.interm__rate(); + out->data.transp = (gsm48_bcap_transp) (int) data.transp(); + out->data.modem_type = (gsm48_bcap_modem_type) (int) data.modem__type(); + } + +} + +static MNCC__bearer__cap dec_bcap(const struct gsm_mncc_bearer_cap *in) +{ + MNCC__bearer__cap__data data; + MNCC__speech__vers vers; + data = MNCC__bearer__cap__data((GSM48__bcap__ra) in->data.rate_adaption, + (GSM48__bcap__sig__access) in->data.sig_access, + in->data.async, + in->data.nr_stop_bits, + in->data.nr_data_bits, + (GSM48__bcap__user__rate) in->data.user_rate, + (GSM48__bcap__parity) in->data.parity, + (GSM48__bcap__interm__rate) in->data.interm_rate, + (GSM48__bcap__transp) in->data.transp, + (GSM48__bcap__modem__type) in->data.modem_type); + + for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++) + vers[0] = in->speech_ver[0]; + + return MNCC__bearer__cap(in->transfer, in->mode, in->coding, in->radio, in->speech_ctm, + vers, data); +} + + +static void enc_number(struct gsm_mncc_number *num, const MNCC__number& in) +{ + num->type = in.number__type(); + num->plan = in.plan(); + num->present = in.presence(); + num->screen = in.screen(); + strncpy(num->number, in.number(), sizeof(num->number)); +} + +static MNCC__number dec_number(const struct gsm_mncc_number *num) +{ + return MNCC__number(num->type, num->plan,num->present, num->screen, num->number); +} + +OCTETSTRING enc__MNCC__PDU(const MNCC__PDU& in) +{ + const MNCC__PDU__Signal& in_sig = in.u().signal(); + struct gsm_mncc mncc; + OCTETSTRING ret_val; + + memset(&mncc, 0, sizeof(mncc)); + mncc.msg_type = in.msg__type(); + + if (in_sig.is_value()) { + mncc.callref = in_sig.callref(); + if (in_sig.bearer__cap().is_value()) { + enc_bcap(&mncc.bearer_cap, in_sig.bearer__cap()); + mncc.fields |= MNCC_F_BEARER_CAP; + } + if (in_sig.called().is_value()) { + enc_number(&mncc.called, in_sig.called()); + mncc.fields |= MNCC_F_CALLED; + } + if (in_sig.calling().is_value()) { + enc_number(&mncc.calling, in_sig.calling()); + mncc.fields |= MNCC_F_CALLING; + } + if (in_sig.redirecting().is_value()) { + enc_number(&mncc.redirecting, in_sig.redirecting()); + mncc.fields |= MNCC_F_REDIRECTING; + } + if (in_sig.connected().is_value()) { + enc_number(&mncc.connected, in_sig.connected()); + mncc.fields |= MNCC_F_CONNECTED; + } + if (in_sig.cause().is_value()) { + const MNCC__cause &cause = in_sig.cause(); + TTCN_Buffer ttcn_buffer(cause.diag()); + mncc.cause.location = cause.location(); + mncc.cause.coding = cause.coding(); + mncc.cause.rec = cause.rec(); + mncc.cause.rec_val = cause.rec__val(); + mncc.cause.value = cause.val(); + mncc.cause.diag_len = ttcn_buffer.get_len(); + if (mncc.cause.diag_len > (int) sizeof(mncc.cause.diag)) { + TTCN_error("MNCC diagnostics length %u too long", mncc.cause.diag_len); + mncc.cause.diag_len = sizeof(mncc.cause.diag); + } + memcpy(mncc.cause.diag, ttcn_buffer.get_data(), ttcn_buffer.get_len()); + mncc.fields |= MNCC_F_CAUSE; + } + if (in_sig.progress().is_value()) { + const MNCC__progress &progress = in_sig.progress(); + mncc.progress.coding = progress.coding(); + mncc.progress.location = progress.location(); + mncc.progress.descr = progress.descr(); + mncc.fields |= MNCC_F_PROGRESS; + } + if (in_sig.useruser().is_value()) { + const MNCC__useruser &useruser = in_sig.useruser(); + mncc.useruser.proto = useruser.proto(); + strncpy(mncc.useruser.info, useruser.info(), sizeof(mncc.useruser.info)); + mncc.fields |= MNCC_F_USERUSER; + } + if (in_sig.facility().is_value()) { + const CHARSTRING &fac = in_sig.facility(); + strncpy(mncc.facility.info, fac, sizeof(mncc.facility.info)); + mncc.facility.len = strlen(mncc.facility.info); + mncc.fields |= MNCC_F_FACILITY; + } + if (in_sig.cccap().is_value()) { + const MNCC__cccap &cccap = in_sig.cccap(); + mncc.cccap.dtmf = cccap.dtmf(); + mncc.cccap.pcp = cccap.pcp(); + mncc.fields |= MNCC_F_CCCAP; + } + if (in_sig.ssversion().is_value()) { + const CHARSTRING &ssv = in_sig.ssversion(); + strncpy(mncc.ssversion.info, ssv, sizeof(mncc.ssversion.info)); + mncc.ssversion.len = strlen(mncc.ssversion.info); + mncc.fields |= MNCC_F_SSVERSION; + } + mncc.clir.sup = in_sig.clir__sup(); + mncc.clir.inv = in_sig.clir__inv(); + if (in_sig.signal().is_value()) { + const INTEGER &sig = in_sig.signal(); + mncc.signal = sig; + mncc.fields |= MNCC_F_SIGNAL; + } + if (in_sig.keypad().is_value()) { + const INTEGER &kpd = in_sig.keypad(); + mncc.signal = kpd; + mncc.fields |= MNCC_F_KEYPAD; + } + mncc.more = in_sig.more(); + mncc.notify = in_sig.notify(); + if (in_sig.emergency().is_value()) { + const INTEGER &emerg = in_sig.emergency(); + mncc.emergency = emerg; + mncc.fields |= MNCC_F_EMERGENCY; + } + strncpy(mncc.imsi, in_sig.imsi(), sizeof(mncc.imsi)); + mncc.lchan_type = in_sig.lchan__type(); + mncc.lchan_mode = in_sig.lchan__mode(); + ret_val = OCTETSTRING(sizeof(mncc), (uint8_t *)&mncc); + } else if (in.u().data().is_value()) { + struct gsm_data_frame data; + memset(&data, 0, sizeof(data)); + data.msg_type = in.msg__type(); + ret_val = OCTETSTRING(sizeof(data), (uint8_t *)&data); + ret_val = ret_val & in.u().data().data(); + } else if (in.u().rtp().is_value()) { + struct gsm_mncc_rtp rtp; + memset(&rtp, 0, sizeof(rtp)); + rtp.msg_type = in.msg__type(); + rtp.callref = in.u().rtp().callref(); + rtp.ip = in.u().rtp().ip(); + rtp.port = in.u().rtp().rtp__port(); + rtp.payload_type = in.u().rtp().payload__type(); + rtp.payload_msg_type = in.u().rtp().payload__msg__type(); + ret_val = OCTETSTRING(sizeof(rtp), (uint8_t *) &rtp); + } else if (in.u().hello().is_value()) { + struct gsm_mncc_hello hello; + memset(&hello, 0, sizeof(hello)); + hello.msg_type = in.msg__type(); + hello.version = in.u().hello().version(); + hello.mncc_size = in.u().hello().mncc__size(); + hello.data_frame_size = in.u().hello().data__frame__size(); + hello.called_offset = in.u().hello().called__offset(); + hello.signal_offset = in.u().hello().signal__offset(); + hello.emergency_offset = in.u().hello().emergency__offset(); + hello.lchan_type_offset = in.u().hello().lchan__type__offset(); + ret_val = OCTETSTRING(sizeof(hello), (uint8_t *) &hello); + } + + return ret_val; +} + +MNCC__PDU dec__MNCC__PDU(const OCTETSTRING& in) +{ + TTCN_Buffer ttcn_buffer(in); + const struct gsm_mncc *in_mncc; + MNCC__PDU__Signal sign; + const struct gsm_mncc_hello *in_hello; + MNCC__PDU__Hello hello; + const struct gsm_data_frame *in_data; + MNCC__PDU__Data data; + const struct gsm_mncc_rtp *in_rtp; + MNCC__PDU__Rtp rtp; + MNCC__MsgUnion u; + + in_mncc = (struct gsm_mncc *) ttcn_buffer.get_read_data(); + + switch (in_mncc->msg_type) { + case MNCC_SOCKET_HELLO: + in_hello = (const struct gsm_mncc_hello *) in_mncc; + hello = MNCC__PDU__Hello(in_hello->version, + in_hello->mncc_size, + in_hello->data_frame_size, + in_hello->called_offset, + in_hello->signal_offset, + in_hello->emergency_offset, + in_hello->lchan_type_offset); + u.hello() = hello; + break; + case GSM_TCHF_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHH_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_BAD_FRAME: + in_data = (const struct gsm_data_frame *) in_mncc; + u.data() = MNCC__PDU__Data(in_data->callref, + substr(in, offsetof(struct gsm_data_frame, data), + in.lengthof() - offsetof(struct gsm_data_frame, data))); + break; + case MNCC_RTP_CREATE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_FREE: + in_rtp = (const struct gsm_mncc_rtp *) in_mncc; + rtp = MNCC__PDU__Rtp(in_rtp->callref, in_rtp->ip, in_rtp->port, in_rtp->payload_type, + in_rtp->payload_msg_type); + u.rtp() = rtp; + break; + default: + sign.callref() = in_mncc->callref; + if (in_mncc->fields & MNCC_F_BEARER_CAP) { + sign.bearer__cap() = dec_bcap(&in_mncc->bearer_cap); + } + if (in_mncc->fields & MNCC_F_CALLED) + sign.called() = dec_number(&in_mncc->called); + if (in_mncc->fields & MNCC_F_CALLING) + sign.calling() = dec_number(&in_mncc->calling); + if (in_mncc->fields & MNCC_F_REDIRECTING) + sign.redirecting() = dec_number(&in_mncc->redirecting); + if (in_mncc->fields & MNCC_F_CONNECTED) + sign.connected() = dec_number(&in_mncc->connected); + if (in_mncc->fields & MNCC_F_CAUSE) { + sign.cause() = MNCC__cause(in_mncc->cause.location, + in_mncc->cause.coding, + in_mncc->cause.rec, + in_mncc->cause.rec_val, + in_mncc->cause.value, + OCTETSTRING(in_mncc->cause.diag_len, + (const uint8_t *)in_mncc->cause.diag)); + } + if (in_mncc->fields & MNCC_F_USERUSER) { + sign.useruser() = MNCC__useruser(in_mncc->useruser.proto, + CHARSTRING(in_mncc->useruser.info)); + } + if (in_mncc->fields & MNCC_F_PROGRESS) { + sign.progress() = MNCC__progress(in_mncc->progress.coding, + in_mncc->progress.location, + in_mncc->progress.descr); + } + if (in_mncc->fields & MNCC_F_EMERGENCY) + sign.emergency() = in_mncc->emergency; + if (in_mncc->fields & MNCC_F_FACILITY) + sign.facility() = CHARSTRING(in_mncc->facility.info); + if (in_mncc->fields & MNCC_F_SSVERSION) + sign.ssversion() = CHARSTRING(in_mncc->ssversion.info); + if (in_mncc->fields & MNCC_F_CCCAP) + sign.cccap() = MNCC__cccap(in_mncc->cccap.dtmf, in_mncc->cccap.pcp); + if (in_mncc->fields & MNCC_F_KEYPAD) + sign.keypad() = in_mncc->keypad; + if (in_mncc->fields & MNCC_F_SIGNAL) + sign.signal() = in_mncc->signal; + + sign.clir__sup() = in_mncc->clir.sup; + sign.clir__inv() = in_mncc->clir.inv; + sign.more() = in_mncc->more; + sign.notify() = in_mncc->notify; + sign.imsi() = CHARSTRING(in_mncc->imsi); + sign.lchan__type() = in_mncc->lchan_type; + sign.lchan__mode() = in_mncc->lchan_mode; + u.signal() = sign; + break; + } + return MNCC__PDU(in_mncc->msg_type, u); +} + +} diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn new file mode 100644 index 0000000..956a1ae --- /dev/null +++ b/library/MNCC_Types.ttcn @@ -0,0 +1,387 @@ +module MNCC_Types { + +import from Osmocom_Types all; + +/* for architectures where 'int' is 32bit like x86_64 */ +type integer int with { variant "FIELDLENGTH(32)" }; + + +/* GSM 04.08 Bearer Capability: Rate Adaption */ +type enumerated GSM48_bcap_ra { + GSM48_BCAP_RA_NONE (0), + GSM48_BCAP_RA_V110_X30 (1), + GSM48_BCAP_RA_X31 (2), + GSM48_BCAP_RA_OTHER (3) +}; + +/* GSM 04.08 Bearer Capability: Signalling access protocol */ +type enumerated GSM48_bcap_sig_access { + GSM48_BCAP_SA_I440_I450 (1), + GSM48_BCAP_SA_X21 (2), + GSM48_BCAP_SA_X28_DP_IN (3), + GSM48_BCAP_SA_X28_DP_UN (4), + GSM48_BCAP_SA_X28_NDP (5), + GSM48_BCAP_SA_X32 (6) +}; + +/* GSM 04.08 Bearer Capability: User Rate */ +type enumerated GSM48_bcap_user_rate { + GSM48_BCAP_UR_300 (1), + GSM48_BCAP_UR_1200 (2), + GSM48_BCAP_UR_2400 (3), + GSM48_BCAP_UR_4800 (4), + GSM48_BCAP_UR_9600 (5), + GSM48_BCAP_UR_12000 (6), + GSM48_BCAP_UR_1200_75 (7) +}; + +/* GSM 04.08 Bearer Capability: Parity */ +type enumerated GSM48_bcap_parity { + GSM48_BCAP_PAR_ODD (0), + GSM48_BCAP_PAR_EVEN (2), + GSM48_BCAP_PAR_NONE (3), + GSM48_BCAP_PAR_ZERO (4), + GSM48_BCAP_PAR_ONE (5) +}; + +/* GSM 04.08 Bearer Capability: Intermediate Rate */ +type enumerated GSM48_bcap_interm_rate { + GSM48_BCAP_IR_8k (2), + GSM48_BCAP_IR_16k (3) +}; + +/* GSM 04.08 Bearer Capability: Transparency */ +type enumerated GSM48_bcap_transp { + GSM48_BCAP_TR_TRANSP (0), + GSM48_BCAP_TR_RLP (1), + GSM48_BCAP_TR_TR_PREF (2), + GSM48_BCAP_TR_RLP_PREF (3) +}; + +/* GSM 04.08 Bearer Capability: Modem Type */ +type enumerated GSM48_bcap_modem_type { + GSM48_BCAP_MT_NONE (0), + GSM48_BCAP_MT_V21 (1), + GSM48_BCAP_MT_V22 (2), + GSM48_BCAP_MT_V22bis (3), + GSM48_BCAP_MT_V23 (4), + GSM48_BCAP_MT_V26ter (5), + GSM48_BCAP_MT_V32 (6), + GSM48_BCAP_MT_UNDEF (7), + GSM48_BCAP_MT_AUTO_1 (8) +}; + +type enumerated MNCC_MsgType { + MNCC_SETUP_REQ ('0101'O), + MNCC_SETUP_IND ('0102'O), + MNCC_SETUP_RSP ('0103'O), + MNCC_SETUP_CNF ('0104'O), + MNCC_SETUP_COMPL_REQ ('0105'O), + MNCC_SETUP_COMPL_IND ('0106'O), + MNCC_CALL_CONF_IND ('0107'O), + MNCC_CALL_PROC_REQ ('0108'O), + MNCC_PROGRESS_REQ ('0109'O), + MNCC_ALERT_REQ ('010a'O), + MNCC_ALERT_IND ('010b'O), + MNCC_NOTIFY_REQ ('010c'O), + MNCC_NOTIFY_IND ('010d'O), + MNCC_DISC_REQ ('010e'O), + MNCC_DISC_IND ('010f'O), + MNCC_REL_REQ ('0110'O), + MNCC_REL_IND ('0111'O), + MNCC_REL_CNF ('0112'O), + MNCC_FACILITY_REQ ('0113'O), + MNCC_FACILITY_IND ('0114'O), + MNCC_START_DTMF_IND ('0115'O), + MNCC_START_DTMF_RSP ('0116'O), + MNCC_START_DTMF_REJ ('0117'O), + MNCC_STOP_DTMF_IND ('0118'O), + MNCC_STOP_DTMF_RSP ('0119'O), + MNCC_MODIFY_REQ ('011a'O), + MNCC_MODIFY_IND ('011b'O), + MNCC_MODIFY_RSP ('011c'O), + MNCC_MODIFY_CNF ('011d'O), + MNCC_MODIFY_REJ ('011e'O), + MNCC_HOLD_IND ('011f'O), + MNCC_HOLD_CNF ('0120'O), + MNCC_HOLD_REJ ('0121'O), + MNCC_RETRIEVE_IND ('0122'O), + MNCC_RETRIEVE_CNF ('0123'O), + MNCC_RETRIEVE_REJ ('0124'O), + MNCC_USERINFO_REQ ('0125'O), + MNCC_USERINFO_IND ('0126'O), + MNCC_REJ_REQ ('0127'O), + MNCC_REJ_IND ('0128'O), + + MNCC_BRIDGE ('0200'O), + MNCC_FRAME_RECV ('0201'O), + MNCC_FRAME_DROP ('0202'O), + MNCC_LCHAN_MODIFY ('0203'O), + MNCC_RTP_CREATE ('0204'O), + MNCC_RTP_CONNECT ('0205'O), + MNCC_RTP_FREE ('0206'O), + + GSM_TCHF_FRAME ('0300'O), + GSM_TCHF_FRAME_EFR ('0301'O), + GSM_TCHH_FRAME ('0302'O), + GSM_TCH_FRAME_AMR ('0303'O), + GSM_BAD_FRAME ('03ff'O), + + MNCC_SOCKET_HELLO ('0400'O) +}; + +const integer GSM_MAX_FACILITY := 128; +const integer GSM_MAX_SSVERSION := 128; +const integer GSM_MAX_USERUSER := 128; + +type record MNCC_bearer_cap_data { + GSM48_bcap_ra rate_adaptation, + GSM48_bcap_sig_access sig_access, + int async, + int nr_stop_bits, + int nr_data_bits, + GSM48_bcap_user_rate user_rate, + GSM48_bcap_parity parity, + GSM48_bcap_interm_rate interm_rate, + GSM48_bcap_transp transp, + GSM48_bcap_modem_type modem_type +}; + +type record length(0..8) of int MNCC_speech_vers; + +/* Expanded fields from GSM TS 04.08, Table 10.5.102 */ +type record MNCC_bearer_cap { + int transfer, + int mode, + int coding, + int radio, + int speech_ctm, + MNCC_speech_vers speech_ver, + MNCC_bearer_cap_data data optional +}; + +template MNCC_bearer_cap ts_MNCC_bcap_voice := { + transfer := 0, /* speech */ + mode := 0, /* circuit */ + coding := 0, /* GSM standard */ + radio := 3, /* FR/HR, FR preferred */ + speech_ctm := 0, /* not supported */ + speech_ver := { 0, 2, 4, 1, 5 }, + data := omit +}; + +type record MNCC_number { + GSM48_type_of_number number_type, + GSM48_num_plan_ind plan, + GSM48_present_ind presence, + GSM48_screening_ind screen, + charstring number +}; + +/* 24.008 10.5.118 */ +type enumerated GSM48_num_plan_ind { + GSM48_NUMPLAN_UNKNOWN (0), + GSM48_NUMPLAN_E164 (1), + GSM48_NUMPLAN_X121 (3), + GSM48_NUMPLAN_F69 (4), + GSM48_NUMPLAN_NATIONAL (8), + GSM48_NUMPLAN_PRIVATE (9), + GSM48_NUMPLAN_CTS (11), + GSM48_NUMPLAN_RESERVED (15) +}; + +/* 04.08 10.5.118 */ +type enumerated GSM48_type_of_number { + GSM48_TON_UNKNOWN (0), + GSM48_TON_INTERNATIONAL (1), + GSM48_TON_NATIONAL (2), + GSM48_TON_NETWORK_SPECIFIC (3), + GSM48_TON_SHORT_CODE (4) +}; + +/* 04.08 10.5.120 */ +type enumerated GSM48_present_ind { + GSM48_PRES_IND_ALLOWED (0), + GSM48_PRES_IND_RESTRICTED (1), + GSM48_PRES_IND_NUM_NOT_AVAIL (2), + GSM48_PRES_IND_RESERVED (3) +}; + +type enumerated GSM48_screening_ind { + GSM48_SCR_IND_NOT_SCREENED (0), + GSM48_SCR_IND_VERIF_PASSED (1), + GSM48_SCR_IND_VERIF_FAILED (2), + GSM48_SCR_IND_NETW_PROVIDED (3) +}; + + +template MNCC_number ts_MNCC_number(charstring number, + GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL, + GSM48_num_plan_ind npi := GSM48_NUMPLAN_E164, + GSM48_present_ind pres := GSM48_PRES_IND_ALLOWED, + GSM48_screening_ind screen := GSM48_SCR_IND_NOT_SCREENED) := { + number_type := ton, + plan := npi, + presence := pres, + screen := screen, + number := number +} + +type record MNCC_cause { + int location, + int coding, + int rec, + int rec_val, + int val, + octetstring diag +}; + +type record MNCC_useruser { + int proto, + charstring info +}; + +type record MNCC_progress { + int coding, + int location, + int descr +}; + +type record MNCC_cccap { + int dtmf, + int pcp +}; + +type enumerated MNCC_bcap { + GSM_MNCC_BCAP_SPEECH (0), + GSM_MNCC_BCAP_UNR_DIG (1), + GSM_MNCC_BCAP_AUDIO (2), + GSM_MNCC_BCAP_FAX_G3 (3), + GSM_MNCC_BCAP_OTHER_ITC (4), + GSM_MNCC_BCAP_RESERVED (7) +}; + + +type record MNCC_PDU_Signal { + uint32_t callref, + + MNCC_bearer_cap bearer_cap optional, + MNCC_number called optional, + MNCC_number calling optional, + MNCC_number redirecting optional, + MNCC_number connected optional, + MNCC_cause cause optional, + MNCC_progress progress optional, + MNCC_useruser useruser optional, + charstring facility optional, + MNCC_cccap cccap optional, + charstring ssversion optional, + + int clir_sup, + int clir_inv, + int signal optional, + + int keypad optional, + int more, + int notify (0..127), + int emergency optional, + charstring imsi, + + uint8_t lchan_type, /* empty in OSmoMSC */ + uint8_t lchan_mode /* empty in OsmoMSC */ +}; + + +type record MNCC_PDU_Data { + uint32_t callref, + octetstring data +}; + +type record MNCC_PDU_Rtp { + uint32_t callref, + uint32_t ip, + uint16_t rtp_port, + uint32_t payload_type, + uint32_t payload_msg_type +}; + +type record MNCC_PDU_Hello { + uint32_t version, + uint32_t mncc_size, + uint32_t data_frame_size, + uint32_t called_offset, + uint32_t signal_offset, + uint32_t emergency_offset, + uint32_t lchan_type_offset +}; + + +type union MNCC_MsgUnion { + MNCC_PDU_Signal signal, + MNCC_PDU_Data data, + MNCC_PDU_Rtp rtp, + MNCC_PDU_Hello hello +}; + + +type record MNCC_PDU { + MNCC_MsgType msg_type, + MNCC_MsgUnion u +} with { variant (u) "CROSSTAG( + hello, msg_type = MNCC_SOCKET_HELLO; + rtp, { msg_type = MNCC_RTP_CREATE, + msg_type = MNCC_RTP_CONNECT, + msg_type = MNCC_RTP_FREE }; + data, { msg_type = GSM_TCHF_FRAME, + msg_type = GSM_TCHF_FRAME_EFR, + msg_type = GSM_TCHH_FRAME, + msg_type = GSM_TCH_FRAME_AMR, + msg_type = GSM_BAD_FRAME }; + signal, OTHERWISE + )" +}; + +external function enc_MNCC_PDU(in MNCC_PDU pdu) return octetstring; + +external function dec_MNCC_PDU(in octetstring stream) return MNCC_PDU; + + +template MNCC_PDU ts_MNCC_Sign(MNCC_MsgType msg_type, MNCC_PDU_Signal sign) := { + msg_type := msg_type, + u := { + signal := sign + } +} + +template MNCC_PDU ts_MNCC_SETUP(uint32_t call_id, charstring called, charstring calling) := { + msg_type := MNCC_SETUP_REQ, + u := { + signal := { + callref := call_id, + bearer_cap := ts_MNCC_bcap_voice, + called := valueof(ts_MNCC_number(called)), + calling := valueof(ts_MNCC_number(calling)), + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "1234", + lchan_type := 0, + lchan_mode := 0 + } + } +}; + + +} with { encode "RAW" ; variant "FIELDORDER(msb)" } diff --git a/library/mncc.h b/library/mncc.h new file mode 100644 index 0000000..3e00db8 --- /dev/null +++ b/library/mncc.h @@ -0,0 +1,304 @@ +/* This file contains sections copied from + * libosmocore/include/osmocom/gsm/protocol/gsm_04_08.h, + * libosmocore/include/osmocom/gsm/mncc.h and + * openbsc/include/openbsc/mncc.h + */ + +#include + +/* GSM 04.08 Bearer Capability: Rate Adaption */ +enum gsm48_bcap_ra { + GSM48_BCAP_RA_NONE = 0, + GSM48_BCAP_RA_V110_X30 = 1, + GSM48_BCAP_RA_X31 = 2, + GSM48_BCAP_RA_OTHER = 3, +}; + +/* GSM 04.08 Bearer Capability: Signalling access protocol */ +enum gsm48_bcap_sig_access { + GSM48_BCAP_SA_I440_I450 = 1, + GSM48_BCAP_SA_X21 = 2, + GSM48_BCAP_SA_X28_DP_IN = 3, + GSM48_BCAP_SA_X28_DP_UN = 4, + GSM48_BCAP_SA_X28_NDP = 5, + GSM48_BCAP_SA_X32 = 6, +}; + +/* GSM 04.08 Bearer Capability: User Rate */ +enum gsm48_bcap_user_rate { + GSM48_BCAP_UR_300 = 1, + GSM48_BCAP_UR_1200 = 2, + GSM48_BCAP_UR_2400 = 3, + GSM48_BCAP_UR_4800 = 4, + GSM48_BCAP_UR_9600 = 5, + GSM48_BCAP_UR_12000 = 6, + GSM48_BCAP_UR_1200_75 = 7, +}; + +/* GSM 04.08 Bearer Capability: Parity */ +enum gsm48_bcap_parity { + GSM48_BCAP_PAR_ODD = 0, + GSM48_BCAP_PAR_EVEN = 2, + GSM48_BCAP_PAR_NONE = 3, + GSM48_BCAP_PAR_ZERO = 4, + GSM48_BCAP_PAR_ONE = 5, +}; + +/* GSM 04.08 Bearer Capability: Intermediate Rate */ +enum gsm48_bcap_interm_rate { + GSM48_BCAP_IR_8k = 2, + GSM48_BCAP_IR_16k = 3, +}; + +/* GSM 04.08 Bearer Capability: Transparency */ +enum gsm48_bcap_transp { + GSM48_BCAP_TR_TRANSP = 0, + GSM48_BCAP_TR_RLP = 1, + GSM48_BCAP_TR_TR_PREF = 2, + GSM48_BCAP_TR_RLP_PREF = 3, +}; + +/* GSM 04.08 Bearer Capability: Modem Type */ +enum gsm48_bcap_modem_type { + GSM48_BCAP_MT_NONE = 0, + GSM48_BCAP_MT_V21 = 1, + GSM48_BCAP_MT_V22 = 2, + GSM48_BCAP_MT_V22bis = 3, + GSM48_BCAP_MT_V23 = 4, + GSM48_BCAP_MT_V26ter = 5, + GSM48_BCAP_MT_V32 = 6, + GSM48_BCAP_MT_UNDEF = 7, + GSM48_BCAP_MT_AUTO_1 = 8, +}; + + + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +/* Expanded fields from GSM TS 04.08, Table 10.5.102 */ +struct gsm_mncc_bearer_cap { + int transfer; /* Information Transfer Capability */ + int mode; /* Transfer Mode */ + int coding; /* Coding Standard */ + int radio; /* Radio Channel Requirement */ + int speech_ctm; /* CTM text telephony indication */ + int speech_ver[8]; /* Speech version indication */ + struct { + enum gsm48_bcap_ra rate_adaption; + enum gsm48_bcap_sig_access sig_access; + int async; + int nr_stop_bits; + int nr_data_bits; + enum gsm48_bcap_user_rate user_rate; + enum gsm48_bcap_parity parity; + enum gsm48_bcap_interm_rate interm_rate; + enum gsm48_bcap_transp transp; + enum gsm48_bcap_modem_type modem_type; + } data; +}; + +struct gsm_mncc_number { + int type; + int plan; + int present; + int screen; + char number[33]; +}; + +struct gsm_mncc_cause { + int location; + int coding; + int rec; + int rec_val; + int value; + int diag_len; + char diag[32]; +}; + +struct gsm_mncc_useruser { + int proto; + char info[GSM_MAX_USERUSER + 1]; /* + termination char */ +}; + +struct gsm_mncc_progress { + int coding; + int location; + int descr; +}; + +struct gsm_mncc_facility { + int len; + char info[GSM_MAX_FACILITY]; +}; + +struct gsm_mncc_ssversion { + int len; + char info[GSM_MAX_SSVERSION]; +}; + +struct gsm_mncc_cccap { + int dtmf; + int pcp; +}; + +enum { + GSM_MNCC_BCAP_SPEECH = 0, + GSM_MNCC_BCAP_UNR_DIG = 1, + GSM_MNCC_BCAP_AUDIO = 2, + GSM_MNCC_BCAP_FAX_G3 = 3, + GSM_MNCC_BCAP_OTHER_ITC = 5, + GSM_MNCC_BCAP_RESERVED = 7, +}; + + +#define MNCC_SETUP_REQ 0x0101 +#define MNCC_SETUP_IND 0x0102 +#define MNCC_SETUP_RSP 0x0103 +#define MNCC_SETUP_CNF 0x0104 +#define MNCC_SETUP_COMPL_REQ 0x0105 +#define MNCC_SETUP_COMPL_IND 0x0106 +/* MNCC_REJ_* is perfomed via MNCC_REL_* */ +#define MNCC_CALL_CONF_IND 0x0107 +#define MNCC_CALL_PROC_REQ 0x0108 +#define MNCC_PROGRESS_REQ 0x0109 +#define MNCC_ALERT_REQ 0x010a +#define MNCC_ALERT_IND 0x010b +#define MNCC_NOTIFY_REQ 0x010c +#define MNCC_NOTIFY_IND 0x010d +#define MNCC_DISC_REQ 0x010e +#define MNCC_DISC_IND 0x010f +#define MNCC_REL_REQ 0x0110 +#define MNCC_REL_IND 0x0111 +#define MNCC_REL_CNF 0x0112 +#define MNCC_FACILITY_REQ 0x0113 +#define MNCC_FACILITY_IND 0x0114 +#define MNCC_START_DTMF_IND 0x0115 +#define MNCC_START_DTMF_RSP 0x0116 +#define MNCC_START_DTMF_REJ 0x0117 +#define MNCC_STOP_DTMF_IND 0x0118 +#define MNCC_STOP_DTMF_RSP 0x0119 +#define MNCC_MODIFY_REQ 0x011a +#define MNCC_MODIFY_IND 0x011b +#define MNCC_MODIFY_RSP 0x011c +#define MNCC_MODIFY_CNF 0x011d +#define MNCC_MODIFY_REJ 0x011e +#define MNCC_HOLD_IND 0x011f +#define MNCC_HOLD_CNF 0x0120 +#define MNCC_HOLD_REJ 0x0121 +#define MNCC_RETRIEVE_IND 0x0122 +#define MNCC_RETRIEVE_CNF 0x0123 +#define MNCC_RETRIEVE_REJ 0x0124 +#define MNCC_USERINFO_REQ 0x0125 +#define MNCC_USERINFO_IND 0x0126 +#define MNCC_REJ_REQ 0x0127 +#define MNCC_REJ_IND 0x0128 + +#define MNCC_BRIDGE 0x0200 +#define MNCC_FRAME_RECV 0x0201 +#define MNCC_FRAME_DROP 0x0202 +#define MNCC_LCHAN_MODIFY 0x0203 +#define MNCC_RTP_CREATE 0x0204 +#define MNCC_RTP_CONNECT 0x0205 +#define MNCC_RTP_FREE 0x0206 + +#define GSM_TCHF_FRAME 0x0300 +#define GSM_TCHF_FRAME_EFR 0x0301 +#define GSM_TCHH_FRAME 0x0302 +#define GSM_TCH_FRAME_AMR 0x0303 +#define GSM_BAD_FRAME 0x03ff + +#define MNCC_SOCKET_HELLO 0x0400 + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +#define MNCC_F_BEARER_CAP 0x0001 +#define MNCC_F_CALLED 0x0002 +#define MNCC_F_CALLING 0x0004 +#define MNCC_F_REDIRECTING 0x0008 +#define MNCC_F_CONNECTED 0x0010 +#define MNCC_F_CAUSE 0x0020 +#define MNCC_F_USERUSER 0x0040 +#define MNCC_F_PROGRESS 0x0080 +#define MNCC_F_EMERGENCY 0x0100 +#define MNCC_F_FACILITY 0x0200 +#define MNCC_F_SSVERSION 0x0400 +#define MNCC_F_CCCAP 0x0800 +#define MNCC_F_KEYPAD 0x1000 +#define MNCC_F_SIGNAL 0x2000 + +struct gsm_mncc { + /* context based information */ + uint32_t msg_type; + uint32_t callref; + + /* which fields are present */ + uint32_t fields; + + /* data derived informations (MNCC_F_ based) */ + struct gsm_mncc_bearer_cap bearer_cap; + struct gsm_mncc_number called; + struct gsm_mncc_number calling; + struct gsm_mncc_number redirecting; + struct gsm_mncc_number connected; + struct gsm_mncc_cause cause; + struct gsm_mncc_progress progress; + struct gsm_mncc_useruser useruser; + struct gsm_mncc_facility facility; + struct gsm_mncc_cccap cccap; + struct gsm_mncc_ssversion ssversion; + struct { + int sup; + int inv; + } clir; + int signal; + + /* data derived information, not MNCC_F based */ + int keypad; + int more; + int notify; /* 0..127 */ + int emergency; + char imsi[16]; + + unsigned char lchan_type; + unsigned char lchan_mode; +}; + +struct gsm_data_frame { + uint32_t msg_type; + uint32_t callref; + unsigned char data[0]; +}; + +#define MNCC_SOCK_VERSION 5 +struct gsm_mncc_hello { + uint32_t msg_type; + uint32_t version; + + /* send the sizes of the structs */ + uint32_t mncc_size; + uint32_t data_frame_size; + + /* send some offsets */ + uint32_t called_offset; + uint32_t signal_offset; + uint32_t emergency_offset; + uint32_t lchan_type_offset; +}; + +struct gsm_mncc_rtp { + uint32_t msg_type; + uint32_t callref; + uint32_t ip; + uint16_t port; + uint32_t payload_type; + uint32_t payload_msg_type; +}; + +struct gsm_mncc_bridge { + uint32_t msg_type; + uint32_t callref[2]; +}; diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 62d8453..6625b11 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -11,9 +11,9 @@ done } -#DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src -#FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn" -#gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src +FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn" +gen_links $DIR $FILES DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h" @@ -54,5 +54,5 @@ DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h" gen_links $DIR $FILES diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index 132da3b..f271c88 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/5637 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c334d4c2e630b2b779e73404c44a8df3278c614 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 3 20:18:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 3 Jan 2018 20:18:33 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Add comments with short module description on top of each file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add comments with short module description on top of each file ...................................................................... Add comments with short module description on top of each file Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3 --- M library/BSSAP_CodecPort.ttcn M library/BSSMAP_Emulation.ttcn M library/BSSMAP_Templates.ttcn M library/GSUP_Types.ttcn M library/IPA_CodecPort.ttcn M library/IPA_Emulation.ttcn M library/IPA_Types.ttcn M library/IuUP_Emulation.ttcn M library/IuUP_Types.ttcn M library/L3_Templates.ttcn M library/MGCP_CodecPort.ttcn M library/MGCP_Templates.ttcn M library/MGCP_Types.ttcn M library/Osmocom_CTRL_Functions.ttcn M library/Osmocom_CTRL_Types.ttcn M library/RSL_Emulation.ttcn M library/RSL_Types.ttcn M library/RTP_CodecPort.ttcn 18 files changed, 233 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSAP_CodecPort.ttcn b/library/BSSAP_CodecPort.ttcn index 7470dd4..41bd171 100644 --- a/library/BSSAP_CodecPort.ttcn +++ b/library/BSSAP_CodecPort.ttcn @@ -1,5 +1,16 @@ module BSSAP_CodecPort { +/* Simple BSSAP Codec Port, translating between raw SCCP primitives with + * octetstring payload towards the SCCP provider, and BSSAP-SCCP primitives + * which carry the decoded BSSAP data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index ba7e27c..153fb86 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -1,5 +1,35 @@ module BSSMAP_Emulation { +/* BSSMAP Emulation, runs on top of BSSAP_CodecPort. It multiplexes/demultiplexes + * the individual connections, so there can be separate TTCN-3 components handling + * each of the connections. + * + * The BSSMAP_Emulation.main() function processes SCCP primitives from the SCCP + * stack via the BSSAP_CodecPort, and dispatches them to the per-connection components. + * + * Outbound BSSAP/SCCP connections are initiated by sending a BSSAP_Conn_Req primitive + * to the component running the BSSMAP_Emulation.main() function. + * + * For each new inbound connections, the BssmapOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound connection, it can + * do so by registering an "expect" with the expected Layer 3 (DTAP) payload. This is e.g. useful + * if you are simulating BTS + MSC, and first trigger a connection from BTS/RSL side in a + * component which then subsequently should also handle the MSC emulation. + * + * Inbound Unit Data messages (such as are dispatched to the BssmapOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from SCCP_Emulation all; import from SCCPasp_Types all; import from BSSAP_Types all; diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index bb1b537..cb6dde8 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -1,5 +1,14 @@ module BSSMAP_Templates { +/* BSSMAP Templates, building on top of BSSAP_Types from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index b994d1f..fc524a1 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -1,5 +1,17 @@ module GSUP_Types { +/* GSUP_Types, defining abstract TTCN-3 data types for the GSUP protocol. + * + * GSUP is a non-standard protocol used between OsmoMSC/OsmoSGSN and OsmoHLR + * in order to replace the complex TCAP/MAP protocol. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; diff --git a/library/IPA_CodecPort.ttcn b/library/IPA_CodecPort.ttcn index 9ba9d18..f9a242b 100644 --- a/library/IPA_CodecPort.ttcn +++ b/library/IPA_CodecPort.ttcn @@ -1,5 +1,16 @@ module IPA_CodecPort { +/* Simple IPA Codec Port, translating between raw TCP octetstring payload + * towards the IPL4asp port provider, and IPA primitives + * which carry the decoded IPA data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from IPL4asp_PortType all; import from IPL4asp_Types all; import from IPA_Types all; diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn index 9bad69f..b40818f 100644 --- a/library/IPA_Emulation.ttcn +++ b/library/IPA_Emulation.ttcn @@ -2,10 +2,18 @@ /* This module implements the IPA multiplex protocol on top of TCP, using the IPL4asp * test-port as provider. It implements both client and server roles, as well was the CCM - * handshake for establishing the identity of the client to the server. It already knows - * certain well-known sub-protocols such as A-bis RSL, MGCP and SCCP and transcodes messages - * so the user can work with abstract data types rather than binary messages. It handles - * multiple packets inside one TCP segment */ + * handshake for establishing the identity of the client to the server. + * + * It already knows certain well-known sub-protocols such as A-bis RSL, MGCP and SCCP and + * GSUP. IT hence transcodes messages so the user can work with abstract data types rather + * than binary messages. It handles multiple packets inside one TCP segment. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ import from IPA_Types all; import from IPA_CodecPort all; diff --git a/library/IPA_Types.ttcn b/library/IPA_Types.ttcn index 5522e87..933a3fe 100644 --- a/library/IPA_Types.ttcn +++ b/library/IPA_Types.ttcn @@ -1,7 +1,16 @@ -/* (C) 2017 by Harald Welte */ - module IPA_Types { +/* Definitions of abstract data types for the IPA multiplex protocol. + * Uses the TITAN "RAW" codec syntax to auto-generate encoder and decoder + * functions. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from Osmocom_Types all; type enumerated IpaStreamId { diff --git a/library/IuUP_Emulation.ttcn b/library/IuUP_Emulation.ttcn index ec25e49..77cd739 100644 --- a/library/IuUP_Emulation.ttcn +++ b/library/IuUP_Emulation.ttcn @@ -1,5 +1,19 @@ module IuUP_Emulation { +/* IuUP emulation, uses the encoding/decoding from IuUP_Types. + * + * rather than running in a separate component with related primitives, + * we just implement a set of functions and data types which can be used + * by other code (such as an RTP endpoint) to implement IuUP support. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from Osmocom_Types all; import from IuUP_Types all; diff --git a/library/IuUP_Types.ttcn b/library/IuUP_Types.ttcn index 933b64f..b822ddf 100644 --- a/library/IuUP_Types.ttcn +++ b/library/IuUP_Types.ttcn @@ -1,5 +1,16 @@ module IuUP_Types { +/* Definition of abstract types for the IuUP protocol as specified in + * 3GPP TS 25.415. Uses the TITAN "RAW" codec to auto-generate encoder/decoder + * functions. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from Osmocom_Types all; import from General_Types all; diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index f0f3d38..19cb99f 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -1,5 +1,14 @@ module L3_Templates { +/* L3 Templates, building on top of MobileL3*_Types from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; diff --git a/library/MGCP_CodecPort.ttcn b/library/MGCP_CodecPort.ttcn index 06072af..416ac36 100644 --- a/library/MGCP_CodecPort.ttcn +++ b/library/MGCP_CodecPort.ttcn @@ -1,5 +1,16 @@ module MGCP_CodecPort { +/* Simple MGCP Codec Port, translating between raw UDP primitives with + * octetstring payload towards the IPL4asp provider, and MGCP primitives + * which carry the decoded MGCP data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from IPL4asp_PortType all; import from IPL4asp_Types all; import from MGCP_Types all; diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 3fa7bd1..f4c6e0f 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -1,5 +1,15 @@ module MGCP_Templates { +/* MGCP Templates, building on top of MGCP_Types (Osmocom) and SDP_Types from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from MGCP_Types all; import from SDP_Types all; diff --git a/library/MGCP_Types.ttcn b/library/MGCP_Types.ttcn index 22141f4..9d1a4e1 100644 --- a/library/MGCP_Types.ttcn +++ b/library/MGCP_Types.ttcn @@ -1,4 +1,16 @@ module MGCP_Types { + +/* Definition of abstract types for the MGCP protocol as specified in + * IETF RFC 3435. Uses the TITAN "TEXT" codec to auto-generate encoder/decoder + * functions, as well as the SDP type definitions and coder from Ericsson. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from SDP_Types all; type charstring MgcpVerb ("EPCF", "CRCX", "MDCX", "DLCX", "RQNT", "NTFY", diff --git a/library/Osmocom_CTRL_Functions.ttcn b/library/Osmocom_CTRL_Functions.ttcn index b8e68e3..70885c9 100644 --- a/library/Osmocom_CTRL_Functions.ttcn +++ b/library/Osmocom_CTRL_Functions.ttcn @@ -1,4 +1,25 @@ module Osmocom_CTRL_Functions { + +/* Definition of helper functions for the Osmocom CTRL interface. + * + * As opposed to many other parts of the Osmocom TTCN-3 code base, this module + * implements blocking functions, instead of asynchronous functions. The + * rationale for this is simple: One normally wants to inquire a value or set + * a value and not continue the main program until that operation is complete. + * + * CTRL is a machine-type protocol on how external programs can interact with + * an Osmocom program in a structured way. It is intended for programmatic + * access (by other software), as opposed to the VTY interface intended for + * human consumption. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + import from Osmocom_CTRL_Types all; import from IPA_Emulation all; diff --git a/library/Osmocom_CTRL_Types.ttcn b/library/Osmocom_CTRL_Types.ttcn index 4d2406d..1d77668 100644 --- a/library/Osmocom_CTRL_Types.ttcn +++ b/library/Osmocom_CTRL_Types.ttcn @@ -1,5 +1,15 @@ module Osmocom_CTRL_Types { +/* Definition of abstract types for the CTRL protocol as used in Osmocom. + * Uses the TITAN "TEXT" codec to auto-generate encoder/decoder functions. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + type charstring CtrlVerb ("GET", "SET") with { /* see https://www.eclipse.org/forums/index.php/t/1088893/ on why this * match expression is needed here */ diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index a42ca1e..7c5a168 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -1,5 +1,22 @@ module RSL_Emulation { +/* RSL Emulation, runs on top of IPA_Emulation. It multiplexes/demultiplexes + * the individual connections (logical channels), so there can be separate TTCN-3 components + * handling each of the connections. + * + * The RSL_Emulation.main() function processes RSL messages from the IPA demultiplex + * stack via the IPA_RSL_PT, and dispatches them to the per-connection components. + * + * Outbound RSL connections are initiated by sending a RSLDC_ChanRqd primitive + * to the component running the RSL_Emulation.main() function. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index 0604440..f42b7fd 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -1,5 +1,16 @@ module RSL_Types { +/* GSUP_Types, defining abstract TTCN-3 data types for the A-bis RSL protocol. + * + * RSL is a 3GPP standard protocol used between BTS and BSC in a GSM network. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from General_Types all; import from Osmocom_Types all; import from GSM_Types all; diff --git a/library/RTP_CodecPort.ttcn b/library/RTP_CodecPort.ttcn index f9293f4..8f85fd9 100644 --- a/library/RTP_CodecPort.ttcn +++ b/library/RTP_CodecPort.ttcn @@ -1,5 +1,16 @@ module RTP_CodecPort { +/* Simple RTP Codec Port, translating between raw UDP primitives with + * octetstring payload towards the IPL4asp provider, and RTP primitives + * which carry the decoded abstract RTP data types as payload. + * + * (C) 2017 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from IPL4asp_PortType all; import from IPL4asp_Types all; import from RTP_Types all; -- To view, visit https://gerrit.osmocom.org/5636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id934d7a763b619d52cbec7de439b3708225b81f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 3 21:50:24 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Jan 2018 21:50:24 +0000 Subject: gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/5634/1/README.md File README.md: Line 23: To join the group with any e-mail addressi, use this link: Typo: addressi -> address. -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 3 21:51:22 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 3 Jan 2018 21:51:22 +0000 Subject: gr-gsm[master]: README.md: Turn URLs into hyperlinks (video, mailing list) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 23:34:20 2018 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Jan 2018 23:34:20 +0000 Subject: openbsc[master]: configure.ac: Add subdir-objects In-Reply-To: References: Message-ID: Patch Set 1: Hi Harald, Please accept my apologies for taking your time, I should have tested this better and searched trough the archives before submitting this for review. I was after Wireshark bug #14105 [1] where they mention a change you have submitted [2] and then in another gerrit review Vadim pointed me to a message in the baseband devel mailing list [3] where he says that the OsmoNiTB generates SI5/SI5ter messages without the l2 pseudo length. So while trying to compile and install OpenBSC I encounter this automake warning and without knowing that this project is legacy and in bugfix mode I've decided to sumbitt this change. [1] https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=14105 [2] https://code.wireshark.org/review/#/c/21767/ [3] http://lists.osmocom.org/pipermail/baseband-devel/2017-December/005459.html -- To view, visit https://gerrit.osmocom.org/5633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7911669662f474ee60d211665fb87c3992589f11 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vasil Velichkov Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 3 23:36:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vasil Velichkov) Date: Wed, 3 Jan 2018 23:36:48 +0000 Subject: [ABANDON] openbsc[master]: configure.ac: Add subdir-objects In-Reply-To: References: Message-ID: Vasil Velichkov has abandoned this change. Change subject: configure.ac: Add subdir-objects ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5633 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I7911669662f474ee60d211665fb87c3992589f11 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vasil Velichkov Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vasil Velichkov From gerrit-no-reply at lists.osmocom.org Thu Jan 4 08:38:03 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 4 Jan 2018 08:38:03 +0000 Subject: [PATCH] meta-telephony[201705]: libdbi: Add version 0.9.0 to fix osmo-msc build failure In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5618 to look at the new patch set (#3). libdbi: Add version 0.9.0 to fix osmo-msc build failure A patch is needed to fix compilation: * Link against sqlite3 instead of sqlite for sqlite3 * Disable tests Remove old libdbi versions and keep/apply the malloc patch Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b --- A recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch A recipes-misc/libdbi/files/disable-tests.patch D recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb A recipes-misc/libdbi/libdbi-drivers_0.9.0.bb D recipes-misc/libdbi/libdbi_0.7.2.bb D recipes-misc/libdbi/libdbi_0.8.3.bb A recipes-misc/libdbi/libdbi_0.9.0.bb 7 files changed, 57 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/18/5618/3 diff --git a/recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch b/recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch new file mode 100644 index 0000000..be897bc --- /dev/null +++ b/recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch @@ -0,0 +1,28 @@ +From 29ea4fd2c00a3c39ab4de08e3f333d5f4e219569 Mon Sep 17 00:00:00 2001 +Message-Id: <29ea4fd2c00a3c39ab4de08e3f333d5f4e219569.1515054303.git.daniel at totalueberwachung.de> +From: Jan Engelhardt +Date: Wed, 4 Sep 2013 12:52:32 +0200 +Subject: [PATCH 1/1] build: resolve link failure in sqlite3 module + +The sqlite3 backend fails to link because the wrong library name is +used. (Ideally, libdbi-drivers should use PKG_CHECK_MODULES instead.) +--- + acinclude.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 8e89af8..45db616 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -310,7 +310,7 @@ if test "$ac_sqlite3" = "yes"; then + AC_SEARCH_LIBS_VAR([sqlite3_exec], sqlite3, , , , SQLITE3_LIBS) + SQLITE3_LDFLAGS="" + else +- SQLITE3_LIBS=-lsqlite ++ SQLITE3_LIBS=-lsqlite3 + SQLITE3_LDFLAGS=-L$ac_sqlite3_libdir + fi + +-- +2.11.0 + diff --git a/recipes-misc/libdbi/files/disable-tests.patch b/recipes-misc/libdbi/files/disable-tests.patch new file mode 100644 index 0000000..a3380e0 --- /dev/null +++ b/recipes-misc/libdbi/files/disable-tests.patch @@ -0,0 +1,12 @@ +--- a/Makefile.am 2017-12-29 12:29:35.504078484 +0100 ++++ b/Makefile.am 2017-12-29 12:29:44.428146890 +0100 +@@ -4,7 +4,7 @@ + + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = drivers tests @docs_subdirs@ ++SUBDIRS = drivers @docs_subdirs@ + + EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README README.win32 README.osx README.encodings TODO libdbi-drivers.spec.in config.h.in Makefile.w32 autogen.sh fixlt.sh + + diff --git a/recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb b/recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb deleted file mode 100644 index deeb56e..0000000 --- a/recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb +++ /dev/null @@ -1,8 +0,0 @@ -require ${PN}.inc - -PR = "${INC_PR}.1" - -SRC_URI[md5sum] = "4de79b323162a5a7652b65b608eca6cd" -SRC_URI[sha256sum] = "4ab9944398ce769c0deeb64d2f73555c67bc25ccd2ade1ccf552226c7b2acf72" - -SRC_URI += "file://memory-corruption-fixes.patch" diff --git a/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb b/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb new file mode 100644 index 0000000..389d36b --- /dev/null +++ b/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb @@ -0,0 +1,10 @@ +require ${PN}.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "9f47b960e225eede2cdeaabf7d22f59f" +SRC_URI[sha256sum] = "43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854" + +SRC_URI += "file://0001-build-resolve-link-failure-in-sqlite3-module.patch \ + file://disable-tests.patch \ + file://memory-corruption-fixes.patch" diff --git a/recipes-misc/libdbi/libdbi_0.7.2.bb b/recipes-misc/libdbi/libdbi_0.7.2.bb deleted file mode 100644 index d5803c0..0000000 --- a/recipes-misc/libdbi/libdbi_0.7.2.bb +++ /dev/null @@ -1,3 +0,0 @@ -require ${PN}.inc - -PR = "${INC_PR}.0" diff --git a/recipes-misc/libdbi/libdbi_0.8.3.bb b/recipes-misc/libdbi/libdbi_0.8.3.bb deleted file mode 100644 index ec16285..0000000 --- a/recipes-misc/libdbi/libdbi_0.8.3.bb +++ /dev/null @@ -1,7 +0,0 @@ -require ${PN}.inc - -PR = "${INC_PR}.0" - -SRC_URI[md5sum] = "ca66db78d479cbfa727cf3245b5864ae" -SRC_URI[sha256sum] = "72e41856bebb1da7b1fd1e6369358c294913f329c5e594e338b3983e6369a5e3" - diff --git a/recipes-misc/libdbi/libdbi_0.9.0.bb b/recipes-misc/libdbi/libdbi_0.9.0.bb new file mode 100644 index 0000000..e32ef03 --- /dev/null +++ b/recipes-misc/libdbi/libdbi_0.9.0.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "05e2ceeac4bc85fbe40de8b4b22d9ab3" +SRC_URI[sha256sum] = "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503" + -- To view, visit https://gerrit.osmocom.org/5618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b Gerrit-PatchSet: 3 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Jan 4 08:38:21 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 4 Jan 2018 08:38:21 +0000 Subject: meta-telephony[201705]: libdbi: Add version 0.9.0 to fix osmo-msc build failure In-Reply-To: References: Message-ID: Patch Set 2: (4 comments) https://gerrit.osmocom.org/#/c/5618/1/recipes-misc/libdbi/files/fix-0.9.0-compile.patch File recipes-misc/libdbi/files/fix-0.9.0-compile.patch: Line 8: + SQLITE3_LIBS=-lsqlite3 > Please provide somewhere a reference explaining that this is a backport com Ha, I didn't even know they were using git and the issue was fixed upstream! I just saw the sf project page and downloaded the 0.9.0 releases. Line 19: +SUBDIRS = drivers @docs_subdirs@ > Why is this needed? why are the tests failing? I see no reference to this i Compilation of tests are failing that were added after 0.8.3-1. It seems they are using cgreen (whatever that is) and building that fails. https://gerrit.osmocom.org/#/c/5618/2/recipes-misc/libdbi/files/fix-0.9.0-compile.patch File recipes-misc/libdbi/files/fix-0.9.0-compile.patch: Line 8: + SQLITE3_LIBS=-lsqlite3 > As I stated in the previous patch version, I'd prefer having 2 separate pat Done https://gerrit.osmocom.org/#/c/5618/2/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb File recipes-misc/libdbi/libdbi-drivers_0.9.0.bb: Line 9: SRC_URI += "file://memory-corruption-fixes.patch" > Better use something like: Done -- To view, visit https://gerrit.osmocom.org/5618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 4 08:40:10 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 4 Jan 2018 08:40:10 +0000 Subject: meta-telephony[201705]: libdbi: Add version 0.9.0 to fix osmo-msc build failure In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/5618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b Gerrit-PatchSet: 3 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:29:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 09:29:52 +0000 Subject: [PATCH] osmo-bts[master]: Remove BSC-specific parts Message-ID: Review at https://gerrit.osmocom.org/5638 Remove BSC-specific parts The dead code is from before repo-split time. Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e --- M include/osmo-bts/gsm_data_shared.h M src/common/gsm_data_shared.c 2 files changed, 1 insertion(+), 108 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/5638/1 diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index a05e4ca..31198fc 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -19,10 +19,7 @@ #include #include - -#ifndef ROLE_BSC #include -#endif /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ @@ -261,46 +258,13 @@ uint8_t rtp_payload; uint8_t rtp_payload2; uint8_t speech_mode; -#ifdef ROLE_BSC - struct rtp_socket *rtp_socket; -#else struct osmo_rtp_socket *rtp_socket; -#endif } abis_ip; uint8_t rqd_ta; char *name; -#ifdef ROLE_BSC - struct osmo_timer_list T3101; - struct osmo_timer_list T3109; - struct osmo_timer_list T3111; - struct osmo_timer_list error_timer; - struct osmo_timer_list act_timer; - struct osmo_timer_list rel_work; - uint8_t error_cause; - - /* table of neighbor cell measurements */ - struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; - - /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; - int meas_rep_idx; - - /* GSM Random Access data */ - struct gsm48_req_ref *rqd_ref; - - struct gsm_subscriber_connection *conn; - - struct { - /* channel activation type and handover ref */ - uint8_t act_type; - uint8_t ho_ref; - struct gsm48_req_ref *rqd_ref; - uint8_t rqd_ta; - } dyn; -#else /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. * Currently we don't share these headers so this is a magic number. */ struct llist_head sapi_cmds; @@ -381,7 +345,6 @@ } ms_power_ctrl; struct msgb *pending_rel_ind_msg; -#endif }; enum { @@ -465,14 +428,12 @@ int nominal_power; /* in dBm */ unsigned int max_power_red; /* in actual dB */ -#ifndef ROLE_BSC struct trx_power_params power_params; int ms_power_control; struct { void *l1h; } role_bts; -#endif union { struct { @@ -846,68 +807,6 @@ int force_combined_si; int bcch_change_mark; -#ifdef ROLE_BSC - /* Abis NM queue */ - struct llist_head abis_queue; - int abis_nm_pend; - - struct gsm_network *network; - - /* should the channel allocator allocate channels from high TRX to TRX0, - * rather than starting from TRX0 and go upwards? */ - int chan_alloc_reverse; - - enum neigh_list_manual_mode neigh_list_manual_mode; - /* parameters from which we build SYSTEM INFORMATION */ - struct { - struct gsm48_rach_control rach_control; - uint8_t ncc_permitted; - struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ - struct gsm48_cell_options cell_options; - struct gsm48_control_channel_descr chan_desc; - struct bitvec neigh_list; - struct bitvec cell_alloc; - struct bitvec si5_neigh_list; - struct osmo_earfcn_si2q si2quater_neigh_list; - size_t uarfcn_length; /* index for uarfcn and scramble lists */ - struct { - /* bitmask large enough for all possible ARFCN's */ - uint8_t neigh_list[1024/8]; - uint8_t cell_alloc[1024/8]; - /* If the user wants a different neighbor list in SI5 than in SI2 */ - uint8_t si5_neigh_list[1024/8]; - uint8_t meas_bw_list[MAX_EARFCN_LIST]; - uint16_t earfcn_list[MAX_EARFCN_LIST]; - uint16_t uarfcn_list[MAX_EARFCN_LIST]; - uint16_t scramble_list[MAX_EARFCN_LIST]; - } data; - } si_common; - bool early_classmark_allowed; - /* for testing only: Have an infinitely long radio link timeout */ - bool infinite_radio_link_timeout; - - /* do we use static (user-defined) system information messages? (bitmask) */ - uint32_t si_mode_static; - - /* exclude the BTS from the global RF Lock handling */ - int excl_from_rf_lock; - - /* supported codecs beside FR */ - struct bts_codec_conf codec; - - /* BTS dependencies bit field */ - uint32_t depends_on[256/(8*4)]; - - /* full and half rate multirate config */ - struct amr_multirate_conf mr_full; - struct amr_multirate_conf mr_half; - - /* PCU socket state */ - char *pcu_sock_path; - struct pcu_sock_state *pcu_state; - -#endif /* ROLE_BSC */ void *role; }; diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index f4fda55..aa012bc 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -271,9 +271,7 @@ name = gsm_lchan_name_compute(lchan); lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif } } @@ -679,17 +677,13 @@ break; default: case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* + /* OSMO_ASSERT(lchan_nr == 0); * FIXME: On octphy and litecell, we hit above assertion (see * Max's comment at https://gerrit.osmocom.org/589 ); disabled * for BTS until this is clarified; remove the #ifdef when it * is fixed. */ #warning "fix caller that passes lchan_nr != 0" -#endif cbits = 0x10; break; } -- To view, visit https://gerrit.osmocom.org/5638 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:46:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:46:23 +0000 Subject: osmo-bsc[master]: Remove obsolete ./configure option In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5605 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9492d8e988b464aa41f572611cbf2461bb8be3eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:48:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:48:36 +0000 Subject: osmo-pcu[master]: Fix llc_queue_size() type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5626 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a6e849d349ab12854976bd0d68537a370a9c83d 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 Jan 4 09:48:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:48:39 +0000 Subject: [MERGED] osmo-pcu[master]: Fix llc_queue_size() type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix llc_queue_size() type ...................................................................... Fix llc_queue_size() type It either returns 0 or LLC queue size() which has size_t return type. This means it can never be negative - hence it's better to use size_t as return type. Change-Id: I2a6e849d349ab12854976bd0d68537a370a9c83d Fixes: CID181478 --- M src/tbf.cpp M src/tbf.h 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..9c1dac9 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -298,7 +298,7 @@ return m_ms ? m_ms->llc_queue() : NULL; } -int gprs_rlcmac_tbf::llc_queue_size() const +size_t gprs_rlcmac_tbf::llc_queue_size() const { /* m_ms->llc_queue() never returns NULL: GprsMs::m_llc_queue is a * member instance. */ diff --git a/src/tbf.h b/src/tbf.h index 40ed974..4a304af 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -228,7 +228,7 @@ uint8_t ms_class() const; void set_ms_class(uint8_t); GprsCodingScheme current_cs() const; - int llc_queue_size() const; + size_t llc_queue_size() const; time_t created_ts() const; uint8_t dl_slots() const; -- To view, visit https://gerrit.osmocom.org/5626 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2a6e849d349ab12854976bd0d68537a370a9c83d 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 Jan 4 09:48:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:48:45 +0000 Subject: [MERGED] osmo-bsc[master]: Remove obsolete ./configure option In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove obsolete ./configure option ...................................................................... Remove obsolete ./configure option The '--enable-vty-tests' is just alias to '--enable-external-tests' anyway. Change-Id: I9492d8e988b464aa41f572611cbf2461bb8be3eb --- M README.vty-tests M configure.ac M contrib/jenkins.sh 3 files changed, 2 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README.vty-tests b/README.vty-tests index ba1b87c..0669ea8 100644 --- a/README.vty-tests +++ b/README.vty-tests @@ -4,7 +4,7 @@ and pass the following configure options here: - ./configure --enable-vty-tests --enable-external-tests + ./configure --enable-external-tests The VTY tests are then included in the standard check target: diff --git a/configure.ac b/configure.ac index 433e3bf..d756970 100644 --- a/configure.ac +++ b/configure.ac @@ -122,11 +122,6 @@ CPPFLAGS="$CPPFLAGS -pg" fi -AC_ARG_ENABLE([vty_tests], - AC_HELP_STRING([--enable-vty-tests], - [Include the VTY/CTRL tests in make check (deprecated) - [default=no]]), - [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) AC_ARG_ENABLE([external_tests], AC_HELP_STRING([--enable-external-tests], [Include the VTY/CTRL tests in make check [default=no]]), diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 873d1a5..5b57532 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -40,7 +40,7 @@ cd "$base" autoreconf --install --force -./configure --enable-sanitize --enable-vty-tests --enable-external-tests +./configure --enable-sanitize --enable-external-tests $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/5605 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9492d8e988b464aa41f572611cbf2461bb8be3eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:49:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:49:43 +0000 Subject: meta-telephony[201705]: libdbi: Add version 0.9.0 to fix osmo-msc build failure In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b Gerrit-PatchSet: 3 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:50:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:50:08 +0000 Subject: [PATCH] gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5634 to look at the new patch set (#2). README.md: Change mailing list address to osmocom.org Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 --- M README.md 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/34/5634/2 diff --git a/README.md b/README.md index 86ca1e8..983873d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ============ Current gr-gsm project's mailing list address is following: -gr-gsm at googlegroups.com +gr-gsm at lists.osmocom.org Mailing list is a place for general discussions, questions about the usage and installation. In case of problem with installation please try to provide full information that will help reproducing it. Minimum information should contain: - operating system with version, @@ -20,9 +20,9 @@ - version of gnuradio (it can be obtained with: gnuradio-companion --version) - error messages (in case of pybombs installation they can be obtained after switching it to verbous mode with -v option). -To join the group with any e-mail addres (google account is not required) use this link: +To join the group with any e-mail address, use this link: -https://groups.google.com/forum/#!forum/gr-gsm/join +https://lists.osmocom.org/mailman/listinfo/gr-gsm Development =========== -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:50:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:50:27 +0000 Subject: gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 re-instating Vadim's +1 after fixing typo -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:52:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:52:08 +0000 Subject: osmo-pcu[master]: TBF-DL: mark rcvd_dl_ack() parameters as boolean In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icc4d68f049a45d4b42c5594f50594ff0d44c1bac Gerrit-PatchSet: 3 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 Jan 4 09:53:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:53:03 +0000 Subject: osmo-pcu[master]: TBF-UL: add simpler test helper In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5337/3/src/rlc.h File src/rlc.h: Line 346: void reset_v_x(); if it resets V and Q, why is the function called reset_v_x ? -- To view, visit https://gerrit.osmocom.org/5337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 4 09:53:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:53:49 +0000 Subject: osmo-pcu[master]: Avoid code duplication in TBF test In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7aa72f5aa66c5e9c255542c066b5494c098aab2 Gerrit-PatchSet: 3 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 Jan 4 09:54:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 09:54:06 +0000 Subject: osmo-pcu[master]: TBF: move window parameters to UL/DL level In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6 Gerrit-PatchSet: 3 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 Jan 4 10:15:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 10:15:59 +0000 Subject: [MERGED] osmo-pcu[master]: TBF-DL: mark rcvd_dl_ack() parameters as boolean In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF-DL: mark rcvd_dl_ack() parameters as boolean ...................................................................... TBF-DL: mark rcvd_dl_ack() parameters as boolean The final(_ack) parameter of rcvd_dl_ack() only used as boolean - mark it as such. Change-Id: Icc4d68f049a45d4b42c5594f50594ff0d44c1bac --- M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp 3 files changed, 10 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf.h b/src/tbf.h index 4a304af..f57dbe3 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -450,8 +450,8 @@ const uint16_t pdu_delay_csec, const uint8_t *data, const uint16_t len); - int rcvd_dl_ack(uint8_t final, uint8_t ssn, uint8_t *rbb); - int rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn, struct bitvec *rbb); + int rcvd_dl_ack(bool final, uint8_t ssn, uint8_t *rbb); + int rcvd_dl_ack(bool final_ack, unsigned first_bsn, struct bitvec *rbb); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); void trigger_ass(struct gprs_rlcmac_tbf *old_tbf); void clear_poll_timeout_flag(); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 84f6166..58b55dc 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1159,7 +1159,7 @@ return 0; } -int gprs_rlcmac_dl_tbf::rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn, +int gprs_rlcmac_dl_tbf::rcvd_dl_ack(bool final_ack, unsigned first_bsn, struct bitvec *rbb) { int rc; @@ -1179,7 +1179,7 @@ return rc; } -int gprs_rlcmac_dl_tbf::rcvd_dl_ack(uint8_t final_ack, uint8_t ssn, uint8_t *rbb) +int gprs_rlcmac_dl_tbf::rcvd_dl_ack(bool final_ack, uint8_t ssn, uint8_t *rbb) { LOGPTBFDL(this, LOGL_DEBUG, "downlink acknowledge\n"); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 18bbc76..2863151 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -267,7 +267,7 @@ /* Queue a final ACK */ memset(rbb, 0, sizeof(rbb)); /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(1, 1, rbb); + dl_tbf->rcvd_dl_ack(true, 1, rbb); /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); @@ -341,14 +341,14 @@ /* ACK all blocks */ memset(rbb, 0xff, sizeof(rbb)); /* Receive an ACK */ - dl_tbf->rcvd_dl_ack(0, dl_tbf->m_window.v_s(), rbb); + dl_tbf->rcvd_dl_ack(false, dl_tbf->m_window.v_s(), rbb); OSMO_ASSERT(dl_tbf->m_window.window_empty()); /* Force sending of a single block containing an LLC dummy command */ request_dl_rlc_block(dl_tbf, &fn); /* Receive an ACK */ - dl_tbf->rcvd_dl_ack(0, dl_tbf->m_window.v_s(), rbb); + dl_tbf->rcvd_dl_ack(false, dl_tbf->m_window.v_s(), rbb); OSMO_ASSERT(dl_tbf->m_window.window_empty()); /* Timeout (make sure fn % 52 remains valid) */ @@ -358,7 +358,7 @@ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FINISHED)); /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(1, dl_tbf->m_window.v_s(), rbb); + dl_tbf->rcvd_dl_ack(true, dl_tbf->m_window.v_s(), rbb); /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); @@ -2695,7 +2695,7 @@ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW)); /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(1, dl_tbf->m_window.v_s(), rbb); + dl_tbf->rcvd_dl_ack(true, dl_tbf->m_window.v_s(), rbb); /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); @@ -2745,7 +2745,7 @@ uint8_t rbb[64/8]; /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(1, dl_tbf->m_window.v_s(), rbb); + dl_tbf->rcvd_dl_ack(true, dl_tbf->m_window.v_s(), rbb); /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); -- To view, visit https://gerrit.osmocom.org/5339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icc4d68f049a45d4b42c5594f50594ff0d44c1bac Gerrit-PatchSet: 4 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 Jan 4 10:16:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 10:16:00 +0000 Subject: [MERGED] osmo-pcu[master]: window: move encoding into functions In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: window: move encoding into functions ...................................................................... window: move encoding into functions * move window size encoding and writing into separate functions * introduce necessary TBF wrappers to avoid direct m_window access This is part of preparation work to move to separate UL/DL windows. Related: OS#1759 Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840 --- M src/encoding.cpp M src/encoding.h M src/pcu_vty_functions.cpp M src/tbf.h M tests/tbf/TbfTest.cpp 5 files changed, 46 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/encoding.cpp b/src/encoding.cpp index 6742efd..87c6f08 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -60,6 +60,21 @@ } } +/* 3GPP TS 44.060 Table 12.5.2.1 */ +static inline uint16_t enc_ws(uint16_t ws) +{ + return (ws - 64) / 32; +} + +static inline void write_ws(bitvec *dest, unsigned int *write_index, uint16_t ws) +{ + dest->cur_bit = *write_index; + + bitvec_set_u64(dest, enc_ws(ws), 5, false); + + *write_index += 5; +} + /* 3GPP TS 44.060 ? 12.12: { 0 | 1 < TIMING_ADVANCE_VALUE : bit (6) > } { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > @@ -114,9 +129,8 @@ // bitvec_write_field(dest, &wp,,0xb,4); if (tbf->is_egprs_enabled()) { /* see GMS 44.018, 10.5.2.16 */ - unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; bitvec_write_field(dest, &wp, 1, 1); // "H" - bitvec_write_field(dest, &wp, ws_enc, 5); // EGPRS Window Size + write_ws(dest, &wp, tbf->window_size()); // EGPRS Window Size bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present } @@ -178,7 +192,6 @@ uint8_t alpha, uint8_t gamma, int8_t ta_idx, enum ph_burst_type burst_type, uint16_t ra) { - unsigned int ws_enc = 0; uint8_t extended_ra = 0; extended_ra = (ra & 0x1F); @@ -208,9 +221,6 @@ bitvec_write_field(dest, &wp, 0, 1); } else { - - ws_enc = (tbf->m_window.ws() - 64) / 32; - bitvec_write_field(dest, &wp, 1, 1); /* single block alloc */ bitvec_write_field(dest, &wp, tbf->tfi(), 5);/* TFI assignment */ bitvec_write_field(dest, &wp, 0, 1); /* polling bit */ @@ -224,7 +234,7 @@ bitvec_write_field(dest, &wp, tbf->tlli(), 1); bitvec_write_field(dest, &wp, 0, 1); /* BEP period present */ bitvec_write_field(dest, &wp, 0, 1); /* resegmentation */ - bitvec_write_field(dest, &wp, ws_enc, 5);/* egprs window_size */ + write_ws(dest, &wp, tbf->window_size()); /* EGPRS window size */ if (alpha) { bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */ @@ -450,7 +460,6 @@ bitvec_write_field(dest, &wp,0x1,1); // TLLI_BLOCK_CHANNEL_CODING write_ta_ie(dest, wp,tbf->ta(), ta_idx, ta_ts); } else { /* EPGRS */ - unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; bitvec_write_field(dest, &wp,0x1,1); // Message escape bitvec_write_field(dest, &wp,0x0,2); // EGPRS message contents bitvec_write_field(dest, &wp,0x0,1); // No CONTENTION_RESOLUTION_TLLI @@ -458,7 +467,7 @@ bitvec_write_field(dest, &wp,tbf->current_cs().to_num()-1, 4); // EGPRS Modulation and Coding IE /* 0: no RESEGMENT, 1: Segmentation*/ bitvec_write_field(dest, &wp, 0x1, 1); - bitvec_write_field(dest, &wp,ws_enc,5); // EGPRS Window Size + write_ws(dest, &wp, tbf->window_size()); // EGPRS Window Size bitvec_write_field(dest, &wp,0x0,1); // No Access Technologies Request bitvec_write_field(dest, &wp,0x0,1); // No ARAC RETRANSMISSION REQUEST bitvec_write_field(dest, &wp,0x1,1); // TLLI_BLOCK_CHANNEL_CODING @@ -509,7 +518,7 @@ /* generate downlink assignment */ void Encoding::write_packet_downlink_assignment(RlcMacDownlink_t * block, bool old_tfi_is_valid, uint8_t old_tfi, uint8_t old_downlink, - struct gprs_rlcmac_tbf *tbf, uint8_t poll, uint8_t rrbp, + struct gprs_rlcmac_dl_tbf *tbf, uint8_t poll, uint8_t rrbp, uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts, bool use_egprs) { @@ -518,7 +527,6 @@ PDA_AdditionsR99_t *pda_r99; uint8_t tn; - unsigned int ws_enc; block->PAYLOAD_TYPE = 0x1; // RLC/MAC control block that does not include the optional octets of the RLC/MAC control header block->RRBP = rrbp; // 0: N+13 @@ -591,12 +599,10 @@ return; } - ws_enc = (tbf->window()->ws() - 64) / 32; - block->u.Packet_Downlink_Assignment.Exist_AdditionsR99 = 0x1; // AdditionsR99 = on pda_r99 = &block->u.Packet_Downlink_Assignment.AdditionsR99; pda_r99->Exist_EGPRS_Params = 1; - pda_r99->EGPRS_WindowSize = ws_enc; /* see TS 44.060, table 12.5.2.1 */ + pda_r99->EGPRS_WindowSize = enc_ws(tbf->window_size()); /* see TS 44.060, table 12.5.2.1 */ pda_r99->LINK_QUALITY_MEASUREMENT_MODE = 0x0; /* no meas, see TS 44.060, table 11.2.7.2 */ pda_r99->Exist_BEP_PERIOD2 = 0; /* No extra EGPRS BEP PERIOD */ pda_r99->Exist_Packet_Extended_Timing_Advance = 0; diff --git a/src/encoding.h b/src/encoding.h index 6164b89..54cb057 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -68,7 +68,7 @@ static void write_packet_downlink_assignment(RlcMacDownlink_t * block, bool old_tfi_is_valid, uint8_t old_tfi, uint8_t old_downlink, - struct gprs_rlcmac_tbf *tbf, uint8_t poll, uint8_t rrbp, + struct gprs_rlcmac_dl_tbf *tbf, uint8_t poll, uint8_t rrbp, uint8_t alpha, uint8_t gamma, int8_t ta_idx, uint8_t ta_ts, bool use_egprs); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index f1dd25c..0a80a23 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -64,13 +64,12 @@ } if (tbf->trx != NULL) vty_out(vty, " TRX_ID=%d", tbf->trx->trx_no); - vty_out(vty, " CS=%s WS=%d", - tbf->current_cs().name(), tbf->window()->ws()); + vty_out(vty, " CS=%s", tbf->current_cs().name()); if (ul_tbf) { gprs_rlc_ul_window *win = &ul_tbf->m_window; - vty_out(vty, " V(Q)=%d V(R)=%d", - win->v_q(), win->v_r()); + vty_out(vty, " WS=%u V(Q)=%d V(R)=%d", + ul_tbf->window_size(), win->v_q(), win->v_r()); vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " TBF Statistics:%s", VTY_NEWLINE); if(GprsCodingScheme::GPRS == tbf->ms()->mode()) { @@ -81,8 +80,8 @@ } if (dl_tbf) { gprs_rlc_dl_window *win = &dl_tbf->m_window; - vty_out(vty, " V(A)=%d V(S)=%d nBSN=%d%s", - win->v_a(), win->v_s(), win->resend_needed(), + vty_out(vty, " WS=%u V(A)=%d V(S)=%d nBSN=%d%s", + dl_tbf->window_size(), win->v_a(), win->v_s(), win->resend_needed(), win->window_stalled() ? " STALLED" : ""); vty_out(vty, "%s", VTY_NEWLINE); vty_out_rate_ctr_group(vty, " ", tbf->m_ctrs); diff --git a/src/tbf.h b/src/tbf.h index f57dbe3..9491f2a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -464,7 +464,7 @@ bool keep_open(unsigned fn) const; int release(); int abort(); - + uint16_t window_size() const; void egprs_calc_window_size(); void update_coding_scheme_counter_dl(const GprsCodingScheme cs); @@ -562,7 +562,7 @@ uint8_t *data, const uint8_t block_idx); void egprs_calc_ulwindow_size(); - + uint16_t window_size() const; void update_coding_scheme_counter_ul(const GprsCodingScheme cs); /* Please note that all variables here will be reset when changing @@ -599,6 +599,16 @@ ((int)GPRS_RLCMAC_UL_TBF - (int)dir + (int)GPRS_RLCMAC_DL_TBF); } +inline uint16_t gprs_rlcmac_ul_tbf::window_size() const +{ + return m_window.ws(); +} + +inline uint16_t gprs_rlcmac_dl_tbf::window_size() const +{ + return m_window.ws(); +} + inline void gprs_rlcmac_ul_tbf::enable_egprs() { m_window.set_sns(RLC_EGPRS_SNS); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 2863151..40cb313 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2214,9 +2214,9 @@ fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), pcu_bitcount(dl_tbf->dl_slots()), - dl_tbf->window()->ws()); + dl_tbf->window_size()); OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4); - OSMO_ASSERT(dl_tbf->window()->ws() == 64); + OSMO_ASSERT(dl_tbf->window_size() == 64); tbf_free(dl_tbf); /* EGPRS-only */ @@ -2229,9 +2229,9 @@ fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), pcu_bitcount(dl_tbf->dl_slots()), - dl_tbf->window()->ws()); + dl_tbf->window_size()); OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4); - OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 4 * 64); + OSMO_ASSERT(dl_tbf->window_size() == 128 + 4 * 64); tbf_free(dl_tbf); printf("=== end %s ===\n", __func__); @@ -2273,9 +2273,9 @@ fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), pcu_bitcount(dl_tbf->dl_slots()), - dl_tbf->window()->ws()); + dl_tbf->window_size()); OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 1); - OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 1 * 64); + OSMO_ASSERT(dl_tbf->window_size() == 128 + 1 * 64); dl_tbf->update(); @@ -2284,9 +2284,9 @@ fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), pcu_bitcount(dl_tbf->dl_slots()), - dl_tbf->window()->ws()); + dl_tbf->window_size()); OSMO_ASSERT(pcu_bitcount(dl_tbf->dl_slots()) == 4); - OSMO_ASSERT(dl_tbf->window()->ws() == 128 + 4 * 64); + OSMO_ASSERT(dl_tbf->window_size() == 128 + 4 * 64); tbf_free(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60184d5049bc7d7b119df5a9eb82d1c4b788c840 Gerrit-PatchSet: 4 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 Jan 4 10:57:04 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 4 Jan 2018 10:57:04 +0000 Subject: [MERGED] osmo-mgw[master]: client: mgcp_response_parse_params: check rtp port In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: client: mgcp_response_parse_params: check rtp port ...................................................................... client: mgcp_response_parse_params: check rtp port Also check the port number for plausibility like we do it already for the IP-Address Change-Id: I594a06fc9dd1bf0522f6e72a8943df52448d2ce4 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 1c35aa9..7e07d00 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -180,6 +180,9 @@ &r->audio_port) != 1) goto response_parse_failure; + if (r->audio_port == 0) + goto response_parse_failure; + return 0; response_parse_failure: -- To view, visit https://gerrit.osmocom.org/5318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I594a06fc9dd1bf0522f6e72a8943df52448d2ce4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw 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 Jan 4 11:06:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 11:06:01 +0000 Subject: osmo-bsc[master]: Reduce T3109 default from 19s to 5s In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7416b4118e5b73c6ffb98e3546bc62a36c7a967a Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 11:13:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 11:13:42 +0000 Subject: [MERGED] osmo-bsc[master]: Reduce T3109 default from 19s to 5s In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Reduce T3109 default from 19s to 5s ...................................................................... Reduce T3109 default from 19s to 5s T3109 is started when the BSS sends a RR CHAN REL to the MS and stops downlink SACCH generation. Stopped when the MS successfully releases the LAPDm link. After stop or timeout, the radio channel is released using RSL RF CHAN REL. Recommended values in literature are 1-2s + RadioLinkTimeout*0.48s or 5s, while we had the absurdly high 19s timeout. This means we occupy the radio channel way longer than needed in situations where the MS is no longer able to properly release Layer2 (LAPDm DISC) due to loss of signal or the like. See also: https://osmocom.org/projects/osmobsc/wiki/Timers Change-Id: I7416b4118e5b73c6ffb98e3546bc62a36c7a967a Closes: OS#2734 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 45fbcd2..0ff5811 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -197,7 +197,7 @@ #define GSM_T3103_DEFAULT 5 /* s */ #define GSM_T3105_DEFAULT 100 /* ms */ #define GSM_T3107_DEFAULT 5 /* s */ -#define GSM_T3109_DEFAULT 19 /* s, must be 2s + radio_link_timeout*0.48 */ +#define GSM_T3109_DEFAULT 5 /* s, must be 2s + radio_link_timeout*0.48 */ #define GSM_T3111_DEFAULT 2 /* s */ #define GSM_T3113_DEFAULT 10 /* s */ #define GSM_T3115_DEFAULT 10 -- To view, visit https://gerrit.osmocom.org/5283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7416b4118e5b73c6ffb98e3546bc62a36c7a967a Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 4 11:20:17 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 4 Jan 2018 11:20:17 +0000 Subject: [MERGED] meta-telephony[201705]: libdbi: Add version 0.9.0 to fix osmo-msc build failure In-Reply-To: References: Message-ID: daniel has submitted this change and it was merged. Change subject: libdbi: Add version 0.9.0 to fix osmo-msc build failure ...................................................................... libdbi: Add version 0.9.0 to fix osmo-msc build failure A patch is needed to fix compilation: * Link against sqlite3 instead of sqlite for sqlite3 * Disable tests Remove old libdbi versions and keep/apply the malloc patch Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b --- A recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch A recipes-misc/libdbi/files/disable-tests.patch D recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb A recipes-misc/libdbi/libdbi-drivers_0.9.0.bb D recipes-misc/libdbi/libdbi_0.7.2.bb D recipes-misc/libdbi/libdbi_0.8.3.bb A recipes-misc/libdbi/libdbi_0.9.0.bb 7 files changed, 57 insertions(+), 18 deletions(-) Approvals: daniel: Verified Harald Welte: Looks good to me, approved diff --git a/recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch b/recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch new file mode 100644 index 0000000..be897bc --- /dev/null +++ b/recipes-misc/libdbi/files/0001-build-resolve-link-failure-in-sqlite3-module.patch @@ -0,0 +1,28 @@ +From 29ea4fd2c00a3c39ab4de08e3f333d5f4e219569 Mon Sep 17 00:00:00 2001 +Message-Id: <29ea4fd2c00a3c39ab4de08e3f333d5f4e219569.1515054303.git.daniel at totalueberwachung.de> +From: Jan Engelhardt +Date: Wed, 4 Sep 2013 12:52:32 +0200 +Subject: [PATCH 1/1] build: resolve link failure in sqlite3 module + +The sqlite3 backend fails to link because the wrong library name is +used. (Ideally, libdbi-drivers should use PKG_CHECK_MODULES instead.) +--- + acinclude.m4 | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/acinclude.m4 b/acinclude.m4 +index 8e89af8..45db616 100644 +--- a/acinclude.m4 ++++ b/acinclude.m4 +@@ -310,7 +310,7 @@ if test "$ac_sqlite3" = "yes"; then + AC_SEARCH_LIBS_VAR([sqlite3_exec], sqlite3, , , , SQLITE3_LIBS) + SQLITE3_LDFLAGS="" + else +- SQLITE3_LIBS=-lsqlite ++ SQLITE3_LIBS=-lsqlite3 + SQLITE3_LDFLAGS=-L$ac_sqlite3_libdir + fi + +-- +2.11.0 + diff --git a/recipes-misc/libdbi/files/disable-tests.patch b/recipes-misc/libdbi/files/disable-tests.patch new file mode 100644 index 0000000..a3380e0 --- /dev/null +++ b/recipes-misc/libdbi/files/disable-tests.patch @@ -0,0 +1,12 @@ +--- a/Makefile.am 2017-12-29 12:29:35.504078484 +0100 ++++ b/Makefile.am 2017-12-29 12:29:44.428146890 +0100 +@@ -4,7 +4,7 @@ + + ACLOCAL_AMFLAGS = -I m4 + +-SUBDIRS = drivers tests @docs_subdirs@ ++SUBDIRS = drivers @docs_subdirs@ + + EXTRA_DIST = AUTHORS COPYING ChangeLog INSTALL README README.win32 README.osx README.encodings TODO libdbi-drivers.spec.in config.h.in Makefile.w32 autogen.sh fixlt.sh + + diff --git a/recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb b/recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb deleted file mode 100644 index deeb56e..0000000 --- a/recipes-misc/libdbi/libdbi-drivers_0.8.3-1.bb +++ /dev/null @@ -1,8 +0,0 @@ -require ${PN}.inc - -PR = "${INC_PR}.1" - -SRC_URI[md5sum] = "4de79b323162a5a7652b65b608eca6cd" -SRC_URI[sha256sum] = "4ab9944398ce769c0deeb64d2f73555c67bc25ccd2ade1ccf552226c7b2acf72" - -SRC_URI += "file://memory-corruption-fixes.patch" diff --git a/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb b/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb new file mode 100644 index 0000000..389d36b --- /dev/null +++ b/recipes-misc/libdbi/libdbi-drivers_0.9.0.bb @@ -0,0 +1,10 @@ +require ${PN}.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "9f47b960e225eede2cdeaabf7d22f59f" +SRC_URI[sha256sum] = "43d2eacd573a4faff296fa925dd97fbf2aedbf1ae35c6263478210c61004c854" + +SRC_URI += "file://0001-build-resolve-link-failure-in-sqlite3-module.patch \ + file://disable-tests.patch \ + file://memory-corruption-fixes.patch" diff --git a/recipes-misc/libdbi/libdbi_0.7.2.bb b/recipes-misc/libdbi/libdbi_0.7.2.bb deleted file mode 100644 index d5803c0..0000000 --- a/recipes-misc/libdbi/libdbi_0.7.2.bb +++ /dev/null @@ -1,3 +0,0 @@ -require ${PN}.inc - -PR = "${INC_PR}.0" diff --git a/recipes-misc/libdbi/libdbi_0.8.3.bb b/recipes-misc/libdbi/libdbi_0.8.3.bb deleted file mode 100644 index ec16285..0000000 --- a/recipes-misc/libdbi/libdbi_0.8.3.bb +++ /dev/null @@ -1,7 +0,0 @@ -require ${PN}.inc - -PR = "${INC_PR}.0" - -SRC_URI[md5sum] = "ca66db78d479cbfa727cf3245b5864ae" -SRC_URI[sha256sum] = "72e41856bebb1da7b1fd1e6369358c294913f329c5e594e338b3983e6369a5e3" - diff --git a/recipes-misc/libdbi/libdbi_0.9.0.bb b/recipes-misc/libdbi/libdbi_0.9.0.bb new file mode 100644 index 0000000..e32ef03 --- /dev/null +++ b/recipes-misc/libdbi/libdbi_0.9.0.bb @@ -0,0 +1,7 @@ +require ${PN}.inc + +PR = "${INC_PR}.0" + +SRC_URI[md5sum] = "05e2ceeac4bc85fbe40de8b4b22d9ab3" +SRC_URI[sha256sum] = "dafb6cdca524c628df832b6dd0bf8fabceb103248edb21762c02d3068fca4503" + -- To view, visit https://gerrit.osmocom.org/5618 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia4319c595a1ccb20c87d86c1ab1e58e95da34d7b Gerrit-PatchSet: 3 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Thu Jan 4 11:53:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 11:53:02 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Describe gsmtap log destination Message-ID: Review at https://gerrit.osmocom.org/5639 Describe gsmtap log destination Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Fixes: OS#2608 --- M common/chapters/logging.adoc 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/39/5639/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 85975bb..22f94e8 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -144,6 +144,27 @@ In the example above 98 is the desired size of the ring buffer (number of messages). Once it's filled, the incoming log messages will push out the oldest messages available in the buffer. +==== Logging via gsmtap + +When debugging complex issues it's handy to be able to reconstruct exact chain of events. This is enabled by using GSMTAP +log output where frames sent/received over the air are intersperced with the log lines. It also simplifies the bug handling +as users don't have to provide separate .pcap and .log files anymore - everything will be inside self-contained packet dump. + +It's configured as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log gsmtap 192.168.2.3 +OsmoBSC(config-log)# +---- + +The hostname/ip argument is optional: if omitted the default 127.0.0.1 will be used. The log strings inside GSMTAP are already +supported by Wireshark. Capturing for `port 4729` on appropriate interface will reveal log messages including source file +name and line number as well as application. This makes it easy to consolidate logs from several different network components +alongside the air frames. + +Note: the logs are also duplicated to stderr when GSMTAP logging is configured. + ==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and -- To view, visit https://gerrit.osmocom.org/5639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 11:53:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 11:53:14 +0000 Subject: [PATCH] libosmocore[master]: Use 127.0.0.1 for GSMTAP logging by default Message-ID: Review at https://gerrit.osmocom.org/5640 Use 127.0.0.1 for GSMTAP logging by default Previously the were no default value provided in case of unspecified hostname in "log gsmtap" vty config. This leads to confusing log messages because NULL was used as a hostname: Inconsistent indentation -- leading whitespace must match adjacent lines, and indentation must reflect child node levels. A mix of tabs and spaces is allowed, but their sequence must not change within a child block. Fix this by using 127.0.0.1 as default log destination and logging hostname in case of errors. Related: OS#2608 Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813 --- M src/vty/logging_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/5640/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index c39017b..dc457ff 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -537,7 +537,7 @@ LOG_STR "Logging via GSMTAP\n" "Host name to send the GSMTAP logging to (UDP port 4729)\n") { - const char *hostname = argv[0]; + const char *hostname = argc ? argv[0] : "127.0.0.1"; struct log_target *tgt; tgt = log_target_find(LOG_TGT_TYPE_GSMTAP, hostname); @@ -546,8 +546,8 @@ host.app_info->name, false, true); if (!tgt) { - vty_out(vty, "%% Unable to create GSMTAP log%s", - VTY_NEWLINE); + vty_out(vty, "%% Unable to create GSMTAP log for %s%s", + hostname, VTY_NEWLINE); return CMD_WARNING; } log_add_target(tgt); -- To view, visit https://gerrit.osmocom.org/5640 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:32:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:32:13 +0000 Subject: [PATCH] osmo-trx[master]: Mark release target as virtual Message-ID: Review at https://gerrit.osmocom.org/5641 Mark release target as virtual Change-Id: Iee747faa3171663f1874a5eacddd56607de55297 --- M Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/41/5641/1 diff --git a/Makefile.am b/Makefile.am index 5cf1a45..da08bf3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,8 @@ COPYING \ README +.PHONY: release + @RELMAKE@ dox: FORCE -- To view, visit https://gerrit.osmocom.org/5641 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee747faa3171663f1874a5eacddd56607de55297 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:32:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:32:14 +0000 Subject: [PATCH] osmo-trx[master]: Remove outdated references to OpenBTS Message-ID: Review at https://gerrit.osmocom.org/5642 Remove outdated references to OpenBTS Change-Id: I2df613bf59af28e2f44a520d0ee953932bcf4d7e --- M AUTHORS 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/42/5642/1 diff --git a/AUTHORS b/AUTHORS index 598b606..88ac61b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -90,9 +90,6 @@ SMS/SMSTransfer.h TRXManager/TRXManager.cpp Transceiver/Complex.h - apps/OpenBTS900.cpp - apps/OpenBTS850.cpp - apps/OpenBTS25c3.cpp tests/AGCHTest.cpp tests/BeaconTest.cpp tests/CallTest.cpp -- To view, visit https://gerrit.osmocom.org/5642 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2df613bf59af28e2f44a520d0ee953932bcf4d7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:32:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:32:14 +0000 Subject: [PATCH] osmo-trx[master]: Remove unused headers Message-ID: Review at https://gerrit.osmocom.org/5643 Remove unused headers Change-Id: Idadb17aeb85b011d114ffc1d81c920544bac1989 --- M CommonLibs/VectorTest.cpp M Transceiver52M/Channelizer.cpp M Transceiver52M/Synthesis.cpp M Transceiver52M/USRPDevice.cpp 4 files changed, 1 insertion(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/43/5643/1 diff --git a/CommonLibs/VectorTest.cpp b/CommonLibs/VectorTest.cpp index ad5c473..6958889 100644 --- a/CommonLibs/VectorTest.cpp +++ b/CommonLibs/VectorTest.cpp @@ -28,10 +28,6 @@ #include "Vector.h" #include -// We must have a gConfig now to include Vector. -#include "Configuration.h" -ConfigurationTable gConfig; - using namespace std; typedef Vector TestVector; diff --git a/Transceiver52M/Channelizer.cpp b/Transceiver52M/Channelizer.cpp index 4b163b9..80eab3e 100644 --- a/Transceiver52M/Channelizer.cpp +++ b/Transceiver52M/Channelizer.cpp @@ -25,7 +25,6 @@ #include #include -#include "Logger.h" #include "Channelizer.h" extern "C" { diff --git a/Transceiver52M/Synthesis.cpp b/Transceiver52M/Synthesis.cpp index 0f8197a..22481d5 100644 --- a/Transceiver52M/Synthesis.cpp +++ b/Transceiver52M/Synthesis.cpp @@ -24,8 +24,8 @@ #include #include #include +#include -#include "Logger.h" #include "Synthesis.h" extern "C" { diff --git a/Transceiver52M/USRPDevice.cpp b/Transceiver52M/USRPDevice.cpp index 3d20411..034ccd8 100644 --- a/Transceiver52M/USRPDevice.cpp +++ b/Transceiver52M/USRPDevice.cpp @@ -36,8 +36,6 @@ #include "Threads.h" #include "USRPDevice.h" -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -- To view, visit https://gerrit.osmocom.org/5643 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idadb17aeb85b011d114ffc1d81c920544bac1989 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:32:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:32:14 +0000 Subject: [PATCH] osmo-trx[master]: Update installation instructions Message-ID: Review at https://gerrit.osmocom.org/5644 Update installation instructions * remove references to OpenBTS * update URLs * remove unnecessary requirements Change-Id: I6ec26beaaa74dd3d98f27d110055a8f0cdd3c991 Related: OS#2600 --- M INSTALLATION 1 file changed, 5 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/44/5644/1 diff --git a/INSTALLATION b/INSTALLATION index 3e35d7e..0c0d205 100644 --- a/INSTALLATION +++ b/INSTALLATION @@ -2,32 +2,24 @@ -OpenBTS compiles to a simple Unix binary and does not require special +osmo-trx compiles to a simple Unix binary and does not require special installation. One some systems (Ubuntu), you will need to define LIBS = -lpthread prior to running configure. -To run OpenBTS, the following should be installed: - - Asterisk (http://www.asterisk.org), running SIP on port 5060. - - libosip2 (http://www.gnu.org/software/osip/) - - libortp (http://freshmeat.net/projects/ortp/) - - libusrp (http://gnuradio.org). +To run osmo-trx, the following should be installed: + libuhd (https://gnuradio.org). This is part of the GNURadio installation. - It is the only part used by OpenBTS. -OpenBTS logs to syslogd as facility LOG_LOCAL7. Please set your /etc/syslog.conf +osmo-trx logs to syslogd as facility LOG_LOCAL7. Please set your /etc/syslog.conf accordingly. For information on specific executables, see tests/README.tests and apps/README.apps. -See http://gnuradio.org/redmine/wiki/gnuradio/OpenBTS/BuildingAndRunning for more +See https://osmocom.org/projects/osmotrx/wiki/OsmoTRX for more information. -- To view, visit https://gerrit.osmocom.org/5644 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ec26beaaa74dd3d98f27d110055a8f0cdd3c991 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:32:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:32:14 +0000 Subject: [PATCH] osmo-trx[master]: Update license notes Message-ID: Review at https://gerrit.osmocom.org/5645 Update license notes * move clarification passages to README * replace references to OpenBTS with OsmoTRX * rearrange paragraphs for easier reading * drop trademark notice Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Related: OS#2600 --- M COPYING M README 2 files changed, 21 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/45/5645/1 diff --git a/COPYING b/COPYING index b5af151..dba13ed 100644 --- a/COPYING +++ b/COPYING @@ -659,66 +659,3 @@ 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 AGPL, see . - - - - -========================================================================= - -This marks the end of the AGPLv3 text. The following text is appended to the -same file for convience but constituting a distinct document, not part of the -actual AGPL text and not part of an attempt to create a deriviative work based -on the AGPLv3 text. - -========================================================================= - - -ADDITIONAL TERMS TO THE AGPLv3 LICENSE FOR OPENBTS - - -Permissive Terms Supplementing the License - -1. Remote Interaction Through IP Networks. - -OpenBTS includes an implementation of the GSM network cellular air interface, -as well as other interfaces to IP networks. The interaction of cellular -handsets with the OpenBTS software is considered "remote network interaction" -for the purposes of the Affero General Public License and cellular users are -subject to the source code access requirements of Section 13 of AGPLv3 ("Remote -Network Interaction; Use with the GNU General Public License"). - -Remote interactions through interfaces other than the GSM air interface are, at -your option, exempted from the requirements of Section 13 ("Remote Network -Interaction; Use with the GNU General Public License"). This exemption of -interfaces other than the GSM air interface from the requirements of Section 13 -is an additional permission granted to you. - - -Non-Permissive Terms Supplementing The License - -1. Trademarks. - -"OpenBTS" is a trademark of Range Networks, Inc., registered with -the US Patent and Trademark Office. Your use of OpenBTS software under a GPL -license does not include the right to use the OpenBTS trademark in commerce. -This additional non-permissive term is consistent with Section 7 of the AGPLv3 -license. - - -END OF ADDITIONAL TERMS - - - -How to comply with Section 13 of the AGPLv3 license. - -The recommended method for compliance with Section 13 of the AGPLv3 license is -to deliver a text message to each handset that attaches to the OpenBTS cellular -network. At a minimum, that text message should include the string "OpenBTS -AGPLv3" and a URL that can be used to access the OpenBTS source code. This -message need not be delivered to handsets that are denied registration with the -network, since those handsets have been denied service. - -In OpenBTS 2.6, such text messages can be delivered with the "Welcome Message" -feature. See the OpenBTS.config.example file for more information on the use of -this feature for AGPLv3 compliance. - diff --git a/README b/README index 502d661..5f9524c 100644 --- a/README +++ b/README @@ -112,5 +112,26 @@ 148 bytes output symbol values, 0 & 1 +How to comply with Section 13 of the AGPLv3 license. +1. Remote Interaction Through IP Networks. +OsmoTRX includes an implementation of the GSM network cellular air interface, +as well as other interfaces to IP networks. The interaction of cellular +handsets with the OsmoTRX software is considered "remote network interaction" +for the purposes of the Affero General Public License and cellular users are +subject to the source code access requirements of Section 13 of AGPLv3 ("Remote +Network Interaction; Use with the GNU General Public License"). + +Remote interactions through interfaces other than the GSM air interface are, at +your option, exempted from the requirements of Section 13 ("Remote Network +Interaction; Use with the GNU General Public License"). This exemption of +interfaces other than the GSM air interface from the requirements of Section 13 +is an additional permission granted to you. + +The recommended method for compliance with Section 13 of the AGPLv3 license is +to deliver a text message to each handset that attaches to the cellular +network. At a minimum, that text message should include the string "OsmoTRX +AGPLv3" and a URL that can be used to access the OsmoTRX source code. This +message need not be delivered to handsets that are denied registration with the +network, since those handsets have been denied service. -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:32:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:32:15 +0000 Subject: [PATCH] osmo-trx[master]: Update legal disclaimer Message-ID: Review at https://gerrit.osmocom.org/5646 Update legal disclaimer * drop trademark passage * add link to OpenBTS website and corresponding attribution * replace OpenBTS references with OsmoTRX Change-Id: Ia40df831649cdb68898db9ca77868c422a8d631d Related: OS#2600 --- M LEGAL 1 file changed, 7 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/46/5646/1 diff --git a/LEGAL b/LEGAL index 1d7702b..a8b75f2 100644 --- a/LEGAL +++ b/LEGAL @@ -1,5 +1,8 @@ OpenBTS +The OsmoTRX project is direved from OpenBTS transceiver code. See http://openbts.org/ for details. + +The related copyrights: Most parts copyright 2008-2011 Free Software Foundation. Some parts copyright 2010 Kestrel Signal Processing, Inc. Some parts copyright 2011 Range Networks, Inc. @@ -12,17 +15,9 @@ actions are necessary to avoid patent infringement. -Trademark - -"OpenBTS" is a registered trademark of Range Networks, Inc. (Range), a -California corporation. Range reserves the right to control the use of this -trademark. Do not use this trademark in commerce without permission and do not -rebrand OpenBTS under a different trademark. - - Telecom and Radio Spectrum Laws -The primary function of OpenBTS is the provision of telecommunications service +The primary function of OsmoTRX is the provision of telecommunications service over a radio link. This activity is heavily regulated nearly everywhere in the world. Users of this software are expected to comply with local and national regulations in the jurisdictions where this sortware is used with radio equipment. @@ -39,7 +34,7 @@ Note to US Government Users -The OpenBTS software applications and associated documentation are "Commercial +The OsmoTRX software applications and associated documentation are "Commercial Item(s)," as that term is defined at 48 C.F.R. Section 2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation," as such terms are used in 48 C.F.R. 12.212 or 48 C.F.R. 227.7202, as @@ -54,13 +49,12 @@ Note to US Government Contractors GPL is not compatible with "government purpose rights" (GPR). If you receive -OpenBTS software under a GPL and deliver it under GPR, you will be in violation +OsmoTRX software under a GPL and deliver it under GPR, you will be in violation of GPL and possibly subject to enforcement actions by the original authors and copyright holders, including the Free Software Foundation, Inc. Software Licensing and Distribution -A subset of OpenBTS is distributed publicly under AGPLv3. Range reserves the right to -distribute most of this source code other licenses as well. See the COPYING file +The OsmoTRX is distributed publicly under AGPLv3. See the COPYING file for more information on the license for this distribution. -- To view, visit https://gerrit.osmocom.org/5646 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia40df831649cdb68898db9ca77868c422a8d631d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:44:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:44:11 +0000 Subject: osmo-trx[master]: Mark release target as virtual In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5641 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee747faa3171663f1874a5eacddd56607de55297 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:44:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:44:25 +0000 Subject: osmo-trx[master]: Remove outdated references to OpenBTS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5642 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2df613bf59af28e2f44a520d0ee953932bcf4d7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:44:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:44:42 +0000 Subject: osmo-trx[master]: Remove unused headers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5643 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idadb17aeb85b011d114ffc1d81c920544bac1989 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:45:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:45:08 +0000 Subject: osmo-trx[master]: Update installation instructions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5644 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ec26beaaa74dd3d98f27d110055a8f0cdd3c991 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:47:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:47:17 +0000 Subject: osmo-trx[master]: Update license notes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/5645/1/COPYING File COPYING: PS1, Line 676: : : : : : : : : : : : : : : : : : : : : : you cannot drop this part abot the remote network interaction. As for the trademark notice, we can safely remove it if nothing herein refers to OpenBTS anymore. -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ttsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:47:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:47:58 +0000 Subject: osmo-trx[master]: Update legal disclaimer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5646 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia40df831649cdb68898db9ca77868c422a8d631d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:52:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 13:52:03 +0000 Subject: [PATCH] libosmocore[master]: MNCC: Add MNCC to string dumper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5625 to look at the new patch set (#2). MNCC: Add MNCC to string dumper As MNCC is rather hard to debug (wireshark cannot trace UNIX domain sockets), let's add our own decoder that we can use from related debug log statements in the respective programs. Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 --- M include/osmocom/gsm/mncc.h M src/gsm/Makefile.am M src/gsm/libosmogsm.map A src/gsm/mncc.c 4 files changed, 429 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/25/5625/2 diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index f2450d9..5ca2986 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -82,3 +82,12 @@ GSM_MNCC_BCAP_OTHER_ITC = 5, GSM_MNCC_BCAP_RESERVED = 7, }; + +struct msgb; +struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len); + +void _osmo_mncc_log(int subsys, int level, const char *file, int line, const char *prefix, + const uint8_t *msg, unsigned int len); + +#define osmo_mncc_log(ss, level, prefix, msg, len) \ + _osmo_mncc_log(ss, level, __BASE_FILE__, __LINE__, prefix, msg, len); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 12f56db..f85aba3 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -30,7 +30,7 @@ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ - gsm23003.c + gsm23003.c mncc.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..80fbe06 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -425,5 +425,8 @@ osmo_imsi_str_valid; osmo_msisdn_str_valid; +osmo_mncc_stringify; +_osmo_mncc_log; + local: *; }; diff --git a/src/gsm/mncc.c b/src/gsm/mncc.c new file mode 100644 index 0000000..fa4726c --- /dev/null +++ b/src/gsm/mncc.c @@ -0,0 +1,416 @@ +/* mncc.c - utility routines for the MNCC API between the 04.08 + * message parsing and the actual Call Control logic */ + +/* (C) 2008-2017 by Harald Welte + * (C) 2009 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include "../config.h" + +#ifdef HAVE_SYS_SOCKET_H + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* FIXME FIXME FIXME FIXME FIXME START */ +#define MNCC_SETUP_REQ 0x0101 +#define MNCC_SETUP_IND 0x0102 +#define MNCC_SETUP_RSP 0x0103 +#define MNCC_SETUP_CNF 0x0104 +#define MNCC_SETUP_COMPL_REQ 0x0105 +#define MNCC_SETUP_COMPL_IND 0x0106 +/* MNCC_REJ_* is perfomed via MNCC_REL_* */ +#define MNCC_CALL_CONF_IND 0x0107 +#define MNCC_CALL_PROC_REQ 0x0108 +#define MNCC_PROGRESS_REQ 0x0109 +#define MNCC_ALERT_REQ 0x010a +#define MNCC_ALERT_IND 0x010b +#define MNCC_NOTIFY_REQ 0x010c +#define MNCC_NOTIFY_IND 0x010d +#define MNCC_DISC_REQ 0x010e +#define MNCC_DISC_IND 0x010f +#define MNCC_REL_REQ 0x0110 +#define MNCC_REL_IND 0x0111 +#define MNCC_REL_CNF 0x0112 +#define MNCC_FACILITY_REQ 0x0113 +#define MNCC_FACILITY_IND 0x0114 +#define MNCC_START_DTMF_IND 0x0115 +#define MNCC_START_DTMF_RSP 0x0116 +#define MNCC_START_DTMF_REJ 0x0117 +#define MNCC_STOP_DTMF_IND 0x0118 +#define MNCC_STOP_DTMF_RSP 0x0119 +#define MNCC_MODIFY_REQ 0x011a +#define MNCC_MODIFY_IND 0x011b +#define MNCC_MODIFY_RSP 0x011c +#define MNCC_MODIFY_CNF 0x011d +#define MNCC_MODIFY_REJ 0x011e +#define MNCC_HOLD_IND 0x011f +#define MNCC_HOLD_CNF 0x0120 +#define MNCC_HOLD_REJ 0x0121 +#define MNCC_RETRIEVE_IND 0x0122 +#define MNCC_RETRIEVE_CNF 0x0123 +#define MNCC_RETRIEVE_REJ 0x0124 +#define MNCC_USERINFO_REQ 0x0125 +#define MNCC_USERINFO_IND 0x0126 +#define MNCC_REJ_REQ 0x0127 +#define MNCC_REJ_IND 0x0128 + +#define MNCC_BRIDGE 0x0200 +#define MNCC_FRAME_RECV 0x0201 +#define MNCC_FRAME_DROP 0x0202 +#define MNCC_LCHAN_MODIFY 0x0203 +#define MNCC_RTP_CREATE 0x0204 +#define MNCC_RTP_CONNECT 0x0205 +#define MNCC_RTP_FREE 0x0206 + +#define GSM_TCHF_FRAME 0x0300 +#define GSM_TCHF_FRAME_EFR 0x0301 +#define GSM_TCHH_FRAME 0x0302 +#define GSM_TCH_FRAME_AMR 0x0303 +#define GSM_BAD_FRAME 0x03ff + +#define MNCC_SOCKET_HELLO 0x0400 + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +#define MNCC_F_BEARER_CAP 0x0001 +#define MNCC_F_CALLED 0x0002 +#define MNCC_F_CALLING 0x0004 +#define MNCC_F_REDIRECTING 0x0008 +#define MNCC_F_CONNECTED 0x0010 +#define MNCC_F_CAUSE 0x0020 +#define MNCC_F_USERUSER 0x0040 +#define MNCC_F_PROGRESS 0x0080 +#define MNCC_F_EMERGENCY 0x0100 +#define MNCC_F_FACILITY 0x0200 +#define MNCC_F_SSVERSION 0x0400 +#define MNCC_F_CCCAP 0x0800 +#define MNCC_F_KEYPAD 0x1000 +#define MNCC_F_SIGNAL 0x2000 + +struct gsm_mncc { + /* context based information */ + uint32_t msg_type; + uint32_t callref; + + /* which fields are present */ + uint32_t fields; + + /* data derived informations (MNCC_F_ based) */ + struct gsm_mncc_bearer_cap bearer_cap; + struct gsm_mncc_number called; + struct gsm_mncc_number calling; + struct gsm_mncc_number redirecting; + struct gsm_mncc_number connected; + struct gsm_mncc_cause cause; + struct gsm_mncc_progress progress; + struct gsm_mncc_useruser useruser; + struct gsm_mncc_facility facility; + struct gsm_mncc_cccap cccap; + struct gsm_mncc_ssversion ssversion; + struct { + int sup; + int inv; + } clir; + int signal; + + /* data derived information, not MNCC_F based */ + int keypad; + int more; + int notify; /* 0..127 */ + int emergency; + char imsi[16]; + + unsigned char lchan_type; + unsigned char lchan_mode; +}; + +struct gsm_data_frame { + uint32_t msg_type; + uint32_t callref; + unsigned char data[0]; +}; + +#define MNCC_SOCK_VERSION 5 +struct gsm_mncc_hello { + uint32_t msg_type; + uint32_t version; + + /* send the sizes of the structs */ + uint32_t mncc_size; + uint32_t data_frame_size; + + /* send some offsets */ + uint32_t called_offset; + uint32_t signal_offset; + uint32_t emergency_offset; + uint32_t lchan_type_offset; +}; + +struct gsm_mncc_rtp { + uint32_t msg_type; + uint32_t callref; + uint32_t ip; + uint16_t port; + uint32_t payload_type; + uint32_t payload_msg_type; +}; + +struct gsm_mncc_bridge { + uint32_t msg_type; + uint32_t callref[2]; +}; + +/* FIXME FIXME FIXME FIXME FIXME END */ + +const struct value_string osmo_mncc_names[] = { + { MNCC_SETUP_REQ, "MNCC_SETUP_REQ" }, + { MNCC_SETUP_IND, "MNCC_SETUP_IND" }, + { MNCC_SETUP_RSP, "MNCC_SETUP_RSP" }, + { MNCC_SETUP_CNF, "MNCC_SETUP_CNF" }, + { MNCC_SETUP_COMPL_REQ, "MNCC_SETUP_COMPL_REQ" }, + { MNCC_SETUP_COMPL_IND, "MNCC_SETUP_COMPL_IND" }, + { MNCC_CALL_CONF_IND, "MNCC_CALL_CONF_IND" }, + { MNCC_CALL_PROC_REQ, "MNCC_CALL_PROC_REQ" }, + { MNCC_PROGRESS_REQ, "MNCC_PROGRESS_REQ" }, + { MNCC_ALERT_REQ, "MNCC_ALERT_REQ" }, + { MNCC_ALERT_IND, "MNCC_ALERT_IND" }, + { MNCC_NOTIFY_REQ, "MNCC_NOTIFY_REQ" }, + { MNCC_NOTIFY_IND, "MNCC_NOTIFY_IND" }, + { MNCC_DISC_REQ, "MNCC_DISC_REQ" }, + { MNCC_DISC_IND, "MNCC_DISC_IND" }, + { MNCC_REL_REQ, "MNCC_REL_REQ" }, + { MNCC_REL_IND, "MNCC_REL_IND" }, + { MNCC_REL_CNF, "MNCC_REL_CNF" }, + { MNCC_FACILITY_REQ, "MNCC_FACILITY_REQ" }, + { MNCC_FACILITY_IND, "MNCC_FACILITY_IND" }, + { MNCC_START_DTMF_IND, "MNCC_START_DTMF_IND" }, + { MNCC_START_DTMF_RSP, "MNCC_START_DTMF_RSP" }, + { MNCC_START_DTMF_REJ, "MNCC_START_DTMF_REJ" }, + { MNCC_STOP_DTMF_IND, "MNCC_STOP_DTMF_IND" }, + { MNCC_STOP_DTMF_RSP, "MNCC_STOP_DTMF_RSP" }, + { MNCC_MODIFY_REQ, "MNCC_MODIFY_REQ" }, + { MNCC_MODIFY_IND, "MNCC_MODIFY_IND" }, + { MNCC_MODIFY_RSP, "MNCC_MODIFY_RSP" }, + { MNCC_MODIFY_CNF, "MNCC_MODIFY_CNF" }, + { MNCC_MODIFY_REJ, "MNCC_MODIFY_REJ" }, + { MNCC_HOLD_IND, "MNCC_HOLD_IND" }, + { MNCC_HOLD_CNF, "MNCC_HOLD_CNF" }, + { MNCC_HOLD_REJ, "MNCC_HOLD_REJ" }, + { MNCC_RETRIEVE_IND, "MNCC_RETRIEVE_IND" }, + { MNCC_RETRIEVE_CNF, "MNCC_RETRIEVE_CNF" }, + { MNCC_RETRIEVE_REJ, "MNCC_RETRIEVE_REJ" }, + { MNCC_USERINFO_REQ, "MNCC_USERINFO_REQ" }, + { MNCC_USERINFO_IND, "MNCC_USERINFO_IND" }, + { MNCC_REJ_REQ, "MNCC_REJ_REQ" }, + { MNCC_REJ_IND, "MNCC_REJ_IND" }, + { MNCC_BRIDGE, "MNCC_BRIDGE" }, + { MNCC_FRAME_RECV, "MNCC_FRAME_RECV" }, + { MNCC_FRAME_DROP, "MNCC_FRAME_DROP" }, + { MNCC_LCHAN_MODIFY, "MNCC_LCHAN_MODIFY" }, + { MNCC_RTP_CREATE, "MNCC_RTP_CREATE" }, + { MNCC_RTP_CONNECT, "MNCC_RTP_CONNECT" }, + { MNCC_RTP_FREE, "MNCC_RTP_FREE" }, + { GSM_TCHF_FRAME, "GSM_TCHF_FRAME" }, + { GSM_TCHF_FRAME_EFR, "GSM_TCHF_FRAME_EFR" }, + { GSM_TCHH_FRAME, "GSM_TCHH_FRAME" }, + { GSM_TCH_FRAME_AMR, "GSM_TCH_FRAME_AMR" }, + { GSM_BAD_FRAME, "GSM_BAD_FRAME" }, + { MNCC_SOCKET_HELLO, "MNCC_SOCKET_HELLO" }, + { 0, NULL }, +}; + +static inline const char *osmo_mncc_name(uint32_t msg_type) { + return get_value_string(osmo_mncc_names, msg_type); +} + +static void mncc_dump_rtp(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_rtp *rtp = (const struct gsm_mncc_rtp *) msg; + struct in_addr ia; + if (len < sizeof(*rtp)) { + msgb_printf(str, "short MNCC RTP message (%u bytes)", len); + return; + } + + ia.s_addr = rtp->ip; + msgb_printf(str, "%s(ref=0x%08x, ip=%s, port=%u, pt=%u, pt_mt=%u)", + osmo_mncc_name(rtp->msg_type), rtp->callref, inet_ntoa(ia), + ntohs(rtp->port), rtp->payload_type, rtp->payload_msg_type); +} + +static void mncc_dump_data(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_data_frame *data = (const struct gsm_data_frame *) msg; + if (len < sizeof(*data)) { + msgb_printf(str, "short MNCC DATA message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ref=0x%08x, data=%s)", osmo_mncc_name(data->msg_type), data->callref, + osmo_hexdump_nospc(data->data, len - sizeof(*data))); +} + +static void mncc_dump_hello(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_hello *hello = (const struct gsm_mncc_hello *) msg; + if (len < sizeof(*hello)) { + msgb_printf(str, "short MNCC HELLO message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ver=%u, mncc_sz=%u, data_size=%u called_off=%u, signal_off=%u, " + "emerg_off=%u, lchan_t_off=%u)\n", osmo_mncc_name(hello->msg_type), + hello->version, hello->mncc_size, hello->data_frame_size, hello->called_offset, + hello->signal_offset, hello->emergency_offset, hello->lchan_type_offset); +} + +static void msg_dump_number(struct msgb *str, const char *pfx, const struct gsm_mncc_number *num) +{ + msgb_printf(str, "%s(%d,%d,%d,%d,%s)", pfx, num->type, num->plan, num->present, num->screen, + num->number); +} + +static void mncc_dump_bridge(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_bridge *bridge = (const struct gsm_mncc_bridge *)msg; + if (len < sizeof(*bridge)) { + msgb_printf(str, "short MNCC BRIDGE message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(call_a=0x%08x, call_b=0x%08x)", osmo_mncc_name(bridge->msg_type), + bridge->callref[0], bridge->callref[1]); +} + +static void mncc_dump_sign(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc *sign = (const struct gsm_mncc *) msg; + if (len < sizeof(*sign)) { + msgb_printf(str, "short MNCC SIGN message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ref=0x%08x, imsi=%s", osmo_mncc_name(sign->msg_type), sign->callref, + sign->imsi); + //if (sign->fields & MNCC_F_BEARER_CAP) + // msgb_printf(str, ", bcap=%s", osmo_hexdump_nospc()); + if (sign->fields & MNCC_F_CALLED) + msg_dump_number(str, ", called=", &sign->called); + if (sign->fields & MNCC_F_CALLING) + msg_dump_number(str, ", calling=", &sign->calling); + if (sign->fields & MNCC_F_REDIRECTING) + msg_dump_number(str, ", redirecting=", &sign->redirecting); + if (sign->fields & MNCC_F_CONNECTED) + msg_dump_number(str, ", connected=", &sign->connected); + if (sign->fields & MNCC_F_CAUSE) { + msgb_printf(str, ", cause=(%d,%d,%d,%d,%d,'%s')", sign->cause.location, + sign->cause.coding, sign->cause.rec, sign->cause.rec_val, + sign->cause.value, sign->cause.diag_len ? sign->cause.diag : ""); + } + if (sign->fields & MNCC_F_USERUSER) { + msgb_printf(str, ", useruser=(%u, '%s')", sign->useruser.proto, + sign->useruser.info); + } + if (sign->fields & MNCC_F_PROGRESS) { + msgb_printf(str, ", progress=(%d, %d, %d)", sign->progress.coding, + sign->progress.location, sign->progress.descr); + } + if (sign->fields & MNCC_F_EMERGENCY) + msgb_printf(str, ", emergency=%d", sign->emergency); + if (sign->fields & MNCC_F_FACILITY) + msgb_printf(str, ", facility='%s'", sign->facility.info); + if (sign->fields & MNCC_F_SSVERSION) + msgb_printf(str, ", ssversion='%s'", sign->ssversion.info); + if (sign->fields & MNCC_F_CCCAP) + msgb_printf(str, ", cccap=(%d, %d)", sign->cccap.dtmf, sign->cccap.pcp); + if (sign->fields & MNCC_F_KEYPAD) + msgb_printf(str, ", keypad=%d", sign->keypad); + if (sign->fields & MNCC_F_SIGNAL) + msgb_printf(str, ", signal=%d", sign->signal); + + msgb_printf(str, ", clir.sup=%d, clir.inv=%d, more=%d, notify=%d)", sign->clir.sup, + sign->clir.inv, sign->more, sign->notify); + /* lchan_type/lchan_mode? */ +} + + +struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len) +{ + uint32_t msg_type; + struct msgb *str = msgb_alloc(2048, __func__); + + OSMO_ASSERT(str); + + if (len <= sizeof(msg_type)) { + msgb_printf(str, "short MNCC message (%d bytes)", len); + return NULL; + } + + msg_type = *(const uint32_t *)msg; + switch (msg_type) { + case MNCC_RTP_CREATE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_FREE: + mncc_dump_rtp(str, msg, len); + break; + case GSM_TCHF_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHH_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_BAD_FRAME: + mncc_dump_data(str, msg, len); + break; + case MNCC_SOCKET_HELLO: + mncc_dump_hello(str, msg, len); + break; + case MNCC_BRIDGE: + mncc_dump_bridge(str, msg, len); + break; + default: + mncc_dump_sign(str, msg, len); + break; + } + return str; +} + +void _osmo_mncc_log(int ss, int level, const char *file, int line, const char *prefix, + const uint8_t *msg, unsigned int len) +{ + struct msgb *str; + if (!log_check_level(ss, level)) + return; + + str = osmo_mncc_stringify(msg, len); + if (!str) + return; + + logp2(ss, level, file, line, 0, "%s%s\n", prefix, str->data); + msgb_free(str); +} + +#endif /* HAVE_SYS_SOCKET_H */ -- To view, visit https://gerrit.osmocom.org/5625 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:52:27 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:52:27 +0000 Subject: osmo-trx[master]: Update license notes In-Reply-To: References: Message-ID: Patch Set 1: I have not dropped it, I've moved it to readme - if I understood it correctly, it's not part of the actual license, just clarification comment. If so, than readme seemsl ike a better place to avoid confusion between actual license terms and related explanations. -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 13:58:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 13:58:59 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Update path to ctrl scripts Message-ID: Review at https://gerrit.osmocom.org/5647 Update path to ctrl scripts Change-Id: Ib95e1ad33bbf115c8190f97210925549e6dc081a Related: OS#2550 --- M common/chapters/control_if.adoc 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/47/5647/1 diff --git a/common/chapters/control_if.adoc b/common/chapters/control_if.adoc index dd6938a..ea55cd7 100644 --- a/common/chapters/control_if.adoc +++ b/common/chapters/control_if.adoc @@ -176,7 +176,7 @@ === Control Interface python examples In the `osmo-python-tests` repository, there is an example python script -called `osmopy/osmo_ctrl.py` which implements the Osmocom +called `scripts/osmo_ctrl.py` which implements the Osmocom control interface protocol. You can use this tool either stand-alone to perform control interface @@ -184,7 +184,7 @@ for developing your own python software talking to the control interface. -Another implementation is in `osmopy/rate_ctr2csv.py` which will retrieve performance counters +Another implementation is in `scripts/osmo_rate_ctr2csv.py` which will retrieve performance counters for a given Osmocom program and output it in csv format. This can be used to periodically (using systemd timer for example) retrieve data to build KPI and evaluate how it changes over time. @@ -196,7 +196,7 @@ .Example: Use `rate_ctr2csv.py` to get rate counters from OsmoBSC ---- -$ ./osmopy/rate_ctr2csv.py --header +$ ./scripts/osmo_rate_ctr2csv.py --header Connecting to localhost:4249... Getting rate counter groups info... "group","counter","absolute","second","minute","hour","day" -- To view, visit https://gerrit.osmocom.org/5647 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib95e1ad33bbf115c8190f97210925549e6dc081a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:05:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 4 Jan 2018 14:05:32 +0000 Subject: osmo-trx[master]: Update license notes In-Reply-To: References: Message-ID: Patch Set 1: > I have not dropped it, I've moved it to readme - if I understood it > correctly, it's not part of the actual license, just clarification > comment. If so, than readme seemsl ike a better place to avoid > confusion between actual license terms and related explanations. A GPLv3 additional grant is well-defined in GPLv3 Section 7 and they should be next to the license, not somewhere else. It's confusing. -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:05:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:05:48 +0000 Subject: [MERGED] osmo-trx[master]: Mark release target as virtual In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Mark release target as virtual ...................................................................... Mark release target as virtual Change-Id: Iee747faa3171663f1874a5eacddd56607de55297 --- M Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 5cf1a45..da08bf3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -39,6 +39,8 @@ COPYING \ README +.PHONY: release + @RELMAKE@ dox: FORCE -- To view, visit https://gerrit.osmocom.org/5641 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee747faa3171663f1874a5eacddd56607de55297 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:14:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:14:55 +0000 Subject: [PATCH] osmo-pcu[master]: TBF-UL: add simpler test helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5337 to look at the new patch set (#4). TBF-UL: add simpler test helper Add function to set both V_R and V_Q values to 0 which is useful for TBF test. Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 --- M src/rlc.h M tests/tbf/TbfTest.cpp 2 files changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/37/5337/4 diff --git a/src/rlc.h b/src/rlc.h index b62e3ac..b68ee92 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -342,6 +342,7 @@ const void set_v_r(int); const void set_v_q(int); + void reset_state(); const uint16_t ssn() const; @@ -573,6 +574,12 @@ return is_in_window(bsn) && m_v_n.is_received(bsn) && offset_v_r < ws(); } +inline void gprs_rlc_ul_window::reset_state() +{ + m_v_r = 0; + m_v_q = 0; +} + inline const void gprs_rlc_ul_window::set_v_r(int v_r) { m_v_r = v_r; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 40cb313..44f42b9 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1722,8 +1722,7 @@ "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate URBB with length */ ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class, ul_tbf); @@ -1735,8 +1734,7 @@ send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate CRBB */ bts->ws_base = 128; bts->ws_pdch = 64; -- To view, visit https://gerrit.osmocom.org/5337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 Gerrit-PatchSet: 4 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 Jan 4 14:14:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:14:55 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: move window parameters to UL/DL level 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/5340 to look at the new patch set (#4). TBF: move window parameters to UL/DL level The UL and DL TBF use different classes implementing window management. Hence it's better to use it explicitly instead of using the common window management superclass inside common TBF superclass. While at it, also remove the direct access to window class - use accessor functions instead. Related: OS#1759 Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6 --- M src/bts.cpp M src/encoding.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp 6 files changed, 42 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/40/5340/4 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..0133a12 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1203,7 +1203,7 @@ num_blocks = Decoding::decode_gprs_acknack_bits( &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, &tbf->m_window); + &bsn_begin, &bsn_end, tbf->window()); LOGP(DRLCMAC, LOGL_DEBUG, "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " @@ -1279,8 +1279,8 @@ (void *)&ack_nack->EGPRS_AckNack.Desc, (int)offsetof(EGPRS_AckNack_t, Desc), (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->m_window.v_a(), - tbf->m_window.v_s(), + tbf->window()->v_a(), + tbf->window()->v_s(), osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); @@ -1290,7 +1290,7 @@ num_blocks = Decoding::decode_egprs_acknack_bits( &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, &tbf->m_window); + &bsn_begin, &bsn_end, tbf->window()); LOGP(DRLCMAC, LOGL_DEBUG, "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " diff --git a/src/encoding.cpp b/src/encoding.cpp index 87c6f08..b2da1e8 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -695,7 +695,7 @@ { bitvec_write_field(dest, &wp, tbf->current_cs().to_num() - 1, 2); // CHANNEL_CODING_COMMAND - write_packet_ack_nack_desc_gprs(bts, dest, wp, &tbf->m_window, is_final); + write_packet_ack_nack_desc_gprs(bts, dest, wp, tbf->window(), is_final); bitvec_write_field(dest, &wp, 1, 1); // 1: have CONTENTION_RESOLUTION_TLLI bitvec_write_field(dest, &wp, tbf->tlli(), 32); // CONTENTION_RESOLUTION_TLLI @@ -892,7 +892,7 @@ /* -2 for last bit 0 mandatory and REL5 not supported */ unsigned bits_ack_nack = dest->data_len * 8 - wp - 2; - write_packet_ack_nack_desc_egprs(bts, dest, wp, &tbf->m_window, is_final, bits_ack_nack); + write_packet_ack_nack_desc_egprs(bts, dest, wp, tbf->window(), is_final, bits_ack_nack); bitvec_write_field(dest, &wp, 0, 1); // fixed 0 bitvec_write_field(dest, &wp, 0, 1); // 0: don't have REL 5 diff --git a/src/tbf.cpp b/src/tbf.cpp index 9c1dac9..5480757 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1492,6 +1492,11 @@ return ts == control_ts; } +gprs_rlc_ul_window *gprs_rlcmac_ul_tbf::window() +{ + return &m_window; +} + struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) { diff --git a/src/tbf.h b/src/tbf.h index 9491f2a..44b3844 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -191,8 +191,6 @@ GprsMs *ms() const; void set_ms(GprsMs *ms); - gprs_rlc_window *window(); - uint8_t tsc() const; int rlcmac_diag(); @@ -436,7 +434,7 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf { gprs_rlcmac_dl_tbf(BTS *bts); - + gprs_rlc_dl_window *window(); void cleanup(); void enable_egprs(); /* dispatch Unitdata.DL messages */ @@ -476,7 +474,6 @@ * All states that need reset must be in this struct, so this is why * variables are in both (dl and ul) structs and not outside union. */ - gprs_rlc_dl_window m_window; int32_t m_tx_counter; /* count all transmitted blocks */ uint8_t m_wait_confirm; /* wait for CCCH IMM.ASS cnf */ bool m_dl_ack_requested; @@ -527,11 +524,18 @@ enum egprs_rlcmac_dl_spb get_egprs_dl_spb(int bsn); struct osmo_timer_list m_llc_timer; + + /* Please note that all variables below will be reset when changing + * from WAIT RELEASE back to FLOW state (re-use of TBF). + * All states that need reset must be in this struct, so this is why + * variables are in both (dl and ul) structs and not outside union. + */ + gprs_rlc_dl_window m_window; }; struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf { gprs_rlcmac_ul_tbf(BTS *bts); - + gprs_rlc_ul_window *window(); struct msgb *create_ul_ack(uint32_t fn, uint8_t ts); bool ctrl_ack_to_toggle(); bool handle_ctrl_ack(); @@ -570,7 +574,6 @@ * All states that need reset must be in this struct, so this is why * variables are in both (dl and ul) structs and not outside union. */ - gprs_rlc_ul_window m_window; int32_t m_rx_counter; /* count all received blocks */ uint8_t m_n3103; /* N3103 counter */ uint8_t m_usf[8]; /* list USFs per PDCH (timeslot) */ @@ -582,6 +585,13 @@ protected: void maybe_schedule_uplink_acknack(const gprs_rlc_data_info *rlc); + + /* Please note that all variables below will be reset when changing + * from WAIT RELEASE back to FLOW state (re-use of TBF). + * All states that need reset must be in this struct, so this is why + * variables are in both (dl and ul) structs and not outside union. + */ + gprs_rlc_ul_window m_window; }; #ifdef __cplusplus @@ -635,16 +645,6 @@ return static_cast(tbf); else return NULL; -} - -inline gprs_rlc_window *gprs_rlcmac_tbf::window() -{ - switch (direction) - { - case GPRS_RLCMAC_UL_TBF: return &as_ul_tbf(this)->m_window; - case GPRS_RLCMAC_DL_TBF: return &as_dl_tbf(this)->m_window; - } - return NULL; } #endif diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 58b55dc..9129845 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -978,6 +978,11 @@ return lost * 100 / (lost + received); } +gprs_rlc_dl_window *gprs_rlcmac_dl_tbf::window() +{ + return &m_window; +} + int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, const struct bitvec *rbb) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index fbbe366..ac15b2c 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -297,9 +297,9 @@ /* Receive an ACK */ #define RCV_ACK(fin, tbf, rbb) do { \ - tbf->rcvd_dl_ack(fin, tbf->m_window.v_s(), rbb); \ + tbf->rcvd_dl_ack(fin, tbf->window()->v_s(), rbb); \ if (!fin) \ - OSMO_ASSERT(tbf->m_window.window_empty()); \ + OSMO_ASSERT(tbf->window()->window_empty()); \ } while(0) static void test_tbf_delayed_release() @@ -1725,7 +1725,7 @@ "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.reset_state(); + ul_tbf->window()->reset_state(); /* Function to generate URBB with length */ ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class, ul_tbf); @@ -1737,7 +1737,7 @@ send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.reset_state(); + ul_tbf->window()->reset_state(); /* Function to generate CRBB */ bts->ws_base = 128; bts->ws_pdch = 64; @@ -2529,7 +2529,7 @@ dl_tbf = create_dl_tbf(&the_bts, ms_class, egprs_ms_class, &trx_no); dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); - prlcdlwindow = &dl_tbf->m_window; + prlcdlwindow = dl_tbf->window(); prlcmvb = &prlcdlwindow->m_v_b; prlcdlwindow->m_v_s = 1288; prlcdlwindow->m_v_a = 1176; @@ -2561,7 +2561,7 @@ Decoding::decode_egprs_acknack_bits( &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, &dl_tbf->m_window); + &bsn_begin, &bsn_end, dl_tbf->window()); dl_tbf->rcvd_dl_ack( ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, @@ -2755,17 +2755,17 @@ } #define NACK(tbf, x) do { \ - tbf->m_window.m_v_b.mark_nacked(x); \ - OSMO_ASSERT(tbf->m_window.m_v_b.is_nacked(x)); \ + tbf->window()->m_v_b.mark_nacked(x); \ + OSMO_ASSERT(tbf->window()->m_v_b.is_nacked(x)); \ } while(0) #define CHECK_UNACKED(tbf, cs, bsn) do { \ - OSMO_ASSERT(tbf->m_window.m_v_b.is_unacked(bsn)); \ + OSMO_ASSERT(tbf->window()->m_v_b.is_unacked(bsn)); \ OSMO_ASSERT(tbf->m_rlc.block(bsn)->cs_current_trans.to_num() == cs); \ } while(0) #define CHECK_NACKED(tbf, cs, bsn) do { \ - OSMO_ASSERT(tbf->m_window.m_v_b.is_nacked(bsn)); \ + OSMO_ASSERT(tbf->window()->m_v_b.is_nacked(bsn)); \ OSMO_ASSERT(tbf->m_rlc.block(bsn)->cs_current_trans.to_num() == cs); \ } while(0) -- To view, visit https://gerrit.osmocom.org/5340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6 Gerrit-PatchSet: 4 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 Jan 4 14:15:58 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:15:58 +0000 Subject: [MERGED] osmo-trx[master]: Update installation instructions In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Update installation instructions ...................................................................... Update installation instructions * remove references to OpenBTS * update URLs * remove unnecessary requirements Change-Id: I6ec26beaaa74dd3d98f27d110055a8f0cdd3c991 Related: OS#2600 --- M INSTALLATION 1 file changed, 5 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/INSTALLATION b/INSTALLATION index 3e35d7e..0c0d205 100644 --- a/INSTALLATION +++ b/INSTALLATION @@ -2,32 +2,24 @@ -OpenBTS compiles to a simple Unix binary and does not require special +osmo-trx compiles to a simple Unix binary and does not require special installation. One some systems (Ubuntu), you will need to define LIBS = -lpthread prior to running configure. -To run OpenBTS, the following should be installed: - - Asterisk (http://www.asterisk.org), running SIP on port 5060. - - libosip2 (http://www.gnu.org/software/osip/) - - libortp (http://freshmeat.net/projects/ortp/) - - libusrp (http://gnuradio.org). +To run osmo-trx, the following should be installed: + libuhd (https://gnuradio.org). This is part of the GNURadio installation. - It is the only part used by OpenBTS. -OpenBTS logs to syslogd as facility LOG_LOCAL7. Please set your /etc/syslog.conf +osmo-trx logs to syslogd as facility LOG_LOCAL7. Please set your /etc/syslog.conf accordingly. For information on specific executables, see tests/README.tests and apps/README.apps. -See http://gnuradio.org/redmine/wiki/gnuradio/OpenBTS/BuildingAndRunning for more +See https://osmocom.org/projects/osmotrx/wiki/OsmoTRX for more information. -- To view, visit https://gerrit.osmocom.org/5644 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ec26beaaa74dd3d98f27d110055a8f0cdd3c991 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:15:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:15:59 +0000 Subject: [MERGED] osmo-trx[master]: Remove unused headers In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove unused headers ...................................................................... Remove unused headers Change-Id: Idadb17aeb85b011d114ffc1d81c920544bac1989 --- M CommonLibs/VectorTest.cpp M Transceiver52M/Channelizer.cpp M Transceiver52M/Synthesis.cpp M Transceiver52M/USRPDevice.cpp 4 files changed, 1 insertion(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/CommonLibs/VectorTest.cpp b/CommonLibs/VectorTest.cpp index ad5c473..6958889 100644 --- a/CommonLibs/VectorTest.cpp +++ b/CommonLibs/VectorTest.cpp @@ -28,10 +28,6 @@ #include "Vector.h" #include -// We must have a gConfig now to include Vector. -#include "Configuration.h" -ConfigurationTable gConfig; - using namespace std; typedef Vector TestVector; diff --git a/Transceiver52M/Channelizer.cpp b/Transceiver52M/Channelizer.cpp index 4b163b9..80eab3e 100644 --- a/Transceiver52M/Channelizer.cpp +++ b/Transceiver52M/Channelizer.cpp @@ -25,7 +25,6 @@ #include #include -#include "Logger.h" #include "Channelizer.h" extern "C" { diff --git a/Transceiver52M/Synthesis.cpp b/Transceiver52M/Synthesis.cpp index 0f8197a..22481d5 100644 --- a/Transceiver52M/Synthesis.cpp +++ b/Transceiver52M/Synthesis.cpp @@ -24,8 +24,8 @@ #include #include #include +#include -#include "Logger.h" #include "Synthesis.h" extern "C" { diff --git a/Transceiver52M/USRPDevice.cpp b/Transceiver52M/USRPDevice.cpp index 3d20411..034ccd8 100644 --- a/Transceiver52M/USRPDevice.cpp +++ b/Transceiver52M/USRPDevice.cpp @@ -36,8 +36,6 @@ #include "Threads.h" #include "USRPDevice.h" -#include - #ifdef HAVE_CONFIG_H #include "config.h" #endif -- To view, visit https://gerrit.osmocom.org/5643 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idadb17aeb85b011d114ffc1d81c920544bac1989 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:15:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:15:59 +0000 Subject: [MERGED] osmo-trx[master]: Remove outdated references to OpenBTS In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove outdated references to OpenBTS ...................................................................... Remove outdated references to OpenBTS Change-Id: I2df613bf59af28e2f44a520d0ee953932bcf4d7e --- M AUTHORS 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/AUTHORS b/AUTHORS index 598b606..88ac61b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -90,9 +90,6 @@ SMS/SMSTransfer.h TRXManager/TRXManager.cpp Transceiver/Complex.h - apps/OpenBTS900.cpp - apps/OpenBTS850.cpp - apps/OpenBTS25c3.cpp tests/AGCHTest.cpp tests/BeaconTest.cpp tests/CallTest.cpp -- To view, visit https://gerrit.osmocom.org/5642 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2df613bf59af28e2f44a520d0ee953932bcf4d7e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:19:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:19:25 +0000 Subject: [MERGED] osmo-trx[master]: Update legal disclaimer In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Update legal disclaimer ...................................................................... Update legal disclaimer * drop trademark passage * add link to OpenBTS website and corresponding attribution * replace OpenBTS references with OsmoTRX Change-Id: Ia40df831649cdb68898db9ca77868c422a8d631d Related: OS#2600 --- M LEGAL 1 file changed, 7 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/LEGAL b/LEGAL index 1d7702b..a8b75f2 100644 --- a/LEGAL +++ b/LEGAL @@ -1,5 +1,8 @@ OpenBTS +The OsmoTRX project is direved from OpenBTS transceiver code. See http://openbts.org/ for details. + +The related copyrights: Most parts copyright 2008-2011 Free Software Foundation. Some parts copyright 2010 Kestrel Signal Processing, Inc. Some parts copyright 2011 Range Networks, Inc. @@ -12,17 +15,9 @@ actions are necessary to avoid patent infringement. -Trademark - -"OpenBTS" is a registered trademark of Range Networks, Inc. (Range), a -California corporation. Range reserves the right to control the use of this -trademark. Do not use this trademark in commerce without permission and do not -rebrand OpenBTS under a different trademark. - - Telecom and Radio Spectrum Laws -The primary function of OpenBTS is the provision of telecommunications service +The primary function of OsmoTRX is the provision of telecommunications service over a radio link. This activity is heavily regulated nearly everywhere in the world. Users of this software are expected to comply with local and national regulations in the jurisdictions where this sortware is used with radio equipment. @@ -39,7 +34,7 @@ Note to US Government Users -The OpenBTS software applications and associated documentation are "Commercial +The OsmoTRX software applications and associated documentation are "Commercial Item(s)," as that term is defined at 48 C.F.R. Section 2.101, consisting of "Commercial Computer Software" and "Commercial Computer Software Documentation," as such terms are used in 48 C.F.R. 12.212 or 48 C.F.R. 227.7202, as @@ -54,13 +49,12 @@ Note to US Government Contractors GPL is not compatible with "government purpose rights" (GPR). If you receive -OpenBTS software under a GPL and deliver it under GPR, you will be in violation +OsmoTRX software under a GPL and deliver it under GPR, you will be in violation of GPL and possibly subject to enforcement actions by the original authors and copyright holders, including the Free Software Foundation, Inc. Software Licensing and Distribution -A subset of OpenBTS is distributed publicly under AGPLv3. Range reserves the right to -distribute most of this source code other licenses as well. See the COPYING file +The OsmoTRX is distributed publicly under AGPLv3. See the COPYING file for more information on the license for this distribution. -- To view, visit https://gerrit.osmocom.org/5646 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia40df831649cdb68898db9ca77868c422a8d631d Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:20:10 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 4 Jan 2018 14:20:10 +0000 Subject: [PATCH] osmo-bsc[master]: cosmetic: mgcp: remove duplicate logging Message-ID: Review at https://gerrit.osmocom.org/5648 cosmetic: mgcp: remove duplicate logging do not print an additional log lines when the mgcp FSM gets halted. This is already done by osmo-fsm Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 --- M src/osmo-bsc/osmo_bsc_mgcp.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/5648/1 diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 8ea6415..ba99080 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -808,8 +808,6 @@ mgcp_ctx->resp = NULL; } - LOGPFSML(fi, LOGL_DEBUG, "state machine halted\n"); - /* Destroy the state machine and all context information */ osmo_fsm_inst_free(mgcp_ctx->fsm); mgcp_ctx->fsm = NULL; -- To view, visit https://gerrit.osmocom.org/5648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:22:07 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 4 Jan 2018 14:22:07 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams 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/4980 to look at the new patch set (#17). mgcp: use osmo-mgw to switch rtp streams in the current implementation we still use osmo-bsc_mgcp, which has many problems and is also obsoleted by osmo-mgw. integrate osmo-mgw and re-implement the current switching using an osmo fsm. Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062 Closes: OS#2605 Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/gsm_data.h M include/osmocom/msc/iucs.h M include/osmocom/msc/msc_ifaces.h A include/osmocom/msc/msc_mgcp.h M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_mgcp.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c 15 files changed, 1,310 insertions(+), 325 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/4980/17 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 1419e8e..052d830 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -39,6 +39,7 @@ mncc.h \ mncc_int.h \ msc_ifaces.h \ + msc_mgcp.h \ network_listen.h \ oap_client.h \ openbscdefines.h \ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1b0bff9..98fa125 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -196,9 +196,17 @@ struct gsm_encr encr; struct { + struct mgcp_ctx *mgcp_ctx; unsigned int mgcp_rtp_endpoint; - uint16_t port_subscr; - uint16_t port_cn; + + uint16_t local_port_ran; + char local_addr_ran[INET_ADDRSTRLEN]; + uint16_t remote_port_ran; + char remote_addr_ran[INET_ADDRSTRLEN]; + uint16_t local_port_cn; + char local_addr_cn[INET_ADDRSTRLEN]; + uint16_t remote_port_cn; + char remote_addr_cn[INET_ADDRSTRLEN]; } rtp; /* which Iu-CS connection, if any. */ diff --git a/include/osmocom/msc/iucs.h b/include/osmocom/msc/iucs.h index b7d6064..a48a316 100644 --- a/include/osmocom/msc/iucs.h +++ b/include/osmocom/msc/iucs.h @@ -1,7 +1,10 @@ #pragma once +#include + int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, struct ranap_ue_conn_ctx *ue); +int iu_rab_act_cs(struct gsm_trans *trans); diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index 0592c07..ca25e9d 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -37,7 +37,3 @@ enum gsm48_reject_value value); int msc_tx_common_id(struct gsm_subscriber_connection *conn); -int msc_call_assignment(struct gsm_trans *trans); -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); -void msc_call_release(struct gsm_trans *trans); -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip); diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h new file mode 100644 index 0000000..ac3283c --- /dev/null +++ b/include/osmocom/msc/msc_mgcp.h @@ -0,0 +1,56 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +/* MGCP state handler context. This context information stores all information + * to handle the direction of the RTP streams via MGCP. There is one instance + * of this context struct per subscriber connection. + * (see also struct gsm_subscriber_connection) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number. This number identifies the endpoint + * on the MGW on which the RAN and CN connection is created. This + * endpoint number is assigned and released automatically. */ + uint16_t rtp_endpoint; + + /* Set to true, when the context information is no longer needed */ + bool free_ctx; + + /* RTP connection identifiers */ + char conn_id_ran[MGCP_CONN_ID_LENGTH]; + char conn_id_cn[MGCP_CONN_ID_LENGTH]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + struct gsm_trans *trans; + mgcp_trans_id_t mgw_pending_trans; +}; + +int msc_mgcp_call_assignment(struct gsm_trans *trans); +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr); +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); +int msc_mgcp_call_release(struct gsm_trans *trans); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7dfb047..2bb4bcf 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -40,6 +40,7 @@ mncc_builtin.c \ mncc_sock.c \ msc_ifaces.c \ + msc_mgcp.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 9dacca5..3ea873f 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -396,8 +396,17 @@ /* Package RTP-Address data */ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); + rtp_addr_in.sin_port = osmo_htons(conn->rtp.local_port_ran); + rtp_addr_in.sin_addr.s_addr = inet_addr(conn->rtp.local_addr_ran); + + if (rtp_addr_in.sin_addr.s_addr == INADDR_NONE) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Address -- assignment not sent!\n"); + return -EINVAL; + } + if (rtp_addr_in.sin_port == 0) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Port -- assignment not sent!\n"); + return -EINVAL; + } memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 909a9f9..fc95dfb 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -596,11 +597,7 @@ * transport address element */ if (rtp_addr.ss_family == AF_INET) { rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp.port_subscr = osmo_ntohs(rtp_addr_in->sin_port); - /* FIXME: We also get the IP-Address of the remote (e.g. BTS) - * end with the response. Currently we just ignore that address. - * Instead we expect that our local MGCP gateway and the code - * controlling it, magically knows the IP of the remote end. */ + msc_mgcp_ass_complete(conn, osmo_ntohs(rtp_addr_in->sin_port), inet_ntoa(rtp_addr_in->sin_addr)); } else { LOGP(DMSC, LOGL_ERROR, "Unsopported addressing scheme. (supports only IPV4)\n"); goto fail; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3045f71..8e783e7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #ifdef BUILD_IU @@ -77,6 +78,7 @@ #include #include +#include #include @@ -1331,8 +1333,8 @@ { gsm48_stop_cc_timer(trans); - /* Make sure call also gets released on the mgcp side */ - msc_call_release(trans); + /* Initiate the teardown of the related connections on the MGW */ + msc_mgcp_call_release(trans); /* send release to L4, if callref still exists */ if (trans->callref) { @@ -1393,6 +1395,7 @@ { struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[0]); struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); + int rc; if (!trans1 || !trans2) return -EIO; @@ -1403,7 +1406,18 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - return msc_call_bridge(trans1, trans2); + /* Bridge RTP streams */ + rc = msc_mgcp_call_complete(trans1, trans2->conn->rtp.local_port_cn, + trans2->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + rc = msc_mgcp_call_complete(trans2, trans1->conn->rtp.local_port_cn, + trans1->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + return 0; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1746,7 +1760,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -1788,7 +1802,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2672,8 +2686,23 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); - uint16_t port = trans->conn->rtp.port_cn; + uint32_t addr = inet_addr(trans->conn->rtp.local_addr_cn); + uint16_t port = trans->conn->rtp.local_port_cn; + + LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + + if (addr == INADDR_NONE) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid IP-Address\n", + vlr_subscr_name(trans->vsub)); + return; + } + if (port == 0) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid Port\n", + vlr_subscr_name(trans->vsub)); + return; + } /* FIXME: This has to be set to some meaningful value, * before the MSC-Split, this value was pulled from @@ -2713,15 +2742,15 @@ trans->conn->mncc_rtp_bridge = 1; - /* When we call msc_call_assignment() we will trigger, depending + /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. - * msc_call_assignment() also takes care about sending the CRCX + * msc_mgcp_call_assignment() also takes care about sending the CRCX * command to the MGCP-GW. The CRCX will return the port number, * where the PBX (e.g. Asterisk) will send its RTP stream to. We * have to return this port number back to the MNCC by sending * it back with the TCH_RTP_CREATE message. To make sure that * this message is sent AFTER the response to CRCX from the - * MGCP-GW has arrived, we need will instruct msc_call_assignment() + * MGCP-GW has arrived, we need will instruct msc_mgcp_call_assignment() * to take care of this by setting trans->tch_rtp_create to true. * This will make sure that gsm48_tch_rtp_create() (below) is * called as soon as the local port number has become known. */ @@ -2729,7 +2758,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2756,6 +2785,7 @@ { struct gsm_trans *trans; struct gsm_mncc_rtp *rtp = arg; + struct in_addr addr; /* Find callref */ trans = trans_find_by_callref(net, rtp->callref); @@ -2771,8 +2801,8 @@ return 0; } - msc_call_connect(trans, rtp->port, rtp->ip); - return 0; + addr.s_addr = osmo_htonl(rtp->ip); + return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } static struct downstate { diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index c89e412..7bb45b2 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -30,8 +30,22 @@ #include #include +#include #include #include +#include + +#include "../../bscconfig.h" + +#ifdef BUILD_IU +#include +extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, + uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +#else +#include +#endif /* BUILD_IU */ /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, @@ -187,3 +201,53 @@ return rc; } + +int iu_rab_act_cs(struct gsm_trans *trans) +{ + struct gsm_subscriber_connection *conn; + struct msgb *msg; + bool use_x213_nsap; + uint32_t conn_id; + struct ranap_ue_conn_ctx *uectx; + uint8_t rab_id; + uint32_t rtp_ip; + uint16_t rtp_port; + + conn = trans->conn; + uectx = conn->iu.ue_ctx; + rab_id = conn->iu.rab_id; + rtp_ip = osmo_htonl(inet_addr(conn->rtp.local_addr_ran)); + rtp_port = conn->rtp.local_port_ran; + conn_id = uectx->conn_id; + + if (rtp_ip == INADDR_NONE) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP IP-Address\n", + conn_id, rab_id); + return -EINVAL; + } + if (rtp_port == 0) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP Port\n", + conn_id, rab_id); + return -EINVAL; + } + + use_x213_nsap = + (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); + + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, rtp=%x:%u, use_x213_nsap=%d\n", + conn_id, rab_id, rtp_ip, rtp_port, use_x213_nsap); + + msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, + use_x213_nsap); + msg->l2h = msg->data; + + if (ranap_iu_rab_act(uectx, msg)) + LOGP(DIUCS, LOGL_ERROR, + "Failed to send RAB Assignment: conn_id=%d rab_id=%d rtp=%x:%u\n", + conn_id, rab_id, rtp_ip, rtp_port); + return 0; +} + diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index abf1812..57cd50e 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -28,6 +28,8 @@ #include #include +#include +#include #include #include @@ -36,22 +38,54 @@ #include #include #include +#include + +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); -static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, - RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) +static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, RANAP_RAB_SetupOrModifiedItemIEs_t * setup_ies) { uint8_t rab_id; RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem; + RANAP_TransportLayerAddress_t *transp_layer_addr; + RANAP_IuTransportAssociation_t *transp_assoc; + uint16_t port = 0; + int rc; + char addr[INET_ADDRSTRLEN]; rab_id = item->rAB_ID.buf[0]; LOGP(DIUCS, LOGL_NOTICE, - "Received RAB assignment event for %s rab_id=%hhd\n", - vlr_subscr_name(conn->vsub), rab_id); + "Received RAB assignment event for %s rab_id=%hhd\n", vlr_subscr_name(conn->vsub), rab_id); + if (item->iuTransportAssociation && item->transportLayerAddress) { + transp_layer_addr = item->transportLayerAddress; + transp_assoc = item->iuTransportAssociation; + + rc = ranap_transp_assoc_decode(&port, transp_assoc); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode RTP port in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + rc = ranap_transp_layer_addr_decode(addr, sizeof(addr), transp_layer_addr); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode IP-Address in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + return msc_mgcp_ass_complete(conn, port, addr); + } + + LOGP(DIUCS, LOGL_ERROR, + "RAB assignment lacks RTP connection information. (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); return 0; } diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index e29fe0e..437d75c 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -29,15 +29,12 @@ #include #include #include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include -extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, - uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); #else #include #endif /* BUILD_IU */ @@ -140,287 +137,4 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); -} - -static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, - uint32_t rtp_ip, uint16_t rtp_port) -{ -#ifdef BUILD_IU - struct msgb *msg; - bool use_x213_nsap; - uint32_t conn_id = uectx->conn_id; - - use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); - - LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," - " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, - rtp_port, use_x213_nsap); - - msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, - use_x213_nsap); - msg->l2h = msg->data; - - if (ranap_iu_rab_act(uectx, msg)) - LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" - " conn_id=%d rab_id=%d rtp=%x:%u\n", - conn_id, rab_id, rtp_ip, rtp_port); - return 0; -#else - LOGP(DMSC, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); - return -ENOTSUP; -#endif -} - -static void mgcp_response_rab_act_cs_crcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_subscriber_connection *conn = trans->conn; - uint32_t rtp_ip; - int rc; - - if (r->head.response_code != 200) { - LOGP(DMGCP, LOGL_ERROR, - "MGCPGW response yields error: %d %s\n", - r->head.response_code, r->head.comment); - goto rab_act_cs_error; - } - - rc = mgcp_response_parse_params(r); - if (rc) { - LOGP(DMGCP, LOGL_ERROR, - "Cannot parse MGCP response, for %s\n", - vlr_subscr_name(trans->vsub)); - goto rab_act_cs_error; - } - - conn->rtp.port_cn = r->audio_port; - - rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); - - if (trans->conn->via_ran == RAN_UTRAN_IU) { - /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) - goto rab_act_cs_error; - } else if (trans->conn->via_ran == RAN_GERAN_A) { - /* Assign a voice channel via A on 2G */ - if (a_iface_tx_assignment(trans)) - goto rab_act_cs_error; - } else - goto rab_act_cs_error; - - /* Respond back to MNCC (if requested) */ - if (trans->tch_rtp_create) { - if (gsm48_tch_rtp_create(trans)) - goto rab_act_cs_error; - } - return; - -rab_act_cs_error: - /* FIXME abort call, invalidate conn, ... */ - LOGP(DMSC, LOGL_ERROR, "%s: failure during assignment\n", - vlr_subscr_name(trans->vsub)); - return; -} - -int msc_call_assignment(struct gsm_trans *trans) -{ - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - uint16_t bts_base; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - -#ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ - static uint8_t next_iu_rab_id = 1; - if (conn->via_ran == RAN_UTRAN_IU) - conn->iu.rab_id = next_iu_rab_id ++; -#endif - - conn->rtp.mgcp_rtp_endpoint = - mgcp_client_next_endpoint(conn->network->mgw.client); - - /* This will calculate the port we assign to the BTS via AoIP - * assignment command (or rab-assignment on 3G) The BTS will send - * its RTP traffic to that port on the MGCPGW side. The MGCPGW only - * gets the endpoint ID via the CRCX. It will do the same calculation - * on his side too to get knowledge of the rtp port. */ - bts_base = mgcp_client_conf_actual(mgcp)->bts_base; - conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; - - /* Establish the RTP stream first as looping back to the originator. - * The MDCX will patch through to the counterpart. TODO: play a ring - * tone instead. */ - msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); - -static void mgcp_bridge(struct gsm_trans *from, struct gsm_trans *to, - enum bridge_state state, - enum mgcp_connection_mode mode) -{ - struct gsm_subscriber_connection *conn1 = from->conn; - struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcp_client *mgcp = conn1->network->mgw.client; - const char *ip; - struct msgb *msg; - - OSMO_ASSERT(mgcp); - - from->bridge.peer = to; - from->bridge.state = state; - - /* Loop back to the same MGCP GW */ - ip = mgcp_client_remote_addr_str(mgcp); - - msg = mgcp_msg_mdcx(mgcp, - conn1->rtp.mgcp_rtp_endpoint, - ip, conn2->rtp.port_cn, - mode); - if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(from->vsub)); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_trans *peer = trans->bridge.peer; - - switch (trans->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - trans->bridge.state = BRIDGE_STATE_LOOPBACK_ESTABLISHED; - - switch (peer->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - /* Wait until the other is done as well. */ - return; - case BRIDGE_STATE_LOOPBACK_ESTABLISHED: - /* Now that both are in loopback, switch both to - * forwarding. */ - mgcp_bridge(trans, peer, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - mgcp_bridge(peer, trans, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - break; - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } - break; - - case BRIDGE_STATE_BRIDGE_PENDING: - trans->bridge.state = BRIDGE_STATE_BRIDGE_ESTABLISHED; - break; - - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } -} - -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip) -{ - /* With this function we inform the MGCP-GW where (ip/port) it - * has to send its outgoing voic traffic. The receiving end will - * usually be a PBX (e.g. Asterisk). The IP-Address we tell, will - * not only be used to direct the traffic, it will also be used - * as a filter to make sure only RTP packets from the right - * remote end will reach the BSS. This is also the reason why - * inbound audio will not work until this step is performed */ - - /* NOTE: This function is used when msc_call_bridge(), is not - * applicable. This is usually the case when an external MNCC - * is in use */ - - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - if (!trans->conn->network) - return -EINVAL; - if (!trans->conn->network->mgw.client) - return -EINVAL; - - mgcp = trans->conn->network->mgw.client; - - struct in_addr ip_addr; - ip_addr.s_addr = ntohl(ip); - - conn = trans->conn; - - msg = mgcp_msg_mdcx(mgcp, - conn->rtp.mgcp_rtp_endpoint, - inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcp_client_tx(mgcp, msg, NULL, trans)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - return 0; -} - -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2) -{ - if (!trans1) - return -EINVAL; - if (!trans2) - return -EINVAL; - - /* First setup as loopback and configure the counterparts' endpoints, - * so that when transmission starts the originating addresses are - * already known to be valid. The mgcp callback will continue. */ - mgcp_bridge(trans1, trans2, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - mgcp_bridge(trans2, trans1, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - - return 0; -} - -void msc_call_release(struct gsm_trans *trans) -{ - struct msgb *msg; - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - - if (!trans) - return; - if (!trans->conn) - return; - if (!trans->conn->network) - return; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - - /* Send DLCX */ - msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint); - if (mgcp_client_tx(mgcp, msg, NULL, NULL)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send DLCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - /* Release endpoint id */ - mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c new file mode 100644 index 0000000..5d0dc9e --- /dev/null +++ b/src/libmsc/msc_mgcp.c @@ -0,0 +1,1072 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../bscconfig.h" + +#define S(x) (1 << (x)) + +#define CONN_ID_RAN 1 +#define CONN_ID_CN 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_RAN_TIMEOUT 10 /* in seconds */ +#define MGCP_RAN_TIMEOUT_TIMER_NR 2 +#define MGCP_REL_TIMEOUT 60 /* in seconds */ +#define MGCP_REL_TIMEOUT_TIMER_NR 3 +#define MGCP_ASS_TIMEOUT 10 /* in seconds */ +#define MGCP_ASS_TIMEOUT_TIMER_NR 4 + +#define MGCP_ENDPOINT_FORMAT "%x at mgw" + +/* Some internal cause codes to indicate fault condition inside the FSM */ +enum msc_mgcp_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_RAN_TIMEOUT, + MGCP_ERR_ASS_TIMEOUT, + MGCP_ERR_NOMEM, + MGCP_ERR_ASSGMNT_FAIL +}; + +/* Human readable respresentation of the faul codes, will be displayed by + * handle_error() */ +static const struct value_string msc_mgcp_cause_codes_names[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_TX_FAIL, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (RAN)"}, + {MGCP_ERR_RAN_TIMEOUT, "call could not be completed in time (RAN)"}, + {MGCP_ERR_ASS_TIMEOUT, "assignment could not be completed in time (RAN)"}, + {MGCP_ERR_NOMEM, "out of memory"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (RAN)"}, + {0, NULL} +}; + +enum fsm_msc_mgcp_states { + ST_CRCX_RAN, + ST_CRCX_CN, + ST_CRCX_COMPL, + ST_MDCX_CN, + ST_MDCX_CN_COMPL, + ST_MDCX_RAN, + ST_MDCX_RAN_COMPL, + ST_CALL, + ST_HALT, +}; + +enum msc_mgcp_fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Notify that the Assignment is complete and we + * may now forward IP/Port of the remote call leg to the MGW */ + EV_ASSIGN, + + /* External event: Notify that the Call is complete and that the + * two half open connections on the MGW should now be connected */ + EV_CONNECT, + + /* External event: Notify that the call is over and the connections + * on the mgw shall be removed */ + EV_TEARDOWN, + + /* Internal event: An error occurred that requires a controlled + * teardown of the RTP connections */ + EV_TEARDOWN_ERROR, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the RAN side */ + EV_CRCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the CN side */ + EV_CRCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the RAN side */ + EV_MDCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the CN side */ + EV_MDCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the RAN and CN side */ + EV_DLCX_ALL_RESP, +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ +static void handle_error(struct mgcp_ctx *mgcp_ctx, enum msc_mgcp_cause_code cause) +{ + struct osmo_fsm_inst *fi; + + OSMO_ASSERT(mgcp_ctx); + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", + get_value_string(msc_mgcp_cause_codes_names, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN_ERROR, mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* We were unable to communicate with the MGW, unfortunately + * there is no meaningful action we can take now other than + * giving up. */ + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Cancel the transaction that timed out */ + mgcp_client_cancel(mgcp, mgcp_ctx->mgw_pending_trans); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN_ERROR, mgcp_ctx); + } else if (fi->T == MGCP_RAN_TIMEOUT_TIMER_NR) { + /* If the logic that controls the RAN is unable to negotiate a + * connection, we presumably still have a working connection to + * the MGW, we will try to shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_RAN_TIMEOUT); + } else if (fi->T == MGCP_REL_TIMEOUT_TIMER_NR) { + /* Under normal conditions, the MSC logic should always command + * to release the call at some point. However, the release may + * be missing due to errors in the MSC logic and we may have + * reached ST_HALT because of cascading errors and timeouts. In + * this and only in this case we will allow ST_HALT to free all + * context information on its own authority. */ + mgcp_ctx->free_ctx = true; + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_ASS_TIMEOUT_TIMER_NR) { + /* There may be rare cases in which the MSC is unable to + * complete the call assignment */ + handle_error(mgcp_ctx, MGCP_ERR_ASS_TIMEOUT); + } else { + /* Ther must not be any unsolicited timers in this FSM. If so, + * we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_RAN: Send CRCX for RAN side to MGW */ +static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + mgcp_ctx->rtp_endpoint = mgcp_client_next_endpoint(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/RAN: creating connection for the RAN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_CN, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for RAN associated CRCX */ +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_ran, r->head.conn_id, sizeof(mgcp_ctx->conn_id_ran)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/RAN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_ran); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/RAN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_ran = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_ran, r->audio_ip, sizeof(conn->rtp.local_addr_ran)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_RAN_RESP, mgcp_ctx); +} + +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_CN: check MGW response and send CRCX for CN side to MGW */ +static void fsm_crcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_CRCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/CN creating connection for the CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_cn, r->head.conn_id, sizeof(mgcp_ctx->conn_id_cn)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_cn); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/CN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_cn = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_cn, r->audio_ip, sizeof(conn->rtp.local_addr_cn)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_CRCX_COMPL: check MGW response, start assignment */ +static void fsm_crcx_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CRCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Forward assignment request to A/RANAP */ + if (conn->via_ran == RAN_UTRAN_IU) { +#ifdef BUILD_IU + /* Assign a voice channel via RANAP on 3G */ + if (iu_rab_act_cs(trans)) + goto error; +#else + LOGPFSML(fi, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); + goto error; +#endif + } else if (conn->via_ran == RAN_GERAN_A) { + /* Assign a voice channel via A on 2G */ + if (a_iface_tx_assignment(trans)) + goto error; + } else { + /* Unset or unimplemented new RAN type */ + LOGPFSML(fi, LOGL_ERROR, "Unknown RAN type: %d\n", conn->via_ran); + return; + } + + /* Respond back to MNCC (if requested) */ + if (trans->tch_rtp_create) { + if (gsm48_tch_rtp_create(trans)) + goto error; + } + + /* Note: When we reach this point then the situation is basically that + * we have two sides connected, both are in loopback. The local ports + * of the side pointing towards the BSS should be already communicated + * and we are waiting now for the BSS to return with the assignment + * complete command. */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN, MGCP_RAN_TIMEOUT, MGCP_RAN_TIMEOUT_TIMER_NR); + return; + +error: + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); +} + +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_CN: send MDCX for RAN side to MGW */ +static void fsm_mdcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CONNECT: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/CN: completing connection for the CN side on MGW endpoint:0x%x, remote leg expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_cn, conn->rtp.remote_port_cn); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_cn, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_cn, + .audio_port = conn->rtp.remote_port_cn + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_CN_COMPL: wait for mgw response, move on with the MDCX + * for the RAN side if we already have valid IP/Port data for the RAN sided + * RTP stream. */ +static void fsm_mdcx_cn_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_subscriber_connection *conn; + struct gsm_trans *trans; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_MDCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Enter MDCX phase, but we must be sure that the Assigmnet on the A or + * IuCS interface is complete (IP-Address and Port are valid) */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN, MGCP_ASS_TIMEOUT, MGCP_ASS_TIMEOUT_TIMER_NR); + + /* If we already have a valid remote port and IP-Address from the RAN side + * call leg, the assignment has been completed before we got here, so we + * may move on immediately */ + if (conn->rtp.remote_port_ran != 0 || strlen(conn->rtp.remote_addr_ran) > 0) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); +} + +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_RAN: wait for assignment completion, send MDCX for CN side to MGW */ +static void fsm_mdcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_ASSIGN: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/RAN: completing connection for the CN side on MGW endpoint:0x%x, RAN expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_ran, conn->rtp.remote_port_ran); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_ran, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_ran, + .audio_port = conn->rtp.remote_port_ran + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_RAN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_RAN_COMPL: check MGW response */ +static void fsm_mdcx_ran_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_MDCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, "call active, waiting for teardown...\n"); + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); +} + +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CALL: call is active, send DLCX for both sides on teardown */ +static void fsm_call_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "DLCX: removing connection for the RAN and CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = mgcp_ctx->rtp_endpoint + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_dlcx_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + + OSMO_ASSERT(mgcp_ctx); + + /* NOTE: We must not free the context information now, we have to + * wait until msc_mgcp_call_release() is called. Then we are sure + * that the logic controlling us is fully aware that the context + * information is freed. If we would free early now the controlling + * logic might mistakenly think that the context info is still alive, + * so lets keep the context info until we are explicitly asked for + * throwing it away. */ + if (mgcp_ctx->free_ctx) { + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_REL_TIMEOUT, MGCP_REL_TIMEOUT_TIMER_NR); +} + +static struct osmo_fsm_state fsm_msc_mgcp_states[] = { + + /* Startup state machine, send CRCX for RAN side. */ + [ST_CRCX_RAN] = { + .in_event_mask = S(EV_INIT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_RAN), + .action = fsm_crcx_ran_cb, + }, + /* When the response to the RAN CRCX is received, then proceed with + sending the CRCX for CN side */ + [ST_CRCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_COMPL), + .name = OSMO_STRINGIFY(ST_CRCX_CN), + .action = fsm_crcx_cn_cb, + }, + /* Complete the CRCX phase by starting the assignment. Depending on the + * RAT (Radio Access Technology), this will either trigger an + * Assignment Request on the A-Interface or an RAB-Assignment on the + * IU-interface */ + [ST_CRCX_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_COMPL), + .action = fsm_crcx_compl, + }, + /* Wait for MSC to complete the assignment request, when complete, we + * will enter the MDCX phase by sending an MDCX for the CN side to the + * MGW */ + [ST_MDCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CONNECT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_CN), + .action = fsm_mdcx_cn_cb, + }, + /* We arrive in this state when the MDCX phase for the CN side has + * completed we will check the IP/Port of the RAN connection. If this + * data is valid we may continue with the MDCX phase for the RAN side. + * If not we wait until the assinment completes on the A or on the IuCS + * interface. The completion of the assignment will fill in the port and + * IP-Address of the RAN side and way may continue then. */ + [ST_MDCX_CN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_MDCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN), + .name = OSMO_STRINGIFY(ST_MDCX_CN_COMPL), + .action = fsm_mdcx_cn_compl_cb, + }, + /* When the response for the CN MDCX is received, send the MDCX for the + * RAN side to the MGW */ + [ST_MDCX_RAN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_ASSIGN), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN), + .action = fsm_mdcx_ran_cb, + }, + /* The RAN side MDCX phase is complete when the response is received + * from the MGW. The call is then active, we change to ST_CALL and wait + * there until the call ends. */ + [ST_MDCX_RAN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_MDCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN_COMPL), + .action = fsm_mdcx_ran_compl_cb, + }, + /* We are now in the active call phase, wait until the call is done + * and send a DLCX then to remove all connections from the MGW */ + [ST_CALL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_CALL), + .action = fsm_call_cb, + }, + /* When the MGW confirms that the connections are terminated, then halt + * the state machine. */ + [ST_HALT] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_DLCX_ALL_RESP), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_HALT), + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm_msc_mgcp = { + .name = "MGW", + .states = fsm_msc_mgcp_states, + .num_states = ARRAY_SIZE(fsm_msc_mgcp_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that a new call begins. This will create a connection for the + * RAN and the CN on the MGW. + * Parameter: + * trans: transaction context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_assignment(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + struct gsm_subscriber_connection *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call assignment failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + mgcp = conn->network->mgw.client; + OSMO_ASSERT(mgcp); + + if (conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) double assignment detected, dropping...\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + +#ifdef BUILD_IU + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ + static uint8_t next_iu_rab_id = 1; + if (conn->via_ran == RAN_UTRAN_IU) + conn->iu.rab_id = next_iu_rab_id++; +#endif + + if (snprintf(name, sizeof(name), "MGW_%i", trans->transaction_id) >= sizeof(name)) + return -EINVAL; + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_msc_mgcp); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(NULL, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->trans = trans; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_RAN); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + conn->rtp.mgcp_ctx = mgcp_ctx; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call assignment initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Inform the FSM that the assignment (RAN connection) is now complete. + * Parameter: + * conn: subscriber connection context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, call completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, call completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + if (!conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, assignment completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + mgcp_ctx = conn->rtp.mgcp_ctx; + if (!mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignmnet completion failed.\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + /* Memorize port and IP-Address of the remote RAN call leg. We need this + * information at latest when we enter the MDCX phase for the RAN side. */ + conn->rtp.remote_port_ran = port; + osmo_strlcpy(conn->rtp.remote_addr_ran, addr, sizeof(conn->rtp.remote_addr_ran)); + + /* Note: We only dispatch the event if we are really waiting for the + * assignment, if we are not yet waiting, there is no need to loudly + * broadcast an event that the all other states do not understand anyway */ + if (mgcp_ctx->fsm->state == ST_MDCX_RAN) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); + + return 0; +} + +/* Make the connection of a previously assigned call complete + * Parameter: + * trans: transaction context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(trans); + OSMO_ASSERT(addr); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call completion failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* The FSM should already have passed all CRCX phases and be ready to move + * on with the MDCX phases. */ + if (mgcp_ctx->fsm->state != ST_MDCX_CN) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid call state, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + osmo_strlcpy(conn->rtp.remote_addr_cn, addr, sizeof(conn->rtp.remote_addr_cn)); + conn->rtp.remote_port_cn = port; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CONNECT, mgcp_ctx); + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call completion initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Release ongoing call. + * Parameter: + * trans: connection context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_release(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call release failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* Inform the FSM that as soon as it reaches ST_HALT it may free + * all context information immediately */ + mgcp_ctx->free_ctx = true; + + /* Initaite teardown, regardless of which state we are currently + * in */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + + /* Prevent any further operation that is triggered from outside by + * overwriting the context pointer with NULL. The FSM will now + * take care for a graceful shutdown and when done it will free + * all related context information */ + trans->conn->rtp.mgcp_ctx = NULL; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call release initiated\n", + vlr_subscr_name(trans->vsub)); + + return 0; +} diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 3a2c859..43b4e07 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -30,8 +30,8 @@ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=osmo_get_rand_id \ - -Wl,--wrap=msc_call_assignment \ - -Wl,--wrap=msc_call_release \ + -Wl,--wrap=msc_mgcp_call_release \ + -Wl,--wrap=msc_mgcp_call_assignment \ $(NULL) LDADD = \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index ac850b3..09f0df0 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -556,18 +556,18 @@ return 0; } -/* override, requires '-Wl,--wrap=msc_call_assignment' */ -int __real_msc_call_assignment(struct gsm_trans *trans); -int __wrap_msc_call_assignment(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_assignment' */ +int __real_msc_mgcp_call_assignment(struct gsm_trans *trans); +int __wrap_msc_mgcp_call_assignment(struct gsm_trans *trans) { log("MS <--Call Assignment-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); return 0; } -/* override, requires '-Wl,--wrap=msc_call_release' */ -void __real_msc_call_release(struct gsm_trans *trans); -void __wrap_msc_call_release(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_release' */ +void __real_msc_mgcp_call_release(struct gsm_trans *trans); +void __wrap_msc_mgcp_call_release(struct gsm_trans *trans) { log("MS <--Call Release-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); -- To view, visit https://gerrit.osmocom.org/4980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 Gerrit-PatchSet: 17 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 4 14:28:18 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 14:28:18 +0000 Subject: [PATCH] osmo-trx[master]: Update license notes 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/5645 to look at the new patch set (#2). Update license notes * replace references to OpenBTS with OsmoTRX * drop trademark notice * drop outdated example Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Related: OS#2600 --- M COPYING 1 file changed, 6 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/45/5645/2 diff --git a/COPYING b/COPYING index b5af151..879341e 100644 --- a/COPYING +++ b/COPYING @@ -673,16 +673,16 @@ ========================================================================= -ADDITIONAL TERMS TO THE AGPLv3 LICENSE FOR OPENBTS +ADDITIONAL TERMS TO THE AGPLv3 LICENSE FOR OsmoTRX Permissive Terms Supplementing the License 1. Remote Interaction Through IP Networks. -OpenBTS includes an implementation of the GSM network cellular air interface, +OsmoTRX is an implementation of the GSM network cellular air interface, as well as other interfaces to IP networks. The interaction of cellular -handsets with the OpenBTS software is considered "remote network interaction" +handsets with the OsmoTRX software is considered "remote network interaction" for the purposes of the Affero General Public License and cellular users are subject to the source code access requirements of Section 13 of AGPLv3 ("Remote Network Interaction; Use with the GNU General Public License"). @@ -694,17 +694,6 @@ is an additional permission granted to you. -Non-Permissive Terms Supplementing The License - -1. Trademarks. - -"OpenBTS" is a trademark of Range Networks, Inc., registered with -the US Patent and Trademark Office. Your use of OpenBTS software under a GPL -license does not include the right to use the OpenBTS trademark in commerce. -This additional non-permissive term is consistent with Section 7 of the AGPLv3 -license. - - END OF ADDITIONAL TERMS @@ -712,13 +701,8 @@ How to comply with Section 13 of the AGPLv3 license. The recommended method for compliance with Section 13 of the AGPLv3 license is -to deliver a text message to each handset that attaches to the OpenBTS cellular -network. At a minimum, that text message should include the string "OpenBTS -AGPLv3" and a URL that can be used to access the OpenBTS source code. This +to deliver a text message to each handset that attaches to the cellular +network which uses OsmoTRX. At a minimum, that text message should include the string +"OsmoTRX AGPLv3" and a URL that can be used to access the OsmoBTS source code. This message need not be delivered to handsets that are denied registration with the network, since those handsets have been denied service. - -In OpenBTS 2.6, such text messages can be delivered with the "Welcome Message" -feature. See the OpenBTS.config.example file for more information on the use of -this feature for AGPLv3 compliance. - -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Thu Jan 4 17:18:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 17:18:25 +0000 Subject: [PATCH] osmo-bts[master]: Use existing function to obtain TSC Message-ID: Review at https://gerrit.osmocom.org/5649 Use existing function to obtain TSC Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb --- M src/common/pcu_sock.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/49/5649/1 diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index e5bcf57..fa13f24 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -221,8 +221,8 @@ if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED && ts_should_be_pdch(ts)) { info_ind->trx[i].pdch_mask |= (1 << j); - info_ind->trx[i].tsc[j] = - (ts->tsc >= 0) ? ts->tsc : bts->bsic & 7; + info_ind->trx[i].tsc[j] = gsm_ts_tsc(ts); + LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: " "available (tsc=%d arfcn=%d)\n", trx->nr, ts->nr, -- To view, visit https://gerrit.osmocom.org/5649 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 17:44:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 17:44:33 +0000 Subject: [PATCH] libosmocore[master]: Fix incorrect spec reference Message-ID: Review at https://gerrit.osmocom.org/5650 Fix incorrect spec reference RAI is defined in 3GPP TS 24.008 ? 10.5.5.15 Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/50/5650/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 01ab599..93b8c59 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1648,7 +1648,7 @@ #define GSM48_MID_TMSI_LEN (GSM48_TMSI_LEN + 2) #define GSM48_MI_SIZE 32 -/* Chapter 10.4.4.15 */ +/* 3GPP TS 24.008 ? 10.5.5.15 Routing area identification */ struct gsm48_ra_id { uint8_t digits[3]; /* MCC + MNC BCD digits */ uint16_t lac; /* Location Area Code */ -- To view, visit https://gerrit.osmocom.org/5650 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 17:50:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 17:50:26 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix RAI construction Message-ID: Review at https://gerrit.osmocom.org/5651 Fix RAI construction The gsm48_construct_ra() expect 6-byte buffer while ra_id.digits is 3-byte buffer. The function fills in LAC and RAC as well so we should pass entire struct, not just 'digits' part which only store MCC/MNC. Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Fixes: CID57877 --- M src/gprs/gprs_gmm.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/5651/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..a5b29bf 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra(rua->ra_id.digits, &mm->ra); + gsm48_construct_ra(rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 4 17:52:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 17:52:59 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix RAI construction In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5651 to look at the new patch set (#2). Fix RAI construction The gsm48_construct_ra() expect 6-byte buffer while ra_id.digits is 3-byte buffer. The function fills in LAC and RAC as well so we should pass entire struct, not just 'digits' part which only store MCC/MNC. Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Fixes: CID57877, CID57876 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/5651/2 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..f14940d 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra(aa->ra_id.digits, &mm->ra); + gsm48_construct_ra(aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra(rua->ra_id.digits, &mm->ra); + gsm48_construct_ra(rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 4 17:55:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 4 Jan 2018 17:55:22 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix RAI construction In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5651 to look at the new patch set (#3). Fix RAI construction The gsm48_construct_ra() expect 6-byte buffer while ra_id.digits is 3-byte buffer. The function fills in LAC and RAC as well so we should pass entire struct, not just 'digits' part which only store MCC/MNC. Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Fixes: CID57877, CID57876 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/5651/3 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..e4ecf04 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra(aa->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra(rua->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 08:57:57 2018 From: gerrit-no-reply at lists.osmocom.org (ptrkrysik) Date: Fri, 5 Jan 2018 08:57:57 +0000 Subject: gr-gsm[master]: README.md: Turn URLs into hyperlinks (video, mailing list) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Verified+1 Just approving now to see what happens next ;) -- To view, visit https://gerrit.osmocom.org/5635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ptrkrysik Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 09:06:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 09:06:36 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix RAI construction In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5651 to look at the new patch set (#4). Fix RAI construction The gsm48_construct_ra() expect 6-byte buffer while ra_id.digits is 3-byte buffer. The function fills in LAC and RAC as well so we should pass entire struct, not just 'digits' part which only store MCC/MNC. Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Fixes: CID57877, CID57876 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/5651/4 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..a880680 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra(aa->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)&aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra(rua->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)&rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 09:09:24 2018 From: gerrit-no-reply at lists.osmocom.org (ptrkrysik) Date: Fri, 5 Jan 2018 09:09:24 +0000 Subject: gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Approving, but I don't know yet what is the correct way (with gerrit used) to solve the conflict with the patch set 2 -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ptrkrysik Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:04:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:04:32 +0000 Subject: gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Patch Set 2: the numbered patch sets are different versions of the same patch. So you submit a patch, it becomes '1', then there's some review comment (like the typo reported by Vadim), and I've uploaded a new version. You can use the 'diff against' to see the difference to the base version (master) as well as differences between versions. You now have permission to +2 the patches, and then you can push the "submit" button to merge to master. -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ptrkrysik Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:04:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:04:42 +0000 Subject: libosmocore[master]: Fix incorrect spec reference In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5650 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ptrkrysik Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:04:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:04:46 +0000 Subject: [MERGED] libosmocore[master]: Fix incorrect spec reference In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix incorrect spec reference ...................................................................... Fix incorrect spec reference RAI is defined in 3GPP TS 24.008 ? 10.5.5.15 Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 01ab599..93b8c59 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1648,7 +1648,7 @@ #define GSM48_MID_TMSI_LEN (GSM48_TMSI_LEN + 2) #define GSM48_MI_SIZE 32 -/* Chapter 10.4.4.15 */ +/* 3GPP TS 24.008 ? 10.5.5.15 Routing area identification */ struct gsm48_ra_id { uint8_t digits[3]; /* MCC + MNC BCD digits */ uint16_t lac; /* Location Area Code */ -- To view, visit https://gerrit.osmocom.org/5650 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I484485d8c4c56b58dfecc1193bcdd48e61957422 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: ptrkrysik From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:05:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:05:01 +0000 Subject: osmo-bts[master]: Use existing function to obtain TSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5649 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb 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 Jan 5 10:05:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:05:04 +0000 Subject: [MERGED] osmo-bts[master]: Use existing function to obtain TSC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use existing function to obtain TSC ...................................................................... Use existing function to obtain TSC Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb --- M src/common/pcu_sock.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index e5bcf57..fa13f24 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -221,8 +221,8 @@ if (ts->mo.nm_state.operational == NM_OPSTATE_ENABLED && ts_should_be_pdch(ts)) { info_ind->trx[i].pdch_mask |= (1 << j); - info_ind->trx[i].tsc[j] = - (ts->tsc >= 0) ? ts->tsc : bts->bsic & 7; + info_ind->trx[i].tsc[j] = gsm_ts_tsc(ts); + LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: " "available (tsc=%d arfcn=%d)\n", trx->nr, ts->nr, -- To view, visit https://gerrit.osmocom.org/5649 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb 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 Fri Jan 5 10:05:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:05:45 +0000 Subject: osmo-pcu[master]: cosmetic: clarify coding scheme and puncturing In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If599a6c8a6ef56d847604fcf41bb71decccd8a78 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:06:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:06:11 +0000 Subject: [MERGED] osmo-pcu[master]: cosmetic: clarify coding scheme and puncturing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: clarify coding scheme and puncturing ...................................................................... cosmetic: clarify coding scheme and puncturing * use appropriate types for coding scheme parameters * add comment regarding possible number of RLCMAC blocks The code in create_dl_acked_block() has underlying assumption that rlc.num_data_blocks can never be more than 2, which is true and is enforced by appropriate asserts but is not obvious when looking at the function code alone. It's equally hard for Coverity which leads to false positives in scan. Lets' make this assumption explicit by putting it into for(;;) condition alongside with corresponding comment. Fixes: CID143070 Change-Id: If599a6c8a6ef56d847604fcf41bb71decccd8a78 --- M src/gprs_coding_scheme.cpp M src/gprs_coding_scheme.h M src/rlc.cpp M src/rlc.h M src/tbf_dl.cpp 5 files changed, 45 insertions(+), 45 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp index 719cbb2..3094ae6 100644 --- a/src/gprs_coding_scheme.cpp +++ b/src/gprs_coding_scheme.cpp @@ -55,12 +55,12 @@ static struct { struct { - unsigned int bytes; - unsigned int ext_bits; - unsigned int data_header_bits; + uint8_t bytes; + uint8_t ext_bits; + uint8_t data_header_bits; } uplink, downlink; - unsigned int data_bytes; - unsigned int optional_padding_bits; + uint8_t data_bytes; + uint8_t optional_padding_bits; const char *name; GprsCodingScheme::HeaderType data_hdr; GprsCodingScheme::Family family; @@ -99,10 +99,10 @@ static struct { struct { - int data_header_bits; + uint8_t data_header_bits; } uplink, downlink; - unsigned int data_block_header_bits; - unsigned int num_blocks; + uint8_t data_block_header_bits; + uint8_t num_blocks; const char *name; } hdr_type_info[GprsCodingScheme::NUM_HEADER_TYPES] = { {{0}, {0}, 0, 0, "INVALID"}, @@ -134,12 +134,12 @@ return GprsCodingScheme(UNKNOWN); } -unsigned int GprsCodingScheme::sizeUL() const +uint8_t GprsCodingScheme::sizeUL() const { return mcs_info[m_scheme].uplink.bytes + (spareBitsUL() ? 1 : 0); } -unsigned int GprsCodingScheme::usedSizeUL() const +uint8_t GprsCodingScheme::usedSizeUL() const { if (mcs_info[m_scheme].data_hdr == HEADER_GPRS_DATA) return mcs_info[m_scheme].uplink.bytes; @@ -147,22 +147,22 @@ return sizeUL(); } -unsigned int GprsCodingScheme::maxBytesUL() const +uint8_t GprsCodingScheme::maxBytesUL() const { return mcs_info[m_scheme].uplink.bytes; } -unsigned int GprsCodingScheme::spareBitsUL() const +uint8_t GprsCodingScheme::spareBitsUL() const { return mcs_info[m_scheme].uplink.ext_bits; } -unsigned int GprsCodingScheme::sizeDL() const +uint8_t GprsCodingScheme::sizeDL() const { return mcs_info[m_scheme].downlink.bytes + (spareBitsDL() ? 1 : 0); } -unsigned int GprsCodingScheme::usedSizeDL() const +uint8_t GprsCodingScheme::usedSizeDL() const { if (mcs_info[m_scheme].data_hdr == HEADER_GPRS_DATA) return mcs_info[m_scheme].downlink.bytes; @@ -170,42 +170,42 @@ return sizeDL(); } -unsigned int GprsCodingScheme::maxBytesDL() const +uint8_t GprsCodingScheme::maxBytesDL() const { return mcs_info[m_scheme].downlink.bytes; } -unsigned int GprsCodingScheme::spareBitsDL() const +uint8_t GprsCodingScheme::spareBitsDL() const { return mcs_info[m_scheme].downlink.ext_bits; } -unsigned int GprsCodingScheme::maxDataBlockBytes() const +uint8_t GprsCodingScheme::maxDataBlockBytes() const { return mcs_info[m_scheme].data_bytes; } -unsigned int GprsCodingScheme::optionalPaddingBits() const +uint8_t GprsCodingScheme::optionalPaddingBits() const { return mcs_info[m_scheme].optional_padding_bits; } -unsigned int GprsCodingScheme::numDataBlocks() const +uint8_t GprsCodingScheme::numDataBlocks() const { return hdr_type_info[headerTypeData()].num_blocks; } -unsigned int GprsCodingScheme::numDataHeaderBitsUL() const +uint8_t GprsCodingScheme::numDataHeaderBitsUL() const { return hdr_type_info[headerTypeData()].uplink.data_header_bits; } -unsigned int GprsCodingScheme::numDataHeaderBitsDL() const +uint8_t GprsCodingScheme::numDataHeaderBitsDL() const { return hdr_type_info[headerTypeData()].downlink.data_header_bits; } -unsigned int GprsCodingScheme::numDataBlockHeaderBits() const +uint8_t GprsCodingScheme::numDataBlockHeaderBits() const { return hdr_type_info[headerTypeData()].data_block_header_bits; } diff --git a/src/gprs_coding_scheme.h b/src/gprs_coding_scheme.h index dfad240..76cab0f 100644 --- a/src/gprs_coding_scheme.h +++ b/src/gprs_coding_scheme.h @@ -70,7 +70,7 @@ operator bool() const {return m_scheme != UNKNOWN;} operator Scheme() const {return m_scheme;} - unsigned int to_num() const; + uint8_t to_num() const; GprsCodingScheme& operator =(Scheme s); bool operator == (Scheme s) const; @@ -91,20 +91,20 @@ void dec(); void decToSingleBlock(bool *needStuffing); - unsigned int sizeUL() const; - unsigned int sizeDL() const; - unsigned int usedSizeUL() const; - unsigned int usedSizeDL() const; - unsigned int maxBytesUL() const; - unsigned int maxBytesDL() const; - unsigned int spareBitsUL() const; - unsigned int spareBitsDL() const; - unsigned int maxDataBlockBytes() const; - unsigned int numDataBlocks() const; - unsigned int numDataHeaderBitsUL() const; - unsigned int numDataHeaderBitsDL() const; - unsigned int numDataBlockHeaderBits() const; - unsigned int optionalPaddingBits() const; + uint8_t sizeUL() const; + uint8_t sizeDL() const; + uint8_t usedSizeUL() const; + uint8_t usedSizeDL() const; + uint8_t maxBytesUL() const; + uint8_t maxBytesDL() const; + uint8_t spareBitsUL() const; + uint8_t spareBitsDL() const; + uint8_t maxDataBlockBytes() const; + uint8_t numDataBlocks() const; + uint8_t numDataHeaderBitsUL() const; + uint8_t numDataHeaderBitsDL() const; + uint8_t numDataBlockHeaderBits() const; + uint8_t optionalPaddingBits() const; const char *name() const; HeaderType headerTypeData() const; HeaderType headerTypeControl() const; @@ -127,7 +127,7 @@ enum Scheme m_scheme; }; -inline unsigned int GprsCodingScheme::to_num() const +inline uint8_t GprsCodingScheme::to_num() const { if (isGprs()) return (m_scheme - CS1) + 1; diff --git a/src/rlc.cpp b/src/rlc.cpp index 37e83cd..d7f0609 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -375,7 +375,7 @@ unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs, enum egprs_puncturing_values punct, - enum egprs_puncturing_values punct2, int with_padding) + enum egprs_puncturing_values punct2, bool with_padding) { /* validate that punct and punct2 are as expected */ switch (GprsCodingScheme::Scheme(cs)) { diff --git a/src/rlc.h b/src/rlc.h index b62e3ac..a7e6cf3 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -163,7 +163,7 @@ unsigned int es_p; unsigned int rrbp; unsigned int pr; - unsigned int num_data_blocks; + uint8_t num_data_blocks; /* this can actually be only 0, 1, 2: enforced in gprs_rlc_data_header_init() */ unsigned int with_padding; unsigned int data_offs_bits[2]; struct gprs_rlc_data_block_info block_info[2]; @@ -218,7 +218,7 @@ void gprs_rlc_data_block_info_init(struct gprs_rlc_data_block_info *rdbi, GprsCodingScheme cs, bool with_padding, const unsigned int spb); unsigned int gprs_rlc_mcs_cps(GprsCodingScheme cs, enum egprs_puncturing_values - punct, enum egprs_puncturing_values punct2, int with_padding); + punct, enum egprs_puncturing_values punct2, bool with_padding); void gprs_rlc_mcs_cps_decode(unsigned int cps, GprsCodingScheme cs, int *punct, int *punct2, int *with_padding); enum egprs_puncturing_values gprs_get_punct_scheme(enum egprs_puncturing_values diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 58b55dc..b871bc3 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -666,7 +666,7 @@ unsigned msg_len; bool need_poll; /* TODO: support MCS-7 - MCS-9, where data_block_idx can be 1 */ - unsigned int data_block_idx = 0; + uint8_t data_block_idx = 0; unsigned int rrbp; uint32_t new_poll_fn; int rc; @@ -752,8 +752,8 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Copying %u RLC blocks, %u BSNs\n", rlc.num_data_blocks, num_bsns); - /* Copy block(s) to RLC message */ - for (data_block_idx = 0; data_block_idx < rlc.num_data_blocks; + /* Copy block(s) to RLC message: the num_data_blocks cannot be more than 2 - see assert above */ + for (data_block_idx = 0; data_block_idx < OSMO_MIN(rlc.num_data_blocks, 2); data_block_idx++) { int bsn; @@ -777,7 +777,7 @@ OSMO_ASSERT(m_rlc.block(bsn)->next_ps >= EGPRS_PS_1); OSMO_ASSERT(m_rlc.block(bsn)->next_ps <= EGPRS_PS_3); } - OSMO_ASSERT(data_block_idx < 2); /* punct defined above as 2-element array */ + punct[data_block_idx] = m_rlc.block(bsn)->next_ps; rdbi = &rlc.block_info[data_block_idx]; -- To view, visit https://gerrit.osmocom.org/5535 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If599a6c8a6ef56d847604fcf41bb71decccd8a78 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 Fri Jan 5 10:06:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:06:40 +0000 Subject: osmo-bts[master]: Remove BSC-specific parts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5638 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e 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 Jan 5 10:06:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:06:44 +0000 Subject: [MERGED] osmo-bts[master]: Remove BSC-specific parts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove BSC-specific parts ...................................................................... Remove BSC-specific parts The dead code is from before repo-split time. Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e --- M include/osmo-bts/gsm_data_shared.h M src/common/gsm_data_shared.c 2 files changed, 1 insertion(+), 108 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index a05e4ca..31198fc 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -19,10 +19,7 @@ #include #include - -#ifndef ROLE_BSC #include -#endif /* 16 is the max. number of SI2quater messages according to 3GPP TS 44.018 Table 10.5.2.33b.1: 4-bit index is used (2#1111 = 10#15) */ @@ -261,46 +258,13 @@ uint8_t rtp_payload; uint8_t rtp_payload2; uint8_t speech_mode; -#ifdef ROLE_BSC - struct rtp_socket *rtp_socket; -#else struct osmo_rtp_socket *rtp_socket; -#endif } abis_ip; uint8_t rqd_ta; char *name; -#ifdef ROLE_BSC - struct osmo_timer_list T3101; - struct osmo_timer_list T3109; - struct osmo_timer_list T3111; - struct osmo_timer_list error_timer; - struct osmo_timer_list act_timer; - struct osmo_timer_list rel_work; - uint8_t error_cause; - - /* table of neighbor cell measurements */ - struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; - - /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; - int meas_rep_idx; - - /* GSM Random Access data */ - struct gsm48_req_ref *rqd_ref; - - struct gsm_subscriber_connection *conn; - - struct { - /* channel activation type and handover ref */ - uint8_t act_type; - uint8_t ho_ref; - struct gsm48_req_ref *rqd_ref; - uint8_t rqd_ta; - } dyn; -#else /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. * Currently we don't share these headers so this is a magic number. */ struct llist_head sapi_cmds; @@ -381,7 +345,6 @@ } ms_power_ctrl; struct msgb *pending_rel_ind_msg; -#endif }; enum { @@ -465,14 +428,12 @@ int nominal_power; /* in dBm */ unsigned int max_power_red; /* in actual dB */ -#ifndef ROLE_BSC struct trx_power_params power_params; int ms_power_control; struct { void *l1h; } role_bts; -#endif union { struct { @@ -846,68 +807,6 @@ int force_combined_si; int bcch_change_mark; -#ifdef ROLE_BSC - /* Abis NM queue */ - struct llist_head abis_queue; - int abis_nm_pend; - - struct gsm_network *network; - - /* should the channel allocator allocate channels from high TRX to TRX0, - * rather than starting from TRX0 and go upwards? */ - int chan_alloc_reverse; - - enum neigh_list_manual_mode neigh_list_manual_mode; - /* parameters from which we build SYSTEM INFORMATION */ - struct { - struct gsm48_rach_control rach_control; - uint8_t ncc_permitted; - struct gsm48_cell_sel_par cell_sel_par; - struct gsm48_si_selection_params cell_ro_sel_par; /* rest octet */ - struct gsm48_cell_options cell_options; - struct gsm48_control_channel_descr chan_desc; - struct bitvec neigh_list; - struct bitvec cell_alloc; - struct bitvec si5_neigh_list; - struct osmo_earfcn_si2q si2quater_neigh_list; - size_t uarfcn_length; /* index for uarfcn and scramble lists */ - struct { - /* bitmask large enough for all possible ARFCN's */ - uint8_t neigh_list[1024/8]; - uint8_t cell_alloc[1024/8]; - /* If the user wants a different neighbor list in SI5 than in SI2 */ - uint8_t si5_neigh_list[1024/8]; - uint8_t meas_bw_list[MAX_EARFCN_LIST]; - uint16_t earfcn_list[MAX_EARFCN_LIST]; - uint16_t uarfcn_list[MAX_EARFCN_LIST]; - uint16_t scramble_list[MAX_EARFCN_LIST]; - } data; - } si_common; - bool early_classmark_allowed; - /* for testing only: Have an infinitely long radio link timeout */ - bool infinite_radio_link_timeout; - - /* do we use static (user-defined) system information messages? (bitmask) */ - uint32_t si_mode_static; - - /* exclude the BTS from the global RF Lock handling */ - int excl_from_rf_lock; - - /* supported codecs beside FR */ - struct bts_codec_conf codec; - - /* BTS dependencies bit field */ - uint32_t depends_on[256/(8*4)]; - - /* full and half rate multirate config */ - struct amr_multirate_conf mr_full; - struct amr_multirate_conf mr_half; - - /* PCU socket state */ - char *pcu_sock_path; - struct pcu_sock_state *pcu_state; - -#endif /* ROLE_BSC */ void *role; }; diff --git a/src/common/gsm_data_shared.c b/src/common/gsm_data_shared.c index f4fda55..aa012bc 100644 --- a/src/common/gsm_data_shared.c +++ b/src/common/gsm_data_shared.c @@ -271,9 +271,7 @@ name = gsm_lchan_name_compute(lchan); lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif } } @@ -679,17 +677,13 @@ break; default: case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* + /* OSMO_ASSERT(lchan_nr == 0); * FIXME: On octphy and litecell, we hit above assertion (see * Max's comment at https://gerrit.osmocom.org/589 ); disabled * for BTS until this is clarified; remove the #ifdef when it * is fixed. */ #warning "fix caller that passes lchan_nr != 0" -#endif cbits = 0x10; break; } -- To view, visit https://gerrit.osmocom.org/5638 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e 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 Fri Jan 5 10:07:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:07:06 +0000 Subject: osmo-trx[master]: Update license notes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:07:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:07:08 +0000 Subject: [MERGED] osmo-trx[master]: Update license notes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update license notes ...................................................................... Update license notes * replace references to OpenBTS with OsmoTRX * drop trademark notice * drop outdated example Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Related: OS#2600 --- M COPYING 1 file changed, 6 insertions(+), 22 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/COPYING b/COPYING index b5af151..879341e 100644 --- a/COPYING +++ b/COPYING @@ -673,16 +673,16 @@ ========================================================================= -ADDITIONAL TERMS TO THE AGPLv3 LICENSE FOR OPENBTS +ADDITIONAL TERMS TO THE AGPLv3 LICENSE FOR OsmoTRX Permissive Terms Supplementing the License 1. Remote Interaction Through IP Networks. -OpenBTS includes an implementation of the GSM network cellular air interface, +OsmoTRX is an implementation of the GSM network cellular air interface, as well as other interfaces to IP networks. The interaction of cellular -handsets with the OpenBTS software is considered "remote network interaction" +handsets with the OsmoTRX software is considered "remote network interaction" for the purposes of the Affero General Public License and cellular users are subject to the source code access requirements of Section 13 of AGPLv3 ("Remote Network Interaction; Use with the GNU General Public License"). @@ -694,17 +694,6 @@ is an additional permission granted to you. -Non-Permissive Terms Supplementing The License - -1. Trademarks. - -"OpenBTS" is a trademark of Range Networks, Inc., registered with -the US Patent and Trademark Office. Your use of OpenBTS software under a GPL -license does not include the right to use the OpenBTS trademark in commerce. -This additional non-permissive term is consistent with Section 7 of the AGPLv3 -license. - - END OF ADDITIONAL TERMS @@ -712,13 +701,8 @@ How to comply with Section 13 of the AGPLv3 license. The recommended method for compliance with Section 13 of the AGPLv3 license is -to deliver a text message to each handset that attaches to the OpenBTS cellular -network. At a minimum, that text message should include the string "OpenBTS -AGPLv3" and a URL that can be used to access the OpenBTS source code. This +to deliver a text message to each handset that attaches to the cellular +network which uses OsmoTRX. At a minimum, that text message should include the string +"OsmoTRX AGPLv3" and a URL that can be used to access the OsmoBTS source code. This message need not be delivered to handsets that are denied registration with the network, since those handsets have been denied service. - -In OpenBTS 2.6, such text messages can be delivered with the "Welcome Message" -feature. See the OpenBTS.config.example file for more information on the use of -this feature for AGPLv3 compliance. - -- To view, visit https://gerrit.osmocom.org/5645 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I144f96c507bfe48df350fb0350edbeba87126462 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:08:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:08:03 +0000 Subject: libosmocore[master]: Use 127.0.0.1 for GSMTAP logging by default In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5640 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:08:05 +0000 Subject: [MERGED] libosmocore[master]: Use 127.0.0.1 for GSMTAP logging by default In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use 127.0.0.1 for GSMTAP logging by default ...................................................................... Use 127.0.0.1 for GSMTAP logging by default Previously the were no default value provided in case of unspecified hostname in "log gsmtap" vty config. This leads to confusing log messages because NULL was used as a hostname: Inconsistent indentation -- leading whitespace must match adjacent lines, and indentation must reflect child node levels. A mix of tabs and spaces is allowed, but their sequence must not change within a child block. Fix this by using 127.0.0.1 as default log destination and logging hostname in case of errors. Related: OS#2608 Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813 --- M src/vty/logging_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index c39017b..dc457ff 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -537,7 +537,7 @@ LOG_STR "Logging via GSMTAP\n" "Host name to send the GSMTAP logging to (UDP port 4729)\n") { - const char *hostname = argv[0]; + const char *hostname = argc ? argv[0] : "127.0.0.1"; struct log_target *tgt; tgt = log_target_find(LOG_TGT_TYPE_GSMTAP, hostname); @@ -546,8 +546,8 @@ host.app_info->name, false, true); if (!tgt) { - vty_out(vty, "%% Unable to create GSMTAP log%s", - VTY_NEWLINE); + vty_out(vty, "%% Unable to create GSMTAP log for %s%s", + hostname, VTY_NEWLINE); return CMD_WARNING; } log_add_target(tgt); -- To view, visit https://gerrit.osmocom.org/5640 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I58b1d4ec522af18024be2e56c9103b3db7936813 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:08:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 10:08:15 +0000 Subject: [PATCH] libosmocore[master]: Add function to properly encode RAI Message-ID: Review at https://gerrit.osmocom.org/5652 Add function to properly encode RAI Add gsm48_make_ra() which takes appropriate struct as [out] parameter instead of generic buffer. Using uint8_t buffer instead of proper struct type prooved to be error-prone - see Coverity CID57877, CID57876. Old gsm48_construct_ra() is made into tiny wrapper around new function. The test output is adjusted because of the change in function return value which was constant and hence ignored anyway. Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 --- M include/osmocom/gsm/gsm48.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gsm/gsm48.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 7 files changed, 50 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/5652/1 diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 424748e..35e4215 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -39,6 +39,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); +void gsm48_make_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d27a94f..318e5ed 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -161,7 +161,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -169,8 +169,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -185,7 +185,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -193,8 +193,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -209,7 +209,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -217,8 +217,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -231,7 +231,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -239,8 +239,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -259,7 +259,7 @@ uint16_t cid) { /* 6 octets RAC */ - gsm48_construct_ra(buf, raid); + gsm48_make_ra((struct gsm48_ra_id *)buf, raid); /* 2 octets CID */ osmo_store16be(cid, buf+6); @@ -1215,7 +1215,7 @@ uint16_t drx_params = osmo_htons(pinfo->drx_params); uint8_t mi[10]; int imsi_len = gsm48_generate_mid_from_imsi(mi, pinfo->imsi); - uint8_t ra[6]; + struct gsm48_ra_id ra; if (imsi_len < 2) return -EINVAL; @@ -1241,12 +1241,12 @@ } break; case BSSGP_PAGING_LOCATION_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, ra); + gsm48_make_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, (const uint8_t *)&ra); break; case BSSGP_PAGING_ROUTEING_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); break; case BSSGP_PAGING_BVCI: { diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 3939e25..2c11987 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -61,7 +61,7 @@ bssgp_msgb_tlli_put(msg, tlli); - gsm48_construct_ra(ra, ra_id); + gsm48_make_ra(ra, ra_id); msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -84,7 +84,7 @@ bssgp_msgb_tlli_put(msg, tlli); - gsm48_construct_ra(ra, ra_id); + gsm48_make_ra(ra, ra_id); msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index a7daea4..813476a 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -689,33 +689,34 @@ raid->rac = buf[5]; } +/*! Encode a 3GPP TS 24.008 ? 10.5.5.15 Routing area identification + * \param[out] out Caller-provided packed struct + * \param[in] raid Routing Area ID to be encoded + */ +void gsm48_make_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid) +{ + out->lac = osmo_htons(raid->lac); + out->rac = raid->rac; + + out->digits[0] = ((raid->mcc / 100) % 10) | (((raid->mcc / 10) % 10) << 4); + out->digits[1] = raid->mcc % 10; + + if (raid->mnc < 100) { + out->digits[1] |= 0xf0; + out->digits[2] = ((raid->mnc / 10) % 10) | ((raid->mnc % 10) << 4); + } else { + out->digits[1] |= (raid->mnc % 10) << 4; + out->digits[2] = ((raid->mnc / 100) % 10) | (((raid->mnc / 10) % 10) << 4); + } +} + /*! 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; - uint16_t mnc = raid->mnc; - uint16_t _lac; - - buf[0] = ((mcc / 100) % 10) | (((mcc / 10) % 10) << 4); - buf[1] = (mcc % 10); - - /* I wonder who came up with the stupidity of encoding the MNC - * differently depending on how many digits its decimal number has! */ - if (mnc < 100) { - buf[1] |= 0xf0; - buf[2] = ((mnc / 10) % 10) | ((mnc % 10) << 4); - } else { - buf[1] |= (mnc % 10) << 4; - buf[2] = ((mnc / 100) % 10) | (((mnc / 10) % 10) << 4); - } - - _lac = osmo_htons(raid->lac); - memcpy(buf + 3, &_lac, 2); - - buf[5] = raid->rac; + gsm48_make_ra((struct gsm48_ra_id *)buf, raid); return 6; } diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..30c74ef 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -205,6 +205,7 @@ gsm48_rr_msg_name; gsm48_cc_state_name; gsm48_construct_ra; +gsm48_make_ra; gsm48_hdr_gmm_cipherable; gsm48_decode_bcd_number; gsm48_decode_bearer_cap; diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 935ec21..81ad04c 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -137,8 +137,7 @@ static inline void check_ra(const struct gprs_ra_id *raid) { - uint8_t buf[6]; - int res; + struct gsm48_ra_id ra; struct gprs_ra_id raid0 = { .mnc = 0, .mcc = 0, @@ -146,10 +145,10 @@ .rac = 0, }; - res = gsm48_construct_ra(buf, raid); - printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + gsm48_make_ra(&ra, raid); + printf("Constructed RA:\n"); - gsm48_parse_ra(&raid0, buf); + gsm48_parse_ra(&raid0, (const uint8_t *)&ra); dump_ra(raid); dump_ra(&raid0); printf("RA test..."); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index f0abfd5..83165fa 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,11 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=121, MCC=77, LAC=666, RAC=5 RA: MNC=121, MCC=77, LAC=666, RAC=5 RA test...passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=98, MCC=84, LAC=11, RAC=89 RA: MNC=98, MCC=84, LAC=11, RAC=89 RA test...passed -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:08:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 10:08:15 +0000 Subject: [PATCH] libosmocore[master]: Deprecate gsm48_construct_ra() Message-ID: Review at https://gerrit.osmocom.org/5653 Deprecate gsm48_construct_ra() It's just a tiny wrapper around gsm48_make_ra() with less strict type signature. Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 --- M include/osmocom/gsm/gsm48.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/5653/1 diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 35e4215..73c34fd 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -40,7 +40,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); void gsm48_make_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); -int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); +int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) OSMO_DEPRECATED("Use gsm48_make_ra() instead"); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:09:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:09:26 +0000 Subject: osmo-gsm-manuals[master]: Describe gsmtap log destination In-Reply-To: References: Message-ID: Patch Set 1: would be great to insert an example screenshot of how the interspersed pcap and logging looks like in wireshark. Also, one could list the advantages such as being able to filter on sub-systems or change log-levels _after_ the log has already been generated (by means of wireshark filters). -- To view, visit https://gerrit.osmocom.org/5639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:09:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:09:59 +0000 Subject: osmo-gsm-manuals[master]: Update path to ctrl scripts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5647 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib95e1ad33bbf115c8190f97210925549e6dc081a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:10:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:10:01 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Update path to ctrl scripts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update path to ctrl scripts ...................................................................... Update path to ctrl scripts Change-Id: Ib95e1ad33bbf115c8190f97210925549e6dc081a Related: OS#2550 --- M common/chapters/control_if.adoc 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/control_if.adoc b/common/chapters/control_if.adoc index dd6938a..ea55cd7 100644 --- a/common/chapters/control_if.adoc +++ b/common/chapters/control_if.adoc @@ -176,7 +176,7 @@ === Control Interface python examples In the `osmo-python-tests` repository, there is an example python script -called `osmopy/osmo_ctrl.py` which implements the Osmocom +called `scripts/osmo_ctrl.py` which implements the Osmocom control interface protocol. You can use this tool either stand-alone to perform control interface @@ -184,7 +184,7 @@ for developing your own python software talking to the control interface. -Another implementation is in `osmopy/rate_ctr2csv.py` which will retrieve performance counters +Another implementation is in `scripts/osmo_rate_ctr2csv.py` which will retrieve performance counters for a given Osmocom program and output it in csv format. This can be used to periodically (using systemd timer for example) retrieve data to build KPI and evaluate how it changes over time. @@ -196,7 +196,7 @@ .Example: Use `rate_ctr2csv.py` to get rate counters from OsmoBSC ---- -$ ./osmopy/rate_ctr2csv.py --header +$ ./scripts/osmo_rate_ctr2csv.py --header Connecting to localhost:4249... Getting rate counter groups info... "group","counter","absolute","second","minute","hour","day" -- To view, visit https://gerrit.osmocom.org/5647 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib95e1ad33bbf115c8190f97210925549e6dc081a Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:10:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:10:32 +0000 Subject: osmo-msc[master]: Add control command to expire subscriber In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I267886b7c79ed6d9c2f34a2e60d2972b7f4f4036 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:10:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:10:35 +0000 Subject: [MERGED] osmo-msc[master]: Add control command to expire subscriber In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add control command to expire subscriber ...................................................................... Add control command to expire subscriber It's equivalent of existing vty command: common part is extracted into shared helper function. Change-Id: I267886b7c79ed6d9c2f34a2e60d2972b7f4f4036 --- M include/osmocom/msc/vlr.h M src/libmsc/ctrl_commands.c M src/libmsc/vty_interface_layer3.c M src/libvlr/vlr.c 4 files changed, 56 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index b4bb27f..0b61a59 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -279,7 +279,7 @@ /* tell the VLR that the subscriber connection is gone */ int vlr_subscr_disconnected(struct vlr_subscr *vsub); - +bool vlr_subscr_expire(struct vlr_subscr *vsub); int vlr_subscr_rx_id_resp(struct vlr_subscr *vsub, const uint8_t *mi, size_t mi_len); int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, bool is_utran, const uint8_t *res, uint8_t res_len); diff --git a/src/libmsc/ctrl_commands.c b/src/libmsc/ctrl_commands.c index c6236ed..b0625bb 100644 --- a/src/libmsc/ctrl_commands.c +++ b/src/libmsc/ctrl_commands.c @@ -59,11 +59,49 @@ } CTRL_CMD_DEFINE_RO(subscriber_list, "subscriber-list-active-v1"); +CTRL_CMD_DEFINE_WO_NOVRF(sub_expire, "subscriber-expire"); +static int set_sub_expire(struct ctrl_cmd *cmd, void *data) +{ + struct vlr_subscr *vsub; + + if (!msc_ctrl_net) { + cmd->reply = "MSC CTRL commands not initialized"; + return CTRL_CMD_ERROR; + } + + if (!msc_ctrl_net->vlr) { + cmd->reply = "VLR not initialized"; + return CTRL_CMD_ERROR; + } + + vsub = vlr_subscr_find_by_imsi(msc_ctrl_net->vlr, cmd->value); + if (!vsub) { + LOGP(DCTRL, LOGL_ERROR, "Attempt to expire unknown subscriber IMSI=%s\n", cmd->value); + cmd->reply = "IMSI unknown"; + return CTRL_CMD_ERROR; + } + + LOGP(DCTRL, LOGL_NOTICE, "Expiring subscriber IMSI=%s\n", cmd->value); + + if (vlr_subscr_expire(vsub)) + LOGP(DCTRL, LOGL_NOTICE, "VLR released subscriber %s\n", vlr_subscr_name(vsub)); + + if (vsub->use_count > 1) + LOGP(DCTRL, LOGL_NOTICE, "Subscriber %s is still in use, should be released soon\n", + vlr_subscr_name(vsub)); + + vlr_subscr_put(vsub); + + return CTRL_CMD_REPLY; +} + int msc_ctrl_cmds_install(struct gsm_network *net) { int rc = 0; msc_ctrl_net = net; rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_subscriber_list); + rc |= ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_sub_expire); + return rc; } diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 65ba178..c7ec586 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -572,12 +572,9 @@ return CMD_WARNING; } - if (vsub->lu_complete) { - vsub->lu_complete = false; - vlr_subscr_put(vsub); + if (vlr_subscr_expire(vsub)) vty_out(vty, "%% VLR released subscriber %s%s", vlr_subscr_name(vsub), VTY_NEWLINE); - } if (vsub->use_count > 1) vty_out(vty, "%% Subscriber %s is still in use," diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 73c3f13..f57df8e 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -948,17 +948,28 @@ } } +bool vlr_subscr_expire(struct vlr_subscr *vsub) +{ + if (vsub->lu_complete) { + vsub->lu_complete = false; + vlr_subscr_put(vsub); + + return true; + } + + return false; +} + int vlr_subscr_rx_imsi_detach(struct vlr_subscr *vsub) { /* paranoia: should any LU or PARQ FSMs still be running, stop them. */ vlr_subscr_cancel(vsub, GMM_CAUSE_IMPL_DETACHED); vsub->imsi_detached_flag = true; - if (vsub->lu_complete) { - vsub->lu_complete = false; - /* balancing the get from vlr_lu_compl_fsm_success() */ - vlr_subscr_put(vsub); - } + + /* balancing the get from vlr_lu_compl_fsm_success() */ + vlr_subscr_expire(vsub); + return 0; } -- To view, visit https://gerrit.osmocom.org/5598 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I267886b7c79ed6d9c2f34a2e60d2972b7f4f4036 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:10:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:10:56 +0000 Subject: [MERGED] osmo-bsc[master]: Fix "CTRL GET msc_connection_status" response. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix "CTRL GET msc_connection_status" response. ...................................................................... Fix "CTRL GET msc_connection_status" response. Since 39f62bbcbf4309492a6d5bc07213cd74f650d41e the msc_connection_status variable in osmo_bsc_ctrl.c is no longer updated. Query the connection's status from the is_connected flag in struct bsc_msc_connection instead. Makes test BSC_Tests.TC_ctrl_msc_connection_status in ttcn3-bsc-test pass. However, we only query the connection status of the first MSC. Adapting the control command to work with mulitple MSCs is left for future work. Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa Related: OS#2729 --- M src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 4 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/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 8c9dfe7..4460288 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -62,7 +62,10 @@ static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data) { - if (msc_connection_status) + struct gsm_network *gsmnet = data; + struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0); + + if (msc->msc_con->is_connected) cmd->reply = "connected"; else cmd->reply = "disconnected"; -- To view, visit https://gerrit.osmocom.org/5627 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ab8aac83ef6b7831b6136f7e9e3eddfbb43ecaa Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:11:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:11:30 +0000 Subject: python/osmo-python-tests[master]: Use python3 for osmo_ctrl.py In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2461dd9af67771beed5306116e8a1b0ee2285aa8 Gerrit-PatchSet: 5 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:11:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:11:33 +0000 Subject: python/osmo-python-tests[master]: Improve python3 compatibility In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121 Gerrit-PatchSet: 9 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:11:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:11:37 +0000 Subject: python/osmo-python-tests[master]: Update ctrl command parsing for python3 In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I599f9f5a18109929f59386ab4416b8bfd75c74d1 Gerrit-PatchSet: 9 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:11:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:11:40 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Update ctrl command parsing for python3 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Update ctrl command parsing for python3 ...................................................................... Update ctrl command parsing for python3 * make parse() return command id in addition to variable name and value * introduce parse_kv() wrapper which ignores that id and use it instead of old parse() * make parse() compatible with python3 where we got bytes, not string from the socket so we have to decode it properly before using split() * expand test_py3.py with simply asyn server which verifies that osmo_ctrl.py works properly Change-Id: I599f9f5a18109929f59386ab4416b8bfd75c74d1 --- M contrib/jenkins.sh M osmopy/osmo_ipa.py M scripts/osmo_ctrl.py M scripts/twisted_ipa.py M tests/test_py3.py 5 files changed, 88 insertions(+), 23 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index d18b19d..9734549 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -24,7 +24,7 @@ $PY3 $COM_FLAGS $f done -cd scripts -./osmo_ctrl.py --help +# Run async server which tests scripts/osmo_ctrl.py interaction +$PY3 tests/test_py3.py # TODO: add more tests diff --git a/osmopy/osmo_ipa.py b/osmopy/osmo_ipa.py index 71cbf45..a1fcaf6 100755 --- a/osmopy/osmo_ipa.py +++ b/osmopy/osmo_ipa.py @@ -28,7 +28,7 @@ """ Stateless IPA protocol multiplexer: add/remove/parse (extended) header """ - version = "0.0.5" + version = "0.0.6" TCP_PORT_OML = 3002 TCP_PORT_RSL = 3003 # OpenBSC extensions: OSMO, MGCP_OLD @@ -231,23 +231,36 @@ return None return d - def parse(self, data, op=None): + def parse(self, raw_data): + """ + Parse Ctrl string returning (id, var, value) tuple + var could be None in case of ERROR message + value could be None in case of GET message + both could be None in case of TRAP with non-zero id + """ + data = self.rem_header(raw_data) + if data == None: + return None, None, None + data = data.decode('utf-8') + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return i, None, v + if s == self.CTRL_GET: + return i, v, None + if s == self.CTRL_GET + '_' + self.CTRL_REP: + return i, v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return i, None, None + return i, var, val + + def parse_kv(self, raw_data): """ Parse Ctrl string returning (var, value) pair var could be None in case of ERROR message value could be None in case of GET message """ - (s, i, v) = data.split(' ', 2) - if s == self.CTRL_ERR: - return None, v - if s == self.CTRL_GET: - return v, None - (s, i, var, val) = data.split(' ', 3) - if s == self.CTRL_TRAP and i != '0': - return None, '%s with non-zero id %s' % (s, i) - if op is not None and i != op: - if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: - return None, '%s with unexpected id %s' % (s, i) + (i, var, val) = self.parse(raw_data) return var, val def trap(self, var, val): @@ -265,11 +278,19 @@ return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + def reply(self, op_id, var, val=None): + """ + Make SET/GET command reply: returns assembled message + """ + if val is not None: + return self.add_header("%s_%s %s %s %s" % (self.CTRL_SET, self.CTRL_REP, op_id, var, val)) + return self.add_header("%s_%s %s %s" % (self.CTRL_GET, self.CTRL_REP, op_id, var)) + def verify(self, reply, r, var, val=None): """ Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value """ - (k, v) = self.parse(reply) + (k, v) = self.parse_kv(reply) if k != var or (val is not None and v != val): return False, v return True, v diff --git a/scripts/osmo_ctrl.py b/scripts/osmo_ctrl.py index 8c0608f..ac20050 100755 --- a/scripts/osmo_ctrl.py +++ b/scripts/osmo_ctrl.py @@ -40,8 +40,8 @@ def do_set_get(sck, var, value = None): (r, c) = Ctrl().cmd(var, value) sck.send(c) - answer = Ctrl().rem_header(sck.recv(4096)) - return (answer,) + Ctrl().verify(answer, r, var, value) + ret = sck.recv(4096) + return (Ctrl().rem_header(ret),) + Ctrl().verify(ret, r, var, value) def set_var(sck, var, val): (a, _, _) = do_set_get(sck, var, val) diff --git a/scripts/twisted_ipa.py b/scripts/twisted_ipa.py index bb8323d..533bfae 100755 --- a/scripts/twisted_ipa.py +++ b/scripts/twisted_ipa.py @@ -22,7 +22,7 @@ */ """ -__version__ = "0.7.0" # bump this on every non-trivial change +__version__ = "0.7.1" # bump this on every non-trivial change from osmopy.osmo_ipa import Ctrl, IPA from twisted.internet.protocol import ReconnectingClientFactory @@ -243,7 +243,7 @@ OSMO CTRL message dispatcher, lambda default should never happen For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example """ - self.dbg('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + self.dbg('OSMO CTRL received %s::%s' % Ctrl().parse_kv(data)) (cmd, op_id, v) = data.decode('utf-8').split(' ', 2) method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") method(data, op_id, v) diff --git a/tests/test_py3.py b/tests/test_py3.py index cac2f93..3a96d9f 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -1,7 +1,51 @@ #!/usr/bin/env python3 -# just import a smoke test for osmopy +# just a smoke test for osmopy -import osmopy +import asyncio, random +from osmopy.osmo_ipa import Ctrl +from osmopy import __version__ -print('[Python3] Smoke test PASSED.') +class CtrlProtocol(asyncio.Protocol): + def connection_made(self, transport): + peername = transport.get_extra_info('peername') + print('Connection from {}'.format(peername)) + self.transport = transport + + def data_received(self, data): + (i, v, k) = Ctrl().parse(data) + if not k: + print('Ctrl GET received: %s' % v) + else: + print('Ctrl SET received: %s :: %s' % (v, k)) + + message = Ctrl().reply(i, v, k) + self.transport.write(message) + + self.transport.close() + # quit the loop gracefully + print('Closing the loop...') + loop.stop() + + +if __name__ == '__main__': + loop = asyncio.get_event_loop() + test_host = '127.0.0.5' + test_port = str(random.randint(1025, 60000)) + + # Each client connection will create a new protocol instance + server = loop.run_until_complete(loop.create_server(CtrlProtocol, test_host, test_port)) + + print('Serving on {}...'.format(server.sockets[0].getsockname())) + + # Async client running in the subprocess plugged to the same event loop + loop.run_until_complete(asyncio.gather(asyncio.create_subprocess_exec('./scripts/osmo_ctrl.py', '-g', 'mnc', '-d', test_host, '-p', test_port), loop = loop)) + + loop.run_forever() + + # Cleanup after loop is finished + server.close() + loop.run_until_complete(server.wait_closed()) + loop.close() + + print('[Python3] Smoke test PASSED for v%s' % __version__) -- To view, visit https://gerrit.osmocom.org/5028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I599f9f5a18109929f59386ab4416b8bfd75c74d1 Gerrit-PatchSet: 9 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:11:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:11:41 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Use python3 for osmo_ctrl.py In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use python3 for osmo_ctrl.py ...................................................................... Use python3 for osmo_ctrl.py It's a standalone script illustrating the use of ctrl protocol from python. Since it's not used as a library and nothing depends on it, we can safely switch to python3. Change-Id: I2461dd9af67771beed5306116e8a1b0ee2285aa8 --- M contrib/jenkins.sh M scripts/osmo_ctrl.py M setup.py 3 files changed, 8 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c4ddf7d..d18b19d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -6,7 +6,7 @@ # FIXME: remove once python 2 support is deprecated PY2=python2 -PY2_LIST="osmopy scripts/osmo_ctrl.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py" +PY2_LIST="osmopy scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py" $PY2 ./setup.py install $PY2 tests/test_py2.py for f in $PY2_LIST @@ -24,4 +24,7 @@ $PY3 $COM_FLAGS $f done +cd scripts +./osmo_ctrl.py --help + # TODO: add more tests diff --git a/scripts/osmo_ctrl.py b/scripts/osmo_ctrl.py index bec6d1d..8c0608f 100755 --- a/scripts/osmo_ctrl.py +++ b/scripts/osmo_ctrl.py @@ -1,8 +1,8 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- mode: python-mode; py-indent-tabs-mode: nil -*- """ /* - * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * Copyright (C) 2016-2017 sysmocom s.f.m.c. GmbH * * All Rights Reserved * @@ -21,7 +21,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ """ -from __future__ import print_function + from optparse import OptionParser from osmopy.osmo_ipa import Ctrl import socket diff --git a/setup.py b/setup.py index 533272e..bab9c38 100755 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ elif sys.version_info.major == 3: scripts = ["scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", + "scripts/osmo_ctrl.py", "scripts/soap.py", "scripts/twisted_ipa.py", "scripts/osmo_verify_transcript_vty.py", -- To view, visit https://gerrit.osmocom.org/5061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2461dd9af67771beed5306116e8a1b0ee2285aa8 Gerrit-PatchSet: 5 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:12:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:12:31 +0000 Subject: libosmocore[master]: coding: move eB adjustement to appropriate place In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5614 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:12:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:12:35 +0000 Subject: [MERGED] libosmocore[master]: coding: move eB adjustement to appropriate place In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: coding: move eB adjustement to appropriate place ...................................................................... coding: move eB adjustement to appropriate place As a leftover from code move from OsmoBTS we have eB adjustement outside of eB check in gsm0503_tch_burst_map() which is rightfully noted by Coverity. Let's fix this by moving the adjustement under the corresponding if. Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2 Fixes: CID57691 --- M src/coding/gsm0503_mapping.c 1 file changed, 2 insertions(+), 7 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/src/coding/gsm0503_mapping.c b/src/coding/gsm0503_mapping.c index 1e37fce..f7532eb 100644 --- a/src/coding/gsm0503_mapping.c +++ b/src/coding/gsm0503_mapping.c @@ -92,13 +92,8 @@ eB[i] = iB[i]; for (i = 58 - odd; i < 114; i += 2) eB[i + 2] = iB[i]; - } - - if (h) { - if (!odd) - eB[58] = *h; - else - eB[57] = *h; + if (h) + eB[odd ? 57 : 58] = *h; } } -- To view, visit https://gerrit.osmocom.org/5614 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I385cd6ffea4d13ef911910fc87c92b73809888a2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:13:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 10:13:48 +0000 Subject: libosmocore[master]: NS: use monotonic clock In-Reply-To: References: Message-ID: Patch Set 5: I'm not entirely sure it is worth touching each and every part of code using timers and make them use monotonic time. Either we have to fix osmo_timer_list, or we have to introduce another generic timer infrastructure which can then be used by all the callers. -- To view, visit https://gerrit.osmocom.org/5104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6949601a80747f0de1a05e0790a1bace209efbf Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:14:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 10:14:06 +0000 Subject: [PATCH] libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5652 to look at the new patch set (#2). Add function to properly encode RAI Add gsm48_make_ra() which takes appropriate struct as [out] parameter instead of generic buffer. Using uint8_t buffer instead of proper struct type prooved to be error-prone - see Coverity CID57877, CID57876. Old gsm48_construct_ra() is made into tiny wrapper around new function. The test output is adjusted because of the change in function return value which was constant and hence ignored anyway. Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 --- M include/osmocom/gsm/gsm48.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gsm/gsm48.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 7 files changed, 54 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/5652/2 diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 424748e..35e4215 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -39,6 +39,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); +void gsm48_make_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d27a94f..318e5ed 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -161,7 +161,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -169,8 +169,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -185,7 +185,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -193,8 +193,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -209,7 +209,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -217,8 +217,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -231,7 +231,7 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; + struct gsm48_ra_id ra; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -239,8 +239,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -259,7 +259,7 @@ uint16_t cid) { /* 6 octets RAC */ - gsm48_construct_ra(buf, raid); + gsm48_make_ra((struct gsm48_ra_id *)buf, raid); /* 2 octets CID */ osmo_store16be(cid, buf+6); @@ -1215,7 +1215,7 @@ uint16_t drx_params = osmo_htons(pinfo->drx_params); uint8_t mi[10]; int imsi_len = gsm48_generate_mid_from_imsi(mi, pinfo->imsi); - uint8_t ra[6]; + struct gsm48_ra_id ra; if (imsi_len < 2) return -EINVAL; @@ -1241,12 +1241,12 @@ } break; case BSSGP_PAGING_LOCATION_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, ra); + gsm48_make_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, (const uint8_t *)&ra); break; case BSSGP_PAGING_ROUTEING_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); break; case BSSGP_PAGING_BVCI: { diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 3939e25..a71a91f 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -51,7 +51,7 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; + struct gsm48_ra_id ra; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx SUSPEND (TLLI=0x%04x)\n", tlli); @@ -61,8 +61,8 @@ bssgp_msgb_tlli_put(msg, tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -74,7 +74,7 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; + struct gsm48_ra_id ra; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx RESUME (TLLI=0x%04x)\n", tlli); @@ -84,8 +84,8 @@ bssgp_msgb_tlli_put(msg, tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + gsm48_make_ra(&ra, ra_id); + msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, (const uint8_t *)&ra); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index a7daea4..813476a 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -689,33 +689,34 @@ raid->rac = buf[5]; } +/*! Encode a 3GPP TS 24.008 ? 10.5.5.15 Routing area identification + * \param[out] out Caller-provided packed struct + * \param[in] raid Routing Area ID to be encoded + */ +void gsm48_make_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid) +{ + out->lac = osmo_htons(raid->lac); + out->rac = raid->rac; + + out->digits[0] = ((raid->mcc / 100) % 10) | (((raid->mcc / 10) % 10) << 4); + out->digits[1] = raid->mcc % 10; + + if (raid->mnc < 100) { + out->digits[1] |= 0xf0; + out->digits[2] = ((raid->mnc / 10) % 10) | ((raid->mnc % 10) << 4); + } else { + out->digits[1] |= (raid->mnc % 10) << 4; + out->digits[2] = ((raid->mnc / 100) % 10) | (((raid->mnc / 10) % 10) << 4); + } +} + /*! 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; - uint16_t mnc = raid->mnc; - uint16_t _lac; - - buf[0] = ((mcc / 100) % 10) | (((mcc / 10) % 10) << 4); - buf[1] = (mcc % 10); - - /* I wonder who came up with the stupidity of encoding the MNC - * differently depending on how many digits its decimal number has! */ - if (mnc < 100) { - buf[1] |= 0xf0; - buf[2] = ((mnc / 10) % 10) | ((mnc % 10) << 4); - } else { - buf[1] |= (mnc % 10) << 4; - buf[2] = ((mnc / 100) % 10) | (((mnc / 10) % 10) << 4); - } - - _lac = osmo_htons(raid->lac); - memcpy(buf + 3, &_lac, 2); - - buf[5] = raid->rac; + gsm48_make_ra((struct gsm48_ra_id *)buf, raid); return 6; } diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..30c74ef 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -205,6 +205,7 @@ gsm48_rr_msg_name; gsm48_cc_state_name; gsm48_construct_ra; +gsm48_make_ra; gsm48_hdr_gmm_cipherable; gsm48_decode_bcd_number; gsm48_decode_bearer_cap; diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 935ec21..81ad04c 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -137,8 +137,7 @@ static inline void check_ra(const struct gprs_ra_id *raid) { - uint8_t buf[6]; - int res; + struct gsm48_ra_id ra; struct gprs_ra_id raid0 = { .mnc = 0, .mcc = 0, @@ -146,10 +145,10 @@ .rac = 0, }; - res = gsm48_construct_ra(buf, raid); - printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + gsm48_make_ra(&ra, raid); + printf("Constructed RA:\n"); - gsm48_parse_ra(&raid0, buf); + gsm48_parse_ra(&raid0, (const uint8_t *)&ra); dump_ra(raid); dump_ra(&raid0); printf("RA test..."); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index f0abfd5..83165fa 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,11 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=121, MCC=77, LAC=666, RAC=5 RA: MNC=121, MCC=77, LAC=666, RAC=5 RA test...passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=98, MCC=84, LAC=11, RAC=89 RA: MNC=98, MCC=84, LAC=11, RAC=89 RA test...passed -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:15:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 10:15:47 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Improve python3 compatibility In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Improve python3 compatibility ...................................................................... Improve python3 compatibility Use proper print() function to make scripts compatible with both python 2 and 3. This paves the way to deprecating python 2 support altogether. Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121 --- M contrib/jenkins.sh M scripts/osmodumpdoc.py M scripts/osmotestconfig.py M scripts/osmotestvty.py M setup.py 5 files changed, 31 insertions(+), 29 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 9734549..ac67d85 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,7 +16,7 @@ rm -rf ./build PY3=python3 -PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" +PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" $PY3 ./setup.py install $PY3 tests/test_py3.py for f in $PY3_LIST diff --git a/scripts/osmodumpdoc.py b/scripts/osmodumpdoc.py index 2464b05..d71edc8 100644 --- a/scripts/osmodumpdoc.py +++ b/scripts/osmodumpdoc.py @@ -4,7 +4,7 @@ # Fixes may need to be applied to both. """Start the process and dump the documentation to the doc dir.""" - +from __future__ import print_function import subprocess import time import os @@ -21,7 +21,7 @@ out = open(filename, 'w') out.write(xml) out.close() - print 'generated %r' % filename + print('generated %r' % filename) """Dump the config of all the apps. @@ -40,22 +40,22 @@ for app in apps: appname = app[3] - print "Starting app for %s" % appname + print("Starting app for %s" % appname) proc = None cmd = [app[1], "-c", os.path.join(confpath, configs[appname][0])] - print 'cd', os.path.abspath(os.path.curdir), ';', ' '.join(cmd) + print('cd', os.path.abspath(os.path.curdir), ';', ' '.join(cmd)) try: proc = subprocess.Popen(cmd, stdin=None, stdout=None) except OSError as e: # Probably a missing binary - print >> sys.stderr, e - print >> sys.stderr, "Skipping app %s" % appname + print(e, file=sys.stderr) + print("Skipping app %s" % appname, file=sys.stderr) failures += 1 else: try: dump_doc(app[2], app[0], 'doc/%s_vty_reference.xml' % appname) successes += 1 except IOError: # Generally a socket issue - print >> sys.stderr, "%s: couldn't connect, skipping" % appname + print("%s: couldn't connect, skipping" % appname, file=sys.stderr) failures += 1 finally: osmoutil.end_proc(proc) @@ -90,7 +90,7 @@ num_fails, num_sucs = dump_configs( osmoappdesc.apps, osmoappdesc.app_configs, confpath) if num_fails > 0: - print >> sys.stderr, "Warning: Skipped %s apps" % num_fails + print("Warning: Skipped %s apps" % num_fails, file=sys.stderr) if 0 == num_sucs: - print >> sys.stderr, "Nothing run, wrong working dir? Set with -w" + print("Nothing run, wrong working dir? Set with -w", file=sys.stderr) sys.exit(num_fails) diff --git a/scripts/osmotestconfig.py b/scripts/osmotestconfig.py index 2132c43..f227504 100644 --- a/scripts/osmotestconfig.py +++ b/scripts/osmotestconfig.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import print_function import os import os.path import time @@ -52,7 +52,7 @@ try: cmd = app_desc[1].split(' ') + [ "-c", config] if verbose: - print "Verifying %s, test %s" % (' '.join(cmd), run_test.__name__) + print("Verifying %s, test %s" % (' '.join(cmd), run_test.__name__)) proc = osmoutil.popen_devnull(cmd) end = app_desc[2] @@ -61,10 +61,10 @@ ret = run_test(vty) except IOError as se: - print >> sys.stderr, "Failed to verify %s" % ' '.join(cmd) - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Error was %s" % se - print >> sys.stderr, "Config was\n%s" % open(config).read() + print("Failed to verify %s" % ' '.join(cmd), file=sys.stderr) + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Error was %s" % se, file=sys.stderr) + print("Config was\n%s" % open(config).read(), file=sys.stderr) raise se finally: @@ -125,9 +125,8 @@ all_errs.append(err_lines) - print >> sys.stderr, \ - "Documentation error (missing docs): \n%s\n%s\n" % ( - cmd_line, '\n'.join(err_lines)) + print("Documentation error (missing docs): \n%s\n%s\n" % ( + cmd_line, '\n'.join(err_lines)), file=sys.stderr) return (len(all_errs), all_errs) @@ -157,7 +156,7 @@ if config in app_configs[app]: found = True if not found: - print >> sys.stderr, "Warning: %s is not being tested" % config + print("Warning: %s is not being tested" % config, file=sys.stderr) def test_all_apps(apps, app_configs, tmpdir="writtenconfig", verbose=True, @@ -166,7 +165,7 @@ errors = 0 for app in apps: if not app_exists(app): - print >> sys.stderr, "Skipping app %s (not found)" % app[1] + print("Skipping app %s (not found)" % app[1], file=sys.stderr) continue configs = app_configs[app[3]] @@ -178,7 +177,7 @@ remove_tmpdir(tmpdir) if errors: - print >> sys.stderr, "ERRORS: %d" % errors + print("ERRORS: %d" % errors, file=sys.stderr) return errors diff --git a/scripts/osmotestvty.py b/scripts/osmotestvty.py index e513c05..55017a5 100644 --- a/scripts/osmotestvty.py +++ b/scripts/osmotestvty.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import print_function import os import time import unittest @@ -36,11 +36,11 @@ osmo_vty_cmd[cfi] = os.path.join(confpath, osmo_vty_cmd[cfi]) try: - print "Launch: %s from %s" % (' '.join(osmo_vty_cmd), os.getcwd()) + print("Launch: %s from %s" % (' '.join(osmo_vty_cmd), os.getcwd())) self.proc = osmoutil.popen_devnull(osmo_vty_cmd) except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Consider setting -b", file=sys.stderr) appstring = osmoappdesc.vty_app[2] appport = osmoappdesc.vty_app[0] @@ -94,9 +94,9 @@ osmoappdesc = osmoutil.importappconf_or_quit(confpath, "osmoappdesc", args.p) - print "confpath %s, workdir %s" % (confpath, workdir) + print("confpath %s, workdir %s" % (confpath, workdir)) os.chdir(workdir) - print "Running tests for specific VTY commands" + print("Running tests for specific VTY commands") suite = unittest.TestLoader().loadTestsFromTestCase(TestVTY) res = unittest.TextTestRunner(verbosity=verbose_level).run(suite) sys.exit(len(res.errors) + len(res.failures)) diff --git a/setup.py b/setup.py index bab9c38..bbb4b93 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,10 @@ scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", "scripts/osmotestvty.py"] elif sys.version_info.major == 3: - scripts = ["scripts/osmo_interact_vty.py", + scripts = ["scripts/osmodumpdoc.py", + "scripts/osmotestconfig.py", + "scripts/osmotestvty.py", + "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", "scripts/soap.py", -- To view, visit https://gerrit.osmocom.org/5038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80e5850a8978d78cda793e2192ef4bd3fd54a121 Gerrit-PatchSet: 10 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jan 5 10:20:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 10:20:19 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Add rate counter dumper 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/5029 to look at the new patch set (#12). Add rate counter dumper This simple tool dump all the rate counters available via ctrl interface to cvs file (or stdout). Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Fixes: OS#2550 --- M README M contrib/jenkins.sh A scripts/osmo_rate_ctr2csv.py M setup.py 4 files changed, 89 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/29/5029/12 diff --git a/README b/README index e85c1c4..2c04047 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ There are currently following scripts in this package: osmotestconfig.py - test that apps start/write with example configs soap.py - implementation of SOAP <-> Ctrl proxy implemented on top of Twisted +osmo_rate_ctr2csv.py - rate counter dumper on top of osmo_ipa osmo_interact_vty.py - pipe stdin/stdout to a VTY session osmo_interact_ctrl.py - pipe stdin/stdout to a CTRL port osmo_verify_transcript_vty.py - VTY testing by VTY session screen dumps diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ac67d85..08908a4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,7 +16,7 @@ rm -rf ./build PY3=python3 -PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" +PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmo_rate_ctr2csv.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" $PY3 ./setup.py install $PY3 tests/test_py3.py for f in $PY3_LIST diff --git a/scripts/osmo_rate_ctr2csv.py b/scripts/osmo_rate_ctr2csv.py new file mode 100644 index 0000000..1e3fc9f --- /dev/null +++ b/scripts/osmo_rate_ctr2csv.py @@ -0,0 +1,86 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2017 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from osmopy.osmo_ipa import Ctrl +import socket, argparse, sys, logging, csv + +__version__ = "0.0.1" # bump this on every non-trivial change + +def connect(host, port): + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + return sck + +def get_var(sck, var): + (_, c) = Ctrl().cmd(var, None) + sck.send(c) + return Ctrl().parse_kv(sck.recv(4096)) + +def get_interval(group_name, group_counters, interval): + log.debug('Getting %s counter values: %s...' % (group_name, interval)) + (_, c) = get_var(sock, 'rate_ctr.%s.%s' % (interval, group_name)) + for ctr in c.split(';'): + if len(ctr): + (k, v) = ctr.split() + group_counters[k] = group_counters.get(k, (group_name,)) + (v,) + return len(group_counters) + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Dump rate counters into csv via Osmocom CTRL protocol.') + p.add_argument('-v', '--version', action='version', version=("%(prog)s v" + __version__)) + p.add_argument('-p', '--port', type=int, default=4249, help="Port to use for CTRL interface, defaults to 4249") + p.add_argument('-c', '--ctrl', default='localhost', help="Adress to use for CTRL interface, defaults to localhost") + p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") + p.add_argument('--header', action='store_true', help="Prepend column header to output") + p.add_argument('-o', '--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout, help="Output file, defaults to stdout") + args = p.parse_args() + + log = logging.getLogger('rate_ctr2csv') + log.setLevel(logging.DEBUG if args.debug else logging.INFO) + log.addHandler(logging.StreamHandler(sys.stderr)) + + log.info('Connecting to %s:%d...' % (args.ctrl, args.port)) + sock = connect(args.ctrl, args.port) + + log.info('Getting rate counter groups info...') + (_, g) = get_var(sock, 'rate_ctr.*') + + w = csv.writer(args.output, dialect='unix') + total_groups = 0 + total_rows = 0 + + if args.header: + w.writerow(['group', 'counter', 'absolute', 'second', 'minute', 'hour', 'day']) + + for group in g.split(';'): + if len(group): + g_counters = {} + total_groups += 1 + total_rows += list(map(lambda x: get_interval(group, g_counters, x), ('abs', 'per_sec', 'per_min', 'per_hour', 'per_day')))[0] + for (k, (gr, absolute, per_sec, per_min, per_hour, per_day)) in g_counters.items(): + w.writerow([gr, k, absolute, per_sec, per_min, per_hour, per_day]) + + log.info('Completed: %d counters from %d groups received.' % (total_rows, total_groups)) diff --git a/setup.py b/setup.py index bbb4b93..e1bdafe 100755 --- a/setup.py +++ b/setup.py @@ -29,6 +29,7 @@ "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", + "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", "scripts/twisted_ipa.py", "scripts/osmo_verify_transcript_vty.py", -- To view, visit https://gerrit.osmocom.org/5029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Gerrit-PatchSet: 12 Gerrit-Project: python/osmo-python-tests 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 Fri Jan 5 11:53:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 11:53:23 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Describe gsmtap log destination In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5639 to look at the new patch set (#2). Describe gsmtap log destination Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Fixes: OS#2608 --- M .gitignore M common/chapters/logging.adoc A common/images/wireshark-gsmtap-log.png 3 files changed, 25 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/39/5639/2 diff --git a/.gitignore b/.gitignore index 67c2f69..3c72c7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.html *.svg -*.png *.pdf *.sw? *.bak diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 85975bb..beb1341 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -144,6 +144,31 @@ In the example above 98 is the desired size of the ring buffer (number of messages). Once it's filled, the incoming log messages will push out the oldest messages available in the buffer. +==== Logging via gsmtap + +When debugging complex issues it's handy to be able to reconstruct exact chain of events. This is enabled by using GSMTAP +log output where frames sent/received over the air are intersperced with the log lines. It also simplifies the bug handling +as users don't have to provide separate .pcap and .log files anymore - everything will be inside self-contained packet dump. + +It's configured as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log gsmtap 192.168.2.3 +OsmoBSC(config-log)# +---- + +The hostname/ip argument is optional: if omitted the default 127.0.0.1 will be used. The log strings inside GSMTAP are already +supported by Wireshark. Capturing for `port 4729` on appropriate interface will reveal log messages including source file +name and line number as well as application. This makes it easy to consolidate logs from several different network components +alongside the air frames. You can also use Wireshark to quickly filter logs for a given subsystem, severity, file name etc. + +[[fig-wireshark-gsmtap-log]] +.Wireshark with logs delivered over GSMTAP +image::../common/images/wireshark-gsmtap-log.png[] + +Note: the logs are also duplicated to stderr when GSMTAP logging is configured. + ==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and diff --git a/common/images/wireshark-gsmtap-log.png b/common/images/wireshark-gsmtap-log.png new file mode 100644 index 0000000..12fde6f --- /dev/null +++ b/common/images/wireshark-gsmtap-log.png Binary files differ -- To view, visit https://gerrit.osmocom.org/5639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 11:53:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 11:53:23 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: sigtran: fix typo Message-ID: Review at https://gerrit.osmocom.org/5654 sigtran: fix typo Change-Id: I02004ea55a00c55ee134d2c13e93614c3e1f06b3 --- M common/chapters/sigtran-osmocom.adoc 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/54/5654/1 diff --git a/common/chapters/sigtran-osmocom.adoc b/common/chapters/sigtran-osmocom.adoc index eddd70a..1f2bb1e 100644 --- a/common/chapters/sigtran-osmocom.adoc +++ b/common/chapters/sigtran-osmocom.adoc @@ -280,7 +280,7 @@ |Name|VTY Command|Description |ID|(config)# cs7 instance ID|The numeric identifier of this instance |Name|(config-cs7)# name NAME|A human-readable name for this instance -|Description|(cnfig-cs7)# description DESC| More verbose description +|Description|(config-cs7)# description DESC| More verbose description |Primary PC|(config-cs7)# point-code PC|Primary local point code |Network Indicator|(config-cs7)# network-indicator|Network Indicator used in MTP3 Routing Label |Point Code Format|(config-cs7)# point-code format|Point Code Format (Default: 3.8.3) -- To view, visit https://gerrit.osmocom.org/5654 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02004ea55a00c55ee134d2c13e93614c3e1f06b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:29:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 5 Jan 2018 12:29:44 +0000 Subject: [PATCH] osmo-bsc[master]: Support control connection status query for a particular MSC. 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/5630 to look at the new patch set (#3). Support control connection status query for a particular MSC. Add a new control command 'msc.N.connection_status' which can be used to query the connection status of a particular MSC with number N. Keep the old control command 'msc_connection_status', which always queries MSC 0, for backwards compatibility. Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Related: OS#2729 --- M include/osmocom/bsc/ctrl.h M src/libbsc/bsc_ctrl_lookup.c M src/osmo-bsc/osmo_bsc_ctrl.c 3 files changed, 53 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/30/5630/3 diff --git a/include/osmocom/bsc/ctrl.h b/include/osmocom/bsc/ctrl.h index c5ac210..04ca2cb 100644 --- a/include/osmocom/bsc/ctrl.h +++ b/include/osmocom/bsc/ctrl.h @@ -1,4 +1,11 @@ #pragma once +#include + struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, const char *bind_addr, uint16_t port); + +enum bsc_ctrl_node { + CTRL_NODE_MSC = _LAST_CTRL_NODE, + _LAST_CTRL_NODE_BSC +}; diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index d1d9b0a..38d1ba4 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -1,4 +1,4 @@ -/* SNMP-like status interface. Look-up of BTS/TRX +/* SNMP-like status interface. Look-up of BTS/TRX/MSC * * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves @@ -25,12 +25,14 @@ #include #include +#include #include #include +#include extern vector ctrl_node_vec; -/*! \brief control interface lookup function for bsc/bts gsm_data +/*! \brief control interface lookup function for bsc/bts/msc gsm_data * \param[in] data Private data passed to controlif_setup() * \param[in] vline Vector of the line holding the command string * \param[out] node_type type (CTRL_NODE_) that was determined @@ -44,6 +46,7 @@ struct gsm_bts *bts = NULL; struct gsm_bts_trx *trx = NULL; struct gsm_bts_trx_ts *ts = NULL; + struct bsc_msc_data *msc = NULL; char *token = vector_slot(vline, *i); long num; @@ -89,6 +92,18 @@ goto err_missing; *node_data = ts; *node_type = CTRL_NODE_TS; + } else if (!strcmp(token, "msc")) { + if (*node_type != CTRL_NODE_ROOT || !net) + goto err_missing; + (*i)++; + if (!ctrl_parse_get_num(vline, *i, &num)) + goto err_index; + + msc = osmo_msc_data_find(net, num); + if (!msc) + goto err_missing; + *node_data = msc; + *node_type = CTRL_NODE_MSC; } else return 0; @@ -102,6 +117,7 @@ struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, const char *bind_addr, uint16_t port) { - return ctrl_interface_setup_dynip(net, bind_addr, port, - bsc_ctrl_node_lookup); + return ctrl_interface_setup_dynip2(net, bind_addr, port, + bsc_ctrl_node_lookup, + _LAST_CTRL_NODE_BSC); } diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 4460288..fc79086 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -57,10 +58,27 @@ talloc_free(trap); } -CTRL_CMD_DEFINE_RO(msc_connection_status, "msc_connection_status"); -static int msc_connection_status = 0; - +CTRL_CMD_DEFINE_RO(msc_connection_status, "connection_status"); static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data) +{ + struct bsc_msc_data *msc = (struct bsc_msc_data *)cmd->node; + if (msc == NULL) { + cmd->reply = "msc not found"; + return CTRL_CMD_ERROR; + } + + if (msc->msc_con->is_connected) + cmd->reply = "connected"; + else + cmd->reply = "disconnected"; + return CTRL_CMD_REPLY; +} + +/* Backwards compat. */ +CTRL_CMD_DEFINE_RO(msc0_connection_status, "msc_connection_status"); +static int msc_connection_status = 0; /* XXX unused */ + +static int get_msc0_connection_status(struct ctrl_cmd *cmd, void *data) { struct gsm_network *gsmnet = data; struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0); @@ -96,7 +114,7 @@ cmd->id = "0"; cmd->variable = "msc_connection_status"; - get_msc_connection_status(cmd, NULL); + get_msc0_connection_status(cmd, NULL); ctrl_cmd_send_to_all(gsmnet->ctrl, cmd); @@ -627,7 +645,10 @@ rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_timezone); if (rc) goto end; - rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc_connection_status); + rc = ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); + if (rc) + goto end; + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc0_connection_status); if (rc) goto end; rc = osmo_signal_register_handler(SS_MSC, &msc_connection_status_trap_cb, net); -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:35:31 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 5 Jan 2018 12:35:31 +0000 Subject: [ABANDON] libosmocore[master]: Add a control command node type for MSC-specific commands. In-Reply-To: References: Message-ID: Stefan Sperling has abandoned this change. Change subject: Add a control command node type for MSC-specific commands. ...................................................................... Abandoned Not needed as Harald has pointed out. A new patch has been pushed to https://gerrit.osmocom.org/#/c/5630/ which does not depend on this libosmocom change. -- To view, visit https://gerrit.osmocom.org/5628 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I6794b6173f5486d411e6728c324920b8e85f3db6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:46:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 12:46:10 +0000 Subject: osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:46:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 12:46:21 +0000 Subject: osmo-gsm-manuals[master]: sigtran: fix typo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5654 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02004ea55a00c55ee134d2c13e93614c3e1f06b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:46:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 12:46:37 +0000 Subject: osmo-gsm-manuals[master]: Describe gsmtap log destination In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:46:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 12:46:38 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Describe gsmtap log destination In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Describe gsmtap log destination ...................................................................... Describe gsmtap log destination Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Fixes: OS#2608 --- M .gitignore M common/chapters/logging.adoc A common/images/wireshark-gsmtap-log.png 3 files changed, 25 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 67c2f69..3c72c7f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ *.html *.svg -*.png *.pdf *.sw? *.bak diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 85975bb..beb1341 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -144,6 +144,31 @@ In the example above 98 is the desired size of the ring buffer (number of messages). Once it's filled, the incoming log messages will push out the oldest messages available in the buffer. +==== Logging via gsmtap + +When debugging complex issues it's handy to be able to reconstruct exact chain of events. This is enabled by using GSMTAP +log output where frames sent/received over the air are intersperced with the log lines. It also simplifies the bug handling +as users don't have to provide separate .pcap and .log files anymore - everything will be inside self-contained packet dump. + +It's configured as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log gsmtap 192.168.2.3 +OsmoBSC(config-log)# +---- + +The hostname/ip argument is optional: if omitted the default 127.0.0.1 will be used. The log strings inside GSMTAP are already +supported by Wireshark. Capturing for `port 4729` on appropriate interface will reveal log messages including source file +name and line number as well as application. This makes it easy to consolidate logs from several different network components +alongside the air frames. You can also use Wireshark to quickly filter logs for a given subsystem, severity, file name etc. + +[[fig-wireshark-gsmtap-log]] +.Wireshark with logs delivered over GSMTAP +image::../common/images/wireshark-gsmtap-log.png[] + +Note: the logs are also duplicated to stderr when GSMTAP logging is configured. + ==== Logging to a file As opposed to Logging to the VTY, logging to files is persistent and diff --git a/common/images/wireshark-gsmtap-log.png b/common/images/wireshark-gsmtap-log.png new file mode 100644 index 0000000..12fde6f --- /dev/null +++ b/common/images/wireshark-gsmtap-log.png Binary files differ -- To view, visit https://gerrit.osmocom.org/5639 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If34e1640d1033daacc955f4285013b8c1be644d2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:49:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 12:49:23 +0000 Subject: libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Patch Set 2: (3 comments) https://gerrit.osmocom.org/#/c/5652/2/include/osmocom/gsm/gsm48.h File include/osmocom/gsm/gsm48.h: Line 42: void gsm48_make_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); gms48_encode_ra would fit better, IMHO https://gerrit.osmocom.org/#/c/5652/2/src/gb/gprs_bssgp.c File src/gb/gprs_bssgp.c: PS2, Line 173: 6 guess we can now use sizeof(ra) ? https://gerrit.osmocom.org/#/c/5652/2/src/gb/gprs_bssgp_bss.c File src/gb/gprs_bssgp_bss.c: PS2, Line 65: 6 guess we can now use sizeof(ra) ? -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:49:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 5 Jan 2018 12:49:31 +0000 Subject: libosmocore[master]: Deprecate gsm48_construct_ra() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 5 12:51:30 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 12:51:30 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: sigtran: fix typo In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: sigtran: fix typo ...................................................................... sigtran: fix typo Change-Id: I02004ea55a00c55ee134d2c13e93614c3e1f06b3 --- M common/chapters/sigtran-osmocom.adoc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/sigtran-osmocom.adoc b/common/chapters/sigtran-osmocom.adoc index eddd70a..1f2bb1e 100644 --- a/common/chapters/sigtran-osmocom.adoc +++ b/common/chapters/sigtran-osmocom.adoc @@ -280,7 +280,7 @@ |Name|VTY Command|Description |ID|(config)# cs7 instance ID|The numeric identifier of this instance |Name|(config-cs7)# name NAME|A human-readable name for this instance -|Description|(cnfig-cs7)# description DESC| More verbose description +|Description|(config-cs7)# description DESC| More verbose description |Primary PC|(config-cs7)# point-code PC|Primary local point code |Network Indicator|(config-cs7)# network-indicator|Network Indicator used in MTP3 Routing Label |Point Code Format|(config-cs7)# point-code format|Point Code Format (Default: 3.8.3) -- To view, visit https://gerrit.osmocom.org/5654 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02004ea55a00c55ee134d2c13e93614c3e1f06b3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 13:10:52 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 5 Jan 2018 13:10:52 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams 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/4980 to look at the new patch set (#18). mgcp: use osmo-mgw to switch rtp streams in the current implementation we still use osmo-bsc_mgcp, which has many problems and is also obsoleted by osmo-mgw. integrate osmo-mgw and re-implement the current switching using an osmo fsm. Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062 Closes: OS#2605 Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/gsm_data.h M include/osmocom/msc/iucs.h M include/osmocom/msc/msc_ifaces.h A include/osmocom/msc/msc_mgcp.h M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_mgcp.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c 15 files changed, 1,309 insertions(+), 325 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/4980/18 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 1419e8e..052d830 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -39,6 +39,7 @@ mncc.h \ mncc_int.h \ msc_ifaces.h \ + msc_mgcp.h \ network_listen.h \ oap_client.h \ openbscdefines.h \ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1b0bff9..98fa125 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -196,9 +196,17 @@ struct gsm_encr encr; struct { + struct mgcp_ctx *mgcp_ctx; unsigned int mgcp_rtp_endpoint; - uint16_t port_subscr; - uint16_t port_cn; + + uint16_t local_port_ran; + char local_addr_ran[INET_ADDRSTRLEN]; + uint16_t remote_port_ran; + char remote_addr_ran[INET_ADDRSTRLEN]; + uint16_t local_port_cn; + char local_addr_cn[INET_ADDRSTRLEN]; + uint16_t remote_port_cn; + char remote_addr_cn[INET_ADDRSTRLEN]; } rtp; /* which Iu-CS connection, if any. */ diff --git a/include/osmocom/msc/iucs.h b/include/osmocom/msc/iucs.h index b7d6064..a48a316 100644 --- a/include/osmocom/msc/iucs.h +++ b/include/osmocom/msc/iucs.h @@ -1,7 +1,10 @@ #pragma once +#include + int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, struct ranap_ue_conn_ctx *ue); +int iu_rab_act_cs(struct gsm_trans *trans); diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index 0592c07..ca25e9d 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -37,7 +37,3 @@ enum gsm48_reject_value value); int msc_tx_common_id(struct gsm_subscriber_connection *conn); -int msc_call_assignment(struct gsm_trans *trans); -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); -void msc_call_release(struct gsm_trans *trans); -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip); diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h new file mode 100644 index 0000000..ac3283c --- /dev/null +++ b/include/osmocom/msc/msc_mgcp.h @@ -0,0 +1,56 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +/* MGCP state handler context. This context information stores all information + * to handle the direction of the RTP streams via MGCP. There is one instance + * of this context struct per subscriber connection. + * (see also struct gsm_subscriber_connection) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number. This number identifies the endpoint + * on the MGW on which the RAN and CN connection is created. This + * endpoint number is assigned and released automatically. */ + uint16_t rtp_endpoint; + + /* Set to true, when the context information is no longer needed */ + bool free_ctx; + + /* RTP connection identifiers */ + char conn_id_ran[MGCP_CONN_ID_LENGTH]; + char conn_id_cn[MGCP_CONN_ID_LENGTH]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + struct gsm_trans *trans; + mgcp_trans_id_t mgw_pending_trans; +}; + +int msc_mgcp_call_assignment(struct gsm_trans *trans); +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr); +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); +int msc_mgcp_call_release(struct gsm_trans *trans); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7dfb047..2bb4bcf 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -40,6 +40,7 @@ mncc_builtin.c \ mncc_sock.c \ msc_ifaces.c \ + msc_mgcp.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 9dacca5..3ea873f 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -396,8 +396,17 @@ /* Package RTP-Address data */ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); + rtp_addr_in.sin_port = osmo_htons(conn->rtp.local_port_ran); + rtp_addr_in.sin_addr.s_addr = inet_addr(conn->rtp.local_addr_ran); + + if (rtp_addr_in.sin_addr.s_addr == INADDR_NONE) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Address -- assignment not sent!\n"); + return -EINVAL; + } + if (rtp_addr_in.sin_port == 0) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Port -- assignment not sent!\n"); + return -EINVAL; + } memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 909a9f9..fc95dfb 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -596,11 +597,7 @@ * transport address element */ if (rtp_addr.ss_family == AF_INET) { rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp.port_subscr = osmo_ntohs(rtp_addr_in->sin_port); - /* FIXME: We also get the IP-Address of the remote (e.g. BTS) - * end with the response. Currently we just ignore that address. - * Instead we expect that our local MGCP gateway and the code - * controlling it, magically knows the IP of the remote end. */ + msc_mgcp_ass_complete(conn, osmo_ntohs(rtp_addr_in->sin_port), inet_ntoa(rtp_addr_in->sin_addr)); } else { LOGP(DMSC, LOGL_ERROR, "Unsopported addressing scheme. (supports only IPV4)\n"); goto fail; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3045f71..8e783e7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #ifdef BUILD_IU @@ -77,6 +78,7 @@ #include #include +#include #include @@ -1331,8 +1333,8 @@ { gsm48_stop_cc_timer(trans); - /* Make sure call also gets released on the mgcp side */ - msc_call_release(trans); + /* Initiate the teardown of the related connections on the MGW */ + msc_mgcp_call_release(trans); /* send release to L4, if callref still exists */ if (trans->callref) { @@ -1393,6 +1395,7 @@ { struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[0]); struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); + int rc; if (!trans1 || !trans2) return -EIO; @@ -1403,7 +1406,18 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - return msc_call_bridge(trans1, trans2); + /* Bridge RTP streams */ + rc = msc_mgcp_call_complete(trans1, trans2->conn->rtp.local_port_cn, + trans2->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + rc = msc_mgcp_call_complete(trans2, trans1->conn->rtp.local_port_cn, + trans1->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + return 0; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1746,7 +1760,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -1788,7 +1802,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2672,8 +2686,23 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); - uint16_t port = trans->conn->rtp.port_cn; + uint32_t addr = inet_addr(trans->conn->rtp.local_addr_cn); + uint16_t port = trans->conn->rtp.local_port_cn; + + LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + + if (addr == INADDR_NONE) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid IP-Address\n", + vlr_subscr_name(trans->vsub)); + return; + } + if (port == 0) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid Port\n", + vlr_subscr_name(trans->vsub)); + return; + } /* FIXME: This has to be set to some meaningful value, * before the MSC-Split, this value was pulled from @@ -2713,15 +2742,15 @@ trans->conn->mncc_rtp_bridge = 1; - /* When we call msc_call_assignment() we will trigger, depending + /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. - * msc_call_assignment() also takes care about sending the CRCX + * msc_mgcp_call_assignment() also takes care about sending the CRCX * command to the MGCP-GW. The CRCX will return the port number, * where the PBX (e.g. Asterisk) will send its RTP stream to. We * have to return this port number back to the MNCC by sending * it back with the TCH_RTP_CREATE message. To make sure that * this message is sent AFTER the response to CRCX from the - * MGCP-GW has arrived, we need will instruct msc_call_assignment() + * MGCP-GW has arrived, we need will instruct msc_mgcp_call_assignment() * to take care of this by setting trans->tch_rtp_create to true. * This will make sure that gsm48_tch_rtp_create() (below) is * called as soon as the local port number has become known. */ @@ -2729,7 +2758,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2756,6 +2785,7 @@ { struct gsm_trans *trans; struct gsm_mncc_rtp *rtp = arg; + struct in_addr addr; /* Find callref */ trans = trans_find_by_callref(net, rtp->callref); @@ -2771,8 +2801,8 @@ return 0; } - msc_call_connect(trans, rtp->port, rtp->ip); - return 0; + addr.s_addr = osmo_htonl(rtp->ip); + return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } static struct downstate { diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index c89e412..7bb45b2 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -30,8 +30,22 @@ #include #include +#include #include #include +#include + +#include "../../bscconfig.h" + +#ifdef BUILD_IU +#include +extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, + uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +#else +#include +#endif /* BUILD_IU */ /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, @@ -187,3 +201,53 @@ return rc; } + +int iu_rab_act_cs(struct gsm_trans *trans) +{ + struct gsm_subscriber_connection *conn; + struct msgb *msg; + bool use_x213_nsap; + uint32_t conn_id; + struct ranap_ue_conn_ctx *uectx; + uint8_t rab_id; + uint32_t rtp_ip; + uint16_t rtp_port; + + conn = trans->conn; + uectx = conn->iu.ue_ctx; + rab_id = conn->iu.rab_id; + rtp_ip = osmo_htonl(inet_addr(conn->rtp.local_addr_ran)); + rtp_port = conn->rtp.local_port_ran; + conn_id = uectx->conn_id; + + if (rtp_ip == INADDR_NONE) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP IP-Address\n", + conn_id, rab_id); + return -EINVAL; + } + if (rtp_port == 0) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP Port\n", + conn_id, rab_id); + return -EINVAL; + } + + use_x213_nsap = + (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); + + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, rtp=%x:%u, use_x213_nsap=%d\n", + conn_id, rab_id, rtp_ip, rtp_port, use_x213_nsap); + + msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, + use_x213_nsap); + msg->l2h = msg->data; + + if (ranap_iu_rab_act(uectx, msg)) + LOGP(DIUCS, LOGL_ERROR, + "Failed to send RAB Assignment: conn_id=%d rab_id=%d rtp=%x:%u\n", + conn_id, rab_id, rtp_ip, rtp_port); + return 0; +} + diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index abf1812..57cd50e 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -28,6 +28,8 @@ #include #include +#include +#include #include #include @@ -36,22 +38,54 @@ #include #include #include +#include + +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); -static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, - RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) +static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, RANAP_RAB_SetupOrModifiedItemIEs_t * setup_ies) { uint8_t rab_id; RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem; + RANAP_TransportLayerAddress_t *transp_layer_addr; + RANAP_IuTransportAssociation_t *transp_assoc; + uint16_t port = 0; + int rc; + char addr[INET_ADDRSTRLEN]; rab_id = item->rAB_ID.buf[0]; LOGP(DIUCS, LOGL_NOTICE, - "Received RAB assignment event for %s rab_id=%hhd\n", - vlr_subscr_name(conn->vsub), rab_id); + "Received RAB assignment event for %s rab_id=%hhd\n", vlr_subscr_name(conn->vsub), rab_id); + if (item->iuTransportAssociation && item->transportLayerAddress) { + transp_layer_addr = item->transportLayerAddress; + transp_assoc = item->iuTransportAssociation; + + rc = ranap_transp_assoc_decode(&port, transp_assoc); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode RTP port in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + rc = ranap_transp_layer_addr_decode(addr, sizeof(addr), transp_layer_addr); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode IP-Address in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + return msc_mgcp_ass_complete(conn, port, addr); + } + + LOGP(DIUCS, LOGL_ERROR, + "RAB assignment lacks RTP connection information. (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); return 0; } diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index e29fe0e..437d75c 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -29,15 +29,12 @@ #include #include #include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include -extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, - uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); #else #include #endif /* BUILD_IU */ @@ -140,287 +137,4 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); -} - -static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, - uint32_t rtp_ip, uint16_t rtp_port) -{ -#ifdef BUILD_IU - struct msgb *msg; - bool use_x213_nsap; - uint32_t conn_id = uectx->conn_id; - - use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); - - LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," - " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, - rtp_port, use_x213_nsap); - - msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, - use_x213_nsap); - msg->l2h = msg->data; - - if (ranap_iu_rab_act(uectx, msg)) - LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" - " conn_id=%d rab_id=%d rtp=%x:%u\n", - conn_id, rab_id, rtp_ip, rtp_port); - return 0; -#else - LOGP(DMSC, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); - return -ENOTSUP; -#endif -} - -static void mgcp_response_rab_act_cs_crcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_subscriber_connection *conn = trans->conn; - uint32_t rtp_ip; - int rc; - - if (r->head.response_code != 200) { - LOGP(DMGCP, LOGL_ERROR, - "MGCPGW response yields error: %d %s\n", - r->head.response_code, r->head.comment); - goto rab_act_cs_error; - } - - rc = mgcp_response_parse_params(r); - if (rc) { - LOGP(DMGCP, LOGL_ERROR, - "Cannot parse MGCP response, for %s\n", - vlr_subscr_name(trans->vsub)); - goto rab_act_cs_error; - } - - conn->rtp.port_cn = r->audio_port; - - rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); - - if (trans->conn->via_ran == RAN_UTRAN_IU) { - /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) - goto rab_act_cs_error; - } else if (trans->conn->via_ran == RAN_GERAN_A) { - /* Assign a voice channel via A on 2G */ - if (a_iface_tx_assignment(trans)) - goto rab_act_cs_error; - } else - goto rab_act_cs_error; - - /* Respond back to MNCC (if requested) */ - if (trans->tch_rtp_create) { - if (gsm48_tch_rtp_create(trans)) - goto rab_act_cs_error; - } - return; - -rab_act_cs_error: - /* FIXME abort call, invalidate conn, ... */ - LOGP(DMSC, LOGL_ERROR, "%s: failure during assignment\n", - vlr_subscr_name(trans->vsub)); - return; -} - -int msc_call_assignment(struct gsm_trans *trans) -{ - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - uint16_t bts_base; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - -#ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ - static uint8_t next_iu_rab_id = 1; - if (conn->via_ran == RAN_UTRAN_IU) - conn->iu.rab_id = next_iu_rab_id ++; -#endif - - conn->rtp.mgcp_rtp_endpoint = - mgcp_client_next_endpoint(conn->network->mgw.client); - - /* This will calculate the port we assign to the BTS via AoIP - * assignment command (or rab-assignment on 3G) The BTS will send - * its RTP traffic to that port on the MGCPGW side. The MGCPGW only - * gets the endpoint ID via the CRCX. It will do the same calculation - * on his side too to get knowledge of the rtp port. */ - bts_base = mgcp_client_conf_actual(mgcp)->bts_base; - conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; - - /* Establish the RTP stream first as looping back to the originator. - * The MDCX will patch through to the counterpart. TODO: play a ring - * tone instead. */ - msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); - -static void mgcp_bridge(struct gsm_trans *from, struct gsm_trans *to, - enum bridge_state state, - enum mgcp_connection_mode mode) -{ - struct gsm_subscriber_connection *conn1 = from->conn; - struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcp_client *mgcp = conn1->network->mgw.client; - const char *ip; - struct msgb *msg; - - OSMO_ASSERT(mgcp); - - from->bridge.peer = to; - from->bridge.state = state; - - /* Loop back to the same MGCP GW */ - ip = mgcp_client_remote_addr_str(mgcp); - - msg = mgcp_msg_mdcx(mgcp, - conn1->rtp.mgcp_rtp_endpoint, - ip, conn2->rtp.port_cn, - mode); - if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(from->vsub)); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_trans *peer = trans->bridge.peer; - - switch (trans->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - trans->bridge.state = BRIDGE_STATE_LOOPBACK_ESTABLISHED; - - switch (peer->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - /* Wait until the other is done as well. */ - return; - case BRIDGE_STATE_LOOPBACK_ESTABLISHED: - /* Now that both are in loopback, switch both to - * forwarding. */ - mgcp_bridge(trans, peer, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - mgcp_bridge(peer, trans, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - break; - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } - break; - - case BRIDGE_STATE_BRIDGE_PENDING: - trans->bridge.state = BRIDGE_STATE_BRIDGE_ESTABLISHED; - break; - - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } -} - -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip) -{ - /* With this function we inform the MGCP-GW where (ip/port) it - * has to send its outgoing voic traffic. The receiving end will - * usually be a PBX (e.g. Asterisk). The IP-Address we tell, will - * not only be used to direct the traffic, it will also be used - * as a filter to make sure only RTP packets from the right - * remote end will reach the BSS. This is also the reason why - * inbound audio will not work until this step is performed */ - - /* NOTE: This function is used when msc_call_bridge(), is not - * applicable. This is usually the case when an external MNCC - * is in use */ - - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - if (!trans->conn->network) - return -EINVAL; - if (!trans->conn->network->mgw.client) - return -EINVAL; - - mgcp = trans->conn->network->mgw.client; - - struct in_addr ip_addr; - ip_addr.s_addr = ntohl(ip); - - conn = trans->conn; - - msg = mgcp_msg_mdcx(mgcp, - conn->rtp.mgcp_rtp_endpoint, - inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcp_client_tx(mgcp, msg, NULL, trans)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - return 0; -} - -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2) -{ - if (!trans1) - return -EINVAL; - if (!trans2) - return -EINVAL; - - /* First setup as loopback and configure the counterparts' endpoints, - * so that when transmission starts the originating addresses are - * already known to be valid. The mgcp callback will continue. */ - mgcp_bridge(trans1, trans2, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - mgcp_bridge(trans2, trans1, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - - return 0; -} - -void msc_call_release(struct gsm_trans *trans) -{ - struct msgb *msg; - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - - if (!trans) - return; - if (!trans->conn) - return; - if (!trans->conn->network) - return; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - - /* Send DLCX */ - msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint); - if (mgcp_client_tx(mgcp, msg, NULL, NULL)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send DLCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - /* Release endpoint id */ - mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c new file mode 100644 index 0000000..7506168 --- /dev/null +++ b/src/libmsc/msc_mgcp.c @@ -0,0 +1,1071 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../bscconfig.h" + +#define S(x) (1 << (x)) + +#define CONN_ID_RAN 1 +#define CONN_ID_CN 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_RAN_TIMEOUT 10 /* in seconds */ +#define MGCP_RAN_TIMEOUT_TIMER_NR 2 +#define MGCP_REL_TIMEOUT 60 /* in seconds */ +#define MGCP_REL_TIMEOUT_TIMER_NR 3 +#define MGCP_ASS_TIMEOUT 10 /* in seconds */ +#define MGCP_ASS_TIMEOUT_TIMER_NR 4 + +#define MGCP_ENDPOINT_FORMAT "%x at mgw" + +/* Some internal cause codes to indicate fault condition inside the FSM */ +enum msc_mgcp_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_RAN_TIMEOUT, + MGCP_ERR_ASS_TIMEOUT, + MGCP_ERR_NOMEM, + MGCP_ERR_ASSGMNT_FAIL +}; + +/* Human readable respresentation of the faul codes, will be displayed by + * handle_error() */ +static const struct value_string msc_mgcp_cause_codes_names[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_TX_FAIL, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (RAN)"}, + {MGCP_ERR_RAN_TIMEOUT, "call could not be completed in time (RAN)"}, + {MGCP_ERR_ASS_TIMEOUT, "assignment could not be completed in time (RAN)"}, + {MGCP_ERR_NOMEM, "out of memory"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (RAN)"}, + {0, NULL} +}; + +enum fsm_msc_mgcp_states { + ST_CRCX_RAN, + ST_CRCX_CN, + ST_CRCX_COMPL, + ST_MDCX_CN, + ST_MDCX_CN_COMPL, + ST_MDCX_RAN, + ST_MDCX_RAN_COMPL, + ST_CALL, + ST_HALT, +}; + +enum msc_mgcp_fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Notify that the Assignment is complete and we + * may now forward IP/Port of the remote call leg to the MGW */ + EV_ASSIGN, + + /* External event: Notify that the Call is complete and that the + * two half open connections on the MGW should now be connected */ + EV_CONNECT, + + /* External event: Notify that the call is over and the connections + * on the mgw shall be removed */ + EV_TEARDOWN, + + /* Internal event: An error occurred that requires a controlled + * teardown of the RTP connections */ + EV_TEARDOWN_ERROR, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the RAN side */ + EV_CRCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the CN side */ + EV_CRCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the RAN side */ + EV_MDCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the CN side */ + EV_MDCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the RAN and CN side */ + EV_DLCX_ALL_RESP, +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ +static void handle_error(struct mgcp_ctx *mgcp_ctx, enum msc_mgcp_cause_code cause) +{ + struct osmo_fsm_inst *fi; + + OSMO_ASSERT(mgcp_ctx); + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", + get_value_string(msc_mgcp_cause_codes_names, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN_ERROR, mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* We were unable to communicate with the MGW, unfortunately + * there is no meaningful action we can take now other than + * giving up. */ + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Cancel the transaction that timed out */ + mgcp_client_cancel(mgcp, mgcp_ctx->mgw_pending_trans); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN_ERROR, mgcp_ctx); + } else if (fi->T == MGCP_RAN_TIMEOUT_TIMER_NR) { + /* If the logic that controls the RAN is unable to negotiate a + * connection, we presumably still have a working connection to + * the MGW, we will try to shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_RAN_TIMEOUT); + } else if (fi->T == MGCP_REL_TIMEOUT_TIMER_NR) { + /* Under normal conditions, the MSC logic should always command + * to release the call at some point. However, the release may + * be missing due to errors in the MSC logic and we may have + * reached ST_HALT because of cascading errors and timeouts. In + * this and only in this case we will allow ST_HALT to free all + * context information on its own authority. */ + mgcp_ctx->free_ctx = true; + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_ASS_TIMEOUT_TIMER_NR) { + /* There may be rare cases in which the MSC is unable to + * complete the call assignment */ + handle_error(mgcp_ctx, MGCP_ERR_ASS_TIMEOUT); + } else { + /* Ther must not be any unsolicited timers in this FSM. If so, + * we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_RAN: Send CRCX for RAN side to MGW */ +static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + mgcp_ctx->rtp_endpoint = mgcp_client_next_endpoint(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/RAN: creating connection for the RAN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_CN, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for RAN associated CRCX */ +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_ran, r->head.conn_id, sizeof(mgcp_ctx->conn_id_ran)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/RAN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_ran); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/RAN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_ran = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_ran, r->audio_ip, sizeof(conn->rtp.local_addr_ran)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_RAN_RESP, mgcp_ctx); +} + +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_CN: check MGW response and send CRCX for CN side to MGW */ +static void fsm_crcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_CRCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/CN creating connection for the CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_cn, r->head.conn_id, sizeof(mgcp_ctx->conn_id_cn)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_cn); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/CN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_cn = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_cn, r->audio_ip, sizeof(conn->rtp.local_addr_cn)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_CRCX_COMPL: check MGW response, start assignment */ +static void fsm_crcx_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CRCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Forward assignment request to A/RANAP */ + if (conn->via_ran == RAN_UTRAN_IU) { +#ifdef BUILD_IU + /* Assign a voice channel via RANAP on 3G */ + if (iu_rab_act_cs(trans)) + goto error; +#else + LOGPFSML(fi, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); + goto error; +#endif + } else if (conn->via_ran == RAN_GERAN_A) { + /* Assign a voice channel via A on 2G */ + if (a_iface_tx_assignment(trans)) + goto error; + } else { + /* Unset or unimplemented new RAN type */ + LOGPFSML(fi, LOGL_ERROR, "Unknown RAN type: %d\n", conn->via_ran); + return; + } + + /* Respond back to MNCC (if requested) */ + if (trans->tch_rtp_create) { + if (gsm48_tch_rtp_create(trans)) + goto error; + } + + /* Note: When we reach this point then the situation is basically that + * we have two sides connected, both are in loopback. The local ports + * of the side pointing towards the BSS should be already communicated + * and we are waiting now for the BSS to return with the assignment + * complete command. */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN, MGCP_RAN_TIMEOUT, MGCP_RAN_TIMEOUT_TIMER_NR); + return; + +error: + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); +} + +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_CN: send MDCX for RAN side to MGW */ +static void fsm_mdcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CONNECT: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/CN: completing connection for the CN side on MGW endpoint:0x%x, remote leg expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_cn, conn->rtp.remote_port_cn); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_cn, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_cn, + .audio_port = conn->rtp.remote_port_cn + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_CN_COMPL: wait for mgw response, move on with the MDCX + * for the RAN side if we already have valid IP/Port data for the RAN sided + * RTP stream. */ +static void fsm_mdcx_cn_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_subscriber_connection *conn; + struct gsm_trans *trans; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_MDCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Enter MDCX phase, but we must be sure that the Assigmnet on the A or + * IuCS interface is complete (IP-Address and Port are valid) */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN, MGCP_ASS_TIMEOUT, MGCP_ASS_TIMEOUT_TIMER_NR); + + /* If we already have a valid remote port and IP-Address from the RAN side + * call leg, the assignment has been completed before we got here, so we + * may move on immediately */ + if (conn->rtp.remote_port_ran != 0 || strlen(conn->rtp.remote_addr_ran) > 0) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); +} + +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_RAN: wait for assignment completion, send MDCX for CN side to MGW */ +static void fsm_mdcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_ASSIGN: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/RAN: completing connection for the CN side on MGW endpoint:0x%x, RAN expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_ran, conn->rtp.remote_port_ran); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_ran, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_ran, + .audio_port = conn->rtp.remote_port_ran + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_RAN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_RAN_COMPL: check MGW response */ +static void fsm_mdcx_ran_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_MDCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, "call active, waiting for teardown...\n"); + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); +} + +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CALL: call is active, send DLCX for both sides on teardown */ +static void fsm_call_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "DLCX: removing connection for the RAN and CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = mgcp_ctx->rtp_endpoint + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_dlcx_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + + OSMO_ASSERT(mgcp_ctx); + + /* NOTE: We must not free the context information now, we have to + * wait until msc_mgcp_call_release() is called. Then we are sure + * that the logic controlling us is fully aware that the context + * information is freed. If we would free early now the controlling + * logic might mistakenly think that the context info is still alive, + * so lets keep the context info until we are explicitly asked for + * throwing it away. */ + if (mgcp_ctx->free_ctx) { + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_REL_TIMEOUT, MGCP_REL_TIMEOUT_TIMER_NR); +} + +static struct osmo_fsm_state fsm_msc_mgcp_states[] = { + + /* Startup state machine, send CRCX for RAN side. */ + [ST_CRCX_RAN] = { + .in_event_mask = S(EV_INIT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_RAN), + .action = fsm_crcx_ran_cb, + }, + /* When the response to the RAN CRCX is received, then proceed with + sending the CRCX for CN side */ + [ST_CRCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_COMPL), + .name = OSMO_STRINGIFY(ST_CRCX_CN), + .action = fsm_crcx_cn_cb, + }, + /* Complete the CRCX phase by starting the assignment. Depending on the + * RAT (Radio Access Technology), this will either trigger an + * Assignment Request on the A-Interface or an RAB-Assignment on the + * IU-interface */ + [ST_CRCX_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_COMPL), + .action = fsm_crcx_compl, + }, + /* Wait for MSC to complete the assignment request, when complete, we + * will enter the MDCX phase by sending an MDCX for the CN side to the + * MGW */ + [ST_MDCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CONNECT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_CN), + .action = fsm_mdcx_cn_cb, + }, + /* We arrive in this state when the MDCX phase for the CN side has + * completed we will check the IP/Port of the RAN connection. If this + * data is valid we may continue with the MDCX phase for the RAN side. + * If not we wait until the assinment completes on the A or on the IuCS + * interface. The completion of the assignment will fill in the port and + * IP-Address of the RAN side and way may continue then. */ + [ST_MDCX_CN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_MDCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN), + .name = OSMO_STRINGIFY(ST_MDCX_CN_COMPL), + .action = fsm_mdcx_cn_compl_cb, + }, + /* When the response for the CN MDCX is received, send the MDCX for the + * RAN side to the MGW */ + [ST_MDCX_RAN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_ASSIGN), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN), + .action = fsm_mdcx_ran_cb, + }, + /* The RAN side MDCX phase is complete when the response is received + * from the MGW. The call is then active, we change to ST_CALL and wait + * there until the call ends. */ + [ST_MDCX_RAN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_MDCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN_COMPL), + .action = fsm_mdcx_ran_compl_cb, + }, + /* We are now in the active call phase, wait until the call is done + * and send a DLCX then to remove all connections from the MGW */ + [ST_CALL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_CALL), + .action = fsm_call_cb, + }, + /* When the MGW confirms that the connections are terminated, then halt + * the state machine. */ + [ST_HALT] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_DLCX_ALL_RESP), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_HALT), + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm_msc_mgcp = { + .name = "MGW", + .states = fsm_msc_mgcp_states, + .num_states = ARRAY_SIZE(fsm_msc_mgcp_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that a new call begins. This will create a connection for the + * RAN and the CN on the MGW. + * Parameter: + * trans: transaction context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_assignment(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + struct gsm_subscriber_connection *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call assignment failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + mgcp = conn->network->mgw.client; + OSMO_ASSERT(mgcp); + + if (conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) double assignment detected, dropping...\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + +#ifdef BUILD_IU + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ + static uint8_t next_iu_rab_id = 1; + if (conn->via_ran == RAN_UTRAN_IU) + conn->iu.rab_id = next_iu_rab_id++; +#endif + + if (snprintf(name, sizeof(name), "MGW_%i", trans->transaction_id) >= sizeof(name)) + return -EINVAL; + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_msc_mgcp); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(NULL, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->trans = trans; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_RAN); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + conn->rtp.mgcp_ctx = mgcp_ctx; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call assignment initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Inform the FSM that the assignment (RAN connection) is now complete. + * Parameter: + * conn: subscriber connection context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(conn); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, call completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, call completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + mgcp_ctx = conn->rtp.mgcp_ctx; + if (!mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignmnet completion failed.\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + /* Memorize port and IP-Address of the remote RAN call leg. We need this + * information at latest when we enter the MDCX phase for the RAN side. */ + conn->rtp.remote_port_ran = port; + osmo_strlcpy(conn->rtp.remote_addr_ran, addr, sizeof(conn->rtp.remote_addr_ran)); + + /* Note: We only dispatch the event if we are really waiting for the + * assignment, if we are not yet waiting, there is no need to loudly + * broadcast an event that the all other states do not understand anyway */ + if (mgcp_ctx->fsm->state == ST_MDCX_RAN) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); + + return 0; +} + +/* Make the connection of a previously assigned call complete + * Parameter: + * trans: transaction context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(trans); + OSMO_ASSERT(addr); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call completion failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* The FSM should already have passed all CRCX phases and be ready to move + * on with the MDCX phases. */ + if (mgcp_ctx->fsm->state != ST_MDCX_CN) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid call state, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + osmo_strlcpy(conn->rtp.remote_addr_cn, addr, sizeof(conn->rtp.remote_addr_cn)); + conn->rtp.remote_port_cn = port; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CONNECT, mgcp_ctx); + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call completion initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Release ongoing call. + * Parameter: + * trans: connection context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_release(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call release failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* Inform the FSM that as soon as it reaches ST_HALT it may free + * all context information immediately */ + mgcp_ctx->free_ctx = true; + + /* Initaite teardown, regardless of which state we are currently + * in */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + + /* Prevent any further operation that is triggered from outside by + * overwriting the context pointer with NULL. The FSM will now + * take care for a graceful shutdown and when done it will free + * all related context information */ + trans->conn->rtp.mgcp_ctx = NULL; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call release initiated\n", + vlr_subscr_name(trans->vsub)); + + return 0; +} diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 3a2c859..43b4e07 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -30,8 +30,8 @@ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=osmo_get_rand_id \ - -Wl,--wrap=msc_call_assignment \ - -Wl,--wrap=msc_call_release \ + -Wl,--wrap=msc_mgcp_call_release \ + -Wl,--wrap=msc_mgcp_call_assignment \ $(NULL) LDADD = \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index ac850b3..09f0df0 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -556,18 +556,18 @@ return 0; } -/* override, requires '-Wl,--wrap=msc_call_assignment' */ -int __real_msc_call_assignment(struct gsm_trans *trans); -int __wrap_msc_call_assignment(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_assignment' */ +int __real_msc_mgcp_call_assignment(struct gsm_trans *trans); +int __wrap_msc_mgcp_call_assignment(struct gsm_trans *trans) { log("MS <--Call Assignment-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); return 0; } -/* override, requires '-Wl,--wrap=msc_call_release' */ -void __real_msc_call_release(struct gsm_trans *trans); -void __wrap_msc_call_release(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_release' */ +void __real_msc_mgcp_call_release(struct gsm_trans *trans); +void __wrap_msc_mgcp_call_release(struct gsm_trans *trans) { log("MS <--Call Release-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); -- To view, visit https://gerrit.osmocom.org/4980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 Gerrit-PatchSet: 18 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 5 13:31:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 13:31:14 +0000 Subject: [PATCH] libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5652 to look at the new patch set (#3). Add function to properly encode RAI Add gsm48_encode_ra() which takes appropriate struct as [out] parameter instead of generic buffer. Using uint8_t buffer instead of proper struct type prooved to be error-prone - see Coverity CID57877, CID57876. Old gsm48_construct_ra() is made into tiny wrapper around new function. The test output is adjusted because of the change in function return value which was constant and hence ignored anyway. Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 --- M include/osmocom/gprs/gprs_bssgp_bss.h M include/osmocom/gsm/gsm48.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gb/libosmogb.map M src/gsm/gsm48.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 9 files changed, 53 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/5652/3 diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index 74211fd..f07ab52 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,6 +26,7 @@ #include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); +uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id); 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/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 424748e..3ebca18 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -39,6 +39,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); +void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d27a94f..7228263 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -161,7 +161,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -169,8 +168,7 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -185,7 +183,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -193,8 +190,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); + if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -209,7 +206,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -217,8 +213,7 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -231,7 +226,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -239,8 +233,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); + if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -259,7 +253,7 @@ uint16_t cid) { /* 6 octets RAC */ - gsm48_construct_ra(buf, raid); + gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); /* 2 octets CID */ osmo_store16be(cid, buf+6); @@ -1215,7 +1209,7 @@ uint16_t drx_params = osmo_htons(pinfo->drx_params); uint8_t mi[10]; int imsi_len = gsm48_generate_mid_from_imsi(mi, pinfo->imsi); - uint8_t ra[6]; + struct gsm48_ra_id ra; if (imsi_len < 2) return -EINVAL; @@ -1241,12 +1235,11 @@ } break; case BSSGP_PAGING_LOCATION_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, ra); + gsm48_encode_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, (const uint8_t *)&ra); break; case BSSGP_PAGING_ROUTEING_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, &pinfo->raid); break; case BSSGP_PAGING_BVCI: { diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 3939e25..c7e5e4d 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -44,6 +44,14 @@ return msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); } +uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id) +{ + struct gsm48_ra_id ra; + + gsm48_encode_ra(&ra, ra_id); + return msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(ra), (const uint8_t *)&ra); +} + /*! GMM-SUSPEND.req (Chapter 10.3.6) */ int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id) @@ -51,7 +59,6 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx SUSPEND (TLLI=0x%04x)\n", tlli); @@ -60,9 +67,7 @@ bgph->pdu_type = BSSGP_PDUT_SUSPEND; bssgp_msgb_tlli_put(msg, tlli); - - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -74,7 +79,6 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx RESUME (TLLI=0x%04x)\n", tlli); @@ -83,9 +87,7 @@ bgph->pdu_type = BSSGP_PDUT_RESUME; bssgp_msgb_tlli_put(msg, tlli); - - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 9a0dba5..83a3621 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -9,6 +9,7 @@ bssgp_msgb_alloc; bssgp_msgb_copy; bssgp_msgb_tlli_put; +bssgp_msgb_ra_put; bssgp_parse_cell_id; bssgp_tx_bvc_block; bssgp_tx_bvc_reset; diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index a7daea4..8876059 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -689,33 +689,34 @@ raid->rac = buf[5]; } +/*! Encode a 3GPP TS 24.008 ? 10.5.5.15 Routing area identification + * \param[out] out Caller-provided packed struct + * \param[in] raid Routing Area ID to be encoded + */ +void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid) +{ + out->lac = osmo_htons(raid->lac); + out->rac = raid->rac; + + out->digits[0] = ((raid->mcc / 100) % 10) | (((raid->mcc / 10) % 10) << 4); + out->digits[1] = raid->mcc % 10; + + if (raid->mnc < 100) { + out->digits[1] |= 0xf0; + out->digits[2] = ((raid->mnc / 10) % 10) | ((raid->mnc % 10) << 4); + } else { + out->digits[1] |= (raid->mnc % 10) << 4; + out->digits[2] = ((raid->mnc / 100) % 10) | (((raid->mnc / 10) % 10) << 4); + } +} + /*! 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; - uint16_t mnc = raid->mnc; - uint16_t _lac; - - buf[0] = ((mcc / 100) % 10) | (((mcc / 10) % 10) << 4); - buf[1] = (mcc % 10); - - /* I wonder who came up with the stupidity of encoding the MNC - * differently depending on how many digits its decimal number has! */ - if (mnc < 100) { - buf[1] |= 0xf0; - buf[2] = ((mnc / 10) % 10) | ((mnc % 10) << 4); - } else { - buf[1] |= (mnc % 10) << 4; - buf[2] = ((mnc / 100) % 10) | (((mnc / 10) % 10) << 4); - } - - _lac = osmo_htons(raid->lac); - memcpy(buf + 3, &_lac, 2); - - buf[5] = raid->rac; + gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); return 6; } diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..5611ba3 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -205,6 +205,7 @@ gsm48_rr_msg_name; gsm48_cc_state_name; gsm48_construct_ra; +gsm48_encode_ra; gsm48_hdr_gmm_cipherable; gsm48_decode_bcd_number; gsm48_decode_bearer_cap; diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 935ec21..77a8822 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -137,8 +137,7 @@ static inline void check_ra(const struct gprs_ra_id *raid) { - uint8_t buf[6]; - int res; + struct gsm48_ra_id ra; struct gprs_ra_id raid0 = { .mnc = 0, .mcc = 0, @@ -146,10 +145,10 @@ .rac = 0, }; - res = gsm48_construct_ra(buf, raid); - printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + gsm48_encode_ra(&ra, raid); + printf("Constructed RA:\n"); - gsm48_parse_ra(&raid0, buf); + gsm48_parse_ra(&raid0, (const uint8_t *)&ra); dump_ra(raid); dump_ra(&raid0); printf("RA test..."); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index f0abfd5..83165fa 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,11 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=121, MCC=77, LAC=666, RAC=5 RA: MNC=121, MCC=77, LAC=666, RAC=5 RA test...passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=98, MCC=84, LAC=11, RAC=89 RA: MNC=98, MCC=84, LAC=11, RAC=89 RA test...passed -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 13:31:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 13:31:14 +0000 Subject: [PATCH] libosmocore[master]: Deprecate gsm48_construct_ra() 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/5653 to look at the new patch set (#3). Deprecate gsm48_construct_ra() It's just a tiny wrapper around gsm48_encode_ra() with less strict type signature. Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 --- M include/osmocom/gsm/gsm48.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/5653/3 diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 3ebca18..69431de 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -40,7 +40,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); -int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); +int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) OSMO_DEPRECATED("Use gsm48_encode_ra() instead"); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 5 13:31:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 13:31:15 +0000 Subject: [PATCH] libosmocore[master]: Use existing function for TLLI encoding Message-ID: Review at https://gerrit.osmocom.org/5655 Use existing function for TLLI encoding Use bssgp_msgb_tlli_put() instead of copy-pasted code. Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77 --- M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M tests/gb/gprs_bssgp_test.c 3 files changed, 9 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/5655/1 diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index 7228263..4c0bb8a 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -160,14 +160,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_SUSPEND_ACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); @@ -182,14 +180,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_SUSPEND_NACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); if (cause) @@ -205,14 +201,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_RESUME_ACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -225,14 +219,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_SUSPEND_NACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); if (cause) diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index c7e5e4d..487286c 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -396,7 +396,6 @@ struct msgb *msg; struct bssgp_normal_hdr *bgph; uint16_t e_bucket_size, e_leak_rate; - uint32_t e_tlli; if ((ms_bucket_size / 100) > 0xffff) return -EINVAL; @@ -412,8 +411,7 @@ msgb_bvci(msg) = bctx->bvci; bgph->pdu_type = BSSGP_PDUT_FLOW_CONTROL_MS; - e_tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(e_tlli), (uint8_t *)&e_tlli); + bssgp_msgb_tlli_put(msg, tlli); msgb_tvlv_put(msg, BSSGP_IE_TAG, sizeof(tag), (uint8_t *)&tag); msgb_tvlv_put(msg, BSSGP_IE_MS_BUCKET_SIZE, sizeof(e_bucket_size), (uint8_t *) &e_bucket_size); diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c index 1624a31..c38e180 100644 --- a/tests/gb/gprs_bssgp_test.c +++ b/tests/gb/gprs_bssgp_test.c @@ -98,11 +98,11 @@ static void send_bssgp_supend(enum bssgp_pdu_type pdu_type, uint32_t tlli) { struct msgb *msg = bssgp_msgb_alloc(); - uint32_t tlli_be = htonl(tlli); uint8_t rai[] = {0x0f, 0xf1, 0x80, 0x20, 0x37, 0x00}; msgb_v_put(msg, pdu_type); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(tlli_be), (uint8_t *)&tlli_be); + + bssgp_msgb_tlli_put(msg, tlli); msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(rai), &rai[0]); msgb_bssgp_send_and_free(msg); @@ -111,12 +111,12 @@ static void send_bssgp_resume(enum bssgp_pdu_type pdu_type, uint32_t tlli) { struct msgb *msg = bssgp_msgb_alloc(); - uint32_t tlli_be = htonl(tlli); uint8_t rai[] = {0x0f, 0xf1, 0x80, 0x20, 0x37, 0x00}; uint8_t suspend_ref = 1; msgb_v_put(msg, pdu_type); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(tlli_be), (uint8_t *)&tlli_be); + + bssgp_msgb_tlli_put(msg, tlli); msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(rai), &rai[0]); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); -- To view, visit https://gerrit.osmocom.org/5655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 16:27:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 16:27:36 +0000 Subject: osmo-bsc[master]: cosmetic: mgcp: remove duplicate logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc 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 Jan 5 16:29:05 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 16:29:05 +0000 Subject: [PATCH] osmo-pcu[master]: Clarify RACH-related interfaces Message-ID: Review at https://gerrit.osmocom.org/5656 Clarify RACH-related interfaces * make is_11bit parameter into bool * remove is_single_block() from public interface and mark it as static * move logging outside of if ladder * move side-effects from is_single_block() into separate static functions * simplify UL-TBF allocation in case of 11-bit RACH This immediately makes it obvious that priority is never actually used despite being computed - seems like a leftover from merge of incomplete patch series. Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 Related: OS#1548 --- M src/bts.cpp M src/bts.h 2 files changed, 87 insertions(+), 82 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/56/5656/1 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..3a28ae8 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -615,7 +615,89 @@ return fn; } -int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, +static inline uint16_t mslot_class_from_ra(uint16_t ra, bool is_11bit) +{ + if (is_11bit) + return (ra & 0x3e0) >> 5; + + /* set multislot class to 0 for 8-bit RACH, since we don't know it yet */ + return 0; +} + +static inline uint16_t priority_from_ra(uint16_t ra, bool is_11bit) +{ + if (is_11bit) + return (ra & 0x18) >> 3; + + return 0; +} + +static inline bool is_single_block(bool force_two_phase, uint16_t ra, enum ph_burst_type burst_type, bool is_11bit) +{ + bool sb = false; + + if ((ra & 0xf8) == 0x70) + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block allocation\n"); + else if (force_two_phase) + LOGP(DRLCMAC, LOGL_DEBUG, + "MS requests single phase access, but we force two phase access [RACH is %s bit]\n", + is_11bit ? "11" : "8"); + + if (!is_11bit && (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { + + if ((ra & 0xf8) == 0x70) + sb = true; + else if (force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " + "phase access, but we force two phase " + "access\n"); + sb = true; + } + + } else if (is_11bit && + ((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + + if (!(ra & (1 << 10))) { + if (force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH " + "received. MS requests single phase " + "access but we force two phase " + "access\n"); + sb = true; + } else + sb = false; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH received." + "MS requests single block allocation\n"); + sb = true; + } + + } else if (is_11bit && + (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { + LOGP(DRLCMAC, LOGL_ERROR, + "Error: GPRS 11 bit RACH not supported\n"); + + } else if (burst_type == GSM_L1_BURST_TYPE_NONE) { + LOGP(DRLCMAC, LOGL_DEBUG, "pcu has not received burst type " + "from bts \n"); + + if ((ra & 0xf8) == 0x70) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " + "allocation\n"); + sb = true; + } else if (force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " + "phase access, but we force two phase " + "access\n"); + sb = true; + } + } + + return sb; +} + +int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit, enum ph_burst_type burst_type) { struct gprs_rlcmac_ul_tbf *tbf = NULL; @@ -626,8 +708,7 @@ int plen; uint8_t usf = 7; uint8_t tsc = 0, ta = qta2ta(qta); - uint16_t ms_class = 0; - uint16_t priority = 0; + uint16_t ms_class = mslot_class_from_ra(ra, is_11bit); bool failure = false; rach_frame(); @@ -642,7 +723,7 @@ "so we provide one: ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); - sb = is_single_block(ra, burst_type, is_11bit, &ms_class, &priority); + sb = is_single_block(m_bts.force_two_phase, ra, burst_type, is_11bit); if (sb) { rc = sba()->alloc(&trx_no, &ts_no, &sb_fn, ta); @@ -668,14 +749,7 @@ // Create new TBF /* FIXME: Copy and paste with other routines.. */ - if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); - } else { - /* set class to 0, since we don't know the multislot - * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); - } + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, 1); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " @@ -732,73 +806,6 @@ bitvec_free(immediate_assignment); return rc; -} - -uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type, - uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority) -{ - uint8_t sb = 0, val = 0; - - if (!is_11bit && (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { - - if ((ra & 0xf8) == 0x70) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " - "allocation\n"); - sb = 1; - } else if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " - "phase access, but we force two phase " - "access\n"); - sb = 1; - } - - } else if (is_11bit && - ((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || - (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { - - val = !!(ra & (1 << 10)); - - if (!val) { - if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH " - "received. MS requests single phase " - "access but we force two phase " - "access\n"); - sb = 1; - } else { - sb = 0; - *ms_class = (ra & 0x3e0) >> 5; - *priority = (ra & 0x18) >> 3; - } - - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH received." - "MS requests single block allocation\n"); - sb = 1; - } - - } else if (is_11bit && - (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { - LOGP(DRLCMAC, LOGL_ERROR, - "Error: GPRS 11 bit RACH not supported\n"); - - } else if (burst_type == GSM_L1_BURST_TYPE_NONE) { - LOGP(DRLCMAC, LOGL_DEBUG, "pcu has not received burst type " - "from bts \n"); - - if ((ra & 0xf8) == 0x70) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " - "allocation\n"); - sb = 1; - } else if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " - "phase access, but we force two phase " - "access\n"); - sb = 1; - } - } - - return sb; } void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi) diff --git a/src/bts.h b/src/bts.h index a32e87d..b1724c9 100644 --- a/src/bts.h +++ b/src/bts.h @@ -368,11 +368,9 @@ int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); - uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, - uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority); uint32_t rfn_to_fn(int32_t rfn); - int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, + int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit, enum ph_burst_type burst_type); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); -- To view, visit https://gerrit.osmocom.org/5656 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 17:15:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 5 Jan 2018 17:15:48 +0000 Subject: [PATCH] libosmocore[master]: Use python 3 for utilities Message-ID: Review at https://gerrit.osmocom.org/5657 Use python 3 for utilities There're no python2-specific code in there so we can switch right away without waiting till 2020 for python 2 deprecation. Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc --- M debian/control M utils/conv_codes_gsm.py M utils/conv_gen.py 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/5657/1 diff --git a/debian/control b/debian/control index 64c4870..2a6fd4a 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,7 @@ libpcsclite-dev, pkg-config, libtalloc-dev, - python (>= 2.7.6) + python3 Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/libosmocore.git Vcs-Browser: http://git.osmocom.org/gitweb?p=libosmocore.git;a=summary diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py index eeed4fd..72681e7 100644 --- a/utils/conv_codes_gsm.py +++ b/utils/conv_codes_gsm.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- from conv_gen import ConvolutionalCode from conv_gen import poly diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 6b6b267..d2eda15 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python3 mod_license = """ /* -- To view, visit https://gerrit.osmocom.org/5657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 5 20:20:19 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Fri, 5 Jan 2018 20:20:19 +0000 Subject: osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/5630/2/src/osmo-bsc/osmo_bsc_ctrl.c File src/osmo-bsc/osmo_bsc_ctrl.c: Line 75: } > It's better to use CTRL_CMD_DEFINE_RO to avoid boilerplate. Yes, indeed. Thanks! I got confused and assumed that CTRL_CMD_DEFINE_RO() didn't expand to the function signature I needed, but now realized that it fits my case exactly. Line 90: return CTRL_CMD_REPLY; > If it's unused than why not remove it? There is more unused code which uses this variable. So just removing this line would break the build. I plan to remove this line along with the other code later. I would rather not mix feature additions with lots of code removal in a single changeset -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jan 6 11:28:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 6 Jan 2018 11:28:02 +0000 Subject: libosmocore[master]: Use python 3 for utilities In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 6 19:13:18 2018 From: gerrit-no-reply at lists.osmocom.org (ptrkrysik) Date: Sat, 6 Jan 2018 19:13:18 +0000 Subject: gr-gsm[master]: README.md: Turn URLs into hyperlinks (video, mailing list) In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ptrkrysik Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 6 19:16:47 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Sat, 6 Jan 2018 19:16:47 +0000 Subject: gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 7 00:36:47 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 7 Jan 2018 00:36:47 +0000 Subject: [ABANDON] meta-telephony[201705]: osmo-sgsn: no longer depend on libpcap In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: osmo-sgsn: no longer depend on libpcap ...................................................................... Abandoned Pushed to laforge/nightly -- To view, visit https://gerrit.osmocom.org/5485 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I284c16c1f7abd3b24525b824baca357576f16675 Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sun Jan 7 12:13:12 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:13:12 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5367 to look at the new patch set (#4). TBF: cleanup state flag handling * introduce generic function to check whether particular flag was set for'a TBF and clear it if necessary. Use this instead of clear_poll_timeout_flag() * add function to explicitly set assignment and appropriate state flags Overall this makes the code easier to read and debug. Related: OS#1759 Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 --- 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, 36 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/5367/4 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..892ce19 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1031,7 +1031,7 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { /* We now know that the PACCH really existed */ LOGPTBF(new_tbf, LOGL_INFO, "The TBF has been confirmed on the PACCH, " @@ -1042,12 +1042,9 @@ new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - } + tbf_assign_control_ts(new_tbf); return; } @@ -1068,12 +1065,9 @@ 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 (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - } + tbf_assign_control_ts(new_tbf); /* there might be LLC packets waiting in the queue, but the DL * TBF might have been released while the UL TBF has been diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..625181f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,8 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -1511,8 +1510,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); + ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); 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 40ed974..26dce72 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,8 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state); + bool check_n_clear(uint8_t state_flag); + void set_assigned_on(uint8_t state_flag, bool check_ccch); const char *state_name() const; const char *name() const; @@ -371,12 +373,33 @@ return tbf_state_name[state]; } +/* Set assignment state and corrsponding flags */ +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +{ + set_state(GPRS_RLCMAC_ASSIGN); + if (check_ccch) { + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + state_flags |= (1 << state_flag); + } else + state_flags |= (1 << state_flag); +} + inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) { LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; +} + +inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) +{ + if ((state_flags & (1 << state_flag))) { + state_flags &= ~(1 << state_flag); + return true; + } + + return false; } inline LListHead& gprs_rlcmac_tbf::list() @@ -454,7 +477,7 @@ int rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn, struct bitvec *rbb); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); void trigger_ass(struct gprs_rlcmac_tbf *old_tbf); - void clear_poll_timeout_flag(); + bool handle_ack_nack(); void request_dl_ack(); bool need_control_ts() const; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 84f6166..c0ee806 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,9 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -505,8 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -634,18 +631,12 @@ return bsn; } -void gprs_rlcmac_dl_tbf::clear_poll_timeout_flag() -{ - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); -} - bool gprs_rlcmac_dl_tbf::handle_ack_nack() { bool ack_recovered = false; state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - clear_poll_timeout_flag(); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ACK)) { ack_recovered = true; } @@ -856,7 +847,7 @@ if (is_final) T_START(this, T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true); - clear_poll_timeout_flag(); + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); /* clear poll timeout flag */ /* Clear request flag */ m_dl_ack_requested = false; diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 45de7cd..6442b8f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -96,10 +96,8 @@ bool gprs_rlcmac_ul_tbf::ctrl_ack_to_toggle() { - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ACK)) return true; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was set, now cleared */ - } state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); return false; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was unset, now set */ -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 4 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 Sun Jan 7 12:15:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:15:19 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: log source of state transitions 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/5209 to look at the new patch set (#4). TBF: log source of state transitions We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#1759 --- 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.cpp 6 files changed, 24 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/5209/4 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..60dc285 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -685,7 +685,7 @@ failure = true; } else { tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); @@ -1039,7 +1039,7 @@ new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); if ((new_tbf->state_flags & @@ -1067,7 +1067,7 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ASS))) { new_tbf->state_flags &= diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..3f9ca70 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,7 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(tbf, GPRS_RLCMAC_ASSIGN); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); @@ -723,7 +723,7 @@ m_n3101++; if (m_n3101 == bts->bts_data()->n3101) { LOGP(DRLCMAC, LOGL_NOTICE, " N3101 exceeded MAX (%u)\n", bts->bts_data()->n3101); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); return; } @@ -741,7 +741,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); - ul_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_RELEASING); T_START(ul_tbf, T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); return; } @@ -763,7 +763,7 @@ bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pua_poll_failed(); @@ -785,7 +785,7 @@ bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pda_poll_failed(); @@ -811,7 +811,7 @@ } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - dl_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_RELEASING); T_START(dl_tbf, T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); @@ -1102,7 +1102,7 @@ if (!dl_tbf->upgrade_to_multislot) { /* change state to FLOW, so scheduler * will start transmission */ - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); return; } @@ -1238,7 +1238,7 @@ 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); + TBF_SET_STATE(new_dl_tbf, GPRS_RLCMAC_FLOW); tbf_assign_control_ts(new_dl_tbf); /* stop pending assignment timer */ new_dl_tbf->t_stop(T0, "assignment (DL-TBF)"); @@ -1511,7 +1511,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); - ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_ASSIGN); ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); ul_tbf->set_ms(ms); diff --git a/src/tbf.h b/src/tbf.h index 40ed974..9d932fe 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -171,6 +171,8 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) +#define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) + struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -179,7 +181,7 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; - void set_state(enum gprs_rlcmac_tbf_state new_state); + void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); const char *state_name() const; const char *name() const; @@ -371,9 +373,9 @@ return tbf_state_name[state]; } -inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) +inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line) { - LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 84f6166..080e778 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,7 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(this, GPRS_RLCMAC_ASSIGN); if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); @@ -505,7 +505,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); + TBF_SET_STATE(this, GPRS_RLCMAC_ASSIGN); state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); /* send immediate assignment */ @@ -617,7 +617,7 @@ if (is_final) { request_dl_ack(); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); } /* dequeue next LLC frame, if any */ @@ -1113,7 +1113,7 @@ /* report all outstanding packets as received */ gprs_rlcmac_received_lost(this, received, 0); - set_state(GPRS_RLCMAC_WAIT_RELEASE); + TBF_SET_STATE(this, GPRS_RLCMAC_WAIT_RELEASE); /* start T3193 */ T_START(this, T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, @@ -1147,7 +1147,7 @@ * (partly) encoded in chunk 1 of block V(A). (optional) */ } - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); /* reset rlc states */ m_window.reset(); diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 45de7cd..d8f460e 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -332,7 +332,7 @@ if (rdbi->cv == 0) { LOGP(DRLCMACUL, LOGL_DEBUG, "- Finished with UL " "TBF\n"); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); /* Reset N3103 counter. */ this->m_n3103 = 0; } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 18bbc76..94986f5 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -176,7 +176,7 @@ /* "Establish" the DL TBF */ dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu 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 Sun Jan 7 12:20:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:20:26 +0000 Subject: [PATCH] osmo-pcu[master]: TBF-UL: add simpler test helper In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5337 to look at the new patch set (#5). TBF-UL: add simpler test helper Add function to set both V_R and V_Q values to 0 which is useful for TBF test. Related: OS#1759 Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 --- M src/rlc.h M tests/tbf/TbfTest.cpp 2 files changed, 9 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/37/5337/5 diff --git a/src/rlc.h b/src/rlc.h index b62e3ac..b68ee92 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -342,6 +342,7 @@ const void set_v_r(int); const void set_v_q(int); + void reset_state(); const uint16_t ssn() const; @@ -573,6 +574,12 @@ return is_in_window(bsn) && m_v_n.is_received(bsn) && offset_v_r < ws(); } +inline void gprs_rlc_ul_window::reset_state() +{ + m_v_r = 0; + m_v_q = 0; +} + inline const void gprs_rlc_ul_window::set_v_r(int v_r) { m_v_r = v_r; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 40cb313..44f42b9 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1722,8 +1722,7 @@ "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate URBB with length */ ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class, ul_tbf); @@ -1735,8 +1734,7 @@ send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate CRBB */ bts->ws_base = 128; bts->ws_pdch = 64; -- To view, visit https://gerrit.osmocom.org/5337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 Gerrit-PatchSet: 5 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 Sun Jan 7 12:29:09 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:29:09 +0000 Subject: [PATCH] osmo-sgsn[master]: Fix RAI construction In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5651 to look at the new patch set (#5). Fix RAI construction The gsm48_construct_ra() expect 6-byte buffer while ra_id.digits is 3-byte buffer. The function fills in LAC and RAC as well so we should pass entire struct, not just 'digits' part which only store MCC/MNC. Related: OS#1640 Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Fixes: CID57877, CID57876 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/51/5651/5 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..a880680 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra(aa->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)&aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra(rua->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)&rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 5 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 7 12:32:38 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:32:38 +0000 Subject: [PATCH] libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5652 to look at the new patch set (#4). Add function to properly encode RAI Add gsm48_encode_ra() which takes appropriate struct as [out] parameter instead of generic buffer. Using uint8_t buffer instead of proper struct type prooved to be error-prone - see Coverity CID57877, CID57876. Old gsm48_construct_ra() is made into tiny wrapper around new function. The test output is adjusted because of the change in function return value which was constant and hence ignored anyway. Related: OS#1640 Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 --- M include/osmocom/gprs/gprs_bssgp_bss.h M include/osmocom/gsm/gsm48.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gb/libosmogb.map M src/gsm/gsm48.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 9 files changed, 53 insertions(+), 54 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/52/5652/4 diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index 74211fd..f07ab52 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,6 +26,7 @@ #include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); +uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id); 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/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 424748e..3ebca18 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -39,6 +39,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); +void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d27a94f..7228263 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -161,7 +161,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -169,8 +168,7 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -185,7 +183,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -193,8 +190,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); + if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -209,7 +206,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -217,8 +213,7 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -231,7 +226,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -239,8 +233,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); + if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -259,7 +253,7 @@ uint16_t cid) { /* 6 octets RAC */ - gsm48_construct_ra(buf, raid); + gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); /* 2 octets CID */ osmo_store16be(cid, buf+6); @@ -1215,7 +1209,7 @@ uint16_t drx_params = osmo_htons(pinfo->drx_params); uint8_t mi[10]; int imsi_len = gsm48_generate_mid_from_imsi(mi, pinfo->imsi); - uint8_t ra[6]; + struct gsm48_ra_id ra; if (imsi_len < 2) return -EINVAL; @@ -1241,12 +1235,11 @@ } break; case BSSGP_PAGING_LOCATION_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, ra); + gsm48_encode_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, (const uint8_t *)&ra); break; case BSSGP_PAGING_ROUTEING_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, &pinfo->raid); break; case BSSGP_PAGING_BVCI: { diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 3939e25..c7e5e4d 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -44,6 +44,14 @@ return msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); } +uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id) +{ + struct gsm48_ra_id ra; + + gsm48_encode_ra(&ra, ra_id); + return msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(ra), (const uint8_t *)&ra); +} + /*! GMM-SUSPEND.req (Chapter 10.3.6) */ int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id) @@ -51,7 +59,6 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx SUSPEND (TLLI=0x%04x)\n", tlli); @@ -60,9 +67,7 @@ bgph->pdu_type = BSSGP_PDUT_SUSPEND; bssgp_msgb_tlli_put(msg, tlli); - - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -74,7 +79,6 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx RESUME (TLLI=0x%04x)\n", tlli); @@ -83,9 +87,7 @@ bgph->pdu_type = BSSGP_PDUT_RESUME; bssgp_msgb_tlli_put(msg, tlli); - - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 9a0dba5..83a3621 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -9,6 +9,7 @@ bssgp_msgb_alloc; bssgp_msgb_copy; bssgp_msgb_tlli_put; +bssgp_msgb_ra_put; bssgp_parse_cell_id; bssgp_tx_bvc_block; bssgp_tx_bvc_reset; diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index a7daea4..8876059 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -689,33 +689,34 @@ raid->rac = buf[5]; } +/*! Encode a 3GPP TS 24.008 ? 10.5.5.15 Routing area identification + * \param[out] out Caller-provided packed struct + * \param[in] raid Routing Area ID to be encoded + */ +void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid) +{ + out->lac = osmo_htons(raid->lac); + out->rac = raid->rac; + + out->digits[0] = ((raid->mcc / 100) % 10) | (((raid->mcc / 10) % 10) << 4); + out->digits[1] = raid->mcc % 10; + + if (raid->mnc < 100) { + out->digits[1] |= 0xf0; + out->digits[2] = ((raid->mnc / 10) % 10) | ((raid->mnc % 10) << 4); + } else { + out->digits[1] |= (raid->mnc % 10) << 4; + out->digits[2] = ((raid->mnc / 100) % 10) | (((raid->mnc / 10) % 10) << 4); + } +} + /*! 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; - uint16_t mnc = raid->mnc; - uint16_t _lac; - - buf[0] = ((mcc / 100) % 10) | (((mcc / 10) % 10) << 4); - buf[1] = (mcc % 10); - - /* I wonder who came up with the stupidity of encoding the MNC - * differently depending on how many digits its decimal number has! */ - if (mnc < 100) { - buf[1] |= 0xf0; - buf[2] = ((mnc / 10) % 10) | ((mnc % 10) << 4); - } else { - buf[1] |= (mnc % 10) << 4; - buf[2] = ((mnc / 100) % 10) | (((mnc / 10) % 10) << 4); - } - - _lac = osmo_htons(raid->lac); - memcpy(buf + 3, &_lac, 2); - - buf[5] = raid->rac; + gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); return 6; } diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..5611ba3 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -205,6 +205,7 @@ gsm48_rr_msg_name; gsm48_cc_state_name; gsm48_construct_ra; +gsm48_encode_ra; gsm48_hdr_gmm_cipherable; gsm48_decode_bcd_number; gsm48_decode_bearer_cap; diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 935ec21..77a8822 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -137,8 +137,7 @@ static inline void check_ra(const struct gprs_ra_id *raid) { - uint8_t buf[6]; - int res; + struct gsm48_ra_id ra; struct gprs_ra_id raid0 = { .mnc = 0, .mcc = 0, @@ -146,10 +145,10 @@ .rac = 0, }; - res = gsm48_construct_ra(buf, raid); - printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + gsm48_encode_ra(&ra, raid); + printf("Constructed RA:\n"); - gsm48_parse_ra(&raid0, buf); + gsm48_parse_ra(&raid0, (const uint8_t *)&ra); dump_ra(raid); dump_ra(&raid0); printf("RA test..."); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index f0abfd5..83165fa 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,11 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=121, MCC=77, LAC=666, RAC=5 RA: MNC=121, MCC=77, LAC=666, RAC=5 RA test...passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=98, MCC=84, LAC=11, RAC=89 RA: MNC=98, MCC=84, LAC=11, RAC=89 RA test...passed -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 4 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 Sun Jan 7 12:33:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:33:52 +0000 Subject: [PATCH] libosmocore[master]: Deprecate gsm48_construct_ra() 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/5653 to look at the new patch set (#4). Deprecate gsm48_construct_ra() It's just a tiny wrapper around gsm48_encode_ra() with less strict type signature. Related OS#1640 Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 --- M include/osmocom/gsm/gsm48.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/53/5653/4 diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 3ebca18..69431de 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -40,7 +40,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); -int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); +int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) OSMO_DEPRECATED("Use gsm48_encode_ra() instead"); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 4 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 Sun Jan 7 12:37:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 12:37:26 +0000 Subject: [PATCH] libosmocore[master]: Use python 3 for utilities 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/5657 to look at the new patch set (#2). Use python 3 for utilities There're no python2-specific code in there so we can switch right away without waiting till 2020 for python 2 deprecation. Related: OS#2819 Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc --- M debian/control M utils/conv_codes_gsm.py M utils/conv_gen.py 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/5657/2 diff --git a/debian/control b/debian/control index 64c4870..2a6fd4a 100644 --- a/debian/control +++ b/debian/control @@ -15,7 +15,7 @@ libpcsclite-dev, pkg-config, libtalloc-dev, - python (>= 2.7.6) + python3 Standards-Version: 3.9.8 Vcs-Git: git://git.osmocom.org/libosmocore.git Vcs-Browser: http://git.osmocom.org/gitweb?p=libosmocore.git;a=summary diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py index eeed4fd..72681e7 100644 --- a/utils/conv_codes_gsm.py +++ b/utils/conv_codes_gsm.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -*- from conv_gen import ConvolutionalCode from conv_gen import poly diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 6b6b267..d2eda15 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -1,4 +1,4 @@ -#!/usr/bin/python2 +#!/usr/bin/env python3 mod_license = """ /* -- To view, visit https://gerrit.osmocom.org/5657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Sun Jan 7 15:53:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 15:53:37 +0000 Subject: [PATCH] osmo-bsc[master]: cosmetic: remove duplicated code Message-ID: Review at https://gerrit.osmocom.org/5658 cosmetic: remove duplicated code Change-Id: I16c446ef7dc66769826f6e8ae118d8b07bbf6930 --- M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c 2 files changed, 13 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/58/5658/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 6d01109..d5c8733 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -871,6 +871,13 @@ } } +static inline void print_all_trx(struct vty *vty, const struct gsm_bts *bts) +{ + uint8_t trx_nr; + for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) + trx_dump_vty(vty, gsm_bts_trx_num(bts, trx_nr)); +} + DEFUN(show_trx, show_trx_cmd, "show trx [<0-255>] [<0-255>]", @@ -880,7 +887,6 @@ { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts = NULL; - struct gsm_bts_trx *trx; int bts_nr, trx_nr; if (argc >= 1) { @@ -900,26 +906,17 @@ VTY_NEWLINE); return CMD_WARNING; } - trx = gsm_bts_trx_num(bts, trx_nr); - trx_dump_vty(vty, trx); + trx_dump_vty(vty, gsm_bts_trx_num(bts, trx_nr)); return CMD_SUCCESS; } if (bts) { /* print all TRX in this BTS */ - for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { - trx = gsm_bts_trx_num(bts, trx_nr); - trx_dump_vty(vty, trx); - } + print_all_trx(vty, bts); return CMD_SUCCESS; } - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { - bts = gsm_bts_num(net, bts_nr); - for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { - trx = gsm_bts_trx_num(bts, trx_nr); - trx_dump_vty(vty, trx); - } - } + for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) + print_all_trx(vty, gsm_bts_num(net, bts_nr)); return CMD_SUCCESS; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index ad24a1e..07248fb 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -36,11 +36,8 @@ static bool ts_is_usable(const struct gsm_bts_trx_ts *ts) { - /* FIXME: How does this behave for BS-11 ? */ - if (is_ipaccess_bts(ts->trx->bts)) { - if (!nm_is_running(&ts->mo.nm_state)) - return false; - } + if (!trx_is_usable(ts->trx)) + return false; /* If a TCH/F_PDCH TS is busy changing, it is already taken or not * yet available. */ -- To view, visit https://gerrit.osmocom.org/5658 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16c446ef7dc66769826f6e8ae118d8b07bbf6930 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 7 15:53:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 15:53:37 +0000 Subject: [PATCH] osmo-bsc[master]: RSL: print link state per-TRX Message-ID: Review at https://gerrit.osmocom.org/5659 RSL: print link state per-TRX Change-Id: Ie6fad70b4b11d0bb4927b22e32e842422658ba53 Fixes: OS#2715 --- M src/libbsc/bsc_vty.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/59/5659/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index d5c8733..8281606 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -860,6 +860,7 @@ trx->nominal_power - trx->max_power_red, VTY_NEWLINE); vty_out(vty, " NM State: "); net_dump_nmstate(vty, &trx->mo.nm_state); + vty_out(vty, " RSL State: %s%s", trx->rsl_link? "connected" : "disconnected", VTY_NEWLINE); vty_out(vty, " Baseband Transceiver NM State: "); net_dump_nmstate(vty, &trx->bb_transc.mo.nm_state); if (is_ipaccess_bts(trx->bts)) { -- To view, visit https://gerrit.osmocom.org/5659 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6fad70b4b11d0bb4927b22e32e842422658ba53 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 7 15:53:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 15:53:37 +0000 Subject: [PATCH] osmo-bsc[master]: vty: fix OML link state printing Message-ID: Review at https://gerrit.osmocom.org/5660 vty: fix OML link state printing Always print newline regardless of BTS uptime availability. Change-Id: Ib80049fe66de17bc7acfbb774a30075f40a44dee --- M src/libbsc/bsc_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/60/5660/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 8281606..e60bdaf 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -298,9 +298,9 @@ vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); sec = bts_uptime(bts); if (sec) - vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", - OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60, - VTY_NEWLINE); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60); + vty_out(vty, "%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); -- To view, visit https://gerrit.osmocom.org/5660 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib80049fe66de17bc7acfbb774a30075f40a44dee Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 7 16:23:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 7 Jan 2018 16:23:57 +0000 Subject: [PATCH] osmo-bsc[master]: Make extended tests work with any python version Message-ID: Review at https://gerrit.osmocom.org/5661 Make extended tests work with any python version Previously vty and ctrl tests were only compatible with python2. Make it work with either v2 or v3 and adjust ./configure check accordingly. Change-Id: Ib6f845420c0b23f81b076ef6a403d5969260811a Related: OS#2819 --- M configure.ac M tests/ctrl_test_runner.py M tests/vty_test_runner.py 3 files changed, 45 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/61/5661/1 diff --git a/configure.ac b/configure.ac index d756970..f618c0d 100644 --- a/configure.ac +++ b/configure.ac @@ -127,10 +127,7 @@ [Include the VTY/CTRL tests in make check [default=no]]), [enable_ext_tests="$enableval"],[enable_ext_tests="no"]) if test "x$enable_ext_tests" = "xyes" ; then - AC_CHECK_PROG(PYTHON2_AVAIL,python2,yes) - if test "x$PYTHON2_AVAIL" != "xyes" ; then - AC_MSG_ERROR([Please install python2 to run the VTY/CTRL tests.]) - fi + AM_PATH_PYTHON AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmotestvty.py,yes) if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.]) diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py index 4f5df39..6382fa5 100755 --- a/tests/ctrl_test_runner.py +++ b/tests/ctrl_test_runner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # (C) 2013 by Jacob Erlbeck # (C) 2014 by Holger Hans Peter Freyther @@ -19,7 +19,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import print_function import os import time import unittest @@ -53,8 +53,8 @@ try: self.proc = osmoutil.popen_devnull(osmo_ctrl_cmd) except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Consider setting -b", file=sys.stderr) time.sleep(2) appstring = self.ctrl_app()[2] @@ -72,7 +72,7 @@ def connect(self, host, port): if verbose: - print "Connecting to host %s:%i" % (host, port) + print("Connecting to host %s:%i" % (host, port)) retries = 30 while True: @@ -92,7 +92,7 @@ def send(self, data): if verbose: - print "Sending \"%s\"" %(data) + print("Sending \"%s\"" %(data)) data = Ctrl().add_header(data) return self.sock.send(data) == len(data) @@ -123,7 +123,7 @@ (head, data) = IPA().split_combined(data) answer = Ctrl().rem_header(head) if verbose: - print "Got message:", answer + print("Got message:", answer) (mtype, id, msg) = answer.split(None, 2) id = int(id) rsp = {'mtype': mtype, 'id': id} @@ -139,7 +139,7 @@ responses[id] = rsp if verbose: - print "Decoded replies: ", responses + print("Decoded replies: ", responses) return responses @@ -560,9 +560,9 @@ if args.p: confpath = args.p - print "confpath %s, workdir %s" % (confpath, workdir) + print("confpath %s, workdir %s" % (confpath, workdir)) os.chdir(workdir) - print "Running tests for specific control commands" + print("Running tests for specific control commands") suite = unittest.TestSuite() add_bsc_test(suite, workdir) add_nat_test(suite, workdir) diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index 387ea70..ac6f1de 100755 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python # (C) 2013 by Katerina Barone-Adesi # (C) 2013 by Holger Hans Peter Freyther @@ -14,7 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +from __future__ import print_function import os, sys import time import unittest @@ -54,8 +54,8 @@ try: self.proc = osmoutil.popen_devnull(osmo_vty_cmd) except OSError: - print >> sys.stderr, "Current directory: %s" % os.getcwd() - print >> sys.stderr, "Consider setting -b" + print("Current directory: %s" % os.getcwd(), file=sys.stderr) + print("Consider setting -b", file=sys.stderr) appstring = self.vty_app()[2] appport = self.vty_app()[0] @@ -444,33 +444,33 @@ ussdSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ussdSocket.connect(('127.0.0.1', 5001)) ussdSocket.settimeout(2.0) - print "Connected to %s:%d" % ussdSocket.getpeername() + print("Connected to %s:%d" % ussdSocket.getpeername()) - print "Expecting ID_GET request" + print("Expecting ID_GET request") data = ussdSocket.recv(4) self.assertEqual(data, "\x00\x01\xfe\x04") - print "Going to send ID_RESP response" + print("Going to send ID_RESP response") res = ussdSocket.send(IPA().id_resp(IPA().tag_name('key'))) self.assertEqual(res, 10) # initiating PING/PONG cycle to know, that the ID_RESP message has been processed - print "Going to send PING request" + print("Going to send PING request") res = ussdSocket.send(IPA().ping()) self.assertEqual(res, 4) - print "Expecting PONG response" + print("Expecting PONG response") data = ussdSocket.recv(4) self.assertEqual(data, "\x00\x01\xfe\x01") res = self.vty.verify("show ussd-connection", ['The USSD side channel provider is connected and authorized.']) self.assertTrue(res) - print "Going to shut down connection" + print("Going to shut down connection") ussdSocket.shutdown(socket.SHUT_WR) - print "Expecting EOF" + print("Expecting EOF") data = ussdSocket.recv(4) self.assertEqual(data, "") @@ -548,11 +548,11 @@ msc.bind((ip, port)) msc.listen(5) if (verbose): - print "MSC is ready at " + ip + print("MSC is ready at " + ip) conn = None while True: vty_response = x.vty.command("show msc connection") - print "'show msc connection' says: %r" % vty_response + print("'show msc connection' says: %r" % vty_response) if vty_response == "MSC is connected: 1": # success break; @@ -564,10 +564,10 @@ while timeout_retries > 0: try: conn, addr = msc.accept() - print "MSC got connection from ", addr + print("MSC got connection from ", addr) break except socket.timeout: - print "socket timed out." + print("socket timed out.") timeout_retries -= 1 continue @@ -582,42 +582,41 @@ raise Exception("expected to receive 4 bytes, but got %d (%r)" % (len(s)/2, s)) if "0001fe00" == s: if (verbose): - print "\tBSC <- NAT: PING?" + print("\tBSC <- NAT: PING?") x.send(IPA().pong()) elif "0001fe06" == s: if (verbose): - print "\tBSC <- NAT: IPA ID ACK" + print("\tBSC <- NAT: IPA ID ACK") x.send(IPA().id_ack()) elif "0001fe00" == s: if (verbose): - print "\tBSC <- NAT: PONG!" + print("\tBSC <- NAT: PONG!") else: if (verbose): - print "\tBSC <- NAT: ", s + print("\tBSC <- NAT: ", s) def ipa_handle_resp(x, tk, verbose = False, proc=None): s = data2str(x.recv(38)) if "0023fe040108010701020103010401050101010011" in s: retries = 3 while True: - print "\tsending IPA identity(%s) at %s" % (tk, time.strftime("%T")) + print("\tsending IPA identity(%s) at %s" % (tk, time.strftime("%T"))) try: x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8')))) - print "\tdone sending IPA identity(%s) at %s" % (tk, - time.strftime("%T")) + print("\tdone sending IPA identity(%s) at %s" % (tk, time.strftime("%T"))) break except: - print "\tfailed sending IPA identity at", time.strftime("%T") + print("\tfailed sending IPA identity at", time.strftime("%T")) if proc: - print "\tproc.poll() = %r" % proc.poll() + print("\tproc.poll() = %r" % proc.poll()) if retries < 1: - print "\tgiving up" + print("\tgiving up") raise - print "\tretrying (%d attempts left)" % retries + print("\tretrying (%d attempts left)" % retries) retries -= 1 else: if (verbose): - print "\tBSC <- NAT: ", s + print("\tBSC <- NAT: ", s) def nat_bsc_num_con(x): return len(x.vty.command("show bsc connections").split('\n')) @@ -627,18 +626,18 @@ bsc.bind(('127.0.0.1', 0)) bsc.connect(('127.0.0.1', 5000)) if (verbose): - print "BSC%d " %nr - print "\tconnected to %s:%d" % bsc.getpeername() + print("BSC%d " %nr) + print("\tconnected to %s:%d" % bsc.getpeername()) if proc: - print "\tproc.poll() = %r" % proc.poll() - print "\tproc.pid = %r" % proc.pid + print("\tproc.poll() = %r" % proc.poll()) + print("\tproc.pid = %r" % proc.pid) ipa_handle_small(bsc, verbose) ipa_handle_resp(bsc, tk, verbose, proc=proc) if proc: - print "\tproc.poll() = %r" % proc.poll() + print("\tproc.poll() = %r" % proc.poll()) bsc.recv(27) # MGCP msg if proc: - print "\tproc.poll() = %r" % proc.poll() + print("\tproc.poll() = %r" % proc.poll()) ipa_handle_small(bsc, verbose) return bsc @@ -675,9 +674,9 @@ if args.p: confpath = args.p - print "confpath %s, workdir %s" % (confpath, workdir) + print("confpath %s, workdir %s" % (confpath, workdir)) os.chdir(workdir) - print "Running tests for specific VTY commands" + print("Running tests for specific VTY commands") suite = unittest.TestSuite() add_bsc_test(suite, workdir) add_nat_test(suite, workdir) -- To view, visit https://gerrit.osmocom.org/5661 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6f845420c0b23f81b076ef6a403d5969260811a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 7 17:47:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 17:47:57 +0000 Subject: [PATCH] osmo-sgsn[master]: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn Message-ID: Review at https://gerrit.osmocom.org/5662 gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn On 34c3, osmo-sgsn keeps restarting. At least once, it hits the assertion that this patch replaces with an error message, to not disrupt operation. Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 --- M src/gprs/gprs_llc.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/62/5662/1 diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 1a7cf3d..6c92f83 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -372,8 +372,15 @@ dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf; /* make sure we only send it to the right llme */ - OSMO_ASSERT(msgb_tlli(msg) == mmctx->gb.llme->tlli - || msgb_tlli(msg) == mmctx->gb.llme->old_tlli); + if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli + || msgb_tlli(msg) == mmctx->gb.llme->old_tlli)) { + LOGP(DLLC, LOGL_ERROR, + "_bssgp_tx_dl_ud(): Attempt to send Downlink Unitdata to wrong LLME:" + " msgb_tlli=0x%x mmctx->gb.llme->tlli=0x%x ->old_tlli=0x%x\n", + msgb_tlli(msg), mmctx->gb.llme->tlli, mmctx->gb.llme->old_tlli); + msgb_free(msg); + return -EINVAL; + } } memcpy(&dup.qos_profile, qos_profile_default, sizeof(qos_profile_default)); -- To view, visit https://gerrit.osmocom.org/5662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 7 18:00:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 18:00:15 +0000 Subject: osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams In-Reply-To: References: Message-ID: Patch Set 18: (3 comments) updates from 34c3... https://gerrit.osmocom.org/#/c/4980/18/src/libmsc/msc_mgcp.c File src/libmsc/msc_mgcp.c: Line 141: static void handle_error(struct mgcp_ctx *mgcp_ctx, enum msc_mgcp_cause_code cause) on 34c3 I noticed that error logging doesn't convey the actual source of the error, so I added http://git.osmocom.org/osmo-msc/commit/?h=neels/34c3&id=f291d2f007f00f466b3c3299864b79997b13395d which logs file and line of the handle_error() caller Line 929: OSMO_ASSERT(conn); on 34c3 we apparently saw the need to add http://git.osmocom.org/osmo-msc/commit/?h=34c3&id=d251b5379c1c9309f37ab159275ad2e9694a6c38 an assert would crash the MSC, maybe that 34c3 patch would be better? not sure why conn==NULL would be hit though. Line 953: on 34c3 we apparently saw the need for http://git.osmocom.org/osmo-msc/commit/?h=34c3&id=02dd4425a01b0fab069acfe3a2940d9e5e7fc085 -- To view, visit https://gerrit.osmocom.org/4980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 Gerrit-PatchSet: 18 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jan 7 18:04:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 18:04:21 +0000 Subject: [PATCH] osmo-msc[master]: smpp_smsc.c: don't talloc_strdup NULL pointers Message-ID: Review at https://gerrit.osmocom.org/5663 smpp_smsc.c: don't talloc_strdup NULL pointers Change-Id: Ie6a83a20464a959cf51f999d6f900fa4516ced1b --- M src/libmsc/smpp_smsc.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/63/5663/1 diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 34b93f8..f9fef8b 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -974,7 +974,7 @@ talloc_free((void*)smsc->bind_addr); smsc->bind_addr = NULL; if (bind_addr) { - smsc->bind_addr = talloc_strdup(smsc, bind_addr); + smsc->bind_addr = bind_addr ? talloc_strdup(smsc, bind_addr) : NULL; if (!smsc->bind_addr) return -ENOMEM; } -- To view, visit https://gerrit.osmocom.org/5663 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6a83a20464a959cf51f999d6f900fa4516ced1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 7 18:05:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 18:05:32 +0000 Subject: [PATCH] osmo-msc[master]: a_iface_tx_assignment: fix log lvl for "Sending Assignment..." Message-ID: Review at https://gerrit.osmocom.org/5664 a_iface_tx_assignment: fix log lvl for "Sending Assignment..." Change-Id: I42bd3dc601465a4ac6a6e2bf8c4af736547d4838 --- M src/libmsc/a_iface.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/64/5664/1 diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 9dacca5..95d9c91 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -377,7 +377,7 @@ conn = trans->conn; OSMO_ASSERT(conn); - LOGPCONN(conn, LOGL_ERROR, "Sending Assignment Command to BSC\n"); + LOGPCONN(conn, LOGL_DEBUG, "Sending Assignment Command to BSC\n"); /* Channel type */ rc = enc_channel_type(&ct, &trans->bearer_cap); -- To view, visit https://gerrit.osmocom.org/5664 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42bd3dc601465a4ac6a6e2bf8c4af736547d4838 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:29:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:29:12 +0000 Subject: [PATCH] osmo-hlr[master]: ctrl test: fix: adjust expectations after stricter ctrl parsing Message-ID: Review at https://gerrit.osmocom.org/5665 ctrl test: fix: adjust expectations after stricter ctrl parsing After libosmocore I96a9b6b6a3a5e0b80513aa9eaa727ae8c9c7d7a1 the CTRL interface returns stricter errors. Adjust the expectations of test_subscriber_errors.ctrl to fix the external tests on master. Change-Id: I9337b6b4f3fa8822c91760deb01f18a77a073d19 --- M tests/test_subscriber_errors.ctrl 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/65/5665/1 diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl index 55c7480..991d3df 100644 --- a/tests/test_subscriber_errors.ctrl +++ b/tests/test_subscriber_errors.ctrl @@ -62,26 +62,26 @@ ERROR 28 Invalid value part of 'by-xxx-value' selector. GET 29 subscriber.by-id-1+1.info -ERROR 29 Invalid value part of 'by-xxx-value' selector. +ERROR 29 GET variable contains invalid characters GET 30 subscriber.by-id--.info ERROR 30 Invalid value part of 'by-xxx-value' selector. GET 31 subscriber.by-id-+1.info -ERROR 31 Invalid value part of 'by-xxx-value' selector. +ERROR 31 GET variable contains invalid characters GET 32 subscriber.by-id-+-1.info -ERROR 32 Invalid value part of 'by-xxx-value' selector. +ERROR 32 GET variable contains invalid characters GET 33 subscriber.by-id--+1.info -ERROR 33 Invalid value part of 'by-xxx-value' selector. +ERROR 33 GET variable contains invalid characters GET 34 subscriber.by-id-++1.info -ERROR 34 Invalid value part of 'by-xxx-value' selector. +ERROR 34 GET variable contains invalid characters GET 35 subscriber.by-id---1.info ERROR 35 Invalid value part of 'by-xxx-value' selector. GET 36 subscriber.by-id- 1.info -ERROR 36 Command not present. +ERROR 36 GET with trailing characters GET 37 subscriber.by-id-+ 1.info -ERROR 37 Command not present. +ERROR 37 GET variable contains invalid characters GET 38 subscriber.by-id-- 1.info -ERROR 38 Command not present. +ERROR 38 GET with trailing characters SET 39 subscriber.by-imsi-901990000000001.info foo -- To view, visit https://gerrit.osmocom.org/5665 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9337b6b4f3fa8822c91760deb01f18a77a073d19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:33:38 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:33:38 +0000 Subject: [PATCH] osmo-bsc[master]: abisip-find: add --interval option In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5590 to look at the new patch set (#2). abisip-find: add --interval option Change-Id: I9540054bdda185b2585209289cee565f61f33dcf --- M src/ipaccess/abisip-find.c 1 file changed, 17 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/5590/2 diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c index 4e1d192..0f398b4 100644 --- a/src/ipaccess/abisip-find.c +++ b/src/ipaccess/abisip-find.c @@ -39,10 +39,12 @@ static struct { const char *ifname; + int send_interval; bool list_view; time_t list_view_timeout; } cmdline_opts = { .ifname = NULL, + .send_interval = 5, .list_view = false, .list_view_timeout = 10, }; @@ -53,6 +55,7 @@ printf("Usage: abisip-find [-l] []\n"); printf(" Specify the outgoing network interface,\n" " e.g. 'eth0'\n"); + printf(" -i --interval Send broadcast frames every seconds.\n"); printf(" -l --list-view Instead of printing received responses,\n" " output a sorted list of currently present\n" " base stations and change events.\n"); @@ -67,12 +70,13 @@ int option_index = 0, c; static struct option long_options[] = { {"help", 0, 0, 'h'}, + {"send-interval", 1, 0, 'i'}, {"list-view", 0, 0, 'l'}, {"timeout", 1, 0, 't'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hlt:", + c = getopt_long(argc, argv, "hi:lt:", long_options, &option_index); if (c == -1) break; @@ -81,6 +85,14 @@ case 'h': print_help(); exit(EXIT_SUCCESS); + case 'i': + errno = 0; + cmdline_opts.send_interval = strtoul(optarg, NULL, 10); + if (errno || cmdline_opts.send_interval < 1) { + fprintf(stderr, "Invalid interval value: %s\n", optarg); + exit(EXIT_FAILURE); + } + break; case 't': errno = 0; cmdline_opts.list_view_timeout = strtoul(optarg, NULL, 10); @@ -359,7 +371,7 @@ base_stations_bump(false); - osmo_timer_schedule(&timer, 5, 0); + osmo_timer_schedule(&timer, cmdline_opts.send_interval, 0); } int main(int argc, char **argv) @@ -378,6 +390,8 @@ " network interface, e.g. ``%s eth0''\n", argv[0]); if (!cmdline_opts.list_view) fprintf(stdout, "- You may find the --list-view option convenient.\n"); + else if (cmdline_opts.send_interval >= cmdline_opts.list_view_timeout) + fprintf(stdout, "\nWARNING: the --timeout should be larger than --interval.\n\n"); bfd.cb = bfd_cb; bfd.when = BSC_FD_READ | BSC_FD_WRITE; @@ -394,7 +408,7 @@ } osmo_timer_setup(&timer, timer_cb, &bfd); - osmo_timer_schedule(&timer, 5, 0); + osmo_timer_schedule(&timer, cmdline_opts.send_interval, 0); printf("Trying to find ip.access BTS by broadcast UDP...\n"); -- To view, visit https://gerrit.osmocom.org/5590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9540054bdda185b2585209289cee565f61f33dcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:33:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:33:56 +0000 Subject: osmo-hlr[master]: ctrl test: fix: adjust expectations after stricter ctrl parsing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5665 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9337b6b4f3fa8822c91760deb01f18a77a073d19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:33:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:33:58 +0000 Subject: [MERGED] osmo-hlr[master]: ctrl test: fix: adjust expectations after stricter ctrl parsing In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: ctrl test: fix: adjust expectations after stricter ctrl parsing ...................................................................... ctrl test: fix: adjust expectations after stricter ctrl parsing After libosmocore I96a9b6b6a3a5e0b80513aa9eaa727ae8c9c7d7a1 the CTRL interface returns stricter errors. Adjust the expectations of test_subscriber_errors.ctrl to fix the external tests on master. Change-Id: I9337b6b4f3fa8822c91760deb01f18a77a073d19 --- M tests/test_subscriber_errors.ctrl 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/test_subscriber_errors.ctrl b/tests/test_subscriber_errors.ctrl index 55c7480..991d3df 100644 --- a/tests/test_subscriber_errors.ctrl +++ b/tests/test_subscriber_errors.ctrl @@ -62,26 +62,26 @@ ERROR 28 Invalid value part of 'by-xxx-value' selector. GET 29 subscriber.by-id-1+1.info -ERROR 29 Invalid value part of 'by-xxx-value' selector. +ERROR 29 GET variable contains invalid characters GET 30 subscriber.by-id--.info ERROR 30 Invalid value part of 'by-xxx-value' selector. GET 31 subscriber.by-id-+1.info -ERROR 31 Invalid value part of 'by-xxx-value' selector. +ERROR 31 GET variable contains invalid characters GET 32 subscriber.by-id-+-1.info -ERROR 32 Invalid value part of 'by-xxx-value' selector. +ERROR 32 GET variable contains invalid characters GET 33 subscriber.by-id--+1.info -ERROR 33 Invalid value part of 'by-xxx-value' selector. +ERROR 33 GET variable contains invalid characters GET 34 subscriber.by-id-++1.info -ERROR 34 Invalid value part of 'by-xxx-value' selector. +ERROR 34 GET variable contains invalid characters GET 35 subscriber.by-id---1.info ERROR 35 Invalid value part of 'by-xxx-value' selector. GET 36 subscriber.by-id- 1.info -ERROR 36 Command not present. +ERROR 36 GET with trailing characters GET 37 subscriber.by-id-+ 1.info -ERROR 37 Command not present. +ERROR 37 GET variable contains invalid characters GET 38 subscriber.by-id-- 1.info -ERROR 38 Command not present. +ERROR 38 GET with trailing characters SET 39 subscriber.by-imsi-901990000000001.info foo -- To view, visit https://gerrit.osmocom.org/5665 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9337b6b4f3fa8822c91760deb01f18a77a073d19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:34:16 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:34:16 +0000 Subject: osmo-msc[master]: smpp_smsc.c: don't talloc_strdup NULL pointers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5663 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6a83a20464a959cf51f999d6f900fa4516ced1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:34:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:34:19 +0000 Subject: [MERGED] osmo-msc[master]: smpp_smsc.c: don't talloc_strdup NULL pointers In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: smpp_smsc.c: don't talloc_strdup NULL pointers ...................................................................... smpp_smsc.c: don't talloc_strdup NULL pointers Change-Id: Ie6a83a20464a959cf51f999d6f900fa4516ced1b --- M src/libmsc/smpp_smsc.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/smpp_smsc.c b/src/libmsc/smpp_smsc.c index 34b93f8..f9fef8b 100644 --- a/src/libmsc/smpp_smsc.c +++ b/src/libmsc/smpp_smsc.c @@ -974,7 +974,7 @@ talloc_free((void*)smsc->bind_addr); smsc->bind_addr = NULL; if (bind_addr) { - smsc->bind_addr = talloc_strdup(smsc, bind_addr); + smsc->bind_addr = bind_addr ? talloc_strdup(smsc, bind_addr) : NULL; if (!smsc->bind_addr) return -ENOMEM; } -- To view, visit https://gerrit.osmocom.org/5663 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6a83a20464a959cf51f999d6f900fa4516ced1b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 7 21:37:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:37:39 +0000 Subject: [PATCH] libosmo-sccp[master]: error log: sccp_scoc.c: log failure to create conn_id In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5572 to look at the new patch set (#2). error log: sccp_scoc.c: log failure to create conn_id Tweak the FIXME to clarify that we're lacking a reply to the SCCP user besides log output. Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d --- M src/sccp_scoc.c 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/72/5572/2 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index e0742f9..12c733a 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1623,7 +1623,9 @@ /* Allocate new connection structure */ conn = conn_create_id(inst, prim->u.connect.conn_id); if (!conn) { - /* FIXME: inform user */ + /* FIXME: inform SCCP user with proper reply */ + LOGP(DLSCCP, LOGL_ERROR, "Cannot create conn-id for primitive %s\n", + osmo_scu_prim_name(&prim->oph)); goto out; } conn->user = scu; @@ -1635,7 +1637,8 @@ /* Resolve existing connection structure */ conn = conn_find_by_id(inst, scu_prim_conn_id(prim)); if (!conn) { - /* FIXME: inform user */ + LOGP(DLSCCP, LOGL_ERROR, "Received unknown conn-id %u for primitive %s\n", + scu_prim_conn_id(prim), osmo_scu_prim_name(&prim->oph)); goto out; } break; -- To view, visit https://gerrit.osmocom.org/5572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d 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 Jan 7 21:41:10 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 7 Jan 2018 21:41:10 +0000 Subject: [PATCH] libosmo-sccp[master]: error log: sccp_scoc.c: log failure to create/resolve conn_id In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5572 to look at the new patch set (#3). error log: sccp_scoc.c: log failure to create/resolve conn_id Tweak the FIXMEs to clarify that we're lacking a reply to the SCCP user besides log output. Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d --- M src/sccp_scoc.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/72/5572/3 diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index e0742f9..3de986d 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1623,7 +1623,9 @@ /* Allocate new connection structure */ conn = conn_create_id(inst, prim->u.connect.conn_id); if (!conn) { - /* FIXME: inform user */ + /* FIXME: inform SCCP user with proper reply */ + LOGP(DLSCCP, LOGL_ERROR, "Cannot create conn-id for primitive %s\n", + osmo_scu_prim_name(&prim->oph)); goto out; } conn->user = scu; @@ -1635,7 +1637,9 @@ /* Resolve existing connection structure */ conn = conn_find_by_id(inst, scu_prim_conn_id(prim)); if (!conn) { - /* FIXME: inform user */ + /* FIXME: inform SCCP user with proper reply */ + LOGP(DLSCCP, LOGL_ERROR, "Received unknown conn-id %u for primitive %s\n", + scu_prim_conn_id(prim), osmo_scu_prim_name(&prim->oph)); goto out; } break; -- To view, visit https://gerrit.osmocom.org/5572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d Gerrit-PatchSet: 3 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 Jan 8 10:08:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:42 +0000 Subject: [PATCH] osmo-iuh[master]: iu_client.c: Remove unusued variable Message-ID: Review at https://gerrit.osmocom.org/5666 iu_client.c: Remove unusued variable Change-Id: If841d403010a73722ff69617a51719421febab56 --- M src/iu_client.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/66/5666/1 diff --git a/src/iu_client.c b/src/iu_client.c index 0724220..0f89515 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -678,7 +678,6 @@ uint16_t lac, uint8_t rac, bool is_ps) { struct ranap_iu_rnc *rnc; - int rc; const char *log_msg; int log_level; int paged = 0; @@ -824,4 +823,3 @@ return 0; } - -- To view, visit https://gerrit.osmocom.org/5666 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If841d403010a73722ff69617a51719421febab56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:55 +0000 Subject: [PATCH] osmo-sgsn[master]: tests: sgsn_test: Define wrap APIs with correct parameters Message-ID: Review at https://gerrit.osmocom.org/5667 tests: sgsn_test: Define wrap APIs with correct parameters Fixes following compilation warnings: osmo-sgsn/tests/sgsn/sgsn_test.c: In function ?test_gmm_attach_subscr?: osmo-sgsn/tests/sgsn/sgsn_test.c:1110:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info; ^ osmo-sgsn/tests/sgsn/sgsn_test.c: In function ?test_gmm_attach_subscr_fake_auth?: osmo-sgsn/tests/sgsn/sgsn_test.c:1144:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info_fake_auth; ^ osmo-sgsn/tests/sgsn/sgsn_test.c: In function ?test_gmm_attach_subscr_gsup_auth?: osmo-sgsn/tests/sgsn/sgsn_test.c:1275:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info_gsup_auth; ^ Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90 --- M tests/sgsn/sgsn_test.c 1 file changed, 8 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/67/5667/1 diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 219587a..5743fce 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -1095,7 +1095,9 @@ return rc; }; -int my_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { +int my_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, + const uint8_t *auts_rand) +{ gprs_subscr_update(mmctx->subscr); return 0; }; @@ -1124,7 +1126,8 @@ cleanup_test(); } -int my_subscr_request_auth_info_fake_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_fake_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, + const uint8_t *auts_rand) { /* Fake an authentication */ OSMO_ASSERT(mmctx->subscr); @@ -1210,7 +1213,8 @@ static int auth_info_skip = 0; static int upd_loc_skip = 0; -int my_subscr_request_auth_info_gsup_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_gsup_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, + const uint8_t *auts_rand) { static const uint8_t send_auth_info_res[] = { 0x0a, @@ -1320,7 +1324,7 @@ case OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: /* Send SEND_AUTH_INFO_RESULT */ - return my_subscr_request_auth_info_gsup_auth(NULL); + return my_subscr_request_auth_info_gsup_auth(NULL, NULL, NULL); case OSMO_GSUP_MSGT_PURGE_MS_REQUEST: from_peer.message_type = OSMO_GSUP_MSGT_PURGE_MS_RESULT; -- To view, visit https://gerrit.osmocom.org/5667 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:55 +0000 Subject: [PATCH] osmo-sgsn[master]: cosmetic: tests: sgsn_test: Use proper formatting and remove... Message-ID: Review at https://gerrit.osmocom.org/5668 cosmetic: tests: sgsn_test: Use proper formatting and remove uneeded semicolons Change-Id: I144175b89f8058f6f8dedfa931c6768d9c43b70e --- M tests/sgsn/sgsn_test.c 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/68/5668/1 diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 5743fce..4237349 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -165,7 +165,7 @@ llist_for_each(cur, head) count += 1; - return count; + return count; } static struct msgb *create_msg(const uint8_t *data, size_t len) @@ -1085,7 +1085,8 @@ cleanup_test(); } -int my_subscr_request_update_location(struct sgsn_mm_ctx *mmctx) { +int my_subscr_request_update_location(struct sgsn_mm_ctx *mmctx) +{ int rc; rc = __real_gprs_subscr_request_update_location(mmctx); if (rc == -ENOTSUP) { @@ -1093,14 +1094,14 @@ gprs_subscr_update(mmctx->subscr); } return rc; -}; +} int my_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { gprs_subscr_update(mmctx->subscr); return 0; -}; +} static void test_gmm_attach_subscr(void) { @@ -1135,7 +1136,7 @@ gprs_subscr_update_auth_info(mmctx->subscr); return 0; -}; +} static void test_gmm_attach_subscr_fake_auth(void) { @@ -1178,7 +1179,7 @@ gprs_subscr_update_auth_info(mmctx->subscr); return 0; -}; +} static void test_gmm_attach_subscr_real_auth(void) { -- To view, visit https://gerrit.osmocom.org/5668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I144175b89f8058f6f8dedfa931c6768d9c43b70e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:55 +0000 Subject: [PATCH] osmo-sgsn[master]: gprs_gmm: Remove unused variable Message-ID: Review at https://gerrit.osmocom.org/5669 gprs_gmm: Remove unused variable Fixes following compilation warning: osmo-sgsn/src/gprs/gprs_gmm.c: In function ?gsm48_rx_gmm_service_req?: osmo-sgsn/src/gprs/gprs_gmm.c:1786:10: warning: variable ?ciph_seq_nr? set but not used [-Wunused-but-set-variable] uint8_t ciph_seq_nr, service_type, mi_len, mi_type; ^~~~~~~~~~~ Change-Id: If0819026a99f45df96ee6de26a71c16128e79cb8 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/69/5669/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..9c2d548 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1783,7 +1783,7 @@ { struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg); uint8_t *cur = gh->data, *mi; - uint8_t ciph_seq_nr, service_type, mi_len, mi_type; + uint8_t service_type, mi_len, mi_type; uint32_t tmsi; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; @@ -1799,7 +1799,7 @@ } /* Skip Ciphering key sequence number 10.5.1.2 */ - ciph_seq_nr = *cur & 0x07; + /* uint8_t ciph_seq_nr = *cur & 0x07; */ /* Service type 10.5.5.20 */ service_type = (*cur++ >> 4) & 0x07; -- To view, visit https://gerrit.osmocom.org/5669 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0819026a99f45df96ee6de26a71c16128e79cb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:56 +0000 Subject: [PATCH] osmo-sgsn[master]: cosmetic: gprs_gmm: Remove trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/5670 cosmetic: gprs_gmm: Remove trailing whitespace Change-Id: Ie2466268fbc4699a366856d467660b17e3f7e307 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/70/5670/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 9c2d548..f4591f7 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -688,7 +688,7 @@ expect_res = vec->sres; expect_res_len = sizeof(vec->sres); } - + if (!(vec->auth_types & expect_type)) { LOGMMCTXP(LOGL_ERROR, ctx, "Auth error: auth vector does" " not provide the expected auth type:" @@ -2477,7 +2477,7 @@ /* FIXME: print IPv6 address */ } break; - default: + default: DEBUGPC(DMM, "0x%02x ", req_pdpa[1]); break; } -- To view, visit https://gerrit.osmocom.org/5670 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie2466268fbc4699a366856d467660b17e3f7e307 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:56 +0000 Subject: [PATCH] osmo-sgsn[master]: gprs_gmm: Convert warning message to pragma message Message-ID: Review at https://gerrit.osmocom.org/5671 gprs_gmm: Convert warning message to pragma message This way we can enable -Werror in builds to disallow new compilation warnings being introduced. Change-Id: If2b9a618f4219df9e013095beff52c20aacbc79e --- M src/gprs/gprs_gmm.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/71/5671/1 diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index f4591f7..bc01681 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2808,7 +2808,7 @@ switch (pdisc) { case GSM48_PDISC_MM_GPRS: rc = gsm0408_rcv_gmm(mmctx, msg, NULL, false); -#warning "set drop_cipherable arg for gsm0408_rcv_gmm() from IuPS?" +#pragma message "set drop_cipherable arg for gsm0408_rcv_gmm() from IuPS?" break; case GSM48_PDISC_SM_GPRS: rc = gsm0408_rcv_gsm(mmctx, msg, NULL); -- To view, visit https://gerrit.osmocom.org/5671 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2b9a618f4219df9e013095beff52c20aacbc79e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:56 +0000 Subject: [PATCH] osmo-sgsn[master]: contrib/jenkins.sh: Enable Werror Message-ID: Review at https://gerrit.osmocom.org/5672 contrib/jenkins.sh: Enable Werror This way we make sure new patches won't introduce more compilation warnings because the jenkins job will fail. Change-Id: Idd110c4eaecab5268e1f87c11ba96460bda274ee --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/72/5672/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index a32be1e..09f09f7 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -46,7 +46,7 @@ cd "$base" autoreconf --install --force -./configure --enable-sanitize $SMPP $MGCP $IU --enable-external-tests +./configure --enable-sanitize $SMPP $MGCP $IU --enable-external-tests CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE LD_LIBRARY_PATH="$inst/lib" $MAKE check \ || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/5672 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd110c4eaecab5268e1f87c11ba96460bda274ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:08:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:08:56 +0000 Subject: [PATCH] osmo-sgsn[master]: configure.ac: Enable Wall in CFLAGS Message-ID: Review at https://gerrit.osmocom.org/5673 configure.ac: Enable Wall in CFLAGS Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 --- M configure.ac 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/73/5673/1 diff --git a/configure.ac b/configure.ac index b89c046..bb4df57 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,8 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) +CFLAGS="$CFLAGS -Wall" + AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"]) AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"]) -- To view, visit https://gerrit.osmocom.org/5673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:10:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:10:32 +0000 Subject: [PATCH] osmo-bsc[master]: osmo_bsc_bssap.c: Fix discard of const qualifier in assignment Message-ID: Review at https://gerrit.osmocom.org/5674 osmo_bsc_bssap.c: Fix discard of const qualifier in assignment Fixes following compilation warning: osmo-bsc/src/osmo-bsc/osmo_bsc_bssap.c:442:10: warning: assignment discards ?const? qualifier from pointer target type [-Wdiscarded-qualifiers] enc_key = &data[1]; ^ Change-Id: Ieeab5a822d50ac1267362f57196b80073a7901f9 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/74/5674/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 45861cc..0ecc11c 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -401,7 +401,7 @@ struct msgb *resp; int reject_cause = -1; int include_imeisv = 1; - uint8_t *enc_key; + const uint8_t *enc_key; uint16_t enc_key_len; uint8_t enc_bits_bsc; uint8_t enc_bits_msc; -- To view, visit https://gerrit.osmocom.org/5674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieeab5a822d50ac1267362f57196b80073a7901f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:11:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:11:06 +0000 Subject: osmo-sgsn[master]: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/5662/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: Line 375: if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli Global negation is harder to read and I don't think we use this style anywhere. Why not simply .. != .. && .. != ..? -- To view, visit https://gerrit.osmocom.org/5662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:11:17 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:11:17 +0000 Subject: [PATCH] osmo-bts[master]: oml.c: Fix use of htons instead of ntohs Message-ID: Review at https://gerrit.osmocom.org/5675 oml.c: Fix use of htons instead of ntohs In oml_ipa_mo_set_attr_cell, as well as we do in other set functions in the same file, we want to store a parsed value from a TLV received on the network into a host local structure. We hence need to use ntohs instead of htons. Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/5675/1 diff --git a/src/common/oml.c b/src/common/oml.c index ff6dc41..465c416 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1204,7 +1204,7 @@ if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_BVCI, 2)) bts->gprs.cell.bvci = - htons(tlvp_val16_unal(tp, NM_ATT_IPACC_BVCI)); + ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_BVCI)); if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_RLC_CFG, 9)) { cur = TLVP_VAL(tp, NM_ATT_IPACC_RLC_CFG); -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:15:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:15:45 +0000 Subject: osmo-bsc[master]: osmo_bsc_bssap.c: Fix discard of const qualifier in assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieeab5a822d50ac1267362f57196b80073a7901f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:17:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:17:14 +0000 Subject: osmo-bts[master]: oml.c: Fix use of htons instead of ntohs In-Reply-To: References: Message-ID: Patch Set 1: That's odd. How was it working before? Do we need corresponding fix on the BSC side? -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:17:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:17:37 +0000 Subject: osmo-sgsn[master]: cosmetic: gprs_gmm: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5670 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie2466268fbc4699a366856d467660b17e3f7e307 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Jan 8 10:19:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:19:53 +0000 Subject: osmo-sgsn[master]: gprs_gmm: Convert warning message to pragma message In-Reply-To: References: Message-ID: Patch Set 1: I think we should just drop the warning completely and make a ticket to track the issue (if it's not exist already). Using source code as a tracker replacement never really worked. -- To view, visit https://gerrit.osmocom.org/5671 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2b9a618f4219df9e013095beff52c20aacbc79e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Jan 8 10:20:29 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:20:29 +0000 Subject: osmo-iuh[master]: iu_client.c: Remove unusued variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5666 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If841d403010a73722ff69617a51719421febab56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Jan 8 10:21:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:21:49 +0000 Subject: osmo-sgsn[master]: tests: sgsn_test: Define wrap APIs with correct parameters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5667 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Jan 8 10:24:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 10:24:20 +0000 Subject: osmo-sgsn[master]: configure.ac: Enable Wall in CFLAGS In-Reply-To: References: Message-ID: Patch Set 1: I think this should come before Werror patch. -- To view, visit https://gerrit.osmocom.org/5673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Jan 8 10:33:47 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:33:47 +0000 Subject: osmo-bts[master]: oml.c: Fix use of htons instead of ntohs In-Reply-To: References: Message-ID: Patch Set 1: > That's odd. How was it working before? Do we need corresponding fix > on the BSC side? I'm always confused by bit/byte-order stuff, but afaiu in little-endian hosts, htons and ntohs are actually the same function which basically do a swap between first and second byte, so the result is the same if you use htons and ntohs, but from code reader point of view, ntohs makes more sense here and it's the one used in similar places in the same file. -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Mon Jan 8 10:43:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 10:43:01 +0000 Subject: osmo-sgsn[master]: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5662/1/src/gprs/gprs_llc.c File src/gprs/gprs_llc.c: Line 375: if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli > Global negation is harder to read and I don't think we use this style anywh to show that the patch does not modify the condition. -- To view, visit https://gerrit.osmocom.org/5662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 10:59:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 10:59:43 +0000 Subject: [PATCH] meta-telephony[201705]: meta-toolchain-osmo: Create valid symlink indepdenent of pok... Message-ID: Review at https://gerrit.osmocom.org/5676 meta-toolchain-osmo: Create valid symlink indepdenent of poky version Some automated jenkins jobs may want to download latest generated SDK built nightly with latest poky version. As the SDK filename depends on the poky version, if the poky version is bumped (eg. 2.3.1->2.3.2) then the jenkins job may not be able to find the SDK file anymore. Let's create a symlink which doesn't depend on poky version to let those jobs easily download latest SDK no matter the poky version used. Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a --- M recipes-osmocom/meta/meta-toolchain-osmo.bb 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/76/5676/1 diff --git a/recipes-osmocom/meta/meta-toolchain-osmo.bb b/recipes-osmocom/meta/meta-toolchain-osmo.bb index a8dc39d..2a4f9c6 100644 --- a/recipes-osmocom/meta/meta-toolchain-osmo.bb +++ b/recipes-osmocom/meta/meta-toolchain-osmo.bb @@ -1,7 +1,8 @@ TOOLCHAIN_TARGET_OSMOTASK ?= "packagegroup-core-standalone-osmo-sdk-target" TOOLCHAIN_TARGET_TASK = "${TOOLCHAIN_TARGET_OSMOTASK}" -TOOLCHAIN_OUTPUT_BASENAME = "${SDK_NAME}-toolchain-osmo-${DISTRO_VERSION}" -TOOLCHAIN_OUTPUTNAME = "${TOOLCHAIN_OUTPUT_BASENAME}-${DATETIME}" +TOOLCHAIN_OUTPUT_BASENAME = "${SDK_NAME}-toolchain-osmo" +TOOLCHAIN_OUTPUT_VERNAME = "${TOOLCHAIN_OUTPUT_BASENAME}-${DISTRO_VERSION}" +TOOLCHAIN_OUTPUTNAME = "${TOOLCHAIN_OUTPUT_VERNAME}-${DATETIME}" TOOLCHAIN_OUTPUTNAME[vardepsexclude] = "DATETIME" TOOLCHAIN_HOST_TASK_append = " nativesdk-python-argparse" PROVIDES = "meta-toolchain-sdk" @@ -15,6 +16,7 @@ create_symlink() { cd ${SDKDEPLOYDIR}/ - rm -f ${TOOLCHAIN_OUTPUT_BASENAME}.sh + rm -f ${TOOLCHAIN_OUTPUT_BASENAME}.sh ${TOOLCHAIN_OUTPUT_VERNAME}.sh + ln -s ${TOOLCHAIN_OUTPUTNAME}.sh ${TOOLCHAIN_OUTPUT_VERNAME}.sh ln -s ${TOOLCHAIN_OUTPUTNAME}.sh ${TOOLCHAIN_OUTPUT_BASENAME}.sh } -- To view, visit https://gerrit.osmocom.org/5676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a Gerrit-PatchSet: 1 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 11:00:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 11:00:40 +0000 Subject: [PATCH] meta-telephony[201705]: meta-toolchain-osmo: Create valid symlink independent of pok... In-Reply-To: References: Message-ID: meta-toolchain-osmo: Create valid symlink independent of poky version Some automated jenkins jobs may want to download latest generated SDK built nightly with latest poky version. As the SDK filename depends on the poky version, if the poky version is bumped (eg. 2.3.1->2.3.2) then the jenkins job may not be able to find the SDK file anymore. Let's create a symlink which doesn't depend on poky version to let those jobs easily download latest SDK no matter the poky version used. Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a --- M recipes-osmocom/meta/meta-toolchain-osmo.bb 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/76/5676/2 diff --git a/recipes-osmocom/meta/meta-toolchain-osmo.bb b/recipes-osmocom/meta/meta-toolchain-osmo.bb index a8dc39d..2a4f9c6 100644 --- a/recipes-osmocom/meta/meta-toolchain-osmo.bb +++ b/recipes-osmocom/meta/meta-toolchain-osmo.bb @@ -1,7 +1,8 @@ TOOLCHAIN_TARGET_OSMOTASK ?= "packagegroup-core-standalone-osmo-sdk-target" TOOLCHAIN_TARGET_TASK = "${TOOLCHAIN_TARGET_OSMOTASK}" -TOOLCHAIN_OUTPUT_BASENAME = "${SDK_NAME}-toolchain-osmo-${DISTRO_VERSION}" -TOOLCHAIN_OUTPUTNAME = "${TOOLCHAIN_OUTPUT_BASENAME}-${DATETIME}" +TOOLCHAIN_OUTPUT_BASENAME = "${SDK_NAME}-toolchain-osmo" +TOOLCHAIN_OUTPUT_VERNAME = "${TOOLCHAIN_OUTPUT_BASENAME}-${DISTRO_VERSION}" +TOOLCHAIN_OUTPUTNAME = "${TOOLCHAIN_OUTPUT_VERNAME}-${DATETIME}" TOOLCHAIN_OUTPUTNAME[vardepsexclude] = "DATETIME" TOOLCHAIN_HOST_TASK_append = " nativesdk-python-argparse" PROVIDES = "meta-toolchain-sdk" @@ -15,6 +16,7 @@ create_symlink() { cd ${SDKDEPLOYDIR}/ - rm -f ${TOOLCHAIN_OUTPUT_BASENAME}.sh + rm -f ${TOOLCHAIN_OUTPUT_BASENAME}.sh ${TOOLCHAIN_OUTPUT_VERNAME}.sh + ln -s ${TOOLCHAIN_OUTPUTNAME}.sh ${TOOLCHAIN_OUTPUT_VERNAME}.sh ln -s ${TOOLCHAIN_OUTPUTNAME}.sh ${TOOLCHAIN_OUTPUT_BASENAME}.sh } -- To view, visit https://gerrit.osmocom.org/5676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 11:11:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 11:11:22 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Remove osmotestvty.py from python 3 installation Message-ID: Review at https://gerrit.osmocom.org/5677 Remove osmotestvty.py from python 3 installation This script is actually not python 3 compatible yet despite passing current tests. Let's not install it for python 3 until we can figure out a way to catch this incompatibility with test code. Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Related: OS#2821 --- M setup.py 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/77/5677/1 diff --git a/setup.py b/setup.py index bbb4b93..a91274d 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ elif sys.version_info.major == 3: scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", - "scripts/osmotestvty.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", -- To view, visit https://gerrit.osmocom.org/5677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 11:16:05 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 11:16:05 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Remove osmotestvty.py from python 3 installation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5677 to look at the new patch set (#2). Remove osmotestvty.py from python 3 installation This script is actually not python 3 compatible yet despite passing current tests. Let's not install it for python 3 until we can figure out a way to catch this incompatibility with test code. Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Related: OS#2821 --- M osmopy/__init__.py M setup.py 2 files changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/77/5677/2 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index b1b0651..d3d3005 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.0.6' +__version__ = '0.0.7' __all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] diff --git a/setup.py b/setup.py index bbb4b93..a91274d 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ elif sys.version_info.major == 3: scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", - "scripts/osmotestvty.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", -- To view, visit https://gerrit.osmocom.org/5677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 11:39:56 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 11:39:56 +0000 Subject: [PATCH] osmo-ci[master]: Send email on update-* job failures Message-ID: Review at https://gerrit.osmocom.org/5678 Send email on update-* job failures Notify intern@ if either update-osmo-ci or update-osmo-python jobs failed. Those are essential for our CI and test infrastructure so we should look into related failures right away. Change-Id: I0d51e35424a26eab7d38152e13f3ac6fd3f3997c Related: OS#2821 --- M jobs/update-osmo-ci-on-slaves.yml M jobs/update-osmo-python-on-slaves.yml 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/78/5678/1 diff --git a/jobs/update-osmo-ci-on-slaves.yml b/jobs/update-osmo-ci-on-slaves.yml index be93c90..b79751e 100644 --- a/jobs/update-osmo-ci-on-slaves.yml +++ b/jobs/update-osmo-ci-on-slaves.yml @@ -27,4 +27,8 @@ description: | Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! + publishers: + - email: + recipients: intern at lists.sysmocom.de + # vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/update-osmo-python-on-slaves.yml b/jobs/update-osmo-python-on-slaves.yml index e906a53..ce3033d 100644 --- a/jobs/update-osmo-python-on-slaves.yml +++ b/jobs/update-osmo-python-on-slaves.yml @@ -33,5 +33,7 @@ - trigger: project: update-osmo-ci-on-slaves threshold: FAILURE + - email: + recipients: intern at lists.sysmocom.de # vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/5678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d51e35424a26eab7d38152e13f3ac6fd3f3997c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:48:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:48:36 +0000 Subject: python/osmo-python-tests[master]: Remove osmotestvty.py from python 3 installation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:49:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:49:03 +0000 Subject: osmo-ci[master]: Send email on update-* job failures In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d51e35424a26eab7d38152e13f3ac6fd3f3997c 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 Mon Jan 8 12:49:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:49:28 +0000 Subject: meta-telephony[201705]: meta-toolchain-osmo: Create valid symlink independent of pok... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:49:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 12:49:52 +0000 Subject: [PATCH] osmo-bts[master]: Print FN delta on L1 errors Message-ID: Review at https://gerrit.osmocom.org/5679 Print FN delta on L1 errors Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789 --- M src/common/l1sap.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/79/5679/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 18aee93..30c2759 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -458,8 +458,8 @@ frames_expired = info_time_ind->fn - btsb->gsm_time.fn; if (frames_expired > 1) { LOGP(DL1P, LOGL_ERROR, - "Invalid condition detected: Frame difference is %"PRIu32"-%"PRIu32" > 1!\n", - info_time_ind->fn, btsb->gsm_time.fn); + "Invalid condition detected: Frame difference is %"PRIu32"-%"PRIu32"=%d > 1!\n", + info_time_ind->fn, btsb->gsm_time.fn, frames_expired); } /* Update our data structures with the current GSM time */ -- To view, visit https://gerrit.osmocom.org/5679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:50:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:50:22 +0000 Subject: osmo-sgsn[master]: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:50:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:50:40 +0000 Subject: osmo-bts[master]: Print FN delta on L1 errors In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789 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 Mon Jan 8 12:52:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:52:16 +0000 Subject: osmo-mgw[master]: osmo-mgw: Use libosmocore socket abstraction In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39d47b8a27f683060a2facf2dbecff8d00c19ce9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:52:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:52:19 +0000 Subject: [MERGED] osmo-mgw[master]: osmo-mgw: Use libosmocore socket abstraction In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-mgw: Use libosmocore socket abstraction ...................................................................... osmo-mgw: Use libosmocore socket abstraction There's no need for us to use the sockets API directly: We have pretty nice socket helper functions in libosmocore, let's make use of them. Change-Id: I39d47b8a27f683060a2facf2dbecff8d00c19ce9 --- M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp/mgcp_network.c M src/osmo-mgw/mgw_main.c 3 files changed, 36 insertions(+), 118 deletions(-) Approvals: Max: 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/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 7e07d00..9fc414d 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -448,7 +449,6 @@ int mgcp_client_connect(struct mgcp_client *mgcp) { - int on; struct sockaddr_in addr; struct osmo_wqueue *wq; int rc; @@ -460,46 +460,19 @@ wq = &mgcp->wq; - wq->bfd.fd = socket(AF_INET, SOCK_DGRAM, 0); - if (wq->bfd.fd < 0) { - LOGP(DLMGCP, LOGL_FATAL, "Failed to create UDP socket errno: %d\n", errno); - return -errno; - } - - on = 1; - if (setsockopt(wq->bfd.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) < 0) { + rc = osmo_sock_init2_ofd(&wq->bfd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + mgcp->actual.local_addr, mgcp->actual.local_port, + mgcp->actual.remote_addr, mgcp->actual.remote_port, + OSMO_SOCK_F_BIND | OSMO_SOCK_F_CONNECT); + if (rc < 0) { LOGP(DLMGCP, LOGL_FATAL, - "Failed to initialize socket for MGCP GW: %s\n", - strerror(errno)); - rc = -errno; + "Failed to initialize socket %s:%u -> %s:%u for MGCP GW: %s\n", + mgcp->actual.local_addr, mgcp->actual.local_port, + mgcp->actual.remote_addr, mgcp->actual.remote_port, strerror(errno)); goto error_close_fd; } - /* bind socket */ - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - inet_aton(mgcp->actual.local_addr, &addr.sin_addr); - addr.sin_port = htons(mgcp->actual.local_port); - if (bind(wq->bfd.fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - LOGP(DLMGCP, LOGL_FATAL, - "Failed to bind for MGCP GW to %s %u\n", - mgcp->actual.local_addr, mgcp->actual.local_port); - rc = -errno; - goto error_close_fd; - } - - /* connect to the remote */ inet_aton(mgcp->actual.remote_addr, &addr.sin_addr); - addr.sin_port = htons(mgcp->actual.remote_port); - if (connect(wq->bfd.fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - LOGP(DLMGCP, LOGL_FATAL, - "Failed to connect to MGCP GW at %s %u: %s\n", - mgcp->actual.remote_addr, mgcp->actual.remote_port, - strerror(errno)); - rc = -errno; - goto error_close_fd; - } - mgcp->remote_addr = htonl(addr.sin_addr.s_addr); osmo_wqueue_init(wq, 10); @@ -508,11 +481,6 @@ wq->read_cb = mgcp_do_read; wq->write_cb = mgcp_do_write; - if (osmo_fd_register(&wq->bfd) != 0) { - LOGP(DLMGCP, LOGL_FATAL, "Failed to register BFD\n"); - rc = -EIO; - goto error_close_fd; - } LOGP(DLMGCP, LOGL_INFO, "MGCP GW connection: %s:%u -> %s:%u\n", mgcp->actual.local_addr, mgcp->actual.local_port, mgcp->actual.remote_addr, mgcp->actual.remote_port); diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index ac7dc67..bd6bec9 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -1118,41 +1117,17 @@ * \returns 0 on success, -1 on ERROR */ int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port) { - struct sockaddr_in addr; - int on = 1; + int rc; - fd->fd = socket(AF_INET, SOCK_DGRAM, 0); - if (fd->fd < 0) { - LOGP(DRTP, LOGL_ERROR, "failed to create UDP port (%s:%i).\n", - source_addr, port); - return -1; - } else { - LOGP(DRTP, LOGL_DEBUG, - "created UDP port (%s:%i).\n", source_addr, port); - } - - if (setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)) != 0) { - LOGP(DRTP, LOGL_ERROR, - "failed to set socket options (%s:%i).\n", source_addr, - port); - return -1; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - inet_aton(source_addr, &addr.sin_addr); - - if (bind(fd->fd, (struct sockaddr *)&addr, sizeof(addr)) < 0) { - close(fd->fd); - fd->fd = -1; + rc = osmo_sock_init2(AF_INET, SOCK_DGRAM, IPPROTO_UDP, source_addr, port, + NULL, 0, OSMO_SOCK_F_BIND); + if (rc < 0) { LOGP(DRTP, LOGL_ERROR, "failed to bind UDP port (%s:%i).\n", source_addr, port); return -1; - } else { - LOGP(DRTP, LOGL_DEBUG, - "bound UDP port (%s:%i).\n", source_addr, port); } + fd->fd = rc; + LOGP(DRTP, LOGL_DEBUG, "created socket + bound UDP port (%s:%i).\n", source_addr, port); return 0; } diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c index 227fc78..ba8883b 100644 --- a/src/osmo-mgw/mgw_main.c +++ b/src/osmo-mgw/mgw_main.c @@ -45,6 +45,7 @@ #include #include #include +#include #include #include @@ -250,8 +251,8 @@ int main(int argc, char **argv) { - struct sockaddr_in addr; - int on = 1, rc; + unsigned int flags; + int rc; tall_bsc_ctx = talloc_named_const(NULL, 1, "mgcp-callagent"); msgb_talloc_ctx_init(tall_bsc_ctx, 0); @@ -289,53 +290,27 @@ cfg->reset_cb = mgcp_rsip_cb; /* we need to bind a socket */ - if (rc == 0) { - cfg->gw_fd.bfd.when = BSC_FD_READ; - cfg->gw_fd.bfd.cb = read_call_agent; - cfg->gw_fd.bfd.fd = socket(AF_INET, SOCK_DGRAM, 0); - if (cfg->gw_fd.bfd.fd < 0) { - perror("Gateway failed to listen"); - return -1; - } + flags = OSMO_SOCK_F_BIND; + if (cfg->call_agent_addr) + flags |= OSMO_SOCK_F_CONNECT; - setsockopt(cfg->gw_fd.bfd.fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(cfg->source_port); - inet_aton(cfg->source_addr, &addr.sin_addr); - - if (bind(cfg->gw_fd.bfd.fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - perror("Gateway failed to bind"); - return -1; - } - - cfg->gw_fd.bfd.data = msgb_alloc(4096, "mgcp-msg"); - if (!cfg->gw_fd.bfd.data) { - fprintf(stderr, "Gateway memory error.\n"); - return -1; - } - - if (cfg->call_agent_addr) { - addr.sin_port = htons(2727); - inet_aton(cfg->call_agent_addr, &addr.sin_addr); - if (connect(cfg->gw_fd.bfd.fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - LOGP(DLMGCP, LOGL_ERROR, "Failed to connect to: '%s'. errno: %d\n", - cfg->call_agent_addr, errno); - close(cfg->gw_fd.bfd.fd); - cfg->gw_fd.bfd.fd = -1; - return -1; - } - } - - if (osmo_fd_register(&cfg->gw_fd.bfd) != 0) { - LOGP(DLMGCP, LOGL_FATAL, "Failed to register the fd\n"); - return -1; - } - - LOGP(DLMGCP, LOGL_NOTICE, "Configured for MGCP.\n"); + rc = osmo_sock_init2_ofd(&cfg->gw_fd.bfd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + cfg->source_addr, cfg->source_port, + cfg->call_agent_addr, cfg->call_agent_addr ? 2727 : 0, flags); + if (rc < 0) { + perror("Gateway failed to bind"); + return -1; } + cfg->gw_fd.bfd.cb = read_call_agent; + cfg->gw_fd.bfd.data = msgb_alloc(4096, "mgcp-msg"); + if (!cfg->gw_fd.bfd.data) { + fprintf(stderr, "Gateway memory error.\n"); + return -1; + } + + LOGP(DLMGCP, LOGL_NOTICE, "Configured for MGCP.\n"); + /* initialisation */ srand(time(NULL)); -- To view, visit https://gerrit.osmocom.org/4900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I39d47b8a27f683060a2facf2dbecff8d00c19ce9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:52:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 12:52:37 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Remove osmotestvty.py from python 3 installation In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove osmotestvty.py from python 3 installation ...................................................................... Remove osmotestvty.py from python 3 installation This script is actually not python 3 compatible yet despite passing current tests. Let's not install it for python 3 until we can figure out a way to catch this incompatibility with test code. Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Related: OS#2821 --- M osmopy/__init__.py M setup.py 2 files changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/osmopy/__init__.py b/osmopy/__init__.py index b1b0651..d3d3005 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.0.6' +__version__ = '0.0.7' __all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] diff --git a/setup.py b/setup.py index bbb4b93..a91274d 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,6 @@ elif sys.version_info.major == 3: scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", - "scripts/osmotestvty.py", "scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", -- To view, visit https://gerrit.osmocom.org/5677 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:52:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:52:48 +0000 Subject: osmo-bts[master]: oml.c: Fix use of htons instead of ntohs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:53:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:53:10 +0000 Subject: osmo-bsc[master]: osmo_bsc_bssap.c: Fix discard of const qualifier in assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieeab5a822d50ac1267362f57196b80073a7901f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc 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 Mon Jan 8 12:53:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:53:16 +0000 Subject: [MERGED] osmo-bsc[master]: osmo_bsc_bssap.c: Fix discard of const qualifier in assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_bsc_bssap.c: Fix discard of const qualifier in assignment ...................................................................... osmo_bsc_bssap.c: Fix discard of const qualifier in assignment Fixes following compilation warning: osmo-bsc/src/osmo-bsc/osmo_bsc_bssap.c:442:10: warning: assignment discards ?const? qualifier from pointer target type [-Wdiscarded-qualifiers] enc_key = &data[1]; ^ Change-Id: Ieeab5a822d50ac1267362f57196b80073a7901f9 --- M src/osmo-bsc/osmo_bsc_bssap.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/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 45861cc..0ecc11c 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -401,7 +401,7 @@ struct msgb *resp; int reject_cause = -1; int include_imeisv = 1; - uint8_t *enc_key; + const uint8_t *enc_key; uint16_t enc_key_len; uint8_t enc_bits_bsc; uint8_t enc_bits_msc; -- To view, visit https://gerrit.osmocom.org/5674 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieeab5a822d50ac1267362f57196b80073a7901f9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:53:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 12:53:40 +0000 Subject: [MERGED] osmo-bts[master]: Print FN delta on L1 errors In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Print FN delta on L1 errors ...................................................................... Print FN delta on L1 errors Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789 --- M src/common/l1sap.c 1 file changed, 2 insertions(+), 2 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 18aee93..30c2759 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -458,8 +458,8 @@ frames_expired = info_time_ind->fn - btsb->gsm_time.fn; if (frames_expired > 1) { LOGP(DL1P, LOGL_ERROR, - "Invalid condition detected: Frame difference is %"PRIu32"-%"PRIu32" > 1!\n", - info_time_ind->fn, btsb->gsm_time.fn); + "Invalid condition detected: Frame difference is %"PRIu32"-%"PRIu32"=%d > 1!\n", + info_time_ind->fn, btsb->gsm_time.fn, frames_expired); } /* Update our data structures with the current GSM time */ -- To view, visit https://gerrit.osmocom.org/5679 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789 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 Mon Jan 8 12:53:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:53:52 +0000 Subject: osmo-sgsn[master]: tests: sgsn_test: Define wrap APIs with correct parameters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5667 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Mon Jan 8 12:54:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:06 +0000 Subject: osmo-sgsn[master]: cosmetic: tests: sgsn_test: Use proper formatting and remove... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I144175b89f8058f6f8dedfa931c6768d9c43b70e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:54:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:13 +0000 Subject: osmo-sgsn[master]: gprs_gmm: Remove unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5669 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0819026a99f45df96ee6de26a71c16128e79cb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:54:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:17 +0000 Subject: osmo-sgsn[master]: cosmetic: gprs_gmm: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5670 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie2466268fbc4699a366856d467660b17e3f7e307 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Mon Jan 8 12:54:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:28 +0000 Subject: osmo-sgsn[master]: gprs_gmm: Convert warning message to pragma message In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5671 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2b9a618f4219df9e013095beff52c20aacbc79e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Mon Jan 8 12:54:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:37 +0000 Subject: [MERGED] osmo-sgsn[master]: gprs_gmm: Convert warning message to pragma message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gprs_gmm: Convert warning message to pragma message ...................................................................... gprs_gmm: Convert warning message to pragma message This way we can enable -Werror in builds to disallow new compilation warnings being introduced. Change-Id: If2b9a618f4219df9e013095beff52c20aacbc79e --- M src/gprs/gprs_gmm.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index f4591f7..bc01681 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -2808,7 +2808,7 @@ switch (pdisc) { case GSM48_PDISC_MM_GPRS: rc = gsm0408_rcv_gmm(mmctx, msg, NULL, false); -#warning "set drop_cipherable arg for gsm0408_rcv_gmm() from IuPS?" +#pragma message "set drop_cipherable arg for gsm0408_rcv_gmm() from IuPS?" break; case GSM48_PDISC_SM_GPRS: rc = gsm0408_rcv_gsm(mmctx, msg, NULL); -- To view, visit https://gerrit.osmocom.org/5671 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2b9a618f4219df9e013095beff52c20aacbc79e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Mon Jan 8 12:54:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:37 +0000 Subject: [MERGED] osmo-sgsn[master]: cosmetic: gprs_gmm: Remove trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: gprs_gmm: Remove trailing whitespace ...................................................................... cosmetic: gprs_gmm: Remove trailing whitespace Change-Id: Ie2466268fbc4699a366856d467660b17e3f7e307 --- M src/gprs/gprs_gmm.c 1 file changed, 2 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/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 9c2d548..f4591f7 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -688,7 +688,7 @@ expect_res = vec->sres; expect_res_len = sizeof(vec->sres); } - + if (!(vec->auth_types & expect_type)) { LOGMMCTXP(LOGL_ERROR, ctx, "Auth error: auth vector does" " not provide the expected auth type:" @@ -2477,7 +2477,7 @@ /* FIXME: print IPv6 address */ } break; - default: + default: DEBUGPC(DMM, "0x%02x ", req_pdpa[1]); break; } -- To view, visit https://gerrit.osmocom.org/5670 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie2466268fbc4699a366856d467660b17e3f7e307 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:54:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:37 +0000 Subject: [MERGED] osmo-sgsn[master]: gprs_gmm: Remove unused variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gprs_gmm: Remove unused variable ...................................................................... gprs_gmm: Remove unused variable Fixes following compilation warning: osmo-sgsn/src/gprs/gprs_gmm.c: In function ?gsm48_rx_gmm_service_req?: osmo-sgsn/src/gprs/gprs_gmm.c:1786:10: warning: variable ?ciph_seq_nr? set but not used [-Wunused-but-set-variable] uint8_t ciph_seq_nr, service_type, mi_len, mi_type; ^~~~~~~~~~~ Change-Id: If0819026a99f45df96ee6de26a71c16128e79cb8 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index ead958e..9c2d548 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -1783,7 +1783,7 @@ { struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg); uint8_t *cur = gh->data, *mi; - uint8_t ciph_seq_nr, service_type, mi_len, mi_type; + uint8_t service_type, mi_len, mi_type; uint32_t tmsi; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; @@ -1799,7 +1799,7 @@ } /* Skip Ciphering key sequence number 10.5.1.2 */ - ciph_seq_nr = *cur & 0x07; + /* uint8_t ciph_seq_nr = *cur & 0x07; */ /* Service type 10.5.5.20 */ service_type = (*cur++ >> 4) & 0x07; -- To view, visit https://gerrit.osmocom.org/5669 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0819026a99f45df96ee6de26a71c16128e79cb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:54:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:38 +0000 Subject: [MERGED] osmo-sgsn[master]: cosmetic: tests: sgsn_test: Use proper formatting and remove... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: tests: sgsn_test: Use proper formatting and remove uneeded semicolons ...................................................................... cosmetic: tests: sgsn_test: Use proper formatting and remove uneeded semicolons Change-Id: I144175b89f8058f6f8dedfa931c6768d9c43b70e --- M tests/sgsn/sgsn_test.c 1 file changed, 7 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 5743fce..4237349 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -165,7 +165,7 @@ llist_for_each(cur, head) count += 1; - return count; + return count; } static struct msgb *create_msg(const uint8_t *data, size_t len) @@ -1085,7 +1085,8 @@ cleanup_test(); } -int my_subscr_request_update_location(struct sgsn_mm_ctx *mmctx) { +int my_subscr_request_update_location(struct sgsn_mm_ctx *mmctx) +{ int rc; rc = __real_gprs_subscr_request_update_location(mmctx); if (rc == -ENOTSUP) { @@ -1093,14 +1094,14 @@ gprs_subscr_update(mmctx->subscr); } return rc; -}; +} int my_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, const uint8_t *auts_rand) { gprs_subscr_update(mmctx->subscr); return 0; -}; +} static void test_gmm_attach_subscr(void) { @@ -1135,7 +1136,7 @@ gprs_subscr_update_auth_info(mmctx->subscr); return 0; -}; +} static void test_gmm_attach_subscr_fake_auth(void) { @@ -1178,7 +1179,7 @@ gprs_subscr_update_auth_info(mmctx->subscr); return 0; -}; +} static void test_gmm_attach_subscr_real_auth(void) { -- To view, visit https://gerrit.osmocom.org/5668 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I144175b89f8058f6f8dedfa931c6768d9c43b70e Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:54:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:54:38 +0000 Subject: [MERGED] osmo-sgsn[master]: tests: sgsn_test: Define wrap APIs with correct parameters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: sgsn_test: Define wrap APIs with correct parameters ...................................................................... tests: sgsn_test: Define wrap APIs with correct parameters Fixes following compilation warnings: osmo-sgsn/tests/sgsn/sgsn_test.c: In function ?test_gmm_attach_subscr?: osmo-sgsn/tests/sgsn/sgsn_test.c:1110:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info; ^ osmo-sgsn/tests/sgsn/sgsn_test.c: In function ?test_gmm_attach_subscr_fake_auth?: osmo-sgsn/tests/sgsn/sgsn_test.c:1144:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info_fake_auth; ^ osmo-sgsn/tests/sgsn/sgsn_test.c: In function ?test_gmm_attach_subscr_gsup_auth?: osmo-sgsn/tests/sgsn/sgsn_test.c:1275:30: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] subscr_request_auth_info_cb = my_subscr_request_auth_info_gsup_auth; ^ Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90 --- M tests/sgsn/sgsn_test.c 1 file changed, 8 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/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index 219587a..5743fce 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -1095,7 +1095,9 @@ return rc; }; -int my_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx) { +int my_subscr_request_auth_info(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, + const uint8_t *auts_rand) +{ gprs_subscr_update(mmctx->subscr); return 0; }; @@ -1124,7 +1126,8 @@ cleanup_test(); } -int my_subscr_request_auth_info_fake_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_fake_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, + const uint8_t *auts_rand) { /* Fake an authentication */ OSMO_ASSERT(mmctx->subscr); @@ -1210,7 +1213,8 @@ static int auth_info_skip = 0; static int upd_loc_skip = 0; -int my_subscr_request_auth_info_gsup_auth(struct sgsn_mm_ctx *mmctx) +int my_subscr_request_auth_info_gsup_auth(struct sgsn_mm_ctx *mmctx, const uint8_t *auts, + const uint8_t *auts_rand) { static const uint8_t send_auth_info_res[] = { 0x0a, @@ -1320,7 +1324,7 @@ case OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST: /* Send SEND_AUTH_INFO_RESULT */ - return my_subscr_request_auth_info_gsup_auth(NULL); + return my_subscr_request_auth_info_gsup_auth(NULL, NULL, NULL); case OSMO_GSUP_MSGT_PURGE_MS_REQUEST: from_peer.message_type = OSMO_GSUP_MSGT_PURGE_MS_RESULT; -- To view, visit https://gerrit.osmocom.org/5667 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fcb3d460d8becb4cc917fc8d27bfc7e49d50b90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:55:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 12:55:08 +0000 Subject: osmo-bts[master]: oml.c: Fix use of htons instead of ntohs In-Reply-To: References: Message-ID: Patch Set 1: > in little-endian hosts, htons and ntohs are actually the same function Does it mean that on BE host it won't work? Nor sure if anyone ever tested it actually, just curious because it confuses me too. -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:55:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:55:48 +0000 Subject: libosmo-sccp[master]: error log: sccp_scoc.c: log failure to create/resolve conn_id In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d Gerrit-PatchSet: 3 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 Jan 8 12:55:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:55:52 +0000 Subject: [MERGED] libosmo-sccp[master]: error log: sccp_scoc.c: log failure to create/resolve conn_id In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: error log: sccp_scoc.c: log failure to create/resolve conn_id ...................................................................... error log: sccp_scoc.c: log failure to create/resolve conn_id Tweak the FIXMEs to clarify that we're lacking a reply to the SCCP user besides log output. Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d --- M src/sccp_scoc.c 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sccp_scoc.c b/src/sccp_scoc.c index e0742f9..3de986d 100644 --- a/src/sccp_scoc.c +++ b/src/sccp_scoc.c @@ -1623,7 +1623,9 @@ /* Allocate new connection structure */ conn = conn_create_id(inst, prim->u.connect.conn_id); if (!conn) { - /* FIXME: inform user */ + /* FIXME: inform SCCP user with proper reply */ + LOGP(DLSCCP, LOGL_ERROR, "Cannot create conn-id for primitive %s\n", + osmo_scu_prim_name(&prim->oph)); goto out; } conn->user = scu; @@ -1635,7 +1637,9 @@ /* Resolve existing connection structure */ conn = conn_find_by_id(inst, scu_prim_conn_id(prim)); if (!conn) { - /* FIXME: inform user */ + /* FIXME: inform SCCP user with proper reply */ + LOGP(DLSCCP, LOGL_ERROR, "Received unknown conn-id %u for primitive %s\n", + scu_prim_conn_id(prim), osmo_scu_prim_name(&prim->oph)); goto out; } break; -- To view, visit https://gerrit.osmocom.org/5572 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib235ff8e264aaf0c2e9794f464a3ba7b54816f3d Gerrit-PatchSet: 3 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 Jan 8 12:55:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 12:55:52 +0000 Subject: meta-telephony[201705]: meta-toolchain-osmo: Create valid symlink independent of pok... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 I'll update nightly jenkins job once this is merged and sdk is rebuilt. -- To view, visit https://gerrit.osmocom.org/5676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:56:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:56:11 +0000 Subject: osmo-bsc[master]: abisip-find: add --interval option In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9540054bdda185b2585209289cee565f61f33dcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:56:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:56:12 +0000 Subject: [MERGED] osmo-bsc[master]: abisip-find: add --interval option In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abisip-find: add --interval option ...................................................................... abisip-find: add --interval option Change-Id: I9540054bdda185b2585209289cee565f61f33dcf --- M src/ipaccess/abisip-find.c 1 file changed, 17 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ipaccess/abisip-find.c b/src/ipaccess/abisip-find.c index 4e1d192..0f398b4 100644 --- a/src/ipaccess/abisip-find.c +++ b/src/ipaccess/abisip-find.c @@ -39,10 +39,12 @@ static struct { const char *ifname; + int send_interval; bool list_view; time_t list_view_timeout; } cmdline_opts = { .ifname = NULL, + .send_interval = 5, .list_view = false, .list_view_timeout = 10, }; @@ -53,6 +55,7 @@ printf("Usage: abisip-find [-l] []\n"); printf(" Specify the outgoing network interface,\n" " e.g. 'eth0'\n"); + printf(" -i --interval Send broadcast frames every seconds.\n"); printf(" -l --list-view Instead of printing received responses,\n" " output a sorted list of currently present\n" " base stations and change events.\n"); @@ -67,12 +70,13 @@ int option_index = 0, c; static struct option long_options[] = { {"help", 0, 0, 'h'}, + {"send-interval", 1, 0, 'i'}, {"list-view", 0, 0, 'l'}, {"timeout", 1, 0, 't'}, {0, 0, 0, 0} }; - c = getopt_long(argc, argv, "hlt:", + c = getopt_long(argc, argv, "hi:lt:", long_options, &option_index); if (c == -1) break; @@ -81,6 +85,14 @@ case 'h': print_help(); exit(EXIT_SUCCESS); + case 'i': + errno = 0; + cmdline_opts.send_interval = strtoul(optarg, NULL, 10); + if (errno || cmdline_opts.send_interval < 1) { + fprintf(stderr, "Invalid interval value: %s\n", optarg); + exit(EXIT_FAILURE); + } + break; case 't': errno = 0; cmdline_opts.list_view_timeout = strtoul(optarg, NULL, 10); @@ -359,7 +371,7 @@ base_stations_bump(false); - osmo_timer_schedule(&timer, 5, 0); + osmo_timer_schedule(&timer, cmdline_opts.send_interval, 0); } int main(int argc, char **argv) @@ -378,6 +390,8 @@ " network interface, e.g. ``%s eth0''\n", argv[0]); if (!cmdline_opts.list_view) fprintf(stdout, "- You may find the --list-view option convenient.\n"); + else if (cmdline_opts.send_interval >= cmdline_opts.list_view_timeout) + fprintf(stdout, "\nWARNING: the --timeout should be larger than --interval.\n\n"); bfd.cb = bfd_cb; bfd.when = BSC_FD_READ | BSC_FD_WRITE; @@ -394,7 +408,7 @@ } osmo_timer_setup(&timer, timer_cb, &bfd); - osmo_timer_schedule(&timer, 5, 0); + osmo_timer_schedule(&timer, cmdline_opts.send_interval, 0); printf("Trying to find ip.access BTS by broadcast UDP...\n"); -- To view, visit https://gerrit.osmocom.org/5590 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9540054bdda185b2585209289cee565f61f33dcf Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:56:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:56:24 +0000 Subject: osmo-msc[master]: a_iface_tx_assignment: fix log lvl for "Sending Assignment..." In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5664 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42bd3dc601465a4ac6a6e2bf8c4af736547d4838 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:56:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:56:27 +0000 Subject: [MERGED] osmo-msc[master]: a_iface_tx_assignment: fix log lvl for "Sending Assignment..." In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: a_iface_tx_assignment: fix log lvl for "Sending Assignment..." ...................................................................... a_iface_tx_assignment: fix log lvl for "Sending Assignment..." Change-Id: I42bd3dc601465a4ac6a6e2bf8c4af736547d4838 --- M src/libmsc/a_iface.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 9dacca5..95d9c91 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -377,7 +377,7 @@ conn = trans->conn; OSMO_ASSERT(conn); - LOGPCONN(conn, LOGL_ERROR, "Sending Assignment Command to BSC\n"); + LOGPCONN(conn, LOGL_DEBUG, "Sending Assignment Command to BSC\n"); /* Channel type */ rc = enc_channel_type(&ct, &trans->bearer_cap); -- To view, visit https://gerrit.osmocom.org/5664 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42bd3dc601465a4ac6a6e2bf8c4af736547d4838 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:56:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:56:55 +0000 Subject: osmo-bsc[master]: Make extended tests work with any python version In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5661 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6f845420c0b23f81b076ef6a403d5969260811a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:57:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:57:17 +0000 Subject: libosmocore[master]: Use python 3 for utilities In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:57:30 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 12:57:30 +0000 Subject: osmo-bsc[master]: Make extended tests work with any python version In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Let's not merge this until OS#2821 is fixed. -- To view, visit https://gerrit.osmocom.org/5661 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6f845420c0b23f81b076ef6a403d5969260811a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc 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 Jan 8 12:57:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:57:53 +0000 Subject: osmo-bsc[master]: cosmetic: remove duplicated code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5658 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16c446ef7dc66769826f6e8ae118d8b07bbf6930 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:58:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:58:01 +0000 Subject: osmo-bsc[master]: RSL: print link state per-TRX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5659 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6fad70b4b11d0bb4927b22e32e842422658ba53 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:58:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:58:16 +0000 Subject: osmo-bsc[master]: vty: fix OML link state printing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5660 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib80049fe66de17bc7acfbb774a30075f40a44dee Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:58:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:58:40 +0000 Subject: libosmocore[master]: Use existing function for TLLI encoding In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 12:58:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:58:48 +0000 Subject: libosmocore[master]: Deprecate gsm48_construct_ra() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 4 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 Mon Jan 8 12:58:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:58:54 +0000 Subject: libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 4 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 Mon Jan 8 12:59:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 8 Jan 2018 12:59:23 +0000 Subject: osmo-sgsn[master]: Fix RAI construction In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 5 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:01:38 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:01:38 +0000 Subject: [MERGED] osmo-sgsn[master]: Fix RAI construction In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix RAI construction ...................................................................... Fix RAI construction The gsm48_construct_ra() expect 6-byte buffer while ra_id.digits is 3-byte buffer. The function fills in LAC and RAC as well so we should pass entire struct, not just 'digits' part which only store MCC/MNC. Related: OS#1640 Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Fixes: CID57877, CID57876 --- M src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index bc01681..77a5537 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra(aa->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)&aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra(rua->ra_id.digits, &mm->ra); + gsm48_construct_ra((uint8_t *)&rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ -- To view, visit https://gerrit.osmocom.org/5651 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3bfda930012c792452f9fd695ed7acf46365f1df Gerrit-PatchSet: 6 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:02:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:02:08 +0000 Subject: [MERGED] libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add function to properly encode RAI ...................................................................... Add function to properly encode RAI Add gsm48_encode_ra() which takes appropriate struct as [out] parameter instead of generic buffer. Using uint8_t buffer instead of proper struct type prooved to be error-prone - see Coverity CID57877, CID57876. Old gsm48_construct_ra() is made into tiny wrapper around new function. The test output is adjusted because of the change in function return value which was constant and hence ignored anyway. Related: OS#1640 Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 --- M include/osmocom/gprs/gprs_bssgp_bss.h M include/osmocom/gsm/gsm48.h M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M src/gb/libosmogb.map M src/gsm/gsm48.c M src/gsm/libosmogsm.map M tests/gsm0408/gsm0408_test.c M tests/gsm0408/gsm0408_test.ok 9 files changed, 53 insertions(+), 54 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h index 74211fd..f07ab52 100644 --- a/include/osmocom/gprs/gprs_bssgp_bss.h +++ b/include/osmocom/gprs/gprs_bssgp_bss.h @@ -26,6 +26,7 @@ #include uint8_t *bssgp_msgb_tlli_put(struct msgb *msg, uint32_t tlli); +uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id); 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/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 424748e..3ebca18 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -39,6 +39,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); +void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c index d27a94f..7228263 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -161,7 +161,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -169,8 +168,7 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -185,7 +183,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -193,8 +190,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); + if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -209,7 +206,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -217,8 +213,7 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -231,7 +226,6 @@ struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); uint32_t _tlli; - uint8_t ra[6]; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ @@ -239,8 +233,8 @@ _tlli = osmo_htonl(tlli); msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); + if (cause) msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, cause); @@ -259,7 +253,7 @@ uint16_t cid) { /* 6 octets RAC */ - gsm48_construct_ra(buf, raid); + gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); /* 2 octets CID */ osmo_store16be(cid, buf+6); @@ -1215,7 +1209,7 @@ uint16_t drx_params = osmo_htons(pinfo->drx_params); uint8_t mi[10]; int imsi_len = gsm48_generate_mid_from_imsi(mi, pinfo->imsi); - uint8_t ra[6]; + struct gsm48_ra_id ra; if (imsi_len < 2) return -EINVAL; @@ -1241,12 +1235,11 @@ } break; case BSSGP_PAGING_LOCATION_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, ra); + gsm48_encode_ra(&ra, &pinfo->raid); + msgb_tvlv_put(msg, BSSGP_IE_LOCATION_AREA, 4, (const uint8_t *)&ra); break; case BSSGP_PAGING_ROUTEING_AREA: - gsm48_construct_ra(ra, &pinfo->raid); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, &pinfo->raid); break; case BSSGP_PAGING_BVCI: { diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 3939e25..c7e5e4d 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -44,6 +44,14 @@ return msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); } +uint8_t *bssgp_msgb_ra_put(struct msgb *msg, const struct gprs_ra_id *ra_id) +{ + struct gsm48_ra_id ra; + + gsm48_encode_ra(&ra, ra_id); + return msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(ra), (const uint8_t *)&ra); +} + /*! GMM-SUSPEND.req (Chapter 10.3.6) */ int bssgp_tx_suspend(uint16_t nsei, uint32_t tlli, const struct gprs_ra_id *ra_id) @@ -51,7 +59,6 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx SUSPEND (TLLI=0x%04x)\n", tlli); @@ -60,9 +67,7 @@ bgph->pdu_type = BSSGP_PDUT_SUSPEND; bssgp_msgb_tlli_put(msg, tlli); - - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); } @@ -74,7 +79,6 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint8_t ra[6]; LOGP(DBSSGP, LOGL_NOTICE, "BSSGP (BVCI=0) Tx RESUME (TLLI=0x%04x)\n", tlli); @@ -83,9 +87,7 @@ bgph->pdu_type = BSSGP_PDUT_RESUME; bssgp_msgb_tlli_put(msg, tlli); - - gsm48_construct_ra(ra, ra_id); - msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, 6, ra); + bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index 9a0dba5..83a3621 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -9,6 +9,7 @@ bssgp_msgb_alloc; bssgp_msgb_copy; bssgp_msgb_tlli_put; +bssgp_msgb_ra_put; bssgp_parse_cell_id; bssgp_tx_bvc_block; bssgp_tx_bvc_reset; diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index a7daea4..8876059 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -689,33 +689,34 @@ raid->rac = buf[5]; } +/*! Encode a 3GPP TS 24.008 ? 10.5.5.15 Routing area identification + * \param[out] out Caller-provided packed struct + * \param[in] raid Routing Area ID to be encoded + */ +void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid) +{ + out->lac = osmo_htons(raid->lac); + out->rac = raid->rac; + + out->digits[0] = ((raid->mcc / 100) % 10) | (((raid->mcc / 10) % 10) << 4); + out->digits[1] = raid->mcc % 10; + + if (raid->mnc < 100) { + out->digits[1] |= 0xf0; + out->digits[2] = ((raid->mnc / 10) % 10) | ((raid->mnc % 10) << 4); + } else { + out->digits[1] |= (raid->mnc % 10) << 4; + out->digits[2] = ((raid->mnc / 100) % 10) | (((raid->mnc / 10) % 10) << 4); + } +} + /*! 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; - uint16_t mnc = raid->mnc; - uint16_t _lac; - - buf[0] = ((mcc / 100) % 10) | (((mcc / 10) % 10) << 4); - buf[1] = (mcc % 10); - - /* I wonder who came up with the stupidity of encoding the MNC - * differently depending on how many digits its decimal number has! */ - if (mnc < 100) { - buf[1] |= 0xf0; - buf[2] = ((mnc / 10) % 10) | ((mnc % 10) << 4); - } else { - buf[1] |= (mnc % 10) << 4; - buf[2] = ((mnc / 100) % 10) | (((mnc / 10) % 10) << 4); - } - - _lac = osmo_htons(raid->lac); - memcpy(buf + 3, &_lac, 2); - - buf[5] = raid->rac; + gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); return 6; } diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index d915234..5611ba3 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -205,6 +205,7 @@ gsm48_rr_msg_name; gsm48_cc_state_name; gsm48_construct_ra; +gsm48_encode_ra; gsm48_hdr_gmm_cipherable; gsm48_decode_bcd_number; gsm48_decode_bearer_cap; diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c index 935ec21..77a8822 100644 --- a/tests/gsm0408/gsm0408_test.c +++ b/tests/gsm0408/gsm0408_test.c @@ -137,8 +137,7 @@ static inline void check_ra(const struct gprs_ra_id *raid) { - uint8_t buf[6]; - int res; + struct gsm48_ra_id ra; struct gprs_ra_id raid0 = { .mnc = 0, .mcc = 0, @@ -146,10 +145,10 @@ .rac = 0, }; - res = gsm48_construct_ra(buf, raid); - printf("Constructed RA: %d - %s\n", res, res != sizeof(buf) ? "FAIL" : "OK"); + gsm48_encode_ra(&ra, raid); + printf("Constructed RA:\n"); - gsm48_parse_ra(&raid0, buf); + gsm48_parse_ra(&raid0, (const uint8_t *)&ra); dump_ra(raid); dump_ra(&raid0); printf("RA test..."); diff --git a/tests/gsm0408/gsm0408_test.ok b/tests/gsm0408/gsm0408_test.ok index f0abfd5..83165fa 100644 --- a/tests/gsm0408/gsm0408_test.ok +++ b/tests/gsm0408/gsm0408_test.ok @@ -1,11 +1,11 @@ Test `CSD 9600/V.110/transparent' passed Test `Speech, all codecs' passed Simple TMSI encoding test....passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=121, MCC=77, LAC=666, RAC=5 RA: MNC=121, MCC=77, LAC=666, RAC=5 RA test...passed -Constructed RA: 6 - OK +Constructed RA: RA: MNC=98, MCC=84, LAC=11, RAC=89 RA: MNC=98, MCC=84, LAC=11, RAC=89 RA test...passed -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:02:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:02:37 +0000 Subject: [MERGED] osmo-bsc[master]: vty: fix OML link state printing In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: vty: fix OML link state printing ...................................................................... vty: fix OML link state printing Always print newline regardless of BTS uptime availability. Change-Id: Ib80049fe66de17bc7acfbb774a30075f40a44dee --- M src/libbsc/bsc_vty.c 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 8281606..e60bdaf 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -298,9 +298,9 @@ vty_out(vty, " OML Link state: %s", get_model_oml_status(bts)); sec = bts_uptime(bts); if (sec) - vty_out(vty, " %llu days %llu hours %llu min. %llu sec.%s", - OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60, - VTY_NEWLINE); + vty_out(vty, " %llu days %llu hours %llu min. %llu sec.", + OSMO_SEC2DAY(sec), OSMO_SEC2HRS(sec), OSMO_SEC2MIN(sec), sec % 60); + vty_out(vty, "%s", VTY_NEWLINE); } else { vty_out(vty, " E1 Signalling Link:%s", VTY_NEWLINE); e1isl_dump_vty(vty, bts->oml_link); -- To view, visit https://gerrit.osmocom.org/5660 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib80049fe66de17bc7acfbb774a30075f40a44dee Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:02:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:02:37 +0000 Subject: [MERGED] osmo-bsc[master]: RSL: print link state per-TRX In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: RSL: print link state per-TRX ...................................................................... RSL: print link state per-TRX Change-Id: Ie6fad70b4b11d0bb4927b22e32e842422658ba53 Fixes: OS#2715 --- M src/libbsc/bsc_vty.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index d5c8733..8281606 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -860,6 +860,7 @@ trx->nominal_power - trx->max_power_red, VTY_NEWLINE); vty_out(vty, " NM State: "); net_dump_nmstate(vty, &trx->mo.nm_state); + vty_out(vty, " RSL State: %s%s", trx->rsl_link? "connected" : "disconnected", VTY_NEWLINE); vty_out(vty, " Baseband Transceiver NM State: "); net_dump_nmstate(vty, &trx->bb_transc.mo.nm_state); if (is_ipaccess_bts(trx->bts)) { -- To view, visit https://gerrit.osmocom.org/5659 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6fad70b4b11d0bb4927b22e32e842422658ba53 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:02:38 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:02:38 +0000 Subject: [MERGED] osmo-bsc[master]: cosmetic: remove duplicated code In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: cosmetic: remove duplicated code ...................................................................... cosmetic: remove duplicated code Change-Id: I16c446ef7dc66769826f6e8ae118d8b07bbf6930 --- M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c 2 files changed, 13 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 6d01109..d5c8733 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -871,6 +871,13 @@ } } +static inline void print_all_trx(struct vty *vty, const struct gsm_bts *bts) +{ + uint8_t trx_nr; + for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) + trx_dump_vty(vty, gsm_bts_trx_num(bts, trx_nr)); +} + DEFUN(show_trx, show_trx_cmd, "show trx [<0-255>] [<0-255>]", @@ -880,7 +887,6 @@ { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts = NULL; - struct gsm_bts_trx *trx; int bts_nr, trx_nr; if (argc >= 1) { @@ -900,26 +906,17 @@ VTY_NEWLINE); return CMD_WARNING; } - trx = gsm_bts_trx_num(bts, trx_nr); - trx_dump_vty(vty, trx); + trx_dump_vty(vty, gsm_bts_trx_num(bts, trx_nr)); return CMD_SUCCESS; } if (bts) { /* print all TRX in this BTS */ - for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { - trx = gsm_bts_trx_num(bts, trx_nr); - trx_dump_vty(vty, trx); - } + print_all_trx(vty, bts); return CMD_SUCCESS; } - for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) { - bts = gsm_bts_num(net, bts_nr); - for (trx_nr = 0; trx_nr < bts->num_trx; trx_nr++) { - trx = gsm_bts_trx_num(bts, trx_nr); - trx_dump_vty(vty, trx); - } - } + for (bts_nr = 0; bts_nr < net->num_bts; bts_nr++) + print_all_trx(vty, gsm_bts_num(net, bts_nr)); return CMD_SUCCESS; } diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index ad24a1e..07248fb 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -36,11 +36,8 @@ static bool ts_is_usable(const struct gsm_bts_trx_ts *ts) { - /* FIXME: How does this behave for BS-11 ? */ - if (is_ipaccess_bts(ts->trx->bts)) { - if (!nm_is_running(&ts->mo.nm_state)) - return false; - } + if (!trx_is_usable(ts->trx)) + return false; /* If a TCH/F_PDCH TS is busy changing, it is already taken or not * yet available. */ -- To view, visit https://gerrit.osmocom.org/5658 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16c446ef7dc66769826f6e8ae118d8b07bbf6930 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:03:34 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 13:03:34 +0000 Subject: osmo-bts[master]: oml.c: Fix use of htons instead of ntohs In-Reply-To: References: Message-ID: Patch Set 1: > > in little-endian hosts, htons and ntohs are actually the same > function > > Does it mean that on BE host it won't work? Nor sure if anyone ever > tested it actually, just curious because it confuses me too. AFAIK on BE hosts, they are still the same function, but in this case implemented as a NO-OP. -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:28:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:28:37 +0000 Subject: [MERGED] libosmocore[master]: Use existing function for TLLI encoding In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Use existing function for TLLI encoding ...................................................................... Use existing function for TLLI encoding Use bssgp_msgb_tlli_put() instead of copy-pasted code. Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77 --- M src/gb/gprs_bssgp.c M src/gb/gprs_bssgp_bss.c M tests/gb/gprs_bssgp_test.c 3 files changed, 9 insertions(+), 19 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 7228263..4c0bb8a 100644 --- a/src/gb/gprs_bssgp.c +++ b/src/gb/gprs_bssgp.c @@ -160,14 +160,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_SUSPEND_ACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); @@ -182,14 +180,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_SUSPEND_NACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); if (cause) @@ -205,14 +201,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_RESUME_ACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); return gprs_ns_sendmsg(bssgp_nsi, msg); @@ -225,14 +219,12 @@ struct msgb *msg = bssgp_msgb_alloc(); struct bssgp_normal_hdr *bgph = (struct bssgp_normal_hdr *) msgb_put(msg, sizeof(*bgph)); - uint32_t _tlli; msgb_nsei(msg) = nsei; msgb_bvci(msg) = 0; /* Signalling */ bgph->pdu_type = BSSGP_PDUT_SUSPEND_NACK; - _tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, 4, (uint8_t *) &_tlli); + bssgp_msgb_tlli_put(msg, tlli); bssgp_msgb_ra_put(msg, ra_id); if (cause) diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index c7e5e4d..487286c 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -396,7 +396,6 @@ struct msgb *msg; struct bssgp_normal_hdr *bgph; uint16_t e_bucket_size, e_leak_rate; - uint32_t e_tlli; if ((ms_bucket_size / 100) > 0xffff) return -EINVAL; @@ -412,8 +411,7 @@ msgb_bvci(msg) = bctx->bvci; bgph->pdu_type = BSSGP_PDUT_FLOW_CONTROL_MS; - e_tlli = osmo_htonl(tlli); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(e_tlli), (uint8_t *)&e_tlli); + bssgp_msgb_tlli_put(msg, tlli); msgb_tvlv_put(msg, BSSGP_IE_TAG, sizeof(tag), (uint8_t *)&tag); msgb_tvlv_put(msg, BSSGP_IE_MS_BUCKET_SIZE, sizeof(e_bucket_size), (uint8_t *) &e_bucket_size); diff --git a/tests/gb/gprs_bssgp_test.c b/tests/gb/gprs_bssgp_test.c index 1624a31..c38e180 100644 --- a/tests/gb/gprs_bssgp_test.c +++ b/tests/gb/gprs_bssgp_test.c @@ -98,11 +98,11 @@ static void send_bssgp_supend(enum bssgp_pdu_type pdu_type, uint32_t tlli) { struct msgb *msg = bssgp_msgb_alloc(); - uint32_t tlli_be = htonl(tlli); uint8_t rai[] = {0x0f, 0xf1, 0x80, 0x20, 0x37, 0x00}; msgb_v_put(msg, pdu_type); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(tlli_be), (uint8_t *)&tlli_be); + + bssgp_msgb_tlli_put(msg, tlli); msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(rai), &rai[0]); msgb_bssgp_send_and_free(msg); @@ -111,12 +111,12 @@ static void send_bssgp_resume(enum bssgp_pdu_type pdu_type, uint32_t tlli) { struct msgb *msg = bssgp_msgb_alloc(); - uint32_t tlli_be = htonl(tlli); uint8_t rai[] = {0x0f, 0xf1, 0x80, 0x20, 0x37, 0x00}; uint8_t suspend_ref = 1; msgb_v_put(msg, pdu_type); - msgb_tvlv_put(msg, BSSGP_IE_TLLI, sizeof(tlli_be), (uint8_t *)&tlli_be); + + bssgp_msgb_tlli_put(msg, tlli); msgb_tvlv_put(msg, BSSGP_IE_ROUTEING_AREA, sizeof(rai), &rai[0]); msgb_tvlv_put(msg, BSSGP_IE_SUSPEND_REF_NR, 1, &suspend_ref); -- To view, visit https://gerrit.osmocom.org/5655 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06d60566a19dcae701f8648c19fbd8db6d586f77 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:46:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 13:46:13 +0000 Subject: [PATCH] osmo-sgsn[master]: Use gsm48_encode_ra() for RAI encoding Message-ID: Review at https://gerrit.osmocom.org/5680 Use gsm48_encode_ra() for RAI encoding It has strickter type signature which increase the chance of spotting misuse either via compiler warning or with automated scan. This also paves the way for gsm48_construct_ra() deprecation in libosmocore. Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Related: OS#1640 --- M src/gprs/gb_proxy_patch.c M src/gprs/gprs_gmm.c M src/gprs/sgsn_libgtp.c M src/libcommon/gsm_data.c M tests/gbproxy/gbproxy_test.c 5 files changed, 16 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/80/5680/1 diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 4862755..1be9c24 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -32,7 +32,7 @@ extern void *tall_bsc_ctx; /* patch RA identifier in place */ -static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, +static void gbproxy_patch_raid(struct gsm48_ra_id *raid_enc, struct gbproxy_peer *peer, int to_bss, const char *log_text) { struct gbproxy_patch_state *state = &peer->patch_state; @@ -47,7 +47,7 @@ if (!state->local_mcc || !state->local_mnc) return; - gsm48_parse_ra(&raid, raid_enc); + gsm48_parse_ra(&raid, (uint8_t *)raid_enc); old_mcc = raid.mcc; old_mnc = raid.mnc; @@ -76,7 +76,7 @@ old_mcc, old_mnc, raid.lac, raid.rac, raid.mcc, raid.mnc, raid.lac, raid.rac); - gsm48_construct_ra(raid_enc, &raid); + gsm48_encode_ra(raid_enc, &raid); rate_ctr_inc(&peer->ctrg->ctr[counter]); } @@ -233,14 +233,14 @@ } if (parse_ctx->raid_enc) { - gbproxy_patch_raid(parse_ctx->raid_enc, peer, parse_ctx->to_bss, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->raid_enc, peer, parse_ctx->to_bss, parse_ctx->llc_msg_name); have_patched = 1; } if (parse_ctx->old_raid_enc && !parse_ctx->old_raid_is_foreign) { /* TODO: Patch to invalid if P-TMSI unknown. */ - gbproxy_patch_raid(parse_ctx->old_raid_enc, peer, parse_ctx->to_bss, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->old_raid_enc, peer, parse_ctx->to_bss, parse_ctx->llc_msg_name); have_patched = 1; } @@ -286,7 +286,7 @@ int err_ctr = -1; if (parse_ctx->bssgp_raid_enc) - gbproxy_patch_raid(parse_ctx->bssgp_raid_enc, peer, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->bssgp_raid_enc, peer, parse_ctx->to_bss, "BSSGP"); if (parse_ctx->need_decryption && diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 77a5537..9313e98 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra((uint8_t *)&aa->ra_id, &mm->ra); + gsm48_encode_ra(&aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra((uint8_t *)&rua->ra_id, &mm->ra); + gsm48_encode_ra(&rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 1032230..ae293f1 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -268,7 +268,7 @@ raid = mmctx->ra; raid.lac = 0xFFFE; raid.rac = 0xFF; - gsm48_construct_ra(pdp->rai.v, &raid); + gsm48_encode_ra((struct gsm48_ra_id *)pdp->rai.v, &raid); /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index a2837f3..6400963 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -311,15 +311,6 @@ raid->rac = bts->gprs.rac; } -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 3ebdccb..080c96b 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -222,9 +222,9 @@ const uint8_t *convert_ra(struct gprs_ra_id *raid) { - static uint8_t buf[6]; - gsm48_construct_ra(buf, raid); - return buf; + static struct gsm48_ra_id r; + gsm48_encode_ra(&r, raid); + return (const uint8_t *)&r; } /* DTAP - Attach Request */ @@ -582,7 +582,7 @@ OSMO_ASSERT(bssgp_msg_size <= sizeof(msg)); - gsm48_construct_ra(msg + 10, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 10), raid); msg[1] = (uint8_t)(tlli >> 24); msg[2] = (uint8_t)(tlli >> 16); msg[3] = (uint8_t)(tlli >> 8); @@ -713,7 +713,7 @@ msg[5] = (uint8_t)(tlli >> 8); msg[6] = (uint8_t)(tlli >> 0); - gsm48_construct_ra(msg + 9, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid); send_ns_unitdata(nsi, "BVC_SUSPEND", src_addr, 0, msg, sizeof(msg)); } @@ -735,7 +735,7 @@ msg[5] = (uint8_t)(tlli >> 8); msg[6] = (uint8_t)(tlli >> 0); - gsm48_construct_ra(msg + 9, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid); send_ns_unitdata(nsi, "BVC_SUSPEND_ACK", src_addr, 0, msg, sizeof(msg)); } @@ -795,7 +795,7 @@ if (raid) { msg[bssgp_msg_size] = BSSGP_IE_ROUTEING_AREA; msg[bssgp_msg_size+1] = 0x86; - gsm48_construct_ra(msg + bssgp_msg_size + 2, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + bssgp_msg_size + 2), raid); bssgp_msg_size += 8; } -- To view, visit https://gerrit.osmocom.org/5680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 13:48:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 13:48:08 +0000 Subject: osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5630/2//COMMIT_MSG Commit Message: Line 16: https://gerrit.osmocom.org/#/c/5628/ we usually add a tag like Depends: (libosmocore) -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:18:36 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 14:18:36 +0000 Subject: meta-telephony[201705]: meta-toolchain-osmo: Create valid symlink independent of pok... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:18:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 14:18:43 +0000 Subject: [MERGED] meta-telephony[201705]: meta-toolchain-osmo: Create valid symlink independent of pok... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: meta-toolchain-osmo: Create valid symlink independent of poky version ...................................................................... meta-toolchain-osmo: Create valid symlink independent of poky version Some automated jenkins jobs may want to download latest generated SDK built nightly with latest poky version. As the SDK filename depends on the poky version, if the poky version is bumped (eg. 2.3.1->2.3.2) then the jenkins job may not be able to find the SDK file anymore. Let's create a symlink which doesn't depend on poky version to let those jobs easily download latest SDK no matter the poky version used. Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a --- M recipes-osmocom/meta/meta-toolchain-osmo.bb 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/recipes-osmocom/meta/meta-toolchain-osmo.bb b/recipes-osmocom/meta/meta-toolchain-osmo.bb index a8dc39d..2a4f9c6 100644 --- a/recipes-osmocom/meta/meta-toolchain-osmo.bb +++ b/recipes-osmocom/meta/meta-toolchain-osmo.bb @@ -1,7 +1,8 @@ TOOLCHAIN_TARGET_OSMOTASK ?= "packagegroup-core-standalone-osmo-sdk-target" TOOLCHAIN_TARGET_TASK = "${TOOLCHAIN_TARGET_OSMOTASK}" -TOOLCHAIN_OUTPUT_BASENAME = "${SDK_NAME}-toolchain-osmo-${DISTRO_VERSION}" -TOOLCHAIN_OUTPUTNAME = "${TOOLCHAIN_OUTPUT_BASENAME}-${DATETIME}" +TOOLCHAIN_OUTPUT_BASENAME = "${SDK_NAME}-toolchain-osmo" +TOOLCHAIN_OUTPUT_VERNAME = "${TOOLCHAIN_OUTPUT_BASENAME}-${DISTRO_VERSION}" +TOOLCHAIN_OUTPUTNAME = "${TOOLCHAIN_OUTPUT_VERNAME}-${DATETIME}" TOOLCHAIN_OUTPUTNAME[vardepsexclude] = "DATETIME" TOOLCHAIN_HOST_TASK_append = " nativesdk-python-argparse" PROVIDES = "meta-toolchain-sdk" @@ -15,6 +16,7 @@ create_symlink() { cd ${SDKDEPLOYDIR}/ - rm -f ${TOOLCHAIN_OUTPUT_BASENAME}.sh + rm -f ${TOOLCHAIN_OUTPUT_BASENAME}.sh ${TOOLCHAIN_OUTPUT_VERNAME}.sh + ln -s ${TOOLCHAIN_OUTPUTNAME}.sh ${TOOLCHAIN_OUTPUT_VERNAME}.sh ln -s ${TOOLCHAIN_OUTPUTNAME}.sh ${TOOLCHAIN_OUTPUT_BASENAME}.sh } -- To view, visit https://gerrit.osmocom.org/5676 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I039fac5ca9cd41812225f0982ccc9289f11c6f1a Gerrit-PatchSet: 2 Gerrit-Project: meta-telephony Gerrit-Branch: 201705 Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:22:48 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 14:22:48 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: HACK: Work around IPA CCM bug in OsmoBSC Message-ID: Review at https://gerrit.osmocom.org/5681 HACK: Work around IPA CCM bug in OsmoBSC OsmoBSC has some misunderstanding about how IPA CCM works and hence we need to work around this until that bug is fixed in OsmoBSC. See https://osmocom.org/issues/2718 Change-Id: I304535d28a165f76a0a140dc0a15dd81a9db28c8 Related: OS#2718 --- M library/IPA_Emulation.ttcn 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/5681/1 diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn index 9bad69f..b335d87 100644 --- a/library/IPA_Emulation.ttcn +++ b/library/IPA_Emulation.ttcn @@ -296,10 +296,13 @@ f_ccm_tx(valueof(ts_IPA_PONG)); } case (IPAC_MSGT_ID_ACK) { - f_ccm_tx(valueof(ts_IPA_ACK)); + //f_ccm_tx(valueof(ts_IPA_ACK)); + f_send_IPA_EVT(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_ID_ACK)); } case (IPAC_MSGT_ID_GET) { f_ccm_tx(f_ccm_make_id_resp(ccm)); + /* work around broken OsmoBSC stack... */ + f_ccm_tx(valueof(ts_IPA_ACK)); } case else { log("Unknown/unsupported IPA CCM message type", ccm); -- To view, visit https://gerrit.osmocom.org/5681 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I304535d28a165f76a0a140dc0a15dd81a9db28c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:22:48 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 14:22:48 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... Message-ID: Review at https://gerrit.osmocom.org/5682 Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet. With help from Daniel Willmann. Change-Id: I3970382450dd728db68845a6414add8e027706ba Related: OS#2754 --- M library/BSSMAP_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/5682/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index bb1b537..f5c4e3e 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -639,7 +639,7 @@ } private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { - return hex2oct(mcc[1] & mcc[0] & mnc[0] & mnc[2] & mnc[1]); + return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); } template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { -- To view, visit https://gerrit.osmocom.org/5682 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3970382450dd728db68845a6414add8e027706ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:23:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 14:23:44 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: HACK: Work around IPA CCM bug in OsmoBSC In-Reply-To: References: Message-ID: Stefan Sperling has abandoned this change. Change subject: HACK: Work around IPA CCM bug in OsmoBSC ...................................................................... Abandoned Accidental submission. -- To view, visit https://gerrit.osmocom.org/5681 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I304535d28a165f76a0a140dc0a15dd81a9db28c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:41:33 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 14:41:33 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Stefan Sperling has abandoned this change. Change subject: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet. ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5682 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I3970382450dd728db68845a6414add8e027706ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:43:11 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 14:43:11 +0000 Subject: [PATCH] libosmo-abis[master]: cosmetic: update ipaccess_bts_handle_ccm() Message-ID: Review at https://gerrit.osmocom.org/5683 cosmetic: update ipaccess_bts_handle_ccm() * mark internal function parameter as const * log unit IDs Change-Id: Ifcf8baf4bf5670efaa8689ca7386597fe2797bda --- M src/input/ipaccess.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/83/5683/1 diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index acb2db0..5eee57e 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -571,7 +571,7 @@ #define IPA_STRING_MAX 64 static struct msgb * -ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) +ipa_bts_id_resp(const struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) { struct msgb *nmsg; char str[IPA_STRING_MAX]; @@ -704,7 +704,8 @@ if (link->ofd->priv_nr >= E1INP_SIGN_RSL) trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL; - LOGP(DLINP, LOGL_NOTICE, "received ID get\n"); + LOGP(DLINP, LOGL_NOTICE, "received ID get from %u/%u/%u\n", + dev->site_id, dev->bts_id, dev->trx_id); rmsg = ipa_bts_id_resp(dev, data + 1, len - 1, trx_nr); ret = ipa_send(link->ofd->fd, rmsg->data, rmsg->len); if (ret != rmsg->len) { -- To view, visit https://gerrit.osmocom.org/5683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifcf8baf4bf5670efaa8689ca7386597fe2797bda Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 14:44:05 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 14:44:05 +0000 Subject: [PATCH] osmo-sgsn[master]: Use gsm48_encode_ra() for RAI encoding In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5680 to look at the new patch set (#2). Use gsm48_encode_ra() for RAI encoding It has stricter type signature which increase the chance of spotting misuse either via compiler warning or with automated scan. This also paves the way for gsm48_construct_ra() deprecation in libosmocore. Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Related: OS#1640 --- M src/gprs/gb_proxy_patch.c M src/gprs/gprs_gmm.c M src/gprs/sgsn_libgtp.c M src/libcommon/gsm_data.c M tests/gbproxy/gbproxy_test.c 5 files changed, 16 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/80/5680/2 diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 4862755..1be9c24 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -32,7 +32,7 @@ extern void *tall_bsc_ctx; /* patch RA identifier in place */ -static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, +static void gbproxy_patch_raid(struct gsm48_ra_id *raid_enc, struct gbproxy_peer *peer, int to_bss, const char *log_text) { struct gbproxy_patch_state *state = &peer->patch_state; @@ -47,7 +47,7 @@ if (!state->local_mcc || !state->local_mnc) return; - gsm48_parse_ra(&raid, raid_enc); + gsm48_parse_ra(&raid, (uint8_t *)raid_enc); old_mcc = raid.mcc; old_mnc = raid.mnc; @@ -76,7 +76,7 @@ old_mcc, old_mnc, raid.lac, raid.rac, raid.mcc, raid.mnc, raid.lac, raid.rac); - gsm48_construct_ra(raid_enc, &raid); + gsm48_encode_ra(raid_enc, &raid); rate_ctr_inc(&peer->ctrg->ctr[counter]); } @@ -233,14 +233,14 @@ } if (parse_ctx->raid_enc) { - gbproxy_patch_raid(parse_ctx->raid_enc, peer, parse_ctx->to_bss, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->raid_enc, peer, parse_ctx->to_bss, parse_ctx->llc_msg_name); have_patched = 1; } if (parse_ctx->old_raid_enc && !parse_ctx->old_raid_is_foreign) { /* TODO: Patch to invalid if P-TMSI unknown. */ - gbproxy_patch_raid(parse_ctx->old_raid_enc, peer, parse_ctx->to_bss, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->old_raid_enc, peer, parse_ctx->to_bss, parse_ctx->llc_msg_name); have_patched = 1; } @@ -286,7 +286,7 @@ int err_ctr = -1; if (parse_ctx->bssgp_raid_enc) - gbproxy_patch_raid(parse_ctx->bssgp_raid_enc, peer, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->bssgp_raid_enc, peer, parse_ctx->to_bss, "BSSGP"); if (parse_ctx->need_decryption && diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 77a5537..9313e98 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra((uint8_t *)&aa->ra_id, &mm->ra); + gsm48_encode_ra(&aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra((uint8_t *)&rua->ra_id, &mm->ra); + gsm48_encode_ra(&rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 1032230..ae293f1 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -268,7 +268,7 @@ raid = mmctx->ra; raid.lac = 0xFFFE; raid.rac = 0xFF; - gsm48_construct_ra(pdp->rai.v, &raid); + gsm48_encode_ra((struct gsm48_ra_id *)pdp->rai.v, &raid); /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index a2837f3..6400963 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -311,15 +311,6 @@ raid->rac = bts->gprs.rac; } -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 3ebdccb..080c96b 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -222,9 +222,9 @@ const uint8_t *convert_ra(struct gprs_ra_id *raid) { - static uint8_t buf[6]; - gsm48_construct_ra(buf, raid); - return buf; + static struct gsm48_ra_id r; + gsm48_encode_ra(&r, raid); + return (const uint8_t *)&r; } /* DTAP - Attach Request */ @@ -582,7 +582,7 @@ OSMO_ASSERT(bssgp_msg_size <= sizeof(msg)); - gsm48_construct_ra(msg + 10, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 10), raid); msg[1] = (uint8_t)(tlli >> 24); msg[2] = (uint8_t)(tlli >> 16); msg[3] = (uint8_t)(tlli >> 8); @@ -713,7 +713,7 @@ msg[5] = (uint8_t)(tlli >> 8); msg[6] = (uint8_t)(tlli >> 0); - gsm48_construct_ra(msg + 9, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid); send_ns_unitdata(nsi, "BVC_SUSPEND", src_addr, 0, msg, sizeof(msg)); } @@ -735,7 +735,7 @@ msg[5] = (uint8_t)(tlli >> 8); msg[6] = (uint8_t)(tlli >> 0); - gsm48_construct_ra(msg + 9, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid); send_ns_unitdata(nsi, "BVC_SUSPEND_ACK", src_addr, 0, msg, sizeof(msg)); } @@ -795,7 +795,7 @@ if (raid) { msg[bssgp_msg_size] = BSSGP_IE_ROUTEING_AREA; msg[bssgp_msg_size+1] = 0x86; - gsm48_construct_ra(msg + bssgp_msg_size + 2, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + bssgp_msg_size + 2), raid); bssgp_msg_size += 8; } -- To view, visit https://gerrit.osmocom.org/5680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:08:34 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 15:08:34 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... Message-ID: Review at https://gerrit.osmocom.org/5684 Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet. With help from Daniel Willmann. Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Related: OS#2754 --- M library/BSSMAP_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/5684/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index cb6dde8..3bd9b35 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -648,7 +648,7 @@ } private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { - return hex2oct(mcc[1] & mcc[0] & mnc[0] & mnc[2] & mnc[1]); + return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); } template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:09:05 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 15:09:05 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: See https://gerrit.osmocom.org/#/c/5684/ instead. -- To view, visit https://gerrit.osmocom.org/5682 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3970382450dd728db68845a6414add8e027706ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:12:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 15:12:34 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5684/1/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); mcc[2] twice? ... oh wait, this is ttcn, until I realized I was completely confused on what this does. Still mcc[2] twice looks weird to me, sure that is correct? -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:28:12 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 15:28:12 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5684/1/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); > mcc[2] twice? ... oh wait, this is ttcn, until I realized I was completely It is correct for LAI, see http://www.etsi.org/deliver/etsi_ts/100500_100599/100590/08.15.00_60/ts_100590v081500p.pdf#page=102 -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 15:29:11 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5684/1/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); > mcc[2] twice? ... oh wait, this is ttcn, until I realized I was completely IIRC there is an 0xf involved ... seems to me we want what gsm48_construct_ra() does? libosmocore/src/gsm/gsm48.c -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:30:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 15:30:51 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5684/1/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); > IIRC there is an 0xf involved ... seems to me we want what gsm48_construct_ (commented too fast, reading the spec now) -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:44:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 15:44:44 +0000 Subject: [PATCH] osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. Message-ID: Review at https://gerrit.osmocom.org/5685 Show the BTS number for outgoing paging commands in debug log. Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e --- M src/libbsc/paging.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/5685/1 diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 314dfdd..035d5ba 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -86,8 +86,8 @@ log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub); - LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: " - "0x%08x for ch. type %d (attempt %d)\n", request->bsub->imsi, + LOGP(DPAG, LOGL_INFO, "Going to send paging commands: bts: %d imsi: %s tmsi: " + "0x%08x for ch. type %d (attempt %d)\n", bts->nr, request->bsub->imsi, request->bsub->tmsi, request->chan_type, request->attempts); if (request->bsub->tmsi == GSM_RESERVED_TMSI) -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:45:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 15:45:49 +0000 Subject: [MERGED] osmo-bts[master]: oml.c: Fix use of htons instead of ntohs In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: oml.c: Fix use of htons instead of ntohs ...................................................................... oml.c: Fix use of htons instead of ntohs In oml_ipa_mo_set_attr_cell, as well as we do in other set functions in the same file, we want to store a parsed value from a TLV received on the network into a host local structure. We hence need to use ntohs instead of htons. Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b --- M src/common/oml.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/oml.c b/src/common/oml.c index ff6dc41..465c416 100644 --- a/src/common/oml.c +++ b/src/common/oml.c @@ -1204,7 +1204,7 @@ if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_BVCI, 2)) bts->gprs.cell.bvci = - htons(tlvp_val16_unal(tp, NM_ATT_IPACC_BVCI)); + ntohs(tlvp_val16_unal(tp, NM_ATT_IPACC_BVCI)); if (TLVP_PRES_LEN(tp, NM_ATT_IPACC_RLC_CFG, 9)) { cur = TLVP_VAL(tp, NM_ATT_IPACC_RLC_CFG); -- To view, visit https://gerrit.osmocom.org/5675 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:47:20 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 8 Jan 2018 15:47:20 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: a_iface_bssap.c: Fix compilation warning 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/5424 to look at the new patch set (#2). libmsc: a_iface_bssap.c: Fix compilation warning Fixes following compilation warning: osmo-msc/src/libmsc/a_iface_bssap.c:328:11: warning: assignment discards ?const? qualifier from pointer target type [-Wdiscarded-qualifi ers] msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION); ^ osmo-msc/src/libmsc/a_iface_bssap.c:424:12: warning: assignment discards ?const? qualifier from pointer target type [-Wdiscarded-qualifi ers] msg->l3h = TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); ^ Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 --- M src/libmsc/a_iface_bssap.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/24/5424/2 diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 909a9f9..b75e7f9 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -324,9 +324,9 @@ } /* Parse Layer 3 Information element */ - /* FIXME: This is probably to hackish, compiler also complains "assignment discards ?const? qualifier..." */ - msg->l3h = (uint8_t*)TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION); - msg->tail = msg->l3h + TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION); + msgb_l3trim(msg, 0); + msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION)); + memcpy(msg->l3h, TLVP_VAL(&tp, GSM0808_IE_LAYER_3_INFORMATION), msgb_l3len(msg)); /* Create new subscriber context */ conn = subscr_conn_allocate_a(a_conn_info, network, lac, scu, a_conn_info->conn_id); @@ -421,8 +421,9 @@ } if (TLVP_PRESENT(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS)) { - msg->l3h = (uint8_t*)TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); - msg->tail = msg->l3h + TLVP_LEN(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS); + msgb_l3trim(msg, 0); + msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS)); + memcpy(msg->l3h, TLVP_VAL(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS), msgb_l3len(msg)); } else { msgb_free(msg); msg = NULL; -- To view, visit https://gerrit.osmocom.org/5424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:47:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 15:47:40 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5684/1/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mcc[2] & mcc[2] & mnc[1] & mnc[0]); > (commented too fast, reading the spec now) my doubt is confirmed by http://www.etsi.org/deliver/etsi_ts/148000_148099/148008/14.02.00_60/ts_148008v140200p.pdf chapter 3.2.2.27, which has the coding fixed in the spec -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 15:47:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 15:47:44 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 16:05:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 16:05:33 +0000 Subject: osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 16:16:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 16:16:06 +0000 Subject: [PATCH] osmo-pcu[master]: Fix wrong encoding of LH bits Message-ID: Review at https://gerrit.osmocom.org/5686 Fix wrong encoding of LH bits Introduce functions to set L/H bits using bitvec_set_bit() with proper enum from libosmocore instead of bitvec_write_field() with hardcoded numeric values. Adjust tests accordingly. While at it, clarify spec-related comments. The initial fix was proposed in I75dd5bebc74eea85edf9582607c774d0bba0d2a6. Related: OS#1526 Change-Id: Ibc6cb8e72219df55f359f130e509167d841f11bd --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 62 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/5686/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index 87c6f08..8a57848 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -75,6 +75,18 @@ *write_index += 5; } +static inline void write_lh(bitvec *dest, unsigned int *write_index, uint8_t len, bool write_l) +{ + uint8_t i = 0; + for (dest->cur_bit = *write_index; i < len; i++) { + bitvec_set_bit(dest, write_l ? L : H); + *write_index += 2; + } +} + +#define write_L(d, wi, l) write_lh(d, wi, l, true) +#define write_H(d, wi, l) write_lh(d, wi, l, false) + /* 3GPP TS 44.060 ? 12.12: { 0 | 1 < TIMING_ADVANCE_VALUE : bit (6) > } { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > @@ -100,7 +112,7 @@ return -EINVAL; } // GSM 04.08 10.5.2.16 IA Rest Octets - bitvec_write_field(dest, &wp, 3, 2); // "HH" + write_H(dest, &wp, 2); // "HH" bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment bitvec_write_field(dest, &wp,tbf->tlli(),32); // TLLI bitvec_write_field(dest, &wp,0x1,1); // switch TFI : on @@ -122,14 +134,14 @@ bitvec_write_field(dest, &wp,fn % 51,6); // T3 bitvec_write_field(dest, &wp,fn % 26,5); // T2 } else { - bitvec_write_field(dest, &wp,0x0,1); // TBF Starting TIME present + bitvec_write_field(dest, &wp, 0x0, 1); // TBF Starting TIME not present } bitvec_write_field(dest, &wp,0x0,1); // P0 not present // bitvec_write_field(dest, &wp,0x1,1); // P0 not present // bitvec_write_field(dest, &wp,,0xb,4); if (tbf->is_egprs_enabled()) { /* see GMS 44.018, 10.5.2.16 */ - bitvec_write_field(dest, &wp, 1, 1); // "H" + bitvec_write_field(dest, &wp, 1, 1); // "H" FIXME: use write_H write_ws(dest, &wp, tbf->window_size()); // EGPRS Window Size bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present @@ -147,8 +159,8 @@ OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); // GMS 04.08 10.5.2.37b 10.5.2.16 - bitvec_write_field(dest, &wp, 3, 2); // "HH" - bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment + bitvec_write_field(dest, &wp, 3, 2); // "HH" FIXME: use write_H + bitvec_write_field(dest, &wp, 0, 2); // "00" Packet Uplink Assignment if (tbf == NULL) { bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation if (alpha) { @@ -157,6 +169,7 @@ } else bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter + // FIXME: according to note in 3GPP TS 44.018 ?10.5.2.16 TAI shall not be allocated in SBA: write_tai(dest, wp, ta_idx); bitvec_write_field(dest, &wp, 1, 1); // TBF_STARTING_TIME_FLAG bitvec_write_field(dest, &wp,(fn / (26 * 51)) % 32,5); // T1' @@ -196,8 +209,9 @@ extended_ra = (ra & 0x1F); - bitvec_write_field(dest, &wp, 1, 2); /* LH */ - bitvec_write_field(dest, &wp, 0, 2); /* 0 EGPRS Uplink Assignment */ + write_L(dest, &wp, 1); /* "L" */ + write_H(dest, &wp, 1); /* "H" */ + bitvec_write_field(dest, &wp, 0, 2); /* 00 EGPRS Uplink Assignment */ bitvec_write_field(dest, &wp, extended_ra, 5); /* Extended RA */ bitvec_write_field(dest, &wp, 0, 1); /* Access technology Request */ @@ -636,13 +650,12 @@ "multiple of 8 bits, PLEASE FIX!\n"); plen = wp / 8; - bitvec_write_field(dest, &wp,0x0,1); // "L" NLN(PCH) = off - bitvec_write_field(dest, &wp,0x0,1); // "L" Priority1 = off - bitvec_write_field(dest, &wp,0x1,1); // "L" Priority2 = off - bitvec_write_field(dest, &wp,0x0,1); // "L" Group Call information = off - bitvec_write_field(dest, &wp,0x0,1); // "H" Packet Page Indication 1 = packet paging procedure - bitvec_write_field(dest, &wp,0x1,1); // "H" Packet Page Indication 2 = packet paging procedure - + write_L(dest, &wp, 4); // "L" NLN(PCH) = off + // "L" Priority1 = off + // "L" Priority2 = off + // "L" Group Call information = off + write_H(dest, &wp, 2); // "H" Packet Page Indication 1 = packet paging procedure + // "H" Packet Page Indication 2 = packet paging procedure return plen; } diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 3ed8678..077b583 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -625,7 +625,7 @@ TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 02 00 00 2b 2b 2b 2b TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -651,7 +651,7 @@ TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 06 10 00 2b 2b 2b 2b TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -677,7 +677,7 @@ TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 0a 20 00 2b 2b 2b 2b TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -703,7 +703,7 @@ TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 0e 30 00 2b 2b 2b 2b TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -729,7 +729,7 @@ TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 12 40 00 2b 2b 2b 2b TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -755,7 +755,7 @@ TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 16 50 00 2b 2b 2b 2b TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -781,7 +781,7 @@ TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 1a 60 00 2b 2b 2b 2b TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -807,7 +807,7 @@ TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 1e 70 00 2b 2b 2b 2b TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -833,7 +833,7 @@ TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 22 80 00 2b 2b 2b 2b TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -859,7 +859,7 @@ TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 26 90 00 2b 2b 2b 2b TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -885,7 +885,7 @@ TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 2a a0 00 2b 2b 2b 2b TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -911,7 +911,7 @@ TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 2e b0 00 2b 2b 2b 2b TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -937,7 +937,7 @@ TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 32 c0 00 2b 2b 2b 2b TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -963,7 +963,7 @@ TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 36 d0 00 2b 2b 2b 2b TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -989,7 +989,7 @@ TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 3a e0 00 2b 2b 2b 2b TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1015,7 +1015,7 @@ TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 3e f0 00 2b 2b 2b 2b TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1041,7 +1041,7 @@ TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 43 00 00 2b 2b 2b 2b TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1067,7 +1067,7 @@ TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 47 10 00 2b 2b 2b 2b TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1093,7 +1093,7 @@ TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 4b 20 00 2b 2b 2b 2b TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1119,7 +1119,7 @@ TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 4f 30 00 2b 2b 2b 2b TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1145,7 +1145,7 @@ TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 53 40 00 2b 2b 2b 2b TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1171,7 +1171,7 @@ TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 57 50 00 2b 2b 2b 2b TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1197,7 +1197,7 @@ TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 5b 60 00 2b 2b 2b 2b TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1223,7 +1223,7 @@ TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 5f 70 00 2b 2b 2b 2b TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1249,7 +1249,7 @@ TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 63 80 00 2b 2b 2b 2b TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1275,7 +1275,7 @@ TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 67 90 00 2b 2b 2b 2b TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1301,7 +1301,7 @@ TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 6b a0 00 2b 2b 2b 2b TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1327,7 +1327,7 @@ TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 6f b0 00 2b 2b 2b 2b TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1353,7 +1353,7 @@ TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 73 c0 00 2b 2b 2b 2b TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1379,7 +1379,7 @@ TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 77 d0 00 2b 2b 2b 2b TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1405,7 +1405,7 @@ TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 7b e0 00 2b 2b 2b 2b TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1431,7 +1431,7 @@ TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 00 00 7f f0 00 2b 2b 2b 2b TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1465,7 +1465,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 e7 00 48 d1 5a 00 00 2b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes Modifying MS object, TLLI = 0xc0123456, TA 220 -> 0 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes @@ -1494,7 +1494,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 23 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 e7 00 48 d1 5a 00 08 2b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==0) - Sending new block at BSN 0, CS=CS-1 @@ -1608,7 +1608,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=7 TA=7 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 e7 c4 88 cd 12 00 08 2b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: -- To view, visit https://gerrit.osmocom.org/5686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc6cb8e72219df55f359f130e509167d841f11bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 8 16:18:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 16:18:17 +0000 Subject: osmo-pcu[master]: Fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 1: The odd thing I don't understand yet is why we should replace H only in some places while in others it seems to break egprs. Any ideas? -- To view, visit https://gerrit.osmocom.org/5686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc6cb8e72219df55f359f130e509167d841f11bd Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 16:32:09 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 16:32:09 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... 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/5684 to look at the new patch set (#2). Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet. With help from Daniel Willmann. Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Related: OS#2754 --- M library/BSSMAP_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/5684/2 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index cb6dde8..f452263 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -648,7 +648,7 @@ } private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { - return hex2oct(mcc[1] & mcc[0] & mnc[0] & mnc[2] & mnc[1]); + return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); } template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 8 16:33:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 16:33:44 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5684/1/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); > my doubt is confirmed by http://www.etsi.org/deliver/etsi_ts/148000_148099/ Patchset 2 sets to entire MNC triplet. Paging still works as expected. -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:18:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 17:18:44 +0000 Subject: libosmo-abis[master]: cosmetic: update ipaccess_bts_handle_ccm() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcf8baf4bf5670efaa8689ca7386597fe2797bda Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:23:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 17:23:57 +0000 Subject: osmo-bsc[master]: cosmetic: mgcp: remove duplicate logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:25:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 17:25:20 +0000 Subject: osmo-ci[master]: Send email on update-* job failures In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d51e35424a26eab7d38152e13f3ac6fd3f3997c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:25:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 17:25:23 +0000 Subject: [MERGED] osmo-ci[master]: Send email on update-* job failures In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Send email on update-* job failures ...................................................................... Send email on update-* job failures Notify intern@ if either update-osmo-ci or update-osmo-python jobs failed. Those are essential for our CI and test infrastructure so we should look into related failures right away. Change-Id: I0d51e35424a26eab7d38152e13f3ac6fd3f3997c Related: OS#2821 --- M jobs/update-osmo-ci-on-slaves.yml M jobs/update-osmo-python-on-slaves.yml 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/update-osmo-ci-on-slaves.yml b/jobs/update-osmo-ci-on-slaves.yml index be93c90..b79751e 100644 --- a/jobs/update-osmo-ci-on-slaves.yml +++ b/jobs/update-osmo-ci-on-slaves.yml @@ -27,4 +27,8 @@ description: | Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! + publishers: + - email: + recipients: intern at lists.sysmocom.de + # vim: expandtab tabstop=2 shiftwidth=2 diff --git a/jobs/update-osmo-python-on-slaves.yml b/jobs/update-osmo-python-on-slaves.yml index e906a53..ce3033d 100644 --- a/jobs/update-osmo-python-on-slaves.yml +++ b/jobs/update-osmo-python-on-slaves.yml @@ -33,5 +33,7 @@ - trigger: project: update-osmo-ci-on-slaves threshold: FAILURE + - email: + recipients: intern at lists.sysmocom.de # vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/5678 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d51e35424a26eab7d38152e13f3ac6fd3f3997c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:27:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Jan 2018 17:27:10 +0000 Subject: libosmocore[master]: Use python 3 for utilities In-Reply-To: References: Message-ID: Patch Set 2: Hi Max, I definitely like the idea of using the '/usr/bin/env STH' instead of hardcoded '/usr/bin/python2' binary reference. But I am not sure, should we immediately reject Python 2 support? Is it discussed anywhere? -- To view, visit https://gerrit.osmocom.org/5657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc Gerrit-PatchSet: 2 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-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:42:18 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 17:42:18 +0000 Subject: libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Patch Set 5: (2 comments) https://gerrit.osmocom.org/#/c/5652/5/src/gb/gprs_bssgp.c File src/gb/gprs_bssgp.c: Line 256: gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); This code could cause unaligned access on some hardware platforms because we do not know if 'buf' is already aligned. A memcpy(&ra_id, buf, sizeof(ra_id)) to a local struct gsm48_ra_id ra_id; variable and passing a pointer to that variable to gsm48_encode_ra() would avoid an unaligned access. https://gerrit.osmocom.org/#/c/5652/5/src/gsm/gsm48.c File src/gsm/gsm48.c: Line 703: Why was the comment removed? Without the comment (mnc < 100) becomes less obvious. -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:48:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Jan 2018 17:48:38 +0000 Subject: [PATCH] gapk[master]: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() Message-ID: Review at https://gerrit.osmocom.org/5687 libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() During the HR codec initialization, a part of the state is allocated, but not freed at exit. Let's fix this. Found during debugging with Valgrind: 4,932 bytes in 1 blocks are definitely lost in loss record 177 of 179 at 0x4C2AB80: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x6381C8F: gsmhr_init (libgsmhr.c:63) by 0x526DF62: osmo_gapk_pq_queue_codec (pq_codec.c:48) by 0x401ACE: make_processing_chain (app_osmo_gapk.c:573) by 0x401ACE: main (app_osmo_gapk.c:765) Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 --- M libgsmhr/libgsmhr.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/87/5687/1 diff --git a/libgsmhr/libgsmhr.c b/libgsmhr/libgsmhr.c index eca0ce0..305bbb6 100644 --- a/libgsmhr/libgsmhr.c +++ b/libgsmhr/libgsmhr.c @@ -79,6 +79,7 @@ EXPORT void gsmhr_exit(struct gsmhr *state) { + free(state->bss_save); free(state); } -- To view, visit https://gerrit.osmocom.org/5687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:48:41 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Jan 2018 17:48:41 +0000 Subject: [PATCH] gapk[master]: Fix BENCHMARK_STOP call for both AMR and FR codecs Message-ID: Review at https://gerrit.osmocom.org/5688 Fix BENCHMARK_STOP call for both AMR and FR codecs The BENCHMARK_STOP should be called with a correct codec type and a correct operation type (encode or decode). Otherwise the results could be incorrect. Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608 --- M src/codec_amr.c M src/codec_fr.c 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/88/5688/1 diff --git a/src/codec_amr.c b/src/codec_amr.c index 4aae733..ca614ed 100644 --- a/src/codec_amr.c +++ b/src/codec_amr.c @@ -78,7 +78,7 @@ (unsigned char*) cod, 1 ); - BENCHMARK_STOP(CODEC_EFR, 1); + BENCHMARK_STOP(CODEC_AMR, 1); return rv; } @@ -95,7 +95,7 @@ (short *) pcm, 0 ); - BENCHMARK_STOP(CODEC_EFR, 0); + BENCHMARK_STOP(CODEC_AMR, 0); return PCM_CANON_LEN; } diff --git a/src/codec_fr.c b/src/codec_fr.c index 2ce44b4..917f34b 100644 --- a/src/codec_fr.c +++ b/src/codec_fr.c @@ -74,7 +74,7 @@ memcpy(cod_b, cod, FR_CANON_LEN); BENCHMARK_START; rc = gsm_decode(gh, (gsm_byte*)cod_b, (gsm_signal*)pcm); - BENCHMARK_STOP(CODEC_FR, 1); + BENCHMARK_STOP(CODEC_FR, 0); if (rc < 0) return rc; return PCM_CANON_LEN; -- To view, visit https://gerrit.osmocom.org/5688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:49:18 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Jan 2018 17:49:18 +0000 Subject: gapk[master]: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:49:30 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Jan 2018 17:49:30 +0000 Subject: gapk[master]: Fix BENCHMARK_STOP call for both AMR and FR codecs In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:51:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 8 Jan 2018 17:51:48 +0000 Subject: libosmocore[master]: libosmocodec: implement ECU (Error Concealment Unit) for FR In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5421/3/include/osmocom/codec/ecu.h File include/osmocom/codec/ecu.h: Line 9: uint8_t frame_backup[40]; Still unsure about this. I just used the length which is bigger than known values of supported codecs. Any ideas? -- To view, visit https://gerrit.osmocom.org/5421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 17:53:30 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 17:53:30 +0000 Subject: osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/5367/4/src/bts.cpp File src/bts.cpp: Line 1039: new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); We could remove this line as well, couldn't we? The flag is already cleared by check_n_clear if we enter this if-block. -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 18:05:31 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 18:05:31 +0000 Subject: osmo-msc[master]: libmsc: a_iface_bssap.c: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/5424/2/src/libmsc/a_iface_bssap.c File src/libmsc/a_iface_bssap.c: Line 328: msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION)); msgb_put() will panic if the length value provided in the data packet exceeds the length of the message buffer. So this could be used as a DoS attack vector. Could we compare the length value from the packet to msgb_l3len() and goto fail if the length value is larger? Line 425: msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_MESSAGE_CONTENTS)); Same problem. -- To view, visit https://gerrit.osmocom.org/5424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 8 18:25:16 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 18:25:16 +0000 Subject: [PATCH] libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. Message-ID: Review at https://gerrit.osmocom.org/5689 TLVP_PRESENT() should not return TRUE after tlv_parse() fails. If the length provided in the patcket exceeds the buffer length, tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd. Many callers of tlv_parse() do not check its return value, but rely on TLVP_PRESENT() to see if a particular TLV was parsed successfully. By clearing tlv.val and tlv.len we make it less likely that those callers will use an overlong TLV length value. Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 --- M src/gsm/tlv_parser.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/5689/1 diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index ead856c..dcf8846 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -244,8 +244,11 @@ dec->lv[lv_tag].val = &buf[ofs+1]; dec->lv[lv_tag].len = buf[ofs]; len = dec->lv[lv_tag].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag].val = 0; + dec->lv[lv_tag].len = 0; return -2; + } num_parsed++; ofs += len; } @@ -255,8 +258,11 @@ dec->lv[lv_tag2].val = &buf[ofs+1]; dec->lv[lv_tag2].len = buf[ofs]; len = dec->lv[lv_tag2].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag].val = 0; + dec->lv[lv_tag].len = 0; return -2; + } num_parsed++; ofs += len; } -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 8 18:54:49 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Mon, 8 Jan 2018 18:54:49 +0000 Subject: [PATCH] gr-gsm[master]: Just a change to be discarded in gerrit Message-ID: Review at https://gerrit.osmocom.org/5690 Just a change to be discarded in gerrit Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 --- M TESTING.md 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gr-gsm refs/changes/90/5690/1 diff --git a/TESTING.md b/TESTING.md index b51e647..6711e29 100644 --- a/TESTING.md +++ b/TESTING.md @@ -13,3 +13,4 @@ This will copy the entire contents of the currently checked out branch of gr-gsm to a temp folder, and attempt to build the docker images according to the definitions in the .docker files located under gr-gsm/dockerfiles. Once the images are created, the script instantiates a container for testing the rtlsdr scanner on each band, against each Docker image built. This can take quite a while. If you're running on Mac, consider using the ```caffeinate``` command to keep your machine from sleeping. + \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik From gerrit-no-reply at lists.osmocom.org Mon Jan 8 19:03:22 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Mon, 8 Jan 2018 19:03:22 +0000 Subject: gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 The commit was added solely to discard it. Trying to do that but I suppose I don't have enough rights to do that. Is group "gr-gsm Reviewers" linked to gr-gsm project. -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 21:28:02 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 21:28:02 +0000 Subject: [PATCH] libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5689 to look at the new patch set (#2). TLVP_PRESENT() should not return TRUE after tlv_parse() fails. If the length provided in the patcket exceeds the buffer length, tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd. Many callers of tlv_parse() do not check its return value, but rely on TLVP_PRESENT() to see if a particular TLV was parsed successfully. By clearing tlv.val and tlv.len we make it less likely that those callers will use an overlong TLV length value. Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 --- M src/gsm/tlv_parser.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/5689/2 diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index ead856c..6185616 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -244,8 +244,11 @@ dec->lv[lv_tag].val = &buf[ofs+1]; dec->lv[lv_tag].len = buf[ofs]; len = dec->lv[lv_tag].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag].val = 0; + dec->lv[lv_tag].len = 0; return -2; + } num_parsed++; ofs += len; } @@ -255,8 +258,11 @@ dec->lv[lv_tag2].val = &buf[ofs+1]; dec->lv[lv_tag2].len = buf[ofs]; len = dec->lv[lv_tag2].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag2].val = 0; + dec->lv[lv_tag2].len = 0; return -2; + } num_parsed++; ofs += len; } -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 21:31:14 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 8 Jan 2018 21:31:14 +0000 Subject: [PATCH] libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5689 to look at the new patch set (#3). TLVP_PRESENT() should not return TRUE after tlv_parse() fails. If the length provided in the patcket exceeds the buffer length, tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd. Many callers of tlv_parse() do not check its return value, but rely on TLVP_PRESENT() to see if a particular TLV was parsed successfully. By clearing tlv.val and tlv.len we make it less likely that those callers will use an overlong TLV length value. Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 --- M src/gsm/tlv_parser.c 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/5689/3 diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index ead856c..67862da 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -244,8 +244,11 @@ dec->lv[lv_tag].val = &buf[ofs+1]; dec->lv[lv_tag].len = buf[ofs]; len = dec->lv[lv_tag].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag].val = NULL; + dec->lv[lv_tag].len = 0; return -2; + } num_parsed++; ofs += len; } @@ -255,8 +258,11 @@ dec->lv[lv_tag2].val = &buf[ofs+1]; dec->lv[lv_tag2].len = buf[ofs]; len = dec->lv[lv_tag2].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag2].val = NULL; + dec->lv[lv_tag2].len = 0; return -2; + } num_parsed++; ofs += len; } -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 8 21:41:39 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 8 Jan 2018 21:41:39 +0000 Subject: gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Patch Set 1: Curious. As committer you should be able to abandon the commit regardless of group membership. Is "abandon" button is missing from web ui? -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Max Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 21:59:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 8 Jan 2018 21:59:40 +0000 Subject: [ABANDON] osmo-bsc[master]: abisip-find: add getopts and option to prevent endless loop In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: abisip-find: add getopts and option to prevent endless loop ...................................................................... Abandoned There is a merge conflict with Idba1a89753510fe6d409277b20c2db86c1b8f7f8, which adds option parsing (which is 95% the scope of this patch anyway) Also I am not s sure if anybody other than me needs this anyway, so lets abandon this for now. I am sure I will come across this soon anyway and then I probably will submit a better patch. -- To view, visit https://gerrit.osmocom.org/5239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I819b9616282dd6efd36c9557c7d6a50b6b00cdc2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jan 8 22:16:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 22:16:51 +0000 Subject: libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 8 22:18:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 8 Jan 2018 22:18:55 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/5684/2/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); looks proper now, except for the case of a two-digit MNC, where mnc[2] would be 0xf. Not sure if the context already provides for that, the incoming MNC after all seems to be some sort of BCD already... -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 09:05:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 09:05:11 +0000 Subject: libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5689/3/src/gsm/tlv_parser.c File src/gsm/tlv_parser.c: Line 230: * \returns number of bytes consumed by the TLV entry / IE parsed It may be worth documenting in here that it can returns a negative value. A reason users of this function don't usually check the return code may be because it's not actually specified in here that it can fail. -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling 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 Jan 9 09:08:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 9 Jan 2018 09:08:36 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5367 to look at the new patch set (#5). TBF: cleanup state flag handling * introduce generic function to check whether particular flag was set for'a TBF and clear it if necessary. Use this instead of clear_poll_timeout_flag() * add function to explicitly set assignment and appropriate state flags Overall this makes the code easier to read and debug. Related: OS#1759 Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 --- 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, 36 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/5367/5 diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..37a9c80 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1031,23 +1031,19 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { /* We now know that the PACCH really existed */ LOGPTBF(new_tbf, LOGL_INFO, "The TBF has been confirmed on the PACCH, " "changed type from CCCH to PACCH\n"); - new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - } + tbf_assign_control_ts(new_tbf); return; } @@ -1068,12 +1064,9 @@ 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 (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - } + tbf_assign_control_ts(new_tbf); /* there might be LLC packets waiting in the queue, but the DL * TBF might have been released while the UL TBF has been diff --git a/src/tbf.cpp b/src/tbf.cpp index aec67e7..625181f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,8 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -1511,8 +1510,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); + ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); 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 40ed974..26dce72 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,8 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state); + bool check_n_clear(uint8_t state_flag); + void set_assigned_on(uint8_t state_flag, bool check_ccch); const char *state_name() const; const char *name() const; @@ -371,12 +373,33 @@ return tbf_state_name[state]; } +/* Set assignment state and corrsponding flags */ +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +{ + set_state(GPRS_RLCMAC_ASSIGN); + if (check_ccch) { + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + state_flags |= (1 << state_flag); + } else + state_flags |= (1 << state_flag); +} + inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) { LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; +} + +inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) +{ + if ((state_flags & (1 << state_flag))) { + state_flags &= ~(1 << state_flag); + return true; + } + + return false; } inline LListHead& gprs_rlcmac_tbf::list() @@ -454,7 +477,7 @@ int rcvd_dl_ack(uint8_t final_ack, unsigned first_bsn, struct bitvec *rbb); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); void trigger_ass(struct gprs_rlcmac_tbf *old_tbf); - void clear_poll_timeout_flag(); + bool handle_ack_nack(); void request_dl_ack(); bool need_control_ts() const; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 84f6166..c0ee806 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,9 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -505,8 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -634,18 +631,12 @@ return bsn; } -void gprs_rlcmac_dl_tbf::clear_poll_timeout_flag() -{ - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); -} - bool gprs_rlcmac_dl_tbf::handle_ack_nack() { bool ack_recovered = false; state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - clear_poll_timeout_flag(); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ACK)) { ack_recovered = true; } @@ -856,7 +847,7 @@ if (is_final) T_START(this, T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true); - clear_poll_timeout_flag(); + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); /* clear poll timeout flag */ /* Clear request flag */ m_dl_ack_requested = false; diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 45de7cd..6442b8f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -96,10 +96,8 @@ bool gprs_rlcmac_ul_tbf::ctrl_ack_to_toggle() { - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ACK)) return true; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was set, now cleared */ - } state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); return false; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was unset, now set */ -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 9 09:09:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 9 Jan 2018 09:09:19 +0000 Subject: osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Patch Set 4: Right, thanks for review. -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:05:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 11:05:57 +0000 Subject: [PATCH] libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. 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/5689 to look at the new patch set (#4). TLVP_PRESENT() should not return TRUE after tlv_parse() fails. If the length provided in the patcket exceeds the buffer length, tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd. Many callers of tlv_parse() do not check its return value, but rely on TLVP_PRESENT() to see if a particular TLV was parsed successfully. By clearing tlv.val and tlv.len we make it less likely that those callers will use an overlong TLV length value. Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 --- M src/gsm/tlv_parser.c 1 file changed, 10 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/89/5689/4 diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index ead856c..9b1fb17 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -127,7 +127,7 @@ * \param[in] def structure defining the valid TLV tags / configurations * \param[in] buf the input data buffer to be parsed * \param[in] buf_len length of the input data buffer - * \returns number of bytes consumed by the TLV entry / IE parsed + * \returns number of bytes consumed by the TLV entry / IE parsed; negative in case of error */ int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val, const struct tlv_definition *def, @@ -227,7 +227,7 @@ * \param[in] buf_len length of the input data buffer * \param[in] lv_tag an initial LV tag at the start of the buffer * \param[in] lv_tag2 a second initial LV tag following the \a lv_tag - * \returns number of bytes consumed by the TLV entry / IE parsed + * \returns number of bytes consumed by the TLV entry / IE parsed; negative in case of error */ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, const uint8_t *buf, int buf_len, uint8_t lv_tag, @@ -244,8 +244,11 @@ dec->lv[lv_tag].val = &buf[ofs+1]; dec->lv[lv_tag].len = buf[ofs]; len = dec->lv[lv_tag].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag].val = NULL; + dec->lv[lv_tag].len = 0; return -2; + } num_parsed++; ofs += len; } @@ -255,8 +258,11 @@ dec->lv[lv_tag2].val = &buf[ofs+1]; dec->lv[lv_tag2].len = buf[ofs]; len = dec->lv[lv_tag2].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag2].val = NULL; + dec->lv[lv_tag2].len = 0; return -2; + } num_parsed++; ofs += len; } -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:06:55 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 11:06:55 +0000 Subject: libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5689/3/src/gsm/tlv_parser.c File src/gsm/tlv_parser.c: Line 230: * \returns number of bytes consumed by the TLV entry / IE parsed > It may be worth documenting in here that it can returns a negative value. A Agreed. See patchset 3. -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:08:14 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 11:08:14 +0000 Subject: libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5689/3/src/gsm/tlv_parser.c File src/gsm/tlv_parser.c: Line 230: * \returns number of bytes consumed by the TLV entry / IE parsed > Agreed. See patchset 3. I meant patchset 4. -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:18:11 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 11:18:11 +0000 Subject: [MERGED] osmo-bsc[master]: Support control connection status query for a particular MSC. In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Support control connection status query for a particular MSC. ...................................................................... Support control connection status query for a particular MSC. Add a new control command 'msc.N.connection_status' which can be used to query the connection status of a particular MSC with number N. Keep the old control command 'msc_connection_status', which always queries MSC 0, for backwards compatibility. Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Related: OS#2729 --- M include/osmocom/bsc/ctrl.h M src/libbsc/bsc_ctrl_lookup.c M src/osmo-bsc/osmo_bsc_ctrl.c 3 files changed, 53 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/ctrl.h b/include/osmocom/bsc/ctrl.h index c5ac210..04ca2cb 100644 --- a/include/osmocom/bsc/ctrl.h +++ b/include/osmocom/bsc/ctrl.h @@ -1,4 +1,11 @@ #pragma once +#include + struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, const char *bind_addr, uint16_t port); + +enum bsc_ctrl_node { + CTRL_NODE_MSC = _LAST_CTRL_NODE, + _LAST_CTRL_NODE_BSC +}; diff --git a/src/libbsc/bsc_ctrl_lookup.c b/src/libbsc/bsc_ctrl_lookup.c index d1d9b0a..38d1ba4 100644 --- a/src/libbsc/bsc_ctrl_lookup.c +++ b/src/libbsc/bsc_ctrl_lookup.c @@ -1,4 +1,4 @@ -/* SNMP-like status interface. Look-up of BTS/TRX +/* SNMP-like status interface. Look-up of BTS/TRX/MSC * * (C) 2010-2011 by Daniel Willmann * (C) 2010-2011 by On-Waves @@ -25,12 +25,14 @@ #include #include +#include #include #include +#include extern vector ctrl_node_vec; -/*! \brief control interface lookup function for bsc/bts gsm_data +/*! \brief control interface lookup function for bsc/bts/msc gsm_data * \param[in] data Private data passed to controlif_setup() * \param[in] vline Vector of the line holding the command string * \param[out] node_type type (CTRL_NODE_) that was determined @@ -44,6 +46,7 @@ struct gsm_bts *bts = NULL; struct gsm_bts_trx *trx = NULL; struct gsm_bts_trx_ts *ts = NULL; + struct bsc_msc_data *msc = NULL; char *token = vector_slot(vline, *i); long num; @@ -89,6 +92,18 @@ goto err_missing; *node_data = ts; *node_type = CTRL_NODE_TS; + } else if (!strcmp(token, "msc")) { + if (*node_type != CTRL_NODE_ROOT || !net) + goto err_missing; + (*i)++; + if (!ctrl_parse_get_num(vline, *i, &num)) + goto err_index; + + msc = osmo_msc_data_find(net, num); + if (!msc) + goto err_missing; + *node_data = msc; + *node_type = CTRL_NODE_MSC; } else return 0; @@ -102,6 +117,7 @@ struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, const char *bind_addr, uint16_t port) { - return ctrl_interface_setup_dynip(net, bind_addr, port, - bsc_ctrl_node_lookup); + return ctrl_interface_setup_dynip2(net, bind_addr, port, + bsc_ctrl_node_lookup, + _LAST_CTRL_NODE_BSC); } diff --git a/src/osmo-bsc/osmo_bsc_ctrl.c b/src/osmo-bsc/osmo_bsc_ctrl.c index 4460288..fc79086 100644 --- a/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/src/osmo-bsc/osmo_bsc_ctrl.c @@ -19,6 +19,7 @@ */ #include +#include #include #include #include @@ -57,10 +58,27 @@ talloc_free(trap); } -CTRL_CMD_DEFINE_RO(msc_connection_status, "msc_connection_status"); -static int msc_connection_status = 0; - +CTRL_CMD_DEFINE_RO(msc_connection_status, "connection_status"); static int get_msc_connection_status(struct ctrl_cmd *cmd, void *data) +{ + struct bsc_msc_data *msc = (struct bsc_msc_data *)cmd->node; + if (msc == NULL) { + cmd->reply = "msc not found"; + return CTRL_CMD_ERROR; + } + + if (msc->msc_con->is_connected) + cmd->reply = "connected"; + else + cmd->reply = "disconnected"; + return CTRL_CMD_REPLY; +} + +/* Backwards compat. */ +CTRL_CMD_DEFINE_RO(msc0_connection_status, "msc_connection_status"); +static int msc_connection_status = 0; /* XXX unused */ + +static int get_msc0_connection_status(struct ctrl_cmd *cmd, void *data) { struct gsm_network *gsmnet = data; struct bsc_msc_data *msc = osmo_msc_data_find(gsmnet, 0); @@ -96,7 +114,7 @@ cmd->id = "0"; cmd->variable = "msc_connection_status"; - get_msc_connection_status(cmd, NULL); + get_msc0_connection_status(cmd, NULL); ctrl_cmd_send_to_all(gsmnet->ctrl, cmd); @@ -627,7 +645,10 @@ rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_timezone); if (rc) goto end; - rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc_connection_status); + rc = ctrl_cmd_install(CTRL_NODE_MSC, &cmd_msc_connection_status); + if (rc) + goto end; + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc0_connection_status); if (rc) goto end; rc = osmo_signal_register_handler(SS_MSC, &msc_connection_status_trap_cb, net); -- To view, visit https://gerrit.osmocom.org/5630 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd41474a1be80e782b19ec337c856b5efc593fa8 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:35:42 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Jan 2018 11:35:42 +0000 Subject: [PATCH] osmo-bsc[master]: mgcp: log file and line of calls to handle_error() Message-ID: Review at https://gerrit.osmocom.org/5691 mgcp: log file and line of calls to handle_error() When the FSM runs into an error condition handle_error() is called with a cause code. The information about the error is then printed by handle_error(), by this we do not get the sourcecode line of the location where the error actually happend. Convey the source code line number of the actual error in handle_error() Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464 --- M src/osmo-bsc/osmo_bsc_mgcp.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/5691/1 diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 8ea6415..6caf496 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -122,7 +122,10 @@ * remove a half open connection (if possible). This function will execute * a controlled jump to the DLCX phase. From there, the FSM will then just * continue like the call were ended normally */ -static void handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cause) +#define handle_error(mgcp_ctx, cause) \ + _handle_error(mgcp_ctx, cause, __FILE__, __LINE__) +static void _handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cause, + const char *file, int line) { struct osmo_fsm_inst *fi; @@ -130,8 +133,8 @@ fi = mgcp_ctx->fsm; OSMO_ASSERT(fi); - LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", - get_value_string(bsc_mgcp_cause_codes_names, cause)); + LOGPFSMLSRC(mgcp_ctx->fsm, LOGL_ERROR, file, line, "%s -- graceful shutdown...\n", + get_value_string(bsc_mgcp_cause_codes_names, cause)); /* Set the VM into the state where it waits for the call end */ osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); -- To view, visit https://gerrit.osmocom.org/5691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:38:50 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Jan 2018 11:38:50 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams 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/4980 to look at the new patch set (#19). mgcp: use osmo-mgw to switch rtp streams in the current implementation we still use osmo-bsc_mgcp, which has many problems and is also obsoleted by osmo-mgw. integrate osmo-mgw and re-implement the current switching using an osmo fsm. Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062 Closes: OS#2605 Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/gsm_data.h M include/osmocom/msc/iucs.h M include/osmocom/msc/msc_ifaces.h A include/osmocom/msc/msc_mgcp.h M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_mgcp.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c 15 files changed, 1,316 insertions(+), 325 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/4980/19 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 1419e8e..052d830 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -39,6 +39,7 @@ mncc.h \ mncc_int.h \ msc_ifaces.h \ + msc_mgcp.h \ network_listen.h \ oap_client.h \ openbscdefines.h \ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1b0bff9..98fa125 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -196,9 +196,17 @@ struct gsm_encr encr; struct { + struct mgcp_ctx *mgcp_ctx; unsigned int mgcp_rtp_endpoint; - uint16_t port_subscr; - uint16_t port_cn; + + uint16_t local_port_ran; + char local_addr_ran[INET_ADDRSTRLEN]; + uint16_t remote_port_ran; + char remote_addr_ran[INET_ADDRSTRLEN]; + uint16_t local_port_cn; + char local_addr_cn[INET_ADDRSTRLEN]; + uint16_t remote_port_cn; + char remote_addr_cn[INET_ADDRSTRLEN]; } rtp; /* which Iu-CS connection, if any. */ diff --git a/include/osmocom/msc/iucs.h b/include/osmocom/msc/iucs.h index b7d6064..a48a316 100644 --- a/include/osmocom/msc/iucs.h +++ b/include/osmocom/msc/iucs.h @@ -1,7 +1,10 @@ #pragma once +#include + int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, struct ranap_ue_conn_ctx *ue); +int iu_rab_act_cs(struct gsm_trans *trans); diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index 0592c07..ca25e9d 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -37,7 +37,3 @@ enum gsm48_reject_value value); int msc_tx_common_id(struct gsm_subscriber_connection *conn); -int msc_call_assignment(struct gsm_trans *trans); -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); -void msc_call_release(struct gsm_trans *trans); -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip); diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h new file mode 100644 index 0000000..ac3283c --- /dev/null +++ b/include/osmocom/msc/msc_mgcp.h @@ -0,0 +1,56 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +/* MGCP state handler context. This context information stores all information + * to handle the direction of the RTP streams via MGCP. There is one instance + * of this context struct per subscriber connection. + * (see also struct gsm_subscriber_connection) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number. This number identifies the endpoint + * on the MGW on which the RAN and CN connection is created. This + * endpoint number is assigned and released automatically. */ + uint16_t rtp_endpoint; + + /* Set to true, when the context information is no longer needed */ + bool free_ctx; + + /* RTP connection identifiers */ + char conn_id_ran[MGCP_CONN_ID_LENGTH]; + char conn_id_cn[MGCP_CONN_ID_LENGTH]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + struct gsm_trans *trans; + mgcp_trans_id_t mgw_pending_trans; +}; + +int msc_mgcp_call_assignment(struct gsm_trans *trans); +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr); +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); +int msc_mgcp_call_release(struct gsm_trans *trans); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7dfb047..2bb4bcf 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -40,6 +40,7 @@ mncc_builtin.c \ mncc_sock.c \ msc_ifaces.c \ + msc_mgcp.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 95d9c91..0937426 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -396,8 +396,17 @@ /* Package RTP-Address data */ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); + rtp_addr_in.sin_port = osmo_htons(conn->rtp.local_port_ran); + rtp_addr_in.sin_addr.s_addr = inet_addr(conn->rtp.local_addr_ran); + + if (rtp_addr_in.sin_addr.s_addr == INADDR_NONE) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Address -- assignment not sent!\n"); + return -EINVAL; + } + if (rtp_addr_in.sin_port == 0) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Port -- assignment not sent!\n"); + return -EINVAL; + } memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 909a9f9..fc95dfb 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -596,11 +597,7 @@ * transport address element */ if (rtp_addr.ss_family == AF_INET) { rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp.port_subscr = osmo_ntohs(rtp_addr_in->sin_port); - /* FIXME: We also get the IP-Address of the remote (e.g. BTS) - * end with the response. Currently we just ignore that address. - * Instead we expect that our local MGCP gateway and the code - * controlling it, magically knows the IP of the remote end. */ + msc_mgcp_ass_complete(conn, osmo_ntohs(rtp_addr_in->sin_port), inet_ntoa(rtp_addr_in->sin_addr)); } else { LOGP(DMSC, LOGL_ERROR, "Unsopported addressing scheme. (supports only IPV4)\n"); goto fail; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3045f71..8e783e7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -69,6 +69,7 @@ #include #include #include +#include #include #include #ifdef BUILD_IU @@ -77,6 +78,7 @@ #include #include +#include #include @@ -1331,8 +1333,8 @@ { gsm48_stop_cc_timer(trans); - /* Make sure call also gets released on the mgcp side */ - msc_call_release(trans); + /* Initiate the teardown of the related connections on the MGW */ + msc_mgcp_call_release(trans); /* send release to L4, if callref still exists */ if (trans->callref) { @@ -1393,6 +1395,7 @@ { struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[0]); struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); + int rc; if (!trans1 || !trans2) return -EIO; @@ -1403,7 +1406,18 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - return msc_call_bridge(trans1, trans2); + /* Bridge RTP streams */ + rc = msc_mgcp_call_complete(trans1, trans2->conn->rtp.local_port_cn, + trans2->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + rc = msc_mgcp_call_complete(trans2, trans1->conn->rtp.local_port_cn, + trans1->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + return 0; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1746,7 +1760,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -1788,7 +1802,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2672,8 +2686,23 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); - uint16_t port = trans->conn->rtp.port_cn; + uint32_t addr = inet_addr(trans->conn->rtp.local_addr_cn); + uint16_t port = trans->conn->rtp.local_port_cn; + + LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + + if (addr == INADDR_NONE) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid IP-Address\n", + vlr_subscr_name(trans->vsub)); + return; + } + if (port == 0) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid Port\n", + vlr_subscr_name(trans->vsub)); + return; + } /* FIXME: This has to be set to some meaningful value, * before the MSC-Split, this value was pulled from @@ -2713,15 +2742,15 @@ trans->conn->mncc_rtp_bridge = 1; - /* When we call msc_call_assignment() we will trigger, depending + /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. - * msc_call_assignment() also takes care about sending the CRCX + * msc_mgcp_call_assignment() also takes care about sending the CRCX * command to the MGCP-GW. The CRCX will return the port number, * where the PBX (e.g. Asterisk) will send its RTP stream to. We * have to return this port number back to the MNCC by sending * it back with the TCH_RTP_CREATE message. To make sure that * this message is sent AFTER the response to CRCX from the - * MGCP-GW has arrived, we need will instruct msc_call_assignment() + * MGCP-GW has arrived, we need will instruct msc_mgcp_call_assignment() * to take care of this by setting trans->tch_rtp_create to true. * This will make sure that gsm48_tch_rtp_create() (below) is * called as soon as the local port number has become known. */ @@ -2729,7 +2758,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2756,6 +2785,7 @@ { struct gsm_trans *trans; struct gsm_mncc_rtp *rtp = arg; + struct in_addr addr; /* Find callref */ trans = trans_find_by_callref(net, rtp->callref); @@ -2771,8 +2801,8 @@ return 0; } - msc_call_connect(trans, rtp->port, rtp->ip); - return 0; + addr.s_addr = osmo_htonl(rtp->ip); + return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } static struct downstate { diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index c89e412..7bb45b2 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -30,8 +30,22 @@ #include #include +#include #include #include +#include + +#include "../../bscconfig.h" + +#ifdef BUILD_IU +#include +extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, + uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +#else +#include +#endif /* BUILD_IU */ /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, @@ -187,3 +201,53 @@ return rc; } + +int iu_rab_act_cs(struct gsm_trans *trans) +{ + struct gsm_subscriber_connection *conn; + struct msgb *msg; + bool use_x213_nsap; + uint32_t conn_id; + struct ranap_ue_conn_ctx *uectx; + uint8_t rab_id; + uint32_t rtp_ip; + uint16_t rtp_port; + + conn = trans->conn; + uectx = conn->iu.ue_ctx; + rab_id = conn->iu.rab_id; + rtp_ip = osmo_htonl(inet_addr(conn->rtp.local_addr_ran)); + rtp_port = conn->rtp.local_port_ran; + conn_id = uectx->conn_id; + + if (rtp_ip == INADDR_NONE) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP IP-Address\n", + conn_id, rab_id); + return -EINVAL; + } + if (rtp_port == 0) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP Port\n", + conn_id, rab_id); + return -EINVAL; + } + + use_x213_nsap = + (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); + + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, rtp=%x:%u, use_x213_nsap=%d\n", + conn_id, rab_id, rtp_ip, rtp_port, use_x213_nsap); + + msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, + use_x213_nsap); + msg->l2h = msg->data; + + if (ranap_iu_rab_act(uectx, msg)) + LOGP(DIUCS, LOGL_ERROR, + "Failed to send RAB Assignment: conn_id=%d rab_id=%d rtp=%x:%u\n", + conn_id, rab_id, rtp_ip, rtp_port); + return 0; +} + diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index abf1812..57cd50e 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -28,6 +28,8 @@ #include #include +#include +#include #include #include @@ -36,22 +38,54 @@ #include #include #include +#include + +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); -static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, - RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) +static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, RANAP_RAB_SetupOrModifiedItemIEs_t * setup_ies) { uint8_t rab_id; RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem; + RANAP_TransportLayerAddress_t *transp_layer_addr; + RANAP_IuTransportAssociation_t *transp_assoc; + uint16_t port = 0; + int rc; + char addr[INET_ADDRSTRLEN]; rab_id = item->rAB_ID.buf[0]; LOGP(DIUCS, LOGL_NOTICE, - "Received RAB assignment event for %s rab_id=%hhd\n", - vlr_subscr_name(conn->vsub), rab_id); + "Received RAB assignment event for %s rab_id=%hhd\n", vlr_subscr_name(conn->vsub), rab_id); + if (item->iuTransportAssociation && item->transportLayerAddress) { + transp_layer_addr = item->transportLayerAddress; + transp_assoc = item->iuTransportAssociation; + + rc = ranap_transp_assoc_decode(&port, transp_assoc); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode RTP port in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + rc = ranap_transp_layer_addr_decode(addr, sizeof(addr), transp_layer_addr); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode IP-Address in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + return msc_mgcp_ass_complete(conn, port, addr); + } + + LOGP(DIUCS, LOGL_ERROR, + "RAB assignment lacks RTP connection information. (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); return 0; } diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index e29fe0e..437d75c 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -29,15 +29,12 @@ #include #include #include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include -extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, - uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); #else #include #endif /* BUILD_IU */ @@ -140,287 +137,4 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); -} - -static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, - uint32_t rtp_ip, uint16_t rtp_port) -{ -#ifdef BUILD_IU - struct msgb *msg; - bool use_x213_nsap; - uint32_t conn_id = uectx->conn_id; - - use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); - - LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," - " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, - rtp_port, use_x213_nsap); - - msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, - use_x213_nsap); - msg->l2h = msg->data; - - if (ranap_iu_rab_act(uectx, msg)) - LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" - " conn_id=%d rab_id=%d rtp=%x:%u\n", - conn_id, rab_id, rtp_ip, rtp_port); - return 0; -#else - LOGP(DMSC, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); - return -ENOTSUP; -#endif -} - -static void mgcp_response_rab_act_cs_crcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_subscriber_connection *conn = trans->conn; - uint32_t rtp_ip; - int rc; - - if (r->head.response_code != 200) { - LOGP(DMGCP, LOGL_ERROR, - "MGCPGW response yields error: %d %s\n", - r->head.response_code, r->head.comment); - goto rab_act_cs_error; - } - - rc = mgcp_response_parse_params(r); - if (rc) { - LOGP(DMGCP, LOGL_ERROR, - "Cannot parse MGCP response, for %s\n", - vlr_subscr_name(trans->vsub)); - goto rab_act_cs_error; - } - - conn->rtp.port_cn = r->audio_port; - - rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); - - if (trans->conn->via_ran == RAN_UTRAN_IU) { - /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) - goto rab_act_cs_error; - } else if (trans->conn->via_ran == RAN_GERAN_A) { - /* Assign a voice channel via A on 2G */ - if (a_iface_tx_assignment(trans)) - goto rab_act_cs_error; - } else - goto rab_act_cs_error; - - /* Respond back to MNCC (if requested) */ - if (trans->tch_rtp_create) { - if (gsm48_tch_rtp_create(trans)) - goto rab_act_cs_error; - } - return; - -rab_act_cs_error: - /* FIXME abort call, invalidate conn, ... */ - LOGP(DMSC, LOGL_ERROR, "%s: failure during assignment\n", - vlr_subscr_name(trans->vsub)); - return; -} - -int msc_call_assignment(struct gsm_trans *trans) -{ - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - uint16_t bts_base; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - -#ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ - static uint8_t next_iu_rab_id = 1; - if (conn->via_ran == RAN_UTRAN_IU) - conn->iu.rab_id = next_iu_rab_id ++; -#endif - - conn->rtp.mgcp_rtp_endpoint = - mgcp_client_next_endpoint(conn->network->mgw.client); - - /* This will calculate the port we assign to the BTS via AoIP - * assignment command (or rab-assignment on 3G) The BTS will send - * its RTP traffic to that port on the MGCPGW side. The MGCPGW only - * gets the endpoint ID via the CRCX. It will do the same calculation - * on his side too to get knowledge of the rtp port. */ - bts_base = mgcp_client_conf_actual(mgcp)->bts_base; - conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; - - /* Establish the RTP stream first as looping back to the originator. - * The MDCX will patch through to the counterpart. TODO: play a ring - * tone instead. */ - msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); - -static void mgcp_bridge(struct gsm_trans *from, struct gsm_trans *to, - enum bridge_state state, - enum mgcp_connection_mode mode) -{ - struct gsm_subscriber_connection *conn1 = from->conn; - struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcp_client *mgcp = conn1->network->mgw.client; - const char *ip; - struct msgb *msg; - - OSMO_ASSERT(mgcp); - - from->bridge.peer = to; - from->bridge.state = state; - - /* Loop back to the same MGCP GW */ - ip = mgcp_client_remote_addr_str(mgcp); - - msg = mgcp_msg_mdcx(mgcp, - conn1->rtp.mgcp_rtp_endpoint, - ip, conn2->rtp.port_cn, - mode); - if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(from->vsub)); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_trans *peer = trans->bridge.peer; - - switch (trans->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - trans->bridge.state = BRIDGE_STATE_LOOPBACK_ESTABLISHED; - - switch (peer->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - /* Wait until the other is done as well. */ - return; - case BRIDGE_STATE_LOOPBACK_ESTABLISHED: - /* Now that both are in loopback, switch both to - * forwarding. */ - mgcp_bridge(trans, peer, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - mgcp_bridge(peer, trans, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - break; - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } - break; - - case BRIDGE_STATE_BRIDGE_PENDING: - trans->bridge.state = BRIDGE_STATE_BRIDGE_ESTABLISHED; - break; - - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } -} - -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip) -{ - /* With this function we inform the MGCP-GW where (ip/port) it - * has to send its outgoing voic traffic. The receiving end will - * usually be a PBX (e.g. Asterisk). The IP-Address we tell, will - * not only be used to direct the traffic, it will also be used - * as a filter to make sure only RTP packets from the right - * remote end will reach the BSS. This is also the reason why - * inbound audio will not work until this step is performed */ - - /* NOTE: This function is used when msc_call_bridge(), is not - * applicable. This is usually the case when an external MNCC - * is in use */ - - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - if (!trans->conn->network) - return -EINVAL; - if (!trans->conn->network->mgw.client) - return -EINVAL; - - mgcp = trans->conn->network->mgw.client; - - struct in_addr ip_addr; - ip_addr.s_addr = ntohl(ip); - - conn = trans->conn; - - msg = mgcp_msg_mdcx(mgcp, - conn->rtp.mgcp_rtp_endpoint, - inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcp_client_tx(mgcp, msg, NULL, trans)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - return 0; -} - -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2) -{ - if (!trans1) - return -EINVAL; - if (!trans2) - return -EINVAL; - - /* First setup as loopback and configure the counterparts' endpoints, - * so that when transmission starts the originating addresses are - * already known to be valid. The mgcp callback will continue. */ - mgcp_bridge(trans1, trans2, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - mgcp_bridge(trans2, trans1, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - - return 0; -} - -void msc_call_release(struct gsm_trans *trans) -{ - struct msgb *msg; - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - - if (!trans) - return; - if (!trans->conn) - return; - if (!trans->conn->network) - return; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - - /* Send DLCX */ - msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint); - if (mgcp_client_tx(mgcp, msg, NULL, NULL)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send DLCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - /* Release endpoint id */ - mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c new file mode 100644 index 0000000..bd60c13 --- /dev/null +++ b/src/libmsc/msc_mgcp.c @@ -0,0 +1,1078 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../bscconfig.h" + +#define S(x) (1 << (x)) + +#define CONN_ID_RAN 1 +#define CONN_ID_CN 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_RAN_TIMEOUT 10 /* in seconds */ +#define MGCP_RAN_TIMEOUT_TIMER_NR 2 +#define MGCP_REL_TIMEOUT 60 /* in seconds */ +#define MGCP_REL_TIMEOUT_TIMER_NR 3 +#define MGCP_ASS_TIMEOUT 10 /* in seconds */ +#define MGCP_ASS_TIMEOUT_TIMER_NR 4 + +#define MGCP_ENDPOINT_FORMAT "%x at mgw" + +/* Some internal cause codes to indicate fault condition inside the FSM */ +enum msc_mgcp_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_RAN_TIMEOUT, + MGCP_ERR_ASS_TIMEOUT, + MGCP_ERR_NOMEM, + MGCP_ERR_ASSGMNT_FAIL +}; + +/* Human readable respresentation of the faul codes, will be displayed by + * handle_error() */ +static const struct value_string msc_mgcp_cause_codes_names[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_TX_FAIL, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (RAN)"}, + {MGCP_ERR_RAN_TIMEOUT, "call could not be completed in time (RAN)"}, + {MGCP_ERR_ASS_TIMEOUT, "assignment could not be completed in time (RAN)"}, + {MGCP_ERR_NOMEM, "out of memory"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (RAN)"}, + {0, NULL} +}; + +enum fsm_msc_mgcp_states { + ST_CRCX_RAN, + ST_CRCX_CN, + ST_CRCX_COMPL, + ST_MDCX_CN, + ST_MDCX_CN_COMPL, + ST_MDCX_RAN, + ST_MDCX_RAN_COMPL, + ST_CALL, + ST_HALT, +}; + +enum msc_mgcp_fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Notify that the Assignment is complete and we + * may now forward IP/Port of the remote call leg to the MGW */ + EV_ASSIGN, + + /* External event: Notify that the Call is complete and that the + * two half open connections on the MGW should now be connected */ + EV_CONNECT, + + /* External event: Notify that the call is over and the connections + * on the mgw shall be removed */ + EV_TEARDOWN, + + /* Internal event: An error occurred that requires a controlled + * teardown of the RTP connections */ + EV_TEARDOWN_ERROR, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the RAN side */ + EV_CRCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the CN side */ + EV_CRCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the RAN side */ + EV_MDCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the CN side */ + EV_MDCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the RAN and CN side */ + EV_DLCX_ALL_RESP, +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ + +#define handle_error(mgcp_ctx, cause) \ + _handle_error(mgcp_ctx, cause, __FILE__, __LINE__) +static void _handle_error(struct mgcp_ctx *mgcp_ctx, enum msc_mgcp_cause_code cause, + const char *file, int line) +{ + struct osmo_fsm_inst *fi; + + OSMO_ASSERT(mgcp_ctx); + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSMLSRC(mgcp_ctx->fsm, LOGL_ERROR, file, line, "%s -- graceful shutdown...\n", + get_value_string(msc_mgcp_cause_codes_names, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN_ERROR, mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* We were unable to communicate with the MGW, unfortunately + * there is no meaningful action we can take now other than + * giving up. */ + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Cancel the transaction that timed out */ + mgcp_client_cancel(mgcp, mgcp_ctx->mgw_pending_trans); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN_ERROR, mgcp_ctx); + } else if (fi->T == MGCP_RAN_TIMEOUT_TIMER_NR) { + /* If the logic that controls the RAN is unable to negotiate a + * connection, we presumably still have a working connection to + * the MGW, we will try to shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_RAN_TIMEOUT); + } else if (fi->T == MGCP_REL_TIMEOUT_TIMER_NR) { + /* Under normal conditions, the MSC logic should always command + * to release the call at some point. However, the release may + * be missing due to errors in the MSC logic and we may have + * reached ST_HALT because of cascading errors and timeouts. In + * this and only in this case we will allow ST_HALT to free all + * context information on its own authority. */ + mgcp_ctx->free_ctx = true; + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_ASS_TIMEOUT_TIMER_NR) { + /* There may be rare cases in which the MSC is unable to + * complete the call assignment */ + handle_error(mgcp_ctx, MGCP_ERR_ASS_TIMEOUT); + } else { + /* Ther must not be any unsolicited timers in this FSM. If so, + * we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_RAN: Send CRCX for RAN side to MGW */ +static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + mgcp_ctx->rtp_endpoint = mgcp_client_next_endpoint(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/RAN: creating connection for the RAN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_CN, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for RAN associated CRCX */ +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_ran, r->head.conn_id, sizeof(mgcp_ctx->conn_id_ran)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/RAN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_ran); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/RAN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_ran = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_ran, r->audio_ip, sizeof(conn->rtp.local_addr_ran)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_RAN_RESP, mgcp_ctx); +} + +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_CN: check MGW response and send CRCX for CN side to MGW */ +static void fsm_crcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_CRCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/CN creating connection for the CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_cn, r->head.conn_id, sizeof(mgcp_ctx->conn_id_cn)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_cn); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/CN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_cn = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_cn, r->audio_ip, sizeof(conn->rtp.local_addr_cn)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_CRCX_COMPL: check MGW response, start assignment */ +static void fsm_crcx_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CRCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Forward assignment request to A/RANAP */ + if (conn->via_ran == RAN_UTRAN_IU) { +#ifdef BUILD_IU + /* Assign a voice channel via RANAP on 3G */ + if (iu_rab_act_cs(trans)) + goto error; +#else + LOGPFSML(fi, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); + goto error; +#endif + } else if (conn->via_ran == RAN_GERAN_A) { + /* Assign a voice channel via A on 2G */ + if (a_iface_tx_assignment(trans)) + goto error; + } else { + /* Unset or unimplemented new RAN type */ + LOGPFSML(fi, LOGL_ERROR, "Unknown RAN type: %d\n", conn->via_ran); + return; + } + + /* Respond back to MNCC (if requested) */ + if (trans->tch_rtp_create) { + if (gsm48_tch_rtp_create(trans)) + goto error; + } + + /* Note: When we reach this point then the situation is basically that + * we have two sides connected, both are in loopback. The local ports + * of the side pointing towards the BSS should be already communicated + * and we are waiting now for the BSS to return with the assignment + * complete command. */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN, MGCP_RAN_TIMEOUT, MGCP_RAN_TIMEOUT_TIMER_NR); + return; + +error: + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); +} + +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_CN: send MDCX for RAN side to MGW */ +static void fsm_mdcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CONNECT: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/CN: completing connection for the CN side on MGW endpoint:0x%x, remote leg expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_cn, conn->rtp.remote_port_cn); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_cn, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_cn, + .audio_port = conn->rtp.remote_port_cn + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_CN_COMPL: wait for mgw response, move on with the MDCX + * for the RAN side if we already have valid IP/Port data for the RAN sided + * RTP stream. */ +static void fsm_mdcx_cn_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_subscriber_connection *conn; + struct gsm_trans *trans; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_MDCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Enter MDCX phase, but we must be sure that the Assigmnet on the A or + * IuCS interface is complete (IP-Address and Port are valid) */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN, MGCP_ASS_TIMEOUT, MGCP_ASS_TIMEOUT_TIMER_NR); + + /* If we already have a valid remote port and IP-Address from the RAN side + * call leg, the assignment has been completed before we got here, so we + * may move on immediately */ + if (conn->rtp.remote_port_ran != 0 || strlen(conn->rtp.remote_addr_ran) > 0) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); +} + +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_RAN: wait for assignment completion, send MDCX for CN side to MGW */ +static void fsm_mdcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_ASSIGN: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/RAN: completing connection for the CN side on MGW endpoint:0x%x, RAN expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_ran, conn->rtp.remote_port_ran); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_ran, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_ran, + .audio_port = conn->rtp.remote_port_ran + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_RAN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_RAN_COMPL: check MGW response */ +static void fsm_mdcx_ran_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_MDCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, "call active, waiting for teardown...\n"); + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); +} + +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CALL: call is active, send DLCX for both sides on teardown */ +static void fsm_call_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "DLCX: removing connection for the RAN and CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = mgcp_ctx->rtp_endpoint + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_dlcx_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + + OSMO_ASSERT(mgcp_ctx); + + /* NOTE: We must not free the context information now, we have to + * wait until msc_mgcp_call_release() is called. Then we are sure + * that the logic controlling us is fully aware that the context + * information is freed. If we would free early now the controlling + * logic might mistakenly think that the context info is still alive, + * so lets keep the context info until we are explicitly asked for + * throwing it away. */ + if (mgcp_ctx->free_ctx) { + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_REL_TIMEOUT, MGCP_REL_TIMEOUT_TIMER_NR); +} + +static struct osmo_fsm_state fsm_msc_mgcp_states[] = { + + /* Startup state machine, send CRCX for RAN side. */ + [ST_CRCX_RAN] = { + .in_event_mask = S(EV_INIT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_RAN), + .action = fsm_crcx_ran_cb, + }, + /* When the response to the RAN CRCX is received, then proceed with + sending the CRCX for CN side */ + [ST_CRCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_COMPL), + .name = OSMO_STRINGIFY(ST_CRCX_CN), + .action = fsm_crcx_cn_cb, + }, + /* Complete the CRCX phase by starting the assignment. Depending on the + * RAT (Radio Access Technology), this will either trigger an + * Assignment Request on the A-Interface or an RAB-Assignment on the + * IU-interface */ + [ST_CRCX_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_COMPL), + .action = fsm_crcx_compl, + }, + /* Wait for MSC to complete the assignment request, when complete, we + * will enter the MDCX phase by sending an MDCX for the CN side to the + * MGW */ + [ST_MDCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CONNECT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_CN), + .action = fsm_mdcx_cn_cb, + }, + /* We arrive in this state when the MDCX phase for the CN side has + * completed we will check the IP/Port of the RAN connection. If this + * data is valid we may continue with the MDCX phase for the RAN side. + * If not we wait until the assinment completes on the A or on the IuCS + * interface. The completion of the assignment will fill in the port and + * IP-Address of the RAN side and way may continue then. */ + [ST_MDCX_CN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_MDCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN), + .name = OSMO_STRINGIFY(ST_MDCX_CN_COMPL), + .action = fsm_mdcx_cn_compl_cb, + }, + /* When the response for the CN MDCX is received, send the MDCX for the + * RAN side to the MGW */ + [ST_MDCX_RAN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_ASSIGN), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN), + .action = fsm_mdcx_ran_cb, + }, + /* The RAN side MDCX phase is complete when the response is received + * from the MGW. The call is then active, we change to ST_CALL and wait + * there until the call ends. */ + [ST_MDCX_RAN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_MDCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN_COMPL), + .action = fsm_mdcx_ran_compl_cb, + }, + /* We are now in the active call phase, wait until the call is done + * and send a DLCX then to remove all connections from the MGW */ + [ST_CALL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_CALL), + .action = fsm_call_cb, + }, + /* When the MGW confirms that the connections are terminated, then halt + * the state machine. */ + [ST_HALT] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_DLCX_ALL_RESP), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_HALT), + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm_msc_mgcp = { + .name = "MGW", + .states = fsm_msc_mgcp_states, + .num_states = ARRAY_SIZE(fsm_msc_mgcp_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that a new call begins. This will create a connection for the + * RAN and the CN on the MGW. + * Parameter: + * trans: transaction context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_assignment(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + struct gsm_subscriber_connection *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call assignment failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + mgcp = conn->network->mgw.client; + OSMO_ASSERT(mgcp); + + if (conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) double assignment detected, dropping...\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + +#ifdef BUILD_IU + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ + static uint8_t next_iu_rab_id = 1; + if (conn->via_ran == RAN_UTRAN_IU) + conn->iu.rab_id = next_iu_rab_id++; +#endif + + if (snprintf(name, sizeof(name), "MGW_%i", trans->transaction_id) >= sizeof(name)) + return -EINVAL; + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_msc_mgcp); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(NULL, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->trans = trans; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_RAN); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + conn->rtp.mgcp_ctx = mgcp_ctx; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call assignment initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Inform the FSM that the assignment (RAN connection) is now complete. + * Parameter: + * conn: subscriber connection context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(conn); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, assignmnet completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, assignmnet completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + mgcp_ctx = conn->rtp.mgcp_ctx; + if (!mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignmnet completion failed.\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + /* Memorize port and IP-Address of the remote RAN call leg. We need this + * information at latest when we enter the MDCX phase for the RAN side. */ + conn->rtp.remote_port_ran = port; + osmo_strlcpy(conn->rtp.remote_addr_ran, addr, sizeof(conn->rtp.remote_addr_ran)); + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) assignmnet completed, rtp %s:%d.\n", + vlr_subscr_name(conn->vsub), conn->rtp.remote_addr_ran, port); + + /* Note: We only dispatch the event if we are really waiting for the + * assignment, if we are not yet waiting, there is no need to loudly + * broadcast an event that the all other states do not understand anyway */ + if (mgcp_ctx->fsm->state == ST_MDCX_RAN) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); + + return 0; +} + +/* Make the connection of a previously assigned call complete + * Parameter: + * trans: transaction context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(trans); + OSMO_ASSERT(addr); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call completion failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* The FSM should already have passed all CRCX phases and be ready to move + * on with the MDCX phases. */ + if (mgcp_ctx->fsm->state != ST_MDCX_CN) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid call state, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + osmo_strlcpy(conn->rtp.remote_addr_cn, addr, sizeof(conn->rtp.remote_addr_cn)); + conn->rtp.remote_port_cn = port; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CONNECT, mgcp_ctx); + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call completion initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Release ongoing call. + * Parameter: + * trans: connection context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_release(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call release failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* Inform the FSM that as soon as it reaches ST_HALT it may free + * all context information immediately */ + mgcp_ctx->free_ctx = true; + + /* Initaite teardown, regardless of which state we are currently + * in */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + + /* Prevent any further operation that is triggered from outside by + * overwriting the context pointer with NULL. The FSM will now + * take care for a graceful shutdown and when done it will free + * all related context information */ + trans->conn->rtp.mgcp_ctx = NULL; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call release initiated\n", + vlr_subscr_name(trans->vsub)); + + return 0; +} diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 3a2c859..43b4e07 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -30,8 +30,8 @@ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=osmo_get_rand_id \ - -Wl,--wrap=msc_call_assignment \ - -Wl,--wrap=msc_call_release \ + -Wl,--wrap=msc_mgcp_call_release \ + -Wl,--wrap=msc_mgcp_call_assignment \ $(NULL) LDADD = \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index ac850b3..09f0df0 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -556,18 +556,18 @@ return 0; } -/* override, requires '-Wl,--wrap=msc_call_assignment' */ -int __real_msc_call_assignment(struct gsm_trans *trans); -int __wrap_msc_call_assignment(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_assignment' */ +int __real_msc_mgcp_call_assignment(struct gsm_trans *trans); +int __wrap_msc_mgcp_call_assignment(struct gsm_trans *trans) { log("MS <--Call Assignment-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); return 0; } -/* override, requires '-Wl,--wrap=msc_call_release' */ -void __real_msc_call_release(struct gsm_trans *trans); -void __wrap_msc_call_release(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_release' */ +void __real_msc_mgcp_call_release(struct gsm_trans *trans); +void __wrap_msc_mgcp_call_release(struct gsm_trans *trans) { log("MS <--Call Release-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); -- To view, visit https://gerrit.osmocom.org/4980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 Gerrit-PatchSet: 19 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:38:51 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 11:38:51 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5684/2/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); > looks proper now, except for the case of a two-digit MNC, where mnc[2] woul The incoming values are defined in BSC_Tests.ttcn as hex strings with the value '001' for both. type record Cell_Identity { GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci }; private const Cell_Identity cid := { '001'H, '001'H, 1, 0 }; -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:41:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 9 Jan 2018 11:41:52 +0000 Subject: [PATCH] osmo-ci[master]: Notify per email about master branch build failure Message-ID: Review at https://gerrit.osmocom.org/5692 Notify per email about master branch build failure Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 --- M jobs/master-builds.yml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/5692/1 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 3e2e5fb..ca1ef80 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -308,5 +308,8 @@ resolve-relative-paths: true - trigger: project: '{obj:trigger}' + - email: + recipients: gerrit-log at lists.osmocom.org + send-to-individuals: true # vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/5692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:44:54 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 9 Jan 2018 11:44:54 +0000 Subject: osmo-ci[master]: Notify per email about master branch build failure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:47:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 9 Jan 2018 11:47:23 +0000 Subject: gapk[master]: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Would be nice to get some "make check" tests which could be triggered by jenkins. -- To view, visit https://gerrit.osmocom.org/5687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:47:49 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 9 Jan 2018 11:47:49 +0000 Subject: [PATCH] python/osmo-python-tests[master]: remove osmodumpdoc.py and osmotestconfig.py from py3 install Message-ID: Review at https://gerrit.osmocom.org/5693 remove osmodumpdoc.py and osmotestconfig.py from py3 install Install these scripts as py2 only. These scripts were added to py3 in error by commit "Improve python3 compatibility", I80e5850a8978d78cda793e2192ef4bd3fd54a121, which only addresses print() compatibility but not encoding. Recent patch Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 removes osmotestvty.py from py3 installation. osmodumpdoc.py and osmotestconfig.py are still py2 for the same reasons and are also likely to fail when run as python3. Related: OS#2821 Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 --- M setup.py 1 file changed, 1 insertion(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/93/5693/1 diff --git a/setup.py b/setup.py index a91274d..bab9c38 100755 --- a/setup.py +++ b/setup.py @@ -23,9 +23,7 @@ scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", "scripts/osmotestvty.py"] elif sys.version_info.major == 3: - scripts = ["scripts/osmodumpdoc.py", - "scripts/osmotestconfig.py", - "scripts/osmo_interact_vty.py", + scripts = ["scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", "scripts/soap.py", -- To view, visit https://gerrit.osmocom.org/5693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:57:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 9 Jan 2018 11:57:19 +0000 Subject: [PATCH] python/osmo-python-tests[master]: cosmetic: setup.py: tweak indenting, add vim comment Message-ID: Review at https://gerrit.osmocom.org/5694 cosmetic: setup.py: tweak indenting, add vim comment We usually do only space indenting in our py code, replace tabs with spaces. Change to one script path per line for easier patch reading in the future. Add a vim expandtab comment. Change-Id: I8a501715127c2583a630b1efb0d5316574eea173 --- M setup.py 1 file changed, 16 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/94/5694/1 diff --git a/setup.py b/setup.py index bab9c38..e725334 100755 --- a/setup.py +++ b/setup.py @@ -20,16 +20,21 @@ import sys if sys.version_info.major == 2: - scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", - "scripts/osmotestvty.py"] + scripts = [ + "scripts/osmodumpdoc.py", + "scripts/osmotestconfig.py", + "scripts/osmotestvty.py", + ] elif sys.version_info.major == 3: - scripts = ["scripts/osmo_interact_vty.py", - "scripts/osmo_interact_ctrl.py", - "scripts/osmo_ctrl.py", - "scripts/soap.py", - "scripts/twisted_ipa.py", - "scripts/osmo_verify_transcript_vty.py", - "scripts/osmo_verify_transcript_ctrl.py"] + scripts = [ + "scripts/osmo_interact_vty.py", + "scripts/osmo_interact_ctrl.py", + "scripts/osmo_ctrl.py", + "scripts/soap.py", + "scripts/twisted_ipa.py", + "scripts/osmo_verify_transcript_vty.py", + "scripts/osmo_verify_transcript_ctrl.py", + ] setup( name = 'osmopython', @@ -41,3 +46,5 @@ author = "Katerina Barone-Adesi", author_email = "kat.obsc at gmail.com" ) + +# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/5694 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a501715127c2583a630b1efb0d5316574eea173 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 9 11:57:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 9 Jan 2018 11:57:19 +0000 Subject: [PATCH] python/osmo-python-tests[master]: cosmetic: setup.py: move osmo_interact_* next to osmo_verify_* Message-ID: Review at https://gerrit.osmocom.org/5695 cosmetic: setup.py: move osmo_interact_* next to osmo_verify_* Those scripts are semantically closely related, so place them next to each other. Change-Id: Id7380f9d536c83ee1d612457af423dde9b96f5ad --- M setup.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/95/5695/1 diff --git a/setup.py b/setup.py index e725334..3c12327 100755 --- a/setup.py +++ b/setup.py @@ -27,11 +27,11 @@ ] elif sys.version_info.major == 3: scripts = [ - "scripts/osmo_interact_vty.py", - "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", "scripts/soap.py", "scripts/twisted_ipa.py", + "scripts/osmo_interact_vty.py", + "scripts/osmo_interact_ctrl.py", "scripts/osmo_verify_transcript_vty.py", "scripts/osmo_verify_transcript_ctrl.py", ] -- To view, visit https://gerrit.osmocom.org/5695 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7380f9d536c83ee1d612457af423dde9b96f5ad Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 9 12:21:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 12:21:57 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Fix BTS location area code assignment in test configuration. Message-ID: Review at https://gerrit.osmocom.org/5696 Fix BTS location area code assignment in test configuration. The paging tests expect BTS 0 and 1 in LAC 1, and BTS 2 in LAC 2. BUt the osmo-bsc configuration file had BTS 1 in LAC 2, and BTS 2 in LAC 1. Change-Id: I1d6b02fe06116dee59977422bc93bcafcd3aba76 --- M bsc/osmo-bsc.cfg 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/96/5696/1 diff --git a/bsc/osmo-bsc.cfg b/bsc/osmo-bsc.cfg index d97c210..90756a6 100644 --- a/bsc/osmo-bsc.cfg +++ b/bsc/osmo-bsc.cfg @@ -176,7 +176,7 @@ type sysmobts band DCS1800 cell_identity 1 - location_area_code 2 + location_area_code 1 dtx uplink force dtx downlink base_station_id_code 63 @@ -266,7 +266,7 @@ type sysmobts band DCS1800 cell_identity 1 - location_area_code 1 + location_area_code 2 dtx uplink force dtx downlink base_station_id_code 63 -- To view, visit https://gerrit.osmocom.org/5696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d6b02fe06116dee59977422bc93bcafcd3aba76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 9 13:13:44 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Jan 2018 13:13:44 +0000 Subject: [PATCH] osmo-bts[master]: meas_test: fix header file references Message-ID: Review at https://gerrit.osmocom.org/5697 meas_test: fix header file references The unittest module meas_test.c contains a lot of unused header files as the result of a cut and paste error made earlier. Also the reference to stdio.h is missing. remove all header file references that are not needed. add missing header reference to stdio.h Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 --- M tests/meas/meas_test.c 1 file changed, 1 insertion(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/5697/1 diff --git a/tests/meas/meas_test.c b/tests/meas/meas_test.c index acebab5..a283c47 100644 --- a/tests/meas/meas_test.c +++ b/tests/meas/meas_test.c @@ -1,37 +1,12 @@ +#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 #include static struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/5697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 9 13:23:46 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 9 Jan 2018 13:23:46 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: perform error concealment for FR frames 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/5214 to look at the new patch set (#7). osmo-bts-trx: perform error concealment for FR frames When a bad voice frame is received, it is replaced by a silence frame. This may cause unpleasant audio effects. This change implements a functionality to craft a replacement frame from the last known good frame using ECU implementation from libosmocodec. At the moment, only FR is supported. Depends: libosmocore I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6 --- M include/osmo-bts/gsm_data_shared.h M src/osmo-bts-trx/scheduler_trx.c 2 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/5214/7 diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index 31198fc..4ca6d64 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -345,6 +346,9 @@ } ms_power_ctrl; struct msgb *pending_rel_ind_msg; + + /* ECU (Error Correction Unit) state */ + struct osmo_ecu_state ecu_fr_state; }; enum { diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index d3928f1..0e9f342 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -968,6 +969,7 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + bool bfi_flag = false; struct gsm_lchan *lchan = get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); @@ -1058,11 +1060,13 @@ if (rc < 0) { LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, "Received bad data (%u/%u)\n", fn % l1ts->mf_period, l1ts->mf_period); + bfi_flag = true; goto bfi; } if (rc < 4) { LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, "Received bad data (%u/%u) " "with invalid codec mode %d\n", fn % l1ts->mf_period, l1ts->mf_period, rc); + bfi_flag = true; goto bfi; } @@ -1079,8 +1083,14 @@ case GSM48_CMODE_SPEECH_V1: /* FR */ if (lchan->tch.dtx.ul_sid) return 0; /* DTXu: pause in progress */ - memset(tch_data, 0, GSM_FR_BYTES); - tch_data[0] = 0xd0; + + /* Perform error correction if possible */ + rc = osmo_ecu_fr_conceal(&lchan->ecu_fr_state, tch_data); + if (rc) { + memset(tch_data, 0, GSM_FR_BYTES); + tch_data[0] = 0xd0; + } + rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ @@ -1108,6 +1118,10 @@ if (rsl_cmode != RSL_CMOD_SPD_SPEECH) return 0; + /* Reset ECU with a good frame */ + if (!bfi_flag && tch_mode == GSM48_CMODE_SPEECH_V1) + osmo_ecu_fr_reset(&lchan->ecu_fr_state, tch_data); + /* TCH or BFI */ return _sched_compose_tch_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan, tch_data, rc); -- To view, visit https://gerrit.osmocom.org/5214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6 Gerrit-PatchSet: 7 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 Tue Jan 9 13:34:49 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 13:34:49 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: perform error concealment for FR frames 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/5214 to look at the new patch set (#8). osmo-bts-trx: perform error concealment for FR frames When a bad voice frame is received, it is replaced by a silence frame. This may cause unpleasant audio effects. This change implements a functionality to craft a replacement frame from the last known good frame using ECU implementation from libosmocodec. At the moment, only FR is supported. Depends-On: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6 --- M include/osmo-bts/gsm_data_shared.h M src/osmo-bts-trx/scheduler_trx.c 2 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/5214/8 diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index 31198fc..4ca6d64 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -345,6 +346,9 @@ } ms_power_ctrl; struct msgb *pending_rel_ind_msg; + + /* ECU (Error Correction Unit) state */ + struct osmo_ecu_state ecu_fr_state; }; enum { diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index d3928f1..0e9f342 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -968,6 +969,7 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + bool bfi_flag = false; struct gsm_lchan *lchan = get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); @@ -1058,11 +1060,13 @@ if (rc < 0) { LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, "Received bad data (%u/%u)\n", fn % l1ts->mf_period, l1ts->mf_period); + bfi_flag = true; goto bfi; } if (rc < 4) { LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, "Received bad data (%u/%u) " "with invalid codec mode %d\n", fn % l1ts->mf_period, l1ts->mf_period, rc); + bfi_flag = true; goto bfi; } @@ -1079,8 +1083,14 @@ case GSM48_CMODE_SPEECH_V1: /* FR */ if (lchan->tch.dtx.ul_sid) return 0; /* DTXu: pause in progress */ - memset(tch_data, 0, GSM_FR_BYTES); - tch_data[0] = 0xd0; + + /* Perform error correction if possible */ + rc = osmo_ecu_fr_conceal(&lchan->ecu_fr_state, tch_data); + if (rc) { + memset(tch_data, 0, GSM_FR_BYTES); + tch_data[0] = 0xd0; + } + rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ @@ -1108,6 +1118,10 @@ if (rsl_cmode != RSL_CMOD_SPD_SPEECH) return 0; + /* Reset ECU with a good frame */ + if (!bfi_flag && tch_mode == GSM48_CMODE_SPEECH_V1) + osmo_ecu_fr_reset(&lchan->ecu_fr_state, tch_data); + /* TCH or BFI */ return _sched_compose_tch_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan, tch_data, rc); -- To view, visit https://gerrit.osmocom.org/5214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6 Gerrit-PatchSet: 8 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 Tue Jan 9 13:49:47 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 13:49:47 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging by LAI. Message-ID: Review at https://gerrit.osmocom.org/5698 Implement support for paging by LAI. Also, parse the complete cell identifier list for both LAC and LAI. Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c M tests/bssap/bssap_test.c 2 files changed, 109 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/98/5698/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 0ecc11c..83acbb2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,21 +228,52 @@ return 0; } +/* Page a subscriber based on TMSI and LAC. + * A non-zero return value indicates a fatal out of memory condition. */ +static int +page_subscriber(struct bsc_msc_data *msc, uint16_t tmsi, uint32_t lac, + const char *mi_string, uint8_t chan_needed) +{ + struct bsc_subscr *subscr; + + subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, + mi_string); + if (!subscr) { + LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); + return -1; + } + + subscr->lac = lac; + subscr->tmsi = tmsi; + + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, + subscr, chan_needed, msc); + + /* the paging code has grabbed its own references */ + bsc_subscr_put(subscr); + + return 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) { - struct bsc_subscr *subscr; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; - unsigned int lac; + uint16_t lac, *lacp_be; + uint16_t mcc; + uint16_t mnc; uint8_t data_length; + int remain; const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); + remain = payload_length - 1; if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) { LOGP(DMSC, LOGL_ERROR, "Mandatory IMSI not present.\n"); @@ -251,6 +282,7 @@ LOGP(DMSC, LOGL_ERROR, "Wrong content in the IMSI\n"); return -1; } + remain -= TLVP_LEN(&tp, GSM0808_IE_IMSI); if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST)) { LOGP(DMSC, LOGL_ERROR, "Mandatory CELL IDENTIFIER LIST not present.\n"); @@ -260,6 +292,12 @@ if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI) && TLVP_LEN(&tp, GSM0808_IE_TMSI) == 4) { tmsi = ntohl(tlvp_val32_unal(&tp, GSM0808_IE_TMSI)); + remain -= TLVP_LEN(&tp, GSM0808_IE_TMSI); + } + + if (remain <= 0) { + LOGP(DMSC, LOGL_ERROR, "Payload too short.\n"); + return -1; } /* @@ -280,38 +318,12 @@ LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Zero length Cell Identifier List\n", mi_string); return -1; + } else if (data_length > remain) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Bogus Cell Identifier List length\n", + mi_string); + return -1; } - - cell_ident = data[0] & 0xf; - - /* Default fallback: page entire BSS */ - lac = GSM_LAC_RESERVED_ALL_BTS; - - switch (cell_ident) { - case CELL_IDENT_LAC: - if (data_length != 3) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for LAC (0x%x)" - " has invalid length: %u, paging entire BSS instead (%s)\n", - mi_string, CELL_IDENT_LAC, data_length, osmo_hexdump(data, data_length)); - break; - } - lac = osmo_load16be(&data[1]); - break; - - case CELL_IDENT_BSS: - if (data_length != 1) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" - " has invalid length: %u, paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); - } - break; - - default: - LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," - " paging entire BSS instead (%s)\n", - mi_string, cell_ident, osmo_hexdump(data, data_length)); - break; - } + remain = data_length; /* ignore payload padding data beyond data_length */ if (TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_NEEDED) && TLVP_LEN(&tp, GSM0808_IE_CHANNEL_NEEDED) == 1) chan_needed = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_NEEDED)[0] & 0x03; @@ -320,22 +332,73 @@ LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n"); } - subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, - mi_string); - if (!subscr) { - LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); - return -1; + cell_ident = data[0] & 0xf; + remain -= 1; /* cell ident consumed */ + + /* Default fallback: page entire BSS */ + lac = GSM_LAC_RESERVED_ALL_BTS; + + switch (cell_ident) { + case CELL_IDENT_LAI_AND_LAC: { + struct gsm48_loc_area_id lai; + int i = 0; + while (remain >= sizeof(lai)) { + /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). + * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + lai.digits[0] = data[1 + i * sizeof(lai)]; + lai.digits[1] = data[2 + i * sizeof(lai)]; + lai.digits[2] = data[3 + i * sizeof(lai)]; + memcpy(&lai.lac, &data[4 + i * sizeof(lai)], sizeof(lai.lac)); /* don't byte-swap yet */ + if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + + remain -= sizeof(lai); + i++; + } + break; } - subscr->lac = lac; - subscr->tmsi = tmsi; + case CELL_IDENT_LAC: + lacp_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*lacp_be)) { + lac = osmo_load16be(lacp_be); + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + remain -= sizeof(*lacp_be); + lacp_be++; + } + break; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + case CELL_IDENT_BSS: + if (data_length != 1) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" + " has invalid length: %u, paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); + } + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; - /* the paging code has grabbed its own references */ - bsc_subscr_put(subscr); + default: + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," + " paging entire BSS instead (%s)\n", + mi_string, cell_ident, osmo_hexdump(data, data_length)); + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; + } return 0; } diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index 579cae2..2fa2b1f 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -71,7 +71,7 @@ { "001952080859512069000743940904010844601a060415f5490065", /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ - GSM_LAC_RESERVED_ALL_BTS, 0 + 0x65, 0 }, }; -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:10:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 14:10:44 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging by LAI. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5698 to look at the new patch set (#2). Implement support for paging by LAI. Also, parse the complete cell identifier list for both LAC and LAI. Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 3 files changed, 121 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/98/5698/2 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 0ecc11c..b9c7b2d 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,21 +228,52 @@ return 0; } +/* Page a subscriber based on TMSI and LAC. + * A non-zero return value indicates a fatal out of memory condition. */ +static int +page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, + const char *mi_string, uint8_t chan_needed) +{ + struct bsc_subscr *subscr; + + subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, + mi_string); + if (!subscr) { + LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); + return -1; + } + + subscr->lac = lac; + subscr->tmsi = tmsi; + + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, + subscr, chan_needed, msc); + + /* the paging code has grabbed its own references */ + bsc_subscr_put(subscr); + + return 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) { - struct bsc_subscr *subscr; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; - unsigned int lac; + uint16_t lac, *lacp_be; + uint16_t mcc; + uint16_t mnc; uint8_t data_length; + int remain; const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); + remain = payload_length - 1; if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) { LOGP(DMSC, LOGL_ERROR, "Mandatory IMSI not present.\n"); @@ -251,6 +282,7 @@ LOGP(DMSC, LOGL_ERROR, "Wrong content in the IMSI\n"); return -1; } + remain -= TLVP_LEN(&tp, GSM0808_IE_IMSI); if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST)) { LOGP(DMSC, LOGL_ERROR, "Mandatory CELL IDENTIFIER LIST not present.\n"); @@ -260,6 +292,12 @@ if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI) && TLVP_LEN(&tp, GSM0808_IE_TMSI) == 4) { tmsi = ntohl(tlvp_val32_unal(&tp, GSM0808_IE_TMSI)); + remain -= TLVP_LEN(&tp, GSM0808_IE_TMSI); + } + + if (remain <= 0) { + LOGP(DMSC, LOGL_ERROR, "Payload too short.\n"); + return -1; } /* @@ -280,38 +318,12 @@ LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Zero length Cell Identifier List\n", mi_string); return -1; + } else if (data_length > remain) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Bogus Cell Identifier List length\n", + mi_string); + return -1; } - - cell_ident = data[0] & 0xf; - - /* Default fallback: page entire BSS */ - lac = GSM_LAC_RESERVED_ALL_BTS; - - switch (cell_ident) { - case CELL_IDENT_LAC: - if (data_length != 3) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for LAC (0x%x)" - " has invalid length: %u, paging entire BSS instead (%s)\n", - mi_string, CELL_IDENT_LAC, data_length, osmo_hexdump(data, data_length)); - break; - } - lac = osmo_load16be(&data[1]); - break; - - case CELL_IDENT_BSS: - if (data_length != 1) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" - " has invalid length: %u, paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); - } - break; - - default: - LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," - " paging entire BSS instead (%s)\n", - mi_string, cell_ident, osmo_hexdump(data, data_length)); - break; - } + remain = data_length; /* ignore payload padding data beyond data_length */ if (TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_NEEDED) && TLVP_LEN(&tp, GSM0808_IE_CHANNEL_NEEDED) == 1) chan_needed = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_NEEDED)[0] & 0x03; @@ -320,22 +332,73 @@ LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n"); } - subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, - mi_string); - if (!subscr) { - LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); - return -1; + cell_ident = data[0] & 0xf; + remain -= 1; /* cell ident consumed */ + + /* Default fallback: page entire BSS */ + lac = GSM_LAC_RESERVED_ALL_BTS; + + switch (cell_ident) { + case CELL_IDENT_LAI_AND_LAC: { + struct gsm48_loc_area_id lai; + int i = 0; + while (remain >= sizeof(lai)) { + /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). + * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + lai.digits[0] = data[1 + i * sizeof(lai)]; + lai.digits[1] = data[2 + i * sizeof(lai)]; + lai.digits[2] = data[3 + i * sizeof(lai)]; + memcpy(&lai.lac, &data[4 + i * sizeof(lai)], sizeof(lai.lac)); /* don't byte-swap yet */ + if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + + remain -= sizeof(lai); + i++; + } + break; } - subscr->lac = lac; - subscr->tmsi = tmsi; + case CELL_IDENT_LAC: + lacp_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*lacp_be)) { + lac = osmo_load16be(lacp_be); + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + remain -= sizeof(*lacp_be); + lacp_be++; + } + break; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + case CELL_IDENT_BSS: + if (data_length != 1) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" + " has invalid length: %u, paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); + } + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; - /* the paging code has grabbed its own references */ - bsc_subscr_put(subscr); + default: + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," + " paging entire BSS instead (%s)\n", + mi_string, cell_ident, osmo_hexdump(data, data_length)); + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; + } return 0; } diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index 579cae2..c97393d 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -73,6 +73,11 @@ /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ GSM_LAC_RESERVED_ALL_BTS, 0 }, + { + "001952080859512069000743940904010844601a060400f1100065", + /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ + 0x65, 0 + }, }; void test_cell_identifier() diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index 1c432eb..f24ff7c 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -16,7 +16,12 @@ 2: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 15 f5 49 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging IMSI 515029600703449: unimplemented Cell Identifier List (0x4), paging entire BSS instead (04 15 f5 49 00 65 ) -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe -BSC paging started on entire BSS (65534) +DMSC Not paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) +bsc_handle_udt() returned 0 + +3: +DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 +DMSC Rx MSC UDT BSSMAP PAGING +DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:20:49 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 14:20:49 +0000 Subject: osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:23:41 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 9 Jan 2018 14:23:41 +0000 Subject: [PATCH] libosmocore[master]: Add bitvec_set_u8() helper Message-ID: Review at https://gerrit.osmocom.org/5699 Add bitvec_set_u8() helper It's similar to bitvec_set_u64() but does not work with L/H bits. Most of the time (at least in 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets) we only set small values. Having separate helper allows to avoid unnecessary type conversions. The additional advantage over existing bitvec_set_uint() is the explicit length check. Tests are adjusted accordingly. Change-Id: I725cf0f4e4c58dbe1e961d80f9bb34d7635cc975 Related: OS#1526 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bitvec/bitvec_test.c 3 files changed, 34 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/5699/1 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index c9bab39..dd2019b 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -59,6 +59,7 @@ int bitvec_get_bit_high(struct bitvec *bv); int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count); int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh); +int bitvec_set_u8(struct bitvec *bv, uint8_t v, uint8_t num_bits); int bitvec_set_uint(struct bitvec *bv, unsigned int in, unsigned int count); int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits); int bitvec_find_bit_pos(const struct bitvec *bv, unsigned int n, enum bit_value val); diff --git a/src/bitvec.c b/src/bitvec.c index 884eb02..3c9ed98 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -221,6 +221,27 @@ * \param[in] bv bit vector. * \param[in] v mask representing which bits needs to be set. * \param[in] num_bits number of meaningful bits in the mask. + * \return 0 on success; negative in case of error. */ +int bitvec_set_u8(struct bitvec *bv, uint8_t v, uint8_t num_bits) +{ + uint8_t i; + + if (num_bits > 8) + return -E2BIG; + + for (i = 0; i < num_bits; i++) { + int rc = bitvec_set_bit(bv, (v & ((uint64_t)1 << (num_bits - i - 1))) ? 1 : 0); + if (rc != 0) + return rc; + } + + return 0; +} + +/*! set multiple bits (based on numeric value) at current pos. + * \param[in] bv bit vector. + * \param[in] v mask representing which bits needs to be set. + * \param[in] num_bits number of meaningful bits in the mask. * \param[in] use_lh whether to interpret the bits as L/H values or as 0/1. * \return 0 on success; negative in case of error. */ int bitvec_set_u64(struct bitvec *bv, uint64_t v, uint8_t num_bits, bool use_lh) diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index d0bc30c..a868dba 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -88,11 +88,11 @@ /* Write to bitvec */ memset(data, 0x00, sizeof(data)); bv.cur_bit = i; - rc = bitvec_set_uint(&bv, 0x7e, 8); + rc = bitvec_set_u8(&bv, 0x7e, 8); OSMO_ASSERT(rc >= 0); rc = bitvec_set_bytes(&bv, in, in_size); OSMO_ASSERT(rc >= 0); - rc = bitvec_set_uint(&bv, 0x7e, 8); + rc = bitvec_set_u8(&bv, 0x7e, 8); OSMO_ASSERT(rc >= 0); printf("bitvec: %s\n", osmo_hexdump(bv.data, bv.data_len)); @@ -193,11 +193,11 @@ printf("test shifting...\n"); - bitvec_set_uint(&bv, 0x0E, 7); + bitvec_set_u8(&bv, 0x0E, 7); test_shift(&bv, 3); test_shift(&bv, 17); bitvec_set_uint(&bv, 0, 32); - bitvec_set_uint(&bv, 0x0A, 7); + bitvec_set_u8(&bv, 0x0A, 7); test_shift(&bv, 24); printf("checking RL functions...\n"); @@ -208,12 +208,12 @@ test_rl(&bv); bitvec_shiftl(&bv, 18); test_rl(&bv); - bitvec_set_uint(&bv, 0x0F, 8); + bitvec_set_u8(&bv, 0x0F, 8); test_rl(&bv); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xFF, 8); + bitvec_set_u8(&bv, 0xFF, 8); test_rl(&bv); - bitvec_set_uint(&bv, 0xFE, 7); + bitvec_set_u8(&bv, 0xFE, 7); test_rl(&bv); bitvec_set_uint(&bv, 0, 17); test_rl(&bv); @@ -260,12 +260,12 @@ printf("\nbitvec_runlength....\n"); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xff, 8); + bitvec_set_u8(&bv, 0xff, 8); bv.cur_bit -= 8; test_bitvec_rl_curbit(&bv, 1, 64, 8); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xfc, 8); + bitvec_set_u8(&bv, 0xfc, 8); bv.cur_bit -= 8; test_bitvec_rl_curbit(&bv, 1, 64, 6); @@ -273,13 +273,13 @@ test_bitvec_rl_curbit(&bv, 0, 52, 52); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0xfc, 8); + bitvec_set_u8(&bv, 0xfc, 8); bv.cur_bit -= 2; test_bitvec_rl_curbit(&bv, 0, 64, 58); bitvec_zero(&bv); - bitvec_set_uint(&bv, 0x07, 8); - bitvec_set_uint(&bv, 0xf8, 8); + bitvec_set_u8(&bv, 0x07, 8); + bitvec_set_u8(&bv, 0xf8, 8); bv.cur_bit -= 11; test_bitvec_rl_curbit(&bv, 1, 64, 8); -- To view, visit https://gerrit.osmocom.org/5699 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I725cf0f4e4c58dbe1e961d80f9bb34d7635cc975 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:26:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 9 Jan 2018 14:26:49 +0000 Subject: python/osmo-python-tests[master]: remove osmodumpdoc.py and osmotestconfig.py from py3 install In-Reply-To: References: Message-ID: Patch Set 1: Do you see an actual failure? Would be nice to add it to tests. -- To view, visit https://gerrit.osmocom.org/5693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:42:14 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 14:42:14 +0000 Subject: [PATCH] osmo-trx[master]: cosmetic: Remove trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/5700 cosmetic: Remove trailing whitespace Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5 --- M AUTHORS M CommonLibs/LogTest.cpp M CommonLibs/Makefile.am M Transceiver52M/Makefile.am M configure.ac 5 files changed, 4 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/00/5700/1 diff --git a/AUTHORS b/AUTHORS index 88ac61b..65532aa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -186,4 +186,3 @@ RRLPMessages.cpp RRLPMessages.h RRLPTest.cpp - diff --git a/CommonLibs/LogTest.cpp b/CommonLibs/LogTest.cpp index 20959a0..882707d 100644 --- a/CommonLibs/LogTest.cpp +++ b/CommonLibs/LogTest.cpp @@ -64,6 +64,3 @@ std::cout << "you should see ten lines with the numbers 10..19:" << std::endl; printAlarms(); } - - - diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index 18ec2f7..ed188d5 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -50,7 +50,7 @@ ConfigurationTest \ LogTest -# ReportingTest +# ReportingTest noinst_HEADERS = \ BitVector.h \ @@ -94,5 +94,3 @@ LogTest_LDADD = libcommon.la $(SQLITE3_LIBS) MOSTLYCLEANFILES += testSource testDestination - - diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index c2ab9ca..20d0bd6 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -32,7 +32,7 @@ ARCH_LA = x86/libarch.la endif -if USRP1 +if USRP1 AM_CPPFLAGS += $(USRP_CFLAGS) else AM_CPPFLAGS += $(UHD_CFLAGS) @@ -99,7 +99,7 @@ $(GSM_LA) \ $(COMMON_LA) $(SQLITE3_LIBS) -if USRP1 +if USRP1 libtransceiver_la_SOURCES += USRPDevice.cpp osmo_trx_LDADD += $(USRP_LIBS) else diff --git a/configure.ac b/configure.ac index 6e59fa2..01bec91 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ [openbsc at lists.osmocom.org]) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am]) -AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([config]) AM_CONFIG_HEADER(config.h) -- To view, visit https://gerrit.osmocom.org/5700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:42:14 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 14:42:14 +0000 Subject: [PATCH] osmo-trx[master]: Logger: Stop using Log.Alarms.Max from config Message-ID: Review at https://gerrit.osmocom.org/5701 Logger: Stop using Log.Alarms.Max from config This is a first step towards removing ConfigurationTable class and sqlite3 dependency. Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a --- M CommonLibs/Configuration.cpp M CommonLibs/Logger.cpp 2 files changed, 2 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/01/5701/1 diff --git a/CommonLibs/Configuration.cpp b/CommonLibs/Configuration.cpp index 14e5400..4661903 100644 --- a/CommonLibs/Configuration.cpp +++ b/CommonLibs/Configuration.cpp @@ -104,17 +104,6 @@ // Build CommonLibs schema ConfigurationKey *tmp; - tmp = new ConfigurationKey("Log.Alarms.Max","20", - "alarms", - ConfigurationKey::CUSTOMER, - ConfigurationKey::VALRANGE, - "10:20",// educated guess - false, - "Maximum number of alarms to remember inside the application." - ); - mSchema[tmp->getName()] = *tmp; - delete tmp; - tmp = new ConfigurationKey("Log.File","", "", ConfigurationKey::DEVELOPER, diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index 4e4dbbc..d246584 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -36,6 +36,7 @@ #include "Logger.h" #include "Threads.h" // pat added +#define MAX_ALARMS 20 using namespace std; @@ -212,8 +213,7 @@ { alarmsLock.lock(); alarmsList.push_back(s); - unsigned maxAlarms = gConfig.getNum("Log.Alarms.Max"); - while (alarmsList.size() > maxAlarms) alarmsList.pop_front(); + while (alarmsList.size() > MAX_ALARMS) alarmsList.pop_front(); alarmsLock.unlock(); } -- To view, visit https://gerrit.osmocom.org/5701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:42:14 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 14:42:14 +0000 Subject: [PATCH] osmo-trx[master]: Logger: Stop using Log.File and Log.Level from config Message-ID: Review at https://gerrit.osmocom.org/5702 Logger: Stop using Log.File and Log.Level from config This is a required step towards getting rid of ConfigurationTable class and libsqlite dependency. As a side effect, support for different log levels for different files is dropped, but it's not something really being used and we will end up dropping current logging system in favour of osmocom's one in the future anyway. Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51 --- M CommonLibs/Logger.cpp M CommonLibs/Logger.h 2 files changed, 17 insertions(+), 93 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/02/5702/1 diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index d246584..1c462e7 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -50,7 +50,8 @@ // Reference to a global config table, used all over the system. extern ConfigurationTable gConfig; - +// Global log level threshold: +int config_log_level; /**@ The global alarms table. */ //@{ @@ -97,22 +98,6 @@ return -1; } -/** Given a string, return the corresponding level name. */ -int lookupLevel(const string& key) -{ - string val = gConfig.getStr(key); - int level = levelStringToInt(val); - - if (level == -1) { - string defaultLevel = gConfig.mSchema["Log.Level"].getDefaultValue(); - level = levelStringToInt(defaultLevel); - _LOG(CRIT) << "undefined logging level (" << key << " = \"" << val << "\") defaulting to \"" << defaultLevel << ".\" Valid levels are: EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO or DEBUG"; - gConfig.set(key, defaultLevel); - } - - return level; -} - static std::string format(const char *fmt, ...) { va_list ap; @@ -138,62 +123,6 @@ { return os << ss.str(); } - -int getLoggingLevel(const char* filename) -{ - // Default level? - if (!filename) return lookupLevel("Log.Level"); - - // This can afford to be inefficient since it is not called that often. - const string keyName = string("Log.Level.") + string(filename); - if (gConfig.defines(keyName)) return lookupLevel(keyName); - return lookupLevel("Log.Level"); -} - - - -int gGetLoggingLevel(const char* filename) -{ - // This is called a lot and needs to be efficient. - - static Mutex sLogCacheLock; - static map sLogCache; - static unsigned sCacheCount; - static const unsigned sCacheRefreshCount = 1000; - - if (filename==NULL) return gGetLoggingLevel(""); - - HashString hs(filename); - uint64_t key = hs.hash(); - - sLogCacheLock.lock(); - // Time for a cache flush? - if (sCacheCount>sCacheRefreshCount) { - sLogCache.clear(); - sCacheCount=0; - } - // Is it cached already? - map::const_iterator where = sLogCache.find(key); - sCacheCount++; - if (where!=sLogCache.end()) { - int retVal = where->second; - sLogCacheLock.unlock(); - return retVal; - } - // Look it up in the config table and cache it. - // FIXME: Figure out why unlock and lock below fix the config table deadlock. - // (pat) Probably because getLoggingLevel may call LOG recursively via lookupLevel(). - sLogCacheLock.unlock(); - int level = getLoggingLevel(filename); - sLogCacheLock.lock(); - sLogCache.insert(pair(key,level)); - sLogCacheLock.unlock(); - return level; -} - - - - // copies the alarm list and returns it. list supposed to be small. list gGetLoggerAlarms() @@ -268,26 +197,21 @@ -void gLogInit(const char* name, const char* level, int facility) +void gLogInit(const char* name, const char* level, int facility, char* fn) { // Set the level if one has been specified. - if (level) { - gConfig.set("Log.Level",level); - } + if (level) + config_log_level = levelStringToInt(level); // Both the transceiver and OpenBTS use this same facility, but only OpenBTS/OpenNodeB may use this log file: - string str = gConfig.getStr("Log.File"); - if (gLogToFile==NULL && str.length() && 0==strncmp(gCmdName,"Open",4)) { - const char *fn = str.c_str(); - if (fn && *fn && strlen(fn)>3) { // strlen because a garbage char is getting in sometimes. - gLogToFile = fopen(fn,"w"); // New log file each time we start. - if (gLogToFile) { - time_t now; - time(&now); - fprintf(gLogToFile,"Starting at %s",ctime(&now)); - fflush(gLogToFile); - std::cout << "Logging to file: " << fn << "\n"; - } + if (!gLogToFile && fn) { + gLogToFile = fopen(fn,"w"); // New log file each time we start. + if (gLogToFile) { + time_t now; + time(&now); + fprintf(gLogToFile,"Starting at %s",ctime(&now)); + fflush(gLogToFile); + std::cout << "Logging to file: " << fn << "\n"; } } diff --git a/CommonLibs/Logger.h b/CommonLibs/Logger.h index 68c5a9b..099d300 100644 --- a/CommonLibs/Logger.h +++ b/CommonLibs/Logger.h @@ -40,11 +40,13 @@ #include #include +extern int config_log_level; + #define _LOG(level) \ Log(LOG_##level).get() << pthread_self() \ << timestr() << " " __FILE__ ":" << __LINE__ << ":" << __FUNCTION__ << ": " -#define IS_LOG_LEVEL(wLevel) (gGetLoggingLevel(__FILE__)>=LOG_##wLevel) +#define IS_LOG_LEVEL(wLevel) (config_log_level>=LOG_##wLevel) #ifdef NDEBUG #define LOG(wLevel) \ @@ -128,9 +130,7 @@ /**@ Global control and initialization of the logging system. */ //@{ /** Initialize the global logging system. */ -void gLogInit(const char* name, const char* level=NULL, int facility=LOG_USER); -/** Get the logging level associated with a given file. */ -int gGetLoggingLevel(const char *filename=NULL); +void gLogInit(const char* name, const char* level=NULL, int facility=LOG_USER, char* fn=NULL); /** Allow early logging when still in constructors */ void gLogEarly(int level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); //@} -- To view, visit https://gerrit.osmocom.org/5702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:42:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 14:42:15 +0000 Subject: [PATCH] osmo-trx[master]: Drop use of ConfigurationTable gConfig Message-ID: Review at https://gerrit.osmocom.org/5703 Drop use of ConfigurationTable gConfig After latest changes, it is not being used anymore. Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de --- M CommonLibs/LogTest.cpp M CommonLibs/Logger.cpp M Transceiver52M/osmo-trx.cpp 3 files changed, 0 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/03/5703/1 diff --git a/CommonLibs/LogTest.cpp b/CommonLibs/LogTest.cpp index 882707d..2245386 100644 --- a/CommonLibs/LogTest.cpp +++ b/CommonLibs/LogTest.cpp @@ -28,10 +28,6 @@ #include #include "Logger.h" -#include "Configuration.h" - -ConfigurationTable gConfig; -//ConfigurationTable gConfig("example.config"); void printAlarms() { diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index 1c462e7..5b8da99 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -32,7 +32,6 @@ #include #include // For gettimeofday -#include "Configuration.h" #include "Logger.h" #include "Threads.h" // pat added @@ -41,15 +40,11 @@ using namespace std; // Switches to enable/disable logging targets -// MUST BE DEFINED BEFORE gConfig FOR gLogEarly() TO WORK CORRECTLY bool gLogToConsole = true; bool gLogToSyslog = false; FILE *gLogToFile = NULL; Mutex gLogToLock; - -// Reference to a global config table, used all over the system. -extern ConfigurationTable gConfig; // Global log level threshold: int config_log_level; diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 3f72fb7..44da638 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -31,7 +31,6 @@ #include #include -#include extern "C" { #include "convolve.h" @@ -81,8 +80,6 @@ bool edge; int sched_rr; }; - -ConfigurationTable gConfig; volatile bool gshutdown = false; -- To view, visit https://gerrit.osmocom.org/5703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 14:42:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 14:42:15 +0000 Subject: [PATCH] osmo-trx[master]: Remove Configuration module and libsqlite dependency Message-ID: Review at https://gerrit.osmocom.org/5704 Remove Configuration module and libsqlite dependency Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa --- M AUTHORS D CommonLibs/Configuration.cpp D CommonLibs/Configuration.h D CommonLibs/ConfigurationTest.cpp M CommonLibs/Makefile.am D CommonLibs/sqlite3util.cpp D CommonLibs/sqlite3util.h M Makefile.am M Transceiver52M/Makefile.am M configure.ac M debian/control M debian/copyright 12 files changed, 8 insertions(+), 1,951 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/04/5704/1 diff --git a/AUTHORS b/AUTHORS index 65532aa..a956de5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,9 +24,6 @@ CommonLibs/Assert.h CommonLibs/BitVector.cpp CommonLibs/BitVectorTest.cpp - CommonLibs/Configuration.cpp - CommonLibs/Configuration.h - CommonLibs/ConfigurationTest.cpp CommonLibs/Interthread.h CommonLibs/InterthreadTest.cpp CommonLibs/LinkedLists.cpp diff --git a/CommonLibs/Configuration.cpp b/CommonLibs/Configuration.cpp deleted file mode 100644 index 4661903..0000000 --- a/CommonLibs/Configuration.cpp +++ /dev/null @@ -1,1160 +0,0 @@ -/* -* Copyright 2008, 2009, 2010 Free Software Foundation, Inc. -* Copyright 2010 Kestrel Signal Processing, Inc. -* Copyright 2011, 2012 Range Networks, Inc. -* -* -* This software is distributed under the terms of the GNU Affero Public License. -* See the COPYING file in the main directory for details. -* -* This use of this software may be subject to additional restrictions. -* See the LEGAL file in the main directory for details. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -*/ - - -#include "Configuration.h" -#include "Logger.h" -#include -#include -#include - -#ifdef DEBUG_CONFIG -#define debugLogEarly gLogEarly -#else -#define debugLogEarly(x,y,z) -#endif - - -using namespace std; - -char gCmdName[20] = {0}; // Use a char* to avoid avoid static initialization of string, and race at startup. - -static const char* createConfigTable = { - "CREATE TABLE IF NOT EXISTS CONFIG (" - "KEYSTRING TEXT UNIQUE NOT NULL, " - "VALUESTRING TEXT, " - "STATIC INTEGER DEFAULT 0, " - "OPTIONAL INTEGER DEFAULT 0, " - "COMMENTS TEXT DEFAULT ''" - ")" -}; - -static std::string replaceAll(const std::string input, const std::string search, const std::string replace) -{ - std::string output = input; - size_t index = 0; - - while (true) { - index = output.find(search, index); - if (index == std::string::npos) { - break; - } - - output.replace(index, replace.length(), replace); - index += replace.length(); - } - - return output; -} - - -float ConfigurationRecord::floatNumber() const -{ - float val; - sscanf(mValue.c_str(),"%f",&val); - return val; -} - - -ConfigurationTable::ConfigurationTable(const char* filename, const char *wCmdName, ConfigurationKeyMap wSchema) -{ - gLogEarly(LOG_INFO, "opening configuration table from path %s", filename); - // Connect to the database. - int rc = sqlite3_open(filename,&mDB); - // (pat) When I used malloc here, sqlite3 sporadically crashes. - if (wCmdName) { - strncpy(gCmdName,wCmdName,18); - gCmdName[18] = 0; - strcat(gCmdName,":"); - } - if (rc) { - gLogEarly(LOG_EMERG, "cannot open configuration database at %s, error message: %s", filename, sqlite3_errmsg(mDB)); - sqlite3_close(mDB); - mDB = NULL; - return; - } - // Create the table, if needed. - if (!sqlite3_command(mDB,createConfigTable)) { - gLogEarly(LOG_EMERG, "cannot create configuration table in database at %s, error message: %s", filename, sqlite3_errmsg(mDB)); - } - - // Build CommonLibs schema - ConfigurationKey *tmp; - tmp = new ConfigurationKey("Log.File","", - "", - ConfigurationKey::DEVELOPER, - ConfigurationKey::FILEPATH_OPT,// audited - "", - false, - "Path to use for textfile based logging. " - "By default, this feature is disabled. " - "To enable, specify an absolute path to the file you wish to use, eg: /tmp/my-debug.log. " - "To disable again, execute \"unconfig Log.File\"." - ); - mSchema[tmp->getName()] = *tmp; - delete tmp; - - tmp = new ConfigurationKey("Log.Level","NOTICE", - "", - ConfigurationKey::CUSTOMER, - ConfigurationKey::CHOICE, - "EMERG|EMERGENCY - report serious faults associated with service failure or hardware damage," - "ALERT|ALERT - report likely service disruption caused by misconfiguration or poor connectivity," - "CRIT|CRITICAL - report anomalous events that are likely to degrade service," - "ERR|ERROR - report internal errors of the software that may result in degradation of service in unusual circumstances," - "WARNING|WARNING - report anomalous events that may indicate a degradation of normal service," - "NOTICE|NOTICE - report anomalous events that probably do not affect service but may be of interest to network operators," - "INFO|INFORMATION - report normal events," - "DEBUG|DEBUG - only for use by developers and will degrade system performance", - false, - "Default logging level when no other level is defined for a file." - ); - mSchema[tmp->getName()] = *tmp; - delete tmp; - - // Add application specific schema - mSchema.insert(wSchema.begin(), wSchema.end()); - - // Init the cross checking callback to something predictable - mCrossCheck = NULL; -} - -string ConfigurationTable::getDefaultSQL(const std::string& program, const std::string& version) -{ - stringstream ss; - ConfigurationKeyMap::iterator mp; - - ss << "--" << endl; - ss << "-- This file was generated using: " << program << " --gensql" << endl; - ss << "-- binary version: " << version << endl; - ss << "--" << endl; - ss << "-- Future changes should not be put in this file directly but" << endl; - ss << "-- rather in the program's ConfigurationKey schema." << endl; - ss << "--" << endl; - ss << "PRAGMA foreign_keys=OFF;" << endl; - ss << "BEGIN TRANSACTION;" << endl; - ss << "CREATE TABLE CONFIG ( KEYSTRING TEXT UNIQUE NOT NULL, VALUESTRING TEXT, STATIC INTEGER DEFAULT 0, OPTIONAL INTEGER DEFAULT 0, COMMENTS TEXT DEFAULT '');" << endl; - - mp = mSchema.begin(); - while (mp != mSchema.end()) { - ss << "INSERT INTO \"CONFIG\" VALUES("; - // name - ss << "'" << mp->first << "',"; - // default - ss << "'" << mp->second.getDefaultValue() << "',"; - // static - if (mp->second.isStatic()) { - ss << "1"; - } else { - ss << "0"; - } - ss << ","; - // optional - ss << "0,"; - // description - ss << "'"; - if (mp->second.getType() == ConfigurationKey::BOOLEAN) { - ss << "1=enabled, 0=disabled - "; - } - ss << mp->second.getDescription(); - if (mp->second.isStatic()) { - ss << " Static."; - } - ss << "'"; - ss << ");" << endl; - mp++; - } - - ss << "COMMIT;" << endl; - ss << endl; - - return ss.str(); -} - -string ConfigurationTable::getTeX(const std::string& program, const std::string& version) -{ - stringstream ss; - ConfigurationKeyMap::iterator mp; - - ss << "% START AUTO-GENERATED CONTENT" << endl; - ss << "% -- these sections were generated using: " << program << " --gentex" << endl; - ss << "% -- binary version: " << version << endl; - - ss << "\\subsection{Customer Site Parameters}" << endl; - ss << "These parameters must be changed to fit your site." << endl; - ss << "\\begin{itemize}" << endl; - mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->second.getVisibility() == ConfigurationKey::CUSTOMERSITE) { - ss << " \\item "; - // name - ss << mp->first << " -- "; - // description - ss << mp->second.getDescription(); - ss << endl; - } - mp++; - } - ss << "\\end{itemize}" << endl; - ss << endl; - - ss << "\\subsection{Customer Tuneable Parameters}" << endl; - ss << "These parameters can be changed to optimize your site." << endl; - ss << "\\begin{itemize}" << endl; - mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->second.getVisibility() != ConfigurationKey::CUSTOMERSITE && - ( - mp->second.getVisibility() == ConfigurationKey::CUSTOMER || - mp->second.getVisibility() == ConfigurationKey::CUSTOMERTUNE || - mp->second.getVisibility() == ConfigurationKey::CUSTOMERWARN - )) { - ss << " \\item "; - // name - ss << mp->first << " -- "; - // description - ss << mp->second.getDescription(); - ss << endl; - } - mp++; - } - ss << "\\end{itemize}" << endl; - ss << endl; - - ss << "\\subsection{Developer/Factory Parameters}" << endl; - ss << "These parameters should only be changed by when developing new code." << endl; - ss << "\\begin{itemize}" << endl; - mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->second.getVisibility() == ConfigurationKey::FACTORY || - mp->second.getVisibility() == ConfigurationKey::DEVELOPER) { - ss << " \\item "; - // name - ss << mp->first << " -- "; - // description - ss << mp->second.getDescription(); - ss << endl; - } - mp++; - } - ss << "\\end{itemize}" << endl; - ss << "% END AUTO-GENERATED CONTENT" << endl; - ss << endl; - - string tmp = replaceAll(ss.str(), "^", "\\^"); - return replaceAll(tmp, "_", "\\_"); -} - -bool ConfigurationTable::defines(const string& key) -{ - try { - ScopedLock lock(mLock); - return lookup(key).defined(); - } catch (ConfigurationTableKeyNotFound) { - debugLogEarly(LOG_ALERT, "configuration parameter %s not found", key.c_str()); - return false; - } -} - -bool ConfigurationTable::keyDefinedInSchema(const std::string& name) -{ - return mSchema.find(name) == mSchema.end() ? false : true; -} - -bool ConfigurationTable::isValidValue(const std::string& name, const std::string& val) { - bool ret = false; - - ConfigurationKey key = mSchema[name]; - - switch (key.getType()) { - case ConfigurationKey::BOOLEAN: { - if (val == "1" || val == "0") { - ret = true; - } - break; - } - - case ConfigurationKey::CHOICE_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::CHOICE: { - int startPos = -1; - uint endPos = 0; - - std::string tmp = key.getValidValues(); - - do { - startPos++; - if ((endPos = tmp.find('|', startPos)) != std::string::npos) { - if (val == tmp.substr(startPos, endPos-startPos)) { - ret = true; - break; - } - } else { - if (val == tmp.substr(startPos, tmp.find(',', startPos)-startPos)) { - ret = true; - break; - } - } - - } while ((startPos = tmp.find(',', startPos)) != (int)std::string::npos); - break; - } - - case ConfigurationKey::CIDR_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::CIDR: { - uint delimiter; - std::string ip; - int cidr = -1; - - delimiter = val.find('/'); - if (delimiter != std::string::npos) { - ip = val.substr(0, delimiter); - std::stringstream(val.substr(delimiter+1)) >> cidr; - if (ConfigurationKey::isValidIP(ip) && 0 <= cidr && cidr <= 32) { - ret = true; - } - } - break; - } - - case ConfigurationKey::FILEPATH_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::FILEPATH: { - regex_t r; - const char* expression = "^[a-zA-Z0-9/_.-]+$"; - int result = regcomp(&r, expression, REG_EXTENDED); - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - break;//abort(); - } - if (regexec(&r, val.c_str(), 0, NULL, 0)==0) { - ret = true; - } - regfree(&r); - break; - } - - case ConfigurationKey::IPADDRESS_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::IPADDRESS: { - ret = ConfigurationKey::isValidIP(val); - break; - } - - case ConfigurationKey::IPANDPORT: { - uint delimiter; - std::string ip; - int port = -1; - - delimiter = val.find(':'); - if (delimiter != std::string::npos) { - ip = val.substr(0, delimiter); - std::stringstream(val.substr(delimiter+1)) >> port; - if (ConfigurationKey::isValidIP(ip) && 1 <= port && port <= 65535) { - ret = true; - } - } - break; - } - - case ConfigurationKey::MIPADDRESS_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::MIPADDRESS: { - int startPos = -1; - uint endPos = 0; - - do { - startPos++; - endPos = val.find(' ', startPos); - if (ConfigurationKey::isValidIP(val.substr(startPos, endPos-startPos))) { - ret = true; - } else { - ret = false; - break; - } - - } while ((startPos = endPos) != (int)std::string::npos); - break; - } - - case ConfigurationKey::PORT_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::PORT: { - int intVal; - - std::stringstream(val) >> intVal; - - if (1 <= intVal && intVal <= 65535) { - ret = true; - } - break; - } - - case ConfigurationKey::REGEX_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::REGEX: { - regex_t r; - const char* expression = val.c_str(); - int result = regcomp(&r, expression, REG_EXTENDED); - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - } else { - ret = true; - } - regfree(&r); - break; - } - - case ConfigurationKey::STRING_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::STRING: { - regex_t r; - const char* expression = key.getValidValues().c_str(); - int result = regcomp(&r, expression, REG_EXTENDED); - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - break;//abort(); - } - if (regexec(&r, val.c_str(), 0, NULL, 0)==0) { - ret = true; - } - regfree(&r); - break; - } - - case ConfigurationKey::VALRANGE: { - regex_t r; - int result; - if (key.getValidValues().find('.') != std::string::npos) { - result = regcomp(&r, "^[0-9.-]+$", REG_EXTENDED); - } else { - result = regcomp(&r, "^[0-9-]+$", REG_EXTENDED); - } - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - break;//abort(); - } - if (regexec(&r, val.c_str(), 0, NULL, 0)!=0) { - ret = false; - } else if (key.getValidValues().find('.') != std::string::npos) { - ret = ConfigurationKey::isInValRange(key, val, false); - } else { - ret = ConfigurationKey::isInValRange(key, val, true); - } - - regfree(&r); - break; - } - } - - return ret; -} - -ConfigurationKeyMap ConfigurationTable::getSimilarKeys(const std::string& snippet) { - ConfigurationKeyMap tmp; - - ConfigurationKeyMap::const_iterator mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->first.find(snippet) != std::string::npos) { - tmp[mp->first] = mp->second; - } - mp++; - } - - return tmp; -} - -const ConfigurationRecord& ConfigurationTable::lookup(const string& key) -{ - assert(mDB); - checkCacheAge(); - // We assume the caller holds mLock. - // So it is OK to return a reference into the cache. - - // Check the cache. - // This is cheap. - ConfigurationMap::const_iterator where = mCache.find(key); - if (where!=mCache.end()) { - if (where->second.defined()) return where->second; - throw ConfigurationTableKeyNotFound(key); - } - - // Check the database. - // This is more expensive. - char *value = NULL; - sqlite3_single_lookup(mDB,"CONFIG", - "KEYSTRING",key.c_str(),"VALUESTRING",value); - - // value found, cache the result - if (value) { - mCache[key] = ConfigurationRecord(value); - // key definition found, cache the default - } else if (keyDefinedInSchema(key)) { - mCache[key] = ConfigurationRecord(mSchema[key].getDefaultValue()); - // total miss, cache the error - } else { - mCache[key] = ConfigurationRecord(false); - throw ConfigurationTableKeyNotFound(key); - } - - free(value); - - // Leave mLock locked. The caller holds it still. - return mCache[key]; -} - - - -bool ConfigurationTable::isStatic(const string& key) -{ - if (keyDefinedInSchema(key)) { - return mSchema[key].isStatic(); - } else { - return false; - } -} - - - - -string ConfigurationTable::getStr(const string& key) -{ - // We need the lock because rec is a reference into the cache. - try { - ScopedLock lock(mLock); - return lookup(key).value(); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - - -bool ConfigurationTable::getBool(const string& key) -{ - try { - return getNum(key) != 0; - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - - -long ConfigurationTable::getNum(const string& key) -{ - // We need the lock because rec is a reference into the cache. - try { - ScopedLock lock(mLock); - return lookup(key).number(); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - - -float ConfigurationTable::getFloat(const string& key) -{ - try { - ScopedLock lock(mLock); - return lookup(key).floatNumber(); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - -std::vector ConfigurationTable::getVectorOfStrings(const string& key) -{ - // Look up the string. - char *line=NULL; - try { - ScopedLock lock(mLock); - const ConfigurationRecord& rec = lookup(key); - line = strdup(rec.value().c_str()); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } - - assert(line); - char *lp = line; - - // Parse the string. - std::vector retVal; - while (lp) { - while (*lp==' ') lp++; - if (*lp == '\0') break; - char *tp = strsep(&lp," "); - if (!tp) break; - retVal.push_back(tp); - } - free(line); - return retVal; -} - - -std::vector ConfigurationTable::getVector(const string& key) -{ - // Look up the string. - char *line=NULL; - try { - ScopedLock lock(mLock); - const ConfigurationRecord& rec = lookup(key); - line = strdup(rec.value().c_str()); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } - - assert(line); - char *lp = line; - - // Parse the string. - std::vector retVal; - while (lp) { - // Watch for multiple or trailing spaces. - while (*lp==' ') lp++; - if (*lp=='\0') break; - retVal.push_back(strtol(lp,NULL,0)); - strsep(&lp," "); - } - free(line); - return retVal; -} - - -bool ConfigurationTable::remove(const string& key) -{ - assert(mDB); - - ScopedLock lock(mLock); - // Clear the cache entry and the database. - ConfigurationMap::iterator where = mCache.find(key); - if (where!=mCache.end()) mCache.erase(where); - // Really remove it. - string cmd = "DELETE FROM CONFIG WHERE KEYSTRING=='"+key+"'"; - return sqlite3_command(mDB,cmd.c_str()); -} - - - -void ConfigurationTable::find(const string& pat, ostream& os) const -{ - // Prepare the statement. - string cmd = "SELECT KEYSTRING,VALUESTRING FROM CONFIG WHERE KEYSTRING LIKE \"%" + pat + "%\""; - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(mDB,&stmt,cmd.c_str())) return; - // Read the result. - int src = sqlite3_run_query(mDB,stmt); - while (src==SQLITE_ROW) { - const char* value = (const char*)sqlite3_column_text(stmt,1); - os << sqlite3_column_text(stmt,0) << " "; - int len = 0; - if (value) { - len = strlen(value); - } - if (len && value) os << value << endl; - else os << "(disabled)" << endl; - src = sqlite3_run_query(mDB,stmt); - } - sqlite3_finalize(stmt); -} - - -ConfigurationRecordMap ConfigurationTable::getAllPairs() const -{ - ConfigurationRecordMap tmp; - - // Prepare the statement. - string cmd = "SELECT KEYSTRING,VALUESTRING FROM CONFIG"; - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(mDB,&stmt,cmd.c_str())) return tmp; - // Read the result. - int src = sqlite3_run_query(mDB,stmt); - while (src==SQLITE_ROW) { - const char* key = (const char*)sqlite3_column_text(stmt,0); - const char* value = (const char*)sqlite3_column_text(stmt,1); - if (key && value) { - tmp[string(key)] = ConfigurationRecord(value); - } else if (key && !value) { - tmp[string(key)] = ConfigurationRecord(false); - } - src = sqlite3_run_query(mDB,stmt); - } - sqlite3_finalize(stmt); - - return tmp; -} - -bool ConfigurationTable::set(const string& key, const string& value) -{ - assert(mDB); - ScopedLock lock(mLock); - string cmd = "INSERT OR REPLACE INTO CONFIG (KEYSTRING,VALUESTRING,OPTIONAL) VALUES (\"" + key + "\",\"" + value + "\",1)"; - bool success = sqlite3_command(mDB,cmd.c_str()); - // Cache the result. - if (success) mCache[key] = ConfigurationRecord(value); - return success; -} - -bool ConfigurationTable::set(const string& key, long value) -{ - char buffer[30]; - sprintf(buffer,"%ld",value); - return set(key,buffer); -} - - -bool ConfigurationTable::set(const string& key) -{ - assert(mDB); - ScopedLock lock(mLock); - string cmd = "INSERT OR REPLACE INTO CONFIG (KEYSTRING,VALUESTRING,OPTIONAL) VALUES (\"" + key + "\",NULL,1)"; - bool success = sqlite3_command(mDB,cmd.c_str()); - if (success) mCache[key] = ConfigurationRecord(true); - return success; -} - - -void ConfigurationTable::checkCacheAge() -{ - // mLock is set by caller - static time_t timeOfLastPurge = 0; - time_t now = time(NULL); - // purge every 3 seconds - // purge period cannot be configuration parameter - if (now - timeOfLastPurge < 3) return; - timeOfLastPurge = now; - // this is purge() without the lock - ConfigurationMap::iterator mp = mCache.begin(); - while (mp != mCache.end()) { - ConfigurationMap::iterator prev = mp; - mp++; - mCache.erase(prev); - } -} - - -void ConfigurationTable::purge() -{ - ScopedLock lock(mLock); - ConfigurationMap::iterator mp = mCache.begin(); - while (mp != mCache.end()) { - ConfigurationMap::iterator prev = mp; - mp++; - mCache.erase(prev); - } -} - - -void ConfigurationTable::setUpdateHook(void(*func)(void *,int ,char const *,char const *,sqlite3_int64)) -{ - assert(mDB); - sqlite3_update_hook(mDB,func,NULL); -} - - -void ConfigurationTable::setCrossCheckHook(vector (*wCrossCheck)(const string&)) -{ - mCrossCheck = wCrossCheck; -} - - -vector ConfigurationTable::crossCheck(const string& key) { - vector ret; - - if (mCrossCheck != NULL) { - ret = mCrossCheck(key); - } - - return ret; -} - -void HashString::computeHash() -{ - // FIXME -- Someone needs to review this hash function. - const char* cstr = c_str(); - mHash = 0; - for (unsigned i=0; i> 32); - mHash = mHash*127 + cstr[i]; - } -} - - -void SimpleKeyValue::addItem(const char* pair_orig) -{ - char *pair = strdup(pair_orig); - char *key = pair; - char *mark = strchr(pair,'='); - if (!mark) return; - *mark = '\0'; - char *value = mark+1; - mMap[key] = value; - free(pair); -} - - - -const char* SimpleKeyValue::get(const char* key) const -{ - HashStringMap::const_iterator p = mMap.find(key); - if (p==mMap.end()) return NULL; - return p->second.c_str(); -} - - -void SimpleKeyValue::addItems(const char* pairs_orig) -{ - char *pairs = strdup(pairs_orig); - char *thisPair; - while ((thisPair=strsep(&pairs," "))!=NULL) { - addItem(thisPair); - } - free(pairs); -} - - -bool ConfigurationKey::isValidIP(const std::string& ip) { - struct sockaddr_in sa; - return inet_pton(AF_INET, ip.c_str(), &(sa.sin_addr)) != 0; -} - - -void ConfigurationKey::getMinMaxStepping(const ConfigurationKey &key, std::string &min, std::string &max, std::string &stepping) { - uint delimiter; - int startPos; - uint endPos; - - std::string tmp = key.getValidValues(); - stepping = "1"; - - // grab steps if they're defined - startPos = tmp.find('('); - if (startPos != (int)std::string::npos) { - endPos = tmp.find(')'); - stepping = tmp.substr(startPos+1, endPos-startPos-1); - tmp = tmp.substr(0, startPos); - } - startPos = 0; - - delimiter = tmp.find(':', startPos); - min = tmp.substr(startPos, delimiter-startPos); - max = tmp.substr(delimiter+1, tmp.find(',', delimiter)-delimiter-1); -} - - -template bool ConfigurationKey::isInValRange(const ConfigurationKey &key, const std::string& val, const bool isInteger) { - bool ret = false; - - T convVal; - T min; - T max; - T steps; - std::string strMin; - std::string strMax; - std::string strSteps; - - std::stringstream(val) >> convVal; - - ConfigurationKey::getMinMaxStepping(key, strMin, strMax, strSteps); - std::stringstream(strMin) >> min; - std::stringstream(strMax) >> max; - std::stringstream(strSteps) >> steps; - - // TODO : only ranges checked, steps not enforced - if (isInteger) { - if (val.find('.') == std::string::npos && min <= convVal && convVal <= max) { - ret = true; - } - } else { - if (min <= convVal && convVal <= max) { - ret = true; - } - } - - return ret; -} - -const std::string ConfigurationKey::getARFCNsString() { - stringstream ss; - int i; - float downlink; - float uplink; - - // 128:251 GSM850 - downlink = 869.2; - uplink = 824.2; - for (i = 128; i <= 251; i++) { - ss << i << "|GSM850 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - // 1:124 PGSM900 - downlink = 935.2; - uplink = 890.2; - for (i = 1; i <= 124; i++) { - ss << i << "|PGSM900 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - // 512:885 DCS1800 - downlink = 1805.2; - uplink = 1710.2; - for (i = 512; i <= 885; i++) { - ss << i << "|DCS1800 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - // 512:810 PCS1900 - downlink = 1930.2; - uplink = 1850.2; - for (i = 512; i <= 810; i++) { - ss << i << "|PCS1900 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - ss << endl; - - return ss.str(); -} - -const std::string ConfigurationKey::visibilityLevelToString(const ConfigurationKey::VisibilityLevel& visibility) { - std::string ret = "UNKNOWN ERROR"; - - switch (visibility) { - case ConfigurationKey::CUSTOMER: - ret = "customer - can be freely changed by the customer without any detriment to their system"; - break; - case ConfigurationKey::CUSTOMERSITE: - ret = "customer site - these values are different for each BTS and should not be left default"; - break; - case ConfigurationKey::CUSTOMERTUNE: - ret = "customer tune - should only be changed to tune an installation to better suit the physical environment or MS usage pattern"; - break; - case ConfigurationKey::CUSTOMERWARN: - ret = "customer warn - a warning will be presented and confirmation required before changing this sensitive setting"; - break; - case ConfigurationKey::DEVELOPER: - ret = "developer - should only be changed by developers to debug/optimize the implementation"; - break; - case ConfigurationKey::FACTORY: - ret = "factory - set once at the factory, should never be changed"; - break; - } - - return ret; -} - -const std::string ConfigurationKey::typeToString(const ConfigurationKey::Type& type) { - std::string ret = "UNKNOWN ERROR"; - - switch (type) { - case BOOLEAN: - ret = "boolean"; - break; - case CHOICE_OPT: - ret = "multiple choice (optional)"; - break; - case CHOICE: - ret = "multiple choice"; - break; - case CIDR_OPT: - ret = "CIDR notation (optional)"; - break; - case CIDR: - ret = "CIDR notation"; - break; - case FILEPATH_OPT: - ret = "file path (optional)"; - break; - case FILEPATH: - ret = "file path"; - break; - case IPADDRESS_OPT: - ret = "IP address (optional)"; - break; - case IPADDRESS: - ret = "IP address"; - break; - case IPANDPORT: - ret = "IP address and port"; - break; - case MIPADDRESS_OPT: - ret = "space-separated list of IP addresses (optional)"; - break; - case MIPADDRESS: - ret = "space-separated list of IP addresses"; - break; - case PORT_OPT: - ret = "IP port (optional)"; - break; - case PORT: - ret = "IP port"; - break; - case REGEX_OPT: - ret = "regular expression (optional)"; - break; - case REGEX: - ret = "regular expression"; - break; - case STRING_OPT: - ret = "string (optional)"; - break; - case STRING: - ret = "string"; - break; - case VALRANGE: - ret = "value range"; - break; - } - - return ret; -} - -void ConfigurationKey::printKey(const ConfigurationKey &key, const std::string& currentValue, ostream& os) { - os << key.getName() << " "; - if (!currentValue.length()) { - os << "(disabled)"; - } else { - os << currentValue; - } - if (currentValue.compare(key.getDefaultValue()) == 0) { - os << " [default]"; - } - os << endl; -} - -void ConfigurationKey::printDescription(const ConfigurationKey &key, ostream& os) { - std::string tmp; - - os << " - description: " << key.getDescription() << std::endl; - if (key.getUnits().length()) { - os << " - units: " << key.getUnits() << std::endl; - } - os << " - type: " << ConfigurationKey::typeToString(key.getType()) << std::endl; - if (key.getDefaultValue().length()) { - os << " - default value: " << key.getDefaultValue() << std::endl; - } - os << " - visibility level: " << ConfigurationKey::visibilityLevelToString(key.getVisibility()) << std::endl; - os << " - static: " << key.isStatic() << std::endl; - - tmp = key.getValidValues(); - if (key.getType() == ConfigurationKey::VALRANGE) { - int startPos = tmp.find('('); - uint delimiter = 0; - if (startPos != (int)std::string::npos) { - tmp = tmp.substr(0, startPos); - } - startPos = -1; - - do { - startPos++; - delimiter = tmp.find(':', startPos); - os << " - valid values: " << "from " << tmp.substr(startPos, delimiter-startPos) << " to " - << tmp.substr(delimiter+1, tmp.find(',', delimiter)-delimiter-1) << std::endl; - - } while ((startPos = tmp.find(',', startPos)) != (int)std::string::npos); - - } else if (key.getType() == ConfigurationKey::CHOICE) { - int startPos = -1; - uint endPos = 0; - - do { - startPos++; - if ((endPos = tmp.find('|', startPos)) != std::string::npos) { - os << " - valid values: " << tmp.substr(startPos, endPos-startPos); - os << " = " << tmp.substr(endPos+1, tmp.find(',', endPos)-endPos-1) << std::endl; - } else { - os << " - valid values: " << tmp.substr(startPos, tmp.find(',', startPos)-startPos) << std::endl; - } - - } while ((startPos = tmp.find(',', startPos)) != (int)std::string::npos); - - } else if (key.getType() == ConfigurationKey::BOOLEAN) { - os << " - valid values: 0 = disabled" << std::endl; - os << " - valid values: 1 = enabled" << std::endl; - - } else if (key.getType() == ConfigurationKey::STRING) { - os << " - valid val regex: " << tmp << std::endl; - - } else if (key.getValidValues().length()) { - os << " - raw valid values: " << tmp << std::endl; - } -} - - -// vim: ts=4 sw=4 diff --git a/CommonLibs/Configuration.h b/CommonLibs/Configuration.h deleted file mode 100644 index cd4838e..0000000 --- a/CommonLibs/Configuration.h +++ /dev/null @@ -1,422 +0,0 @@ -/* -* Copyright 2009, 2010 Free Software Foundation, Inc. -* Copyright 2010 Kestrel Signal Processing, Inc. -* Copyright 2011, 2012 Range Networks, Inc. -* -* This software is distributed under the terms of the GNU Affero Public License. -* See the COPYING file in the main directory for details. -* -* This use of this software may be subject to additional restrictions. -* See the LEGAL file in the main directory for details. - - 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 . - -*/ - - -#ifndef CONFIGURATION_H -#define CONFIGURATION_H - - -#include "sqlite3util.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - - -/** A class for configuration file errors. */ -class ConfigurationTableError {}; -extern char gCmdName[]; // Gotta be global, gotta be char*, gotta love it. - -/** An exception thrown when a given config key isn't found. */ -class ConfigurationTableKeyNotFound : public ConfigurationTableError { - - private: - - std::string mKey; - - public: - - ConfigurationTableKeyNotFound(const std::string& wKey) - :mKey(wKey) - { } - - const std::string& key() const { return mKey; } - -}; - - -class ConfigurationRecord { - - private: - - std::string mValue; - long mNumber; - bool mDefined; - - public: - - ConfigurationRecord(bool wDefined=true): - mDefined(wDefined) - { } - - ConfigurationRecord(const std::string& wValue): - mValue(wValue), - mNumber(strtol(wValue.c_str(),NULL,0)), - mDefined(true) - { } - - ConfigurationRecord(const char* wValue): - mValue(std::string(wValue)), - mNumber(strtol(wValue,NULL,0)), - mDefined(true) - { } - - - const std::string& value() const { return mValue; } - long number() const { return mNumber; } - bool defined() const { return mDefined; } - - float floatNumber() const; - -}; - - -/** A string class that uses a hash function for comparison. */ -class HashString : public std::string { - - - protected: - - uint64_t mHash; - - void computeHash(); - - - public: - - HashString(const char* src) - :std::string(src) - { - computeHash(); - } - - HashString(const std::string& src) - :std::string(src) - { - computeHash(); - } - - HashString() - { - mHash=0; - } - - HashString& operator=(std::string& src) - { - std::string::operator=(src); - computeHash(); - return *this; - } - - HashString& operator=(const char* src) - { - std::string::operator=(src); - computeHash(); - return *this; - } - - bool operator==(const HashString& other) - { - return mHash==other.mHash; - } - - bool operator<(const HashString& other) - { - return mHash(const HashString& other) - { - return mHash ConfigurationRecordMap; -typedef std::map ConfigurationMap; -class ConfigurationKey; -typedef std::map ConfigurationKeyMap; - -/** - A class for maintaining a configuration key-value table, - based on sqlite3 and a local map-based cache. - Thread-safe, too. -*/ -class ConfigurationTable { - - private: - - sqlite3* mDB; ///< database connection - ConfigurationMap mCache; ///< cache of recently access configuration values - mutable Mutex mLock; ///< control for multithreaded access to the cache - std::vector (*mCrossCheck)(const std::string&); ///< cross check callback pointer - - public: - - ConfigurationKeyMap mSchema;///< definition of configuration default values and validation logic - - ConfigurationTable(const char* filename = ":memory:", const char *wCmdName = 0, ConfigurationKeyMap wSchema = ConfigurationKeyMap()); - - /** Generate an up-to-date example sql file for new installs. */ - std::string getDefaultSQL(const std::string& program, const std::string& version); - - /** Generate an up-to-date TeX snippet. */ - std::string getTeX(const std::string& program, const std::string& version); - - /** Return true if the key is used in the table. */ - bool defines(const std::string& key); - - /** Return true if the application's schema knows about this key. */ - bool keyDefinedInSchema(const std::string& name); - - /** Return true if the provided value validates correctly against the defined schema. */ - bool isValidValue(const std::string& name, const std::string& val); - - /** Return true if the provided value validates correctly against the defined schema. */ - bool isValidValue(const std::string& name, const int val) { std::stringstream ss; ss << val; return isValidValue(name, ss.str()); } - - /** Return a map of all similar keys in the defined schema. */ - ConfigurationKeyMap getSimilarKeys(const std::string& snippet); - - /** Return true if this key is identified as static. */ - bool isStatic(const std::string& key); - - /** - Get a string parameter from the table. - Throw ConfigurationTableKeyNotFound if not found. - */ - std::string getStr(const std::string& key); - - - /** - Get a boolean from the table. - Return false if NULL or 0, true otherwise. - */ - bool getBool(const std::string& key); - - /** - Get a numeric parameter from the table. - Throw ConfigurationTableKeyNotFound if not found. - */ - long getNum(const std::string& key); - - /** - Get a vector of strings from the table. - */ - std::vector getVectorOfStrings(const std::string& key); - - /** - Get a float from the table. - Throw ConfigurationTableKeyNotFound if not found. - */ - float getFloat(const std::string& key); - - /** - Get a numeric vector from the table. - */ - std::vector getVector(const std::string& key); - - /** Get length of a vector */ - unsigned getVectorLength(const std::string &key) - { return getVector(key).size(); } - - /** Set or change a value in the table. */ - bool set(const std::string& key, const std::string& value); - - /** Set or change a value in the table. */ - bool set(const std::string& key, long value); - - /** Create an entry in the table, no value though. */ - bool set(const std::string& key); - - /** - Remove an entry from the table. - Will not alter required values. - @param key The key of the item to be removed. - @return true if anything was actually removed. - */ - bool remove(const std::string& key); - - /** Search the table, dumping to a stream. */ - void find(const std::string& pattern, std::ostream&) const; - - /** Return all key/value pairs stored in the ConfigurationTable */ - ConfigurationRecordMap getAllPairs() const; - - /** Define the callback to purge the cache whenever the database changes. */ - void setUpdateHook(void(*)(void *,int ,char const *,char const *,sqlite3_int64)); - - /** Define the callback for cross checking. */ - void setCrossCheckHook(std::vector (*wCrossCheck)(const std::string&)); - - /** Execute the application specific value cross checking logic. */ - std::vector crossCheck(const std::string& key); - - /** purege cache if it exceeds a certain age */ - void checkCacheAge(); - - /** Delete all records from the cache. */ - void purge(); - - - private: - - /** - Attempt to lookup a record, cache if needed. - Throw ConfigurationTableKeyNotFound if not found. - Caller should hold mLock because the returned reference points into the cache. - */ - const ConfigurationRecord& lookup(const std::string& key); - -}; - - -typedef std::map HashStringMap; - -class SimpleKeyValue { - - protected: - - HashStringMap mMap; - - public: - - /** Take a C string "A=B" and set map["A"]="B". */ - void addItem(const char*); - - /** Take a C string "A=B C=D E=F ..." and add all of the pairs to the map. */ - void addItems(const char*s); - - /** Return a reference to the string at map["key"]. */ - const char* get(const char*) const; -}; - - -class ConfigurationKey { - - public: - - enum VisibilityLevel - { - CUSTOMER, - CUSTOMERSITE, - CUSTOMERTUNE, - CUSTOMERWARN, - DEVELOPER, - FACTORY - }; - - enum Type - { - BOOLEAN, - CHOICE_OPT, - CHOICE, - CIDR_OPT, - CIDR, - FILEPATH_OPT, - FILEPATH, - IPADDRESS_OPT, - IPADDRESS, - IPANDPORT, - MIPADDRESS_OPT, - MIPADDRESS, - PORT_OPT, - PORT, - REGEX_OPT, - REGEX, - STRING_OPT, - STRING, - VALRANGE - }; - - private: - - std::string mName; - std::string mDefaultValue; - std::string mUnits; - VisibilityLevel mVisibility; - Type mType; - std::string mValidValues; - bool mIsStatic; - std::string mDescription; - - - public: - - ConfigurationKey(const std::string& wName, const std::string& wDefaultValue, const std::string& wUnits, const VisibilityLevel wVisibility, const Type wType, const std::string& wValidValues, bool wIsStatic, const std::string& wDescription): - mName(wName), - mDefaultValue(wDefaultValue), - mUnits(wUnits), - mVisibility(wVisibility), - mType(wType), - mValidValues(wValidValues), - mIsStatic(wIsStatic), - mDescription(wDescription) - { } - - ConfigurationKey() - { } - - const std::string& getName() const { return mName; } - const std::string& getDefaultValue() const { return mDefaultValue; } - void updateDefaultValue(const std::string& newValue) { mDefaultValue = newValue; } - void updateDefaultValue(const int newValue) { std::stringstream ss; ss << newValue; updateDefaultValue(ss.str()); } - const std::string& getUnits() const { return mUnits; } - const VisibilityLevel& getVisibility() const { return mVisibility; } - const Type& getType() const { return mType; } - const std::string& getValidValues() const { return mValidValues; } - bool isStatic() const { return mIsStatic; } - const std::string& getDescription() const { return mDescription; } - - static bool isValidIP(const std::string& ip); - static void getMinMaxStepping(const ConfigurationKey &key, std::string &min, std::string &max, std::string &stepping); - template static bool isInValRange(const ConfigurationKey &key, const std::string& val, const bool isInteger); - static const std::string visibilityLevelToString(const VisibilityLevel& visibility); - static const std::string typeToString(const ConfigurationKey::Type& type); - static void printKey(const ConfigurationKey &key, const std::string& currentValue, std::ostream& os); - static void printDescription(const ConfigurationKey &key, std::ostream& os); - static const std::string getARFCNsString(); -}; - - -#endif - - -// vim: ts=4 sw=4 diff --git a/CommonLibs/ConfigurationTest.cpp b/CommonLibs/ConfigurationTest.cpp deleted file mode 100644 index 7042228..0000000 --- a/CommonLibs/ConfigurationTest.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* -* Copyright 2009, 2010 Free Software Foundation, Inc. -* Copyright 2010 Kestrel Signal Processing, Inc. -* -* -* This software is distributed under the terms of the GNU Affero Public License. -* See the COPYING file in the main directory for details. -* -* This use of this software may be subject to additional restrictions. -* See the LEGAL file in the main directory for details. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -*/ - - - -#include "Configuration.h" -#include -#include - -using namespace std; - -ConfigurationKeyMap getConfigurationKeys(); -ConfigurationTable gConfig("exampleconfig.db","test", getConfigurationKeys()); - -void purgeConfig(void*,int,char const*, char const*, sqlite3_int64) -{ - //cout << "update hook" << endl; - gConfig.purge(); -} - - -int main(int argc, char *argv[]) -{ - - gConfig.setUpdateHook(purgeConfig); - - const char *keys[5] = {"key1", "key2", "key3", "key4", "key5"}; - - for (int i=0; i<5; i++) { - gConfig.set(keys[i],i); - } - - for (int i=0; i<5; i++) { - cout << "table[" << keys[i] << "]=" << gConfig.getStr(keys[i]) << endl; - cout << "table[" << keys[i] << "]=" << gConfig.getNum(keys[i]) << endl; - } - - for (int i=0; i<5; i++) { - cout << "defined table[" << keys[i] << "]=" << gConfig.defines(keys[i]) << endl; - } - - gConfig.set("key5","100 200 300 400 "); - std::vector vect = gConfig.getVector("key5"); - cout << "vect length " << vect.size() << ": "; - for (unsigned i=0; i svect = gConfig.getVectorOfStrings("key5"); - cout << "vect length " << svect.size() << ": "; - for (unsigned i=0; igetName()] = *tmp; - free(tmp); - - tmp = new ConfigurationKey("numnumber","42", - "", - ConfigurationKey::DEVELOPER, - ConfigurationKey::VALRANGE, - "0-100", - false, - "" - ); - map[tmp->getName()] = *tmp; - free(tmp); - - tmp = new ConfigurationKey("newstring","new string value", - "", - ConfigurationKey::DEVELOPER, - ConfigurationKey::STRING, - "", - false, - "" - ); - map[tmp->getName()] = *tmp; - free(tmp); - - return map; -} diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index ed188d5..d42e82a 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -36,9 +36,7 @@ Sockets.cpp \ Threads.cpp \ Timeval.cpp \ - Logger.cpp \ - Configuration.cpp \ - sqlite3util.cpp + Logger.cpp noinst_PROGRAMS = \ BitVectorTest \ @@ -47,7 +45,6 @@ SocketsTest \ TimevalTest \ VectorTest \ - ConfigurationTest \ LogTest # ReportingTest @@ -61,12 +58,10 @@ Threads.h \ Timeval.h \ Vector.h \ - Configuration.h \ - Logger.h \ - sqlite3util.h + Logger.h BitVectorTest_SOURCES = BitVectorTest.cpp -BitVectorTest_LDADD = libcommon.la $(SQLITE3_LIBS) +BitVectorTest_LDADD = libcommon.la PRBSTest_SOURCES = PRBSTest.cpp @@ -82,15 +77,12 @@ TimevalTest_LDADD = libcommon.la VectorTest_SOURCES = VectorTest.cpp -VectorTest_LDADD = libcommon.la $(SQLITE3_LIBS) - -ConfigurationTest_SOURCES = ConfigurationTest.cpp -ConfigurationTest_LDADD = libcommon.la $(SQLITE3_LIBS) +VectorTest_LDADD = libcommon.la # ReportingTest_SOURCES = ReportingTest.cpp -# ReportingTest_LDADD = libcommon.la $(SQLITE_LA) +# ReportingTest_LDADD = libcommon.la LogTest_SOURCES = LogTest.cpp -LogTest_LDADD = libcommon.la $(SQLITE3_LIBS) +LogTest_LDADD = libcommon.la MOSTLYCLEANFILES += testSource testDestination diff --git a/CommonLibs/sqlite3util.cpp b/CommonLibs/sqlite3util.cpp deleted file mode 100644 index 2b19ee6..0000000 --- a/CommonLibs/sqlite3util.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* -* Copyright 2010 Kestrel Signal Processing, Inc. -* All rights reserved. -*/ - - -#include -#include "sqlite3util.h" - -#include -#include -#include - - -// Wrappers to sqlite operations. -// These will eventually get moved to commonlibs. - -int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query) -{ - int src = SQLITE_BUSY; - while (src==SQLITE_BUSY) { - src = sqlite3_prepare_v2(DB,query,strlen(query),stmt,NULL); - if (src==SQLITE_BUSY) { - usleep(100000); - } - } - if (src) { - fprintf(stderr,"sqlite3_prepare_v2 failed for \"%s\": %s\n",query,sqlite3_errmsg(DB)); - sqlite3_finalize(*stmt); - } - return src; -} - -int sqlite3_run_query(sqlite3* DB, sqlite3_stmt *stmt) -{ - int src = SQLITE_BUSY; - while (src==SQLITE_BUSY) { - src = sqlite3_step(stmt); - if (src==SQLITE_BUSY) { - usleep(100000); - } - } - if ((src!=SQLITE_DONE) && (src!=SQLITE_ROW)) { - fprintf(stderr,"sqlite3_run_query failed: %s: %s\n", sqlite3_sql(stmt), sqlite3_errmsg(DB)); - } - return src; -} - - -bool sqlite3_exists(sqlite3* DB, const char *tableName, - const char* keyName, const char* keyData) -{ - size_t stringSize = 100 + strlen(tableName) + strlen(keyName) + strlen(keyData); - char query[stringSize]; - sprintf(query,"SELECT * FROM %s WHERE %s == \"%s\"",tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - sqlite3_finalize(stmt); - // Anything there? - return (src == SQLITE_ROW); -} - - - -bool sqlite3_single_lookup(sqlite3* DB, const char *tableName, - const char* keyName, const char* keyData, - const char* valueName, unsigned &valueData) -{ - size_t stringSize = 100 + strlen(valueName) + strlen(tableName) + strlen(keyName) + strlen(keyData); - char query[stringSize]; - sprintf(query,"SELECT %s FROM %s WHERE %s == \"%s\"",valueName,tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - bool retVal = false; - if (src == SQLITE_ROW) { - valueData = (unsigned)sqlite3_column_int64(stmt,0); - retVal = true; - } - sqlite3_finalize(stmt); - return retVal; -} - - -// This function returns an allocated string that must be free'd by the caller. -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, const char* keyData, - const char* valueName, char* &valueData) -{ - valueData=NULL; - size_t stringSize = 100 + strlen(valueName) + strlen(tableName) + strlen(keyName) + strlen(keyData); - char query[stringSize]; - sprintf(query,"SELECT %s FROM %s WHERE %s == \"%s\"",valueName,tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - bool retVal = false; - if (src == SQLITE_ROW) { - const char* ptr = (const char*)sqlite3_column_text(stmt,0); - if (ptr) valueData = strdup(ptr); - retVal = true; - } - sqlite3_finalize(stmt); - return retVal; -} - - -// This function returns an allocated string that must be free'd by tha caller. -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, unsigned keyData, - const char* valueName, char* &valueData) -{ - valueData=NULL; - size_t stringSize = 100 + strlen(valueName) + strlen(tableName) + strlen(keyName) + 20; - char query[stringSize]; - sprintf(query,"SELECT %s FROM %s WHERE %s == %u",valueName,tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - bool retVal = false; - if (src == SQLITE_ROW) { - const char* ptr = (const char*)sqlite3_column_text(stmt,0); - if (ptr) valueData = strdup(ptr); - retVal = true; - } - sqlite3_finalize(stmt); - return retVal; -} - - - - -bool sqlite3_command(sqlite3* DB, const char* query) -{ - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Run the query. - int src = sqlite3_run_query(DB,stmt); - sqlite3_finalize(stmt); - return src==SQLITE_DONE; -} - - - diff --git a/CommonLibs/sqlite3util.h b/CommonLibs/sqlite3util.h deleted file mode 100644 index f2b3aa7..0000000 --- a/CommonLibs/sqlite3util.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef SQLITE3UTIL_H -#define SQLITE3UTIL_H - -#include - -int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query); - -int sqlite3_run_query(sqlite3* DB, sqlite3_stmt *stmt); - -bool sqlite3_single_lookup(sqlite3* DB, const char *tableName, - const char* keyName, const char* keyData, - const char* valueName, unsigned &valueData); - -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, const char* keyData, - const char* valueName, char* &valueData); - -// This function returns an allocated string that must be free'd by the caller. -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, unsigned keyData, - const char* valueName, char* &valueData); - -bool sqlite3_exists(sqlite3* DB, const char* tableName, - const char* keyName, const char* keyData); - -/** Run a query, ignoring the result; return true on success. */ -bool sqlite3_command(sqlite3* DB, const char* query); - -#endif diff --git a/Makefile.am b/Makefile.am index da08bf3..658eae4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common ACLOCAL_AMFLAGS = -I config -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) $(SQLITE3_CFLAGS) +AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) AM_CXXFLAGS = -Wall -pthread -ldl #AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread -ldl #AM_CFLAGS = -Wall -O2 -NDEBUG -pthread -ldl diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 20d0bd6..dc6e597 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -97,7 +97,7 @@ libtransceiver.la \ $(ARCH_LA) \ $(GSM_LA) \ - $(COMMON_LA) $(SQLITE3_LIBS) + $(COMMON_LA) if USRP1 libtransceiver_la_SOURCES += USRPDevice.cpp diff --git a/configure.ac b/configure.ac index 01bec91..1a9712a 100644 --- a/configure.ac +++ b/configure.ac @@ -158,10 +158,7 @@ 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"]) -AC_CHECK_LIB(sqlite3, sqlite3_open, , AC_MSG_ERROR(sqlite3 is not available)) - PKG_CHECK_MODULES(LIBUSB, libusb-1.0) -PKG_CHECK_MODULES(SQLITE3, sqlite3) AC_CHECK_HEADER([boost/config.hpp],[], [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) diff --git a/debian/control b/debian/control index b9ed72a..c8a639e 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Build-Depends: debhelper (>= 9), autotools-dev, autoconf-archive, - libsqlite3-dev, pkg-config, dh-autoreconf, libuhd-dev, diff --git a/debian/copyright b/debian/copyright index 45d0e6d..b7790f2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -52,20 +52,6 @@ the U.S. Army Research Laboratory. License: BSD-3-clause -Files: CommonLibs/sqlite3util.cpp -Copyright: 2010 Kestrel Signal Processing Inc. -License: none - No license described for file. -Comment: In the previous version of the file in the git repository - at upstream it is written: - Written by David A. Burgess, Kestrel Signal Processing, Inc., 2010 - The author disclaims copyright to this source code. - In the git log, this is written: - I do not claim any copyright over this change, as it's very basic. - Looking forward to see it merged into mainline. - See revision e766abbf82f02473038a83fd2f78befd08544cab at - https://github.com/osmocom/osmo-trx - Files: debian/* Copyright: 2015 Ruben Undheim License: GPL-3+ -- To view, visit https://gerrit.osmocom.org/5704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 15:12:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:12:02 +0000 Subject: osmo-trx[master]: Remove Configuration module and libsqlite dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:12:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:12:14 +0000 Subject: osmo-trx[master]: cosmetic: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:12:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:12:32 +0000 Subject: osmo-trx[master]: Logger: Stop using Log.Alarms.Max from config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:12:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:12:51 +0000 Subject: osmo-trx[master]: Logger: Stop using Log.File and Log.Level from config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:12:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:12:54 +0000 Subject: osmo-trx[master]: Drop use of ConfigurationTable gConfig In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:13:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:13:00 +0000 Subject: osmo-trx[master]: Remove Configuration module and libsqlite dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/5704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:14:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:14:29 +0000 Subject: osmo-trx[master]: Remove Configuration module and libsqlite dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Tue Jan 9 15:17:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:17:39 +0000 Subject: osmo-bsc[master]: Implement support for paging by LAI. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/5698/2/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 348: lai.digits[0] = data[1 + i * sizeof(lai)]; this is a really ugly/verbose way of manually copying individual bytes. why is it needed? why not simply do a memcpy(&lai, data, sizeof(lai)) ? -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 15:18:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:18:05 +0000 Subject: osmo-ttcn3-hacks[master]: Fix BTS location area code assignment in test configuration. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d6b02fe06116dee59977422bc93bcafcd3aba76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 15:18:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:18:07 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Fix BTS location area code assignment in test configuration. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix BTS location area code assignment in test configuration. ...................................................................... Fix BTS location area code assignment in test configuration. The paging tests expect BTS 0 and 1 in LAC 1, and BTS 2 in LAC 2. BUt the osmo-bsc configuration file had BTS 1 in LAC 2, and BTS 2 in LAC 1. Change-Id: I1d6b02fe06116dee59977422bc93bcafcd3aba76 --- M bsc/osmo-bsc.cfg 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/osmo-bsc.cfg b/bsc/osmo-bsc.cfg index d97c210..90756a6 100644 --- a/bsc/osmo-bsc.cfg +++ b/bsc/osmo-bsc.cfg @@ -176,7 +176,7 @@ type sysmobts band DCS1800 cell_identity 1 - location_area_code 2 + location_area_code 1 dtx uplink force dtx downlink base_station_id_code 63 @@ -266,7 +266,7 @@ type sysmobts band DCS1800 cell_identity 1 - location_area_code 1 + location_area_code 2 dtx uplink force dtx downlink base_station_id_code 63 -- To view, visit https://gerrit.osmocom.org/5696 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d6b02fe06116dee59977422bc93bcafcd3aba76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 15:19:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 15:19:55 +0000 Subject: osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/5684/2/library/BSSMAP_Templates.ttcn File library/BSSMAP_Templates.ttcn: Line 651: return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); > The incoming values are defined in BSC_Tests.ttcn as hex strings with the v I think MNC should be '01'H instead. And then you can use the length of the hexstring (in number of nibbles) to know if it's a two-digit or threre-digig MNC. Anyway, this could be a follow-up patch. -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 16:57:39 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 16:57:39 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on CI (cell identifier). Message-ID: Review at https://gerrit.osmocom.org/5705 Implement support for paging based on CI (cell identifier). This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e --- M include/osmocom/bsc/osmo_bsc_grace.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 91 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5705/1 diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h index b7950ce..d78e41c 100644 --- a/include/osmocom/bsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -30,6 +30,7 @@ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, + struct gsm_bts *bts); #endif diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index b9c7b2d..b1e7030 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,11 +228,12 @@ return 0; } -/* Page a subscriber based on TMSI and LAC. +/* Page a subscriber based on TMSI and LAC in the specified MSC. + * If BTS is not NULL, page the subscriber via this particular BTS. * A non-zero return value indicates a fatal out of memory condition. */ static int -page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, - const char *mi_string, uint8_t chan_needed) +page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, + uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; @@ -246,9 +247,14 @@ subscr->lac = lac; subscr->tmsi = tmsi; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + if (bts) + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); + else + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); @@ -339,6 +345,28 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_CI: { + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + struct gsm_bts *bts; + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity == ci) + break; + } + + if (bts) { + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", + mi_string, ci); + remain -= sizeof(*ci_be); + ci_be++; + } + break; + } case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; @@ -357,7 +385,7 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " @@ -374,7 +402,7 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; remain -= sizeof(*lacp_be); lacp_be++; @@ -387,7 +415,7 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; @@ -395,7 +423,7 @@ LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index f16a19a..7eb5702 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -50,44 +50,62 @@ return paging_request(msc->network, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* - * continue if the BTS is not excluded from the lock - */ - if (!bts->excl_from_rf_lock) - continue; - - /* in case of no lac patching is in place, check the BTS */ - if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) - continue; - - /* - * now page on this bts - */ - paging_request_bts(bts, subscr, chan_needed, msc); - }; - - /* All bts are either off or in the grace period */ - return 0; -} - -/** - * Try to not page if everything the cell is not on. - */ -int bsc_grace_paging_request(enum signal_rf rf_policy, +/* Return value is like paging_request_bts(): + * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ +static int locked_paging_bts(struct gsm_bts *bts, struct bsc_subscr *subscr, int chan_needed, struct bsc_msc_data *msc) { + /* Return error if the BTS is not excluded from the lock. */ + if (!bts->excl_from_rf_lock) + return 0; + + /* in case of no lac patching is in place, check the BTS */ + if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) + return 0; + + return paging_request_bts(bts, subscr, chan_needed, msc); +} + +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) +{ + struct gsm_bts *bts = NULL; + int num_pages; + + /* + * Check if there is any BTS that is on for the given lac. Start + * with NULL and iterate through all bts. + * All other bts are either off or in the grace period. + */ + llist_for_each_entry(bts, &msc->network->bts_list, list) + num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); + + return num_pages; +} + +/** + * Page a subscriber in an MSC. + * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock + * \param[in] subscr subscriber we want to page + * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE + * \param[in] msc MSC which has issued this paging + * \param[in] bts if not NULL, page via this particular BTS + * \returns number of BTS on which we issued the paging + */ +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc, + struct gsm_bts *bts) +{ + if (bts) { + if (rf_policy == S_RF_ON) + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); + } + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 9 17:02:36 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 17:02:36 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging by LAI. 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/5698 to look at the new patch set (#3). Implement support for paging by LAI. Also, parse the complete cell identifier list for both LAC and LAI. Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 3 files changed, 118 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/98/5698/3 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 0ecc11c..54e0205 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,21 +228,52 @@ return 0; } +/* Page a subscriber based on TMSI and LAC. + * A non-zero return value indicates a fatal out of memory condition. */ +static int +page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, + const char *mi_string, uint8_t chan_needed) +{ + struct bsc_subscr *subscr; + + subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, + mi_string); + if (!subscr) { + LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); + return -1; + } + + subscr->lac = lac; + subscr->tmsi = tmsi; + + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, + subscr, chan_needed, msc); + + /* the paging code has grabbed its own references */ + bsc_subscr_put(subscr); + + return 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) { - struct bsc_subscr *subscr; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; - unsigned int lac; + uint16_t lac, *lacp_be; + uint16_t mcc; + uint16_t mnc; uint8_t data_length; + int remain; const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); + remain = payload_length - 1; if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) { LOGP(DMSC, LOGL_ERROR, "Mandatory IMSI not present.\n"); @@ -251,6 +282,7 @@ LOGP(DMSC, LOGL_ERROR, "Wrong content in the IMSI\n"); return -1; } + remain -= TLVP_LEN(&tp, GSM0808_IE_IMSI); if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST)) { LOGP(DMSC, LOGL_ERROR, "Mandatory CELL IDENTIFIER LIST not present.\n"); @@ -260,6 +292,12 @@ if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI) && TLVP_LEN(&tp, GSM0808_IE_TMSI) == 4) { tmsi = ntohl(tlvp_val32_unal(&tp, GSM0808_IE_TMSI)); + remain -= TLVP_LEN(&tp, GSM0808_IE_TMSI); + } + + if (remain <= 0) { + LOGP(DMSC, LOGL_ERROR, "Payload too short.\n"); + return -1; } /* @@ -280,38 +318,12 @@ LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Zero length Cell Identifier List\n", mi_string); return -1; + } else if (data_length > remain) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Bogus Cell Identifier List length\n", + mi_string); + return -1; } - - cell_ident = data[0] & 0xf; - - /* Default fallback: page entire BSS */ - lac = GSM_LAC_RESERVED_ALL_BTS; - - switch (cell_ident) { - case CELL_IDENT_LAC: - if (data_length != 3) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for LAC (0x%x)" - " has invalid length: %u, paging entire BSS instead (%s)\n", - mi_string, CELL_IDENT_LAC, data_length, osmo_hexdump(data, data_length)); - break; - } - lac = osmo_load16be(&data[1]); - break; - - case CELL_IDENT_BSS: - if (data_length != 1) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" - " has invalid length: %u, paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); - } - break; - - default: - LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," - " paging entire BSS instead (%s)\n", - mi_string, cell_ident, osmo_hexdump(data, data_length)); - break; - } + remain = data_length; /* ignore payload padding data beyond data_length */ if (TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_NEEDED) && TLVP_LEN(&tp, GSM0808_IE_CHANNEL_NEEDED) == 1) chan_needed = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_NEEDED)[0] & 0x03; @@ -320,22 +332,70 @@ LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n"); } - subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, - mi_string); - if (!subscr) { - LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); - return -1; + cell_ident = data[0] & 0xf; + remain -= 1; /* cell ident consumed */ + + /* Default fallback: page entire BSS */ + lac = GSM_LAC_RESERVED_ALL_BTS; + + switch (cell_ident) { + case CELL_IDENT_LAI_AND_LAC: { + struct gsm48_loc_area_id lai; + int i = 0; + while (remain >= sizeof(lai)) { + /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). + * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + memcpy(&lai, &data[1 + i * sizeof(lai)], sizeof(lai)); /* don't byte swap yet */ + if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + + remain -= sizeof(lai); + i++; + } + break; } - subscr->lac = lac; - subscr->tmsi = tmsi; + case CELL_IDENT_LAC: + lacp_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*lacp_be)) { + lac = osmo_load16be(lacp_be); + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + remain -= sizeof(*lacp_be); + lacp_be++; + } + break; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + case CELL_IDENT_BSS: + if (data_length != 1) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" + " has invalid length: %u, paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); + } + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; - /* the paging code has grabbed its own references */ - bsc_subscr_put(subscr); + default: + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," + " paging entire BSS instead (%s)\n", + mi_string, cell_ident, osmo_hexdump(data, data_length)); + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; + } return 0; } diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index 579cae2..c97393d 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -73,6 +73,11 @@ /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ GSM_LAC_RESERVED_ALL_BTS, 0 }, + { + "001952080859512069000743940904010844601a060400f1100065", + /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ + 0x65, 0 + }, }; void test_cell_identifier() diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index 1c432eb..f24ff7c 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -16,7 +16,12 @@ 2: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 15 f5 49 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging IMSI 515029600703449: unimplemented Cell Identifier List (0x4), paging entire BSS instead (04 15 f5 49 00 65 ) -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe -BSC paging started on entire BSS (65534) +DMSC Not paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) +bsc_handle_udt() returned 0 + +3: +DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 +DMSC Rx MSC UDT BSSMAP PAGING +DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 17:03:21 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 17:03:21 +0000 Subject: osmo-bsc[master]: Implement support for paging by LAI. In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5698/2/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 348: lai.digits[0] = data[1 + i * sizeof(lai)]; > this is a really ugly/verbose way of manually copying individual bytes. why Agreed, a single memcpy() works just fine. Fixed in next patchset. -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 17:12:58 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 17:12:58 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5705 to look at the new patch set (#3). Implement support for paging based on CI (cell identifier). This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2753 --- M include/osmocom/bsc/osmo_bsc_grace.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 91 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5705/3 diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h index b7950ce..d78e41c 100644 --- a/include/osmocom/bsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -30,6 +30,7 @@ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, + struct gsm_bts *bts); #endif diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 54e0205..0dd4ee5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,11 +228,12 @@ return 0; } -/* Page a subscriber based on TMSI and LAC. +/* Page a subscriber based on TMSI and LAC in the specified MSC. + * If BTS is not NULL, page the subscriber via this particular BTS. * A non-zero return value indicates a fatal out of memory condition. */ static int -page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, - const char *mi_string, uint8_t chan_needed) +page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, + uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; @@ -246,9 +247,14 @@ subscr->lac = lac; subscr->tmsi = tmsi; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + if (bts) + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); + else + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); @@ -339,6 +345,28 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_CI: { + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + struct gsm_bts *bts; + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity == ci) + break; + } + + if (bts) { + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", + mi_string, ci); + remain -= sizeof(*ci_be); + ci_be++; + } + break; + } case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; @@ -354,7 +382,7 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " @@ -371,7 +399,7 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; remain -= sizeof(*lacp_be); lacp_be++; @@ -384,7 +412,7 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; @@ -392,7 +420,7 @@ LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index f16a19a..7eb5702 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -50,44 +50,62 @@ return paging_request(msc->network, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* - * continue if the BTS is not excluded from the lock - */ - if (!bts->excl_from_rf_lock) - continue; - - /* in case of no lac patching is in place, check the BTS */ - if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) - continue; - - /* - * now page on this bts - */ - paging_request_bts(bts, subscr, chan_needed, msc); - }; - - /* All bts are either off or in the grace period */ - return 0; -} - -/** - * Try to not page if everything the cell is not on. - */ -int bsc_grace_paging_request(enum signal_rf rf_policy, +/* Return value is like paging_request_bts(): + * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ +static int locked_paging_bts(struct gsm_bts *bts, struct bsc_subscr *subscr, int chan_needed, struct bsc_msc_data *msc) { + /* Return error if the BTS is not excluded from the lock. */ + if (!bts->excl_from_rf_lock) + return 0; + + /* in case of no lac patching is in place, check the BTS */ + if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) + return 0; + + return paging_request_bts(bts, subscr, chan_needed, msc); +} + +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) +{ + struct gsm_bts *bts = NULL; + int num_pages; + + /* + * Check if there is any BTS that is on for the given lac. Start + * with NULL and iterate through all bts. + * All other bts are either off or in the grace period. + */ + llist_for_each_entry(bts, &msc->network->bts_list, list) + num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); + + return num_pages; +} + +/** + * Page a subscriber in an MSC. + * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock + * \param[in] subscr subscriber we want to page + * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE + * \param[in] msc MSC which has issued this paging + * \param[in] bts if not NULL, page via this particular BTS + * \returns number of BTS on which we issued the paging + */ +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc, + struct gsm_bts *bts) +{ + if (bts) { + if (rf_policy == S_RF_ON) + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); + } + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 17:15:49 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 17:15:49 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5705 to look at the new patch set (#4). Implement support for paging based on CI (cell identifier). This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2753 --- M include/osmocom/bsc/osmo_bsc_grace.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 91 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5705/4 diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h index b7950ce..d78e41c 100644 --- a/include/osmocom/bsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -30,6 +30,7 @@ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, + struct gsm_bts *bts); #endif diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 54e0205..0dd4ee5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,11 +228,12 @@ return 0; } -/* Page a subscriber based on TMSI and LAC. +/* Page a subscriber based on TMSI and LAC in the specified MSC. + * If BTS is not NULL, page the subscriber via this particular BTS. * A non-zero return value indicates a fatal out of memory condition. */ static int -page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, - const char *mi_string, uint8_t chan_needed) +page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, + uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; @@ -246,9 +247,14 @@ subscr->lac = lac; subscr->tmsi = tmsi; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + if (bts) + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); + else + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); @@ -339,6 +345,28 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_CI: { + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + struct gsm_bts *bts; + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity == ci) + break; + } + + if (bts) { + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", + mi_string, ci); + remain -= sizeof(*ci_be); + ci_be++; + } + break; + } case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; @@ -354,7 +382,7 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " @@ -371,7 +399,7 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; remain -= sizeof(*lacp_be); lacp_be++; @@ -384,7 +412,7 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; @@ -392,7 +420,7 @@ LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index f16a19a..93ca9b9 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -50,44 +50,62 @@ return paging_request(msc->network, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* - * continue if the BTS is not excluded from the lock - */ - if (!bts->excl_from_rf_lock) - continue; - - /* in case of no lac patching is in place, check the BTS */ - if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) - continue; - - /* - * now page on this bts - */ - paging_request_bts(bts, subscr, chan_needed, msc); - }; - - /* All bts are either off or in the grace period */ - return 0; -} - -/** - * Try to not page if everything the cell is not on. - */ -int bsc_grace_paging_request(enum signal_rf rf_policy, +/* Return value is like paging_request_bts(): + * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ +static int locked_paging_bts(struct gsm_bts *bts, struct bsc_subscr *subscr, int chan_needed, struct bsc_msc_data *msc) { + /* Return error if the BTS is not excluded from the lock. */ + if (!bts->excl_from_rf_lock) + return 0; + + /* in case of no lac patching is in place, check the BTS */ + if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) + return 0; + + return paging_request_bts(bts, subscr, chan_needed, msc); +} + +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) +{ + struct gsm_bts *bts = NULL; + int num_pages = 0; + + /* + * Check if there is any BTS that is on for the given lac. Start + * with NULL and iterate through all bts. + * All other bts are either off or in the grace period. + */ + llist_for_each_entry(bts, &msc->network->bts_list, list) + num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); + + return num_pages; +} + +/** + * Page a subscriber in an MSC. + * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock + * \param[in] subscr subscriber we want to page + * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE + * \param[in] msc MSC which has issued this paging + * \param[in] bts if not NULL, page via this particular BTS + * \returns number of BTS on which we issued the paging + */ +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc, + struct gsm_bts *bts) +{ + if (bts) { + if (rf_policy == S_RF_ON) + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); + } + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 17:26:33 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 9 Jan 2018 17:26:33 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5705 to look at the new patch set (#5). Implement support for paging based on CI (cell identifier). This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run in isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2753 --- M include/osmocom/bsc/osmo_bsc_grace.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 91 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5705/5 diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h index b7950ce..d78e41c 100644 --- a/include/osmocom/bsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -30,6 +30,7 @@ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, + struct gsm_bts *bts); #endif diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 54e0205..0dd4ee5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,11 +228,12 @@ return 0; } -/* Page a subscriber based on TMSI and LAC. +/* Page a subscriber based on TMSI and LAC in the specified MSC. + * If BTS is not NULL, page the subscriber via this particular BTS. * A non-zero return value indicates a fatal out of memory condition. */ static int -page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, - const char *mi_string, uint8_t chan_needed) +page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, + uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; @@ -246,9 +247,14 @@ subscr->lac = lac; subscr->tmsi = tmsi; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + if (bts) + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); + else + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); @@ -339,6 +345,28 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_CI: { + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + struct gsm_bts *bts; + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity == ci) + break; + } + + if (bts) { + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", + mi_string, ci); + remain -= sizeof(*ci_be); + ci_be++; + } + break; + } case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; @@ -354,7 +382,7 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " @@ -371,7 +399,7 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; remain -= sizeof(*lacp_be); lacp_be++; @@ -384,7 +412,7 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; @@ -392,7 +420,7 @@ LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index f16a19a..93ca9b9 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -50,44 +50,62 @@ return paging_request(msc->network, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* - * continue if the BTS is not excluded from the lock - */ - if (!bts->excl_from_rf_lock) - continue; - - /* in case of no lac patching is in place, check the BTS */ - if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) - continue; - - /* - * now page on this bts - */ - paging_request_bts(bts, subscr, chan_needed, msc); - }; - - /* All bts are either off or in the grace period */ - return 0; -} - -/** - * Try to not page if everything the cell is not on. - */ -int bsc_grace_paging_request(enum signal_rf rf_policy, +/* Return value is like paging_request_bts(): + * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ +static int locked_paging_bts(struct gsm_bts *bts, struct bsc_subscr *subscr, int chan_needed, struct bsc_msc_data *msc) { + /* Return error if the BTS is not excluded from the lock. */ + if (!bts->excl_from_rf_lock) + return 0; + + /* in case of no lac patching is in place, check the BTS */ + if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) + return 0; + + return paging_request_bts(bts, subscr, chan_needed, msc); +} + +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) +{ + struct gsm_bts *bts = NULL; + int num_pages = 0; + + /* + * Check if there is any BTS that is on for the given lac. Start + * with NULL and iterate through all bts. + * All other bts are either off or in the grace period. + */ + llist_for_each_entry(bts, &msc->network->bts_list, list) + num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); + + return num_pages; +} + +/** + * Page a subscriber in an MSC. + * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock + * \param[in] subscr subscriber we want to page + * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE + * \param[in] msc MSC which has issued this paging + * \param[in] bts if not NULL, page via this particular BTS + * \returns number of BTS on which we issued the paging + */ +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc, + struct gsm_bts *bts) +{ + if (bts) { + if (rf_policy == S_RF_ON) + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); + } + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:35:16 +0000 Subject: osmo-trx[master]: cosmetic: Remove trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:36:19 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:36:19 +0000 Subject: osmo-trx[master]: Logger: Stop using Log.Alarms.Max from config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:37:39 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:37:39 +0000 Subject: osmo-trx[master]: Logger: Stop using Log.File and Log.Level from config In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:38:28 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:38:28 +0000 Subject: osmo-trx[master]: Drop use of ConfigurationTable gConfig In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:39:59 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:39:59 +0000 Subject: osmo-trx[master]: Remove Configuration module and libsqlite dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:45:27 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:45:27 +0000 Subject: osmo-bts[master]: meas_test: fix header file references In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/5697/1//COMMIT_MSG Commit Message: Line 7: meas_test: fix header file references Not sure we are fixing anything in this change. Probably, "drop useless includes" would be better here. PS1, Line 13: remove all header file references that are not needed. : : add missing header reference to stdio.h Cosmetic: both points are looking like the list items... May we use a marker, such as ' - ' or ' * ' as Max does? -- To view, visit https://gerrit.osmocom.org/5697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 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 Tue Jan 9 18:46:30 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 18:46:30 +0000 Subject: osmo-bts[master]: meas_test: fix header file references In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 At the same time, "missing header reference to stdio.h" is actual fix... -- To view, visit https://gerrit.osmocom.org/5697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:49:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:49:01 +0000 Subject: osmo-bts[master]: meas_test: fix header file references In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:54:16 +0000 Subject: osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/5705/5/include/osmocom/bsc/osmo_bsc_grace.h File include/osmocom/bsc/osmo_bsc_grace.h: Line 34: struct gsm_bts *bts); I think API-wise this might end up rather confusing. So either the BTS selection is done higher up the stack by the MSC/A interface and we know the BTS, or we hand down the LAC/CI and let the lower layers issue the request on as many BTSs as it wants. I guess what I would prefer is that we have the A interface related code that parses the cell identification list [eleemnts] and then we resolve the BTS or BTSs in one layer, and finally issue the paging on each bTS. So the 'bsc_grace_paging_request' would then basically *only* have a 'bts' parameter, and we would call that for as many BTS as we determine to be in the LAC/LAI/CIs specified by the MSC? Am I making sense? We can do this as multiple patches, and this could be the first one. I just think the APIs should become more obvious/clean, and less convoluted. -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:54:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:54:22 +0000 Subject: osmo-bsc[master]: Implement support for paging by LAI. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:54:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:54:39 +0000 Subject: python/osmo-python-tests[master]: remove osmodumpdoc.py and osmotestconfig.py from py3 install In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:54:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:54:57 +0000 Subject: python/osmo-python-tests[master]: cosmetic: setup.py: move osmo_interact_* next to osmo_verify_* In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5695 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7380f9d536c83ee1d612457af423dde9b96f5ad Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests 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 Jan 9 18:55:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:55:06 +0000 Subject: python/osmo-python-tests[master]: cosmetic: setup.py: tweak indenting, add vim comment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5694 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a501715127c2583a630b1efb0d5316574eea173 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests 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 Jan 9 18:55:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:55:53 +0000 Subject: osmo-bsc[master]: cosmetic: mgcp: remove duplicate logging In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 18:56:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 9 Jan 2018 18:56:14 +0000 Subject: osmo-bsc[master]: mgcp: log file and line of calls to handle_error() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 9 19:29:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 19:29:09 +0000 Subject: [PATCH] osmo-trx[master]: Set up GNU Autotest infrastructure Message-ID: Review at https://gerrit.osmocom.org/5706 Set up GNU Autotest infrastructure Test files are moved from CommonLibs/ to tests/CommonLibs/. Some tests are disabled in autotest because they generate timedate related output which cannot exactly match against expected output. Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc --- M .gitignore M AUTHORS M CommonLibs/Makefile.am M Makefile.am M configure.ac R tests/CommonLibs/BitVectorTest.cpp A tests/CommonLibs/BitVectorTest.ok R tests/CommonLibs/InterthreadTest.cpp A tests/CommonLibs/InterthreadTest.ok R tests/CommonLibs/LogTest.cpp A tests/CommonLibs/LogTest.err A tests/CommonLibs/LogTest.ok A tests/CommonLibs/Makefile.am R tests/CommonLibs/PRBSTest.cpp A tests/CommonLibs/PRBSTest.ok R tests/CommonLibs/SocketsTest.cpp R tests/CommonLibs/TimevalTest.cpp A tests/CommonLibs/TimevalTest.ok R tests/CommonLibs/VectorTest.cpp A tests/CommonLibs/VectorTest.ok A tests/Makefile.am A tests/testsuite.at 22 files changed, 364 insertions(+), 113 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/06/5706/1 diff --git a/.gitignore b/.gitignore index d560f19..bc6c036 100644 --- a/.gitignore +++ b/.gitignore @@ -5,17 +5,16 @@ Transceiver52M/osmo-trx # tests -CommonLibs/BitVectorTest -CommonLibs/ConfigurationTest -CommonLibs/F16Test -CommonLibs/InterthreadTest -CommonLibs/LogTest -CommonLibs/RegexpTest -CommonLibs/SocketsTest -CommonLibs/TimevalTest -CommonLibs/URLEncodeTest -CommonLibs/VectorTest -CommonLibs/PRBSTest +tests/CommonLibs/BitVectorTest +tests/CommonLibs/F16Test +tests/CommonLibs/InterthreadTest +tests/CommonLibs/LogTest +tests/CommonLibs/RegexpTest +tests/CommonLibs/SocketsTest +tests/CommonLibs/TimevalTest +tests/CommonLibs/URLEncodeTest +tests/CommonLibs/VectorTest +tests/CommonLibs/PRBSTest # automake/autoconf *.in @@ -41,6 +40,8 @@ missing stamp-h1 INSTALL +tests/package.m4 +tests/testsuite # vim *.sw? diff --git a/AUTHORS b/AUTHORS index a956de5..53a3c7d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,18 +1,18 @@ # # Copyright 2008, 2009 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio 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, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. @@ -23,31 +23,17 @@ CLI/CLI.h CommonLibs/Assert.h CommonLibs/BitVector.cpp - CommonLibs/BitVectorTest.cpp CommonLibs/Interthread.h - CommonLibs/InterthreadTest.cpp CommonLibs/LinkedLists.cpp CommonLibs/LinkedLists.h CommonLibs/Regexp.h - CommonLibs/RegexpTest.cpp CommonLibs/Sockets.cpp CommonLibs/Sockets.h - CommonLibs/SocketsTest.cpp CommonLibs/Threads.cpp CommonLibs/Threads.h CommonLibs/Timeval.cpp CommonLibs/Timeval.h - CommonLibs/TimevalTest.cpp CommonLibs/Vector.h - CommonLibs/VectorTest.cpp - Control/CallControl.cpp - Control/ControlCommon.cpp - Control/ControlCommon.h - Control/FACCHDispatch.cpp - Control/MobilityManagement.cpp - Control/PagerTest.cpp - Control/RadioResource.cpp - Control/SDCCHDispatch.cpp GSM/GSM610Tables.cpp GSM/GSM610Tables.h GSM/GSMCommon.cpp @@ -79,26 +65,15 @@ GSM/GSMTransfer.cpp GSM/GSMTransfer.h LICENSEBLOCK - SIP/SIPEngine.h - SIP/SIPInterface.h - SMS/SMSMessages.cpp - SMS/SMSMessages.h - SMS/SMSTransfer.cpp - SMS/SMSTransfer.h TRXManager/TRXManager.cpp Transceiver/Complex.h - tests/AGCHTest.cpp - tests/BeaconTest.cpp - tests/CallTest.cpp - tests/CallTest2.cpp - tests/LAPDmTest.cpp - tests/LoopbackTest.cpp - tests/RegistrationTest.cpp - tests/TRXSimulator.cpp + tests/CommonLibs/BitVectorTest.cpp + tests/CommonLibs/InterthreadTest.cpp + tests/CommonLibs/SocketsTest.cpp + tests/CommonLibs/TimevalTest.cpp + tests/CommonLibs/VectorTest.cpp Harvind S. Samra, hssamra at kestrelsp.com: - Control/PagerTest.cpp - Control/RadioResource.cpp GSM/GSMConfig.h GSM/GSMTransfer.h LICENSEBLOCK @@ -120,13 +95,6 @@ Transceiver/testRadio.cpp Raffi Sevlian, raffisev at gmail.com: - Control/CallControl.cpp - Control/ControlCommon.cpp - Control/ControlCommon.h - Control/FACCHDispatch.cpp - Control/MobilityManagement.cpp - Control/PagerTest.cpp - Control/RadioResource.cpp GSM/GSMCommon.h GSM/GSMConfig.h GSM/GSML1FEC.h @@ -151,32 +119,6 @@ GSM/GSMSAPMux.h GSM/GSMTransfer.h LICENSEBLOCK - SIP/SIPEngine.cpp - SIP/SIPInterface.cpp - SIP/SIPInterface.h - SIP/SIPMessage.cpp - SIP/SIPMessage.h - SIP/SIPUtility.cpp - SIP/SIPUtility.h - SMS/CMMessage.cpp - SMS/CMMessage.h - SMS/CMProcessor.cpp - SMS/CMProcessor.h - SMS/CMTest.cpp - SMS/RLMessage.cpp - SMS/RLMessage.h - SMS/RLProcessor.cpp - SMS/RLProcessor.h - SMS/SMSMessages.cpp - SMS/SMSMessages.h - SMS/SMSProcessors.cpp - SMS/SMSProcessors.h - SMS/SMSTransfer.cpp - SMS/SMSTransfer.h - SMS/TLMessage.cpp - SMS/TLMessage.h - SMS/TLProcessor.cpp - SMS/TLProcessor.h TRXManager/TRXManager.h Alon Levy, alonlevy1 at gmail.com diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index d42e82a..a9fa099 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -38,15 +38,6 @@ Timeval.cpp \ Logger.cpp -noinst_PROGRAMS = \ - BitVectorTest \ - PRBSTest \ - InterthreadTest \ - SocketsTest \ - TimevalTest \ - VectorTest \ - LogTest - # ReportingTest noinst_HEADERS = \ @@ -59,30 +50,5 @@ Timeval.h \ Vector.h \ Logger.h - -BitVectorTest_SOURCES = BitVectorTest.cpp -BitVectorTest_LDADD = libcommon.la - -PRBSTest_SOURCES = PRBSTest.cpp - -InterthreadTest_SOURCES = InterthreadTest.cpp -InterthreadTest_LDADD = libcommon.la -InterthreadTest_LDFLAGS = -lpthread - -SocketsTest_SOURCES = SocketsTest.cpp -SocketsTest_LDADD = libcommon.la -SocketsTest_LDFLAGS = -lpthread - -TimevalTest_SOURCES = TimevalTest.cpp -TimevalTest_LDADD = libcommon.la - -VectorTest_SOURCES = VectorTest.cpp -VectorTest_LDADD = libcommon.la - -# ReportingTest_SOURCES = ReportingTest.cpp -# ReportingTest_LDADD = libcommon.la - -LogTest_SOURCES = LogTest.cpp -LogTest_LDADD = libcommon.la MOSTLYCLEANFILES += testSource testDestination diff --git a/Makefile.am b/Makefile.am index 658eae4..1e659a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,8 @@ SUBDIRS = \ CommonLibs \ GSM \ - Transceiver52M + Transceiver52M \ + tests EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index 1a9712a..3ad4b41 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,7 @@ AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([config]) AM_CONFIG_HEADER(config.h) +AC_CONFIG_TESTDIR(tests) AC_CANONICAL_BUILD AC_CANONICAL_HOST @@ -171,6 +172,8 @@ Transceiver52M/Makefile \ Transceiver52M/arm/Makefile \ Transceiver52M/x86/Makefile \ + tests/Makefile \ + tests/CommonLibs/Makefile \ ]) AC_OUTPUT diff --git a/CommonLibs/BitVectorTest.cpp b/tests/CommonLibs/BitVectorTest.cpp similarity index 100% rename from CommonLibs/BitVectorTest.cpp rename to tests/CommonLibs/BitVectorTest.cpp diff --git a/tests/CommonLibs/BitVectorTest.ok b/tests/CommonLibs/BitVectorTest.ok new file mode 100644 index 0000000..f959a08 --- /dev/null +++ b/tests/CommonLibs/BitVectorTest.ok @@ -0,0 +1,8 @@ +15 15 240 +000011110000 +101011110000 +175 +111101010000 +ts=abcdefgh +tp=0110000101100010011000110110010001100101011001100110011101101000000000 +ts=abcdefgh diff --git a/CommonLibs/InterthreadTest.cpp b/tests/CommonLibs/InterthreadTest.cpp similarity index 100% rename from CommonLibs/InterthreadTest.cpp rename to tests/CommonLibs/InterthreadTest.cpp diff --git a/tests/CommonLibs/InterthreadTest.ok b/tests/CommonLibs/InterthreadTest.ok new file mode 100644 index 0000000..db382bb --- /dev/null +++ b/tests/CommonLibs/InterthreadTest.ok @@ -0,0 +1,81 @@ +1515515500.150033 140715424245504: queue write 0 +1515515500.150105 140715423979264: map write 0 +1515515500.150132 140715423979264: map write 1 +1515515500.150143 140715424777984: queue read 0 +1515515500.150175 140715424511744: map read 0 +1515515500.150194 140715424511744: map read 1 +1515515501.150203 140715424245504: queue write 1 +1515515501.150288 140715423979264: map write 2 +1515515501.150334 140715424777984: queue read 1 +1515515501.150366 140715424511744: map read 2 +1515515502.150405 140715424245504: queue write 2 +1515515502.150488 140715423979264: map write 3 +1515515502.150533 140715424777984: queue read 2 +1515515502.150612 140715423979264: map write 4 +1515515502.150642 140715423979264: map write 5 +1515515502.150662 140715424511744: map read 3 +1515515502.150680 140715424511744: map read 4 +1515515502.150686 140715424511744: map read 5 +1515515503.150607 140715424245504: queue write 3 +1515515503.150709 140715424777984: queue read 3 +1515515503.150741 140715423979264: map write 6 +1515515503.150760 140715423979264: map write 7 +1515515503.150776 140715424511744: map read 6 +1515515503.150788 140715424511744: map read 7 +1515515504.150770 140715424245504: queue write 4 +1515515504.150839 140715424245504: queue write 5 +1515515504.150857 140715423979264: map write 8 +1515515504.150876 140715424777984: queue read 4 +1515515504.150904 140715424777984: queue read 5 +1515515504.150919 140715424511744: map read 8 +1515515505.150990 140715424245504: queue write 6 +1515515505.151066 140715423979264: map write 9 +1515515505.151095 140715424245504: queue write 7 +1515515505.151127 140715424245504: queue write 8 +1515515505.151143 140715424245504: queue write 9 +1515515505.151163 140715424245504: queue write 10 +1515515505.151179 140715424777984: queue read 6 +1515515505.151210 140715424777984: queue read 7 +1515515505.151217 140715424777984: queue read 8 +1515515505.151221 140715424777984: queue read 9 +1515515505.151226 140715424777984: queue read 10 +1515515505.151249 140715423979264: map write 10 +1515515505.151277 140715424511744: map read 9 +1515515505.151291 140715424511744: map read 10 +1515515505.151298 140715423979264: map write 11 +1515515505.151317 140715424511744: map read 11 +1515515506.151303 140715424245504: queue write 11 +1515515506.151386 140715423979264: map write 12 +1515515506.151414 140715424777984: queue read 11 +1515515506.151457 140715424511744: map read 12 +1515515506.151528 140715423979264: map write 13 +1515515506.151567 140715423979264: map write 14 +1515515506.151577 140715423979264: map write 15 +1515515506.151601 140715424511744: map read 13 +1515515506.151621 140715424511744: map read 14 +1515515506.151628 140715424511744: map read 15 +1515515507.151498 140715424245504: queue write 12 +1515515507.151606 140715424777984: queue read 12 +1515515507.151654 140715423979264: map write 16 +1515515507.151711 140715424511744: map read 16 +1515515508.151707 140715424245504: queue write 13 +1515515508.151778 140715423979264: map write 17 +1515515508.151816 140715423979264: map write 18 +1515515508.151830 140715424511744: map read 17 +1515515508.151870 140715424511744: map read 18 +1515515508.151904 140715423979264: map write 19 +1515515508.151963 140715424777984: queue read 13 +1515515508.151997 140715424511744: map read 19 +1515515509.151920 140715424245504: queue write 14 +1515515509.152023 140715424777984: queue read 14 +1515515510.152109 140715424245504: queue write 15 +1515515510.152218 140715424777984: queue read 15 +1515515511.152258 140715424245504: queue write 16 +1515515511.152380 140715424777984: queue read 16 +1515515512.152409 140715424245504: queue write 17 +1515515512.152449 140715424245504: queue write 18 +1515515512.152458 140715424777984: queue read 17 +1515515512.152477 140715424777984: queue read 18 +1515515513.152574 140715424245504: queue write 19 +1515515513.152674 140715424777984: queue read 19 +1515515513.152708 140715424777984: queue read -1 diff --git a/CommonLibs/LogTest.cpp b/tests/CommonLibs/LogTest.cpp similarity index 100% rename from CommonLibs/LogTest.cpp rename to tests/CommonLibs/LogTest.cpp diff --git a/tests/CommonLibs/LogTest.err b/tests/CommonLibs/LogTest.err new file mode 100644 index 0000000..eee46b9 --- /dev/null +++ b/tests/CommonLibs/LogTest.err @@ -0,0 +1,24 @@ +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 diff --git a/tests/CommonLibs/LogTest.ok b/tests/CommonLibs/LogTest.ok new file mode 100644 index 0000000..724f053 --- /dev/null +++ b/tests/CommonLibs/LogTest.ok @@ -0,0 +1,59 @@ +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +WARNING 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:48:main: testing the logger. +NOTICE 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:49:main: testing the logger. + + + +testing Alarms +you should see three lines: +# alarms = 4 +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +----------- generating 20 alarms ---------- +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +you should see ten lines with the numbers 10..19: +# alarms = 20 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 diff --git a/tests/CommonLibs/Makefile.am b/tests/CommonLibs/Makefile.am new file mode 100644 index 0000000..1d2bd64 --- /dev/null +++ b/tests/CommonLibs/Makefile.am @@ -0,0 +1,45 @@ +include $(top_srcdir)/Makefile.common + +AM_CPPFLAGS = -Wall -I$(top_srcdir)/CommonLibs $(STD_DEFINES_AND_INCLUDES) -g + +EXTRA_DIST = BitVectorTest.ok \ + PRBSTest.ok \ + InterthreadTest.ok \ + SocketsTest.ok \ + TimevalTest.ok \ + VectorTest.ok \ + LogTest.ok + +noinst_PROGRAMS = \ + BitVectorTest \ + PRBSTest \ + InterthreadTest \ + SocketsTest \ + TimevalTest \ + VectorTest \ + LogTest + +BitVectorTest_SOURCES = BitVectorTest.cpp +BitVectorTest_LDADD = $(COMMON_LA) + +PRBSTest_SOURCES = PRBSTest.cpp + +InterthreadTest_SOURCES = InterthreadTest.cpp +InterthreadTest_LDADD = $(COMMON_LA) +InterthreadTest_LDFLAGS = -lpthread + +SocketsTest_SOURCES = SocketsTest.cpp +SocketsTest_LDADD = $(COMMON_LA) +SocketsTest_LDFLAGS = -lpthread + +TimevalTest_SOURCES = TimevalTest.cpp +TimevalTest_LDADD = $(COMMON_LA) + +VectorTest_SOURCES = VectorTest.cpp +VectorTest_LDADD = $(COMMON_LA) + +# ReportingTest_SOURCES = ReportingTest.cpp +# ReportingTest_LDADD = $(COMMON_LA) + +LogTest_SOURCES = LogTest.cpp +LogTest_LDADD = $(COMMON_LA) diff --git a/CommonLibs/PRBSTest.cpp b/tests/CommonLibs/PRBSTest.cpp similarity index 100% rename from CommonLibs/PRBSTest.cpp rename to tests/CommonLibs/PRBSTest.cpp diff --git a/tests/CommonLibs/PRBSTest.ok b/tests/CommonLibs/PRBSTest.ok new file mode 100644 index 0000000..d3fe378 --- /dev/null +++ b/tests/CommonLibs/PRBSTest.ok @@ -0,0 +1,4 @@ +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +Period: 511 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +Period: 32767 diff --git a/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp similarity index 100% rename from CommonLibs/SocketsTest.cpp rename to tests/CommonLibs/SocketsTest.cpp diff --git a/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp similarity index 100% rename from CommonLibs/TimevalTest.cpp rename to tests/CommonLibs/TimevalTest.cpp diff --git a/tests/CommonLibs/TimevalTest.ok b/tests/CommonLibs/TimevalTest.ok new file mode 100644 index 0000000..c97031d --- /dev/null +++ b/tests/CommonLibs/TimevalTest.ok @@ -0,0 +1,22 @@ +-10000 +now: 1515515602.357742 then: 1515515612.357710 remaining: 10000 +now: 1515515602.857837 then: 1515515612.357710 remaining: 9500 +now: 1515515603.357975 then: 1515515612.357710 remaining: 9000 +now: 1515515603.858163 then: 1515515612.357710 remaining: 8500 +now: 1515515604.358353 then: 1515515612.357710 remaining: 8000 +now: 1515515604.858465 then: 1515515612.357710 remaining: 7500 +now: 1515515605.358622 then: 1515515612.357710 remaining: 7000 +now: 1515515605.858745 then: 1515515612.357710 remaining: 6499 +now: 1515515606.358852 then: 1515515612.357710 remaining: 5999 +now: 1515515606.859055 then: 1515515612.357710 remaining: 5499 +now: 1515515607.359170 then: 1515515612.357710 remaining: 4999 +now: 1515515607.859349 then: 1515515612.357710 remaining: 4499 +now: 1515515608.359455 then: 1515515612.357710 remaining: 3999 +now: 1515515608.859549 then: 1515515612.357710 remaining: 3499 +now: 1515515609.359748 then: 1515515612.357710 remaining: 2998 +now: 1515515609.859865 then: 1515515612.357710 remaining: 2498 +now: 1515515610.360064 then: 1515515612.357710 remaining: 1998 +now: 1515515610.860223 then: 1515515612.357710 remaining: 1498 +now: 1515515611.360386 then: 1515515612.357710 remaining: 998 +now: 1515515611.860592 then: 1515515612.357710 remaining: 498 +now: 1515515612.360712 then: 1515515612.357710 remaining: -3 diff --git a/CommonLibs/VectorTest.cpp b/tests/CommonLibs/VectorTest.cpp similarity index 100% rename from CommonLibs/VectorTest.cpp rename to tests/CommonLibs/VectorTest.cpp diff --git a/tests/CommonLibs/VectorTest.ok b/tests/CommonLibs/VectorTest.ok new file mode 100644 index 0000000..afe5162 --- /dev/null +++ b/tests/CommonLibs/VectorTest.ok @@ -0,0 +1,10 @@ +0 1 2 3 4 +10 11 12 13 14 +0 1 2 3 4 10 11 12 13 14 +0 1 2 +3 4 10 11 12 13 14 +8 8 8 8 8 8 8 8 8 8 +8 8 8 0 1 2 3 4 8 8 +1 2 3 +8 8 8 0 9 9 9 4 8 8 +9 9 9 diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..c18bef3 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,40 @@ +SUBDIRS = \ + CommonLibs \ + $(NULL) + +# The `:;' works around a Bash 3.2 bug when the output is not writeable. +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + :;{ \ + echo '# Signature of the current package.' && \ + echo 'm4_define([AT_PACKAGE_NAME],' && \ + echo ' [$(PACKAGE_NAME)])' && \ + echo 'm4_define([AT_PACKAGE_TARNAME],' && \ + echo ' [$(PACKAGE_TARNAME)])' && \ + echo 'm4_define([AT_PACKAGE_VERSION],' && \ + echo ' [$(PACKAGE_VERSION)])' && \ + echo 'm4_define([AT_PACKAGE_STRING],' && \ + echo ' [$(PACKAGE_STRING)])' && \ + echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \ + echo ' [$(PACKAGE_BUGREPORT)])'; \ + echo 'm4_define([AT_PACKAGE_URL],' && \ + echo ' [$(PACKAGE_URL)])'; \ + } >'$(srcdir)/package.m4' + +EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) +TESTSUITE = $(srcdir)/testsuite +DISTCLEANFILES = atconfig $(NULL) + +check-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean + +AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + mv $@.tmp $@ diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..2c1e0b5 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,45 @@ +AT_INIT +AT_BANNER([Regression tests.]) + +AT_SETUP([BitVectorTest]) +AT_KEYWORDS([BitVectorTest]) +cat $abs_srcdir/CommonLibs/BitVectorTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/BitVectorTest], [], [expout], []) +AT_CLEANUP + +#AT_SETUP([InterthreadTest]) +#AT_KEYWORDS([InterthreadTest]) +#cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], []) +#AT_CLEANUP + +#AT_SETUP([LogTest]) +#AT_KEYWORDS([LogTest]) +#cat $abs_srcdir/CommonLibs/LogTest.ok > expout +#cat $abs_srcdir/CommonLibs/LogTest.err > experr +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) +#AT_CLEANUP + +AT_SETUP([PRBSTest]) +AT_KEYWORDS([PRBSTest]) +cat $abs_srcdir/CommonLibs/PRBSTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/PRBSTest], [], [expout], []) +AT_CLEANUP + +#AT_SETUP([SocketsTest]) +#AT_KEYWORDS([SocketsTest]) +#cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) +#AT_CLEANUP + +#AT_SETUP([TimevalTest]) +#AT_KEYWORDS([TimevalTest]) +#cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], []) +#AT_CLEANUP + +AT_SETUP([VectorTest]) +AT_KEYWORDS([VectorTest]) +cat $abs_srcdir/CommonLibs/VectorTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/VectorTest], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 19:29:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 19:29:10 +0000 Subject: [PATCH] osmo-trx[master]: tests: InterThread: adapt to have reproducible output and en... Message-ID: Review at https://gerrit.osmocom.org/5707 tests: InterThread: adapt to have reproducible output and enable autotest Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f --- M tests/CommonLibs/InterthreadTest.cpp M tests/CommonLibs/InterthreadTest.ok M tests/testsuite.at 3 files changed, 30 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/07/5707/1 diff --git a/tests/CommonLibs/InterthreadTest.cpp b/tests/CommonLibs/InterthreadTest.cpp index 03445d9..0f6ce5a 100644 --- a/tests/CommonLibs/InterthreadTest.cpp +++ b/tests/CommonLibs/InterthreadTest.cpp @@ -35,14 +35,20 @@ InterthreadQueue gQ; InterthreadMap gMap; +int q_last_read_val = -1; +int q_last_write_val; +int m_last_read_val; +int m_last_write_val; + void* qWriter(void*) { int *p; for (int i=0; i<20; i++) { p = new int; *p = i; - COUT("queue write " << *p); + CERR("queue write " << *p); gQ.write(p); + q_last_write_val = i; if (random()%2) sleep(1); } p = new int; @@ -56,8 +62,14 @@ bool done = false; while (!done) { int *p = gQ.read(); - COUT("queue read " << *p); - if (*p<0) done=true; + CERR("queue read " << *p); + if (*p<0) { + assert(q_last_read_val == 19 && *p == -1); + done = true; + } else { + assert(q_last_read_val == *p - 1); + q_last_read_val = *p; + } delete p; } return NULL; @@ -70,8 +82,9 @@ for (int i=0; i<20; i++) { p = new int; *p = i; - COUT("map write " << *p); + CERR("map write " << *p); gMap.write(i,p); + m_last_write_val = i; if (random()%2) sleep(1); } return NULL; @@ -81,7 +94,9 @@ { for (int i=0; i<20; i++) { int *p = gMap.read(i); - COUT("map read " << *p); + CERR("map read " << *p); + assert(*p == i); + m_last_read_val = *p; // InterthreadMap will delete the pointers // delete p; } @@ -109,6 +124,11 @@ qWriterThread.join(); mapReaderThread.join(); mapWriterThread.join(); + + assert(q_last_write_val == 19); + assert(q_last_read_val == 19); + assert(m_last_write_val == 19); + assert(m_last_read_val == 19); } diff --git a/tests/CommonLibs/InterthreadTest.ok b/tests/CommonLibs/InterthreadTest.ok index db382bb..e69de29 100644 --- a/tests/CommonLibs/InterthreadTest.ok +++ b/tests/CommonLibs/InterthreadTest.ok @@ -1,81 +0,0 @@ -1515515500.150033 140715424245504: queue write 0 -1515515500.150105 140715423979264: map write 0 -1515515500.150132 140715423979264: map write 1 -1515515500.150143 140715424777984: queue read 0 -1515515500.150175 140715424511744: map read 0 -1515515500.150194 140715424511744: map read 1 -1515515501.150203 140715424245504: queue write 1 -1515515501.150288 140715423979264: map write 2 -1515515501.150334 140715424777984: queue read 1 -1515515501.150366 140715424511744: map read 2 -1515515502.150405 140715424245504: queue write 2 -1515515502.150488 140715423979264: map write 3 -1515515502.150533 140715424777984: queue read 2 -1515515502.150612 140715423979264: map write 4 -1515515502.150642 140715423979264: map write 5 -1515515502.150662 140715424511744: map read 3 -1515515502.150680 140715424511744: map read 4 -1515515502.150686 140715424511744: map read 5 -1515515503.150607 140715424245504: queue write 3 -1515515503.150709 140715424777984: queue read 3 -1515515503.150741 140715423979264: map write 6 -1515515503.150760 140715423979264: map write 7 -1515515503.150776 140715424511744: map read 6 -1515515503.150788 140715424511744: map read 7 -1515515504.150770 140715424245504: queue write 4 -1515515504.150839 140715424245504: queue write 5 -1515515504.150857 140715423979264: map write 8 -1515515504.150876 140715424777984: queue read 4 -1515515504.150904 140715424777984: queue read 5 -1515515504.150919 140715424511744: map read 8 -1515515505.150990 140715424245504: queue write 6 -1515515505.151066 140715423979264: map write 9 -1515515505.151095 140715424245504: queue write 7 -1515515505.151127 140715424245504: queue write 8 -1515515505.151143 140715424245504: queue write 9 -1515515505.151163 140715424245504: queue write 10 -1515515505.151179 140715424777984: queue read 6 -1515515505.151210 140715424777984: queue read 7 -1515515505.151217 140715424777984: queue read 8 -1515515505.151221 140715424777984: queue read 9 -1515515505.151226 140715424777984: queue read 10 -1515515505.151249 140715423979264: map write 10 -1515515505.151277 140715424511744: map read 9 -1515515505.151291 140715424511744: map read 10 -1515515505.151298 140715423979264: map write 11 -1515515505.151317 140715424511744: map read 11 -1515515506.151303 140715424245504: queue write 11 -1515515506.151386 140715423979264: map write 12 -1515515506.151414 140715424777984: queue read 11 -1515515506.151457 140715424511744: map read 12 -1515515506.151528 140715423979264: map write 13 -1515515506.151567 140715423979264: map write 14 -1515515506.151577 140715423979264: map write 15 -1515515506.151601 140715424511744: map read 13 -1515515506.151621 140715424511744: map read 14 -1515515506.151628 140715424511744: map read 15 -1515515507.151498 140715424245504: queue write 12 -1515515507.151606 140715424777984: queue read 12 -1515515507.151654 140715423979264: map write 16 -1515515507.151711 140715424511744: map read 16 -1515515508.151707 140715424245504: queue write 13 -1515515508.151778 140715423979264: map write 17 -1515515508.151816 140715423979264: map write 18 -1515515508.151830 140715424511744: map read 17 -1515515508.151870 140715424511744: map read 18 -1515515508.151904 140715423979264: map write 19 -1515515508.151963 140715424777984: queue read 13 -1515515508.151997 140715424511744: map read 19 -1515515509.151920 140715424245504: queue write 14 -1515515509.152023 140715424777984: queue read 14 -1515515510.152109 140715424245504: queue write 15 -1515515510.152218 140715424777984: queue read 15 -1515515511.152258 140715424245504: queue write 16 -1515515511.152380 140715424777984: queue read 16 -1515515512.152409 140715424245504: queue write 17 -1515515512.152449 140715424245504: queue write 18 -1515515512.152458 140715424777984: queue read 17 -1515515512.152477 140715424777984: queue read 18 -1515515513.152574 140715424245504: queue write 19 -1515515513.152674 140715424777984: queue read 19 -1515515513.152708 140715424777984: queue read -1 diff --git a/tests/testsuite.at b/tests/testsuite.at index 2c1e0b5..5d519d2 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -7,11 +7,11 @@ AT_CHECK([$abs_top_builddir/tests/CommonLibs/BitVectorTest], [], [expout], []) AT_CLEANUP -#AT_SETUP([InterthreadTest]) -#AT_KEYWORDS([InterthreadTest]) -#cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([InterthreadTest]) +AT_KEYWORDS([InterthreadTest]) +cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], [ignore]) +AT_CLEANUP #AT_SETUP([LogTest]) #AT_KEYWORDS([LogTest]) -- To view, visit https://gerrit.osmocom.org/5707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 19:29:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 19:29:10 +0000 Subject: [PATCH] osmo-trx[master]: tests: Log: adapt to have reproducible output and enable aut... Message-ID: Review at https://gerrit.osmocom.org/5709 tests: Log: adapt to have reproducible output and enable autotest Change-Id: I77c40230503acadef5f64ab2624cd872f9782b98 --- M tests/CommonLibs/LogTest.cpp M tests/CommonLibs/LogTest.err M tests/CommonLibs/LogTest.ok M tests/testsuite.at 4 files changed, 91 insertions(+), 89 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/09/5709/1 diff --git a/tests/CommonLibs/LogTest.cpp b/tests/CommonLibs/LogTest.cpp index 2245386..f64041d 100644 --- a/tests/CommonLibs/LogTest.cpp +++ b/tests/CommonLibs/LogTest.cpp @@ -41,21 +41,21 @@ { gLogInit("LogTest","NOTICE",LOG_LOCAL7); - LOG(EMERG) << " testing the logger."; - LOG(ALERT) << " testing the logger."; - LOG(CRIT) << " testing the logger."; - LOG(ERR) << " testing the logger."; - LOG(WARNING) << " testing the logger."; - LOG(NOTICE) << " testing the logger."; - LOG(INFO) << " testing the logger."; - LOG(DEBUG) << " testing the logger."; + Log(LOG_EMERG).get() << " testing the logger."; + Log(LOG_ALERT).get() << " testing the logger."; + Log(LOG_CRIT).get() << " testing the logger."; + Log(LOG_ERR).get() << " testing the logger."; + Log(LOG_WARNING).get() << " testing the logger."; + Log(LOG_NOTICE).get() << " testing the logger."; + Log(LOG_INFO).get() << " testing the logger."; + Log(LOG_DEBUG).get() << " testing the logger."; std::cout << "\n\n\n"; std::cout << "testing Alarms\n"; std::cout << "you should see three lines:" << std::endl; printAlarms(); std::cout << "----------- generating 20 alarms ----------" << std::endl; for (int i = 0 ; i < 20 ; ++i) { - LOG(ALERT) << i; + Log(LOG_ALERT).get() << i; } std::cout << "you should see ten lines with the numbers 10..19:" << std::endl; printAlarms(); diff --git a/tests/CommonLibs/LogTest.err b/tests/CommonLibs/LogTest.err index eee46b9..718ff40 100644 --- a/tests/CommonLibs/LogTest.err +++ b/tests/CommonLibs/LogTest.err @@ -1,24 +1,24 @@ -EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. -CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. -ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +EMERG testing the logger. +ALERT testing the logger. +CRIT testing the logger. +ERR testing the logger. +ALERT 0 +ALERT 1 +ALERT 2 +ALERT 3 +ALERT 4 +ALERT 5 +ALERT 6 +ALERT 7 +ALERT 8 +ALERT 9 +ALERT 10 +ALERT 11 +ALERT 12 +ALERT 13 +ALERT 14 +ALERT 15 +ALERT 16 +ALERT 17 +ALERT 18 +ALERT 19 diff --git a/tests/CommonLibs/LogTest.ok b/tests/CommonLibs/LogTest.ok index 724f053..e1211b0 100644 --- a/tests/CommonLibs/LogTest.ok +++ b/tests/CommonLibs/LogTest.ok @@ -1,59 +1,61 @@ -EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. -CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. -ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. -WARNING 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:48:main: testing the logger. -NOTICE 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:49:main: testing the logger. +EMERG testing the logger. +ALERT testing the logger. +CRIT testing the logger. +ERR testing the logger. +WARNING testing the logger. +NOTICE testing the logger. +INFO testing the logger. +DEBUG testing the logger. testing Alarms you should see three lines: # alarms = 4 -EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. -CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. -ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +EMERG testing the logger. +ALERT testing the logger. +CRIT testing the logger. +ERR testing the logger. ----------- generating 20 alarms ---------- -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +ALERT 0 +ALERT 1 +ALERT 2 +ALERT 3 +ALERT 4 +ALERT 5 +ALERT 6 +ALERT 7 +ALERT 8 +ALERT 9 +ALERT 10 +ALERT 11 +ALERT 12 +ALERT 13 +ALERT 14 +ALERT 15 +ALERT 16 +ALERT 17 +ALERT 18 +ALERT 19 you should see ten lines with the numbers 10..19: # alarms = 20 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +ALERT 0 +ALERT 1 +ALERT 2 +ALERT 3 +ALERT 4 +ALERT 5 +ALERT 6 +ALERT 7 +ALERT 8 +ALERT 9 +ALERT 10 +ALERT 11 +ALERT 12 +ALERT 13 +ALERT 14 +ALERT 15 +ALERT 16 +ALERT 17 +ALERT 18 +ALERT 19 diff --git a/tests/testsuite.at b/tests/testsuite.at index 8e9a541..f6b48af 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -13,12 +13,12 @@ AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], [ignore]) AT_CLEANUP -#AT_SETUP([LogTest]) -#AT_KEYWORDS([LogTest]) -#cat $abs_srcdir/CommonLibs/LogTest.ok > expout -#cat $abs_srcdir/CommonLibs/LogTest.err > experr -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) -#AT_CLEANUP +AT_SETUP([LogTest]) +AT_KEYWORDS([LogTest]) +cat $abs_srcdir/CommonLibs/LogTest.ok > expout +cat $abs_srcdir/CommonLibs/LogTest.err > experr +AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) +AT_CLEANUP AT_SETUP([PRBSTest]) AT_KEYWORDS([PRBSTest]) -- To view, visit https://gerrit.osmocom.org/5709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77c40230503acadef5f64ab2624cd872f9782b98 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 19:29:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 19:29:10 +0000 Subject: [PATCH] osmo-trx[master]: tests: Timeval: adapt to have reproducible output and enable... Message-ID: Review at https://gerrit.osmocom.org/5708 tests: Timeval: adapt to have reproducible output and enable autotest Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 --- M tests/CommonLibs/TimevalTest.cpp M tests/CommonLibs/TimevalTest.ok M tests/testsuite.at 3 files changed, 20 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/08/5708/1 diff --git a/tests/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp index b4746f2..11360f9 100644 --- a/tests/CommonLibs/TimevalTest.cpp +++ b/tests/CommonLibs/TimevalTest.cpp @@ -28,18 +28,29 @@ #include "Timeval.h" #include +#include using namespace std; int main(int argc, char *argv[]) { - Timeval then(10000); - cout << then.elapsed() << endl; + assert(then.elapsed() == -10000); + cerr << then << " elapsed: " << then.elapsed() << endl; + double then_seconds = then.seconds(); + double last_now = Timeval().seconds(); + long last_remaining = 10000; + int loops = 0; while (!then.passed()) { - cout << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + double tnow = Timeval().seconds(); + cerr << "now: " << tnow << " then: " << then << " remaining: " << then.remaining() << endl; + assert(last_now <= tnow && last_remaining >= then.remaining()); + assert(then_seconds == then.seconds()); usleep(500000); + loops++; } - cout << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + cerr << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + assert(then.remaining() <= 0); + assert(loops >= 18); } diff --git a/tests/CommonLibs/TimevalTest.ok b/tests/CommonLibs/TimevalTest.ok index c97031d..e69de29 100644 --- a/tests/CommonLibs/TimevalTest.ok +++ b/tests/CommonLibs/TimevalTest.ok @@ -1,22 +0,0 @@ --10000 -now: 1515515602.357742 then: 1515515612.357710 remaining: 10000 -now: 1515515602.857837 then: 1515515612.357710 remaining: 9500 -now: 1515515603.357975 then: 1515515612.357710 remaining: 9000 -now: 1515515603.858163 then: 1515515612.357710 remaining: 8500 -now: 1515515604.358353 then: 1515515612.357710 remaining: 8000 -now: 1515515604.858465 then: 1515515612.357710 remaining: 7500 -now: 1515515605.358622 then: 1515515612.357710 remaining: 7000 -now: 1515515605.858745 then: 1515515612.357710 remaining: 6499 -now: 1515515606.358852 then: 1515515612.357710 remaining: 5999 -now: 1515515606.859055 then: 1515515612.357710 remaining: 5499 -now: 1515515607.359170 then: 1515515612.357710 remaining: 4999 -now: 1515515607.859349 then: 1515515612.357710 remaining: 4499 -now: 1515515608.359455 then: 1515515612.357710 remaining: 3999 -now: 1515515608.859549 then: 1515515612.357710 remaining: 3499 -now: 1515515609.359748 then: 1515515612.357710 remaining: 2998 -now: 1515515609.859865 then: 1515515612.357710 remaining: 2498 -now: 1515515610.360064 then: 1515515612.357710 remaining: 1998 -now: 1515515610.860223 then: 1515515612.357710 remaining: 1498 -now: 1515515611.360386 then: 1515515612.357710 remaining: 998 -now: 1515515611.860592 then: 1515515612.357710 remaining: 498 -now: 1515515612.360712 then: 1515515612.357710 remaining: -3 diff --git a/tests/testsuite.at b/tests/testsuite.at index 5d519d2..8e9a541 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -32,11 +32,11 @@ #AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) #AT_CLEANUP -#AT_SETUP([TimevalTest]) -#AT_KEYWORDS([TimevalTest]) -#cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([TimevalTest]) +AT_KEYWORDS([TimevalTest]) +cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], [ignore]) +AT_CLEANUP AT_SETUP([VectorTest]) AT_KEYWORDS([VectorTest]) -- To view, visit https://gerrit.osmocom.org/5708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 19:29:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 19:29:10 +0000 Subject: [PATCH] osmo-trx[master]: Sockets.cpp: Fix initialization of UDD socket Message-ID: Review at https://gerrit.osmocom.org/5710 Sockets.cpp: Fix initialization of UDD socket Without this line, destination address for a UDD socket is left with incorrect value AF_UNSPEC. Later on when calling DatagramSocket:write(), sendto() fails with EINVAL. This commit fixes test SocketsTest.cpp. Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433 --- M CommonLibs/Sockets.cpp 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/10/5710/1 diff --git a/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index a65d62b..11e96dd 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -324,6 +324,7 @@ void UDDSocket::destination(const char* remotePath) { struct sockaddr_un* unAddr = (struct sockaddr_un*)mDestination; + unAddr->sun_family = AF_UNIX; strcpy(unAddr->sun_path,remotePath); } -- To view, visit https://gerrit.osmocom.org/5710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 19:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 9 Jan 2018 19:29:11 +0000 Subject: [PATCH] osmo-trx[master]: tests: Sockets: adapt to have reproducible output and enable... Message-ID: Review at https://gerrit.osmocom.org/5711 tests: Sockets: adapt to have reproducible output and enable autotest Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c --- M tests/CommonLibs/SocketsTest.cpp A tests/CommonLibs/SocketsTest.ok M tests/testsuite.at 3 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/11/5711/1 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 3198a5e..e73ad72 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -44,7 +44,7 @@ char buf[MAX_UDP_LENGTH]; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { - COUT("read: " << buf); + CERR("read: " << buf); rc++; } else { sleep(2); @@ -65,7 +65,7 @@ buf[MAX_UDP_LENGTH] = '\0'; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { - COUT("read: " << buf); + CERR("read: " << buf); rc++; } else { sleep(2); @@ -85,14 +85,14 @@ UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); UDDSocket socket1U("testSource","testDestination"); - - COUT("socket1: " << socket1.port()); + + CERR("socket1: " << socket1.port()); // give the readers time to open sleep(1); for (int i=0; i expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([SocketsTest]) +AT_KEYWORDS([SocketsTest]) +cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], [ignore]) +AT_CLEANUP AT_SETUP([TimevalTest]) AT_KEYWORDS([TimevalTest]) -- To view, visit https://gerrit.osmocom.org/5711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 9 20:31:40 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 20:31:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3377 to look at the new patch set (#4). gsm0480: parse GSM0480_MTYPE_FACILITY separately Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa --- M src/gsm/gsm0480.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/3377/4 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ecbea8c..d717270 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -196,6 +196,8 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *req); +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct gsm0480_ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, @@ -281,8 +283,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - case GSM0480_MTYPE_FACILITY: rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + break; + case GSM0480_MTYPE_FACILITY: + rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", @@ -294,6 +298,18 @@ return rc; } +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct gsm0480_ss_request *req) +{ + uint8_t facility_length; + + facility_length = ss_facility[0]; + if (len - 1 < facility_length) + return 0; + + return parse_facility_ie(ss_facility + 1, facility_length, req); +} + static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct gsm0480_ss_request *req) { -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 20:31:40 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 20:31:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3378 to look at the new patch set (#4). gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 84 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3378/4 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d717270..d1e978f 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -369,6 +373,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -448,6 +455,83 @@ return rc; } +/* Parse an Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 1; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; + + req->ussd_text_language = 1; + req->ussd_text_len = num_chars; + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 20:31:40 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 20:31:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3381 to look at the new patch set (#4). gsm0480: expose the gsm0480_parse_ss_facility_ie() Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3381/4 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 7811c9e..4e0d99f 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -50,6 +50,8 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *request); +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct gsm0480_ss_request *req); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index a35ff4a..ae82f46 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -200,8 +200,6 @@ struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct gsm0480_ss_request *req); -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, @@ -311,7 +309,8 @@ if (len - 1 < facility_length) return 0; - return parse_facility_ie(ss_facility + 1, facility_length, req); + return gsm0480_parse_ss_facility_ie(ss_facility + 1, + facility_length, req); } static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, @@ -333,7 +332,7 @@ case GSM48_IE_CAUSE: break; case GSM0480_IE_FACILITY: - rc = parse_facility_ie(ss_ie + 2, iei_length, req); + rc = gsm0480_parse_ss_facility_ie(ss_ie + 2, iei_length, req); break; case GSM0480_IE_SS_VERSION: break; @@ -347,8 +346,8 @@ return rc; } -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct gsm0480_ss_request *req) +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset = 0; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5611ba3..f316cad 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -90,6 +90,7 @@ gsm0480_create_ussd_release_complete; gsm0480_decode_ussd_request; gsm0480_decode_ss_request; +gsm0480_parse_ss_facility_ie; gsm0480_wrap_facility; gsm0480_wrap_invoke; -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 20:31:40 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 20:31:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3374 to look at the new patch set (#3). gsm0480: modify USSD structures to support external handling This change renames the 'ss_request' struct to 'gsm0480_ss_request', and adds the following new fields: - message_type - GSM 04.80 Chapter 2.2 - component_type - GSM 04.80 Chapter 3.6.2 - error_code - GSM 04.80 Chapter 3.6.6 - problem_code - GSM 04.80 Chapter 3.6.7 - ussd_text_language - ussd_text_len in order to pave the way for the further patches to allow communicating un-parsed SS/USSD to an external application, and avoid parsing the whole SS/USSD request every time. As this brokes the API/ABI, the code compiled against the old version of the library will no longer work due to the missing symbol. Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 --- M TODO-RELEASE M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M tests/ussd/ussd_test.c 4 files changed, 54 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/3374/3 diff --git a/TODO-RELEASE b/TODO-RELEASE index a5def79..da0e82a 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h +gsm GSM 04.80 API + ABI facilitate external USSD interface diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 672ffe5..781d8d7 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -20,16 +20,36 @@ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, struct ussd_request *request) OSMO_DEPRECATED("Use gsm0480_decode_ss_request() instead"); -struct ss_request { - uint8_t opcode; - uint8_t ss_code; - uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; +struct gsm0480_ss_request { + /*! L3 transaction ID */ uint8_t transaction_id; + /*! Message type 2.2 */ + uint8_t message_type; + + /*! Component type 3.6.2 */ + uint8_t component_type; + /*! Invoke id 3.6.3 */ uint8_t invoke_id; + + union { + /*! Operational code 3.6.4 */ + uint8_t opcode; + /*! Error code 3.6.6 */ + uint8_t error_code; + /*! Problem code 3.6.7 */ + uint8_t problem_code; + }; + + uint8_t ussd_text_len; + uint8_t ussd_text_language; + uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; + + /*! Parameters of a Interrogate/Activate/DeactivateSS Request */ + uint8_t ss_code; }; int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, - struct ss_request *request); + struct gsm0480_ss_request *request); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 71470e5..9cfe336 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -195,24 +195,24 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, - uint16_t len, struct ss_request *req); + uint16_t len, struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); /* Decode a mobile-originated USSD-request message */ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, struct ussd_request *req) { - struct ss_request ss; + struct gsm0480_ss_request ss; int rc = 0; memset(&ss, 0, sizeof(ss)); @@ -228,7 +228,7 @@ ss.transaction_id = req->transaction_id; rc = parse_ss(hdr, len, &ss); - /* convert from ss_request to legacy ussd_request */ + /* convert from gsm0480_ss_request to legacy ussd_request */ req->transaction_id = ss.transaction_id; req->invoke_id = ss.invoke_id; if (ss.ussd_text[0] == 0xFF) @@ -247,7 +247,7 @@ /* Decode a mobile-originated SS request message */ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 0; @@ -267,11 +267,13 @@ return rc; } -static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) +static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, + struct gsm0480_ss_request *req) { int rc = 1; uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ + req->message_type = msg_type; switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); @@ -293,7 +295,7 @@ } static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = -1; /* Information Element Identifier - table 3.2 & GSM 04.08 section 10.5 */ @@ -326,7 +328,7 @@ } static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset = 0; @@ -341,6 +343,8 @@ LOGP(0, LOGL_ERROR, "Component does not fit.\n"); return 0; } + + req->component_type = component_type; switch (component_type) { case GSM0480_CTYPE_INVOKE: @@ -368,7 +372,7 @@ /* Parse an Invoke component - see table 3.3 */ static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset; @@ -430,7 +434,7 @@ /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 0; int num_chars; @@ -451,9 +455,12 @@ /* Prevent a mobile-originated buffer-overrun! */ if (num_chars > MAX_LEN_USSD_STRING) num_chars = MAX_LEN_USSD_STRING; - gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), - &(uss_req_data[7]), num_chars); + + num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + req->ussd_text_language = 0x80; + req->ussd_text_len = num_chars; rc = 1; } } @@ -464,7 +471,7 @@ /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ static int parse_ss_for_bs_req(const uint8_t *ss_req_data, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 0; diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 40b4317..e5a734f 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -44,7 +44,7 @@ { uint8_t *data; int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *hdr; data = malloc(len); @@ -60,7 +60,7 @@ { uint8_t *data; int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *hdr; data = malloc(len); @@ -119,7 +119,7 @@ int main(int argc, char **argv) { - struct ss_request req; + struct gsm0480_ss_request req; const int size = sizeof(ussd_request); int i; struct msgb *msg; -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Tue Jan 9 20:31:40 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 20:31:40 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#4). gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/3375/4 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 9cfe336..12ae1a3 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -436,36 +436,37 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) { - int rc = 0; int num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; - num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; - req->ussd_text_language = 0x80; - req->ussd_text_len = num_chars; - rc = 1; - } - } + num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + req->ussd_text_language = 0x80; + req->ussd_text_len = num_chars; + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 9 20:31:43 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 9 Jan 2018 20:31:43 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 Message-ID: Review at https://gerrit.osmocom.org/5712 gsm0480: increase the MAX_LEN_USSD_STRING to 182 According to the GSM 04.08 specification, the maximum size of a USSD message is 160 bytes. So, for 7-bit data coding schemes, the maximum number of characters is 182 (160 * 8 / 7) characters. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5712/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 781d8d7..7811c9e 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,7 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +#define MAX_LEN_USSD_STRING 182 /* deprecated */ struct ussd_request { -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:05:13 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:05:13 +0000 Subject: [PATCH] pysim[master]: Fix comment: Ki -> OPC Message-ID: Review at https://gerrit.osmocom.org/5713 Fix comment: Ki -> OPC Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a --- M pySim-prog.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/5713/1 diff --git a/pySim-prog.py b/pySim-prog.py index 3df18ba..728949e 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -367,7 +367,7 @@ else: ki = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]) - # Ki (random) + # OPC (random) if opts.opc is not None: opc = opts.opc if not re.match('^[0-9a-fA-F]{32}$', opc): -- To view, visit https://gerrit.osmocom.org/5713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:05:13 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:05:13 +0000 Subject: [PATCH] pysim[master]: ts_51_011: A file with MF/DF/EF constants from TS 51 011 Message-ID: Review at https://gerrit.osmocom.org/5714 ts_51_011: A file with MF/DF/EF constants from TS 51 011 pySim has been using magic numbers to access various files which makes it hard to read, maintain and extend. With this file in place we can start replacing all those magic numbers with human readable names lile EF['IMSI'] instead of ['3F00', '7F20', '6F07']. Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 --- A pySim/ts_51_011.py 1 file changed, 251 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/14/5714/1 diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py new file mode 100644 index 0000000..754d57f --- /dev/null +++ b/pySim/ts_51_011.py @@ -0,0 +1,251 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" Various constants from ETSI TS 151.011 +""" + +# +# Copyright (C) 2017 Alexander.Chemeris +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +MF_num = '3F00' + +DF_num = { +'TELECOM': '7F10', + +'GSM': '7F20', +'IS-41': '7F22', +'FP-CTS': '7F23', + +'GRAPHICS': '5F50', + +'IRIDIUM': '5F30', +'GLOBST': '5F31', +'ICO': '5F32', +'ACeS': '5F33', + +'EIA/TIA-553': '5F40', +'CTS': '5F60', +'SOLSA': '5F70', + +'MExE': '5F3C', +} + +EF_num = { +# MF +'ICCID': '2FE2', +'ELP': '2F05', + +# DF_TELECOM +'ADN': '6F3A', +'FDN': '6F3B', +'SMS': '6F3C', +'CCP': '6F3D', +'MSISDN': '6F40', +'SMSP': '6F42', +'SMSS': '6F43', +'LND': '6F44', +'SMSR': '6F47', +'SDN': '6F49', +'EXT1': '6F4A', +'EXT2': '6F4B', +'EXT3': '6F4C', +'BDN': '6F4D', +'EXT4': '6F4E', +'CMI': '6F58', +'ECCP': '6F4F', + +# DF_GRAPHICS +'IMG': '4F20', + +# DF_SoLSA +'SAI': '4F30', +'SLL': '4F31', + +# DF_MExE +'MExE-ST': '4F40', +'ORPK': '4F41', +'ARPK': '4F42', +'TPRPK': '4F43', + +# DF_GSM +'LP': '6F05', +'IMSI': '6F07', +'Kc': '6F20', +'DCK': '6F2C', +'PLMNsel': '6F30', +'HPPLMN': '6F31', +'CNL': '6F32', +'ACMmax': '6F37', +'SST': '6F38', +'ACM': '6F39', +'GID1': '6F3E', +'GID2': '6F3F', +'PUCT': '6F41', +'CBMI': '6F45', +'SPN': '6F46', +'CBMID': '6F48', +'BCCH': '6F74', +'ACC': '6F78', +'FPLMN': '6F7B', +'LOCI': '6F7E', +'AD': '6FAD', +'PHASE': '6FAE', +'VGCS': '6FB1', +'VGCSS': '6FB2', +'VBS': '6FB3', +'VBSS': '6FB4', +'eMLPP': '6FB5', +'AAeM': '6FB6', +'ECC': '6FB7', +'CBMIR': '6F50', +'NIA': '6F51', +'KcGPRS': '6F52', +'LOCIGPRS': '6F53', +'SUME': '6F54', +'PLMNwAcT': '6F60', +'OPLMNwAcT': '6F61', +# Figure 8 names it HPLMNAcT, but in the text it's names it HPLMNwAcT +'HPLMNAcT': '6F62', +'HPLMNwAcT': '6F62', +'CPBCCH': '6F63', +'INVSCAN': '6F64', +'PNN': '6FC5', +'OPL': '6FC6', +'MBDN': '6FC7', +'EXT6': '6FC8', +'MBI': '6FC9', +'MWIS': '6FCA', +'CFIS': '6FCB', +'EXT7': '6FCC', +'SPDI': '6FCD', +'MMSN': '6FCE', +'EXT8': '6FCF', +'MMSICP': '6FD0', +'MMSUP': '6FD1', +'MMSUCP': '6FD2', +} + +DF = { +'TELECOM': [MF_num, DF_num['TELECOM']], + +'GSM': [MF_num, DF_num['GSM']], +'IS-41': [MF_num, DF_num['IS-41']], +'FP-CTS': [MF_num, DF_num['FP-CTS']], + +'GRAPHICS': [MF_num, DF_num['GRAPHICS']], + +'IRIDIUM': [MF_num, DF_num['IRIDIUM']], +'GLOBST': [MF_num, DF_num['GLOBST']], +'ICO': [MF_num, DF_num['ICO']], +'ACeS': [MF_num, DF_num['ACeS']], + +'EIA/TIA-553': [MF_num, DF_num['EIA/TIA-553']], +'CTS': [MF_num, DF_num['CTS']], +'SoLSA': [MF_num, DF_num['SOLSA']], + +'MExE': [MF_num, DF_num['MExE']], +} + + +EF = { +'ICCID': [MF_num, EF_num['ICCID']], +'ELP': [MF_num, EF_num['ELP']], + +'ADN': DF['TELECOM']+[EF_num['ADN']], +'FDN': DF['TELECOM']+[EF_num['FDN']], +'SMS': DF['TELECOM']+[EF_num['SMS']], +'CCP': DF['TELECOM']+[EF_num['CCP']], +'MSISDN': DF['TELECOM']+[EF_num['MSISDN']], +'SMSP': DF['TELECOM']+[EF_num['SMSP']], +'SMSS': DF['TELECOM']+[EF_num['SMSS']], +'LND': DF['TELECOM']+[EF_num['LND']], +'SMSR': DF['TELECOM']+[EF_num['SMSR']], +'SDN': DF['TELECOM']+[EF_num['SDN']], +'EXT1': DF['TELECOM']+[EF_num['EXT1']], +'EXT2': DF['TELECOM']+[EF_num['EXT2']], +'EXT3': DF['TELECOM']+[EF_num['EXT3']], +'BDN': DF['TELECOM']+[EF_num['BDN']], +'EXT4': DF['TELECOM']+[EF_num['EXT4']], +'CMI': DF['TELECOM']+[EF_num['CMI']], +'ECCP': DF['TELECOM']+[EF_num['ECCP']], + +'IMG': DF['GRAPHICS']+[EF_num['IMG']], + +'SAI': DF['SoLSA']+[EF_num['SAI']], +'SLL': DF['SoLSA']+[EF_num['SLL']], + +'MExE-ST': DF['MExE']+[EF_num['MExE-ST']], +'ORPK': DF['MExE']+[EF_num['ORPK']], +'ARPK': DF['MExE']+[EF_num['ARPK']], +'TPRPK': DF['MExE']+[EF_num['TPRPK']], + +'LP': DF['GSM']+[EF_num['LP']], +'IMSI': DF['GSM']+[EF_num['IMSI']], +'Kc': DF['GSM']+[EF_num['Kc']], +'DCK': DF['GSM']+[EF_num['DCK']], +'PLMNsel': DF['GSM']+[EF_num['PLMNsel']], +'HPPLMN': DF['GSM']+[EF_num['HPPLMN']], +'CNL': DF['GSM']+[EF_num['CNL']], +'ACMmax': DF['GSM']+[EF_num['ACMmax']], +'SST': DF['GSM']+[EF_num['SST']], +'ACM': DF['GSM']+[EF_num['ACM']], +'GID1': DF['GSM']+[EF_num['GID1']], +'GID2': DF['GSM']+[EF_num['GID2']], +'PUCT': DF['GSM']+[EF_num['PUCT']], +'CBMI': DF['GSM']+[EF_num['CBMI']], +'SPN': DF['GSM']+[EF_num['SPN']], +'CBMID': DF['GSM']+[EF_num['CBMID']], +'BCCH': DF['GSM']+[EF_num['BCCH']], +'ACC': DF['GSM']+[EF_num['ACC']], +'FPLMN': DF['GSM']+[EF_num['FPLMN']], +'LOCI': DF['GSM']+[EF_num['LOCI']], +'AD': DF['GSM']+[EF_num['AD']], +'PHASE': DF['GSM']+[EF_num['PHASE']], +'VGCS': DF['GSM']+[EF_num['VGCS']], +'VGCSS': DF['GSM']+[EF_num['VGCSS']], +'VBS': DF['GSM']+[EF_num['VBS']], +'VBSS': DF['GSM']+[EF_num['VBSS']], +'eMLPP': DF['GSM']+[EF_num['eMLPP']], +'AAeM': DF['GSM']+[EF_num['AAeM']], +'ECC': DF['GSM']+[EF_num['ECC']], +'CBMIR': DF['GSM']+[EF_num['CBMIR']], +'NIA': DF['GSM']+[EF_num['NIA']], +'KcGPRS': DF['GSM']+[EF_num['KcGPRS']], +'LOCIGPRS': DF['GSM']+[EF_num['LOCIGPRS']], +'SUME': DF['GSM']+[EF_num['SUME']], +'PLMNwAcT': DF['GSM']+[EF_num['PLMNwAcT']], +'OPLMNwAcT': DF['GSM']+[EF_num['OPLMNwAcT']], +# Figure 8 names it HPLMNAcT, but in the text it's names it HPLMNwAcT +'HPLMNAcT': DF['GSM']+[EF_num['HPLMNAcT']], +'HPLMNwAcT': DF['GSM']+[EF_num['HPLMNAcT']], +'CPBCCH': DF['GSM']+[EF_num['CPBCCH']], +'INVSCAN': DF['GSM']+[EF_num['INVSCAN']], +'PNN': DF['GSM']+[EF_num['PNN']], +'OPL': DF['GSM']+[EF_num['OPL']], +'MBDN': DF['GSM']+[EF_num['MBDN']], +'EXT6': DF['GSM']+[EF_num['EXT6']], +'MBI': DF['GSM']+[EF_num['MBI']], +'MWIS': DF['GSM']+[EF_num['MWIS']], +'CFIS': DF['GSM']+[EF_num['CFIS']], +'EXT7': DF['GSM']+[EF_num['EXT7']], +'SPDI': DF['GSM']+[EF_num['SPDI']], +'MMSN': DF['GSM']+[EF_num['MMSN']], +'EXT8': DF['GSM']+[EF_num['EXT8']], +'MMSICP': DF['GSM']+[EF_num['MMSICP']], +'MMSUP': DF['GSM']+[EF_num['MMSUP']], +'MMSUCP': DF['GSM']+[EF_num['MMSUCP']], +} -- To view, visit https://gerrit.osmocom.org/5714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:05:14 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:05:14 +0000 Subject: [PATCH] pysim[master]: utils: Functions to encode/decode EF SPN. Message-ID: Review at https://gerrit.osmocom.org/5715 utils: Functions to encode/decode EF SPN. According to TS 51 011. Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334 --- M pySim/utils.py 1 file changed, 19 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/15/5715/1 diff --git a/pySim/utils.py b/pySim/utils.py index 84b613f..8463581 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -34,6 +34,12 @@ def i2h(s): return ''.join(['%02x'%(x) for x in s]) +def h2s(s): + return ''.join([chr((int(x,16)<<4)+int(y,16)) for x,y in zip(s[0::2], s[1::2]) if not (x == 'f' and y == 'f') ]) + +def s2h(s): + return b2h(s) + def swap_nibbles(s): return ''.join([x+y for x,y in zip(s[1::2], s[0::2])]) @@ -73,3 +79,16 @@ def enc_plmn(mcc, mnc): """Converts integer MCC/MNC into 6 bytes for EF""" return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3)) + +def dec_spn(ef): + byte1 = int(ef[0:2]) + hplmn_disp = (byte1&0x01 == 0x01) + oplmn_disp = (byte1&0x02 == 0x02) + name = h2s(ef[2:]) + return (name, hplmn_disp, oplmn_disp) + +def enc_spn(name, hplmn_disp=False, oplmn_disp=False): + byte1 = 0x00 + if hplmn_disp: byte1 = byte1|0x01 + if oplmn_disp: byte1 = byte1|0x02 + return i2h([byte1])+s2h(name) -- To view, visit https://gerrit.osmocom.org/5715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:05:14 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:05:14 +0000 Subject: [PATCH] pysim[master]: utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 Message-ID: Review at https://gerrit.osmocom.org/5716 utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 --- M pySim/utils.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/16/5716/1 diff --git a/pySim/utils.py b/pySim/utils.py index 8463581..43d52dd 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -77,7 +77,7 @@ return swap_nibbles(rpad(iccid, 20)) def enc_plmn(mcc, mnc): - """Converts integer MCC/MNC into 6 bytes for EF""" + """Converts integer MCC/MNC into 3 bytes for EF""" return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3)) def dec_spn(ef): -- To view, visit https://gerrit.osmocom.org/5716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:05:14 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:05:14 +0000 Subject: [PATCH] pysim[master]: Add methods to get ATR for a card or a link. Message-ID: Review at https://gerrit.osmocom.org/5717 Add methods to get ATR for a card or a link. Implemented for both serial and PCSC readers. Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc --- M pySim/commands.py M pySim/transport/pcsc.py M pySim/transport/serial.py 3 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/17/5717/1 diff --git a/pySim/commands.py b/pySim/commands.py index 777dd24..eba915c 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -31,6 +31,9 @@ self._cla_byte = "a0" self.sel_ctrl = "0000" + def get_atr(self): + return self._tp.get_atr() + @property def cla_byte(self): return self._cla_byte diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index dc040c5..47c4185 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -56,6 +56,9 @@ except NoCardException: raise NoCardError() + def get_atr(self): + return self._con.getATR() + def disconnect(self): self._con.disconnect() diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index 825c458..c0b5b54 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -46,6 +46,7 @@ ) self._rst_pin = rst self._debug = debug + self._atr = None def __del__(self): self._sl.close() @@ -90,6 +91,9 @@ def connect(self): self.reset_card() + + def get_atr(self): + return self._atr def disconnect(self): pass # Nothing to do really ... @@ -102,6 +106,7 @@ raise ProtocolError() def _reset_card(self): + self._atr = None rst_meth_map = { 'rts': self._sl.setRTS, 'dtr': self._sl.setDTR, @@ -133,18 +138,24 @@ return -1 t0 = ord(b) self._dbg_print("T0: 0x%x" % t0) + self._atr = [0x3b, ord(b)] for i in range(4): if t0 & (0x10 << i): - self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(self._rx_byte()))) + b = self._rx_byte() + self._atr.apend(ord(b)) + self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(b))) for i in range(0, t0 & 0xf): - self._dbg_print("Historical = %x" % ord(self._rx_byte())) + b = self._rx_byte() + self._atr.apend(ord(b)) + self._dbg_print("Historical = %x" % ord(b)) while True: x = self._rx_byte() if not x: break + self._atr.apend(ord(x)) self._dbg_print("Extra: %x" % ord(x)) return 1 -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:05:14 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:05:14 +0000 Subject: [PATCH] pysim[master]: cards: Extend Card class with access functions for some of t... Message-ID: Review at https://gerrit.osmocom.org/5718 cards: Extend Card class with access functions for some of the standard EF files. Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 --- M pySim/cards.py 1 file changed, 67 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/18/5718/1 diff --git a/pySim/cards.py b/pySim/cards.py index 9f678ab..db63d2b 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -7,6 +7,7 @@ # # Copyright (C) 2009-2010 Sylvain Munaut # Copyright (C) 2011 Harald Welte +# Copyright (C) 2017 Alexander.Chemeris # # 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 @@ -22,17 +23,81 @@ # along with this program. If not, see . # -from pySim.utils import b2h, h2b, swap_nibbles, rpad, lpad, enc_imsi, enc_iccid, enc_plmn - +from pySim.ts_51_011 import EF, DF +from pySim.utils import * class Card(object): def __init__(self, scc): self._scc = scc + self._adm_chv_num = 4 def reset(self): self._scc.reset_card() + def verify_adm(self, key): + ''' + Authenticate with ADM key + ''' + (res, sw) = self._scc.verify_chv(self._adm_chv_num, key) + return sw + + def read_iccid(self): + (res, sw) = self._scc.read_binary(EF['ICCID']) + if sw == '9000': + return (dec_iccid(res), sw) + else: + return (None, sw) + + def read_imsi(self): + (res, sw) = self._scc.read_binary(EF['IMSI']) + if sw == '9000': + return (dec_imsi(res), sw) + else: + return (None, sw) + + def update_imsi(self, imsi): + data, sw = self._scc.update_binary(EF['IMSI'], enc_imsi(imsi)) + return sw + + def update_acc(self, acc): + data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4)) + return sw + + def update_hplmn_act(self, mcc, mnc, access_tech='FFFF'): + """ + Update Home PLMN with access technology bit-field + + See Section "10.3.37 EFHPLMNwAcT (HPLMN Selector with Access Technology)" + in ETSI TS 151 011 for the details of the access_tech field coding. + Some common values: + access_tech = '0080' # Only GSM is selected + access_tech = 'FFFF' # All technologues selected, even Reserved for Future Use ones + """ + # get size and write EF.HPLMNwAcT + r = self._scc.select_file(EF['HPLMNwAcT']) + size = int(r[-1][4:8], 16) + hplmn = enc_plmn(mcc, mnc) + content = hplmn + access_tech + data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1)) + return sw + + def update_smsp(self, smsp): + data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) + return sw + + def read_spn(self): + (spn, sw) = self._scc.read_binary(EF['SPN']) + if sw == '9000': + return (dec_spn(spn), sw) + else: + return (None, sw) + + def update_spn(self, name, hplmn_disp=False, oplmn_disp=False): + content = enc_spn(name, hplmn_disp, oplmn_disp) + data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32)) + return sw + class _MagicSimBase(Card): """ -- To view, visit https://gerrit.osmocom.org/5718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:19:23 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:19:23 +0000 Subject: [PATCH] pysim[master]: pySim-prog: ADM code can be longer 8 digits, it's implementa... Message-ID: Review at https://gerrit.osmocom.org/5719 pySim-prog: ADM code can be longer 8 digits, it's implementation specific. E.g. Fairwaves SIM cards have longer ADM codes. Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b --- M pySim-prog.py 1 file changed, 3 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/19/5719/1 diff --git a/pySim-prog.py b/pySim-prog.py index 728949e..2177d8c 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -379,10 +379,9 @@ opc = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]) if opts.pin_adm is not None: - if len(opts.pin_adm) > 8: - raise ValueError("PIN-ADM needs to be <=8 digits") - pin_adm = ''.join(['%02x'%(ord(x)) for x in opts.pin_adm]) - pin_adm = rpad(pin_adm, 16) + pin_adm = opts.pin_adm + if not re.match('^([0-9a-fA-F][0-9a-fA-F])+$', pin_adm): + raise ValueError('ADM pin needs to be in hex format (even number of hex digits)') else: pin_adm = None -- To view, visit https://gerrit.osmocom.org/5719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:19:24 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:19:24 +0000 Subject: [PATCH] pysim[master]: pySim-prog: Replace magic numbers with a readable EF file name. Message-ID: Review at https://gerrit.osmocom.org/5720 pySim-prog: Replace magic numbers with a readable EF file name. Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af --- M pySim-prog.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/20/5720/1 diff --git a/pySim-prog.py b/pySim-prog.py index 2177d8c..44ca1fd 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -618,7 +618,7 @@ # Connect transport print "Insert card now (or CTRL-C to cancel)" sl.wait_for_card(newcardonly=not first) - (res,_) = scc.read_binary(['3f00', '7f20', '6f07']) + (res,_) = scc.read_binary(EF['IMSI']) imsi = swap_nibbles(res)[3:] else: imsi = opts.imsi -- To view, visit https://gerrit.osmocom.org/5720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:19:24 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:19:24 +0000 Subject: [PATCH] pysim[master]: cards: Implement card type autodetection based on ATR. Message-ID: Review at https://gerrit.osmocom.org/5721 cards: Implement card type autodetection based on ATR. Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 --- M pySim/cards.py 1 file changed, 21 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/21/5721/1 diff --git a/pySim/cards.py b/pySim/cards.py index db63d2b..046766e 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -25,6 +25,7 @@ from pySim.ts_51_011 import EF, DF from pySim.utils import * +from smartcard.util import toBytes class Card(object): @@ -418,7 +419,12 @@ @classmethod def autodetect(kls, scc): - # TODO: look for ATR 3B 7D 94 00 00 55 55 53 0A 74 86 93 0B 24 7C 4D 54 68 + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 7D 94 00 00 55 55 53 0A 74 86 93 0B 24 7C 4D 54 68"): + return kls(scc) + except: + return None return None def program(self, p): @@ -494,7 +500,12 @@ @classmethod def autodetect(kls, scc): - # TODO: look for ATR 3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 43 20 07 18 00 00 01 A5 + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 43 20 07 18 00 00 01 A5"): + return kls(scc) + except: + return None return None def program(self, p): @@ -537,3 +548,11 @@ # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1 ] + +def card_autodetect(scc): + for kls in _cards_classes: + card = kls.autodetect(scc) + if card is not None: + card.reset() + return card + return None -- To view, visit https://gerrit.osmocom.org/5721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 05:19:24 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 05:19:24 +0000 Subject: [PATCH] pysim[master]: cards: Add Fairwaves SIM implementation. Message-ID: Review at https://gerrit.osmocom.org/5722 cards: Add Fairwaves SIM implementation. Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b --- M pySim/cards.py 1 file changed, 145 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/22/5722/1 diff --git a/pySim/cards.py b/pySim/cards.py index 046766e..b1b70be 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -539,15 +539,158 @@ r = self._scc.select_file(['3f00', '7f10']) data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) + def erase(self): + return + + +class FairwavesSIM(Card): + """ + FairwavesSIM + + The SIM card is operating according to the standard. + For Ki/OP/OPC programming the following files are additionally open for writing: + 3F00/7F20/FF01 ? OP/OPC: + byte 1 = 0x01, bytes 2-17: OPC; + byte 1 = 0x00, bytes 2-17: OP; + 3F00/7F20/FF02: Ki + """ + + name = 'Fairwaves SIM' + # Propriatary files + _EF_num = { + 'Ki': 'FF02', + 'OP/OPC': 'FF01', + } + _EF = { + 'Ki': DF['GSM']+[_EF_num['Ki']], + 'OP/OPC': DF['GSM']+[_EF_num['OP/OPC']], + } + + def __init__(self, ssc): + super(FairwavesSIM, self).__init__(ssc) + self._adm_chv_num = 0x11 + self._adm2_chv_num = 0x12 + + + @classmethod + def autodetect(kls, scc): + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 44 22 06 10 00 00 01 A9"): + return kls(scc) + except: + return None + return None + + + def verify_adm2(self, key): + ''' + Authenticate with ADM2 key. + + Fairwaves SIM cards support hierarchical key structure and ADM2 key + is a key which has access to proprietary files (Ki and OP/OPC). + That said, ADM key inherits permissions of ADM2 key and thus we rarely + need ADM2 key per se. + ''' + (res, sw) = self._scc.verify_chv(self._adm2_chv_num, key) + return sw + + + def read_ki(self): + """ + Read Ki in proprietary file. + + Requires ADM1 access level + """ + return self._scc.read_binary(self._EF['Ki']) + + + def update_ki(self, ki): + """ + Set Ki in proprietary file. + + Requires ADM1 access level + """ + data, sw = self._scc.update_binary(self._EF['Ki'], ki) + return sw + + + def read_op_opc(self): + """ + Read Ki in proprietary file. + + Requires ADM1 access level + """ + (ef, sw) = self._scc.read_binary(self._EF['OP/OPC']) + type = 'OP' if ef[0:2] == '00' else 'OPC' + return ((type, ef[2:]), sw) + + + def update_op(self, op): + """ + Set OP in proprietary file. + + Requires ADM1 access level + """ + content = '00' + op + data, sw = self._scc.update_binary(self._EF['OP/OPC'], content) + return sw + + + def update_opc(self, opc): + """ + Set OPC in proprietary file. + + Requires ADM1 access level + """ + content = '01' + opc + data, sw = self._scc.update_binary(self._EF['OP/OPC'], content) + return sw + + + def program(self, p): + # authenticate as ADM1 + if not p['pin_adm']: + raise ValueError("Please provide a PIN-ADM as there is no default one") + sw = self.verify_adm(h2b(p['pin_adm'])) + if sw != '9000': + raise RuntimeError('Failed to authenticate with ADM key %s'%(p['pin_adm'],)) + + # TODO: Set operator name + if p.get('smsp') is not None: + sw = self.update_smsp(p['smsp']) + if sw != '9000': + print("Programming SMSP failed with code %s"%sw) + # This SIM doesn't support changing ICCID + if p.get('mcc') is not None and p.get('mnc') is not None: + sw = self.update_hplmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming MCC/MNC failed with code %s"%sw) + if p.get('imsi') is not None: + sw = self.update_imsi(p['imsi']) + if sw != '9000': + print("Programming IMSI failed with code %s"%sw) + if p.get('ki') is not None: + sw = self.update_ki(p['ki']) + if sw != '9000': + print("Programming Ki failed with code %s"%sw) + if p.get('opc') is not None: + sw = self.update_opc(p['opc']) + if sw != '9000': + print("Programming OPC failed with code %s"%sw) + if p.get('acc') is not None: + sw = self.update_acc(p['acc']) + if sw != '9000': + print("Programming ACC failed with code %s"%sw) def erase(self): return - # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, - SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1 ] + SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1, + FairwavesSIM ] def card_autodetect(scc): for kls in _cards_classes: -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Wed Jan 10 07:59:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 07:59:58 +0000 Subject: pysim[master]: Fix comment: Ki -> OPC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:01:25 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:01:25 +0000 Subject: pysim[master]: ts_51_011: A file with MF/DF/EF constants from TS 51 011 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:02:27 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:02:27 +0000 Subject: pysim[master]: utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:03:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:03:35 +0000 Subject: pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5717/1/pySim/transport/serial.py File pySim/transport/serial.py: Line 94: Whitespace... -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:04:32 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:04:32 +0000 Subject: pysim[master]: cards: Extend Card class with access functions for some of t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:05:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:05:21 +0000 Subject: pysim[master]: pySim-prog: ADM code can be longer 8 digits, it's implementa... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:07:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:07:10 +0000 Subject: pysim[master]: pySim-prog: Replace magic numbers with a readable EF file name. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:07:59 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:07:59 +0000 Subject: pysim[master]: cards: Implement card type autodetection based on ATR. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:09:00 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:09:00 +0000 Subject: pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5722/1/pySim/cards.py File pySim/cards.py: Line 589: Whitespace... -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:12:47 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 08:12:47 +0000 Subject: [PATCH] pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Add methods to get ATR for a card or a link. Implemented for both serial and PCSC readers. Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc --- M pySim/commands.py M pySim/transport/pcsc.py M pySim/transport/serial.py 3 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/17/5717/2 diff --git a/pySim/commands.py b/pySim/commands.py index 777dd24..eba915c 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -31,6 +31,9 @@ self._cla_byte = "a0" self.sel_ctrl = "0000" + def get_atr(self): + return self._tp.get_atr() + @property def cla_byte(self): return self._cla_byte diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index dc040c5..47c4185 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -56,6 +56,9 @@ except NoCardException: raise NoCardError() + def get_atr(self): + return self._con.getATR() + def disconnect(self): self._con.disconnect() diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index 825c458..5b15b2f 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -46,6 +46,7 @@ ) self._rst_pin = rst self._debug = debug + self._atr = None def __del__(self): self._sl.close() @@ -91,6 +92,9 @@ def connect(self): self.reset_card() + def get_atr(self): + return self._atr + def disconnect(self): pass # Nothing to do really ... @@ -102,6 +106,7 @@ raise ProtocolError() def _reset_card(self): + self._atr = None rst_meth_map = { 'rts': self._sl.setRTS, 'dtr': self._sl.setDTR, @@ -133,18 +138,24 @@ return -1 t0 = ord(b) self._dbg_print("T0: 0x%x" % t0) + self._atr = [0x3b, ord(b)] for i in range(4): if t0 & (0x10 << i): - self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(self._rx_byte()))) + b = self._rx_byte() + self._atr.apend(ord(b)) + self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(b))) for i in range(0, t0 & 0xf): - self._dbg_print("Historical = %x" % ord(self._rx_byte())) + b = self._rx_byte() + self._atr.apend(ord(b)) + self._dbg_print("Historical = %x" % ord(b)) while True: x = self._rx_byte() if not x: break + self._atr.apend(ord(x)) self._dbg_print("Extra: %x" % ord(x)) return 1 -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:13:54 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 08:13:54 +0000 Subject: pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5717/1/pySim/transport/serial.py File pySim/transport/serial.py: Line 94: > Whitespace... Thanks, fixed. -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:18:41 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 08:18:41 +0000 Subject: [PATCH] pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: cards: Add Fairwaves SIM implementation. Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b --- M pySim/cards.py 1 file changed, 145 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/22/5722/3 diff --git a/pySim/cards.py b/pySim/cards.py index 046766e..e324857 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -539,15 +539,158 @@ r = self._scc.select_file(['3f00', '7f10']) data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) + def erase(self): + return + + +class FairwavesSIM(Card): + """ + FairwavesSIM + + The SIM card is operating according to the standard. + For Ki/OP/OPC programming the following files are additionally open for writing: + 3F00/7F20/FF01 ? OP/OPC: + byte 1 = 0x01, bytes 2-17: OPC; + byte 1 = 0x00, bytes 2-17: OP; + 3F00/7F20/FF02: Ki + """ + + name = 'Fairwaves SIM' + # Propriatary files + _EF_num = { + 'Ki': 'FF02', + 'OP/OPC': 'FF01', + } + _EF = { + 'Ki': DF['GSM']+[_EF_num['Ki']], + 'OP/OPC': DF['GSM']+[_EF_num['OP/OPC']], + } + + def __init__(self, ssc): + super(FairwavesSIM, self).__init__(ssc) + self._adm_chv_num = 0x11 + self._adm2_chv_num = 0x12 + + + @classmethod + def autodetect(kls, scc): + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 44 22 06 10 00 00 01 A9"): + return kls(scc) + except: + return None + return None + + + def verify_adm2(self, key): + ''' + Authenticate with ADM2 key. + + Fairwaves SIM cards support hierarchical key structure and ADM2 key + is a key which has access to proprietary files (Ki and OP/OPC). + That said, ADM key inherits permissions of ADM2 key and thus we rarely + need ADM2 key per se. + ''' + (res, sw) = self._scc.verify_chv(self._adm2_chv_num, key) + return sw + + + def read_ki(self): + """ + Read Ki in proprietary file. + + Requires ADM1 access level + """ + return self._scc.read_binary(self._EF['Ki']) + + + def update_ki(self, ki): + """ + Set Ki in proprietary file. + + Requires ADM1 access level + """ + data, sw = self._scc.update_binary(self._EF['Ki'], ki) + return sw + + + def read_op_opc(self): + """ + Read Ki in proprietary file. + + Requires ADM1 access level + """ + (ef, sw) = self._scc.read_binary(self._EF['OP/OPC']) + type = 'OP' if ef[0:2] == '00' else 'OPC' + return ((type, ef[2:]), sw) + + + def update_op(self, op): + """ + Set OP in proprietary file. + + Requires ADM1 access level + """ + content = '00' + op + data, sw = self._scc.update_binary(self._EF['OP/OPC'], content) + return sw + + + def update_opc(self, opc): + """ + Set OPC in proprietary file. + + Requires ADM1 access level + """ + content = '01' + opc + data, sw = self._scc.update_binary(self._EF['OP/OPC'], content) + return sw + + + def program(self, p): + # authenticate as ADM1 + if not p['pin_adm']: + raise ValueError("Please provide a PIN-ADM as there is no default one") + sw = self.verify_adm(h2b(p['pin_adm'])) + if sw != '9000': + raise RuntimeError('Failed to authenticate with ADM key %s'%(p['pin_adm'],)) + + # TODO: Set operator name + if p.get('smsp') is not None: + sw = self.update_smsp(p['smsp']) + if sw != '9000': + print("Programming SMSP failed with code %s"%sw) + # This SIM doesn't support changing ICCID + if p.get('mcc') is not None and p.get('mnc') is not None: + sw = self.update_hplmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming MCC/MNC failed with code %s"%sw) + if p.get('imsi') is not None: + sw = self.update_imsi(p['imsi']) + if sw != '9000': + print("Programming IMSI failed with code %s"%sw) + if p.get('ki') is not None: + sw = self.update_ki(p['ki']) + if sw != '9000': + print("Programming Ki failed with code %s"%sw) + if p.get('opc') is not None: + sw = self.update_opc(p['opc']) + if sw != '9000': + print("Programming OPC failed with code %s"%sw) + if p.get('acc') is not None: + sw = self.update_acc(p['acc']) + if sw != '9000': + print("Programming ACC failed with code %s"%sw) def erase(self): return - # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, - SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1 ] + SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1, + FairwavesSIM ] def card_autodetect(scc): for kls in _cards_classes: -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 3 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:19:05 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:19:05 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/5706/1/AUTHORS File AUTHORS: Line 3: # Great thing, but unrelated ;) separate change (5700)? https://gerrit.osmocom.org/#/c/5706/1/CommonLibs/Makefile.am File CommonLibs/Makefile.am: Line 41: # ReportingTest Should we keep this? Line 54: MOSTLYCLEANFILES += testSource testDestination Both files are related to SocketsTest.cpp. I think this also should be migrated... -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:19:11 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 10 Jan 2018 08:19:11 +0000 Subject: pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5722/1/pySim/cards.py File pySim/cards.py: Line 589: > Whitespace... Fixed -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:22:59 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:22:59 +0000 Subject: osmo-trx[master]: tests: InterThread: adapt to have reproducible output and en... In-Reply-To: References: Message-ID: Patch Set 1: Should tests/CommonLibs/InterthreadTest.ok be empty? May we remove one? -- To view, visit https://gerrit.osmocom.org/5707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Wed Jan 10 08:33:20 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:33:20 +0000 Subject: osmo-trx[master]: Sockets.cpp: Fix initialization of UDD socket In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Wed Jan 10 08:34:37 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:34:37 +0000 Subject: pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 3 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 08:34:54 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 08:34:54 +0000 Subject: pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 09:35:30 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 09:35:30 +0000 Subject: osmo-trx[master]: tests: Timeval: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Patch Set 1: This is odd - if test output is always empty, how can we be sure that the test was executed at all? I think it's better to log at least what kind of test is executing. Even better would be to log smth in case of error instead of using assert: if we hit assert than we don't know what happens with the test code beyond assert point. If we log error and continue, we might see several errors at once and the test would still fail due to output difference. Although it might be matter of personal preference. -- To view, visit https://gerrit.osmocom.org/5708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Wed Jan 10 09:43:27 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 09:43:27 +0000 Subject: libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 In-Reply-To: References: Message-ID: Patch Set 1: Would be nice to have more detailed spec reference - which chapter/paragraph exactly states that? Also, 160 * 8 / 7 is around 182.86 - you sure we shouldn't use 183 chars? -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e 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 Wed Jan 10 09:46:58 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 09:46:58 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 3: > the old version of the library will no longer work Which osmo-* are actually using it? Do we have patches for them too? Would be nice to reference them in commit message or to clarify why it's unnecessary. This would help to unsure that we won't break build of some other project when merging this. -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:04:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:04:30 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/5706/1/AUTHORS File AUTHORS: Line 3: # > Great thing, but unrelated ;) separate change (5700)? It slipped in unintentionally, I'll move it to a new path. https://gerrit.osmocom.org/#/c/5706/1/CommonLibs/Makefile.am File CommonLibs/Makefile.am: Line 41: # ReportingTest > Should we keep this? Indeed, it can be removed. Line 54: MOSTLYCLEANFILES += testSource testDestination > Both files are related to SocketsTest.cpp. Ah now I see those are the names of the unix socket created by SocketsTest.cpp, thanks for pointing it out. -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:09:03 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 10:09:03 +0000 Subject: [PATCH] osmo-ci[master]: Install setuptools in docker images Message-ID: Review at https://gerrit.osmocom.org/5723 Install setuptools in docker images Make sure that python-setuptools are installed for both python v2 and v3 to make sure osmo-python-tests can be installed. Change-Id: I3ecd96af2e2c0c7d141977639103d71e46c0cdc5 Related: OS#2821 --- M docker/Dockerfile.deb8_amd64 M docker/Dockerfile.deb8_i386 M docker/Dockerfile_osmocom_jenkins.amd64 3 files changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/23/5723/1 diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 9b6a939..3fdcd6a 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -31,5 +31,8 @@ # building RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +# for osmo-python-tests +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools + # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile.deb8_i386 b/docker/Dockerfile.deb8_i386 index 51962f6..9beb188 100644 --- a/docker/Dockerfile.deb8_i386 +++ b/docker/Dockerfile.deb8_i386 @@ -31,5 +31,8 @@ # OsmocomBB RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi +# for osmo-python-tests +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools + # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 10c49c3..063199b 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -31,6 +31,9 @@ # building RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +# for osmo-python-tests +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools + # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc -- To view, visit https://gerrit.osmocom.org/5723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ecd96af2e2c0c7d141977639103d71e46c0cdc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:10:35 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:10:35 +0000 Subject: [MERGED] osmo-trx[master]: Remove Configuration module and libsqlite dependency In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Remove Configuration module and libsqlite dependency ...................................................................... Remove Configuration module and libsqlite dependency Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa --- M AUTHORS D CommonLibs/Configuration.cpp D CommonLibs/Configuration.h D CommonLibs/ConfigurationTest.cpp M CommonLibs/Makefile.am D CommonLibs/sqlite3util.cpp D CommonLibs/sqlite3util.h M Makefile.am M Transceiver52M/Makefile.am M configure.ac M debian/control M debian/copyright 12 files changed, 8 insertions(+), 1,951 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/AUTHORS b/AUTHORS index 65532aa..a956de5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -24,9 +24,6 @@ CommonLibs/Assert.h CommonLibs/BitVector.cpp CommonLibs/BitVectorTest.cpp - CommonLibs/Configuration.cpp - CommonLibs/Configuration.h - CommonLibs/ConfigurationTest.cpp CommonLibs/Interthread.h CommonLibs/InterthreadTest.cpp CommonLibs/LinkedLists.cpp diff --git a/CommonLibs/Configuration.cpp b/CommonLibs/Configuration.cpp deleted file mode 100644 index 4661903..0000000 --- a/CommonLibs/Configuration.cpp +++ /dev/null @@ -1,1160 +0,0 @@ -/* -* Copyright 2008, 2009, 2010 Free Software Foundation, Inc. -* Copyright 2010 Kestrel Signal Processing, Inc. -* Copyright 2011, 2012 Range Networks, Inc. -* -* -* This software is distributed under the terms of the GNU Affero Public License. -* See the COPYING file in the main directory for details. -* -* This use of this software may be subject to additional restrictions. -* See the LEGAL file in the main directory for details. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -*/ - - -#include "Configuration.h" -#include "Logger.h" -#include -#include -#include - -#ifdef DEBUG_CONFIG -#define debugLogEarly gLogEarly -#else -#define debugLogEarly(x,y,z) -#endif - - -using namespace std; - -char gCmdName[20] = {0}; // Use a char* to avoid avoid static initialization of string, and race at startup. - -static const char* createConfigTable = { - "CREATE TABLE IF NOT EXISTS CONFIG (" - "KEYSTRING TEXT UNIQUE NOT NULL, " - "VALUESTRING TEXT, " - "STATIC INTEGER DEFAULT 0, " - "OPTIONAL INTEGER DEFAULT 0, " - "COMMENTS TEXT DEFAULT ''" - ")" -}; - -static std::string replaceAll(const std::string input, const std::string search, const std::string replace) -{ - std::string output = input; - size_t index = 0; - - while (true) { - index = output.find(search, index); - if (index == std::string::npos) { - break; - } - - output.replace(index, replace.length(), replace); - index += replace.length(); - } - - return output; -} - - -float ConfigurationRecord::floatNumber() const -{ - float val; - sscanf(mValue.c_str(),"%f",&val); - return val; -} - - -ConfigurationTable::ConfigurationTable(const char* filename, const char *wCmdName, ConfigurationKeyMap wSchema) -{ - gLogEarly(LOG_INFO, "opening configuration table from path %s", filename); - // Connect to the database. - int rc = sqlite3_open(filename,&mDB); - // (pat) When I used malloc here, sqlite3 sporadically crashes. - if (wCmdName) { - strncpy(gCmdName,wCmdName,18); - gCmdName[18] = 0; - strcat(gCmdName,":"); - } - if (rc) { - gLogEarly(LOG_EMERG, "cannot open configuration database at %s, error message: %s", filename, sqlite3_errmsg(mDB)); - sqlite3_close(mDB); - mDB = NULL; - return; - } - // Create the table, if needed. - if (!sqlite3_command(mDB,createConfigTable)) { - gLogEarly(LOG_EMERG, "cannot create configuration table in database at %s, error message: %s", filename, sqlite3_errmsg(mDB)); - } - - // Build CommonLibs schema - ConfigurationKey *tmp; - tmp = new ConfigurationKey("Log.File","", - "", - ConfigurationKey::DEVELOPER, - ConfigurationKey::FILEPATH_OPT,// audited - "", - false, - "Path to use for textfile based logging. " - "By default, this feature is disabled. " - "To enable, specify an absolute path to the file you wish to use, eg: /tmp/my-debug.log. " - "To disable again, execute \"unconfig Log.File\"." - ); - mSchema[tmp->getName()] = *tmp; - delete tmp; - - tmp = new ConfigurationKey("Log.Level","NOTICE", - "", - ConfigurationKey::CUSTOMER, - ConfigurationKey::CHOICE, - "EMERG|EMERGENCY - report serious faults associated with service failure or hardware damage," - "ALERT|ALERT - report likely service disruption caused by misconfiguration or poor connectivity," - "CRIT|CRITICAL - report anomalous events that are likely to degrade service," - "ERR|ERROR - report internal errors of the software that may result in degradation of service in unusual circumstances," - "WARNING|WARNING - report anomalous events that may indicate a degradation of normal service," - "NOTICE|NOTICE - report anomalous events that probably do not affect service but may be of interest to network operators," - "INFO|INFORMATION - report normal events," - "DEBUG|DEBUG - only for use by developers and will degrade system performance", - false, - "Default logging level when no other level is defined for a file." - ); - mSchema[tmp->getName()] = *tmp; - delete tmp; - - // Add application specific schema - mSchema.insert(wSchema.begin(), wSchema.end()); - - // Init the cross checking callback to something predictable - mCrossCheck = NULL; -} - -string ConfigurationTable::getDefaultSQL(const std::string& program, const std::string& version) -{ - stringstream ss; - ConfigurationKeyMap::iterator mp; - - ss << "--" << endl; - ss << "-- This file was generated using: " << program << " --gensql" << endl; - ss << "-- binary version: " << version << endl; - ss << "--" << endl; - ss << "-- Future changes should not be put in this file directly but" << endl; - ss << "-- rather in the program's ConfigurationKey schema." << endl; - ss << "--" << endl; - ss << "PRAGMA foreign_keys=OFF;" << endl; - ss << "BEGIN TRANSACTION;" << endl; - ss << "CREATE TABLE CONFIG ( KEYSTRING TEXT UNIQUE NOT NULL, VALUESTRING TEXT, STATIC INTEGER DEFAULT 0, OPTIONAL INTEGER DEFAULT 0, COMMENTS TEXT DEFAULT '');" << endl; - - mp = mSchema.begin(); - while (mp != mSchema.end()) { - ss << "INSERT INTO \"CONFIG\" VALUES("; - // name - ss << "'" << mp->first << "',"; - // default - ss << "'" << mp->second.getDefaultValue() << "',"; - // static - if (mp->second.isStatic()) { - ss << "1"; - } else { - ss << "0"; - } - ss << ","; - // optional - ss << "0,"; - // description - ss << "'"; - if (mp->second.getType() == ConfigurationKey::BOOLEAN) { - ss << "1=enabled, 0=disabled - "; - } - ss << mp->second.getDescription(); - if (mp->second.isStatic()) { - ss << " Static."; - } - ss << "'"; - ss << ");" << endl; - mp++; - } - - ss << "COMMIT;" << endl; - ss << endl; - - return ss.str(); -} - -string ConfigurationTable::getTeX(const std::string& program, const std::string& version) -{ - stringstream ss; - ConfigurationKeyMap::iterator mp; - - ss << "% START AUTO-GENERATED CONTENT" << endl; - ss << "% -- these sections were generated using: " << program << " --gentex" << endl; - ss << "% -- binary version: " << version << endl; - - ss << "\\subsection{Customer Site Parameters}" << endl; - ss << "These parameters must be changed to fit your site." << endl; - ss << "\\begin{itemize}" << endl; - mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->second.getVisibility() == ConfigurationKey::CUSTOMERSITE) { - ss << " \\item "; - // name - ss << mp->first << " -- "; - // description - ss << mp->second.getDescription(); - ss << endl; - } - mp++; - } - ss << "\\end{itemize}" << endl; - ss << endl; - - ss << "\\subsection{Customer Tuneable Parameters}" << endl; - ss << "These parameters can be changed to optimize your site." << endl; - ss << "\\begin{itemize}" << endl; - mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->second.getVisibility() != ConfigurationKey::CUSTOMERSITE && - ( - mp->second.getVisibility() == ConfigurationKey::CUSTOMER || - mp->second.getVisibility() == ConfigurationKey::CUSTOMERTUNE || - mp->second.getVisibility() == ConfigurationKey::CUSTOMERWARN - )) { - ss << " \\item "; - // name - ss << mp->first << " -- "; - // description - ss << mp->second.getDescription(); - ss << endl; - } - mp++; - } - ss << "\\end{itemize}" << endl; - ss << endl; - - ss << "\\subsection{Developer/Factory Parameters}" << endl; - ss << "These parameters should only be changed by when developing new code." << endl; - ss << "\\begin{itemize}" << endl; - mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->second.getVisibility() == ConfigurationKey::FACTORY || - mp->second.getVisibility() == ConfigurationKey::DEVELOPER) { - ss << " \\item "; - // name - ss << mp->first << " -- "; - // description - ss << mp->second.getDescription(); - ss << endl; - } - mp++; - } - ss << "\\end{itemize}" << endl; - ss << "% END AUTO-GENERATED CONTENT" << endl; - ss << endl; - - string tmp = replaceAll(ss.str(), "^", "\\^"); - return replaceAll(tmp, "_", "\\_"); -} - -bool ConfigurationTable::defines(const string& key) -{ - try { - ScopedLock lock(mLock); - return lookup(key).defined(); - } catch (ConfigurationTableKeyNotFound) { - debugLogEarly(LOG_ALERT, "configuration parameter %s not found", key.c_str()); - return false; - } -} - -bool ConfigurationTable::keyDefinedInSchema(const std::string& name) -{ - return mSchema.find(name) == mSchema.end() ? false : true; -} - -bool ConfigurationTable::isValidValue(const std::string& name, const std::string& val) { - bool ret = false; - - ConfigurationKey key = mSchema[name]; - - switch (key.getType()) { - case ConfigurationKey::BOOLEAN: { - if (val == "1" || val == "0") { - ret = true; - } - break; - } - - case ConfigurationKey::CHOICE_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::CHOICE: { - int startPos = -1; - uint endPos = 0; - - std::string tmp = key.getValidValues(); - - do { - startPos++; - if ((endPos = tmp.find('|', startPos)) != std::string::npos) { - if (val == tmp.substr(startPos, endPos-startPos)) { - ret = true; - break; - } - } else { - if (val == tmp.substr(startPos, tmp.find(',', startPos)-startPos)) { - ret = true; - break; - } - } - - } while ((startPos = tmp.find(',', startPos)) != (int)std::string::npos); - break; - } - - case ConfigurationKey::CIDR_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::CIDR: { - uint delimiter; - std::string ip; - int cidr = -1; - - delimiter = val.find('/'); - if (delimiter != std::string::npos) { - ip = val.substr(0, delimiter); - std::stringstream(val.substr(delimiter+1)) >> cidr; - if (ConfigurationKey::isValidIP(ip) && 0 <= cidr && cidr <= 32) { - ret = true; - } - } - break; - } - - case ConfigurationKey::FILEPATH_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::FILEPATH: { - regex_t r; - const char* expression = "^[a-zA-Z0-9/_.-]+$"; - int result = regcomp(&r, expression, REG_EXTENDED); - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - break;//abort(); - } - if (regexec(&r, val.c_str(), 0, NULL, 0)==0) { - ret = true; - } - regfree(&r); - break; - } - - case ConfigurationKey::IPADDRESS_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::IPADDRESS: { - ret = ConfigurationKey::isValidIP(val); - break; - } - - case ConfigurationKey::IPANDPORT: { - uint delimiter; - std::string ip; - int port = -1; - - delimiter = val.find(':'); - if (delimiter != std::string::npos) { - ip = val.substr(0, delimiter); - std::stringstream(val.substr(delimiter+1)) >> port; - if (ConfigurationKey::isValidIP(ip) && 1 <= port && port <= 65535) { - ret = true; - } - } - break; - } - - case ConfigurationKey::MIPADDRESS_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::MIPADDRESS: { - int startPos = -1; - uint endPos = 0; - - do { - startPos++; - endPos = val.find(' ', startPos); - if (ConfigurationKey::isValidIP(val.substr(startPos, endPos-startPos))) { - ret = true; - } else { - ret = false; - break; - } - - } while ((startPos = endPos) != (int)std::string::npos); - break; - } - - case ConfigurationKey::PORT_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::PORT: { - int intVal; - - std::stringstream(val) >> intVal; - - if (1 <= intVal && intVal <= 65535) { - ret = true; - } - break; - } - - case ConfigurationKey::REGEX_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::REGEX: { - regex_t r; - const char* expression = val.c_str(); - int result = regcomp(&r, expression, REG_EXTENDED); - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - } else { - ret = true; - } - regfree(&r); - break; - } - - case ConfigurationKey::STRING_OPT: { - if (val.length() == 0) { - ret = true; - break; - } - } - case ConfigurationKey::STRING: { - regex_t r; - const char* expression = key.getValidValues().c_str(); - int result = regcomp(&r, expression, REG_EXTENDED); - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - break;//abort(); - } - if (regexec(&r, val.c_str(), 0, NULL, 0)==0) { - ret = true; - } - regfree(&r); - break; - } - - case ConfigurationKey::VALRANGE: { - regex_t r; - int result; - if (key.getValidValues().find('.') != std::string::npos) { - result = regcomp(&r, "^[0-9.-]+$", REG_EXTENDED); - } else { - result = regcomp(&r, "^[0-9-]+$", REG_EXTENDED); - } - if (result) { - char msg[256]; - regerror(result,&r,msg,255); - break;//abort(); - } - if (regexec(&r, val.c_str(), 0, NULL, 0)!=0) { - ret = false; - } else if (key.getValidValues().find('.') != std::string::npos) { - ret = ConfigurationKey::isInValRange(key, val, false); - } else { - ret = ConfigurationKey::isInValRange(key, val, true); - } - - regfree(&r); - break; - } - } - - return ret; -} - -ConfigurationKeyMap ConfigurationTable::getSimilarKeys(const std::string& snippet) { - ConfigurationKeyMap tmp; - - ConfigurationKeyMap::const_iterator mp = mSchema.begin(); - while (mp != mSchema.end()) { - if (mp->first.find(snippet) != std::string::npos) { - tmp[mp->first] = mp->second; - } - mp++; - } - - return tmp; -} - -const ConfigurationRecord& ConfigurationTable::lookup(const string& key) -{ - assert(mDB); - checkCacheAge(); - // We assume the caller holds mLock. - // So it is OK to return a reference into the cache. - - // Check the cache. - // This is cheap. - ConfigurationMap::const_iterator where = mCache.find(key); - if (where!=mCache.end()) { - if (where->second.defined()) return where->second; - throw ConfigurationTableKeyNotFound(key); - } - - // Check the database. - // This is more expensive. - char *value = NULL; - sqlite3_single_lookup(mDB,"CONFIG", - "KEYSTRING",key.c_str(),"VALUESTRING",value); - - // value found, cache the result - if (value) { - mCache[key] = ConfigurationRecord(value); - // key definition found, cache the default - } else if (keyDefinedInSchema(key)) { - mCache[key] = ConfigurationRecord(mSchema[key].getDefaultValue()); - // total miss, cache the error - } else { - mCache[key] = ConfigurationRecord(false); - throw ConfigurationTableKeyNotFound(key); - } - - free(value); - - // Leave mLock locked. The caller holds it still. - return mCache[key]; -} - - - -bool ConfigurationTable::isStatic(const string& key) -{ - if (keyDefinedInSchema(key)) { - return mSchema[key].isStatic(); - } else { - return false; - } -} - - - - -string ConfigurationTable::getStr(const string& key) -{ - // We need the lock because rec is a reference into the cache. - try { - ScopedLock lock(mLock); - return lookup(key).value(); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - - -bool ConfigurationTable::getBool(const string& key) -{ - try { - return getNum(key) != 0; - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - - -long ConfigurationTable::getNum(const string& key) -{ - // We need the lock because rec is a reference into the cache. - try { - ScopedLock lock(mLock); - return lookup(key).number(); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - - -float ConfigurationTable::getFloat(const string& key) -{ - try { - ScopedLock lock(mLock); - return lookup(key).floatNumber(); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } -} - -std::vector ConfigurationTable::getVectorOfStrings(const string& key) -{ - // Look up the string. - char *line=NULL; - try { - ScopedLock lock(mLock); - const ConfigurationRecord& rec = lookup(key); - line = strdup(rec.value().c_str()); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } - - assert(line); - char *lp = line; - - // Parse the string. - std::vector retVal; - while (lp) { - while (*lp==' ') lp++; - if (*lp == '\0') break; - char *tp = strsep(&lp," "); - if (!tp) break; - retVal.push_back(tp); - } - free(line); - return retVal; -} - - -std::vector ConfigurationTable::getVector(const string& key) -{ - // Look up the string. - char *line=NULL; - try { - ScopedLock lock(mLock); - const ConfigurationRecord& rec = lookup(key); - line = strdup(rec.value().c_str()); - } catch (ConfigurationTableKeyNotFound) { - // Raise an alert and re-throw the exception. - debugLogEarly(LOG_ALERT, "configuration parameter %s has no defined value", key.c_str()); - throw ConfigurationTableKeyNotFound(key); - } - - assert(line); - char *lp = line; - - // Parse the string. - std::vector retVal; - while (lp) { - // Watch for multiple or trailing spaces. - while (*lp==' ') lp++; - if (*lp=='\0') break; - retVal.push_back(strtol(lp,NULL,0)); - strsep(&lp," "); - } - free(line); - return retVal; -} - - -bool ConfigurationTable::remove(const string& key) -{ - assert(mDB); - - ScopedLock lock(mLock); - // Clear the cache entry and the database. - ConfigurationMap::iterator where = mCache.find(key); - if (where!=mCache.end()) mCache.erase(where); - // Really remove it. - string cmd = "DELETE FROM CONFIG WHERE KEYSTRING=='"+key+"'"; - return sqlite3_command(mDB,cmd.c_str()); -} - - - -void ConfigurationTable::find(const string& pat, ostream& os) const -{ - // Prepare the statement. - string cmd = "SELECT KEYSTRING,VALUESTRING FROM CONFIG WHERE KEYSTRING LIKE \"%" + pat + "%\""; - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(mDB,&stmt,cmd.c_str())) return; - // Read the result. - int src = sqlite3_run_query(mDB,stmt); - while (src==SQLITE_ROW) { - const char* value = (const char*)sqlite3_column_text(stmt,1); - os << sqlite3_column_text(stmt,0) << " "; - int len = 0; - if (value) { - len = strlen(value); - } - if (len && value) os << value << endl; - else os << "(disabled)" << endl; - src = sqlite3_run_query(mDB,stmt); - } - sqlite3_finalize(stmt); -} - - -ConfigurationRecordMap ConfigurationTable::getAllPairs() const -{ - ConfigurationRecordMap tmp; - - // Prepare the statement. - string cmd = "SELECT KEYSTRING,VALUESTRING FROM CONFIG"; - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(mDB,&stmt,cmd.c_str())) return tmp; - // Read the result. - int src = sqlite3_run_query(mDB,stmt); - while (src==SQLITE_ROW) { - const char* key = (const char*)sqlite3_column_text(stmt,0); - const char* value = (const char*)sqlite3_column_text(stmt,1); - if (key && value) { - tmp[string(key)] = ConfigurationRecord(value); - } else if (key && !value) { - tmp[string(key)] = ConfigurationRecord(false); - } - src = sqlite3_run_query(mDB,stmt); - } - sqlite3_finalize(stmt); - - return tmp; -} - -bool ConfigurationTable::set(const string& key, const string& value) -{ - assert(mDB); - ScopedLock lock(mLock); - string cmd = "INSERT OR REPLACE INTO CONFIG (KEYSTRING,VALUESTRING,OPTIONAL) VALUES (\"" + key + "\",\"" + value + "\",1)"; - bool success = sqlite3_command(mDB,cmd.c_str()); - // Cache the result. - if (success) mCache[key] = ConfigurationRecord(value); - return success; -} - -bool ConfigurationTable::set(const string& key, long value) -{ - char buffer[30]; - sprintf(buffer,"%ld",value); - return set(key,buffer); -} - - -bool ConfigurationTable::set(const string& key) -{ - assert(mDB); - ScopedLock lock(mLock); - string cmd = "INSERT OR REPLACE INTO CONFIG (KEYSTRING,VALUESTRING,OPTIONAL) VALUES (\"" + key + "\",NULL,1)"; - bool success = sqlite3_command(mDB,cmd.c_str()); - if (success) mCache[key] = ConfigurationRecord(true); - return success; -} - - -void ConfigurationTable::checkCacheAge() -{ - // mLock is set by caller - static time_t timeOfLastPurge = 0; - time_t now = time(NULL); - // purge every 3 seconds - // purge period cannot be configuration parameter - if (now - timeOfLastPurge < 3) return; - timeOfLastPurge = now; - // this is purge() without the lock - ConfigurationMap::iterator mp = mCache.begin(); - while (mp != mCache.end()) { - ConfigurationMap::iterator prev = mp; - mp++; - mCache.erase(prev); - } -} - - -void ConfigurationTable::purge() -{ - ScopedLock lock(mLock); - ConfigurationMap::iterator mp = mCache.begin(); - while (mp != mCache.end()) { - ConfigurationMap::iterator prev = mp; - mp++; - mCache.erase(prev); - } -} - - -void ConfigurationTable::setUpdateHook(void(*func)(void *,int ,char const *,char const *,sqlite3_int64)) -{ - assert(mDB); - sqlite3_update_hook(mDB,func,NULL); -} - - -void ConfigurationTable::setCrossCheckHook(vector (*wCrossCheck)(const string&)) -{ - mCrossCheck = wCrossCheck; -} - - -vector ConfigurationTable::crossCheck(const string& key) { - vector ret; - - if (mCrossCheck != NULL) { - ret = mCrossCheck(key); - } - - return ret; -} - -void HashString::computeHash() -{ - // FIXME -- Someone needs to review this hash function. - const char* cstr = c_str(); - mHash = 0; - for (unsigned i=0; i> 32); - mHash = mHash*127 + cstr[i]; - } -} - - -void SimpleKeyValue::addItem(const char* pair_orig) -{ - char *pair = strdup(pair_orig); - char *key = pair; - char *mark = strchr(pair,'='); - if (!mark) return; - *mark = '\0'; - char *value = mark+1; - mMap[key] = value; - free(pair); -} - - - -const char* SimpleKeyValue::get(const char* key) const -{ - HashStringMap::const_iterator p = mMap.find(key); - if (p==mMap.end()) return NULL; - return p->second.c_str(); -} - - -void SimpleKeyValue::addItems(const char* pairs_orig) -{ - char *pairs = strdup(pairs_orig); - char *thisPair; - while ((thisPair=strsep(&pairs," "))!=NULL) { - addItem(thisPair); - } - free(pairs); -} - - -bool ConfigurationKey::isValidIP(const std::string& ip) { - struct sockaddr_in sa; - return inet_pton(AF_INET, ip.c_str(), &(sa.sin_addr)) != 0; -} - - -void ConfigurationKey::getMinMaxStepping(const ConfigurationKey &key, std::string &min, std::string &max, std::string &stepping) { - uint delimiter; - int startPos; - uint endPos; - - std::string tmp = key.getValidValues(); - stepping = "1"; - - // grab steps if they're defined - startPos = tmp.find('('); - if (startPos != (int)std::string::npos) { - endPos = tmp.find(')'); - stepping = tmp.substr(startPos+1, endPos-startPos-1); - tmp = tmp.substr(0, startPos); - } - startPos = 0; - - delimiter = tmp.find(':', startPos); - min = tmp.substr(startPos, delimiter-startPos); - max = tmp.substr(delimiter+1, tmp.find(',', delimiter)-delimiter-1); -} - - -template bool ConfigurationKey::isInValRange(const ConfigurationKey &key, const std::string& val, const bool isInteger) { - bool ret = false; - - T convVal; - T min; - T max; - T steps; - std::string strMin; - std::string strMax; - std::string strSteps; - - std::stringstream(val) >> convVal; - - ConfigurationKey::getMinMaxStepping(key, strMin, strMax, strSteps); - std::stringstream(strMin) >> min; - std::stringstream(strMax) >> max; - std::stringstream(strSteps) >> steps; - - // TODO : only ranges checked, steps not enforced - if (isInteger) { - if (val.find('.') == std::string::npos && min <= convVal && convVal <= max) { - ret = true; - } - } else { - if (min <= convVal && convVal <= max) { - ret = true; - } - } - - return ret; -} - -const std::string ConfigurationKey::getARFCNsString() { - stringstream ss; - int i; - float downlink; - float uplink; - - // 128:251 GSM850 - downlink = 869.2; - uplink = 824.2; - for (i = 128; i <= 251; i++) { - ss << i << "|GSM850 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - // 1:124 PGSM900 - downlink = 935.2; - uplink = 890.2; - for (i = 1; i <= 124; i++) { - ss << i << "|PGSM900 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - // 512:885 DCS1800 - downlink = 1805.2; - uplink = 1710.2; - for (i = 512; i <= 885; i++) { - ss << i << "|DCS1800 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - // 512:810 PCS1900 - downlink = 1930.2; - uplink = 1850.2; - for (i = 512; i <= 810; i++) { - ss << i << "|PCS1900 #" << i << " : " << downlink << " MHz downlink / " << uplink << " MHz uplink,"; - downlink += 0.2; - uplink += 0.2; - } - - ss << endl; - - return ss.str(); -} - -const std::string ConfigurationKey::visibilityLevelToString(const ConfigurationKey::VisibilityLevel& visibility) { - std::string ret = "UNKNOWN ERROR"; - - switch (visibility) { - case ConfigurationKey::CUSTOMER: - ret = "customer - can be freely changed by the customer without any detriment to their system"; - break; - case ConfigurationKey::CUSTOMERSITE: - ret = "customer site - these values are different for each BTS and should not be left default"; - break; - case ConfigurationKey::CUSTOMERTUNE: - ret = "customer tune - should only be changed to tune an installation to better suit the physical environment or MS usage pattern"; - break; - case ConfigurationKey::CUSTOMERWARN: - ret = "customer warn - a warning will be presented and confirmation required before changing this sensitive setting"; - break; - case ConfigurationKey::DEVELOPER: - ret = "developer - should only be changed by developers to debug/optimize the implementation"; - break; - case ConfigurationKey::FACTORY: - ret = "factory - set once at the factory, should never be changed"; - break; - } - - return ret; -} - -const std::string ConfigurationKey::typeToString(const ConfigurationKey::Type& type) { - std::string ret = "UNKNOWN ERROR"; - - switch (type) { - case BOOLEAN: - ret = "boolean"; - break; - case CHOICE_OPT: - ret = "multiple choice (optional)"; - break; - case CHOICE: - ret = "multiple choice"; - break; - case CIDR_OPT: - ret = "CIDR notation (optional)"; - break; - case CIDR: - ret = "CIDR notation"; - break; - case FILEPATH_OPT: - ret = "file path (optional)"; - break; - case FILEPATH: - ret = "file path"; - break; - case IPADDRESS_OPT: - ret = "IP address (optional)"; - break; - case IPADDRESS: - ret = "IP address"; - break; - case IPANDPORT: - ret = "IP address and port"; - break; - case MIPADDRESS_OPT: - ret = "space-separated list of IP addresses (optional)"; - break; - case MIPADDRESS: - ret = "space-separated list of IP addresses"; - break; - case PORT_OPT: - ret = "IP port (optional)"; - break; - case PORT: - ret = "IP port"; - break; - case REGEX_OPT: - ret = "regular expression (optional)"; - break; - case REGEX: - ret = "regular expression"; - break; - case STRING_OPT: - ret = "string (optional)"; - break; - case STRING: - ret = "string"; - break; - case VALRANGE: - ret = "value range"; - break; - } - - return ret; -} - -void ConfigurationKey::printKey(const ConfigurationKey &key, const std::string& currentValue, ostream& os) { - os << key.getName() << " "; - if (!currentValue.length()) { - os << "(disabled)"; - } else { - os << currentValue; - } - if (currentValue.compare(key.getDefaultValue()) == 0) { - os << " [default]"; - } - os << endl; -} - -void ConfigurationKey::printDescription(const ConfigurationKey &key, ostream& os) { - std::string tmp; - - os << " - description: " << key.getDescription() << std::endl; - if (key.getUnits().length()) { - os << " - units: " << key.getUnits() << std::endl; - } - os << " - type: " << ConfigurationKey::typeToString(key.getType()) << std::endl; - if (key.getDefaultValue().length()) { - os << " - default value: " << key.getDefaultValue() << std::endl; - } - os << " - visibility level: " << ConfigurationKey::visibilityLevelToString(key.getVisibility()) << std::endl; - os << " - static: " << key.isStatic() << std::endl; - - tmp = key.getValidValues(); - if (key.getType() == ConfigurationKey::VALRANGE) { - int startPos = tmp.find('('); - uint delimiter = 0; - if (startPos != (int)std::string::npos) { - tmp = tmp.substr(0, startPos); - } - startPos = -1; - - do { - startPos++; - delimiter = tmp.find(':', startPos); - os << " - valid values: " << "from " << tmp.substr(startPos, delimiter-startPos) << " to " - << tmp.substr(delimiter+1, tmp.find(',', delimiter)-delimiter-1) << std::endl; - - } while ((startPos = tmp.find(',', startPos)) != (int)std::string::npos); - - } else if (key.getType() == ConfigurationKey::CHOICE) { - int startPos = -1; - uint endPos = 0; - - do { - startPos++; - if ((endPos = tmp.find('|', startPos)) != std::string::npos) { - os << " - valid values: " << tmp.substr(startPos, endPos-startPos); - os << " = " << tmp.substr(endPos+1, tmp.find(',', endPos)-endPos-1) << std::endl; - } else { - os << " - valid values: " << tmp.substr(startPos, tmp.find(',', startPos)-startPos) << std::endl; - } - - } while ((startPos = tmp.find(',', startPos)) != (int)std::string::npos); - - } else if (key.getType() == ConfigurationKey::BOOLEAN) { - os << " - valid values: 0 = disabled" << std::endl; - os << " - valid values: 1 = enabled" << std::endl; - - } else if (key.getType() == ConfigurationKey::STRING) { - os << " - valid val regex: " << tmp << std::endl; - - } else if (key.getValidValues().length()) { - os << " - raw valid values: " << tmp << std::endl; - } -} - - -// vim: ts=4 sw=4 diff --git a/CommonLibs/Configuration.h b/CommonLibs/Configuration.h deleted file mode 100644 index cd4838e..0000000 --- a/CommonLibs/Configuration.h +++ /dev/null @@ -1,422 +0,0 @@ -/* -* Copyright 2009, 2010 Free Software Foundation, Inc. -* Copyright 2010 Kestrel Signal Processing, Inc. -* Copyright 2011, 2012 Range Networks, Inc. -* -* This software is distributed under the terms of the GNU Affero Public License. -* See the COPYING file in the main directory for details. -* -* This use of this software may be subject to additional restrictions. -* See the LEGAL file in the main directory for details. - - 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 . - -*/ - - -#ifndef CONFIGURATION_H -#define CONFIGURATION_H - - -#include "sqlite3util.h" - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include -#include - - -/** A class for configuration file errors. */ -class ConfigurationTableError {}; -extern char gCmdName[]; // Gotta be global, gotta be char*, gotta love it. - -/** An exception thrown when a given config key isn't found. */ -class ConfigurationTableKeyNotFound : public ConfigurationTableError { - - private: - - std::string mKey; - - public: - - ConfigurationTableKeyNotFound(const std::string& wKey) - :mKey(wKey) - { } - - const std::string& key() const { return mKey; } - -}; - - -class ConfigurationRecord { - - private: - - std::string mValue; - long mNumber; - bool mDefined; - - public: - - ConfigurationRecord(bool wDefined=true): - mDefined(wDefined) - { } - - ConfigurationRecord(const std::string& wValue): - mValue(wValue), - mNumber(strtol(wValue.c_str(),NULL,0)), - mDefined(true) - { } - - ConfigurationRecord(const char* wValue): - mValue(std::string(wValue)), - mNumber(strtol(wValue,NULL,0)), - mDefined(true) - { } - - - const std::string& value() const { return mValue; } - long number() const { return mNumber; } - bool defined() const { return mDefined; } - - float floatNumber() const; - -}; - - -/** A string class that uses a hash function for comparison. */ -class HashString : public std::string { - - - protected: - - uint64_t mHash; - - void computeHash(); - - - public: - - HashString(const char* src) - :std::string(src) - { - computeHash(); - } - - HashString(const std::string& src) - :std::string(src) - { - computeHash(); - } - - HashString() - { - mHash=0; - } - - HashString& operator=(std::string& src) - { - std::string::operator=(src); - computeHash(); - return *this; - } - - HashString& operator=(const char* src) - { - std::string::operator=(src); - computeHash(); - return *this; - } - - bool operator==(const HashString& other) - { - return mHash==other.mHash; - } - - bool operator<(const HashString& other) - { - return mHash(const HashString& other) - { - return mHash ConfigurationRecordMap; -typedef std::map ConfigurationMap; -class ConfigurationKey; -typedef std::map ConfigurationKeyMap; - -/** - A class for maintaining a configuration key-value table, - based on sqlite3 and a local map-based cache. - Thread-safe, too. -*/ -class ConfigurationTable { - - private: - - sqlite3* mDB; ///< database connection - ConfigurationMap mCache; ///< cache of recently access configuration values - mutable Mutex mLock; ///< control for multithreaded access to the cache - std::vector (*mCrossCheck)(const std::string&); ///< cross check callback pointer - - public: - - ConfigurationKeyMap mSchema;///< definition of configuration default values and validation logic - - ConfigurationTable(const char* filename = ":memory:", const char *wCmdName = 0, ConfigurationKeyMap wSchema = ConfigurationKeyMap()); - - /** Generate an up-to-date example sql file for new installs. */ - std::string getDefaultSQL(const std::string& program, const std::string& version); - - /** Generate an up-to-date TeX snippet. */ - std::string getTeX(const std::string& program, const std::string& version); - - /** Return true if the key is used in the table. */ - bool defines(const std::string& key); - - /** Return true if the application's schema knows about this key. */ - bool keyDefinedInSchema(const std::string& name); - - /** Return true if the provided value validates correctly against the defined schema. */ - bool isValidValue(const std::string& name, const std::string& val); - - /** Return true if the provided value validates correctly against the defined schema. */ - bool isValidValue(const std::string& name, const int val) { std::stringstream ss; ss << val; return isValidValue(name, ss.str()); } - - /** Return a map of all similar keys in the defined schema. */ - ConfigurationKeyMap getSimilarKeys(const std::string& snippet); - - /** Return true if this key is identified as static. */ - bool isStatic(const std::string& key); - - /** - Get a string parameter from the table. - Throw ConfigurationTableKeyNotFound if not found. - */ - std::string getStr(const std::string& key); - - - /** - Get a boolean from the table. - Return false if NULL or 0, true otherwise. - */ - bool getBool(const std::string& key); - - /** - Get a numeric parameter from the table. - Throw ConfigurationTableKeyNotFound if not found. - */ - long getNum(const std::string& key); - - /** - Get a vector of strings from the table. - */ - std::vector getVectorOfStrings(const std::string& key); - - /** - Get a float from the table. - Throw ConfigurationTableKeyNotFound if not found. - */ - float getFloat(const std::string& key); - - /** - Get a numeric vector from the table. - */ - std::vector getVector(const std::string& key); - - /** Get length of a vector */ - unsigned getVectorLength(const std::string &key) - { return getVector(key).size(); } - - /** Set or change a value in the table. */ - bool set(const std::string& key, const std::string& value); - - /** Set or change a value in the table. */ - bool set(const std::string& key, long value); - - /** Create an entry in the table, no value though. */ - bool set(const std::string& key); - - /** - Remove an entry from the table. - Will not alter required values. - @param key The key of the item to be removed. - @return true if anything was actually removed. - */ - bool remove(const std::string& key); - - /** Search the table, dumping to a stream. */ - void find(const std::string& pattern, std::ostream&) const; - - /** Return all key/value pairs stored in the ConfigurationTable */ - ConfigurationRecordMap getAllPairs() const; - - /** Define the callback to purge the cache whenever the database changes. */ - void setUpdateHook(void(*)(void *,int ,char const *,char const *,sqlite3_int64)); - - /** Define the callback for cross checking. */ - void setCrossCheckHook(std::vector (*wCrossCheck)(const std::string&)); - - /** Execute the application specific value cross checking logic. */ - std::vector crossCheck(const std::string& key); - - /** purege cache if it exceeds a certain age */ - void checkCacheAge(); - - /** Delete all records from the cache. */ - void purge(); - - - private: - - /** - Attempt to lookup a record, cache if needed. - Throw ConfigurationTableKeyNotFound if not found. - Caller should hold mLock because the returned reference points into the cache. - */ - const ConfigurationRecord& lookup(const std::string& key); - -}; - - -typedef std::map HashStringMap; - -class SimpleKeyValue { - - protected: - - HashStringMap mMap; - - public: - - /** Take a C string "A=B" and set map["A"]="B". */ - void addItem(const char*); - - /** Take a C string "A=B C=D E=F ..." and add all of the pairs to the map. */ - void addItems(const char*s); - - /** Return a reference to the string at map["key"]. */ - const char* get(const char*) const; -}; - - -class ConfigurationKey { - - public: - - enum VisibilityLevel - { - CUSTOMER, - CUSTOMERSITE, - CUSTOMERTUNE, - CUSTOMERWARN, - DEVELOPER, - FACTORY - }; - - enum Type - { - BOOLEAN, - CHOICE_OPT, - CHOICE, - CIDR_OPT, - CIDR, - FILEPATH_OPT, - FILEPATH, - IPADDRESS_OPT, - IPADDRESS, - IPANDPORT, - MIPADDRESS_OPT, - MIPADDRESS, - PORT_OPT, - PORT, - REGEX_OPT, - REGEX, - STRING_OPT, - STRING, - VALRANGE - }; - - private: - - std::string mName; - std::string mDefaultValue; - std::string mUnits; - VisibilityLevel mVisibility; - Type mType; - std::string mValidValues; - bool mIsStatic; - std::string mDescription; - - - public: - - ConfigurationKey(const std::string& wName, const std::string& wDefaultValue, const std::string& wUnits, const VisibilityLevel wVisibility, const Type wType, const std::string& wValidValues, bool wIsStatic, const std::string& wDescription): - mName(wName), - mDefaultValue(wDefaultValue), - mUnits(wUnits), - mVisibility(wVisibility), - mType(wType), - mValidValues(wValidValues), - mIsStatic(wIsStatic), - mDescription(wDescription) - { } - - ConfigurationKey() - { } - - const std::string& getName() const { return mName; } - const std::string& getDefaultValue() const { return mDefaultValue; } - void updateDefaultValue(const std::string& newValue) { mDefaultValue = newValue; } - void updateDefaultValue(const int newValue) { std::stringstream ss; ss << newValue; updateDefaultValue(ss.str()); } - const std::string& getUnits() const { return mUnits; } - const VisibilityLevel& getVisibility() const { return mVisibility; } - const Type& getType() const { return mType; } - const std::string& getValidValues() const { return mValidValues; } - bool isStatic() const { return mIsStatic; } - const std::string& getDescription() const { return mDescription; } - - static bool isValidIP(const std::string& ip); - static void getMinMaxStepping(const ConfigurationKey &key, std::string &min, std::string &max, std::string &stepping); - template static bool isInValRange(const ConfigurationKey &key, const std::string& val, const bool isInteger); - static const std::string visibilityLevelToString(const VisibilityLevel& visibility); - static const std::string typeToString(const ConfigurationKey::Type& type); - static void printKey(const ConfigurationKey &key, const std::string& currentValue, std::ostream& os); - static void printDescription(const ConfigurationKey &key, std::ostream& os); - static const std::string getARFCNsString(); -}; - - -#endif - - -// vim: ts=4 sw=4 diff --git a/CommonLibs/ConfigurationTest.cpp b/CommonLibs/ConfigurationTest.cpp deleted file mode 100644 index 7042228..0000000 --- a/CommonLibs/ConfigurationTest.cpp +++ /dev/null @@ -1,149 +0,0 @@ -/* -* Copyright 2009, 2010 Free Software Foundation, Inc. -* Copyright 2010 Kestrel Signal Processing, Inc. -* -* -* This software is distributed under the terms of the GNU Affero Public License. -* See the COPYING file in the main directory for details. -* -* This use of this software may be subject to additional restrictions. -* See the LEGAL file in the main directory for details. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . - -*/ - - - -#include "Configuration.h" -#include -#include - -using namespace std; - -ConfigurationKeyMap getConfigurationKeys(); -ConfigurationTable gConfig("exampleconfig.db","test", getConfigurationKeys()); - -void purgeConfig(void*,int,char const*, char const*, sqlite3_int64) -{ - //cout << "update hook" << endl; - gConfig.purge(); -} - - -int main(int argc, char *argv[]) -{ - - gConfig.setUpdateHook(purgeConfig); - - const char *keys[5] = {"key1", "key2", "key3", "key4", "key5"}; - - for (int i=0; i<5; i++) { - gConfig.set(keys[i],i); - } - - for (int i=0; i<5; i++) { - cout << "table[" << keys[i] << "]=" << gConfig.getStr(keys[i]) << endl; - cout << "table[" << keys[i] << "]=" << gConfig.getNum(keys[i]) << endl; - } - - for (int i=0; i<5; i++) { - cout << "defined table[" << keys[i] << "]=" << gConfig.defines(keys[i]) << endl; - } - - gConfig.set("key5","100 200 300 400 "); - std::vector vect = gConfig.getVector("key5"); - cout << "vect length " << vect.size() << ": "; - for (unsigned i=0; i svect = gConfig.getVectorOfStrings("key5"); - cout << "vect length " << svect.size() << ": "; - for (unsigned i=0; igetName()] = *tmp; - free(tmp); - - tmp = new ConfigurationKey("numnumber","42", - "", - ConfigurationKey::DEVELOPER, - ConfigurationKey::VALRANGE, - "0-100", - false, - "" - ); - map[tmp->getName()] = *tmp; - free(tmp); - - tmp = new ConfigurationKey("newstring","new string value", - "", - ConfigurationKey::DEVELOPER, - ConfigurationKey::STRING, - "", - false, - "" - ); - map[tmp->getName()] = *tmp; - free(tmp); - - return map; -} diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index ed188d5..d42e82a 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -36,9 +36,7 @@ Sockets.cpp \ Threads.cpp \ Timeval.cpp \ - Logger.cpp \ - Configuration.cpp \ - sqlite3util.cpp + Logger.cpp noinst_PROGRAMS = \ BitVectorTest \ @@ -47,7 +45,6 @@ SocketsTest \ TimevalTest \ VectorTest \ - ConfigurationTest \ LogTest # ReportingTest @@ -61,12 +58,10 @@ Threads.h \ Timeval.h \ Vector.h \ - Configuration.h \ - Logger.h \ - sqlite3util.h + Logger.h BitVectorTest_SOURCES = BitVectorTest.cpp -BitVectorTest_LDADD = libcommon.la $(SQLITE3_LIBS) +BitVectorTest_LDADD = libcommon.la PRBSTest_SOURCES = PRBSTest.cpp @@ -82,15 +77,12 @@ TimevalTest_LDADD = libcommon.la VectorTest_SOURCES = VectorTest.cpp -VectorTest_LDADD = libcommon.la $(SQLITE3_LIBS) - -ConfigurationTest_SOURCES = ConfigurationTest.cpp -ConfigurationTest_LDADD = libcommon.la $(SQLITE3_LIBS) +VectorTest_LDADD = libcommon.la # ReportingTest_SOURCES = ReportingTest.cpp -# ReportingTest_LDADD = libcommon.la $(SQLITE_LA) +# ReportingTest_LDADD = libcommon.la LogTest_SOURCES = LogTest.cpp -LogTest_LDADD = libcommon.la $(SQLITE3_LIBS) +LogTest_LDADD = libcommon.la MOSTLYCLEANFILES += testSource testDestination diff --git a/CommonLibs/sqlite3util.cpp b/CommonLibs/sqlite3util.cpp deleted file mode 100644 index 2b19ee6..0000000 --- a/CommonLibs/sqlite3util.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* -* Copyright 2010 Kestrel Signal Processing, Inc. -* All rights reserved. -*/ - - -#include -#include "sqlite3util.h" - -#include -#include -#include - - -// Wrappers to sqlite operations. -// These will eventually get moved to commonlibs. - -int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query) -{ - int src = SQLITE_BUSY; - while (src==SQLITE_BUSY) { - src = sqlite3_prepare_v2(DB,query,strlen(query),stmt,NULL); - if (src==SQLITE_BUSY) { - usleep(100000); - } - } - if (src) { - fprintf(stderr,"sqlite3_prepare_v2 failed for \"%s\": %s\n",query,sqlite3_errmsg(DB)); - sqlite3_finalize(*stmt); - } - return src; -} - -int sqlite3_run_query(sqlite3* DB, sqlite3_stmt *stmt) -{ - int src = SQLITE_BUSY; - while (src==SQLITE_BUSY) { - src = sqlite3_step(stmt); - if (src==SQLITE_BUSY) { - usleep(100000); - } - } - if ((src!=SQLITE_DONE) && (src!=SQLITE_ROW)) { - fprintf(stderr,"sqlite3_run_query failed: %s: %s\n", sqlite3_sql(stmt), sqlite3_errmsg(DB)); - } - return src; -} - - -bool sqlite3_exists(sqlite3* DB, const char *tableName, - const char* keyName, const char* keyData) -{ - size_t stringSize = 100 + strlen(tableName) + strlen(keyName) + strlen(keyData); - char query[stringSize]; - sprintf(query,"SELECT * FROM %s WHERE %s == \"%s\"",tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - sqlite3_finalize(stmt); - // Anything there? - return (src == SQLITE_ROW); -} - - - -bool sqlite3_single_lookup(sqlite3* DB, const char *tableName, - const char* keyName, const char* keyData, - const char* valueName, unsigned &valueData) -{ - size_t stringSize = 100 + strlen(valueName) + strlen(tableName) + strlen(keyName) + strlen(keyData); - char query[stringSize]; - sprintf(query,"SELECT %s FROM %s WHERE %s == \"%s\"",valueName,tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - bool retVal = false; - if (src == SQLITE_ROW) { - valueData = (unsigned)sqlite3_column_int64(stmt,0); - retVal = true; - } - sqlite3_finalize(stmt); - return retVal; -} - - -// This function returns an allocated string that must be free'd by the caller. -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, const char* keyData, - const char* valueName, char* &valueData) -{ - valueData=NULL; - size_t stringSize = 100 + strlen(valueName) + strlen(tableName) + strlen(keyName) + strlen(keyData); - char query[stringSize]; - sprintf(query,"SELECT %s FROM %s WHERE %s == \"%s\"",valueName,tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - bool retVal = false; - if (src == SQLITE_ROW) { - const char* ptr = (const char*)sqlite3_column_text(stmt,0); - if (ptr) valueData = strdup(ptr); - retVal = true; - } - sqlite3_finalize(stmt); - return retVal; -} - - -// This function returns an allocated string that must be free'd by tha caller. -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, unsigned keyData, - const char* valueName, char* &valueData) -{ - valueData=NULL; - size_t stringSize = 100 + strlen(valueName) + strlen(tableName) + strlen(keyName) + 20; - char query[stringSize]; - sprintf(query,"SELECT %s FROM %s WHERE %s == %u",valueName,tableName,keyName,keyData); - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Read the result. - int src = sqlite3_run_query(DB,stmt); - bool retVal = false; - if (src == SQLITE_ROW) { - const char* ptr = (const char*)sqlite3_column_text(stmt,0); - if (ptr) valueData = strdup(ptr); - retVal = true; - } - sqlite3_finalize(stmt); - return retVal; -} - - - - -bool sqlite3_command(sqlite3* DB, const char* query) -{ - // Prepare the statement. - sqlite3_stmt *stmt; - if (sqlite3_prepare_statement(DB,&stmt,query)) return false; - // Run the query. - int src = sqlite3_run_query(DB,stmt); - sqlite3_finalize(stmt); - return src==SQLITE_DONE; -} - - - diff --git a/CommonLibs/sqlite3util.h b/CommonLibs/sqlite3util.h deleted file mode 100644 index f2b3aa7..0000000 --- a/CommonLibs/sqlite3util.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef SQLITE3UTIL_H -#define SQLITE3UTIL_H - -#include - -int sqlite3_prepare_statement(sqlite3* DB, sqlite3_stmt **stmt, const char* query); - -int sqlite3_run_query(sqlite3* DB, sqlite3_stmt *stmt); - -bool sqlite3_single_lookup(sqlite3* DB, const char *tableName, - const char* keyName, const char* keyData, - const char* valueName, unsigned &valueData); - -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, const char* keyData, - const char* valueName, char* &valueData); - -// This function returns an allocated string that must be free'd by the caller. -bool sqlite3_single_lookup(sqlite3* DB, const char* tableName, - const char* keyName, unsigned keyData, - const char* valueName, char* &valueData); - -bool sqlite3_exists(sqlite3* DB, const char* tableName, - const char* keyName, const char* keyData); - -/** Run a query, ignoring the result; return true on success. */ -bool sqlite3_command(sqlite3* DB, const char* query); - -#endif diff --git a/Makefile.am b/Makefile.am index da08bf3..658eae4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -21,7 +21,7 @@ include $(top_srcdir)/Makefile.common ACLOCAL_AMFLAGS = -I config -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) $(SQLITE3_CFLAGS) +AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) AM_CXXFLAGS = -Wall -pthread -ldl #AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread -ldl #AM_CFLAGS = -Wall -O2 -NDEBUG -pthread -ldl diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 20d0bd6..dc6e597 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -97,7 +97,7 @@ libtransceiver.la \ $(ARCH_LA) \ $(GSM_LA) \ - $(COMMON_LA) $(SQLITE3_LIBS) + $(COMMON_LA) if USRP1 libtransceiver_la_SOURCES += USRPDevice.cpp diff --git a/configure.ac b/configure.ac index 01bec91..1a9712a 100644 --- a/configure.ac +++ b/configure.ac @@ -158,10 +158,7 @@ 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"]) -AC_CHECK_LIB(sqlite3, sqlite3_open, , AC_MSG_ERROR(sqlite3 is not available)) - PKG_CHECK_MODULES(LIBUSB, libusb-1.0) -PKG_CHECK_MODULES(SQLITE3, sqlite3) AC_CHECK_HEADER([boost/config.hpp],[], [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) diff --git a/debian/control b/debian/control index b9ed72a..c8a639e 100644 --- a/debian/control +++ b/debian/control @@ -5,7 +5,6 @@ Build-Depends: debhelper (>= 9), autotools-dev, autoconf-archive, - libsqlite3-dev, pkg-config, dh-autoreconf, libuhd-dev, diff --git a/debian/copyright b/debian/copyright index 45d0e6d..b7790f2 100644 --- a/debian/copyright +++ b/debian/copyright @@ -52,20 +52,6 @@ the U.S. Army Research Laboratory. License: BSD-3-clause -Files: CommonLibs/sqlite3util.cpp -Copyright: 2010 Kestrel Signal Processing Inc. -License: none - No license described for file. -Comment: In the previous version of the file in the git repository - at upstream it is written: - Written by David A. Burgess, Kestrel Signal Processing, Inc., 2010 - The author disclaims copyright to this source code. - In the git log, this is written: - I do not claim any copyright over this change, as it's very basic. - Looking forward to see it merged into mainline. - See revision e766abbf82f02473038a83fd2f78befd08544cab at - https://github.com/osmocom/osmo-trx - Files: debian/* Copyright: 2015 Ruben Undheim License: GPL-3+ -- To view, visit https://gerrit.osmocom.org/5704 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I823aea91367d586507bbf352f1b6f25bdd635baa Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:10:35 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:10:35 +0000 Subject: [MERGED] osmo-trx[master]: Drop use of ConfigurationTable gConfig In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Drop use of ConfigurationTable gConfig ...................................................................... Drop use of ConfigurationTable gConfig After latest changes, it is not being used anymore. Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de --- M CommonLibs/LogTest.cpp M CommonLibs/Logger.cpp M Transceiver52M/osmo-trx.cpp 3 files changed, 0 insertions(+), 12 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/CommonLibs/LogTest.cpp b/CommonLibs/LogTest.cpp index 882707d..2245386 100644 --- a/CommonLibs/LogTest.cpp +++ b/CommonLibs/LogTest.cpp @@ -28,10 +28,6 @@ #include #include "Logger.h" -#include "Configuration.h" - -ConfigurationTable gConfig; -//ConfigurationTable gConfig("example.config"); void printAlarms() { diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index 1c462e7..5b8da99 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -32,7 +32,6 @@ #include #include // For gettimeofday -#include "Configuration.h" #include "Logger.h" #include "Threads.h" // pat added @@ -41,15 +40,11 @@ using namespace std; // Switches to enable/disable logging targets -// MUST BE DEFINED BEFORE gConfig FOR gLogEarly() TO WORK CORRECTLY bool gLogToConsole = true; bool gLogToSyslog = false; FILE *gLogToFile = NULL; Mutex gLogToLock; - -// Reference to a global config table, used all over the system. -extern ConfigurationTable gConfig; // Global log level threshold: int config_log_level; diff --git a/Transceiver52M/osmo-trx.cpp b/Transceiver52M/osmo-trx.cpp index 3f72fb7..44da638 100644 --- a/Transceiver52M/osmo-trx.cpp +++ b/Transceiver52M/osmo-trx.cpp @@ -31,7 +31,6 @@ #include #include -#include extern "C" { #include "convolve.h" @@ -81,8 +80,6 @@ bool edge; int sched_rr; }; - -ConfigurationTable gConfig; volatile bool gshutdown = false; -- To view, visit https://gerrit.osmocom.org/5703 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43a49aee94e3239194ad9742fb6374324acac0de Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:10:36 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:10:36 +0000 Subject: [MERGED] osmo-trx[master]: Logger: Stop using Log.File and Log.Level from config In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Logger: Stop using Log.File and Log.Level from config ...................................................................... Logger: Stop using Log.File and Log.Level from config This is a required step towards getting rid of ConfigurationTable class and libsqlite dependency. As a side effect, support for different log levels for different files is dropped, but it's not something really being used and we will end up dropping current logging system in favour of osmocom's one in the future anyway. Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51 --- M CommonLibs/Logger.cpp M CommonLibs/Logger.h 2 files changed, 17 insertions(+), 93 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/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index d246584..1c462e7 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -50,7 +50,8 @@ // Reference to a global config table, used all over the system. extern ConfigurationTable gConfig; - +// Global log level threshold: +int config_log_level; /**@ The global alarms table. */ //@{ @@ -97,22 +98,6 @@ return -1; } -/** Given a string, return the corresponding level name. */ -int lookupLevel(const string& key) -{ - string val = gConfig.getStr(key); - int level = levelStringToInt(val); - - if (level == -1) { - string defaultLevel = gConfig.mSchema["Log.Level"].getDefaultValue(); - level = levelStringToInt(defaultLevel); - _LOG(CRIT) << "undefined logging level (" << key << " = \"" << val << "\") defaulting to \"" << defaultLevel << ".\" Valid levels are: EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO or DEBUG"; - gConfig.set(key, defaultLevel); - } - - return level; -} - static std::string format(const char *fmt, ...) { va_list ap; @@ -138,62 +123,6 @@ { return os << ss.str(); } - -int getLoggingLevel(const char* filename) -{ - // Default level? - if (!filename) return lookupLevel("Log.Level"); - - // This can afford to be inefficient since it is not called that often. - const string keyName = string("Log.Level.") + string(filename); - if (gConfig.defines(keyName)) return lookupLevel(keyName); - return lookupLevel("Log.Level"); -} - - - -int gGetLoggingLevel(const char* filename) -{ - // This is called a lot and needs to be efficient. - - static Mutex sLogCacheLock; - static map sLogCache; - static unsigned sCacheCount; - static const unsigned sCacheRefreshCount = 1000; - - if (filename==NULL) return gGetLoggingLevel(""); - - HashString hs(filename); - uint64_t key = hs.hash(); - - sLogCacheLock.lock(); - // Time for a cache flush? - if (sCacheCount>sCacheRefreshCount) { - sLogCache.clear(); - sCacheCount=0; - } - // Is it cached already? - map::const_iterator where = sLogCache.find(key); - sCacheCount++; - if (where!=sLogCache.end()) { - int retVal = where->second; - sLogCacheLock.unlock(); - return retVal; - } - // Look it up in the config table and cache it. - // FIXME: Figure out why unlock and lock below fix the config table deadlock. - // (pat) Probably because getLoggingLevel may call LOG recursively via lookupLevel(). - sLogCacheLock.unlock(); - int level = getLoggingLevel(filename); - sLogCacheLock.lock(); - sLogCache.insert(pair(key,level)); - sLogCacheLock.unlock(); - return level; -} - - - - // copies the alarm list and returns it. list supposed to be small. list gGetLoggerAlarms() @@ -268,26 +197,21 @@ -void gLogInit(const char* name, const char* level, int facility) +void gLogInit(const char* name, const char* level, int facility, char* fn) { // Set the level if one has been specified. - if (level) { - gConfig.set("Log.Level",level); - } + if (level) + config_log_level = levelStringToInt(level); // Both the transceiver and OpenBTS use this same facility, but only OpenBTS/OpenNodeB may use this log file: - string str = gConfig.getStr("Log.File"); - if (gLogToFile==NULL && str.length() && 0==strncmp(gCmdName,"Open",4)) { - const char *fn = str.c_str(); - if (fn && *fn && strlen(fn)>3) { // strlen because a garbage char is getting in sometimes. - gLogToFile = fopen(fn,"w"); // New log file each time we start. - if (gLogToFile) { - time_t now; - time(&now); - fprintf(gLogToFile,"Starting at %s",ctime(&now)); - fflush(gLogToFile); - std::cout << "Logging to file: " << fn << "\n"; - } + if (!gLogToFile && fn) { + gLogToFile = fopen(fn,"w"); // New log file each time we start. + if (gLogToFile) { + time_t now; + time(&now); + fprintf(gLogToFile,"Starting at %s",ctime(&now)); + fflush(gLogToFile); + std::cout << "Logging to file: " << fn << "\n"; } } diff --git a/CommonLibs/Logger.h b/CommonLibs/Logger.h index 68c5a9b..099d300 100644 --- a/CommonLibs/Logger.h +++ b/CommonLibs/Logger.h @@ -40,11 +40,13 @@ #include #include +extern int config_log_level; + #define _LOG(level) \ Log(LOG_##level).get() << pthread_self() \ << timestr() << " " __FILE__ ":" << __LINE__ << ":" << __FUNCTION__ << ": " -#define IS_LOG_LEVEL(wLevel) (gGetLoggingLevel(__FILE__)>=LOG_##wLevel) +#define IS_LOG_LEVEL(wLevel) (config_log_level>=LOG_##wLevel) #ifdef NDEBUG #define LOG(wLevel) \ @@ -128,9 +130,7 @@ /**@ Global control and initialization of the logging system. */ //@{ /** Initialize the global logging system. */ -void gLogInit(const char* name, const char* level=NULL, int facility=LOG_USER); -/** Get the logging level associated with a given file. */ -int gGetLoggingLevel(const char *filename=NULL); +void gLogInit(const char* name, const char* level=NULL, int facility=LOG_USER, char* fn=NULL); /** Allow early logging when still in constructors */ void gLogEarly(int level, const char *fmt, ...) __attribute__((format(printf, 2, 3))); //@} -- To view, visit https://gerrit.osmocom.org/5702 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I51cb12d1ab7e103e78190ac71a70fb5bb1d9ff51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:10:36 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:10:36 +0000 Subject: [MERGED] osmo-trx[master]: Logger: Stop using Log.Alarms.Max from config In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Logger: Stop using Log.Alarms.Max from config ...................................................................... Logger: Stop using Log.Alarms.Max from config This is a first step towards removing ConfigurationTable class and sqlite3 dependency. Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a --- M CommonLibs/Configuration.cpp M CommonLibs/Logger.cpp 2 files changed, 2 insertions(+), 13 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/CommonLibs/Configuration.cpp b/CommonLibs/Configuration.cpp index 14e5400..4661903 100644 --- a/CommonLibs/Configuration.cpp +++ b/CommonLibs/Configuration.cpp @@ -104,17 +104,6 @@ // Build CommonLibs schema ConfigurationKey *tmp; - tmp = new ConfigurationKey("Log.Alarms.Max","20", - "alarms", - ConfigurationKey::CUSTOMER, - ConfigurationKey::VALRANGE, - "10:20",// educated guess - false, - "Maximum number of alarms to remember inside the application." - ); - mSchema[tmp->getName()] = *tmp; - delete tmp; - tmp = new ConfigurationKey("Log.File","", "", ConfigurationKey::DEVELOPER, diff --git a/CommonLibs/Logger.cpp b/CommonLibs/Logger.cpp index 4e4dbbc..d246584 100644 --- a/CommonLibs/Logger.cpp +++ b/CommonLibs/Logger.cpp @@ -36,6 +36,7 @@ #include "Logger.h" #include "Threads.h" // pat added +#define MAX_ALARMS 20 using namespace std; @@ -212,8 +213,7 @@ { alarmsLock.lock(); alarmsList.push_back(s); - unsigned maxAlarms = gConfig.getNum("Log.Alarms.Max"); - while (alarmsList.size() > maxAlarms) alarmsList.pop_front(); + while (alarmsList.size() > MAX_ALARMS) alarmsList.pop_front(); alarmsLock.unlock(); } -- To view, visit https://gerrit.osmocom.org/5701 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idcd789afe668a5c0271352f1d20d2efda826213a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:10:36 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:10:36 +0000 Subject: [MERGED] osmo-trx[master]: cosmetic: Remove trailing whitespace In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: cosmetic: Remove trailing whitespace ...................................................................... cosmetic: Remove trailing whitespace Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5 --- M AUTHORS M CommonLibs/LogTest.cpp M CommonLibs/Makefile.am M Transceiver52M/Makefile.am M configure.ac 5 files changed, 4 insertions(+), 10 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/AUTHORS b/AUTHORS index 88ac61b..65532aa 100644 --- a/AUTHORS +++ b/AUTHORS @@ -186,4 +186,3 @@ RRLPMessages.cpp RRLPMessages.h RRLPTest.cpp - diff --git a/CommonLibs/LogTest.cpp b/CommonLibs/LogTest.cpp index 20959a0..882707d 100644 --- a/CommonLibs/LogTest.cpp +++ b/CommonLibs/LogTest.cpp @@ -64,6 +64,3 @@ std::cout << "you should see ten lines with the numbers 10..19:" << std::endl; printAlarms(); } - - - diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index 18ec2f7..ed188d5 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -50,7 +50,7 @@ ConfigurationTest \ LogTest -# ReportingTest +# ReportingTest noinst_HEADERS = \ BitVector.h \ @@ -94,5 +94,3 @@ LogTest_LDADD = libcommon.la $(SQLITE3_LIBS) MOSTLYCLEANFILES += testSource testDestination - - diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index c2ab9ca..20d0bd6 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -32,7 +32,7 @@ ARCH_LA = x86/libarch.la endif -if USRP1 +if USRP1 AM_CPPFLAGS += $(USRP_CFLAGS) else AM_CPPFLAGS += $(UHD_CFLAGS) @@ -99,7 +99,7 @@ $(GSM_LA) \ $(COMMON_LA) $(SQLITE3_LIBS) -if USRP1 +if USRP1 libtransceiver_la_SOURCES += USRPDevice.cpp osmo_trx_LDADD += $(USRP_LIBS) else diff --git a/configure.ac b/configure.ac index 6e59fa2..01bec91 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ [openbsc at lists.osmocom.org]) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([Transceiver52M/Makefile.am]) -AC_CONFIG_AUX_DIR([.]) +AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([config]) AM_CONFIG_HEADER(config.h) -- To view, visit https://gerrit.osmocom.org/5700 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64c8dbad3fc42bcb8dd4ac9b16bbd9c59a0cf5d5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:11:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 10:11:49 +0000 Subject: osmo-ci[master]: Notify per email about master branch build failure In-Reply-To: References: Message-ID: Patch Set 1: I've verified that it works but I'm unable to mark it as such in gerrit until I have +2 review. -- To view, visit https://gerrit.osmocom.org/5692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:35:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:35:37 +0000 Subject: osmo-trx[master]: tests: Timeval: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Patch Set 1: > This is odd - if test output is always empty, how can we be sure > that the test was executed at all? I think it's better to log at > least what kind of test is executing. Even better would be to log > smth in case of error instead of using assert: if we hit assert > than we don't know what happens with the test code beyond assert > point. If we log error and continue, we might see several errors at > once and the test would still fail due to output difference. > Although it might be matter of personal preference. AT_CHECK checks the return code of the program, so we catch if it fails or not. I'll add a small print to the stdout to check against it, though, as it gives more confidence when checking if the test is run. If the test fails with assert, then you can easily run it with gdb and get a backtrace and see what's going on, so no issue with it. Some tests also print extra information to stderr which is logged into testsuite.log if the test fails. -- To view, visit https://gerrit.osmocom.org/5708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Wed Jan 10 10:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:36:07 +0000 Subject: [PATCH] osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5706 to look at the new patch set (#2). Set up GNU Autotest infrastructure Test files are moved from CommonLibs/ to tests/CommonLibs/. Some tests are disabled in autotest because they generate timedate related output which cannot exactly match against expected output. Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc --- M .gitignore M AUTHORS M CommonLibs/Makefile.am M Makefile.am M configure.ac R tests/CommonLibs/BitVectorTest.cpp A tests/CommonLibs/BitVectorTest.ok R tests/CommonLibs/InterthreadTest.cpp A tests/CommonLibs/InterthreadTest.ok R tests/CommonLibs/LogTest.cpp A tests/CommonLibs/LogTest.err A tests/CommonLibs/LogTest.ok A tests/CommonLibs/Makefile.am R tests/CommonLibs/PRBSTest.cpp A tests/CommonLibs/PRBSTest.ok R tests/CommonLibs/SocketsTest.cpp R tests/CommonLibs/TimevalTest.cpp A tests/CommonLibs/TimevalTest.ok R tests/CommonLibs/VectorTest.cpp A tests/CommonLibs/VectorTest.ok A tests/Makefile.am A tests/testsuite.at 22 files changed, 359 insertions(+), 113 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/06/5706/2 diff --git a/.gitignore b/.gitignore index d560f19..bc6c036 100644 --- a/.gitignore +++ b/.gitignore @@ -5,17 +5,16 @@ Transceiver52M/osmo-trx # tests -CommonLibs/BitVectorTest -CommonLibs/ConfigurationTest -CommonLibs/F16Test -CommonLibs/InterthreadTest -CommonLibs/LogTest -CommonLibs/RegexpTest -CommonLibs/SocketsTest -CommonLibs/TimevalTest -CommonLibs/URLEncodeTest -CommonLibs/VectorTest -CommonLibs/PRBSTest +tests/CommonLibs/BitVectorTest +tests/CommonLibs/F16Test +tests/CommonLibs/InterthreadTest +tests/CommonLibs/LogTest +tests/CommonLibs/RegexpTest +tests/CommonLibs/SocketsTest +tests/CommonLibs/TimevalTest +tests/CommonLibs/URLEncodeTest +tests/CommonLibs/VectorTest +tests/CommonLibs/PRBSTest # automake/autoconf *.in @@ -41,6 +40,8 @@ missing stamp-h1 INSTALL +tests/package.m4 +tests/testsuite # vim *.sw? diff --git a/AUTHORS b/AUTHORS index 7898188..53a3c7d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,31 +23,17 @@ CLI/CLI.h CommonLibs/Assert.h CommonLibs/BitVector.cpp - CommonLibs/BitVectorTest.cpp CommonLibs/Interthread.h - CommonLibs/InterthreadTest.cpp CommonLibs/LinkedLists.cpp CommonLibs/LinkedLists.h CommonLibs/Regexp.h - CommonLibs/RegexpTest.cpp CommonLibs/Sockets.cpp CommonLibs/Sockets.h - CommonLibs/SocketsTest.cpp CommonLibs/Threads.cpp CommonLibs/Threads.h CommonLibs/Timeval.cpp CommonLibs/Timeval.h - CommonLibs/TimevalTest.cpp CommonLibs/Vector.h - CommonLibs/VectorTest.cpp - Control/CallControl.cpp - Control/ControlCommon.cpp - Control/ControlCommon.h - Control/FACCHDispatch.cpp - Control/MobilityManagement.cpp - Control/PagerTest.cpp - Control/RadioResource.cpp - Control/SDCCHDispatch.cpp GSM/GSM610Tables.cpp GSM/GSM610Tables.h GSM/GSMCommon.cpp @@ -79,26 +65,15 @@ GSM/GSMTransfer.cpp GSM/GSMTransfer.h LICENSEBLOCK - SIP/SIPEngine.h - SIP/SIPInterface.h - SMS/SMSMessages.cpp - SMS/SMSMessages.h - SMS/SMSTransfer.cpp - SMS/SMSTransfer.h TRXManager/TRXManager.cpp Transceiver/Complex.h - tests/AGCHTest.cpp - tests/BeaconTest.cpp - tests/CallTest.cpp - tests/CallTest2.cpp - tests/LAPDmTest.cpp - tests/LoopbackTest.cpp - tests/RegistrationTest.cpp - tests/TRXSimulator.cpp + tests/CommonLibs/BitVectorTest.cpp + tests/CommonLibs/InterthreadTest.cpp + tests/CommonLibs/SocketsTest.cpp + tests/CommonLibs/TimevalTest.cpp + tests/CommonLibs/VectorTest.cpp Harvind S. Samra, hssamra at kestrelsp.com: - Control/PagerTest.cpp - Control/RadioResource.cpp GSM/GSMConfig.h GSM/GSMTransfer.h LICENSEBLOCK @@ -120,13 +95,6 @@ Transceiver/testRadio.cpp Raffi Sevlian, raffisev at gmail.com: - Control/CallControl.cpp - Control/ControlCommon.cpp - Control/ControlCommon.h - Control/FACCHDispatch.cpp - Control/MobilityManagement.cpp - Control/PagerTest.cpp - Control/RadioResource.cpp GSM/GSMCommon.h GSM/GSMConfig.h GSM/GSML1FEC.h @@ -151,32 +119,6 @@ GSM/GSMSAPMux.h GSM/GSMTransfer.h LICENSEBLOCK - SIP/SIPEngine.cpp - SIP/SIPInterface.cpp - SIP/SIPInterface.h - SIP/SIPMessage.cpp - SIP/SIPMessage.h - SIP/SIPUtility.cpp - SIP/SIPUtility.h - SMS/CMMessage.cpp - SMS/CMMessage.h - SMS/CMProcessor.cpp - SMS/CMProcessor.h - SMS/CMTest.cpp - SMS/RLMessage.cpp - SMS/RLMessage.h - SMS/RLProcessor.cpp - SMS/RLProcessor.h - SMS/SMSMessages.cpp - SMS/SMSMessages.h - SMS/SMSProcessors.cpp - SMS/SMSProcessors.h - SMS/SMSTransfer.cpp - SMS/SMSTransfer.h - SMS/TLMessage.cpp - SMS/TLMessage.h - SMS/TLProcessor.cpp - SMS/TLProcessor.h TRXManager/TRXManager.h Alon Levy, alonlevy1 at gmail.com diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index d42e82a..46cc143 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -38,17 +38,6 @@ Timeval.cpp \ Logger.cpp -noinst_PROGRAMS = \ - BitVectorTest \ - PRBSTest \ - InterthreadTest \ - SocketsTest \ - TimevalTest \ - VectorTest \ - LogTest - -# ReportingTest - noinst_HEADERS = \ BitVector.h \ PRBS.h \ @@ -59,30 +48,3 @@ Timeval.h \ Vector.h \ Logger.h - -BitVectorTest_SOURCES = BitVectorTest.cpp -BitVectorTest_LDADD = libcommon.la - -PRBSTest_SOURCES = PRBSTest.cpp - -InterthreadTest_SOURCES = InterthreadTest.cpp -InterthreadTest_LDADD = libcommon.la -InterthreadTest_LDFLAGS = -lpthread - -SocketsTest_SOURCES = SocketsTest.cpp -SocketsTest_LDADD = libcommon.la -SocketsTest_LDFLAGS = -lpthread - -TimevalTest_SOURCES = TimevalTest.cpp -TimevalTest_LDADD = libcommon.la - -VectorTest_SOURCES = VectorTest.cpp -VectorTest_LDADD = libcommon.la - -# ReportingTest_SOURCES = ReportingTest.cpp -# ReportingTest_LDADD = libcommon.la - -LogTest_SOURCES = LogTest.cpp -LogTest_LDADD = libcommon.la - -MOSTLYCLEANFILES += testSource testDestination diff --git a/Makefile.am b/Makefile.am index 658eae4..1e659a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,8 @@ SUBDIRS = \ CommonLibs \ GSM \ - Transceiver52M + Transceiver52M \ + tests EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index 1a9712a..3ad4b41 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,7 @@ AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([config]) AM_CONFIG_HEADER(config.h) +AC_CONFIG_TESTDIR(tests) AC_CANONICAL_BUILD AC_CANONICAL_HOST @@ -171,6 +172,8 @@ Transceiver52M/Makefile \ Transceiver52M/arm/Makefile \ Transceiver52M/x86/Makefile \ + tests/Makefile \ + tests/CommonLibs/Makefile \ ]) AC_OUTPUT diff --git a/CommonLibs/BitVectorTest.cpp b/tests/CommonLibs/BitVectorTest.cpp similarity index 100% rename from CommonLibs/BitVectorTest.cpp rename to tests/CommonLibs/BitVectorTest.cpp diff --git a/tests/CommonLibs/BitVectorTest.ok b/tests/CommonLibs/BitVectorTest.ok new file mode 100644 index 0000000..f959a08 --- /dev/null +++ b/tests/CommonLibs/BitVectorTest.ok @@ -0,0 +1,8 @@ +15 15 240 +000011110000 +101011110000 +175 +111101010000 +ts=abcdefgh +tp=0110000101100010011000110110010001100101011001100110011101101000000000 +ts=abcdefgh diff --git a/CommonLibs/InterthreadTest.cpp b/tests/CommonLibs/InterthreadTest.cpp similarity index 100% rename from CommonLibs/InterthreadTest.cpp rename to tests/CommonLibs/InterthreadTest.cpp diff --git a/tests/CommonLibs/InterthreadTest.ok b/tests/CommonLibs/InterthreadTest.ok new file mode 100644 index 0000000..db382bb --- /dev/null +++ b/tests/CommonLibs/InterthreadTest.ok @@ -0,0 +1,81 @@ +1515515500.150033 140715424245504: queue write 0 +1515515500.150105 140715423979264: map write 0 +1515515500.150132 140715423979264: map write 1 +1515515500.150143 140715424777984: queue read 0 +1515515500.150175 140715424511744: map read 0 +1515515500.150194 140715424511744: map read 1 +1515515501.150203 140715424245504: queue write 1 +1515515501.150288 140715423979264: map write 2 +1515515501.150334 140715424777984: queue read 1 +1515515501.150366 140715424511744: map read 2 +1515515502.150405 140715424245504: queue write 2 +1515515502.150488 140715423979264: map write 3 +1515515502.150533 140715424777984: queue read 2 +1515515502.150612 140715423979264: map write 4 +1515515502.150642 140715423979264: map write 5 +1515515502.150662 140715424511744: map read 3 +1515515502.150680 140715424511744: map read 4 +1515515502.150686 140715424511744: map read 5 +1515515503.150607 140715424245504: queue write 3 +1515515503.150709 140715424777984: queue read 3 +1515515503.150741 140715423979264: map write 6 +1515515503.150760 140715423979264: map write 7 +1515515503.150776 140715424511744: map read 6 +1515515503.150788 140715424511744: map read 7 +1515515504.150770 140715424245504: queue write 4 +1515515504.150839 140715424245504: queue write 5 +1515515504.150857 140715423979264: map write 8 +1515515504.150876 140715424777984: queue read 4 +1515515504.150904 140715424777984: queue read 5 +1515515504.150919 140715424511744: map read 8 +1515515505.150990 140715424245504: queue write 6 +1515515505.151066 140715423979264: map write 9 +1515515505.151095 140715424245504: queue write 7 +1515515505.151127 140715424245504: queue write 8 +1515515505.151143 140715424245504: queue write 9 +1515515505.151163 140715424245504: queue write 10 +1515515505.151179 140715424777984: queue read 6 +1515515505.151210 140715424777984: queue read 7 +1515515505.151217 140715424777984: queue read 8 +1515515505.151221 140715424777984: queue read 9 +1515515505.151226 140715424777984: queue read 10 +1515515505.151249 140715423979264: map write 10 +1515515505.151277 140715424511744: map read 9 +1515515505.151291 140715424511744: map read 10 +1515515505.151298 140715423979264: map write 11 +1515515505.151317 140715424511744: map read 11 +1515515506.151303 140715424245504: queue write 11 +1515515506.151386 140715423979264: map write 12 +1515515506.151414 140715424777984: queue read 11 +1515515506.151457 140715424511744: map read 12 +1515515506.151528 140715423979264: map write 13 +1515515506.151567 140715423979264: map write 14 +1515515506.151577 140715423979264: map write 15 +1515515506.151601 140715424511744: map read 13 +1515515506.151621 140715424511744: map read 14 +1515515506.151628 140715424511744: map read 15 +1515515507.151498 140715424245504: queue write 12 +1515515507.151606 140715424777984: queue read 12 +1515515507.151654 140715423979264: map write 16 +1515515507.151711 140715424511744: map read 16 +1515515508.151707 140715424245504: queue write 13 +1515515508.151778 140715423979264: map write 17 +1515515508.151816 140715423979264: map write 18 +1515515508.151830 140715424511744: map read 17 +1515515508.151870 140715424511744: map read 18 +1515515508.151904 140715423979264: map write 19 +1515515508.151963 140715424777984: queue read 13 +1515515508.151997 140715424511744: map read 19 +1515515509.151920 140715424245504: queue write 14 +1515515509.152023 140715424777984: queue read 14 +1515515510.152109 140715424245504: queue write 15 +1515515510.152218 140715424777984: queue read 15 +1515515511.152258 140715424245504: queue write 16 +1515515511.152380 140715424777984: queue read 16 +1515515512.152409 140715424245504: queue write 17 +1515515512.152449 140715424245504: queue write 18 +1515515512.152458 140715424777984: queue read 17 +1515515512.152477 140715424777984: queue read 18 +1515515513.152574 140715424245504: queue write 19 +1515515513.152674 140715424777984: queue read 19 +1515515513.152708 140715424777984: queue read -1 diff --git a/CommonLibs/LogTest.cpp b/tests/CommonLibs/LogTest.cpp similarity index 100% rename from CommonLibs/LogTest.cpp rename to tests/CommonLibs/LogTest.cpp diff --git a/tests/CommonLibs/LogTest.err b/tests/CommonLibs/LogTest.err new file mode 100644 index 0000000..eee46b9 --- /dev/null +++ b/tests/CommonLibs/LogTest.err @@ -0,0 +1,24 @@ +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 diff --git a/tests/CommonLibs/LogTest.ok b/tests/CommonLibs/LogTest.ok new file mode 100644 index 0000000..724f053 --- /dev/null +++ b/tests/CommonLibs/LogTest.ok @@ -0,0 +1,59 @@ +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +WARNING 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:48:main: testing the logger. +NOTICE 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:49:main: testing the logger. + + + +testing Alarms +you should see three lines: +# alarms = 4 +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +----------- generating 20 alarms ---------- +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +you should see ten lines with the numbers 10..19: +# alarms = 20 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 diff --git a/tests/CommonLibs/Makefile.am b/tests/CommonLibs/Makefile.am new file mode 100644 index 0000000..6bd1852 --- /dev/null +++ b/tests/CommonLibs/Makefile.am @@ -0,0 +1,44 @@ +include $(top_srcdir)/Makefile.common + +AM_CPPFLAGS = -Wall -I$(top_srcdir)/CommonLibs $(STD_DEFINES_AND_INCLUDES) -g + +EXTRA_DIST = BitVectorTest.ok \ + PRBSTest.ok \ + InterthreadTest.ok \ + SocketsTest.ok \ + TimevalTest.ok \ + VectorTest.ok \ + LogTest.ok + +noinst_PROGRAMS = \ + BitVectorTest \ + PRBSTest \ + InterthreadTest \ + SocketsTest \ + TimevalTest \ + VectorTest \ + LogTest + +BitVectorTest_SOURCES = BitVectorTest.cpp +BitVectorTest_LDADD = $(COMMON_LA) + +PRBSTest_SOURCES = PRBSTest.cpp + +InterthreadTest_SOURCES = InterthreadTest.cpp +InterthreadTest_LDADD = $(COMMON_LA) +InterthreadTest_LDFLAGS = -lpthread + +SocketsTest_SOURCES = SocketsTest.cpp +SocketsTest_LDADD = $(COMMON_LA) +SocketsTest_LDFLAGS = -lpthread + +TimevalTest_SOURCES = TimevalTest.cpp +TimevalTest_LDADD = $(COMMON_LA) + +VectorTest_SOURCES = VectorTest.cpp +VectorTest_LDADD = $(COMMON_LA) + +LogTest_SOURCES = LogTest.cpp +LogTest_LDADD = $(COMMON_LA) + +MOSTLYCLEANFILES += testSource testDestination diff --git a/CommonLibs/PRBSTest.cpp b/tests/CommonLibs/PRBSTest.cpp similarity index 100% rename from CommonLibs/PRBSTest.cpp rename to tests/CommonLibs/PRBSTest.cpp diff --git a/tests/CommonLibs/PRBSTest.ok b/tests/CommonLibs/PRBSTest.ok new file mode 100644 index 0000000..d3fe378 --- /dev/null +++ b/tests/CommonLibs/PRBSTest.ok @@ -0,0 +1,4 @@ +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +Period: 511 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +Period: 32767 diff --git a/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp similarity index 100% rename from CommonLibs/SocketsTest.cpp rename to tests/CommonLibs/SocketsTest.cpp diff --git a/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp similarity index 100% rename from CommonLibs/TimevalTest.cpp rename to tests/CommonLibs/TimevalTest.cpp diff --git a/tests/CommonLibs/TimevalTest.ok b/tests/CommonLibs/TimevalTest.ok new file mode 100644 index 0000000..c97031d --- /dev/null +++ b/tests/CommonLibs/TimevalTest.ok @@ -0,0 +1,22 @@ +-10000 +now: 1515515602.357742 then: 1515515612.357710 remaining: 10000 +now: 1515515602.857837 then: 1515515612.357710 remaining: 9500 +now: 1515515603.357975 then: 1515515612.357710 remaining: 9000 +now: 1515515603.858163 then: 1515515612.357710 remaining: 8500 +now: 1515515604.358353 then: 1515515612.357710 remaining: 8000 +now: 1515515604.858465 then: 1515515612.357710 remaining: 7500 +now: 1515515605.358622 then: 1515515612.357710 remaining: 7000 +now: 1515515605.858745 then: 1515515612.357710 remaining: 6499 +now: 1515515606.358852 then: 1515515612.357710 remaining: 5999 +now: 1515515606.859055 then: 1515515612.357710 remaining: 5499 +now: 1515515607.359170 then: 1515515612.357710 remaining: 4999 +now: 1515515607.859349 then: 1515515612.357710 remaining: 4499 +now: 1515515608.359455 then: 1515515612.357710 remaining: 3999 +now: 1515515608.859549 then: 1515515612.357710 remaining: 3499 +now: 1515515609.359748 then: 1515515612.357710 remaining: 2998 +now: 1515515609.859865 then: 1515515612.357710 remaining: 2498 +now: 1515515610.360064 then: 1515515612.357710 remaining: 1998 +now: 1515515610.860223 then: 1515515612.357710 remaining: 1498 +now: 1515515611.360386 then: 1515515612.357710 remaining: 998 +now: 1515515611.860592 then: 1515515612.357710 remaining: 498 +now: 1515515612.360712 then: 1515515612.357710 remaining: -3 diff --git a/CommonLibs/VectorTest.cpp b/tests/CommonLibs/VectorTest.cpp similarity index 100% rename from CommonLibs/VectorTest.cpp rename to tests/CommonLibs/VectorTest.cpp diff --git a/tests/CommonLibs/VectorTest.ok b/tests/CommonLibs/VectorTest.ok new file mode 100644 index 0000000..afe5162 --- /dev/null +++ b/tests/CommonLibs/VectorTest.ok @@ -0,0 +1,10 @@ +0 1 2 3 4 +10 11 12 13 14 +0 1 2 3 4 10 11 12 13 14 +0 1 2 +3 4 10 11 12 13 14 +8 8 8 8 8 8 8 8 8 8 +8 8 8 0 1 2 3 4 8 8 +1 2 3 +8 8 8 0 9 9 9 4 8 8 +9 9 9 diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..c18bef3 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,40 @@ +SUBDIRS = \ + CommonLibs \ + $(NULL) + +# The `:;' works around a Bash 3.2 bug when the output is not writeable. +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + :;{ \ + echo '# Signature of the current package.' && \ + echo 'm4_define([AT_PACKAGE_NAME],' && \ + echo ' [$(PACKAGE_NAME)])' && \ + echo 'm4_define([AT_PACKAGE_TARNAME],' && \ + echo ' [$(PACKAGE_TARNAME)])' && \ + echo 'm4_define([AT_PACKAGE_VERSION],' && \ + echo ' [$(PACKAGE_VERSION)])' && \ + echo 'm4_define([AT_PACKAGE_STRING],' && \ + echo ' [$(PACKAGE_STRING)])' && \ + echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \ + echo ' [$(PACKAGE_BUGREPORT)])'; \ + echo 'm4_define([AT_PACKAGE_URL],' && \ + echo ' [$(PACKAGE_URL)])'; \ + } >'$(srcdir)/package.m4' + +EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) +TESTSUITE = $(srcdir)/testsuite +DISTCLEANFILES = atconfig $(NULL) + +check-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean + +AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + mv $@.tmp $@ diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..2c1e0b5 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,45 @@ +AT_INIT +AT_BANNER([Regression tests.]) + +AT_SETUP([BitVectorTest]) +AT_KEYWORDS([BitVectorTest]) +cat $abs_srcdir/CommonLibs/BitVectorTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/BitVectorTest], [], [expout], []) +AT_CLEANUP + +#AT_SETUP([InterthreadTest]) +#AT_KEYWORDS([InterthreadTest]) +#cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], []) +#AT_CLEANUP + +#AT_SETUP([LogTest]) +#AT_KEYWORDS([LogTest]) +#cat $abs_srcdir/CommonLibs/LogTest.ok > expout +#cat $abs_srcdir/CommonLibs/LogTest.err > experr +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) +#AT_CLEANUP + +AT_SETUP([PRBSTest]) +AT_KEYWORDS([PRBSTest]) +cat $abs_srcdir/CommonLibs/PRBSTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/PRBSTest], [], [expout], []) +AT_CLEANUP + +#AT_SETUP([SocketsTest]) +#AT_KEYWORDS([SocketsTest]) +#cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) +#AT_CLEANUP + +#AT_SETUP([TimevalTest]) +#AT_KEYWORDS([TimevalTest]) +#cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], []) +#AT_CLEANUP + +AT_SETUP([VectorTest]) +AT_KEYWORDS([VectorTest]) +cat $abs_srcdir/CommonLibs/VectorTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/VectorTest], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:36:07 +0000 Subject: [PATCH] osmo-trx[master]: tests: InterThread: adapt to have reproducible output and en... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5707 to look at the new patch set (#2). tests: InterThread: adapt to have reproducible output and enable autotest Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f --- M tests/CommonLibs/InterthreadTest.cpp M tests/CommonLibs/InterthreadTest.ok M tests/testsuite.at 3 files changed, 33 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/07/5707/2 diff --git a/tests/CommonLibs/InterthreadTest.cpp b/tests/CommonLibs/InterthreadTest.cpp index 03445d9..c131c2a 100644 --- a/tests/CommonLibs/InterthreadTest.cpp +++ b/tests/CommonLibs/InterthreadTest.cpp @@ -35,14 +35,20 @@ InterthreadQueue gQ; InterthreadMap gMap; +int q_last_read_val = -1; +int q_last_write_val; +int m_last_read_val; +int m_last_write_val; + void* qWriter(void*) { int *p; for (int i=0; i<20; i++) { p = new int; *p = i; - COUT("queue write " << *p); + CERR("queue write " << *p); gQ.write(p); + q_last_write_val = i; if (random()%2) sleep(1); } p = new int; @@ -56,8 +62,14 @@ bool done = false; while (!done) { int *p = gQ.read(); - COUT("queue read " << *p); - if (*p<0) done=true; + CERR("queue read " << *p); + if (*p<0) { + assert(q_last_read_val == 19 && *p == -1); + done = true; + } else { + assert(q_last_read_val == *p - 1); + q_last_read_val = *p; + } delete p; } return NULL; @@ -70,8 +82,9 @@ for (int i=0; i<20; i++) { p = new int; *p = i; - COUT("map write " << *p); + CERR("map write " << *p); gMap.write(i,p); + m_last_write_val = i; if (random()%2) sleep(1); } return NULL; @@ -81,7 +94,9 @@ { for (int i=0; i<20; i++) { int *p = gMap.read(i); - COUT("map read " << *p); + CERR("map read " << *p); + assert(*p == i); + m_last_read_val = *p; // InterthreadMap will delete the pointers // delete p; } @@ -109,6 +124,13 @@ qWriterThread.join(); mapReaderThread.join(); mapWriterThread.join(); + + assert(q_last_write_val == 19); + assert(q_last_read_val == 19); + assert(m_last_write_val == 19); + assert(m_last_read_val == 19); + + printf("Done\n"); } diff --git a/tests/CommonLibs/InterthreadTest.ok b/tests/CommonLibs/InterthreadTest.ok index db382bb..a965a70 100644 --- a/tests/CommonLibs/InterthreadTest.ok +++ b/tests/CommonLibs/InterthreadTest.ok @@ -1,81 +1 @@ -1515515500.150033 140715424245504: queue write 0 -1515515500.150105 140715423979264: map write 0 -1515515500.150132 140715423979264: map write 1 -1515515500.150143 140715424777984: queue read 0 -1515515500.150175 140715424511744: map read 0 -1515515500.150194 140715424511744: map read 1 -1515515501.150203 140715424245504: queue write 1 -1515515501.150288 140715423979264: map write 2 -1515515501.150334 140715424777984: queue read 1 -1515515501.150366 140715424511744: map read 2 -1515515502.150405 140715424245504: queue write 2 -1515515502.150488 140715423979264: map write 3 -1515515502.150533 140715424777984: queue read 2 -1515515502.150612 140715423979264: map write 4 -1515515502.150642 140715423979264: map write 5 -1515515502.150662 140715424511744: map read 3 -1515515502.150680 140715424511744: map read 4 -1515515502.150686 140715424511744: map read 5 -1515515503.150607 140715424245504: queue write 3 -1515515503.150709 140715424777984: queue read 3 -1515515503.150741 140715423979264: map write 6 -1515515503.150760 140715423979264: map write 7 -1515515503.150776 140715424511744: map read 6 -1515515503.150788 140715424511744: map read 7 -1515515504.150770 140715424245504: queue write 4 -1515515504.150839 140715424245504: queue write 5 -1515515504.150857 140715423979264: map write 8 -1515515504.150876 140715424777984: queue read 4 -1515515504.150904 140715424777984: queue read 5 -1515515504.150919 140715424511744: map read 8 -1515515505.150990 140715424245504: queue write 6 -1515515505.151066 140715423979264: map write 9 -1515515505.151095 140715424245504: queue write 7 -1515515505.151127 140715424245504: queue write 8 -1515515505.151143 140715424245504: queue write 9 -1515515505.151163 140715424245504: queue write 10 -1515515505.151179 140715424777984: queue read 6 -1515515505.151210 140715424777984: queue read 7 -1515515505.151217 140715424777984: queue read 8 -1515515505.151221 140715424777984: queue read 9 -1515515505.151226 140715424777984: queue read 10 -1515515505.151249 140715423979264: map write 10 -1515515505.151277 140715424511744: map read 9 -1515515505.151291 140715424511744: map read 10 -1515515505.151298 140715423979264: map write 11 -1515515505.151317 140715424511744: map read 11 -1515515506.151303 140715424245504: queue write 11 -1515515506.151386 140715423979264: map write 12 -1515515506.151414 140715424777984: queue read 11 -1515515506.151457 140715424511744: map read 12 -1515515506.151528 140715423979264: map write 13 -1515515506.151567 140715423979264: map write 14 -1515515506.151577 140715423979264: map write 15 -1515515506.151601 140715424511744: map read 13 -1515515506.151621 140715424511744: map read 14 -1515515506.151628 140715424511744: map read 15 -1515515507.151498 140715424245504: queue write 12 -1515515507.151606 140715424777984: queue read 12 -1515515507.151654 140715423979264: map write 16 -1515515507.151711 140715424511744: map read 16 -1515515508.151707 140715424245504: queue write 13 -1515515508.151778 140715423979264: map write 17 -1515515508.151816 140715423979264: map write 18 -1515515508.151830 140715424511744: map read 17 -1515515508.151870 140715424511744: map read 18 -1515515508.151904 140715423979264: map write 19 -1515515508.151963 140715424777984: queue read 13 -1515515508.151997 140715424511744: map read 19 -1515515509.151920 140715424245504: queue write 14 -1515515509.152023 140715424777984: queue read 14 -1515515510.152109 140715424245504: queue write 15 -1515515510.152218 140715424777984: queue read 15 -1515515511.152258 140715424245504: queue write 16 -1515515511.152380 140715424777984: queue read 16 -1515515512.152409 140715424245504: queue write 17 -1515515512.152449 140715424245504: queue write 18 -1515515512.152458 140715424777984: queue read 17 -1515515512.152477 140715424777984: queue read 18 -1515515513.152574 140715424245504: queue write 19 -1515515513.152674 140715424777984: queue read 19 -1515515513.152708 140715424777984: queue read -1 +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 2c1e0b5..5d519d2 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -7,11 +7,11 @@ AT_CHECK([$abs_top_builddir/tests/CommonLibs/BitVectorTest], [], [expout], []) AT_CLEANUP -#AT_SETUP([InterthreadTest]) -#AT_KEYWORDS([InterthreadTest]) -#cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([InterthreadTest]) +AT_KEYWORDS([InterthreadTest]) +cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], [ignore]) +AT_CLEANUP #AT_SETUP([LogTest]) #AT_KEYWORDS([LogTest]) -- To view, visit https://gerrit.osmocom.org/5707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:36:07 +0000 Subject: [PATCH] osmo-trx[master]: tests: Timeval: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5708 to look at the new patch set (#2). tests: Timeval: adapt to have reproducible output and enable autotest Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 --- M tests/CommonLibs/TimevalTest.cpp M tests/CommonLibs/TimevalTest.ok M tests/testsuite.at 3 files changed, 23 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/08/5708/2 diff --git a/tests/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp index b4746f2..f579878 100644 --- a/tests/CommonLibs/TimevalTest.cpp +++ b/tests/CommonLibs/TimevalTest.cpp @@ -28,18 +28,31 @@ #include "Timeval.h" #include +#include using namespace std; int main(int argc, char *argv[]) { - Timeval then(10000); - cout << then.elapsed() << endl; + assert(then.elapsed() == -10000); + cerr << then << " elapsed: " << then.elapsed() << endl; + double then_seconds = then.seconds(); + double last_now = Timeval().seconds(); + long last_remaining = 10000; + int loops = 0; while (!then.passed()) { - cout << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + double tnow = Timeval().seconds(); + cerr << "now: " << tnow << " then: " << then << " remaining: " << then.remaining() << endl; + assert(last_now <= tnow && last_remaining >= then.remaining()); + assert(then_seconds == then.seconds()); usleep(500000); + loops++; } - cout << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + cerr << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + assert(then.remaining() <= 0); + assert(loops >= 18); + + printf("Done\n"); } diff --git a/tests/CommonLibs/TimevalTest.ok b/tests/CommonLibs/TimevalTest.ok index c97031d..a965a70 100644 --- a/tests/CommonLibs/TimevalTest.ok +++ b/tests/CommonLibs/TimevalTest.ok @@ -1,22 +1 @@ --10000 -now: 1515515602.357742 then: 1515515612.357710 remaining: 10000 -now: 1515515602.857837 then: 1515515612.357710 remaining: 9500 -now: 1515515603.357975 then: 1515515612.357710 remaining: 9000 -now: 1515515603.858163 then: 1515515612.357710 remaining: 8500 -now: 1515515604.358353 then: 1515515612.357710 remaining: 8000 -now: 1515515604.858465 then: 1515515612.357710 remaining: 7500 -now: 1515515605.358622 then: 1515515612.357710 remaining: 7000 -now: 1515515605.858745 then: 1515515612.357710 remaining: 6499 -now: 1515515606.358852 then: 1515515612.357710 remaining: 5999 -now: 1515515606.859055 then: 1515515612.357710 remaining: 5499 -now: 1515515607.359170 then: 1515515612.357710 remaining: 4999 -now: 1515515607.859349 then: 1515515612.357710 remaining: 4499 -now: 1515515608.359455 then: 1515515612.357710 remaining: 3999 -now: 1515515608.859549 then: 1515515612.357710 remaining: 3499 -now: 1515515609.359748 then: 1515515612.357710 remaining: 2998 -now: 1515515609.859865 then: 1515515612.357710 remaining: 2498 -now: 1515515610.360064 then: 1515515612.357710 remaining: 1998 -now: 1515515610.860223 then: 1515515612.357710 remaining: 1498 -now: 1515515611.360386 then: 1515515612.357710 remaining: 998 -now: 1515515611.860592 then: 1515515612.357710 remaining: 498 -now: 1515515612.360712 then: 1515515612.357710 remaining: -3 +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 5d519d2..8e9a541 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -32,11 +32,11 @@ #AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) #AT_CLEANUP -#AT_SETUP([TimevalTest]) -#AT_KEYWORDS([TimevalTest]) -#cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([TimevalTest]) +AT_KEYWORDS([TimevalTest]) +cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], [ignore]) +AT_CLEANUP AT_SETUP([VectorTest]) AT_KEYWORDS([VectorTest]) -- To view, visit https://gerrit.osmocom.org/5708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Wed Jan 10 10:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:36:07 +0000 Subject: [PATCH] osmo-trx[master]: tests: Sockets: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5711 to look at the new patch set (#2). tests: Sockets: adapt to have reproducible output and enable autotest Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c --- M tests/CommonLibs/SocketsTest.cpp A tests/CommonLibs/SocketsTest.ok M tests/testsuite.at 3 files changed, 13 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/11/5711/2 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 3198a5e..b51587d 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -44,7 +44,7 @@ char buf[MAX_UDP_LENGTH]; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { - COUT("read: " << buf); + CERR("read: " << buf); rc++; } else { sleep(2); @@ -65,7 +65,7 @@ buf[MAX_UDP_LENGTH] = '\0'; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { - COUT("read: " << buf); + CERR("read: " << buf); rc++; } else { sleep(2); @@ -85,20 +85,22 @@ UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); UDDSocket socket1U("testSource","testDestination"); - - COUT("socket1: " << socket1.port()); + + CERR("socket1: " << socket1.port()); // give the readers time to open sleep(1); for (int i=0; i expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([SocketsTest]) +AT_KEYWORDS([SocketsTest]) +cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], [ignore]) +AT_CLEANUP AT_SETUP([TimevalTest]) AT_KEYWORDS([TimevalTest]) -- To view, visit https://gerrit.osmocom.org/5711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:36:08 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:36:08 +0000 Subject: [PATCH] osmo-trx[master]: cosmetic: AUTHORS: fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/5724 cosmetic: AUTHORS: fix trailing whitespace Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d --- M AUTHORS 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/24/5724/1 diff --git a/AUTHORS b/AUTHORS index a956de5..7898188 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,18 +1,18 @@ # # Copyright 2008, 2009 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio 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, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- To view, visit https://gerrit.osmocom.org/5724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 10 10:50:18 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 10:50:18 +0000 Subject: osmo-trx[master]: cosmetic: AUTHORS: fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Wed Jan 10 10:56:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 10:56:32 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: Why move to tests/CommonLibs/ instead of just tests/ ? -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 10 10:59:58 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 10:59:58 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: > Why move to tests/CommonLibs/ instead of just tests/ ? Because it's testing stuff from CommonLibs directory. We may want to test stuff from other parts, and this way is a lot clearer which part of the code is it testing. We do the same in osmo-ggsn (subdirs gtp, lib). -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 10 11:08:16 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 10 Jan 2018 11:08:16 +0000 Subject: libosmocore[master]: libosmocodec: implement ECU (Error Concealment Unit) for FR In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) > (1 comment) https://gerrit.osmocom.org/#/c/5421/3/include/osmocom/codec/ecu.h File include/osmocom/codec/ecu.h: Line 9: uint8_t frame_backup[40]; > Still unsure about this. I just used the length which When I see this right, than this originally was struct ecu_fr_ctx I think your intension is to unify the struct, so that it can be used for all codecs. This would require to have the frame_backup[] as large as the larges possible frame - correct. However, I would still prefer to have a specific type for each ecu implementation because it may be that other ecu implementations work completely different and may require different kind of states. -- To view, visit https://gerrit.osmocom.org/5421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:09:57 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:09:57 +0000 Subject: libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 In-Reply-To: References: Message-ID: Patch Set 1: > Would be nice to have more detailed spec reference - which > chapter/paragraph exactly states that? Also, 160 * 8 / 7 is around > 182.86 - you sure we shouldn't use 183 chars? Ok, I'll upload more detailed description soon. Regarding to 182.86, you have: 160 * 8 = 1280 bits 182 * 7 = 1274 bits 1280 - 1274 = 6 bits 6 bits isn't enough to encode a 7-bit character ;) -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:10:28 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 10 Jan 2018 11:10:28 +0000 Subject: [MERGED] osmo-bts[master]: meas_test: fix header file references In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: meas_test: fix header file references ...................................................................... meas_test: fix header file references The unittest module meas_test.c contains a lot of unused header files as the result of a cut and paste error made earlier. Also the reference to stdio.h is missing. remove all header file references that are not needed. add missing header reference to stdio.h Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 --- M tests/meas/meas_test.c 1 file changed, 1 insertion(+), 26 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/tests/meas/meas_test.c b/tests/meas/meas_test.c index acebab5..a283c47 100644 --- a/tests/meas/meas_test.c +++ b/tests/meas/meas_test.c @@ -1,37 +1,12 @@ +#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 #include static struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/5697 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I167be096ed25a86b1114de1ada955822a0b42856 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5712 to look at the new patch set (#2). gsm0480: increase the MAX_LEN_USSD_STRING to 182 According to the GSM 04.80 (version 5.0.0) specification Annex A "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD OCTET STRING is 160 bytes. Thus according to ETSI TS 123 038 (version 10.0.0) specification 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. The remaining 6 bits are set to zero. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5712/2 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 781d8d7..7811c9e 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,7 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +#define MAX_LEN_USSD_STRING 182 /* deprecated */ struct ussd_request { -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3376 to look at the new patch set (#5). gsm0480: handle UnstructuredSS request with DSC != 0x0F Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 --- M src/gsm/gsm0480.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/3376/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 12ae1a3..ecbea8c 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -464,6 +464,17 @@ req->ussd_text_len = num_chars; return 1; + } else { + num_chars = uss_req_data[6]; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; + + req->ussd_text_language = dcs; + req->ussd_text_len = num_chars; + memcpy(req->ussd_text, &(uss_req_data[7]), num_chars); + + return 1; } return 0; -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3377 to look at the new patch set (#5). gsm0480: parse GSM0480_MTYPE_FACILITY separately Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa --- M src/gsm/gsm0480.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/3377/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ecbea8c..d717270 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -196,6 +196,8 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *req); +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct gsm0480_ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, @@ -281,8 +283,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - case GSM0480_MTYPE_FACILITY: rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + break; + case GSM0480_MTYPE_FACILITY: + rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", @@ -294,6 +298,18 @@ return rc; } +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct gsm0480_ss_request *req) +{ + uint8_t facility_length; + + facility_length = ss_facility[0]; + if (len - 1 < facility_length) + return 0; + + return parse_facility_ie(ss_facility + 1, facility_length, req); +} + static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct gsm0480_ss_request *req) { -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3378 to look at the new patch set (#5). gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 84 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3378/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d717270..d1e978f 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -369,6 +373,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -448,6 +455,83 @@ return rc; } +/* Parse an Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 1; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; + + req->ussd_text_language = 1; + req->ussd_text_len = num_chars; + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3379 to look at the new patch set (#5). gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e --- M src/gsm/gsm0480.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/3379/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d1e978f..ecdb315 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -427,6 +427,8 @@ uint8_t operation_code = invoke_data[offset+2]; req->opcode = operation_code; switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: case GSM0480_OP_CODE_PROCESS_USS_REQ: rc = parse_process_uss_req(invoke_data + offset + 3, length - offset - 3, -- To view, visit https://gerrit.osmocom.org/3379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3380 to look at the new patch set (#5). gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 --- M src/gsm/gsm0480.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/3380/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ecdb315..a35ff4a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -434,6 +434,11 @@ length - offset - 3, req); break; + case GSM0480_OP_CODE_PROCESS_USS_DATA: + rc = parse_process_uss_data(invoke_data + offset + 3, + length - offset - 3, + req); + break; case GSM0480_OP_CODE_ACTIVATE_SS: case GSM0480_OP_CODE_DEACTIVATE_SS: case GSM0480_OP_CODE_INTERROGATE_SS: -- To view, visit https://gerrit.osmocom.org/3380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3381 to look at the new patch set (#5). gsm0480: expose the gsm0480_parse_ss_facility_ie() Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3381/5 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 7811c9e..4e0d99f 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -50,6 +50,8 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *request); +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct gsm0480_ss_request *req); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index a35ff4a..ae82f46 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -200,8 +200,6 @@ struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct gsm0480_ss_request *req); -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, @@ -311,7 +309,8 @@ if (len - 1 < facility_length) return 0; - return parse_facility_ie(ss_facility + 1, facility_length, req); + return gsm0480_parse_ss_facility_ie(ss_facility + 1, + facility_length, req); } static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, @@ -333,7 +332,7 @@ case GSM48_IE_CAUSE: break; case GSM0480_IE_FACILITY: - rc = parse_facility_ie(ss_ie + 2, iei_length, req); + rc = gsm0480_parse_ss_facility_ie(ss_ie + 2, iei_length, req); break; case GSM0480_IE_SS_VERSION: break; @@ -347,8 +346,8 @@ return rc; } -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct gsm0480_ss_request *req) +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset = 0; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5611ba3..f316cad 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -90,6 +90,7 @@ gsm0480_create_ussd_release_complete; gsm0480_decode_ussd_request; gsm0480_decode_ss_request; +gsm0480_parse_ss_facility_ie; gsm0480_wrap_facility; gsm0480_wrap_invoke; -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: drop length check in gsm0480_decode_ss_request() 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/3373 to look at the new patch set (#5). gsm0480: drop length check in gsm0480_decode_ss_request() According to GSM 04.80 Section 2.5 'Release complete' Table 2.5, the 'RELEASE COMPLETE' message payload is optional, so let's drop length check in gsm0480_decode_ss_request(). Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 --- M src/gsm/gsm0480.c 1 file changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3373/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ae82f46..acf11a9 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -254,12 +254,6 @@ struct gsm0480_ss_request *req) { int rc = 0; - - if (len < sizeof(*hdr) + 2) { - LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); - return 0; - } - if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { req->transaction_id = hdr->proto_discr & 0x70; rc = parse_ss(hdr, len, req); -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:10:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#5). gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/3375/5 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 9cfe336..12ae1a3 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -436,36 +436,37 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) { - int rc = 0; int num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; - num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; - req->ussd_text_language = 0x80; - req->ussd_text_len = num_chars; - rc = 1; - } - } + num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + req->ussd_text_language = 0x80; + req->ussd_text_len = num_chars; + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 11:11:57 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 10 Jan 2018 11:11:57 +0000 Subject: [MERGED] osmo-bsc[master]: mgcp: log file and line of calls to handle_error() In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: mgcp: log file and line of calls to handle_error() ...................................................................... mgcp: log file and line of calls to handle_error() When the FSM runs into an error condition handle_error() is called with a cause code. The information about the error is then printed by handle_error(), by this we do not get the sourcecode line of the location where the error actually happend. Convey the source code line number of the actual error in handle_error() Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464 --- M src/osmo-bsc/osmo_bsc_mgcp.c 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 8ea6415..6caf496 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -122,7 +122,10 @@ * remove a half open connection (if possible). This function will execute * a controlled jump to the DLCX phase. From there, the FSM will then just * continue like the call were ended normally */ -static void handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cause) +#define handle_error(mgcp_ctx, cause) \ + _handle_error(mgcp_ctx, cause, __FILE__, __LINE__) +static void _handle_error(struct mgcp_ctx *mgcp_ctx, enum bsc_mgcp_cause_code cause, + const char *file, int line) { struct osmo_fsm_inst *fi; @@ -130,8 +133,8 @@ fi = mgcp_ctx->fsm; OSMO_ASSERT(fi); - LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "%s -- graceful shutdown...\n", - get_value_string(bsc_mgcp_cause_codes_names, cause)); + LOGPFSMLSRC(mgcp_ctx->fsm, LOGL_ERROR, file, line, "%s -- graceful shutdown...\n", + get_value_string(bsc_mgcp_cause_codes_names, cause)); /* Set the VM into the state where it waits for the call end */ osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); -- To view, visit https://gerrit.osmocom.org/5691 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa7f2a655474826630988572616cd26e1e2f3464 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc 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 Wed Jan 10 11:12:14 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 10 Jan 2018 11:12:14 +0000 Subject: [MERGED] osmo-bsc[master]: cosmetic: mgcp: remove duplicate logging In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: cosmetic: mgcp: remove duplicate logging ...................................................................... cosmetic: mgcp: remove duplicate logging do not print an additional log lines when the mgcp FSM gets halted. This is already done by osmo-fsm Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 --- M src/osmo-bsc/osmo_bsc_mgcp.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Stefan Sperling: Looks good to me, but someone else must approve Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 6caf496..186c8c5 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -811,8 +811,6 @@ mgcp_ctx->resp = NULL; } - LOGPFSML(fi, LOGL_DEBUG, "state machine halted\n"); - /* Destroy the state machine and all context information */ osmo_fsm_inst_free(mgcp_ctx->fsm); mgcp_ctx->fsm = NULL; -- To view, visit https://gerrit.osmocom.org/5648 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5aebbcacb68eab3c6afb19991dbf63a02524e4d7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:18:50 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:18:50 +0000 Subject: libosmocore[master]: libosmocodec: implement ECU (Error Concealment Unit) for FR In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5421/3/include/osmocom/codec/ecu.h File include/osmocom/codec/ecu.h: Line 9: uint8_t frame_backup[40]; > When I see this right, than this originally was struct ecu_fr_ctx Ok, agree with you. I'll modify the change. -- To view, visit https://gerrit.osmocom.org/5421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:35:13 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:35:13 +0000 Subject: [PATCH] libosmocore[master]: libosmocodec: implement ECU (Error Concealment Unit) for FR In-Reply-To: References: Message-ID: Hello dexter, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5421 to look at the new patch set (#4). libosmocodec: implement ECU (Error Concealment Unit) for FR When a bad GSM voice frame is received, it's being replaced by a silence frame. This may cause unpleasant audio effects. This change implements a functionality to craft a replacement frame from the last known good frame. Currently, only FR is supported, support for other codecs may be added latter. Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 --- M TODO-RELEASE M include/Makefile.am A include/osmocom/codec/ecu.h M src/codec/Makefile.am A src/codec/ecu_fr.c M tests/Makefile.am A tests/codec/codec_ecu_fr_test.c A tests/codec/codec_ecu_fr_test.ok M tests/testsuite.at 9 files changed, 535 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/5421/4 diff --git a/TODO-RELEASE b/TODO-RELEASE index a5def79..782ba19 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h +codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) diff --git a/include/Makefile.am b/include/Makefile.am index 09f5ca6..f95d90c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,6 +1,7 @@ BUILT_SOURCES = osmocom/gsm/gsm0503.h nobase_include_HEADERS = \ + osmocom/codec/ecu.h \ osmocom/codec/codec.h \ osmocom/codec/gsm610_bits.h \ osmocom/core/application.h \ diff --git a/include/osmocom/codec/ecu.h b/include/osmocom/codec/ecu.h new file mode 100644 index 0000000..f7a29a0 --- /dev/null +++ b/include/osmocom/codec/ecu.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +#include + +/* Codec independent ECU state */ +struct osmo_ecu_fr_state { + bool subsequent_lost_frame; + uint8_t frame_backup[GSM_FR_BYTES]; +}; + +void osmo_ecu_fr_reset(struct osmo_ecu_fr_state *state, uint8_t *frame); +int osmo_ecu_fr_conceal(struct osmo_ecu_fr_state *state, uint8_t *frame); diff --git a/src/codec/Makefile.am b/src/codec/Makefile.am index b4df5da..f77d910 100644 --- a/src/codec/Makefile.am +++ b/src/codec/Makefile.am @@ -13,6 +13,6 @@ lib_LTLIBRARIES = libosmocodec.la -libosmocodec_la_SOURCES = gsm610.c gsm620.c gsm660.c gsm690.c +libosmocodec_la_SOURCES = gsm610.c gsm620.c gsm660.c gsm690.c ecu_fr.c libosmocodec_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined libosmocodec_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/codec/ecu_fr.c b/src/codec/ecu_fr.c new file mode 100644 index 0000000..d4ea741 --- /dev/null +++ b/src/codec/ecu_fr.c @@ -0,0 +1,165 @@ +/* + * (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2017 by Philipp Maier + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +/* See also GSM 06.11, chapter 6 Example solution */ +#define GSM610_XMAXC_REDUCE 4 +#define GSM610_XMAXC_LEN 6 + +/** + * Reduce the XMAXC field. When the XMAXC field reaches + * zero the function will return true. + */ +static bool reduce_xmaxcr(struct bitvec *frame_bitvec, + const unsigned int index) +{ + unsigned int field_index; + uint64_t field; + + field_index = index; + field = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + if (field > GSM610_XMAXC_REDUCE) + field -= GSM610_XMAXC_REDUCE; + else + field = 0; + + field_index = index; + bitvec_write_field(frame_bitvec, &field_index, field, GSM610_XMAXC_LEN); + + return field == 0; +} + +/** + * Reduce all XMAXC fields in the frame. When all XMAXC fields + * reach zero, then the function will return true. + */ +static bool reduce_xmaxcr_all(struct bitvec *frame_bitvec) +{ + bool silent = false; + + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC00)) + silent = true; + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC10)) + silent = true; + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC20)) + silent = true; + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC30)) + silent = true; + + return silent; +} + +/* Use certain modifications to conceal the errors in a full rate frame */ +static int conceal_frame(uint8_t *frame) +{ + struct bitvec *frame_bitvec; + unsigned int len; + bool silent; + int rc = 0; + + /* In case we already deal with a silent frame, + * there is nothing to, we just abort immediately */ + if (osmo_fr_check_sid(frame, GSM_FR_BYTES)) + return 0; + + /* Attempt to allocate memory for bitvec */ + frame_bitvec = bitvec_alloc(GSM_FR_BYTES, NULL); + if (!frame_bitvec) + return -ENOMEM; + + /* Convert a frame to bitvec */ + len = bitvec_unpack(frame_bitvec, frame); + if (len != GSM_FR_BYTES) { + rc = -EIO; + goto leave; + } + + /* Fudge frame parameters */ + silent = reduce_xmaxcr_all(frame_bitvec); + + /* If we reached silence level, mute the frame + * completely, this also means that we can + * save the bitvec_pack operation */ + if (silent) { + memset(frame, 0x00, GSM_FR_BYTES); + frame[0] = 0xd0; + goto leave; + } + + /* Convert back to packed byte form */ + len = bitvec_pack(frame_bitvec, frame); + if (len != GSM_FR_BYTES) { + rc = -EIO; + goto leave; + } + +leave: + bitvec_free(frame_bitvec); + return rc; +} + +/** + * To be called when a good frame is received. + * This function will then create a backup of the frame + * and reset the internal state. + */ +void osmo_ecu_fr_reset(struct osmo_ecu_fr_state *state, uint8_t *frame) +{ + state->subsequent_lost_frame = false; + memcpy(state->frame_backup, frame, GSM_FR_BYTES); +} + +/** + * To be called when a bad frame is received. + * This function will then generate a replacement frame + * that can be used to conceal the dropout. + */ +int osmo_ecu_fr_conceal(struct osmo_ecu_fr_state *state, uint8_t *frame) +{ + int rc; + + /* For subsequent frames we run the error concealment + * functions on the backed up frame before we restore + * the backup */ + if (state->subsequent_lost_frame) { + rc = conceal_frame(state->frame_backup); + if (rc) + return rc; + } + + /* Restore the backed up frame and set flag in case + * we receive even more bad frames */ + memcpy(frame, state->frame_backup, GSM_FR_BYTES); + state->subsequent_lost_frame = true; + + return 0; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 78542b2..877a302 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -17,7 +17,8 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test gsm23003/gsm23003_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test \ + codec/codec_ecu_fr_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -136,6 +137,9 @@ codec_codec_test_SOURCES = codec/codec_test.c codec_codec_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la +codec_codec_ecu_fr_test_SOURCES = codec/codec_ecu_fr_test.c +codec_codec_ecu_fr_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la + loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c loggingrb_loggingrb_test_LDADD = $(LDADD) @@ -205,11 +209,13 @@ gsm0808/gsm0808_test.ok gb/bssgp_fc_tests.err \ gb/bssgp_fc_tests.ok gb/bssgp_fc_tests.sh \ gb/gprs_bssgp_test.ok gb/gprs_ns_test.ok gea/gea_test.ok \ - gprs/gprs_test.ok kasumi/kasumi_test.ok codec/codec_test.ok \ + gprs/gprs_test.ok kasumi/kasumi_test.ok \ msgfile/msgfile_test.ok msgfile/msgconfig.cfg \ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ + codec/codec_test.ok \ + codec/codec_ecu_fr_test.ok \ vty/vty_test.ok \ vty/fail_not_de-indented.cfg \ vty/fail_tabs_and_spaces.cfg \ diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c new file mode 100644 index 0000000..0fdc489 --- /dev/null +++ b/tests/codec/codec_ecu_fr_test.c @@ -0,0 +1,146 @@ +#include +#include +#include + +#include +#include + +#include +#include + +/* Set with sample full-rate voice frames and some intentional dropouts */ +static const char *fr_frames_hex[] = { + "d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723", + "d8eb83699a66c036ec89b7246e6034dc8d48948620589b7256e3a6603b2371b8da", + "d967abaa1cbe4035238da6ace4c036d46ec69ba600391c4eb8a2b040591c6a3924", + "d8e8a42662c240472469b91bd2e0452291b6dba600495b8e38dcb020491a71c91b", + "da2aac1ddbb00036e46e26dcec6039138db923822047137248e3560048e38dc8e3", + "d929ab2a9b5240395b6dc72ba020469c8d551c5440349c9148e36a4036a372471b", + "d9eb93215bb8a0271c69c724682036db71c71a94a0372491b72bee4044eb71b923", + "d9ab9aa19abc40391b6e5ae2ee40471b91c6dbe820492291b8e4b84036e47238db", + "d96b9be9db782044e371b55cb200389491c69b8ea034e271c8d3808038ec6db8e3", + "d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd", + "BAD", + "d9ea9c219ce60046e38d3724e0c034e56e36eb7e0038d471b8dcb260491b8dbb23", + "d9e89be9d9e0a0391b6dd6a4624029247138e3a2a04713922524de0036db69d91c", + "d9699422a2b6a048dd90c91c6a802b6259395c8880575b4a58e4ac20269d7248d4", + "d967ac5b1baae0371c71b8ab9c804a9e8e58a55a8038626ec8dcb640395c7244dc", + "d9e8a3e262e68027638db52b88a038634e471a7ec049136e3b1bc8402923adcad2", + "d8eab36e1bbe0046e34d491b608035137658d3524044e48e375cdac0472b9238d4", + "d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b", + "BAD", + "BAD", + "d8e6a2e1d3d2605b1376c8d35280392451391cbc80392a71b6db8aa049238dc8ab", + "d9a87ba1a3982048eb8a471cac00472b4e391bbc40292489b71cc200495b8d3ae3", + "d9278b2a1ba4c0475b8dc722d6e0491b5228da70204ae36dc71d94a056a29236e3", + "d9ec9be2129520392335598c50c04b5bad3d4ba680789b69df5a5aa0469cd1b4da", + "d8ea932623e660669b8e4a9dd8a03aa32a76e466e028d396cc9bbe4047256dc8e5", + "d96a94215aa0403aab713f22e8e024e68db91ab6a027abd1a55b6e804aec9146e4", + "d867ac21e270a0350d6ac91a724037247246d2a6c0396c89d6dc562049244e48d5", + "d8a9b460d3b48026a4ad471b7c20452491b69bbc803ae48db722ee00292491a8db", + "d928a3e1d3b24036e37244abf02047634d371b74c047637148a29ac03b234e38e3", + "d9ab9b21d2e0c0471c693aec54e044dbae46dc7c20391badb724ee8038e469bb15", + "d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963", + "BAD", + "BAD", + "BAD", + "BAD", + "BAD", + "BAD", + "d92c8b6d5aee4034ebb22724862047145634a5c0a038e371b8e4a880485c89dd25", + "d8e78b29e3c6c038dba9d91beca04723ad491cda80471471b6ec7ae03b1396b91b", + "d8a78b25e37a0022dd8a46dc68a0351bad391bde2046e56dd8dc96c038e396d89b", + "d8a88c255ab6e038e38e48dbde8038ad8dc8db8ec0376372b564b44038e49234dc", + "d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3", + "d8ee9bea5ae4003ae371b713eae05adc91995a5ea064dcc9571e786026ed51c52c", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d92aab696190c046e26e392cae0026a376a8dc662048d291b75b54c04ad3ae3b1b", + "d8e7a469627a6038e289cb1baca0569b8db6dddec026dc8e38e5dc803722722d23", + "d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713", + "BAD", + "d7299c19a3be8024e58ea7a49f20a522963ad976e0a76ecd92b38500cb62aa4c94", + "d7eb6c6262eee02b2c42e79a60a0aa55aed68a7f00ad358e10fad960e55a39396d", + "d970858dd2ab61d91355ebc15ca1a6a7ca48a05cc0dae66f2523c2a1bad3825daa", + "d8f0844a23ad20da50d6de025e81c37392b9039cc0c764c1bd1e94c1b699736a98", + "d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d2577a1cda50004924924924500049249249245000492492492450004923924924", + NULL +}; + +/* Example of a good frame */ +static const char *sample_frame_hex = \ + "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da"; + +/** + * Start with a good voice frame and then simulate 20 consecutive bad frames, + * watching how the error concealment decreases the XMAXC parameters. + */ +void test_fr_concealment(void) +{ + struct osmo_ecu_fr_state state; + uint8_t frame[GSM_FR_BYTES]; + int i, rc; + + /* Parse frame from string to hex */ + osmo_hexparse(sample_frame_hex, frame, GSM_FR_BYTES); + + printf("Start with: %s\n", sample_frame_hex); + + /* Reset the ECU with the proposed known good frame */ + osmo_ecu_fr_reset(&state, frame); + + /* Now pretend that we do not receive any good frames anymore */ + for (i = 0; i < 20; i++) { + rc = osmo_ecu_fr_conceal(&state, frame); + OSMO_ASSERT(rc == 0); + + printf("conceal: %02i, result: %s\n", + i, osmo_hexdump_nospc(frame, GSM_FR_BYTES)); + } +} + +/* Simulate a real life situation: voice frames with a few dropouts */ +void test_fr_concealment_realistic() +{ + struct osmo_ecu_fr_state state; + uint8_t frame[GSM_FR_BYTES]; + unsigned int frame_len; + int rc, i = 0; + + while (fr_frames_hex[i] != NULL) { + /* Debug print */ + printf("Frame No. %03i:\n", i); + + /* Good or bad frame? */ + frame_len = strlen(fr_frames_hex[i]) / 2; + if (frame_len == GSM_FR_BYTES) { + printf(" * input: %s\n", fr_frames_hex[i]); + osmo_hexparse(fr_frames_hex[i], frame, GSM_FR_BYTES); + osmo_ecu_fr_reset(&state, frame); + } else { + printf(" * input: (bad)\n"); + memset(frame, 0x00, GSM_FR_BYTES); + rc = osmo_ecu_fr_conceal(&state, frame); + OSMO_ASSERT(rc == 0); + } + + /* Print result */ + printf(" * output: %s\n", + osmo_hexdump_nospc(frame, GSM_FR_BYTES)); + + /* Go to the next frame */ + i++; + } +} + +int main(int argc, char **argv) +{ + /* Perform actual tests */ + test_fr_concealment(); + test_fr_concealment_realistic(); + + return 0; +} diff --git a/tests/codec/codec_ecu_fr_test.ok b/tests/codec/codec_ecu_fr_test.ok new file mode 100644 index 0000000..6e20099 --- /dev/null +++ b/tests/codec/codec_ecu_fr_test.ok @@ -0,0 +1,192 @@ +Start with: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da +conceal: 00, result: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da +conceal: 01, result: d9ec9be212901d802335598c501d805bad3d4ba01d809b69df5a501d809cd1b4da +conceal: 02, result: d9ec9be212901b802335598c501b805bad3d4ba01b809b69df5a501b809cd1b4da +conceal: 03, result: d9ec9be2129019802335598c5019805bad3d4ba019809b69df5a5019809cd1b4da +conceal: 04, result: d9ec9be2129017802335598c5017805bad3d4ba017809b69df5a5017809cd1b4da +conceal: 05, result: d9ec9be2129015802335598c5015805bad3d4ba015809b69df5a5015809cd1b4da +conceal: 06, result: d9ec9be2129013802335598c5013805bad3d4ba013809b69df5a5013809cd1b4da +conceal: 07, result: d9ec9be2129011802335598c5011805bad3d4ba011809b69df5a5011809cd1b4da +conceal: 08, result: d9ec9be212900f802335598c500f805bad3d4ba00f809b69df5a500f809cd1b4da +conceal: 09, result: d9ec9be212900d802335598c500d805bad3d4ba00d809b69df5a500d809cd1b4da +conceal: 10, result: d9ec9be212900b802335598c500b805bad3d4ba00b809b69df5a500b809cd1b4da +conceal: 11, result: d9ec9be2129009802335598c5009805bad3d4ba009809b69df5a5009809cd1b4da +conceal: 12, result: d9ec9be2129007802335598c5007805bad3d4ba007809b69df5a5007809cd1b4da +conceal: 13, result: d9ec9be2129005802335598c5005805bad3d4ba005809b69df5a5005809cd1b4da +conceal: 14, result: d9ec9be2129003802335598c5003805bad3d4ba003809b69df5a5003809cd1b4da +conceal: 15, result: d9ec9be2129001802335598c5001805bad3d4ba001809b69df5a5001809cd1b4da +conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 +conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 +conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 +conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 000: + * input: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 + * output: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 +Frame No. 001: + * input: d8eb83699a66c036ec89b7246e6034dc8d48948620589b7256e3a6603b2371b8da + * output: d8eb83699a66c036ec89b7246e6034dc8d48948620589b7256e3a6603b2371b8da +Frame No. 002: + * input: d967abaa1cbe4035238da6ace4c036d46ec69ba600391c4eb8a2b040591c6a3924 + * output: d967abaa1cbe4035238da6ace4c036d46ec69ba600391c4eb8a2b040591c6a3924 +Frame No. 003: + * input: d8e8a42662c240472469b91bd2e0452291b6dba600495b8e38dcb020491a71c91b + * output: d8e8a42662c240472469b91bd2e0452291b6dba600495b8e38dcb020491a71c91b +Frame No. 004: + * input: da2aac1ddbb00036e46e26dcec6039138db923822047137248e3560048e38dc8e3 + * output: da2aac1ddbb00036e46e26dcec6039138db923822047137248e3560048e38dc8e3 +Frame No. 005: + * input: d929ab2a9b5240395b6dc72ba020469c8d551c5440349c9148e36a4036a372471b + * output: d929ab2a9b5240395b6dc72ba020469c8d551c5440349c9148e36a4036a372471b +Frame No. 006: + * input: d9eb93215bb8a0271c69c724682036db71c71a94a0372491b72bee4044eb71b923 + * output: d9eb93215bb8a0271c69c724682036db71c71a94a0372491b72bee4044eb71b923 +Frame No. 007: + * input: d9ab9aa19abc40391b6e5ae2ee40471b91c6dbe820492291b8e4b84036e47238db + * output: d9ab9aa19abc40391b6e5ae2ee40471b91c6dbe820492291b8e4b84036e47238db +Frame No. 008: + * input: d96b9be9db782044e371b55cb200389491c69b8ea034e271c8d3808038ec6db8e3 + * output: d96b9be9db782044e371b55cb200389491c69b8ea034e271c8d3808038ec6db8e3 +Frame No. 009: + * input: d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd + * output: d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd +Frame No. 010: + * input: (bad) + * output: d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd +Frame No. 011: + * input: d9ea9c219ce60046e38d3724e0c034e56e36eb7e0038d471b8dcb260491b8dbb23 + * output: d9ea9c219ce60046e38d3724e0c034e56e36eb7e0038d471b8dcb260491b8dbb23 +Frame No. 012: + * input: d9e89be9d9e0a0391b6dd6a4624029247138e3a2a04713922524de0036db69d91c + * output: d9e89be9d9e0a0391b6dd6a4624029247138e3a2a04713922524de0036db69d91c +Frame No. 013: + * input: d9699422a2b6a048dd90c91c6a802b6259395c8880575b4a58e4ac20269d7248d4 + * output: d9699422a2b6a048dd90c91c6a802b6259395c8880575b4a58e4ac20269d7248d4 +Frame No. 014: + * input: d967ac5b1baae0371c71b8ab9c804a9e8e58a55a8038626ec8dcb640395c7244dc + * output: d967ac5b1baae0371c71b8ab9c804a9e8e58a55a8038626ec8dcb640395c7244dc +Frame No. 015: + * input: d9e8a3e262e68027638db52b88a038634e471a7ec049136e3b1bc8402923adcad2 + * output: d9e8a3e262e68027638db52b88a038634e471a7ec049136e3b1bc8402923adcad2 +Frame No. 016: + * input: d8eab36e1bbe0046e34d491b608035137658d3524044e48e375cdac0472b9238d4 + * output: d8eab36e1bbe0046e34d491b608035137658d3524044e48e375cdac0472b9238d4 +Frame No. 017: + * input: d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b + * output: d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b +Frame No. 018: + * input: (bad) + * output: d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b +Frame No. 019: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 020: + * input: d8e6a2e1d3d2605b1376c8d35280392451391cbc80392a71b6db8aa049238dc8ab + * output: d8e6a2e1d3d2605b1376c8d35280392451391cbc80392a71b6db8aa049238dc8ab +Frame No. 021: + * input: d9a87ba1a3982048eb8a471cac00472b4e391bbc40292489b71cc200495b8d3ae3 + * output: d9a87ba1a3982048eb8a471cac00472b4e391bbc40292489b71cc200495b8d3ae3 +Frame No. 022: + * input: d9278b2a1ba4c0475b8dc722d6e0491b5228da70204ae36dc71d94a056a29236e3 + * output: d9278b2a1ba4c0475b8dc722d6e0491b5228da70204ae36dc71d94a056a29236e3 +Frame No. 023: + * input: d9ec9be2129520392335598c50c04b5bad3d4ba680789b69df5a5aa0469cd1b4da + * output: d9ec9be2129520392335598c50c04b5bad3d4ba680789b69df5a5aa0469cd1b4da +Frame No. 024: + * input: d8ea932623e660669b8e4a9dd8a03aa32a76e466e028d396cc9bbe4047256dc8e5 + * output: d8ea932623e660669b8e4a9dd8a03aa32a76e466e028d396cc9bbe4047256dc8e5 +Frame No. 025: + * input: d96a94215aa0403aab713f22e8e024e68db91ab6a027abd1a55b6e804aec9146e4 + * output: d96a94215aa0403aab713f22e8e024e68db91ab6a027abd1a55b6e804aec9146e4 +Frame No. 026: + * input: d867ac21e270a0350d6ac91a724037247246d2a6c0396c89d6dc562049244e48d5 + * output: d867ac21e270a0350d6ac91a724037247246d2a6c0396c89d6dc562049244e48d5 +Frame No. 027: + * input: d8a9b460d3b48026a4ad471b7c20452491b69bbc803ae48db722ee00292491a8db + * output: d8a9b460d3b48026a4ad471b7c20452491b69bbc803ae48db722ee00292491a8db +Frame No. 028: + * input: d928a3e1d3b24036e37244abf02047634d371b74c047637148a29ac03b234e38e3 + * output: d928a3e1d3b24036e37244abf02047634d371b74c047637148a29ac03b234e38e3 +Frame No. 029: + * input: d9ab9b21d2e0c0471c693aec54e044dbae46dc7c20391badb724ee8038e469bb15 + * output: d9ab9b21d2e0c0471c693aec54e044dbae46dc7c20391badb724ee8038e469bb15 +Frame No. 030: + * input: d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963 + * output: d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963 +Frame No. 031: + * input: (bad) + * output: d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963 +Frame No. 032: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 033: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 034: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 035: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 036: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 037: + * input: d92c8b6d5aee4034ebb22724862047145634a5c0a038e371b8e4a880485c89dd25 + * output: d92c8b6d5aee4034ebb22724862047145634a5c0a038e371b8e4a880485c89dd25 +Frame No. 038: + * input: d8e78b29e3c6c038dba9d91beca04723ad491cda80471471b6ec7ae03b1396b91b + * output: d8e78b29e3c6c038dba9d91beca04723ad491cda80471471b6ec7ae03b1396b91b +Frame No. 039: + * input: d8a78b25e37a0022dd8a46dc68a0351bad391bde2046e56dd8dc96c038e396d89b + * output: d8a78b25e37a0022dd8a46dc68a0351bad391bde2046e56dd8dc96c038e396d89b +Frame No. 040: + * input: d8a88c255ab6e038e38e48dbde8038ad8dc8db8ec0376372b564b44038e49234dc + * output: d8a88c255ab6e038e38e48dbde8038ad8dc8db8ec0376372b564b44038e49234dc +Frame No. 041: + * input: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 + * output: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 +Frame No. 042: + * input: d8ee9bea5ae4003ae371b713eae05adc91995a5ea064dcc9571e786026ed51c52c + * output: d8ee9bea5ae4003ae371b713eae05adc91995a5ea064dcc9571e786026ed51c52c +Frame No. 043: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 044: + * input: d92aab696190c046e26e392cae0026a376a8dc662048d291b75b54c04ad3ae3b1b + * output: d92aab696190c046e26e392cae0026a376a8dc662048d291b75b54c04ad3ae3b1b +Frame No. 045: + * input: d8e7a469627a6038e289cb1baca0569b8db6dddec026dc8e38e5dc803722722d23 + * output: d8e7a469627a6038e289cb1baca0569b8db6dddec026dc8e38e5dc803722722d23 +Frame No. 046: + * input: d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713 + * output: d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713 +Frame No. 047: + * input: (bad) + * output: d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713 +Frame No. 048: + * input: d7299c19a3be8024e58ea7a49f20a522963ad976e0a76ecd92b38500cb62aa4c94 + * output: d7299c19a3be8024e58ea7a49f20a522963ad976e0a76ecd92b38500cb62aa4c94 +Frame No. 049: + * input: d7eb6c6262eee02b2c42e79a60a0aa55aed68a7f00ad358e10fad960e55a39396d + * output: d7eb6c6262eee02b2c42e79a60a0aa55aed68a7f00ad358e10fad960e55a39396d +Frame No. 050: + * input: d970858dd2ab61d91355ebc15ca1a6a7ca48a05cc0dae66f2523c2a1bad3825daa + * output: d970858dd2ab61d91355ebc15ca1a6a7ca48a05cc0dae66f2523c2a1bad3825daa +Frame No. 051: + * input: d8f0844a23ad20da50d6de025e81c37392b9039cc0c764c1bd1e94c1b699736a98 + * output: d8f0844a23ad20da50d6de025e81c37392b9039cc0c764c1bd1e94c1b699736a98 +Frame No. 052: + * input: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 + * output: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 +Frame No. 053: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 054: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 055: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 056: + * input: d2577a1cda50004924924924500049249249245000492492492450004923924924 + * output: d2577a1cda50004924924924500049249249245000492492492450004923924924 diff --git a/tests/testsuite.at b/tests/testsuite.at index 81730ee..0ec852c 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -157,6 +157,12 @@ AT_CHECK([$abs_top_builddir/tests/codec/codec_test], [0], [expout], [ignore]) AT_CLEANUP +AT_SETUP([codec_ecu_fr]) +AT_KEYWORDS([codec_ecu_fr]) +cat $abs_srcdir/codec/codec_ecu_fr_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/codec/codec_ecu_fr_test], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([fr]) AT_KEYWORDS([fr]) cat $abs_srcdir/fr/fr_test.ok > expout -- To view, visit https://gerrit.osmocom.org/5421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 10 11:39:55 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 11:39:55 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: perform error concealment for FR frames 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/5214 to look at the new patch set (#9). osmo-bts-trx: perform error concealment for FR frames When a bad voice frame is received, it is replaced by a silence frame. This may cause unpleasant audio effects. This change implements a functionality to craft a replacement frame from the last known good frame using ECU implementation from libosmocodec. At the moment, only FR is supported. Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6 Depends-On: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 --- M include/osmo-bts/gsm_data_shared.h M src/osmo-bts-trx/scheduler_trx.c 2 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/5214/9 diff --git a/include/osmo-bts/gsm_data_shared.h b/include/osmo-bts/gsm_data_shared.h index 31198fc..404299d 100644 --- a/include/osmo-bts/gsm_data_shared.h +++ b/include/osmo-bts/gsm_data_shared.h @@ -5,6 +5,7 @@ #include #include +#include #include #include #include @@ -345,6 +346,9 @@ } ms_power_ctrl; struct msgb *pending_rel_ind_msg; + + /* ECU (Error Correction Unit) state */ + struct osmo_ecu_fr_state ecu_fr_state; }; enum { diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index d3928f1..0e9f342 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -968,6 +969,7 @@ uint8_t tch_data[128]; /* just to be safe */ int rc, amr = 0; int n_errors, n_bits_total; + bool bfi_flag = false; struct gsm_lchan *lchan = get_lchan_by_chan_nr(l1t->trx, trx_chan_desc[chan].chan_nr | tn); @@ -1058,11 +1060,13 @@ if (rc < 0) { LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, "Received bad data (%u/%u)\n", fn % l1ts->mf_period, l1ts->mf_period); + bfi_flag = true; goto bfi; } if (rc < 4) { LOGL1S(DL1P, LOGL_NOTICE, l1t, tn, chan, fn, "Received bad data (%u/%u) " "with invalid codec mode %d\n", fn % l1ts->mf_period, l1ts->mf_period, rc); + bfi_flag = true; goto bfi; } @@ -1079,8 +1083,14 @@ case GSM48_CMODE_SPEECH_V1: /* FR */ if (lchan->tch.dtx.ul_sid) return 0; /* DTXu: pause in progress */ - memset(tch_data, 0, GSM_FR_BYTES); - tch_data[0] = 0xd0; + + /* Perform error correction if possible */ + rc = osmo_ecu_fr_conceal(&lchan->ecu_fr_state, tch_data); + if (rc) { + memset(tch_data, 0, GSM_FR_BYTES); + tch_data[0] = 0xd0; + } + rc = GSM_FR_BYTES; break; case GSM48_CMODE_SPEECH_EFR: /* EFR */ @@ -1108,6 +1118,10 @@ if (rsl_cmode != RSL_CMOD_SPD_SPEECH) return 0; + /* Reset ECU with a good frame */ + if (!bfi_flag && tch_mode == GSM48_CMODE_SPEECH_V1) + osmo_ecu_fr_reset(&lchan->ecu_fr_state, tch_data); + /* TCH or BFI */ return _sched_compose_tch_ind(l1t, tn, (fn + GSM_HYPERFRAME - 7) % GSM_HYPERFRAME, chan, tch_data, rc); -- To view, visit https://gerrit.osmocom.org/5214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6 Gerrit-PatchSet: 9 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 Wed Jan 10 12:06:15 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 12:06:15 +0000 Subject: [PATCH] osmo-bsc[master]: bsc/gsm_04_80.h: clean up useless declarations Message-ID: Review at https://gerrit.osmocom.org/5725 bsc/gsm_04_80.h: clean up useless declarations This change removes a few USSD specific declarations, which are not actually used now, and probably accidentally nigrated from legacy OpenBSC. Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 --- M include/osmocom/bsc/gsm_04_80.h 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/25/5725/1 diff --git a/include/osmocom/bsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h index d65f640..66b9d3e 100644 --- a/include/osmocom/bsc/gsm_04_80.h +++ b/include/osmocom/bsc/gsm_04_80.h @@ -1,22 +1,7 @@ #ifndef _GSM_04_80_H #define _GSM_04_80_H -#include -#include -#include - struct gsm_subscriber_connection; - -int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); -int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, - const struct ss_request *request); - -int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, - const char *text); -int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); -- To view, visit https://gerrit.osmocom.org/5725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:09:44 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 12:09:44 +0000 Subject: [PATCH] osmo-bsc[master]: bsc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: bsc/gsm_04_80.h: clean up useless declarations This change removes a few USSD specific declarations, which are not actually used now, and probably accidentally migrated from legacy OpenBSC. Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 --- M include/osmocom/bsc/gsm_04_80.h 1 file changed, 0 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/25/5725/2 diff --git a/include/osmocom/bsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h index d65f640..66b9d3e 100644 --- a/include/osmocom/bsc/gsm_04_80.h +++ b/include/osmocom/bsc/gsm_04_80.h @@ -1,22 +1,7 @@ #ifndef _GSM_04_80_H #define _GSM_04_80_H -#include -#include -#include - struct gsm_subscriber_connection; - -int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); -int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, - const struct ss_request *request); - -int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, - const char *text); -int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); -- To view, visit https://gerrit.osmocom.org/5725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:22:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 12:22:40 +0000 Subject: [PATCH] osmo-pcu[master]: Rewrite EGPRS Packet Uplink Assignment Message-ID: Review at https://gerrit.osmocom.org/5726 Rewrite EGPRS Packet Uplink Assignment Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ?10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. Reusable fragments are split into static helpers. Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Related: OS#1526 --- M src/encoding.cpp 1 file changed, 117 insertions(+), 55 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/26/5726/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index 87c6f08..df84b69 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -36,6 +36,13 @@ #include #include +#define check(rc) { if (rc < 0) return rc; } +#define set_x(bv, x) { if (bitvec_set_bit(bv, x) < 0) return -EOWNERDEAD; } +#define set_0(bv) set_x(bv, ZERO) +#define set_1(bv) set_x(bv, ONE) +#define set_L(bv) set_x(bv, L) +#define set_H(bv) set_x(bv, H) + /* { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } */ static inline bool write_tai(bitvec *dest, unsigned& wp, int8_t tai) { @@ -86,6 +93,70 @@ write_ta(dest, wp, ta); if (write_tai(dest, wp, tai)) /* TIMING_ADVANCE_TIMESLOT_NUMBER: */ bitvec_write_field(dest, &wp, ts, 3); +} + +/* 3GPP TS 44.018 ? 10.5.2.16: + { 0 | 1 < ALPHA : bit (4) > } + < GAMMA : bit (5) > +*/ +static inline int write_alpha_gamma(bitvec *dest, uint8_t alpha, uint8_t gamma) +{ + int rc; + + if (alpha) { + set_1(dest); + rc = bitvec_set_u64(dest, alpha, 4, false); /* ALPHA */ + check(rc); + } else + set_0(dest); /* No ALPHA */ + + rc = bitvec_set_u64(dest, gamma, 5, false); /* GAMMA */ + check(rc); + + return 0; +} + +/* TBF_STARTING_TIME -- same as 3GPP TS 44.018 ?10.5.2.38 Starting Time without tag: */ +static inline int write_tbf_start_time(bitvec *dest, uint32_t fn) +{ + int rc; + + /* Set values according to 3GPP TS 44.018 Table 10.5.2.38.1 */ + rc = bitvec_set_u64(dest, (fn / (26 * 51)) % 32, 5, false); /* T1' */ + check(rc); + rc = bitvec_set_u64(dest, fn % 51, 6, false); /* T3 */ + check(rc); + rc = bitvec_set_u64(dest, fn % 26, 5, false); /* T2 */ + + return rc; +} + +/* 3GPP TS 44.018 ? 10.5.2.16: + < TFI_ASSIGNMENT : bit (5) > + < POLLING : bit > + 0 -- The value '1' was allocated in an earlier version of the protocol and shall not be used. + < USF: bit (3) > + < USF_GRANULARITY : bit > + { 0 | 1 < P0 : bit (4) > < PR_MODE : bit (1) > } +*/ +static inline int write_tfi_usf(bitvec *dest, const gprs_rlcmac_ul_tbf *tbf, uint8_t usf) +{ + int rc; + + rc = bitvec_set_u64(dest, tbf->tfi(), 5, false); /* TFI_ASSIGNMENT */ + check(rc); + + set_0(dest); /* POLLING -- no action is required from MS */ + + set_0(dest); /* '1' was allocated in an earlier spec version and shall not be used */ + + rc = bitvec_set_u64(dest, usf, 3, false); /* USF */ + check(rc); + set_0(dest); /* USF_GRANULARITY -- the mobile station shall transmit one RLC/MAC block */ + + set_0(dest); /* No P0 nor PR_MODE */ + + return 0; } static int write_ia_rest_downlink( @@ -185,68 +256,60 @@ return 0; } -static int write_ia_rest_egprs_uplink( - gprs_rlcmac_ul_tbf *tbf, - bitvec * dest, unsigned& wp, - uint8_t usf, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx, - enum ph_burst_type burst_type, uint16_t ra) +/* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets ::= EGPRS Packet Uplink Assignment */ +static inline int write_ia_rest_egprs_uplink(const gprs_rlcmac_ul_tbf *tbf, bitvec *dest, + uint8_t usf, uint32_t fn, + uint8_t alpha, uint8_t gamma, int8_t ta_idx, + enum ph_burst_type burst_type, uint16_t ra) { - uint8_t extended_ra = 0; + int rc; - extended_ra = (ra & 0x1F); + set_L(dest); set_H(dest); + set_0(dest); set_0(dest); /* 00 EGPRS Packet Uplink Assignment */ - bitvec_write_field(dest, &wp, 1, 2); /* LH */ - bitvec_write_field(dest, &wp, 0, 2); /* 0 EGPRS Uplink Assignment */ - bitvec_write_field(dest, &wp, extended_ra, 5); /* Extended RA */ - bitvec_write_field(dest, &wp, 0, 1); /* Access technology Request */ + rc = bitvec_set_u64(dest, ra & 0x1F, 5, false); /* Extended RA */ + check(rc); - if (tbf == NULL) { + set_0(dest); /* No Access Technologies Request */ - bitvec_write_field(dest, &wp, 0, 1); /* multiblock allocation */ + if (tbf) { + set_1(dest); /* Single Block Allocation */ - if (alpha) { - bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */ - bitvec_write_field(dest, &wp, alpha, 4); /* ALPHA */ - } else { - bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = no */ - } + rc = write_tfi_usf(dest, tbf, usf); + check(rc); - bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power contrl */ - bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5);/* T1' */ - bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ - bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ - bitvec_write_field(dest, &wp, 0, 2); /* Radio block allocation */ + /* 3GPP TS 44.060 ?12.10d EGPRS Modulation and coding Scheme description: */ + rc = bitvec_set_u64(dest, tbf->current_cs().to_num() - 1, 4, false); /* EGPRS CHANNEL_CODING_COMMAND */ + check(rc); - bitvec_write_field(dest, &wp, 0, 1); + rc = bitvec_set_bit(dest, (bit_value)tbf->tlli()); /* TLLI_BLOCK_CHANNEL_CODING */ + set_0(dest); /* No BEP_PERIOD2 */ + + /* Retransmitted RLC data blocks shall not be re-segmented: (see 3GPP TS 44.060 ?12.10e) */ + set_0(dest); /* RESEGMENT */ + + rc = bitvec_set_u64(dest, enc_ws(tbf->window_size()), 5, false); /* EGPRS Window Size */ + check(rc); + + rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ + check(rc); + + set_0(dest); /* No TIMING_ADVANCE_INDEX */ + set_0(dest); /* No TBF_STARTING_TIME */ + bitvec_set_bit(dest, L); /* No Additions for Rel-7 */ } else { - bitvec_write_field(dest, &wp, 1, 1); /* single block alloc */ - bitvec_write_field(dest, &wp, tbf->tfi(), 5);/* TFI assignment */ - bitvec_write_field(dest, &wp, 0, 1); /* polling bit */ - bitvec_write_field(dest, &wp, 0, 1); /* constant */ - bitvec_write_field(dest, &wp, usf, 3); /* USF bit */ - bitvec_write_field(dest, &wp, 0, 1); /* USF granularity */ - bitvec_write_field(dest, &wp, 0, 1); /* P0 */ - /* MCS */ - bitvec_write_field(dest, &wp, tbf->current_cs().to_num()-1, 4); - /* tlli channel block */ - bitvec_write_field(dest, &wp, tbf->tlli(), 1); - bitvec_write_field(dest, &wp, 0, 1); /* BEP period present */ - bitvec_write_field(dest, &wp, 0, 1); /* resegmentation */ - write_ws(dest, &wp, tbf->window_size()); /* EGPRS window size */ + set_0(dest); /* Multi Block Allocation */ - if (alpha) { - bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */ - bitvec_write_field(dest, &wp, alpha, 4); /* ALPHA */ - } else { - bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = no */ - } + rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ + check(rc); - bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power contrl */ - bitvec_write_field(dest, &wp, 0, 1); /* TIMING_ADVANCE_INDEX */ - bitvec_write_field(dest, &wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ - bitvec_write_field(dest, &wp, 0, 1); /* NULL */ + rc = write_tbf_start_time(dest, fn); /* TBF_STARTING_TIME */ + check(rc); + + set_0(dest); /* NUMBER OF RADIO BLOCKS ALLOCATED: */ + set_0(dest); /* 1 radio block reserved for uplink transmission */ + set_0(dest); /* No P0 */ } return 0; @@ -402,11 +465,10 @@ polling, gsm48_ta_is_valid(ta), fn, alpha, gamma, ta_idx); else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || - (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) - rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, wp, - usf, fn, - alpha, gamma, ta_idx, burst_type, ra); - else + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + dest->cur_bit = wp; + rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx, burst_type, ra); + } else rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, wp, usf, fn, alpha, gamma, ta_idx); -- To view, visit https://gerrit.osmocom.org/5726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:22:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 12:22:45 +0000 Subject: [PATCH] osmo-pcu[master]: Rewrite Packet Downlink Assignment Message-ID: Review at https://gerrit.osmocom.org/5727 Rewrite Packet Downlink Assignment Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ?10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. The tests are adjusted accordingly. Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Related: OS#1526 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 108 insertions(+), 83 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/27/5727/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index df84b69..6ed323e 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -44,6 +44,21 @@ #define set_H(bv) set_x(bv, H) /* { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } */ +static inline int write_ta_index(bitvec *dest, int8_t tai) +{ + int rc; + + if (tai < 0) /* No TIMING_ADVANCE_INDEX: */ + set_0(dest); + + /* TIMING_ADVANCE_INDEX: */ + set_1(dest); + rc = bitvec_set_u64(dest, tai, 4, false); + check(rc); + + return 0; +} + static inline bool write_tai(bitvec *dest, unsigned& wp, int8_t tai) { if (tai < 0) { /* No TIMING_ADVANCE_INDEX: */ @@ -159,52 +174,58 @@ return 0; } -static int write_ia_rest_downlink( - gprs_rlcmac_dl_tbf *tbf, - bitvec * dest, unsigned& wp, - uint8_t polling, bool ta_valid, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx) +/* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets ::= Packet Downlink Assignment */ +static inline int write_ia_rest_downlink(const gprs_rlcmac_dl_tbf *tbf, bitvec *dest, + bool polling, bool ta_valid, uint32_t fn, + uint8_t alpha, uint8_t gamma, int8_t ta_idx) { - if (!tbf) { - LOGP(DRLCMACDL, LOGL_ERROR, - "Cannot encode DL IMMEDIATE ASSIGNMENT without TBF\n"); - return -EINVAL; - } - // GSM 04.08 10.5.2.16 IA Rest Octets - bitvec_write_field(dest, &wp, 3, 2); // "HH" - bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment - bitvec_write_field(dest, &wp,tbf->tlli(),32); // TLLI - bitvec_write_field(dest, &wp,0x1,1); // switch TFI : on - bitvec_write_field(dest, &wp,tbf->tfi(),5); // TFI - bitvec_write_field(dest, &wp,0x0,1); // RLC acknowledged mode - if (alpha) { - bitvec_write_field(dest, &wp,0x1,1); // ALPHA = present - bitvec_write_field(dest, &wp,alpha,4); // ALPHA - } else { - bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present - } - bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter - bitvec_write_field(dest, &wp,polling,1); // Polling Bit - bitvec_write_field(dest, &wp, ta_valid, 1); // N. B: NOT related to TAI! - write_tai(dest, wp, ta_idx); + int rc; + + set_H(dest); set_H(dest); + set_0(dest); set_1(dest); /* 00 Packet Downlink Assignment */ + + rc = bitvec_set_u64(dest, tbf->tlli(), 32, false); /* TLLI */ + check(rc); + + set_1(dest); + rc = bitvec_set_u64(dest, tbf->tfi(), 5, false); /* TFI_ASSIGNMENT */ + check(rc); + + /* RLC acknowledged mode */ + set_0(dest); /* RLC_MODE */ + + rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ + check(rc); + + rc = bitvec_set_bit(dest, (bit_value)polling); /* POLLING */ + check(rc); + + /* N. B: NOT related to TAI! */ + rc = bitvec_set_bit(dest, (bit_value)ta_valid); /* TA_VALID */ + check(rc); + + rc = write_ta_index(dest, ta_idx); + check(rc); + if (polling) { - bitvec_write_field(dest, &wp,0x1,1); // TBF Starting TIME present - bitvec_write_field(dest, &wp,(fn / (26 * 51)) % 32,5); // T1' - bitvec_write_field(dest, &wp,fn % 51,6); // T3 - bitvec_write_field(dest, &wp,fn % 26,5); // T2 - } else { - bitvec_write_field(dest, &wp,0x0,1); // TBF Starting TIME present - } - bitvec_write_field(dest, &wp,0x0,1); // P0 not present - // bitvec_write_field(dest, &wp,0x1,1); // P0 not present - // bitvec_write_field(dest, &wp,,0xb,4); + set_1(dest); + rc = write_tbf_start_time(dest, fn); /* TBF_STARTING_TIME */ + check(rc); + } else + set_0(dest); /* No TBF_STARTING_TIME */ + + set_0(dest); /* No P0 nor PR_MODE */ + if (tbf->is_egprs_enabled()) { - /* see GMS 44.018, 10.5.2.16 */ - bitvec_write_field(dest, &wp, 1, 1); // "H" - write_ws(dest, &wp, tbf->window_size()); // EGPRS Window Size - bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE - bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present - } + set_H(dest); + rc = bitvec_set_u64(dest, enc_ws(tbf->window_size()), 5, false); /* EGPRS Window Size */ + check(rc); + + /* The mobile station shall not report measurements: (see 3GPP TS 44.060 Table 11.2.7.1) */ + set_0(dest); set_0(dest); /* LINK_QUALITY_MEASUREMENT_MODE */ + set_1(dest); /* No BEP_PERIOD2 */ + } else + set_L(dest); /* No Additions for Rel-6 */ return 0; } @@ -460,11 +481,15 @@ plen = wp / 8; - if (downlink) - rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, wp, - polling, gsm48_ta_is_valid(ta), fn, - alpha, gamma, ta_idx); - else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + if (downlink) { + if (!as_dl_tbf(tbf)) { + LOGP(DRLCMACDL, LOGL_ERROR, "Cannot encode DL IMMEDIATE ASSIGNMENT without TBF\n"); + return -EINVAL; + } + dest->cur_bit = wp; + rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, polling, gsm48_ta_is_valid(ta), fn, + alpha, gamma, ta_idx); + } else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { dest->cur_bit = wp; rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx, burst_type, ra); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 3ed8678..46045bf 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -625,7 +625,7 @@ TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -651,7 +651,7 @@ TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 0f 8b 2b 2b 2b TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -677,7 +677,7 @@ TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 0f 8b 2b 2b 2b TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -703,7 +703,7 @@ TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 0f 8b 2b 2b 2b TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -729,7 +729,7 @@ TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 0f 8b 2b 2b 2b TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -755,7 +755,7 @@ TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 0f 8b 2b 2b 2b TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -781,7 +781,7 @@ TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 0f 8b 2b 2b 2b TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -807,7 +807,7 @@ TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 0f 8b 2b 2b 2b TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -833,7 +833,7 @@ TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 0f 8b 2b 2b 2b TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -859,7 +859,7 @@ TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 0f 8b 2b 2b 2b TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -885,7 +885,7 @@ TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 0f 8b 2b 2b 2b TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -911,7 +911,7 @@ TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 0f 8b 2b 2b 2b TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -937,7 +937,7 @@ TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 0f 8b 2b 2b 2b TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -963,7 +963,7 @@ TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 0f 8b 2b 2b 2b TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -989,7 +989,7 @@ TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 0f 8b 2b 2b 2b TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1015,7 +1015,7 @@ TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 0f 8b 2b 2b 2b TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1041,7 +1041,7 @@ TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 0f 8b 2b 2b 2b TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1067,7 +1067,7 @@ TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 0f 8b 2b 2b 2b TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1093,7 +1093,7 @@ TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 0f 8b 2b 2b 2b TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1119,7 +1119,7 @@ TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 0f 8b 2b 2b 2b TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1145,7 +1145,7 @@ TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 0f 8b 2b 2b 2b TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1171,7 +1171,7 @@ TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 0f 8b 2b 2b 2b TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1197,7 +1197,7 @@ TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 0f 8b 2b 2b 2b TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1223,7 +1223,7 @@ TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 0f 8b 2b 2b 2b TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1249,7 +1249,7 @@ TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 0f 8b 2b 2b 2b TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1275,7 +1275,7 @@ TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 0f 8b 2b 2b 2b TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1301,7 +1301,7 @@ TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 0f 8b 2b 2b 2b TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1327,7 +1327,7 @@ TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 0f 8b 2b 2b 2b TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1353,7 +1353,7 @@ TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 0f 8b 2b 2b 2b TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1379,7 +1379,7 @@ TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 0f 8b 2b 2b 2b TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1405,7 +1405,7 @@ TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 0f 8b 2b 2b 2b TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1431,7 +1431,7 @@ TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 0f 8b 2b 2b 2b TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1465,7 +1465,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes Modifying MS object, TLLI = 0xc0123456, TA 220 -> 0 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes @@ -1494,7 +1494,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 23 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==0) - Sending new block at BSN 0, CS=CS-1 @@ -1608,7 +1608,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=7 TA=7 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: -- To view, visit https://gerrit.osmocom.org/5727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:22:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 12:22:45 +0000 Subject: [PATCH] osmo-pcu[master]: Rewrite Packet Uplink Assignment Message-ID: Review at https://gerrit.osmocom.org/5728 Rewrite Packet Uplink Assignment Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ?10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. The tests are adjusted accordingly. Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3 Related: OS#1526 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 63 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/28/5728/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index 6ed323e..636e1c3 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -230,50 +230,51 @@ return 0; } -static int write_ia_rest_uplink( - gprs_rlcmac_ul_tbf *tbf, - bitvec * dest, unsigned& wp, - uint8_t usf, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx) +/* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets ::= Packet Uplink Assignment */ +static inline int write_ia_rest_uplink(const gprs_rlcmac_ul_tbf *tbf, bitvec * dest, + uint8_t usf, uint32_t fn, uint8_t alpha, uint8_t gamma, int8_t ta_idx) { - OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); + int rc; - // GMS 04.08 10.5.2.37b 10.5.2.16 - bitvec_write_field(dest, &wp, 3, 2); // "HH" - bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment - if (tbf == NULL) { - bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation - if (alpha) { - bitvec_write_field(dest, &wp,0x1,1); // ALPHA = present - bitvec_write_field(dest, &wp,alpha,4); // ALPHA = present - } else - bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present - bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter - write_tai(dest, wp, ta_idx); - bitvec_write_field(dest, &wp, 1, 1); // TBF_STARTING_TIME_FLAG - bitvec_write_field(dest, &wp,(fn / (26 * 51)) % 32,5); // T1' - bitvec_write_field(dest, &wp,fn % 51,6); // T3 - bitvec_write_field(dest, &wp,fn % 26,5); // T2 + set_H(dest); set_H(dest); + set_0(dest); set_0(dest); /* 00 Packet Uplink Assignment */ + + if (tbf) { + set_1(dest); /* Multi Block Allocation */ + + rc = write_tfi_usf(dest, tbf, usf); + check(rc); + + /* 3GPP TS 44.060 Table 11.2.28.2 Channel Coding Indicator */ + rc = bitvec_set_u64(dest, tbf->current_cs().to_num() - 1, 2, false); /* CHANNEL_CODING_COMMAND */ + check(rc); + + rc = bitvec_set_bit(dest, (bit_value)tbf->tlli()); /* TLLI_BLOCK_CHANNEL_CODING */ + check(rc); + + rc = write_alpha_gamma(dest, alpha, gamma); + check(rc); + + set_0(dest); /* No TIMING_ADVANCE_INDEX */ + set_0(dest); /* No TBF_STARTING_TIME */ } else { - bitvec_write_field(dest, &wp, 1, 1); // Block Allocation : Not Single Block Allocation - bitvec_write_field(dest, &wp, tbf->tfi(), 5); // TFI_ASSIGNMENT Temporary Flow Identity - bitvec_write_field(dest, &wp, 0, 1); // POLLING - bitvec_write_field(dest, &wp, 0, 1); // ALLOCATION_TYPE: dynamic - bitvec_write_field(dest, &wp, usf, 3); // USF - bitvec_write_field(dest, &wp, 0, 1); // USF_GRANULARITY - bitvec_write_field(dest, &wp, 0, 1); // "0" power control: Not Present - bitvec_write_field(dest, &wp, tbf->current_cs().to_num()-1, 2); // CHANNEL_CODING_COMMAND - bitvec_write_field(dest, &wp, 1, 1); // TLLI_BLOCK_CHANNEL_CODING - if (alpha) { - bitvec_write_field(dest, &wp,0x1,1); // ALPHA = present - bitvec_write_field(dest, &wp,alpha,4); // ALPHA - } else - bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present - bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter - /* note: there is no choise for TAI and no starting time */ - bitvec_write_field(dest, &wp, 0, 1); // switch TIMING_ADVANCE_INDEX = off - bitvec_write_field(dest, &wp, 0, 1); // TBF_STARTING_TIME_FLAG + set_0(dest); /* Single Block Allocation */ + rc = write_alpha_gamma(dest, alpha, gamma); + check(rc); + + /* A 'Timing Advance index' shall not be allocated at a Single Block allocation. + A 'TBF Starting Time' shall be allocated at a Single Block allocation. */ + set_0(dest); + set_1(dest); + + rc = write_tbf_start_time(dest, fn); /* TBF_STARTING_TIME */ + check(rc); + + set_L(dest); /* No P0 nor PR_MODE */ + set_L(dest); /* No Additions for R99 */ + set_L(dest); /* No Additions for Rel-6 */ } + return 0; } @@ -481,22 +482,21 @@ plen = wp / 8; + dest->cur_bit = wp; if (downlink) { if (!as_dl_tbf(tbf)) { LOGP(DRLCMACDL, LOGL_ERROR, "Cannot encode DL IMMEDIATE ASSIGNMENT without TBF\n"); return -EINVAL; } - dest->cur_bit = wp; rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, polling, gsm48_ta_is_valid(ta), fn, alpha, gamma, ta_idx); } else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || - (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { - dest->cur_bit = wp; + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx, burst_type, ra); - } else - rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, wp, - usf, fn, - alpha, gamma, ta_idx); + else { + OSMO_ASSERT(!as_ul_tbf(tbf) || !as_ul_tbf(tbf)->is_egprs_enabled()); + rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx); + } if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 46045bf..fcecf4f 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1561,7 +1561,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2195,7 +2195,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -6871,7 +6871,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6896,7 +6896,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6921,7 +6921,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6946,7 +6946,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6971,7 +6971,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6996,7 +6996,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -7021,7 +7021,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9054,7 +9054,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9079,7 +9079,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9104,7 +9104,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9129,7 +9129,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9154,7 +9154,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9179,7 +9179,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9204,7 +9204,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -- To view, visit https://gerrit.osmocom.org/5728 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:22:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 12:22:45 +0000 Subject: [PATCH] osmo-pcu[master]: Use Timing Advance Index in UL assignments Message-ID: Review at https://gerrit.osmocom.org/5729 Use Timing Advance Index in UL assignments Write TAI (if available) when generating Rest Octets for UL Assignment. This should not affect actual PCU behavior because TAI is not yet supported by upper layers but we have to adjust corresponding tests anyway. Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 22 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/5729/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index 636e1c3..aaa51e6 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -255,7 +255,9 @@ rc = write_alpha_gamma(dest, alpha, gamma); check(rc); - set_0(dest); /* No TIMING_ADVANCE_INDEX */ + rc = write_ta_index(dest, ta_idx); + check(rc); + set_0(dest); /* No TBF_STARTING_TIME */ } else { set_0(dest); /* Single Block Allocation */ @@ -317,7 +319,9 @@ rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ check(rc); - set_0(dest); /* No TIMING_ADVANCE_INDEX */ + rc = write_ta_index(dest, ta_idx); + check(rc); + set_0(dest); /* No TBF_STARTING_TIME */ bitvec_set_bit(dest, L); /* No Additions for Rel-7 */ } else { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index fcecf4f..f50f2dd 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1561,7 +1561,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2195,7 +2195,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -6871,7 +6871,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6896,7 +6896,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6921,7 +6921,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6946,7 +6946,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6971,7 +6971,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6996,7 +6996,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -7021,7 +7021,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9054,7 +9054,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9079,7 +9079,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9104,7 +9104,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9129,7 +9129,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9154,7 +9154,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9179,7 +9179,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9204,7 +9204,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -- To view, visit https://gerrit.osmocom.org/5729 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:22:46 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 12:22:46 +0000 Subject: [PATCH] osmo-pcu[master]: cosmetic: inline single-use helper Message-ID: Review at https://gerrit.osmocom.org/5730 cosmetic: inline single-use helper Change-Id: I5ec54ccd9c4bf8344fbd1dce91e8707f6b17b2f7 --- M src/encoding.cpp 1 file changed, 6 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/30/5730/1 diff --git a/src/encoding.cpp b/src/encoding.cpp index aaa51e6..443024b 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -71,17 +71,6 @@ return true; } -/* { 0 | 1 < TIMING_ADVANCE_VALUE : bit (6) > } */ -static inline void write_ta(bitvec *dest, unsigned& wp, int8_t ta) -{ - if (ta < 0) /* No TIMING_ADVANCE_VALUE: */ - bitvec_write_field(dest, &wp, 0, 1); - else { /* TIMING_ADVANCE_VALUE: */ - bitvec_write_field(dest, &wp, 1, 1); - bitvec_write_field(dest, &wp, ta, 6); - } -} - /* 3GPP TS 44.060 Table 12.5.2.1 */ static inline uint16_t enc_ws(uint16_t ws) { @@ -105,7 +94,12 @@ static inline void write_ta_ie(bitvec *dest, unsigned& wp, int8_t ta, int8_t tai, uint8_t ts) { - write_ta(dest, wp, ta); + if (ta < 0) /* No TIMING_ADVANCE_VALUE: */ + bitvec_write_field(dest, &wp, 0, 1); + else { /* TIMING_ADVANCE_VALUE: */ + bitvec_write_field(dest, &wp, 1, 1); + bitvec_write_field(dest, &wp, ta, 6); + } if (write_tai(dest, wp, tai)) /* TIMING_ADVANCE_TIMESLOT_NUMBER: */ bitvec_write_field(dest, &wp, ts, 3); } -- To view, visit https://gerrit.osmocom.org/5730 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ec54ccd9c4bf8344fbd1dce91e8707f6b17b2f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 12:26:13 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 12:26:13 +0000 Subject: [PATCH] osmo-bsc[master]: bsc/gsm_04_80.h: use '#pragma once' instead of includes Message-ID: Review at https://gerrit.osmocom.org/5731 bsc/gsm_04_80.h: use '#pragma once' instead of includes This is a common include guard way for Osmocom projects. Change-Id: Iee73e24a2438b6081a5d569db7d48725b564ee3a --- M include/osmocom/bsc/gsm_04_80.h 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/31/5731/1 diff --git a/include/osmocom/bsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h index d65f640..dd699f2 100644 --- a/include/osmocom/bsc/gsm_04_80.h +++ b/include/osmocom/bsc/gsm_04_80.h @@ -1,5 +1,4 @@ -#ifndef _GSM_04_80_H -#define _GSM_04_80_H +#pragma once #include #include @@ -21,5 +20,3 @@ int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - -#endif -- To view, visit https://gerrit.osmocom.org/5731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee73e24a2438b6081a5d569db7d48725b564ee3a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 13:27:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 13:27:13 +0000 Subject: osmo-bsc[master]: bsc/gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee73e24a2438b6081a5d569db7d48725b564ee3a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc 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 Wed Jan 10 13:27:44 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 13:27:44 +0000 Subject: osmo-bsc[master]: bsc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc 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 Wed Jan 10 13:30:21 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 10 Jan 2018 13:30:21 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 10 13:31:14 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 13:31:14 +0000 Subject: osmo-trx[master]: cosmetic: AUTHORS: fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Wed Jan 10 13:37:15 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 13:37:15 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: According to the commit description, both LogTest.err and LogTest.ok are related to a single disabled test. I am not sure we really need these files, if the test is disabled itself... -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 10 14:04:20 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 14:04:20 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: > According to the commit description, both LogTest.err and > LogTest.ok > are related to a single disabled test. I am not sure we really need > these files, if the test is disabled itself... It's not the only disabled test I do the same here for other tests which are not working in its current/old form (due to changing output). I could remove the files but it can still make sense to leave them there to see better in follow-up commits how the changes affect the output. It also shows in the current commit how the output is unusable yet and why the test is disabled. -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 10 14:09:55 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 14:09:55 +0000 Subject: [PATCH] osmo-msc[master]: msc/gsm_04_80.h: clean up useless declarations Message-ID: Review at https://gerrit.osmocom.org/5732 msc/gsm_04_80.h: clean up useless declarations This change removes a few USSD specific declarations, which are not actually used now, and probably accidentally migrated from legacy OpenBSC. Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7 --- M include/osmocom/msc/gsm_04_80.h 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/5732/1 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index d65f640..40ecfba 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -18,8 +18,4 @@ const char *text); int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); -int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, - const char *text); -int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - #endif -- To view, visit https://gerrit.osmocom.org/5732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 14:09:55 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 14:09:55 +0000 Subject: [PATCH] osmo-msc[master]: msc/gsm_04_80.h: use '#pragma once' instead of includes Message-ID: Review at https://gerrit.osmocom.org/5733 msc/gsm_04_80.h: use '#pragma once' instead of includes This is a common include guard way for Osmocom projects. Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6 --- M include/osmocom/msc/gsm_04_80.h 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/5733/1 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 40ecfba..045be6c 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -1,5 +1,4 @@ -#ifndef _GSM_04_80_H -#define _GSM_04_80_H +#pragma once #include #include @@ -17,5 +16,3 @@ int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - -#endif -- To view, visit https://gerrit.osmocom.org/5733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 14:09:55 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 14:09:55 +0000 Subject: [PATCH] osmo-msc[master]: src/libmsc/ussd.c: drop useless forward declaration Message-ID: Review at https://gerrit.osmocom.org/5734 src/libmsc/ussd.c: drop useless forward declaration There is no any significant reason to define static function 'send_own_number' after the code that calls it. Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2 --- M src/libmsc/ussd.c 1 file changed, 12 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/34/5734/1 diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index 7b450a2..eeab52a 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -39,9 +39,19 @@ /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; -/* Forward declarations of network-specific handler functions */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req); +/* A network-specific handler function */ +static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +{ + char *own_number = conn->vsub->msisdn; + char response_string[GSM_EXTENSION_LENGTH + 20]; + DEBUGP(DMM, "%s: MSISDN = %s\n", vlr_subscr_name(conn->vsub), + own_number); + + /* Need trailing CR as EOT character */ + snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); + return gsm0480_send_ussd_response(conn, msg, response_string, req); +} /* Entrypoint - handler function common to all mobile-originated USSDs */ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -87,18 +97,4 @@ } return rc; -} - -/* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) -{ - char *own_number = conn->vsub->msisdn; - char response_string[GSM_EXTENSION_LENGTH + 20]; - - DEBUGP(DMM, "%s: MSISDN = %s\n", vlr_subscr_name(conn->vsub), - own_number); - - /* Need trailing CR as EOT character */ - snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); } -- To view, visit https://gerrit.osmocom.org/5734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 14:09:56 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 14:09:56 +0000 Subject: [PATCH] osmo-msc[master]: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility Message-ID: Review at https://gerrit.osmocom.org/5735 gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility Since the I5f8972b86cd4dcb54b643a24b5794a87c8758073, the GSM 04.80 libosmocore API / ABI is changed in order to facilitate external USSD interface development. The only affected part of OsmoMSC is 'libmsc/ussd.c' which only handles '*#100#' so far. Depends-On: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Change-Id: I9b3a4a169d4a473dd0547815d84a28e24997446f --- M include/osmocom/msc/gsm_04_80.h M src/libmsc/gsm_04_80.c M src/libmsc/ussd.c 3 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/35/5735/1 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 045be6c..46a72fe 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -8,10 +8,10 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); + const struct gsm0480_ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *msg, - const struct ss_request *request); + const struct gsm0480_ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index 37e058c..9c6febc 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -63,7 +63,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char *response_text, - const struct ss_request *req) + const struct gsm0480_ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -111,7 +111,7 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, - const struct ss_request *req) + const struct gsm0480_ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); struct gsm48_hdr *gh; diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index eeab52a..456894f 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -40,7 +40,8 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, + const struct msgb *msg, const struct gsm0480_ss_request *req) { char *own_number = conn->vsub->msisdn; char response_string[GSM_EXTENSION_LENGTH + 20]; @@ -57,7 +58,7 @@ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) { int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *gh; /* TODO: Use subscriber_connection ref-counting if we ever want -- To view, visit https://gerrit.osmocom.org/5735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b3a4a169d4a473dd0547815d84a28e24997446f Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 16:20:41 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 16:20:41 +0000 Subject: [PATCH] osmo-msc[master]: msc/gsm_04_80.h: cosmetic: whitespace fix Message-ID: Review at https://gerrit.osmocom.org/5736 msc/gsm_04_80.h: cosmetic: whitespace fix Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c --- M include/osmocom/msc/gsm_04_80.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/36/5736/1 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 40ecfba..52d2f4a 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -8,10 +8,10 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, + const struct msgb *in_msg, const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, + const struct msgb *msg, const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, -- To view, visit https://gerrit.osmocom.org/5736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 16:20:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 16:20:38 +0000 Subject: [PATCH] osmo-msc[master]: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5735 to look at the new patch set (#2). gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility Since the I5f8972b86cd4dcb54b643a24b5794a87c8758073, the GSM 04.80 libosmocore API / ABI is changed in order to facilitate external USSD interface development. The only affected part of OsmoMSC is 'libmsc/ussd.c' which only handles '*#100#' so far. Depends-On: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Change-Id: I9b3a4a169d4a473dd0547815d84a28e24997446f --- M include/osmocom/msc/gsm_04_80.h M src/libmsc/gsm_04_80.c M src/libmsc/ussd.c 3 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/35/5735/2 diff --git a/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 7da45a0..e19a634 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -8,10 +8,10 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); + const struct gsm0480_ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *msg, - const struct ss_request *request); + const struct gsm0480_ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); diff --git a/src/libmsc/gsm_04_80.c b/src/libmsc/gsm_04_80.c index 37e058c..9c6febc 100644 --- a/src/libmsc/gsm_04_80.c +++ b/src/libmsc/gsm_04_80.c @@ -63,7 +63,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char *response_text, - const struct ss_request *req) + const struct gsm0480_ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -111,7 +111,7 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, - const struct ss_request *req) + const struct gsm0480_ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); struct gsm48_hdr *gh; diff --git a/src/libmsc/ussd.c b/src/libmsc/ussd.c index eeab52a..456894f 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -40,7 +40,8 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, + const struct msgb *msg, const struct gsm0480_ss_request *req) { char *own_number = conn->vsub->msisdn; char response_string[GSM_EXTENSION_LENGTH + 20]; @@ -57,7 +58,7 @@ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) { int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *gh; /* TODO: Use subscriber_connection ref-counting if we ever want -- To view, visit https://gerrit.osmocom.org/5735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b3a4a169d4a473dd0547815d84a28e24997446f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 10 16:30:20 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 16:30:20 +0000 Subject: [PATCH] openbsc[master]: gsm_04_80.h: use '#pragma once' instead of includes Message-ID: Review at https://gerrit.osmocom.org/5737 gsm_04_80.h: use '#pragma once' instead of includes This is a common include guard way for Osmocom projects. Change-Id: I9b84e5d87068aba4926d6950b4c419be837bbcc3 --- M openbsc/include/openbsc/gsm_04_80.h 1 file changed, 1 insertion(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/5737/1 diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index d65f640..dd699f2 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -1,5 +1,4 @@ -#ifndef _GSM_04_80_H -#define _GSM_04_80_H +#pragma once #include #include @@ -21,5 +20,3 @@ int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - -#endif -- To view, visit https://gerrit.osmocom.org/5737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b84e5d87068aba4926d6950b4c419be837bbcc3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 16:30:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 16:30:21 +0000 Subject: [PATCH] openbsc[master]: gsm_04_80.h: cosmetic: whitespace fix Message-ID: Review at https://gerrit.osmocom.org/5738 gsm_04_80.h: cosmetic: whitespace fix Change-Id: Ife129bc8b01122444511f6ee52e30cd6367f8593 --- M openbsc/include/openbsc/gsm_04_80.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/5738/1 diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index dd699f2..ce1b5c2 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -7,10 +7,10 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, + const struct msgb *in_msg, const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, + const struct msgb *msg, const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, -- To view, visit https://gerrit.osmocom.org/5738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ife129bc8b01122444511f6ee52e30cd6367f8593 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 16:30:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 16:30:21 +0000 Subject: [PATCH] openbsc[master]: src/libmsc/ussd.c: drop useless forward declaration Message-ID: Review at https://gerrit.osmocom.org/5739 src/libmsc/ussd.c: drop useless forward declaration There is no any significant reason to define static function 'send_own_number' after the code that calls it. Change-Id: I8d804398cfa460eaa5a5f84f0ed90909488d0bdd --- M openbsc/src/libmsc/ussd.c 1 file changed, 10 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/39/5739/1 diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c index f12c1f2..488e813 100644 --- a/openbsc/src/libmsc/ussd.c +++ b/openbsc/src/libmsc/ussd.c @@ -37,8 +37,16 @@ /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; -/* Forward declarations of network-specific handler functions */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req); +/* A network-specific handler function */ +static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +{ + char *own_number = conn->subscr->extension; + char response_string[GSM_EXTENSION_LENGTH + 20]; + + /* Need trailing CR as EOT character */ + snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); + return gsm0480_send_ussd_response(conn, msg, response_string, req); +} /* Entrypoint - handler function common to all mobile-originated USSDs */ @@ -81,15 +89,4 @@ /* check if we can release it */ msc_release_connection(conn); return rc; -} - -/* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) -{ - char *own_number = conn->subscr->extension; - char response_string[GSM_EXTENSION_LENGTH + 20]; - - /* Need trailing CR as EOT character */ - snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); } -- To view, visit https://gerrit.osmocom.org/5739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d804398cfa460eaa5a5f84f0ed90909488d0bdd Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 16:30:22 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 16:30:22 +0000 Subject: [PATCH] openbsc[master]: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility Message-ID: Review at https://gerrit.osmocom.org/5740 gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility Since the I5f8972b86cd4dcb54b643a24b5794a87c8758073, the GSM 04.80 libosmocore API / ABI is changed in order to facilitate external USSD interface development. The only affected part of OpenBSC is 'libmsc/ussd.c' which only handles '*#100#' so far. Change-Id: Ic7fed57115dfa9f06a48adced86cd2fb7779139e Depends-On: I5f8972b86cd4dcb54b643a24b5794a87c8758073 --- M openbsc/include/openbsc/gsm_04_80.h M openbsc/src/libmsc/gsm_04_80.c M openbsc/src/libmsc/ussd.c 3 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/5740/1 diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index ce1b5c2..e7f552a 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -8,10 +8,10 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); + const struct gsm0480_ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *msg, - const struct ss_request *request); + const struct gsm0480_ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c index 479d6fb..f417eb6 100644 --- a/openbsc/src/libmsc/gsm_04_80.c +++ b/openbsc/src/libmsc/gsm_04_80.c @@ -63,7 +63,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char *response_text, - const struct ss_request *req) + const struct gsm0480_ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -111,7 +111,7 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, - const struct ss_request *req) + const struct gsm0480_ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); struct gsm48_hdr *gh; diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c index 488e813..15df8e4 100644 --- a/openbsc/src/libmsc/ussd.c +++ b/openbsc/src/libmsc/ussd.c @@ -38,7 +38,8 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, + const struct msgb *msg, const struct gsm0480_ss_request *req) { char *own_number = conn->subscr->extension; char response_string[GSM_EXTENSION_LENGTH + 20]; @@ -53,7 +54,7 @@ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) { int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *gh; memset(&req, 0, sizeof(req)); -- To view, visit https://gerrit.osmocom.org/5740 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic7fed57115dfa9f06a48adced86cd2fb7779139e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:17:20 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 17:17:20 +0000 Subject: [PATCH] osmo-trx[master]: utils/convolvtest: Remove uneeded libosmocore dependency Message-ID: Review at https://gerrit.osmocom.org/5741 utils/convolvtest: Remove uneeded libosmocore dependency Change-Id: I1742146c31cadec8ce8afbbdae5777f076b212d4 --- M utils/convolvetest/Makefile M utils/convolvetest/main.c 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/41/5741/1 diff --git a/utils/convolvetest/Makefile b/utils/convolvetest/Makefile index d09a4cd..1163d67 100644 --- a/utils/convolvetest/Makefile +++ b/utils/convolvetest/Makefile @@ -1,5 +1,5 @@ all: main.o convolve_base.o convolve.o convolve_sse_3.o - gcc -g -Wall ./*.o -o convtest -losmocore + gcc -g -Wall ./*.o -o convtest clean: rm -f ./*.o diff --git a/utils/convolvetest/main.c b/utils/convolvetest/main.c index ff88ba5..f4a76c3 100644 --- a/utils/convolvetest/main.c +++ b/utils/convolvetest/main.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include "../../Transceiver52M/common/convolve.h" #define TESTVEC_LEN 1000 -- To view, visit https://gerrit.osmocom.org/5741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1742146c31cadec8ce8afbbdae5777f076b212d4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:17:20 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 17:17:20 +0000 Subject: [PATCH] osmo-trx[master]: Move ARCH_LA to Makefile.common Message-ID: Review at https://gerrit.osmocom.org/5742 Move ARCH_LA to Makefile.common It will later be used by other directories too (tests/Transceiver52M). Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 --- M Makefile.common M Transceiver52M/Makefile.am 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/42/5742/1 diff --git a/Makefile.common b/Makefile.common index c0fc850..e9820a4 100644 --- a/Makefile.common +++ b/Makefile.common @@ -32,4 +32,10 @@ COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la GSM_LA = $(top_builddir)/GSM/libGSM.la +if ARCH_ARM +ARCH_LA = $(top_builddir)/Transceiver52M/arm/libarch.la +else +ARCH_LA = $(top_builddir)/Transceiver52M/x86/libarch.la +endif + MOSTLYCLEANFILES = *~ diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index dc6e597..8df2d34 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -26,12 +26,6 @@ SUBDIRS = arm x86 -if ARCH_ARM -ARCH_LA = arm/libarch.la -else -ARCH_LA = x86/libarch.la -endif - if USRP1 AM_CPPFLAGS += $(USRP_CFLAGS) else -- To view, visit https://gerrit.osmocom.org/5742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:17:20 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 10 Jan 2018 17:17:20 +0000 Subject: [PATCH] osmo-trx[master]: tests: Migrate convtest util to autotest infrastructure Message-ID: Review at https://gerrit.osmocom.org/5743 tests: Migrate convtest util to autotest infrastructure Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e --- M configure.ac M tests/Makefile.am A tests/Transceiver52M/Makefile.am R tests/Transceiver52M/convolve_test.c R tests/Transceiver52M/convolve_test.ok M tests/testsuite.at D utils/convolvetest/Makefile 7 files changed, 25 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/43/5743/1 diff --git a/configure.ac b/configure.ac index 3ad4b41..5cee4a6 100644 --- a/configure.ac +++ b/configure.ac @@ -174,6 +174,7 @@ Transceiver52M/x86/Makefile \ tests/Makefile \ tests/CommonLibs/Makefile \ + tests/Transceiver52M/Makefile \ ]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index c18bef3..d4589a4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ CommonLibs \ + Transceiver52M \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/Transceiver52M/Makefile.am b/tests/Transceiver52M/Makefile.am new file mode 100644 index 0000000..79f73c6 --- /dev/null +++ b/tests/Transceiver52M/Makefile.am @@ -0,0 +1,17 @@ +include $(top_srcdir)/Makefile.common + +AM_CFLAGS = -Wall -I$(top_srcdir)/Transciever52 $(STD_DEFINES_AND_INCLUDES) -g + +EXTRA_DIST = convolve_test.ok + +noinst_PROGRAMS = \ + convolve_test + +convolve_test_SOURCES = convolve_test.c +convolve_test_LDADD = $(COMMON_LA) $(ARCH_LA) +if HAVE_SSE3 +convolve_test_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS) +endif +if HAVE_SSE4_1 +convolve_test_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS) +endif diff --git a/utils/convolvetest/main.c b/tests/Transceiver52M/convolve_test.c similarity index 100% rename from utils/convolvetest/main.c rename to tests/Transceiver52M/convolve_test.c diff --git a/utils/convolvetest/convtest.ok b/tests/Transceiver52M/convolve_test.ok similarity index 100% rename from utils/convolvetest/convtest.ok rename to tests/Transceiver52M/convolve_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index 00e6002..c6ca848 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -43,3 +43,9 @@ cat $abs_srcdir/CommonLibs/VectorTest.ok > expout AT_CHECK([$abs_top_builddir/tests/CommonLibs/VectorTest], [], [expout], []) AT_CLEANUP + +AT_SETUP([convolve_test]) +AT_KEYWORDS([convolve_test]) +cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) +AT_CLEANUP diff --git a/utils/convolvetest/Makefile b/utils/convolvetest/Makefile deleted file mode 100644 index 1163d67..0000000 --- a/utils/convolvetest/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -all: main.o convolve_base.o convolve.o convolve_sse_3.o - gcc -g -Wall ./*.o -o convtest - -clean: - rm -f ./*.o - rm -f ./convtest - -main.o: main.c - gcc -g -Wall -c main.c - -convolve_base.o: ../../Transceiver52M/common/convolve_base.c - gcc -std=c99 -c ../../Transceiver52M/common/convolve_base.c - -convolve.o: ../../Transceiver52M/x86/convolve.c - gcc -std=c99 -c ../../Transceiver52M/x86/convolve.c -I ../../Transceiver52M/common/ -msse3 -DHAVE_SSE3 - -convolve_sse_3.o: ../../Transceiver52M/x86/convolve_sse_3.c - gcc -std=c99 -c ../../Transceiver52M/x86/convolve_sse_3.c -I ../../Transceiver52M/common/ -msse3 -DHAVE_SSE3 -- To view, visit https://gerrit.osmocom.org/5743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5712 to look at the new patch set (#3). gsm0480: increase the MAX_LEN_USSD_STRING to 182 According to the GSM 04.80 (version 5.0.0) specification Annex A "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD OCTET STRING is 160 bytes. Thus according to ETSI TS 123 038 (version 10.0.0) specification 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. The remaining 6 bits are set to zero. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5712/3 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 781d8d7..7811c9e 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,7 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +#define MAX_LEN_USSD_STRING 182 /* deprecated */ struct ussd_request { -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS request with DSC != 0x0F In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3376 to look at the new patch set (#6). gsm0480: handle UnstructuredSS request with DSC != 0x0F Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 --- M src/gsm/gsm0480.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/3376/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 12ae1a3..ecbea8c 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -464,6 +464,17 @@ req->ussd_text_len = num_chars; return 1; + } else { + num_chars = uss_req_data[6]; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; + + req->ussd_text_language = dcs; + req->ussd_text_len = num_chars; + memcpy(req->ussd_text, &(uss_req_data[7]), num_chars); + + return 1; } return 0; -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3377 to look at the new patch set (#6). gsm0480: parse GSM0480_MTYPE_FACILITY separately Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa --- M src/gsm/gsm0480.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/3377/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ecbea8c..d717270 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -196,6 +196,8 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *req); +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct gsm0480_ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, @@ -281,8 +283,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - case GSM0480_MTYPE_FACILITY: rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + break; + case GSM0480_MTYPE_FACILITY: + rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", @@ -294,6 +298,18 @@ return rc; } +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct gsm0480_ss_request *req) +{ + uint8_t facility_length; + + facility_length = ss_facility[0]; + if (len - 1 < facility_length) + return 0; + + return parse_facility_ie(ss_facility + 1, facility_length, req); +} + static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct gsm0480_ss_request *req) { -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3378 to look at the new patch set (#6). gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 84 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3378/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d717270..d1e978f 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -369,6 +373,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -448,6 +455,83 @@ return rc; } +/* Parse an Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 1; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; + + req->ussd_text_language = 1; + req->ussd_text_len = num_chars; + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3379 to look at the new patch set (#6). gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e --- M src/gsm/gsm0480.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/79/3379/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d1e978f..ecdb315 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -427,6 +427,8 @@ uint8_t operation_code = invoke_data[offset+2]; req->opcode = operation_code; switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: case GSM0480_OP_CODE_PROCESS_USS_REQ: rc = parse_process_uss_req(invoke_data + offset + 3, length - offset - 3, -- To view, visit https://gerrit.osmocom.org/3379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3380 to look at the new patch set (#6). gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 --- M src/gsm/gsm0480.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/3380/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ecdb315..a35ff4a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -434,6 +434,11 @@ length - offset - 3, req); break; + case GSM0480_OP_CODE_PROCESS_USS_DATA: + rc = parse_process_uss_data(invoke_data + offset + 3, + length - offset - 3, + req); + break; case GSM0480_OP_CODE_ACTIVATE_SS: case GSM0480_OP_CODE_DEACTIVATE_SS: case GSM0480_OP_CODE_INTERROGATE_SS: -- To view, visit https://gerrit.osmocom.org/3380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3381 to look at the new patch set (#6). gsm0480: expose the gsm0480_parse_ss_facility_ie() Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3381/6 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 7811c9e..4e0d99f 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -50,6 +50,8 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *request); +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct gsm0480_ss_request *req); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index a35ff4a..ae82f46 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -200,8 +200,6 @@ struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct gsm0480_ss_request *req); -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, @@ -311,7 +309,8 @@ if (len - 1 < facility_length) return 0; - return parse_facility_ie(ss_facility + 1, facility_length, req); + return gsm0480_parse_ss_facility_ie(ss_facility + 1, + facility_length, req); } static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, @@ -333,7 +332,7 @@ case GSM48_IE_CAUSE: break; case GSM0480_IE_FACILITY: - rc = parse_facility_ie(ss_ie + 2, iei_length, req); + rc = gsm0480_parse_ss_facility_ie(ss_ie + 2, iei_length, req); break; case GSM0480_IE_SS_VERSION: break; @@ -347,8 +346,8 @@ return rc; } -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct gsm0480_ss_request *req) +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset = 0; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5611ba3..f316cad 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -90,6 +90,7 @@ gsm0480_create_ussd_release_complete; gsm0480_decode_ussd_request; gsm0480_decode_ss_request; +gsm0480_parse_ss_facility_ie; gsm0480_wrap_facility; gsm0480_wrap_invoke; -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message 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/3373 to look at the new patch set (#6). gsm0480: skip length check for 'RELEASE COMPLETE' message According to GSM 04.80 Section 2.5 'Release complete' Table 2.5, the 'RELEASE COMPLETE' message payload is optional, so let's drop length check in gsm0480_decode_ss_request() for this type. Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 --- M src/gsm/gsm0480.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3373/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ae82f46..45808c9 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -253,11 +253,18 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct gsm0480_ss_request *req) { + uint8_t msg_type = hdr->msg_type & 0x3F; int rc = 0; - if (len < sizeof(*hdr) + 2) { - LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); - return 0; + /** + * GSM 04.80 Section 2.5 'Release complete' Table 2.5 + * payload is optional for 'RELEASE COMPLETE' message + */ + if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (len < sizeof(*hdr) + 2) { + LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); + return 0; + } } if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3374 to look at the new patch set (#4). gsm0480: modify USSD structures to support external handling This change renames the 'ss_request' struct to 'gsm0480_ss_request', and adds the following new fields: - message_type - GSM 04.80 Chapter 2.2 - component_type - GSM 04.80 Chapter 3.6.2 - error_code - GSM 04.80 Chapter 3.6.6 - problem_code - GSM 04.80 Chapter 3.6.7 - ussd_text_language - ussd_text_len in order to pave the way for the further patches to allow communicating un-parsed SS/USSD to an external application, and avoid parsing the whole SS/USSD request every time. As this brokes the API/ABI, the code compiled against the old version of the library will no longer work due to the missing symbol. Affected projects: - OsmoBSC: https://gerrit.osmocom.org/5725 - OsmoMSC: https://gerrit.osmocom.org/5735 - OpenBSC legacy: https://gerrit.osmocom.org/5740 Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 --- M TODO-RELEASE M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M tests/ussd/ussd_test.c 4 files changed, 54 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/3374/4 diff --git a/TODO-RELEASE b/TODO-RELEASE index a5def79..da0e82a 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h +gsm GSM 04.80 API + ABI facilitate external USSD interface diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 672ffe5..781d8d7 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -20,16 +20,36 @@ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, struct ussd_request *request) OSMO_DEPRECATED("Use gsm0480_decode_ss_request() instead"); -struct ss_request { - uint8_t opcode; - uint8_t ss_code; - uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; +struct gsm0480_ss_request { + /*! L3 transaction ID */ uint8_t transaction_id; + /*! Message type 2.2 */ + uint8_t message_type; + + /*! Component type 3.6.2 */ + uint8_t component_type; + /*! Invoke id 3.6.3 */ uint8_t invoke_id; + + union { + /*! Operational code 3.6.4 */ + uint8_t opcode; + /*! Error code 3.6.6 */ + uint8_t error_code; + /*! Problem code 3.6.7 */ + uint8_t problem_code; + }; + + uint8_t ussd_text_len; + uint8_t ussd_text_language; + uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; + + /*! Parameters of a Interrogate/Activate/DeactivateSS Request */ + uint8_t ss_code; }; int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, - struct ss_request *request); + struct gsm0480_ss_request *request); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 71470e5..9cfe336 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -195,24 +195,24 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, - uint16_t len, struct ss_request *req); + uint16_t len, struct gsm0480_ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, uint16_t length, - struct ss_request *req); + struct gsm0480_ss_request *req); /* Decode a mobile-originated USSD-request message */ int gsm0480_decode_ussd_request(const struct gsm48_hdr *hdr, uint16_t len, struct ussd_request *req) { - struct ss_request ss; + struct gsm0480_ss_request ss; int rc = 0; memset(&ss, 0, sizeof(ss)); @@ -228,7 +228,7 @@ ss.transaction_id = req->transaction_id; rc = parse_ss(hdr, len, &ss); - /* convert from ss_request to legacy ussd_request */ + /* convert from gsm0480_ss_request to legacy ussd_request */ req->transaction_id = ss.transaction_id; req->invoke_id = ss.invoke_id; if (ss.ussd_text[0] == 0xFF) @@ -247,7 +247,7 @@ /* Decode a mobile-originated SS request message */ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 0; @@ -267,11 +267,13 @@ return rc; } -static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) +static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, + struct gsm0480_ss_request *req) { int rc = 1; uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ + req->message_type = msg_type; switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); @@ -293,7 +295,7 @@ } static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = -1; /* Information Element Identifier - table 3.2 & GSM 04.08 section 10.5 */ @@ -326,7 +328,7 @@ } static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset = 0; @@ -341,6 +343,8 @@ LOGP(0, LOGL_ERROR, "Component does not fit.\n"); return 0; } + + req->component_type = component_type; switch (component_type) { case GSM0480_CTYPE_INVOKE: @@ -368,7 +372,7 @@ /* Parse an Invoke component - see table 3.3 */ static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 1; uint8_t offset; @@ -430,7 +434,7 @@ /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 0; int num_chars; @@ -451,9 +455,12 @@ /* Prevent a mobile-originated buffer-overrun! */ if (num_chars > MAX_LEN_USSD_STRING) num_chars = MAX_LEN_USSD_STRING; - gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), - &(uss_req_data[7]), num_chars); + + num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + req->ussd_text_language = 0x80; + req->ussd_text_len = num_chars; rc = 1; } } @@ -464,7 +471,7 @@ /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ static int parse_ss_for_bs_req(const uint8_t *ss_req_data, uint16_t length, - struct ss_request *req) + struct gsm0480_ss_request *req) { int rc = 0; diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 40b4317..e5a734f 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -44,7 +44,7 @@ { uint8_t *data; int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *hdr; data = malloc(len); @@ -60,7 +60,7 @@ { uint8_t *data; int rc; - struct ss_request req; + struct gsm0480_ss_request req; struct gsm48_hdr *hdr; data = malloc(len); @@ -119,7 +119,7 @@ int main(int argc, char **argv) { - struct ss_request req; + struct gsm0480_ss_request req; const int size = sizeof(ussd_request); int i; struct msgb *msg; -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 10 17:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:34:48 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#6). gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/3375/6 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 9cfe336..12ae1a3 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -436,36 +436,37 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) { - int rc = 0; int num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; - num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_STRING) + num_chars = MAX_LEN_USSD_STRING; - req->ussd_text_language = 0x80; - req->ussd_text_len = num_chars; - rc = 1; - } - } + num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + req->ussd_text_language = 0x80; + req->ussd_text_len = num_chars; + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 10 17:46:26 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 10 Jan 2018 17:46:26 +0000 Subject: [PATCH] libosmocore[master]: ussd_test.c: fix rc / len debug output confusion Message-ID: Review at https://gerrit.osmocom.org/5744 ussd_test.c: fix rc / len debug output confusion Both len and rc values were swapped in the test output. Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309 --- M tests/ussd/ussd_test.c M tests/ussd/ussd_test.ok 2 files changed, 52 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5744/1 diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index e5a734f..cbc5857 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -140,13 +140,13 @@ for (i = size; i > sizeof(struct gsm48_hdr); --i) { int rc = parse_ussd(&ussd_request[0], i); - printf("Result for %d is %d\n", rc, i); + printf("Result for len=%d is %d\n", i, rc); } printf("Mangling the container now\n"); for (i = size; i > sizeof(struct gsm48_hdr) + 2; --i) { int rc = parse_mangle_ussd(&ussd_request[0], i); - printf("Result for %d is %d\n", rc, i); + printf("Result for len=%d is %d\n", i, rc); } printf(" case test for 7 bit encode\n"); diff --git a/tests/ussd/ussd_test.ok b/tests/ussd/ussd_test.ok index 69ea53c..aff383e 100644 --- a/tests/ussd/ussd_test.ok +++ b/tests/ussd/ussd_test.ok @@ -1,57 +1,57 @@ Tested if it still works. Text was: **321# interrogateSS CFU text..'' code 33 Testing parsing a USSD request and truncated versions -Result for 1 is 28 -Result for 1 is 27 -Result for 1 is 26 -Result for 1 is 25 -Result for 0 is 24 -Result for 0 is 23 -Result for 0 is 22 -Result for 0 is 21 -Result for 0 is 20 -Result for 0 is 19 -Result for 0 is 18 -Result for 0 is 17 -Result for 0 is 16 -Result for 0 is 15 -Result for 0 is 14 -Result for 0 is 13 -Result for 0 is 12 -Result for 0 is 11 -Result for 0 is 10 -Result for 0 is 9 -Result for 0 is 8 -Result for 0 is 7 -Result for 0 is 6 -Result for 0 is 5 -Result for 0 is 4 -Result for 0 is 3 +Result for len=28 is 1 +Result for len=27 is 1 +Result for len=26 is 1 +Result for len=25 is 1 +Result for len=24 is 0 +Result for len=23 is 0 +Result for len=22 is 0 +Result for len=21 is 0 +Result for len=20 is 0 +Result for len=19 is 0 +Result for len=18 is 0 +Result for len=17 is 0 +Result for len=16 is 0 +Result for len=15 is 0 +Result for len=14 is 0 +Result for len=13 is 0 +Result for len=12 is 0 +Result for len=11 is 0 +Result for len=10 is 0 +Result for len=9 is 0 +Result for len=8 is 0 +Result for len=7 is 0 +Result for len=6 is 0 +Result for len=5 is 0 +Result for len=4 is 0 +Result for len=3 is 0 Mangling the container now -Result for 0 is 28 -Result for 0 is 27 -Result for 1 is 26 -Result for 1 is 25 -Result for 0 is 24 -Result for 0 is 23 -Result for 0 is 22 -Result for 0 is 21 -Result for 0 is 20 -Result for 0 is 19 -Result for 0 is 18 -Result for 0 is 17 -Result for 0 is 16 -Result for 0 is 15 -Result for 0 is 14 -Result for 0 is 13 -Result for 0 is 12 -Result for 0 is 11 -Result for 0 is 10 -Result for 0 is 9 -Result for 0 is 8 -Result for 0 is 7 -Result for 0 is 6 -Result for 1 is 5 +Result for len=28 is 0 +Result for len=27 is 0 +Result for len=26 is 1 +Result for len=25 is 1 +Result for len=24 is 0 +Result for len=23 is 0 +Result for len=22 is 0 +Result for len=21 is 0 +Result for len=20 is 0 +Result for len=19 is 0 +Result for len=18 is 0 +Result for len=17 is 0 +Result for len=16 is 0 +Result for len=15 is 0 +Result for len=14 is 0 +Result for len=13 is 0 +Result for len=12 is 0 +Result for len=11 is 0 +Result for len=10 is 0 +Result for len=9 is 0 +Result for len=8 is 0 +Result for len=7 is 0 +Result for len=6 is 0 +Result for len=5 is 1 case test for 7 bit encode original = 30 31 32 33 34 35 36 37 encoded = b0 98 6c 46 ab d9 6e -- To view, visit https://gerrit.osmocom.org/5744 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 11 02:34:07 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 02:34:07 +0000 Subject: libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Thu Jan 11 02:34:40 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 02:34:40 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 02:37:10 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 02:37:10 +0000 Subject: libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 The code looks proper now. -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 11 02:39:38 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 02:39:38 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Thu Jan 11 02:44:49 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 02:44:49 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Thu Jan 11 02:45:22 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 02:45:22 +0000 Subject: libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Thu Jan 11 03:02:31 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 03:02:31 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 Sorry, forgot to ask this: What happened to this change? Do you plan to submit it as a separate patch? > #define MAX_LEN_USSD_STRING 182 -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 04:29:34 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 04:29:34 +0000 Subject: [PATCH] pysim[master]: Make derive_milenage_opc and calculate_luhn publicly availab... Message-ID: Review at https://gerrit.osmocom.org/5745 Make derive_milenage_opc and calculate_luhn publicly available through utils.py Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01 --- M pySim-prog.py M pySim/utils.py 2 files changed, 22 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/45/5745/1 diff --git a/pySim-prog.py b/pySim-prog.py index 44ca1fd..c08f43b 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -39,7 +39,7 @@ from pySim.commands import SimCardCommands from pySim.cards import _cards_classes -from pySim.utils import h2b, swap_nibbles, rpad +from pySim.utils import h2b, swap_nibbles, rpad, derive_milenage_opc, calculate_luhn def parse_options(): @@ -233,24 +233,6 @@ out.append(chr(x)) return ''.join(out) - -def calculate_luhn(cc): - num = map(int, str(cc)) - check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in num[::-2]]) % 10 - return 0 if check_digit == 10 else check_digit - -def derive_milenage_opc(ki_hex, op_hex): - """ - Run the milenage algorithm. - """ - from Crypto.Cipher import AES - from Crypto.Util.strxor import strxor - from pySim.utils import b2h - - # We pass in hex string and now need to work on bytes - aes = AES.new(h2b(ki_hex)) - opc_bytes = aes.encrypt(h2b(op_hex)) - return b2h(strxor(opc_bytes, h2b(op_hex))) def gen_parameters(opts): """Generates Name, ICCID, MCC, MNC, IMSI, SMSP, Ki, PIN-ADM from the diff --git a/pySim/utils.py b/pySim/utils.py index 43d52dd..17dc693 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -92,3 +92,24 @@ if hplmn_disp: byte1 = byte1|0x01 if oplmn_disp: byte1 = byte1|0x02 return i2h([byte1])+s2h(name) + +def derive_milenage_opc(ki_hex, op_hex): + """ + Run the milenage algorithm to calculate OPC from Ki and OP + """ + from Crypto.Cipher import AES + from Crypto.Util.strxor import strxor + from pySim.utils import b2h + + # We pass in hex string and now need to work on bytes + aes = AES.new(h2b(ki_hex)) + opc_bytes = aes.encrypt(h2b(op_hex)) + return b2h(strxor(opc_bytes, h2b(op_hex))) + +def calculate_luhn(cc): + """ + Calculate Luhn checksum used in e.g. ICCID and IMEI + """ + num = map(int, str(cc)) + check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in num[::-2]]) % 10 + return 0 if check_digit == 10 else check_digit -- To view, visit https://gerrit.osmocom.org/5745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Thu Jan 11 04:29:36 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 04:29:36 +0000 Subject: [PATCH] pysim[master]: Checking in pySim-fairwaves-prog.py utility. Message-ID: Review at https://gerrit.osmocom.org/5746 Checking in pySim-fairwaves-prog.py utility. This utility is an example utility for programming Fairwaves SIM cards. The original pySim-prog.py utility is already bloated with features and is difficult to modify so we decided to create a leaner and easier to maintain and modify version. Change-Id: I9f58e1b45d1785d59cef161eab1388332a97936b --- A pySim-fairwaves-prog.py 1 file changed, 272 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/46/5746/1 diff --git a/pySim-fairwaves-prog.py b/pySim-fairwaves-prog.py new file mode 100755 index 0000000..b709af9 --- /dev/null +++ b/pySim-fairwaves-prog.py @@ -0,0 +1,272 @@ +#!/usr/bin/env python + +# +# Utility to update SPN field of a SIM card +# +# Copyright (C) 2017-2018 Alexander Chemeris +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +from optparse import OptionParser +import os +import sys +import csv +import random + +from pySim.commands import SimCardCommands +from pySim.utils import h2b, swap_nibbles, rpad, dec_imsi, dec_iccid, derive_milenage_opc +from pySim.cards import card_autodetect + + +def load_sim_db(filename): + sim_db = {} + with open(filename, 'r') as f: + reader = csv.reader(f, delimiter=' ') + # Skip the header + reader.next() + for l in reader: + sim_db[l[0]] = l + return sim_db + +def write_params_csv(filename, sim_keys): + with open(filename, 'a') as f: + cw = csv.writer(f, delimiter=' ') + cw.writerow([x for x in sim_keys]) + + +def program_sim_card(card, sim_db, opts): + # Program the card + print("Reading SIM card ...") + + # EF.ICCID + (iccid, sw) = card.read_iccid() + if sw != '9000': + print("ICCID: Can't read, response code = %s" % (sw,)) + sys.exit(1) + print("ICCID: %s" % (iccid)) + + # Find SIM card keys in the DB + sim_keys = sim_db.get(iccid+'F') + if sim_keys == None: + print("Can't find SIM card in the SIM DB.") + sys.exit(1) + + # EF.IMSI + (imsi, sw) = card.read_imsi() + if sw != '9000': + print("IMSI: Can't read, response code = %s" % (sw,)) + sys.exit(1) + print("IMSI: %s" % (imsi)) + + # EF.SPN + ((name, hplmn_disp, oplmn_disp), sw) = card.read_spn() + if sw == '9000': + print("Service Provider Name: %s" % name) + print(" display for HPLMN %s" % hplmn_disp) + print(" display for other PLMN %s" % oplmn_disp) + else: + print("Old SPN: Can't read, response code = %s" % (sw,)) + + print("Entring ADM code...") + + # Enter ADM code to get access to proprietary files + sw = card.verify_adm(h2b(sim_keys[6])) + if sw != '9000': + print("Fail to verify ADM code with result = %s" % (sw,)) + sys.exit(1) + + # Read EF.Ki + (ki, sw) = card.read_ki() + if sw == '9000': + ki = ki.upper() + print("Ki: %s" % ki) + else: + print("Ki: Can't read, response code = %s" % (sw,)) + + # Read EF.OP/OPC + ((op_opc_type, op_opc), sw) = card.read_op_opc() + if sw == '9000': + op_opc = op_opc.upper() + print("%s: %s" % (op_opc_type, op_opc)) + else: + print("Ki: Can't read, response code = %s" % (sw,)) + + print("Programming...") + + # Update SPN + sw = card.update_spn(opts.name, False, False) + if sw != '9000': + print("SPN: Fail to update with result = %s" % (sw,)) + sys.exit(1) + + # Update Ki + ki = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]).upper() + sim_keys[8] = ki + sw = card.update_ki(sim_keys[8]) + if sw != '9000': + print("Ki: Fail to update with result = %s" % (sw,)) + sys.exit(1) + + # Update OPC + op_opc = derive_milenage_opc(ki, opts.op).upper() + sim_keys[9] = '01' + op_opc + sw = card.update_opc(sim_keys[9][2:]) + if sw != '9000': + print("OPC: Fail to update with result = %s" % (sw,)) + sys.exit(1) + + # Update Home PLMN + sw = card.update_hplmn_act(opts.mcc, opts.mnc) + if sw != '9000': + print("MCC/MNC: Fail to update with result = %s" % (sw,)) + sys.exit(1) + + # Update IMSI + imsi = "%03d%02d%s" % (opts.mcc, opts.mnc, imsi[5:]) + sw = card.update_imsi(imsi) + if sw != '9000': + print("IMSI: Fail to update with result = %s" % (sw,)) + sys.exit(1) + + # Verify EF.IMSI + (imsi_new, sw) = card.read_imsi() + if sw != '9000': + print("IMSI: Can't read, response code = %s" % (sw,)) + sys.exit(1) + print("IMSI: %s" % (imsi_new)) + + # Verify EF.SPN + ((name, hplmn_disp, oplmn_disp), sw) = card.read_spn() + if sw == '9000': + print("Service Provider Name: %s" % name) + print(" display for HPLMN %s" % hplmn_disp) + print(" display for other PLMN %s" % oplmn_disp) + else: + print("New SPN: Can't read, response code = %s" % (sw,)) + + # Verify EF.Ki + (ki_new, sw) = card.read_ki() + if sw == '9000': + ki_new = ki_new.upper() + print("Ki: %s (%s)" % (ki_new, "match" if (ki==ki_new) else ("DON'T match %s" % ki))) + else: + print("New Ki: Can't read, response code = %s" % (sw,)) + + # Verify EF.OP/OPC + ((op_opc_type_new, op_opc_new), sw) = card.read_op_opc() + if sw == '9000': + op_opc_new = op_opc_new.upper() + print("%s: %s (%s)" % (op_opc_type_new, op_opc_new, "match" if (op_opc==op_opc_new) else ("DON'T match %s" % op_opc))) + else: + print("Ki: Can't read, response code = %s" % (sw,)) + + # Done with this card + print "Done !\n" + + return sim_keys + + +def parse_options(): + + parser = OptionParser(usage="usage: %prog [options]", + description="An example utility to program Fairwaves SIM cards." + " Modify it to your own specific needs.") + + parser.add_option("-d", "--device", dest="device", metavar="DEV", + help="Serial Device for SIM access [default: %default]", + default="/dev/ttyUSB0", + ) + parser.add_option("-b", "--baud", dest="baudrate", type="int", metavar="BAUD", + help="Baudrate used for SIM access [default: %default]", + default=9600, + ) + parser.add_option("-p", "--pcsc-device", dest="pcsc_dev", type='int', metavar="PCSC", + help="Which PC/SC reader number for SIM access", + default=None, + ) + parser.add_option("-s", "--sim-db", dest="sim_db_filename", type='string', metavar="FILE", + help="filename of a SIM DB to load keys from (space searated)", + default="sim_db.dat", + ) + parser.add_option("-o", "--out-db", dest="out_db_filename", type='string', metavar="FILE", + help="filename of a SIM DB to write keys to (space searated)", + default="out.csv", + ) + parser.add_option("--batch", dest="batch", + help="Process SIM cards in batch mode - don't exit after programming and wait for the next SIM card to be inserted.", + default=False, action="store_true", + ) + parser.add_option("-n", "--name", dest="name", + help="Operator name [default: %default]", + default="Fairwaves", + ) + parser.add_option("-x", "--mcc", dest="mcc", type="int", + help="Mobile Country Code [default: %default]", + default=001, + ) + parser.add_option("-y", "--mnc", dest="mnc", type="int", + help="Mobile Network Code [default: %default]", + default=01, + ) + parser.add_option("--op", dest="op", + help="Set OP to derive OPC from OP and KI [default: %default]", + default='00000000000000000000000000000000', + ) + + (options, args) = parser.parse_args() + + if args: + parser.error("Extraneous arguments") + + return options + + +if __name__ == '__main__': + + # Parse options + opts = parse_options() + + # Connect to the card + if opts.pcsc_dev is None: + from pySim.transport.serial import SerialSimLink + sl = SerialSimLink(device=opts.device, baudrate=opts.baudrate) + else: + from pySim.transport.pcsc import PcscSimLink + sl = PcscSimLink(opts.pcsc_dev) + + # Create command layer + scc = SimCardCommands(transport=sl) + + print("Loading SIM DB ...") + sim_db = load_sim_db(opts.sim_db_filename) + + if opts.batch: + print("Batch mode enabled! Press Ctrl-C to exit") + + # Loop once in non-batch mode and loop forever in batch mode + first_run = True + while first_run or opts.batch: + print("Insert a SIM card to program...") + sl.wait_for_card(newcardonly=not first_run) + first_run = False + + card = card_autodetect(scc) + if card is None: + print("Card autodetect failed") + continue + print "Autodetected card type %s" % card.name + + sim_keys = program_sim_card(card, sim_db, opts) + write_params_csv(opts.out_db_filename, sim_keys) -- To view, visit https://gerrit.osmocom.org/5746 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9f58e1b45d1785d59cef161eab1388332a97936b Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Thu Jan 11 07:15:47 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 07:15:47 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 4: > Sorry, forgot to ask this: > What happened to this change? > Do you plan to submit it as a separate patch? > > #define MAX_LEN_USSD_STRING 182 It's already submitted, see the next one in this set. I decided to do that separately because it requires a bit more detailed description than a few lines in the end of this commit... -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 07:27:21 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 07:27:21 +0000 Subject: libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 Please move the description of this calculation from the commit message to a comment. It should be easily understood when you browse the code. -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 07:27:47 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 07:27:47 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 Sorry,missed that patch -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 07:29:14 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 11 Jan 2018 07:29:14 +0000 Subject: libosmocore[master]: ussd_test.c: fix rc / len debug output confusion In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5744 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 09:00:54 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:00:54 +0000 Subject: libosmocore[master]: gsm0480: increase the MAX_LEN_USSD_STRING to 182 In-Reply-To: References: Message-ID: Patch Set 3: > Please move the description I'd say better copy it, not move. -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 09:01:31 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:01:31 +0000 Subject: openbsc[master]: gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b84e5d87068aba4926d6950b4c419be837bbcc3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Thu Jan 11 09:01:44 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:01:44 +0000 Subject: openbsc[master]: gsm_04_80.h: cosmetic: whitespace fix In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife129bc8b01122444511f6ee52e30cd6367f8593 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Thu Jan 11 09:02:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:02:02 +0000 Subject: openbsc[master]: src/libmsc/ussd.c: drop useless forward declaration In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d804398cfa460eaa5a5f84f0ed90909488d0bdd Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Thu Jan 11 09:02:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:02:47 +0000 Subject: osmo-trx[master]: Move ARCH_LA to Makefile.common In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Jan 11 09:03:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:03:49 +0000 Subject: osmo-trx[master]: tests: Migrate convtest util to autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Jan 11 09:04:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:04:37 +0000 Subject: osmo-msc[master]: msc/gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc 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 Thu Jan 11 09:04:54 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:04:54 +0000 Subject: osmo-msc[master]: msc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Thu Jan 11 09:05:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:05:06 +0000 Subject: osmo-msc[master]: msc/gsm_04_80.h: cosmetic: whitespace fix In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Thu Jan 11 09:05:31 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:05:31 +0000 Subject: osmo-msc[master]: src/libmsc/ussd.c: drop useless forward declaration In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc 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 Thu Jan 11 09:32:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 09:32:40 +0000 Subject: libosmocore[master]: Deprecate gsm48_construct_ra() In-Reply-To: References: Message-ID: Patch Set 5: This should be merged after https://gerrit.osmocom.org/#/c/5680/ -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore 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 Jan 11 10:03:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 10:03:40 +0000 Subject: [PATCH] libosmocore[master]: Allow multiple 'log gsmtap' sinks Message-ID: Review at https://gerrit.osmocom.org/5747 Allow multiple 'log gsmtap' sinks Previously we've checked for existing log target with a given hostname from vty code but it was ignored inside the check so only the very first 'log gsmtap' entry was enabled while the rest were silently ignored. Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2 --- M src/logging.c 1 file changed, 9 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/5747/1 diff --git a/src/logging.c b/src/logging.c index 20ec443..0f65b39 100644 --- a/src/logging.c +++ b/src/logging.c @@ -745,11 +745,18 @@ llist_for_each_entry(tgt, &osmo_log_target_list, entry) { if (tgt->type != type) continue; - if (tgt->type == LOG_TGT_TYPE_FILE) { + switch (tgt->type) { + case LOG_TGT_TYPE_FILE: if (!strcmp(fname, tgt->tgt_file.fname)) return tgt; - } else + break; + case LOG_TGT_TYPE_GSMTAP: + if (!strcmp(fname, tgt->tgt_gsmtap.hostname)) + return tgt; + break; + default: return tgt; + } } return NULL; } -- To view, visit https://gerrit.osmocom.org/5747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 11 10:23:50 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 10:23:50 +0000 Subject: [PATCH] libosmocore[master]: log: print loginfo assertions source Message-ID: Review at https://gerrit.osmocom.org/5748 log: print loginfo assertions source Print which function has triggered assert_loginfo(). It's handy in debugging logging-related issues in libosmocore. Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad --- M src/logging.c 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/5748/1 diff --git a/src/logging.c b/src/logging.c index 20ec443..1e0b21b 100644 --- a/src/logging.c +++ b/src/logging.c @@ -182,11 +182,11 @@ NULL, }; -static void assert_loginfo(void) +static void assert_loginfo(const char *src) { if (!osmo_log_info) { fprintf(stderr, "ERROR: osmo_log_info == NULL! " - "You must call log_init() before using logging!\n"); + "You must call log_init() before using logging in %s()!\n", src); OSMO_ASSERT(osmo_log_info); } } @@ -223,7 +223,7 @@ { int i; - assert_loginfo(); + assert_loginfo(__func__); for (i = 0; i < osmo_log_info->num_cat; ++i) { if (osmo_log_info->cat[i].name == NULL) @@ -248,7 +248,7 @@ char *mask = strdup(_mask); char *category_token = NULL; - assert_loginfo(); + assert_loginfo(__func__); /* Disable everything to enable it afterwards */ for (i = 0; i < osmo_log_info->num_cat; ++i) @@ -653,7 +653,7 @@ struct log_target *target; unsigned int i; - assert_loginfo(); + assert_loginfo(__func__); target = talloc_zero(tall_log_ctx, struct log_target); if (!target) @@ -827,7 +827,7 @@ int size = strlen("logging level () ()") + 1; char *str; - assert_loginfo(); + assert_loginfo(__func__); for (i = 0; i < info->num_cat; i++) { if (info->cat[i].name == NULL) @@ -909,7 +909,7 @@ strlen(LOGGING_STR "Set the log level for a specified category\n") + 1; - assert_loginfo(); + assert_loginfo(__func__); for (i = 0; i < info->num_cat; i++) { if (info->cat[i].name == NULL) @@ -1028,7 +1028,7 @@ { struct log_target *tar; - assert_loginfo(); + assert_loginfo(__func__); subsys = map_subsys(subsys); -- To view, visit https://gerrit.osmocom.org/5748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 11 10:23:51 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 10:23:51 +0000 Subject: [PATCH] libosmocore[master]: Log lapd_datalink state on errors Message-ID: Review at https://gerrit.osmocom.org/5749 Log lapd_datalink state on errors It's not very useful to get raw pointer address in case of lapd_datalink on receive error. Log it's state instead. Change-Id: I3141212fa74d045ee24a18eea1191d63cd15e0ed --- M src/gsm/lapd_core.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/5749/1 diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 5d87154..9b2e105 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1505,7 +1505,7 @@ /* G.2.2 Wrong value of the C/R bit */ if (lctx->cr == dl->cr.rem2loc.resp) { LOGP(DLLAPD, LOGL_ERROR, - "I frame response not allowed (dl=%p)\n", dl); + "I frame response not allowed (dl state %s)\n", lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_FRM_UNIMPL, lctx); return -EINVAL; @@ -1517,7 +1517,7 @@ * primitive with cause "I frame with incorrect length" * is sent to the mobile management entity. */ LOGP(DLLAPD, LOGL_ERROR, - "I frame length not allowed (dl=%p)\n", dl); + "I frame length not allowed (dl state %s)\n", lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_LEN, lctx); return -EIO; @@ -1529,7 +1529,7 @@ * mobile management entity. */ if (lctx->more && length < lctx->n201) { LOGP(DLLAPD, LOGL_ERROR, - "I frame with M bit too short (dl=%p)\n", dl); + "I frame with M bit too short (dl state %s)\n", lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_MBITS, lctx); return -EIO; @@ -1545,7 +1545,7 @@ case LAPD_STATE_SABM_SENT: case LAPD_STATE_DISC_SENT: LOGP(DLLAPD, LOGL_NOTICE, - "I frame ignored in this state (dl=%p)\n", dl); + "I frame ignored in state %s\n", lapd_state_name(dl->state)); msgb_free(msg); return 0; } @@ -1553,7 +1553,7 @@ /* 5.7.1: N(s) sequence error */ if (ns != dl->v_recv) { LOGP(DLLAPD, LOGL_NOTICE, "N(S) sequence error: N(S)=%u, " - "V(R)=%u (dl=%p)\n", ns, dl->v_recv, dl); + "V(R)=%u (dl state %s)\n", ns, dl->v_recv, lapd_state_name(dl->state)); /* discard data */ msgb_free(msg); if (dl->seq_err_cond != 1) { -- To view, visit https://gerrit.osmocom.org/5749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3141212fa74d045ee24a18eea1191d63cd15e0ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 11 10:29:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 10:29:48 +0000 Subject: libosmocore[master]: Allow multiple 'log gsmtap' sinks In-Reply-To: References: Message-ID: Patch Set 1: See my question to ML https://lists.osmocom.org/pipermail/openbsc/2018-January/011623.html - not sure if this should be merged. -- To view, visit https://gerrit.osmocom.org/5747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 10:49:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 10:49:35 +0000 Subject: [PATCH] osmo-ggsn[master]: Log GSN mode for unexpectde packets Message-ID: Review at https://gerrit.osmocom.org/5750 Log GSN mode for unexpectde packets Change-Id: I36ee608182523709c795d8317095ae4fda4a7858 --- M gtp/gtp.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/50/5750/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index b36e0c6..2da9084 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2785,7 +2785,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv0 Signalling Message\n"); + "[GGSN] Unexpected GTPv0 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2796,7 +2796,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv0 Signalling Message\n"); + "[SGSN] Unexpected GTPv0 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2960,7 +2960,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv1 Signalling Message\n"); + "[GGSN] Unexpected GTPv1 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } @@ -2971,7 +2971,7 @@ gsn->unexpect++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, - "Unexpected GTPv1 Signalling Message\n"); + "[SGSN] Unexpected GTPv1 Signalling Message\n"); continue; /* Silently discard 29.60: 11.1.4 */ } -- To view, visit https://gerrit.osmocom.org/5750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I36ee608182523709c795d8317095ae4fda4a7858 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 11 11:05:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 11:05:32 +0000 Subject: [MERGED] osmo-sgsn[master]: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn ...................................................................... gprs_llc: tx dl ud: make mismatching LLE not crash osmo-sgsn On 34c3, osmo-sgsn keeps restarting. At least once, it hits the assertion that this patch replaces with an error message, to not disrupt operation. Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 --- M src/gprs/gprs_llc.c 1 file changed, 9 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/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 1a7cf3d..6c92f83 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -372,8 +372,15 @@ dup.ms_ra_cap.v = mmctx->ms_radio_access_capa.buf; /* make sure we only send it to the right llme */ - OSMO_ASSERT(msgb_tlli(msg) == mmctx->gb.llme->tlli - || msgb_tlli(msg) == mmctx->gb.llme->old_tlli); + if (!(msgb_tlli(msg) == mmctx->gb.llme->tlli + || msgb_tlli(msg) == mmctx->gb.llme->old_tlli)) { + LOGP(DLLC, LOGL_ERROR, + "_bssgp_tx_dl_ud(): Attempt to send Downlink Unitdata to wrong LLME:" + " msgb_tlli=0x%x mmctx->gb.llme->tlli=0x%x ->old_tlli=0x%x\n", + msgb_tlli(msg), mmctx->gb.llme->tlli, mmctx->gb.llme->old_tlli); + msgb_free(msg); + return -EINVAL; + } } memcpy(&dup.qos_profile, qos_profile_default, sizeof(qos_profile_default)); -- To view, visit https://gerrit.osmocom.org/5662 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I07a40960920dbc594192530c3a145f9a5d2a9c81 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jan 11 11:11:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 11:11:07 +0000 Subject: python/osmo-python-tests[master]: remove osmodumpdoc.py and osmotestconfig.py from py3 install In-Reply-To: References: Message-ID: Patch Set 1: > Do you see an actual failure? Would be nice to add it to tests. Max, you could obviously see these errors by actually running the tests for once! For example: osmotestconfig.py -p /n/s/dev/make/osmo-mgw/../../src/osmo-mgw -w /n/s/dev/make/osmo-mgw -v Verifying src/osmo-mgw/osmo-mgw -c /n/s/dev/make/osmo-mgw/../../src/osmo-mgw/doc/examples/osmo-mgw/osmo-mgw.cfg, test verify_doc Opening /dev/null Launching: PWD=/n/s/dev/make/osmo-mgw 'src/osmo-mgw/osmo-mgw' '-c' '/n/s/dev/make/osmo-mgw/../../src/osmo-mgw/doc/examples/osmo-mgw/osmo-mgw.cfg' Traceback (most recent call last): File "/usr/local/bin/osmotestconfig.py", line 4, in __import__('pkg_resources').run_script('osmopython==0.0.7', 'osmotestconfig.py') File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 750, in run_script self.require(requires)[0].run_script(script_name, ns) File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1534, in run_script exec(script_code, namespace, namespace) File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/EGG-INFO/scripts/osmotestconfig.py", line 219, in File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/EGG-INFO/scripts/osmotestconfig.py", line 174, in test_all_apps File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/EGG-INFO/scripts/osmotestconfig.py", line 31, in test_config File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/EGG-INFO/scripts/osmotestconfig.py", line 61, in test_config_atest File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/EGG-INFO/scripts/osmotestconfig.py", line 114, in verify_doc File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/osmopy/obscvty.py", line 223, in command File "/usr/local/lib/python3.6/dist-packages/osmopython-0.0.7-py3.6.egg/osmopy/obscvty.py", line 179, in _common_command TypeError: a bytes-like object is required, not 'str' -- To view, visit https://gerrit.osmocom.org/5693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 11:11:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 11:11:37 +0000 Subject: [MERGED] python/osmo-python-tests[master]: remove osmodumpdoc.py and osmotestconfig.py from py3 install In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: remove osmodumpdoc.py and osmotestconfig.py from py3 install ...................................................................... remove osmodumpdoc.py and osmotestconfig.py from py3 install Install these scripts as py2 only. These scripts were added to py3 in error by commit "Improve python3 compatibility", I80e5850a8978d78cda793e2192ef4bd3fd54a121, which only addresses print() compatibility but not encoding. Recent patch Ief11b75acc973dc7aeaac9c2298a21dc5390efe4 removes osmotestvty.py from py3 installation. osmodumpdoc.py and osmotestconfig.py are still py2 for the same reasons and are also likely to fail when run as python3. Related: OS#2821 Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 --- M setup.py 1 file changed, 1 insertion(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/setup.py b/setup.py index a91274d..bab9c38 100755 --- a/setup.py +++ b/setup.py @@ -23,9 +23,7 @@ scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", "scripts/osmotestvty.py"] elif sys.version_info.major == 3: - scripts = ["scripts/osmodumpdoc.py", - "scripts/osmotestconfig.py", - "scripts/osmo_interact_vty.py", + scripts = ["scripts/osmo_interact_vty.py", "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", "scripts/soap.py", -- To view, visit https://gerrit.osmocom.org/5693 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf8fc488ae2c022f75f0ca63483d80ed701e8c40 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jan 11 11:11:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 11:11:55 +0000 Subject: [MERGED] python/osmo-python-tests[master]: cosmetic: setup.py: tweak indenting, add vim comment In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: setup.py: tweak indenting, add vim comment ...................................................................... cosmetic: setup.py: tweak indenting, add vim comment We usually do only space indenting in our py code, replace tabs with spaces. Change to one script path per line for easier patch reading in the future. Add a vim expandtab comment. Change-Id: I8a501715127c2583a630b1efb0d5316574eea173 --- M setup.py 1 file changed, 16 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/setup.py b/setup.py index bab9c38..e725334 100755 --- a/setup.py +++ b/setup.py @@ -20,16 +20,21 @@ import sys if sys.version_info.major == 2: - scripts = ["scripts/osmodumpdoc.py", "scripts/osmotestconfig.py", - "scripts/osmotestvty.py"] + scripts = [ + "scripts/osmodumpdoc.py", + "scripts/osmotestconfig.py", + "scripts/osmotestvty.py", + ] elif sys.version_info.major == 3: - scripts = ["scripts/osmo_interact_vty.py", - "scripts/osmo_interact_ctrl.py", - "scripts/osmo_ctrl.py", - "scripts/soap.py", - "scripts/twisted_ipa.py", - "scripts/osmo_verify_transcript_vty.py", - "scripts/osmo_verify_transcript_ctrl.py"] + scripts = [ + "scripts/osmo_interact_vty.py", + "scripts/osmo_interact_ctrl.py", + "scripts/osmo_ctrl.py", + "scripts/soap.py", + "scripts/twisted_ipa.py", + "scripts/osmo_verify_transcript_vty.py", + "scripts/osmo_verify_transcript_ctrl.py", + ] setup( name = 'osmopython', @@ -41,3 +46,5 @@ author = "Katerina Barone-Adesi", author_email = "kat.obsc at gmail.com" ) + +# vim: expandtab tabstop=4 shiftwidth=4 -- To view, visit https://gerrit.osmocom.org/5694 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a501715127c2583a630b1efb0d5316574eea173 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests 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 Jan 11 11:12:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 11:12:02 +0000 Subject: [MERGED] python/osmo-python-tests[master]: cosmetic: setup.py: move osmo_interact_* next to osmo_verify_* In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: setup.py: move osmo_interact_* next to osmo_verify_* ...................................................................... cosmetic: setup.py: move osmo_interact_* next to osmo_verify_* Those scripts are semantically closely related, so place them next to each other. Change-Id: Id7380f9d536c83ee1d612457af423dde9b96f5ad --- M setup.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/setup.py b/setup.py index e725334..3c12327 100755 --- a/setup.py +++ b/setup.py @@ -27,11 +27,11 @@ ] elif sys.version_info.major == 3: scripts = [ - "scripts/osmo_interact_vty.py", - "scripts/osmo_interact_ctrl.py", "scripts/osmo_ctrl.py", "scripts/soap.py", "scripts/twisted_ipa.py", + "scripts/osmo_interact_vty.py", + "scripts/osmo_interact_ctrl.py", "scripts/osmo_verify_transcript_vty.py", "scripts/osmo_verify_transcript_ctrl.py", ] -- To view, visit https://gerrit.osmocom.org/5695 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7380f9d536c83ee1d612457af423dde9b96f5ad Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests 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 Jan 11 11:46:20 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 11:46:20 +0000 Subject: osmo-msc[master]: Permit a set of multiple different A5 ciphers In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) +2 if the default a5_encryption should really change https://gerrit.osmocom.org/#/c/5559/2/src/libcommon-cs/common_cs.c File src/libcommon-cs/common_cs.c: Line 60: net->a5_encryption_mask = (1 << 3) | (1 << 1); before, the default was to do no encryption (a5_encryption == 0), do you intend to change that? Otherwise | (1 << 0) I guess https://gerrit.osmocom.org/#/c/5559/2/src/libcommon-cs/common_cs_vty.c File src/libcommon-cs/common_cs_vty.c: Line 160: "GSM A5 Air Interface Encryption\n" (might be nice to keep the doc of '0: no encryption' ... not sure how helpful the others really are) -- To view, visit https://gerrit.osmocom.org/5559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc 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 Thu Jan 11 12:01:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 11 Jan 2018 12:01:33 +0000 Subject: osmo-msc[master]: MSC: Intersect configured A5 algorithms with MS-supported ones In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) maybe fix that spec ref and merge https://gerrit.osmocom.org/#/c/5560/2/src/libmsc/gsm_04_08.c File src/libmsc/gsm_04_08.c: Line 113: /* See 3GPP TS 24.008 10.5.1.7 */ cm 1 is 10.5.1.5 Line 124: case 2: spec says for A5/2: "The MS shall set this bit to ?0?.", might deserve a comment like above -- To view, visit https://gerrit.osmocom.org/5560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc 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 Thu Jan 11 12:50:08 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 12:50:08 +0000 Subject: [MERGED] osmo-bsc[master]: Implement support for paging by LAI. In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Implement support for paging by LAI. ...................................................................... Implement support for paging by LAI. Also, parse the complete cell identifier list for both LAC and LAI. Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 3 files changed, 118 insertions(+), 48 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 0ecc11c..54e0205 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,21 +228,52 @@ return 0; } +/* Page a subscriber based on TMSI and LAC. + * A non-zero return value indicates a fatal out of memory condition. */ +static int +page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, + const char *mi_string, uint8_t chan_needed) +{ + struct bsc_subscr *subscr; + + subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, + mi_string); + if (!subscr) { + LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); + return -1; + } + + subscr->lac = lac; + subscr->tmsi = tmsi; + + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, + subscr, chan_needed, msc); + + /* the paging code has grabbed its own references */ + bsc_subscr_put(subscr); + + return 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) { - struct bsc_subscr *subscr; struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; - unsigned int lac; + uint16_t lac, *lacp_be; + uint16_t mcc; + uint16_t mnc; uint8_t data_length; + int remain; const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); + remain = payload_length - 1; if (!TLVP_PRESENT(&tp, GSM0808_IE_IMSI)) { LOGP(DMSC, LOGL_ERROR, "Mandatory IMSI not present.\n"); @@ -251,6 +282,7 @@ LOGP(DMSC, LOGL_ERROR, "Wrong content in the IMSI\n"); return -1; } + remain -= TLVP_LEN(&tp, GSM0808_IE_IMSI); if (!TLVP_PRESENT(&tp, GSM0808_IE_CELL_IDENTIFIER_LIST)) { LOGP(DMSC, LOGL_ERROR, "Mandatory CELL IDENTIFIER LIST not present.\n"); @@ -260,6 +292,12 @@ if (TLVP_PRESENT(&tp, GSM0808_IE_TMSI) && TLVP_LEN(&tp, GSM0808_IE_TMSI) == 4) { tmsi = ntohl(tlvp_val32_unal(&tp, GSM0808_IE_TMSI)); + remain -= TLVP_LEN(&tp, GSM0808_IE_TMSI); + } + + if (remain <= 0) { + LOGP(DMSC, LOGL_ERROR, "Payload too short.\n"); + return -1; } /* @@ -280,38 +318,12 @@ LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Zero length Cell Identifier List\n", mi_string); return -1; + } else if (data_length > remain) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Bogus Cell Identifier List length\n", + mi_string); + return -1; } - - cell_ident = data[0] & 0xf; - - /* Default fallback: page entire BSS */ - lac = GSM_LAC_RESERVED_ALL_BTS; - - switch (cell_ident) { - case CELL_IDENT_LAC: - if (data_length != 3) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for LAC (0x%x)" - " has invalid length: %u, paging entire BSS instead (%s)\n", - mi_string, CELL_IDENT_LAC, data_length, osmo_hexdump(data, data_length)); - break; - } - lac = osmo_load16be(&data[1]); - break; - - case CELL_IDENT_BSS: - if (data_length != 1) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" - " has invalid length: %u, paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); - } - break; - - default: - LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," - " paging entire BSS instead (%s)\n", - mi_string, cell_ident, osmo_hexdump(data, data_length)); - break; - } + remain = data_length; /* ignore payload padding data beyond data_length */ if (TLVP_PRESENT(&tp, GSM0808_IE_CHANNEL_NEEDED) && TLVP_LEN(&tp, GSM0808_IE_CHANNEL_NEEDED) == 1) chan_needed = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_NEEDED)[0] & 0x03; @@ -320,22 +332,70 @@ LOGP(DMSC, LOGL_ERROR, "eMLPP is not handled\n"); } - subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, - mi_string); - if (!subscr) { - LOGP(DMSC, LOGL_ERROR, "Failed to allocate a subscriber for %s\n", mi_string); - return -1; + cell_ident = data[0] & 0xf; + remain -= 1; /* cell ident consumed */ + + /* Default fallback: page entire BSS */ + lac = GSM_LAC_RESERVED_ALL_BTS; + + switch (cell_ident) { + case CELL_IDENT_LAI_AND_LAC: { + struct gsm48_loc_area_id lai; + int i = 0; + while (remain >= sizeof(lai)) { + /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). + * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + memcpy(&lai, &data[1 + i * sizeof(lai)], sizeof(lai)); /* don't byte swap yet */ + if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + + remain -= sizeof(lai); + i++; + } + break; } - subscr->lac = lac; - subscr->tmsi = tmsi; + case CELL_IDENT_LAC: + lacp_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*lacp_be)) { + lac = osmo_load16be(lacp_be); + if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + break; + remain -= sizeof(*lacp_be); + lacp_be++; + } + break; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + case CELL_IDENT_BSS: + if (data_length != 1) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Cell Identifier List for BSS (0x%x)" + " has invalid length: %u, paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); + } + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; - /* the paging code has grabbed its own references */ - bsc_subscr_put(subscr); + default: + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," + " paging entire BSS instead (%s)\n", + mi_string, cell_ident, osmo_hexdump(data, data_length)); + if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + break; + break; + } return 0; } diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index 579cae2..c97393d 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -73,6 +73,11 @@ /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ GSM_LAC_RESERVED_ALL_BTS, 0 }, + { + "001952080859512069000743940904010844601a060400f1100065", + /* ^^^^^^^^^^^^ Cell Identifier List: LAI */ + 0x65, 0 + }, }; void test_cell_identifier() diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index 1c432eb..f24ff7c 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -16,7 +16,12 @@ 2: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 15 f5 49 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging IMSI 515029600703449: unimplemented Cell Identifier List (0x4), paging entire BSS instead (04 15 f5 49 00 65 ) -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe -BSC paging started on entire BSS (65534) +DMSC Not paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) +bsc_handle_udt() returned 0 + +3: +DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 +DMSC Rx MSC UDT BSSMAP PAGING +DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5698 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 12:54:33 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 12:54:33 +0000 Subject: [PATCH] osmo-bsc[master]: Add TAGS files (produced by 'make tags') to .gitignore file. Message-ID: Review at https://gerrit.osmocom.org/5751 Add TAGS files (produced by 'make tags') to .gitignore file. Change-Id: If5592cb0b5de018b7b9c06955f2e34d1f666530e --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/51/5751/1 diff --git a/.gitignore b/.gitignore index 3481bad..4def47a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ *.gcda *.gcno +**/TAGS + #configure aclocal.m4 autom4te.cache/ -- To view, visit https://gerrit.osmocom.org/5751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If5592cb0b5de018b7b9c06955f2e34d1f666530e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 14:39:25 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 14:39:25 +0000 Subject: [PATCH] osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... Message-ID: Review at https://gerrit.osmocom.org/5752 Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c. We can now either page an invidual BTS directly or page several BTS in a given location area. This decision is taken based on the contents of the cell identifier list in the paging request. Select a set of BTS for paging while processing the cell identifier list, rather than requiring the paging layer to loop over all BTS in the MSC. This change requires some adjustment in bssap_test. In particular, this test must now add a BTS to its network in order to pass. No funtional change is intended. The purpose of this change is to make the layering a bit cleaner. Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Suggested-by: Harald Welte Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Related: OS#2753 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 35 insertions(+), 66 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/52/5752/1 diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 2b1bc50..2be71c3 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -56,8 +56,6 @@ }; /* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc); int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 0dd4ee5..26887f3 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,14 +228,16 @@ return 0; } -/* Page a subscriber based on TMSI and LAC in the specified MSC. - * If BTS is not NULL, page the subscriber via this particular BTS. - * A non-zero return value indicates a fatal out of memory condition. */ +/* Page a subscriber based on TMSI and LAC via the specified BTS. + * The msc parameter is the MSC which issued the corresponding paging request. + * Returns 1 if the paging request could be issued, 0 if not. + * A negative return value indicates a fatal out of memory condition. */ static int page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; + int ret; subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, mi_string); @@ -247,19 +249,15 @@ subscr->lac = lac; subscr->tmsi = tmsi; - if (bts) - LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", - bts->nr, mi_string, tmsi, tmsi, lac); - else - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc, bts); + ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); - return 0; + return ret; } /* GSM 08.08 ? 3.2.1.19 */ @@ -277,6 +275,7 @@ const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; + struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -349,7 +348,6 @@ uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { uint16_t ci = osmo_load16be(ci_be); - struct gsm_bts *bts; llist_for_each_entry(bts, &msc->network->bts_list, list) { if (bts->cell_identity == ci) @@ -357,11 +355,12 @@ } if (bts) { - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) break; } else LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", mi_string, ci); + remain -= sizeof(*ci_be); ci_be++; } @@ -382,13 +381,16 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) break; + } } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - remain -= sizeof(lai); i++; } @@ -399,8 +401,12 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } remain -= sizeof(*lacp_be); lacp_be++; } @@ -412,16 +418,20 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) < 0) + break; + } break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) < 0) + break; + } break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 93ca9b9..705933c 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -34,22 +34,6 @@ } -static int normal_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - /* we can't page by lac.. we need to page everything */ - if (msc->core_lac != -1) { - struct gsm_bts *bts; - - llist_for_each_entry(bts, &msc->network->bts_list, list) - paging_request_bts(bts, subscr, chan_needed, msc); - - return 0; - } - - return paging_request(msc->network, subscr, chan_needed, msc); -} - /* Return value is like paging_request_bts(): * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ static int locked_paging_bts(struct gsm_bts *bts, @@ -68,31 +52,14 @@ return paging_request_bts(bts, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - int num_pages = 0; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - * All other bts are either off or in the grace period. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) - num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); - - return num_pages; -} - /** * Page a subscriber in an MSC. * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock * \param[in] subscr subscriber we want to page * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE * \param[in] msc MSC which has issued this paging - * \param[in] bts if not NULL, page via this particular BTS - * \returns number of BTS on which we issued the paging + * \param[in] bts The BTS to issue the paging on + * \returns 1 if paging was issued to the BTS, 0 if not */ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, @@ -100,15 +67,9 @@ struct bsc_msc_data *msc, struct gsm_bts *bts) { - if (bts) { - if (rf_policy == S_RF_ON) - return paging_request_bts(bts, subscr, chan_needed, msc); - return locked_paging_bts(bts, subscr, chan_needed, msc); - } - if (rf_policy == S_RF_ON) - return normal_paging(subscr, chan_needed, msc); - return locked_paging(subscr, chan_needed, msc); + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); } static int handle_sub(struct gsm_lchan *lchan, const char *text) -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 14:40:10 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 14:40:10 +0000 Subject: osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/5705/5/include/osmocom/bsc/osmo_bsc_grace.h File include/osmocom/bsc/osmo_bsc_grace.h: Line 34: struct gsm_bts *bts); > I think API-wise this might end up rather confusing. So either the BTS sel See https://gerrit.osmocom.org/#/c/5752/ Does this correspond to what you had in mind? -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 11 14:41:24 2018 From: gerrit-no-reply at lists.osmocom.org (Minh-Quang Nguyen) Date: Thu, 11 Jan 2018 14:41:24 +0000 Subject: [PATCH] osmo-bts[master]: LC15: Fix missing fill frame and GSM 05.08 mandatory frame Message-ID: Review at https://gerrit.osmocom.org/5753 LC15: Fix missing fill frame and GSM 05.08 mandatory frame Problem: We have noticed that the LC15 BTS does not send L2 fill frame in case there is nothing to transmit. This leads to bad RXQUAL repored by MS during signaling in TCH channel. Related issue: https://osmocom.org/issues/1950 Fixes: BTS needs to send L2 fill frame in case there is nothing to transmit as indicated in GSM 05.08, section 8.3. "On any TCH this subset of TDMA frames is always used for transmission during DTX. For speech, when no signalling or speech is to be transmitted these TDMA frames are occupied by the SID (Silence Descriptor) speech frame, see TS GSM 06.12 and TSM GSM 06.31 for detailed specification of the SID frame and its transmission requirements. In other cases when no information is required to be transmitted, e.g. on data channels, the L2 fill frame (see GSM 04.06 section 5.4.2.3) shall be transmitted as a FACCH in the TDMA frame subset always to be transmitted. On the SDCCH and on the half rate speech traffic channel in signalling only mode DTX is not allowed. In these cases and during signalling on the TCH when DTX is not used, the same L2 fill frame shall be transmitted in case there is nothing else to transmit." Change-Id: I40e9bf9438c0b400e4d29eb39ffae37207e34db6 --- M include/osmo-bts/msg_utils.h M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c 3 files changed, 119 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/5753/1 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 7ddbe88..24534ac 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -32,6 +32,17 @@ OML_MSG_TYPE_OSMO, }; +static const uint8_t gsm_speech_zero[GSM_FR_BYTES] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00 +}; + +static const uint8_t amr_sid_first_zero[9] = { + 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00 +}; + void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index f936c98..41fe990 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -379,7 +379,7 @@ static const uint8_t f[] = { 52, 53, 54, 55, 56, 57, 58, 59 }, h0[] = { 0, 2, 4, 6, 52, 54, 56, 58 }, h1[] = { 14, 16, 18, 20, 66, 68, 70, 72 }; - if (lchan->tch_mode == GSM48_CMODE_SPEECH_V1) { + if ((lchan->tch_mode == GSM48_CMODE_SPEECH_V1) || (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR)){ if (lchan->type == GSM_LCHAN_TCH_F) return fn_chk(f, fn, ARRAY_SIZE(f)); else @@ -465,6 +465,7 @@ */ uint8_t repeat_last_sid(struct gsm_lchan *lchan, uint8_t *dst, uint32_t fn) { + uint8_t pl_len; /* FIXME: add EFR support */ if (lchan->tch_mode == GSM48_CMODE_SPEECH_EFR) return 0; @@ -472,11 +473,54 @@ if (lchan->tch_mode != GSM48_CMODE_SPEECH_AMR) { if (dtx_sched_optional(lchan, fn)) return 0; - } else + else { + if (lchan->ts->trx->bts->dtxd) { + /* Need to send zeroed TCH frame on mandatory Fn defined in GSM 05.08, section 8.3 */ + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + pl_len = GSM_FR_BYTES; + break; + case GSM_LCHAN_TCH_H: + pl_len = GSM_HR_BYTES; + break; + default: + return 0; + } + memcpy(dst, gsm_speech_zero, pl_len); + + LOGP(DL1C, LOGL_DEBUG, "%s Have to send %s %s zero speech frame, Fn=%d, Fn mod 104=%d, dump=%s\n", + gsm_lchan_name(lchan), + get_value_string(gsm_chan_t_names, lchan->type), + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + fn, + fn%104, + osmo_hexdump(dst, pl_len)); + return pl_len + 1; + } + } + } else { + if (!dtx_sched_optional(lchan, fn) && (lchan->rsl_cmode == RSL_CMOD_SPD_SPEECH)) { + if (!(lchan->tch.dtx.len)) { + pl_len = 9; + /* Send zero SID FIRST frame */ + memcpy(dst, amr_sid_first_zero, pl_len); + LOGP(DL1C, LOGL_DEBUG, "%s Have to send %s %s zero speech frame, Fn=%d, Fn mod 104=%d, dump=%s\n", + gsm_lchan_name(lchan), + get_value_string(gsm_chan_t_names, lchan->type), + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + fn, + fn%104, + osmo_hexdump(dst, pl_len)); + return pl_len + 1; /* plus one to take into account of payload type */ + } + } + if (dtx_amr_sid_optional(lchan, fn)) return 0; + } if (lchan->tch.dtx.len) { + if (dtx_dl_amr_enabled(lchan)) { if ((lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F2) || @@ -502,11 +546,17 @@ } memcpy(dst, lchan->tch.dtx.cache, lchan->tch.dtx.len); lchan->tch.dtx.fn = fn; + LOGP(DL1C, LOGL_DEBUG, "%s Have to send %s SID buffer " + "%s\n", + gsm_lchan_name(lchan), + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + osmo_hexdump(lchan->tch.dtx.cache, lchan->tch.dtx.len)); return lchan->tch.dtx.len + 1; } - LOGP(DL1C, LOGL_DEBUG, "Have to send %s frame on TCH but SID buffer " + LOGP(DL1C, LOGL_DEBUG, "%s Have to send %s frame on TCH but SID buffer " "is empty - sent nothing\n", + gsm_lchan_name(lchan), get_value_string(gsm48_chan_mode_names, lchan->tch_mode)); return 0; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 12c2470..6438c54 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -331,6 +331,49 @@ return empty_req; } +/* fill frame PH-DATA.req from l1sap primitive */ +static GsmL1_PhDataReq_t * +fill_req_from_l1sap(GsmL1_Prim_t *l1p, struct lc15l1_hdl *fl1, + uint8_t tn, uint32_t fn, uint8_t sapi, uint8_t sub_ch, + uint8_t block_nr) +{ + GsmL1_PhDataReq_t *data_req = &l1p->u.phDataReq; + GsmL1_MsgUnitParam_t *msu_param; + uint8_t *l1_payload; + + msu_param = &data_req->msgUnitParam; + l1_payload = &msu_param->u8Buffer[0]; + l1p->id = GsmL1_PrimId_PhDataReq; + + memset(l1_payload, 0x2B, GSM_MACBLOCK_LEN); + /* address field */ + l1_payload[0] = 0x03; + /* control field */ + l1_payload[1] = 0x03; + /* length field */ + l1_payload[2] = 0x01; + + /* copy fields from PH-RTS.ind */ + data_req->hLayer1 = (HANDLE)fl1->hLayer1; + data_req->u8Tn = tn; + data_req->u32Fn = fn; + data_req->sapi = sapi; + data_req->subCh = sub_ch; + data_req->u8BlockNbr = block_nr; + data_req->msgUnitParam.u8Size = GSM_MACBLOCK_LEN; + + + LOGP(DL1C, LOGL_DEBUG, "Send fill frame on in none DTX mode Tn=%d, Fn=%d, SAPI=%d, SubCh=%d, BlockNr=%d dump=%s\n", + tn, + fn, + sapi, + sub_ch, + block_nr, + osmo_hexdump(data_req->msgUnitParam.u8Buffer, data_req->msgUnitParam.u8Size)); + + return data_req; +} + static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg, struct osmo_phsap_prim *l1sap, bool use_cache) { @@ -461,10 +504,19 @@ osmo_hexdump(l1p->u.phDataReq.msgUnitParam.u8Buffer, l1p->u.phDataReq.msgUnitParam.u8Size)); } else { - /* empty frame */ - GsmL1_Prim_t *l1p = msgb_l1prim(l1msg); - empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); + GsmL1_Prim_t *l1p = msgb_l1prim(l1msg); + if (lchan->rsl_cmode == RSL_CMOD_SPD_SIGN) + /* fill frame */ + fill_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); + else { + if (lchan->ts->trx->bts->dtxd) + /* empty frame */ + empty_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); + else + /* fill frame */ + fill_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr); + } } /* send message to DSP's queue */ -- To view, visit https://gerrit.osmocom.org/5753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40e9bf9438c0b400e4d29eb39ffae37207e34db6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Thu Jan 11 14:43:16 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 14:43:16 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC tri... In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet. ...................................................................... Fix f_enc_mcc_mnc() to return a properly encoded MCC/MNC triple octet. With help from Daniel Willmann. Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Related: OS#2754 --- M library/BSSMAP_Templates.ttcn 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/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index cb6dde8..f452263 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -648,7 +648,7 @@ } private function f_enc_mcc_mnc(GsmMcc mcc, GsmMnc mnc) return OCT3 { - return hex2oct(mcc[1] & mcc[0] & mnc[0] & mnc[2] & mnc[1]); + return hex2oct(mcc[1] & mcc[0] & mnc[2] & mcc[2] & mnc[1] & mnc[0]); } template BSSMAP_FIELD_CellIdentification_CGI ts_BSSMAP_CI_CGI(GsmMcc mcc, GsmMnc mnc, GsmLac lac, GsmCellId ci) := { -- To view, visit https://gerrit.osmocom.org/5684 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99a5317e425d15acd463aa94c683676cacd54e0b Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 14:48:19 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 14:48:19 +0000 Subject: [PATCH] osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5752 to look at the new patch set (#2). Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c. We can now either page an invidual BTS directly or page several BTS in a given location area. This decision is taken based on the contents of the cell identifier list in the paging request. Select a set of BTS for paging while processing the cell identifier list, rather than requiring the paging layer to loop over all BTS in the MSC. This change requires some adjustment in bssap_test. In particular, this test must now add a BTS to its network in order to pass. No funtional change is intended. The purpose of this change is to make the layering a bit cleaner. Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Suggested-by: Harald Welte Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Related: OS#2753 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 5 files changed, 49 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/52/5752/2 diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 2b1bc50..2be71c3 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -56,8 +56,6 @@ }; /* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc); int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 0dd4ee5..26887f3 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,14 +228,16 @@ return 0; } -/* Page a subscriber based on TMSI and LAC in the specified MSC. - * If BTS is not NULL, page the subscriber via this particular BTS. - * A non-zero return value indicates a fatal out of memory condition. */ +/* Page a subscriber based on TMSI and LAC via the specified BTS. + * The msc parameter is the MSC which issued the corresponding paging request. + * Returns 1 if the paging request could be issued, 0 if not. + * A negative return value indicates a fatal out of memory condition. */ static int page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; + int ret; subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, mi_string); @@ -247,19 +249,15 @@ subscr->lac = lac; subscr->tmsi = tmsi; - if (bts) - LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", - bts->nr, mi_string, tmsi, tmsi, lac); - else - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc, bts); + ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); - return 0; + return ret; } /* GSM 08.08 ? 3.2.1.19 */ @@ -277,6 +275,7 @@ const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; + struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -349,7 +348,6 @@ uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { uint16_t ci = osmo_load16be(ci_be); - struct gsm_bts *bts; llist_for_each_entry(bts, &msc->network->bts_list, list) { if (bts->cell_identity == ci) @@ -357,11 +355,12 @@ } if (bts) { - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) break; } else LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", mi_string, ci); + remain -= sizeof(*ci_be); ci_be++; } @@ -382,13 +381,16 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) break; + } } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - remain -= sizeof(lai); i++; } @@ -399,8 +401,12 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } remain -= sizeof(*lacp_be); lacp_be++; } @@ -412,16 +418,20 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) < 0) + break; + } break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) < 0) + break; + } break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 93ca9b9..705933c 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -34,22 +34,6 @@ } -static int normal_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - /* we can't page by lac.. we need to page everything */ - if (msc->core_lac != -1) { - struct gsm_bts *bts; - - llist_for_each_entry(bts, &msc->network->bts_list, list) - paging_request_bts(bts, subscr, chan_needed, msc); - - return 0; - } - - return paging_request(msc->network, subscr, chan_needed, msc); -} - /* Return value is like paging_request_bts(): * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ static int locked_paging_bts(struct gsm_bts *bts, @@ -68,31 +52,14 @@ return paging_request_bts(bts, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - int num_pages = 0; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - * All other bts are either off or in the grace period. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) - num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); - - return num_pages; -} - /** * Page a subscriber in an MSC. * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock * \param[in] subscr subscriber we want to page * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE * \param[in] msc MSC which has issued this paging - * \param[in] bts if not NULL, page via this particular BTS - * \returns number of BTS on which we issued the paging + * \param[in] bts The BTS to issue the paging on + * \returns 1 if paging was issued to the BTS, 0 if not */ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, @@ -100,15 +67,9 @@ struct bsc_msc_data *msc, struct gsm_bts *bts) { - if (bts) { - if (rf_policy == S_RF_ON) - return paging_request_bts(bts, subscr, chan_needed, msc); - return locked_paging_bts(bts, subscr, chan_needed, msc); - } - if (rf_policy == S_RF_ON) - return normal_paging(subscr, chan_needed, msc); - return locked_paging(subscr, chan_needed, msc); + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); } static int handle_sub(struct gsm_lchan *lchan, const char *text) diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index c97393d..1d8fe77 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -41,9 +42,9 @@ /* override, requires '-Wl,--wrap=bsc_grace_paging_request' */ int __real_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, struct gsm_bts *bts); int __wrap_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) + struct bsc_msc_data *msc, struct gsm_bts *bts) { if (subscr->lac == GSM_LAC_RESERVED_ALL_BTS) fprintf(stderr, "BSC paging started on entire BSS (%u)\n", subscr->lac); @@ -86,6 +87,7 @@ int rc; struct gsm_network *net; struct bsc_msc_data *msc; + struct gsm_bts *bts; net = bsc_network_init(NULL, 1, 1); net->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf); @@ -93,6 +95,12 @@ msc = talloc_zero(net, struct bsc_msc_data); msc->network = net; + + bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_UNKNOWN, 0); + if (bts == NULL) { + fprintf(stderr, "gsm_bts_alloc_register() returned NULL\n"); + return; + } log_set_log_level(osmo_stderr_target, LOGL_DEBUG); @@ -102,6 +110,7 @@ msg = msgb_from_hex("test_cell_identifier", 1024, cell_identifier_tests[i].msg); gl_expect_lac = cell_identifier_tests[i].expect_lac; + bts->location_area_code = (gl_expect_lac == GSM_LAC_RESERVED_ALL_BTS ? 0 : gl_expect_lac); rc = bsc_handle_udt(msc, msg, msgb_l2len(msg)); fprintf(stderr, "bsc_handle_udt() returned %d\n", rc); diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index f24ff7c..abe1def 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -2,14 +2,14 @@ 0: DMSC Rx MSC UDT: 00 16 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 03 05 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 1: DMSC Rx MSC UDT: 00 14 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 01 06 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe BSC paging started on entire BSS (65534) bsc_handle_udt() returned 0 @@ -22,6 +22,6 @@ 3: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 14:52:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 14:52:05 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: add message sequence chart MS/BTS/BSC/MSC for 3GPP aoIP MO call Message-ID: Review at https://gerrit.osmocom.org/5754 add message sequence chart MS/BTS/BSC/MSC for 3GPP aoIP MO call Change-Id: I7e41234cfe1483bb73589dc959851a54f9aafa36 --- A OsmoBSC/message-sequences/mo_call-abis_a.msc 1 file changed, 146 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/54/5754/1 diff --git a/OsmoBSC/message-sequences/mo_call-abis_a.msc b/OsmoBSC/message-sequences/mo_call-abis_a.msc new file mode 100644 index 0000000..4597ab1 --- /dev/null +++ b/OsmoBSC/message-sequences/mo_call-abis_a.msc @@ -0,0 +1,146 @@ +msc { + hscale=2; + ms [label="MS"], + bts [label="BTS"], + bsc_l [label="BSC(lchan SDCCH)"], + bsc_l2 [label="BSC(lchan TCH)"], + bsc [label="BSC"], + mgw [label="MGW at BSC"], + m_sc [label="MSC"]; + + ...; + --- [label="MS Requests dedicated channel"]; + ms -> bts [label="RACH: REQ"]; + bts -> bsc [label="RSL Cchan CHAN RQD"]; + bsc_l <= bsc [label="allocate lchan (RR IMM ASS)", textcolor="red", linecolor="red"]; + bts <- bsc_l [label="RSL Dchan (SDCCH) CHAN ACT"]; + bts -> bsc_l [label="RSL Dchan (SDCCH) CHAN ACT ACK"]; + bts <- bsc_l [label="RSL Cchan IMM ASS (RR IMM ASS)"]; + bsc_l box bsc_l [label="Start T3101"]; + ms <- bts [label="AGCH: RR IMM ASS"]; + --- [label="MS Establishes SDCCH"]; + ms -> bts [label="SDCCH: SABM (CM SERV REQ)"]; + ms <- bts [label="SDCCH: UA (CM SERV REQ)"]; + bts -> bsc_l [label="RSL RLL (SDCCH, SAPI0, DCCH) EST IND", textcolor="green", linecolor="green"]; + bsc_l box bsc_l [label="Stop T3101"]; + bsc_l => bsc [label="GSCON_EV_A_CONN_REQ", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP CR (BSSMAP COMPL L3 (CM SERV REQ))"]; + bsc <- m_sc [label="SCCP CC"]; + bsc -> bsc [label="GSCON_EV_A_CONN_CFM", textcolor="red", linecolor="red"]; + ms box m_sc [label="Authentication, MM info, ..."]; + bsc <- m_sc [label="SCCP DT1 (DTAP (CM SERV ACK)"]; + bsc -> bsc [label="GSCON_EV_MT_DTAP", textcolor="red", linecolor="red"]; + bsc_l <= bsc [label="lchan_submit_dtap(CM SERV ACK)", textcolor="red", linecolor="red"]; + bts <- bsc_l [label="RSL RLL (SDCCH) DATA REQ (CM SERV ACK)", textcolor="green", linecolor="green"]; + ms <- bts [label="SDCCH: I (CM SERV ACK)"]; + ms -> bts [label="SDCCH: I (CC SETUP)"]; + bts -> bsc_l [label="RSL RLL (SDCCH) DATA IND (CC SETUP)", textcolor="green", linecolor="green"]; + bsc_l -> bsc [label="GSCON_EV_MO_DTAP", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP DT1 (DTAP (CC SETUP))"]; + ...; + + --- [label="MSC assigns Voice Channel (TCH)"]; + bsc <- m_sc [label="SCCP DT1 (BSSMAP ASSIGNMENT CMD)"]; + bsc -> bsc [label="GSCON_EV_A_ASSIGNMENT_CMD", textcolor="red", linecolor="red"]; + bsc_l2 <= bsc [label="allocate lchan", textcolor="red", linecolor="red"]; + bts <- bsc_l2 [label="RSL Dchan (TCH) CHAN ACT"]; + bts -> bsc_l2 [label="RSL Dchan (TCH) CHAN ACT ACK"]; + bts <- bsc_l [label="RSL RLL (SDDCH) DATA REQ (RR ASSIGNMENT CMD)", textcolor="green", +linecolor="green"]; + bsc_l2 box bsc_l2 [label="Start T3107"]; + ms <- bts [label="SDCCH: I (RR ASSIGNMENT CMD)"]; + ms box ms [label="local-end RLL release", textcolor="green", linecolor="green"]; + bts -> bsc_l [label="RSL RLL (SDCCH) REL IND", textcolor="gray", linecolor="green"]; + bsc_l => bsc [label="GSCON_EV_RLL_REL_IND", textcolor="gray", linecolor="red"]; + bts -> bsc_l [label="RSL Dchan (SDCCH) CONN FAIL IND", textcolor="gray", linecolor="green"]; + bsc_l => bsc [label="GSCON_EV_CONN_FAIL", textcolor="gray", linecolor="red"]; + bsc_l box bsc_l [label="BSC must ignore failures on old channel"]; + ms -> bts [label="TCH: SABM (RR ASSIGNMENT CMPL)"]; + ms <- bts [label="TCH: UA (RR ASSIGNMENT CMPL)"]; + bts -> bsc_l2 [label="RSL RLL (TCH, SAPI0, DCCH) EST IND", textcolor="green", linecolor="green"]; + bsc_l2 box bsc_l2 [label="Stop T3107"]; + bsc_l2 => bsc [label="GSCON_EV_RR_ASS_COMPL", textcolor="red", linecolor="red"]; + + bsc_l <= bsc [label="release_lchan(SDCCH)", textcolor="red", linecolor="red"]; + bts box bsc_l [label="local-end RLL release", textcolor="green", linecolor="green"]; + bts <- bsc_l [label="RSL Dchan (SDCCH) RF CHAN REL"]; + bts <- bsc_l [label="RSL RLL (SDCCH, SAPI0, DCCH) REL REQ", textcolor="gray", linecolor="green"]; + bts <- bsc_l [label="RSL DChan (SDCCH) DEACTIVATE SACCH", textcolor="gray", linecolor="black"]; + bts -> bsc_l [label="RSL RLL (SDCCH, SAPI0, DCCH) RF FAIL IND", textcolor="gray", linecolor="green"]; + bts -> bsc_l [label="RSL Dchan (SDCCH, SAPI0, DCCH) RF CHAN REL ACK"]; + + # connect BTS RTP with BSC-MGW RTP + --- [label="BSC configures RTP on BTS and both sides of MGW"]; + bts <- bsc [label="RSL IPA CRCX", textcolor="blue", linecolor="blue"]; + bts box bts [label="Bind to BTS-local RTP Port (1000)", textcolor="blue", linecolor="blue"]; + bts -> bsc [label="IPA CRCX ACK (BTS:1000)", textcolor="blue", linecolor="blue"]; + bsc -> mgw [label="MGCP CRCX rtpbridge/2 at mgw (BTS:1000)", textcolor="blue", linecolor="blue"]; + mgw box mgw [label="Bind to MGW-local RTP Port (2000)\nConnect to BTS:1000", textcolor="blue", linecolor="blue"]; + bsc <- mgw [label="MGCP CRCX rtpbridge/2 at mgw OK (MGW:2000)", textcolor="blue", linecolor="blue"]; + bts <- bsc [label="IPA MDCX (MGW:2000)", textcolor="blue", linecolor="blue"]; + bts box bts [label="Connect RTP socket to remote (MGW) RTP Port", textcolor="blue", linecolor="blue"]; + bts -> bsc [label="IPA MDCX ACK", textcolor="blue", linecolor="blue"]; + bsc >> mgw [label="MGCP MDCX rtpbridge/2 at mgw", textcolor="gray", linecolor="gray"]; + bsc << mgw [label="MGCP MDCX rtpbridge/2 at mgw OK", textcolor="gray", linecolor="gray"]; + ...; + + --- [label="BSC finally can report successful TCH assignment"]; + bsc -> m_sc [label="SCCP DT1 (BSSMAP ASSGN CMPL (3GPP AoIP MGW:3000))"]; + m_sc box m_sc [label="Connect remote RTP to MGW addr from ASSGN CMPL"]; + ...; + + mgw <-> m_sc [label="RTP Audio MGW:3000 MSC:4000", textcolor="blue", linecolor="blue"]; + bts <-> mgw [label="RTP Audio BTS:1000 MGW:2000", textcolor="blue", linecolor="blue"]; + ms <-> bts [label="Um Audio (bidirectional)", textcolor="blue", linecolor="blue"]; + ms <-> m_sc [label="DTAP CC ALERTING"]; + ...; + + --- [label="Further signalling in parallel with RTP (simplified)"]; + ms <- m_sc [label="DTAP CC CONNECT"]; + ms -> m_sc [label="DTAP CC CONNECT ACK"]; + --- [label="Voice Call in Progress"]; + ...; + --- [label="B-end hangs up"]; + 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="SCCP DT1 (BSSMAP CLEAR CMD)"]; + bsc -> bsc [label="GSCON_EV_A_CLEAR_CMD", textcolor="red", linecolor="red"]; + --- [label="BSC must release terrestrial resoures before reporting CLEAR COMPLETE"]; + mgw <- bsc [label="MGCP DLCX rtpbridge/2 at mgw", textcolor="blue", linecolor="blue"]; + mgw box mgw [label="Release MSC-facing local RTP port (3000)", textcolor="blue", linecolor="blue"]; + mgw -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK", textcolor="blue", linecolor="blue"]; + + mgw <- bsc [label="MGCP DLCX rtpbridge/2 at mgw", textcolor="blue", linecolor="blue"]; + mgw box mgw [label="Release BTS-facing local RTP port (2000)", textcolor="blue", linecolor="blue"]; + mgw -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK", textcolor="blue", linecolor="blue"]; + + bts <- bsc [label="IPA DLCX", textcolor="blue", linecolor="blue"]; + bts box bts [label="Release BTS-local RTP port (1000)", textcolor="blue", linecolor="blue"]; + bts -> bsc [label="IPA DLCX OK", textcolor="blue", linecolor="blue"]; + + bsc -> bsc [label="GSCON_EV_RSL_CLEAR_COMPL", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP DT1 (BSSMAP CLEAR COMPL)"]; + bsc <- m_sc [label="SCCP RLSD"]; + bsc -> bsc [label="GSCON_EV_A_DISC_IND", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP RLC"]; + + --- [label="BSC releases radio resources after CLEAR COMPLETE"]; + bsc_l2 <= bsc [label="release_lchan(TCH)", textcolor="red", linecolor="red"]; + bts <- bsc_l2 [label="RSL RLL (TCH, SAPI0, DCCH) DATA REQ (RR CHANNEL RELEASE)", textcolor="green", linecolor="green"]; + bsc_l2 box bsc_l2 [label="Start T3109"]; + bts <- bsc_l2 [label="RSL Dchan (TCH) DEACTIVATE SACCH"]; + ms <- bts [label="TCH: I (RR CHANNEL RELEASE)"]; + ms -> bts [label="TCH: DISC (RR CHANNEL RELEASE)"]; + bts -> bsc_l2 [label="RSL RLL (TCH, SAPI0, DCCH) REL IND", textcolor="green", linecolor="green"]; + bsc_l2 => bsc [label="GSCON_EV_RLL_REL_IND", textcolor="red", linecolor="red"]; + bsc_l2 box bsc_l2 [label="Stop T3109; Start T3111"]; + # optional: Conn Fail? + bts <- bsc_l2 [label="RSL Dchan (TCH, SAPI0, DCCH) RF CHAN REL"]; + bts -> bsc_l2 [label="RSL Dchan (TCH, SAPI0, DCCH) RF CHAN REL ACK"]; + bsc_l2 box bsc_l2 [label="T3111 timeout: Channel can be used again"]; + + ...; + +} -- To view, visit https://gerrit.osmocom.org/5754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e41234cfe1483bb73589dc959851a54f9aafa36 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Jan 11 15:15:08 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 15:15:08 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for CELL_IDENT_NO_CELL. Message-ID: Review at https://gerrit.osmocom.org/5755 Implement support for CELL_IDENT_NO_CELL. Change-Id: I941477fee041664bd3d256b272e3cafa9bce4e69 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/55/5755/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 54e0205..ada4b66 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -339,6 +339,10 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_NO_CELL: + LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); + return 0; /* nothing to do */ + case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; -- To view, visit https://gerrit.osmocom.org/5755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I941477fee041664bd3d256b272e3cafa9bce4e69 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 15:17:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 15:17:37 +0000 Subject: osmo-bsc[master]: Implement support for CELL_IDENT_NO_CELL. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I941477fee041664bd3d256b272e3cafa9bce4e69 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 15:17:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 15:17:42 +0000 Subject: osmo-gsm-manuals[master]: add message sequence chart MS/BTS/BSC/MSC for 3GPP aoIP MO call In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e41234cfe1483bb73589dc959851a54f9aafa36 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 Thu Jan 11 15:17:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 15:17:44 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: add message sequence chart MS/BTS/BSC/MSC for 3GPP aoIP MO call In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: add message sequence chart MS/BTS/BSC/MSC for 3GPP aoIP MO call ...................................................................... add message sequence chart MS/BTS/BSC/MSC for 3GPP aoIP MO call Change-Id: I7e41234cfe1483bb73589dc959851a54f9aafa36 --- A OsmoBSC/message-sequences/mo_call-abis_a.msc 1 file changed, 146 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBSC/message-sequences/mo_call-abis_a.msc b/OsmoBSC/message-sequences/mo_call-abis_a.msc new file mode 100644 index 0000000..4597ab1 --- /dev/null +++ b/OsmoBSC/message-sequences/mo_call-abis_a.msc @@ -0,0 +1,146 @@ +msc { + hscale=2; + ms [label="MS"], + bts [label="BTS"], + bsc_l [label="BSC(lchan SDCCH)"], + bsc_l2 [label="BSC(lchan TCH)"], + bsc [label="BSC"], + mgw [label="MGW at BSC"], + m_sc [label="MSC"]; + + ...; + --- [label="MS Requests dedicated channel"]; + ms -> bts [label="RACH: REQ"]; + bts -> bsc [label="RSL Cchan CHAN RQD"]; + bsc_l <= bsc [label="allocate lchan (RR IMM ASS)", textcolor="red", linecolor="red"]; + bts <- bsc_l [label="RSL Dchan (SDCCH) CHAN ACT"]; + bts -> bsc_l [label="RSL Dchan (SDCCH) CHAN ACT ACK"]; + bts <- bsc_l [label="RSL Cchan IMM ASS (RR IMM ASS)"]; + bsc_l box bsc_l [label="Start T3101"]; + ms <- bts [label="AGCH: RR IMM ASS"]; + --- [label="MS Establishes SDCCH"]; + ms -> bts [label="SDCCH: SABM (CM SERV REQ)"]; + ms <- bts [label="SDCCH: UA (CM SERV REQ)"]; + bts -> bsc_l [label="RSL RLL (SDCCH, SAPI0, DCCH) EST IND", textcolor="green", linecolor="green"]; + bsc_l box bsc_l [label="Stop T3101"]; + bsc_l => bsc [label="GSCON_EV_A_CONN_REQ", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP CR (BSSMAP COMPL L3 (CM SERV REQ))"]; + bsc <- m_sc [label="SCCP CC"]; + bsc -> bsc [label="GSCON_EV_A_CONN_CFM", textcolor="red", linecolor="red"]; + ms box m_sc [label="Authentication, MM info, ..."]; + bsc <- m_sc [label="SCCP DT1 (DTAP (CM SERV ACK)"]; + bsc -> bsc [label="GSCON_EV_MT_DTAP", textcolor="red", linecolor="red"]; + bsc_l <= bsc [label="lchan_submit_dtap(CM SERV ACK)", textcolor="red", linecolor="red"]; + bts <- bsc_l [label="RSL RLL (SDCCH) DATA REQ (CM SERV ACK)", textcolor="green", linecolor="green"]; + ms <- bts [label="SDCCH: I (CM SERV ACK)"]; + ms -> bts [label="SDCCH: I (CC SETUP)"]; + bts -> bsc_l [label="RSL RLL (SDCCH) DATA IND (CC SETUP)", textcolor="green", linecolor="green"]; + bsc_l -> bsc [label="GSCON_EV_MO_DTAP", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP DT1 (DTAP (CC SETUP))"]; + ...; + + --- [label="MSC assigns Voice Channel (TCH)"]; + bsc <- m_sc [label="SCCP DT1 (BSSMAP ASSIGNMENT CMD)"]; + bsc -> bsc [label="GSCON_EV_A_ASSIGNMENT_CMD", textcolor="red", linecolor="red"]; + bsc_l2 <= bsc [label="allocate lchan", textcolor="red", linecolor="red"]; + bts <- bsc_l2 [label="RSL Dchan (TCH) CHAN ACT"]; + bts -> bsc_l2 [label="RSL Dchan (TCH) CHAN ACT ACK"]; + bts <- bsc_l [label="RSL RLL (SDDCH) DATA REQ (RR ASSIGNMENT CMD)", textcolor="green", +linecolor="green"]; + bsc_l2 box bsc_l2 [label="Start T3107"]; + ms <- bts [label="SDCCH: I (RR ASSIGNMENT CMD)"]; + ms box ms [label="local-end RLL release", textcolor="green", linecolor="green"]; + bts -> bsc_l [label="RSL RLL (SDCCH) REL IND", textcolor="gray", linecolor="green"]; + bsc_l => bsc [label="GSCON_EV_RLL_REL_IND", textcolor="gray", linecolor="red"]; + bts -> bsc_l [label="RSL Dchan (SDCCH) CONN FAIL IND", textcolor="gray", linecolor="green"]; + bsc_l => bsc [label="GSCON_EV_CONN_FAIL", textcolor="gray", linecolor="red"]; + bsc_l box bsc_l [label="BSC must ignore failures on old channel"]; + ms -> bts [label="TCH: SABM (RR ASSIGNMENT CMPL)"]; + ms <- bts [label="TCH: UA (RR ASSIGNMENT CMPL)"]; + bts -> bsc_l2 [label="RSL RLL (TCH, SAPI0, DCCH) EST IND", textcolor="green", linecolor="green"]; + bsc_l2 box bsc_l2 [label="Stop T3107"]; + bsc_l2 => bsc [label="GSCON_EV_RR_ASS_COMPL", textcolor="red", linecolor="red"]; + + bsc_l <= bsc [label="release_lchan(SDCCH)", textcolor="red", linecolor="red"]; + bts box bsc_l [label="local-end RLL release", textcolor="green", linecolor="green"]; + bts <- bsc_l [label="RSL Dchan (SDCCH) RF CHAN REL"]; + bts <- bsc_l [label="RSL RLL (SDCCH, SAPI0, DCCH) REL REQ", textcolor="gray", linecolor="green"]; + bts <- bsc_l [label="RSL DChan (SDCCH) DEACTIVATE SACCH", textcolor="gray", linecolor="black"]; + bts -> bsc_l [label="RSL RLL (SDCCH, SAPI0, DCCH) RF FAIL IND", textcolor="gray", linecolor="green"]; + bts -> bsc_l [label="RSL Dchan (SDCCH, SAPI0, DCCH) RF CHAN REL ACK"]; + + # connect BTS RTP with BSC-MGW RTP + --- [label="BSC configures RTP on BTS and both sides of MGW"]; + bts <- bsc [label="RSL IPA CRCX", textcolor="blue", linecolor="blue"]; + bts box bts [label="Bind to BTS-local RTP Port (1000)", textcolor="blue", linecolor="blue"]; + bts -> bsc [label="IPA CRCX ACK (BTS:1000)", textcolor="blue", linecolor="blue"]; + bsc -> mgw [label="MGCP CRCX rtpbridge/2 at mgw (BTS:1000)", textcolor="blue", linecolor="blue"]; + mgw box mgw [label="Bind to MGW-local RTP Port (2000)\nConnect to BTS:1000", textcolor="blue", linecolor="blue"]; + bsc <- mgw [label="MGCP CRCX rtpbridge/2 at mgw OK (MGW:2000)", textcolor="blue", linecolor="blue"]; + bts <- bsc [label="IPA MDCX (MGW:2000)", textcolor="blue", linecolor="blue"]; + bts box bts [label="Connect RTP socket to remote (MGW) RTP Port", textcolor="blue", linecolor="blue"]; + bts -> bsc [label="IPA MDCX ACK", textcolor="blue", linecolor="blue"]; + bsc >> mgw [label="MGCP MDCX rtpbridge/2 at mgw", textcolor="gray", linecolor="gray"]; + bsc << mgw [label="MGCP MDCX rtpbridge/2 at mgw OK", textcolor="gray", linecolor="gray"]; + ...; + + --- [label="BSC finally can report successful TCH assignment"]; + bsc -> m_sc [label="SCCP DT1 (BSSMAP ASSGN CMPL (3GPP AoIP MGW:3000))"]; + m_sc box m_sc [label="Connect remote RTP to MGW addr from ASSGN CMPL"]; + ...; + + mgw <-> m_sc [label="RTP Audio MGW:3000 MSC:4000", textcolor="blue", linecolor="blue"]; + bts <-> mgw [label="RTP Audio BTS:1000 MGW:2000", textcolor="blue", linecolor="blue"]; + ms <-> bts [label="Um Audio (bidirectional)", textcolor="blue", linecolor="blue"]; + ms <-> m_sc [label="DTAP CC ALERTING"]; + ...; + + --- [label="Further signalling in parallel with RTP (simplified)"]; + ms <- m_sc [label="DTAP CC CONNECT"]; + ms -> m_sc [label="DTAP CC CONNECT ACK"]; + --- [label="Voice Call in Progress"]; + ...; + --- [label="B-end hangs up"]; + 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="SCCP DT1 (BSSMAP CLEAR CMD)"]; + bsc -> bsc [label="GSCON_EV_A_CLEAR_CMD", textcolor="red", linecolor="red"]; + --- [label="BSC must release terrestrial resoures before reporting CLEAR COMPLETE"]; + mgw <- bsc [label="MGCP DLCX rtpbridge/2 at mgw", textcolor="blue", linecolor="blue"]; + mgw box mgw [label="Release MSC-facing local RTP port (3000)", textcolor="blue", linecolor="blue"]; + mgw -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK", textcolor="blue", linecolor="blue"]; + + mgw <- bsc [label="MGCP DLCX rtpbridge/2 at mgw", textcolor="blue", linecolor="blue"]; + mgw box mgw [label="Release BTS-facing local RTP port (2000)", textcolor="blue", linecolor="blue"]; + mgw -> bsc [label="MGCP DLCX rtpbridge/2 at mgw OK", textcolor="blue", linecolor="blue"]; + + bts <- bsc [label="IPA DLCX", textcolor="blue", linecolor="blue"]; + bts box bts [label="Release BTS-local RTP port (1000)", textcolor="blue", linecolor="blue"]; + bts -> bsc [label="IPA DLCX OK", textcolor="blue", linecolor="blue"]; + + bsc -> bsc [label="GSCON_EV_RSL_CLEAR_COMPL", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP DT1 (BSSMAP CLEAR COMPL)"]; + bsc <- m_sc [label="SCCP RLSD"]; + bsc -> bsc [label="GSCON_EV_A_DISC_IND", textcolor="red", linecolor="red"]; + bsc -> m_sc [label="SCCP RLC"]; + + --- [label="BSC releases radio resources after CLEAR COMPLETE"]; + bsc_l2 <= bsc [label="release_lchan(TCH)", textcolor="red", linecolor="red"]; + bts <- bsc_l2 [label="RSL RLL (TCH, SAPI0, DCCH) DATA REQ (RR CHANNEL RELEASE)", textcolor="green", linecolor="green"]; + bsc_l2 box bsc_l2 [label="Start T3109"]; + bts <- bsc_l2 [label="RSL Dchan (TCH) DEACTIVATE SACCH"]; + ms <- bts [label="TCH: I (RR CHANNEL RELEASE)"]; + ms -> bts [label="TCH: DISC (RR CHANNEL RELEASE)"]; + bts -> bsc_l2 [label="RSL RLL (TCH, SAPI0, DCCH) REL IND", textcolor="green", linecolor="green"]; + bsc_l2 => bsc [label="GSCON_EV_RLL_REL_IND", textcolor="red", linecolor="red"]; + bsc_l2 box bsc_l2 [label="Stop T3109; Start T3111"]; + # optional: Conn Fail? + bts <- bsc_l2 [label="RSL Dchan (TCH, SAPI0, DCCH) RF CHAN REL"]; + bts -> bsc_l2 [label="RSL Dchan (TCH, SAPI0, DCCH) RF CHAN REL ACK"]; + bsc_l2 box bsc_l2 [label="T3111 timeout: Channel can be used again"]; + + ...; + +} -- To view, visit https://gerrit.osmocom.org/5754 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e41234cfe1483bb73589dc959851a54f9aafa36 Gerrit-PatchSet: 1 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 Thu Jan 11 15:18:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 15:18:00 +0000 Subject: osmo-bsc[master]: Add TAGS files (produced by 'make tags') to .gitignore file. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If5592cb0b5de018b7b9c06955f2e34d1f666530e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 15:18:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 15:18:08 +0000 Subject: [MERGED] osmo-bsc[master]: Add TAGS files (produced by 'make tags') to .gitignore file. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add TAGS files (produced by 'make tags') to .gitignore file. ...................................................................... Add TAGS files (produced by 'make tags') to .gitignore file. Change-Id: If5592cb0b5de018b7b9c06955f2e34d1f666530e --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 3481bad..4def47a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,8 @@ *.gcda *.gcno +**/TAGS + #configure aclocal.m4 autom4te.cache/ -- To view, visit https://gerrit.osmocom.org/5751 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If5592cb0b5de018b7b9c06955f2e34d1f666530e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 15:19:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 11 Jan 2018 15:19:11 +0000 Subject: osmo-msc[master]: Permit a set of multiple different A5 ciphers In-Reply-To: References: Message-ID: Patch Set 2: I think it's time we start to enable A5 by default, yes. I would want to have a testsuite before merging this, though. -- To view, visit https://gerrit.osmocom.org/5559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte 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 Thu Jan 11 15:42:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 15:42:48 +0000 Subject: osmo-trx[master]: Move ARCH_LA to Makefile.common In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Thu Jan 11 15:48:00 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 15:48:00 +0000 Subject: osmo-trx[master]: utils/convolvtest: Remove uneeded libosmocore dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1742146c31cadec8ce8afbbdae5777f076b212d4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Thu Jan 11 16:03:26 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 16:03:26 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on a Cell Global Identifier. Message-ID: Review at https://gerrit.osmocom.org/5756 Implement support for paging based on a Cell Global Identifier. This is essentially a case which combines paging by LAI and CI. Depends: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 49 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/5756/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 26887f3..7ada195 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -260,6 +260,19 @@ return ret; } +/* Decode 5-byte LAI list element data (see TS 08.08 3.2.2.27) into MCC/MNC/LAC. + * Return 0 if successful, negative on error. */ +static int +decode_lai(const uint8_t *data, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) +{ + struct gsm48_loc_area_id lai; + + /* Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + memcpy(&lai, data, sizeof(lai)); /* don't byte swap yet */ + + return gsm48_decode_lai(&lai, mcc, mnc, lac) != 0 ? -1 : 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) @@ -344,6 +357,39 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_WHOLE_GLOBAL: { + uint16_t ci; + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { + uint16_t *ci_be; + size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); + if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); + ci = osmo_load16be(ci_be); + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } + } else + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); + i++; + } + } + case CELL_IDENT_CI: { uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { @@ -367,13 +413,9 @@ break; } case CELL_IDENT_LAI_AND_LAC: { - struct gsm48_loc_area_id lai; int i = 0; - while (remain >= sizeof(lai)) { - /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). - * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ - memcpy(&lai, &data[1 + i * sizeof(lai)], sizeof(lai)); /* don't byte swap yet */ - if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + while (remain >= sizeof(struct gsm48_loc_area_id)) { + if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " "for BSS (0x%x), paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); @@ -391,7 +433,7 @@ LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - remain -= sizeof(lai); + remain -= sizeof(struct gsm48_loc_area_id); i++; } break; -- To view, visit https://gerrit.osmocom.org/5756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:04:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 16:04:10 +0000 Subject: osmo-trx[master]: tests: Migrate convtest util to autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Just wondering: wont this test fail on CPUs without SSE support? -- To view, visit https://gerrit.osmocom.org/5743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Thu Jan 11 16:08:23 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 16:08:23 +0000 Subject: [MERGED] osmo-bsc[master]: Implement support for CELL_IDENT_NO_CELL. In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Implement support for CELL_IDENT_NO_CELL. ...................................................................... Implement support for CELL_IDENT_NO_CELL. Change-Id: I941477fee041664bd3d256b272e3cafa9bce4e69 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 54e0205..ada4b66 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -339,6 +339,10 @@ lac = GSM_LAC_RESERVED_ALL_BTS; switch (cell_ident) { + case CELL_IDENT_NO_CELL: + LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); + return 0; /* nothing to do */ + case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; -- To view, visit https://gerrit.osmocom.org/5755 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I941477fee041664bd3d256b272e3cafa9bce4e69 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:15:49 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 16:15:49 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5705 to look at the new patch set (#7). Implement support for paging based on CI (cell identifier). This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run in isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2753 --- M include/osmocom/bsc/osmo_bsc_grace.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 92 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5705/7 diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h index b7950ce..d78e41c 100644 --- a/include/osmocom/bsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -30,6 +30,7 @@ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, + struct gsm_bts *bts); #endif diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index ada4b66..a02ea9e 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,11 +228,12 @@ return 0; } -/* Page a subscriber based on TMSI and LAC. +/* Page a subscriber based on TMSI and LAC in the specified MSC. + * If BTS is not NULL, page the subscriber via this particular BTS. * A non-zero return value indicates a fatal out of memory condition. */ static int -page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, - const char *mi_string, uint8_t chan_needed) +page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, + uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; @@ -246,9 +247,14 @@ subscr->lac = lac; subscr->tmsi = tmsi; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + if (bts) + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); + else + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); @@ -343,6 +349,29 @@ LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ + case CELL_IDENT_CI: { + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + struct gsm_bts *bts; + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity == ci) + break; + } + + if (bts) { + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", + mi_string, ci); + remain -= sizeof(*ci_be); + ci_be++; + } + break; + } + case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; @@ -358,7 +387,7 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " @@ -375,7 +404,7 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; remain -= sizeof(*lacp_be); lacp_be++; @@ -388,7 +417,7 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; @@ -396,7 +425,7 @@ LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index f16a19a..93ca9b9 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -50,44 +50,62 @@ return paging_request(msc->network, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* - * continue if the BTS is not excluded from the lock - */ - if (!bts->excl_from_rf_lock) - continue; - - /* in case of no lac patching is in place, check the BTS */ - if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) - continue; - - /* - * now page on this bts - */ - paging_request_bts(bts, subscr, chan_needed, msc); - }; - - /* All bts are either off or in the grace period */ - return 0; -} - -/** - * Try to not page if everything the cell is not on. - */ -int bsc_grace_paging_request(enum signal_rf rf_policy, +/* Return value is like paging_request_bts(): + * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ +static int locked_paging_bts(struct gsm_bts *bts, struct bsc_subscr *subscr, int chan_needed, struct bsc_msc_data *msc) { + /* Return error if the BTS is not excluded from the lock. */ + if (!bts->excl_from_rf_lock) + return 0; + + /* in case of no lac patching is in place, check the BTS */ + if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) + return 0; + + return paging_request_bts(bts, subscr, chan_needed, msc); +} + +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) +{ + struct gsm_bts *bts = NULL; + int num_pages = 0; + + /* + * Check if there is any BTS that is on for the given lac. Start + * with NULL and iterate through all bts. + * All other bts are either off or in the grace period. + */ + llist_for_each_entry(bts, &msc->network->bts_list, list) + num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); + + return num_pages; +} + +/** + * Page a subscriber in an MSC. + * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock + * \param[in] subscr subscriber we want to page + * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE + * \param[in] msc MSC which has issued this paging + * \param[in] bts if not NULL, page via this particular BTS + * \returns number of BTS on which we issued the paging + */ +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc, + struct gsm_bts *bts) +{ + if (bts) { + if (rf_policy == S_RF_ON) + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); + } + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:17:57 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 16:17:57 +0000 Subject: osmo-bts[master]: LC15: Fix missing fill frame and GSM 05.08 mandatory frame In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/5753/1/include/osmo-bts/msg_utils.h File include/osmo-bts/msg_utils.h: PS1, Line 35: static const uint8_t gsm_speech_zero[GSM_FR_BYTES] = { : 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, : 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, : 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, : 0x00, 0x00, 0x00 : }; : : static const uint8_t amr_sid_first_zero[9] = { : 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00 : }; Do we really need static struct definitions within the header? I had only a quick look, but it seems they only used by msg_utils.c... If I am correct, they shouldn't be here. -- To view, visit https://gerrit.osmocom.org/5753 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I40e9bf9438c0b400e4d29eb39ffae37207e34db6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:21:32 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 16:21:32 +0000 Subject: libosmocore[master]: log: print loginfo assertions source In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:22:30 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 16:22:30 +0000 Subject: libosmocore[master]: Log lapd_datalink state on errors In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3141212fa74d045ee24a18eea1191d63cd15e0ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:30:54 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 16:30:54 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on a Cell Global Identifier. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5756 to look at the new patch set (#2). Implement support for paging based on a Cell Global Identifier. This is essentially a case which combines paging by LAI and CI. Depends: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 49 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/5756/2 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 9cb550e..5676105 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -260,6 +260,19 @@ return ret; } +/* Decode 5-byte LAI list element data (see TS 08.08 3.2.2.27) into MCC/MNC/LAC. + * Return 0 if successful, negative on error. */ +static int +decode_lai(const uint8_t *data, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) +{ + struct gsm48_loc_area_id lai; + + /* Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + memcpy(&lai, data, sizeof(lai)); /* don't byte swap yet */ + + return gsm48_decode_lai(&lai, mcc, mnc, lac) != 0 ? -1 : 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) @@ -348,6 +361,39 @@ LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ + case CELL_IDENT_WHOLE_GLOBAL: { + uint16_t ci; + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { + uint16_t *ci_be; + size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); + if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); + ci = osmo_load16be(ci_be); + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } + } else + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); + i++; + } + } + case CELL_IDENT_CI: { uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { @@ -372,13 +418,9 @@ } case CELL_IDENT_LAI_AND_LAC: { - struct gsm48_loc_area_id lai; int i = 0; - while (remain >= sizeof(lai)) { - /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). - * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ - memcpy(&lai, &data[1 + i * sizeof(lai)], sizeof(lai)); /* don't byte swap yet */ - if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + while (remain >= sizeof(struct gsm48_loc_area_id)) { + if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " "for BSS (0x%x), paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); @@ -396,7 +438,7 @@ LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - remain -= sizeof(lai); + remain -= sizeof(struct gsm48_loc_area_id); i++; } break; -- To view, visit https://gerrit.osmocom.org/5756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 16:53:52 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 11 Jan 2018 16:53:52 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on LAC and CI. Message-ID: Review at https://gerrit.osmocom.org/5757 Implement support for paging based on LAC and CI. This is a simple combination of the LAC and CI cases which have already been implemented. The BSC_Tests.TC_paging_imsi_nochan_lac_ci ttcn3 test passes. The switch statement in bssmap_handle_paging() is getting a bit large, and scoping of local variables could be improved. I will focus on cleaning this up later once paging functionality is complete. Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127 Depends: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Related: OS#2752 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/57/5757/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 5676105..ffd4b60 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -394,6 +394,30 @@ } } + case CELL_IDENT_LAC_AND_CI: { + uint16_t ci, *ci_be; + lacp_be = (uint16_t *)(&data[1]); + ci_be = (uint16_t *)(&data[3]); + while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) { + lac = osmo_load16be(lacp_be); + ci = osmo_load16be(ci_be); + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } + + remain -= sizeof(*lacp_be) + sizeof(*ci_be); + lacp_be++; + ci_be++; + } + break; + } + case CELL_IDENT_CI: { uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { -- To view, visit https://gerrit.osmocom.org/5757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 11 17:26:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 17:26:06 +0000 Subject: [PATCH] osmo-ggsn[master]: Add GTP message names Message-ID: Review at https://gerrit.osmocom.org/5758 Add GTP message names Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 49 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/58/5758/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index b36e0c6..0d6d896 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -86,6 +86,51 @@ return VERSION; } +const struct value_string gtp_type_names[] = { + { GTP_ECHO_REQ, "Echo Request" }, + { GTP_ECHO_RSP, "Echo Response" }, + { GTP_NOT_SUPPORTED, "Version Not Supported" }, + { GTP_ALIVE_REQ, "Node Alive Request" }, + { GTP_ALIVE_RSP, "Node Alive Response" }, + { GTP_REDIR_REQ, "Redirection Request" }, + { GTP_REDIR_RSP, "Redirection Response" }, + { GTP_CREATE_PDP_REQ, "Create PDP Context Request" }, + { GTP_CREATE_PDP_RSP, "Create PDP Context Response" }, + { GTP_UPDATE_PDP_REQ, "Update PDP Context Request" }, + { GTP_UPDATE_PDP_RSP, "Update PDP Context Response" }, + { GTP_DELETE_PDP_REQ, "Delete PDP Context Request" }, + { GTP_DELETE_PDP_RSP, "Delete PDP Context Response" }, + { GTP_ERROR, "Error Indication" }, + { GTP_PDU_NOT_REQ, "PDU Notification Request" }, + { GTP_PDU_NOT_RSP, "PDU Notification Response" }, + { GTP_PDU_NOT_REJ_REQ, "PDU Notification Reject Request" }, + { GTP_PDU_NOT_REJ_RSP, "PDU Notification Reject Response" }, + { GTP_SUPP_EXT_HEADER, "Supported Extension Headers Notification" }, + { GTP_SND_ROUTE_REQ, "Send Routeing Information for GPRS Request" }, + { GTP_SND_ROUTE_RSP, "Send Routeing Information for GPRS Response" }, + { GTP_FAILURE_REQ, "Failure Report Request" }, + { GTP_FAILURE_RSP, "Failure Report Response" }, + { GTP_MS_PRESENT_REQ, "Note MS GPRS Present Request" }, + { GTP_MS_PRESENT_RSP, "Note MS GPRS Present Response" }, + { GTP_IDEN_REQ, "Identification Request" }, + { GTP_IDEN_RSP, "Identification Response" }, + { GTP_SGSN_CONTEXT_REQ,"SGSN Context Request" }, + { GTP_SGSN_CONTEXT_RSP,"SGSN Context Response" }, + { GTP_SGSN_CONTEXT_ACK,"SGSN Context Acknowledge" }, + { GTP_FWD_RELOC_REQ, "Forward Relocation Request" }, + { GTP_FWD_RELOC_RSP, "Forward Relocation Response" }, + { GTP_FWD_RELOC_COMPL, "Forward Relocation Complete" }, + { GTP_RELOC_CANCEL_REQ,"Relocation Cancel Request" }, + { GTP_RELOC_CANCEL_RSP,"Relocation Cancel Response" }, + { GTP_FWD_SRNS, "Forward SRNS Context" }, + { GTP_FWD_RELOC_ACK, "Forward Relocation Complete Acknowledge" }, + { GTP_FWD_SRNS_ACK, "Forward SRNS Context Acknowledge" }, + { GTP_DATA_TRAN_REQ, "Data Record Transfer Request" }, + { GTP_DATA_TRAN_RSP, "Data Record Transfer Response" }, + { GTP_GPDU, "G-PDU" }, + { 0, NULL } +}; + /* gtp_new */ /* gtp_free */ diff --git a/gtp/gtp.h b/gtp/gtp.h index d189ded..d80519a 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -12,6 +12,8 @@ #ifndef _GTP_H #define _GTP_H +#include + #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -85,6 +87,8 @@ /* 242-254 For future use. */ #define GTP_GPDU 255 /* G-PDU */ +extern const struct value_string gtp_type_names[]; + /* GTP information element cause codes from 29.060 v3.9.0 7.7 */ /* */ #define GTPCAUSE_REQ_IMSI 0 /* Request IMSI */ -- To view, visit https://gerrit.osmocom.org/5758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 11 17:47:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 17:47:09 +0000 Subject: [PATCH] osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... Message-ID: Review at https://gerrit.osmocom.org/5759 master-builds.yml: Build osmo-trx with different optimization instruction sets enabled Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf --- M jobs/master-builds.yml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/59/5759/1 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 3e2e5fb..cfbe2c7 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -237,6 +237,9 @@ - osmo-trx: slave_axis: !!python/tuple [OsmocomBuild1] + a1_name: INSTR + a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] + concurrent: true - osmocom-bb -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 11 17:49:07 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 17:49:07 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: fix USSD OCTET STRING length In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5712 to look at the new patch set (#4). gsm0480: fix USSD OCTET STRING length According to the GSM 04.80 (version 5.0.0) specification Annex A "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD OCTET STRING is 160 bytes. Thus according to ETSI TS 123 038 (version 10.0.0) specification 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. The remaining 6 bits are set to zero. This change defines both mentioned values: - MAX_LEN_USSD_OCTET_STRING 160 - MAX_LEN_USSD_7BIT_STRING 182 keeping the old MAX_LEN_USSD_STRING as is due to compatibility reasons. Now the new value is used for the gsm0480_ss_request, while the old one is still used for deprecated ussd_request structure. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c 2 files changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5712/4 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 781d8d7..cca09bb 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,27 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +/** + * According to the GSM 04.80 (version 5.0.0) specification Annex A + * "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD + * OCTET STRING field is 160 bytes. + */ +#define MAX_LEN_USSD_OCTET_STRING 160 + +/** + * Thus according to ETSI TS 123 038 (version 10.0.0) specification + * 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's + * possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. + * The remaining 6 bits are set to zero. + */ +#define MAX_LEN_USSD_7BIT_STRING 182 + +/** + * DEPRECATED: this definition doesn't follow any specification, + * so we only keep it for compatibility reasons. It's strongly + * recommended to use correct definitions above. + */ +#define MAX_LEN_USSD_STRING 31 /* deprecated */ struct ussd_request { @@ -42,7 +62,7 @@ uint8_t ussd_text_len; uint8_t ussd_text_language; - uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; + uint8_t ussd_text[MAX_LEN_USSD_OCTET_STRING]; /*! Parameters of a Interrogate/Activate/DeactivateSS Request */ uint8_t ss_code; diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 9cfe336..4c7352c 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -453,8 +453,8 @@ (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { num_chars = (uss_req_data[6] * 8) / 7; /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + if (num_chars > MAX_LEN_USSD_7BIT_STRING) + num_chars = MAX_LEN_USSD_7BIT_STRING; num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 11 17:49:07 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 17:49:07 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3376 to look at the new patch set (#7). gsm0480: handle UnstructuredSS Request with DSC != 0x0F According to GSM 04.08, 4.4.2 "ASN.1 data types": the USSD-DataCodingScheme shall indicate use of the default alphabet using the 0x0F value. Previously, the UnstructuredSS Request messages with not default alphabet were not being handled. Let's fix this. Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 --- M src/gsm/gsm0480.c 1 file changed, 23 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/3376/7 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index b2e521a..bfa0287 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -450,9 +450,18 @@ if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) return 0; + /* Get DCS (Data Coding Scheme) */ dcs = uss_req_data[4]; + + /** + * According to GSM 04.08, 4.4.2 "ASN.1 data types": + * the USSD-DataCodingScheme shall indicate use of + * the default alphabet using the 0x0F value. + */ if (dcs == 0x0F) { + /* Calculate the amount of 7-bit characters */ num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ if (num_chars > MAX_LEN_USSD_7BIT_STRING) num_chars = MAX_LEN_USSD_7BIT_STRING; @@ -464,6 +473,20 @@ req->ussd_text_len = num_chars; return 1; + } else { + /* Get the amount of 8-bit characters */ + num_chars = uss_req_data[6]; + + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_OCTET_STRING) + num_chars = MAX_LEN_USSD_OCTET_STRING; + + memcpy(req->ussd_text, &(uss_req_data[7]), num_chars); + + req->ussd_text_language = dcs; + req->ussd_text_len = num_chars; + + return 1; } return 0; -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 17:49:07 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 17:49:07 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3378 to look at the new patch set (#7). gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 85 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3378/7 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 730f3c9..d9a90c7 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct gsm0480_ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct gsm0480_ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -369,6 +373,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -448,6 +455,84 @@ return rc; } +/* Parse a Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 0; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct gsm0480_ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > MAX_LEN_USSD_OCTET_STRING) + num_chars = MAX_LEN_USSD_OCTET_STRING; + + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + req->ussd_text_language = 0x00; + req->ussd_text_len = num_chars; + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 17:49:07 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 17:49:07 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#7). gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/3375/7 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 4c7352c..b2e521a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -436,36 +436,37 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct gsm0480_ss_request *req) { - int rc = 0; int num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_7BIT_STRING) - num_chars = MAX_LEN_USSD_7BIT_STRING; + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; - num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > MAX_LEN_USSD_7BIT_STRING) + num_chars = MAX_LEN_USSD_7BIT_STRING; - req->ussd_text_language = 0x80; - req->ussd_text_len = num_chars; - rc = 1; - } - } + num_chars = gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + req->ussd_text_language = 0x80; + req->ussd_text_len = num_chars; + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:08:21 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 18:08:21 +0000 Subject: libosmocore[master]: gsm0480: fix USSD OCTET STRING length In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:17:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:17:54 +0000 Subject: [PATCH] osmo-trx[master]: tests: Migrate convtest util to autotest infrastructure In-Reply-To: References: Message-ID: Hello Vadim Yanitskiy, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5743 to look at the new patch set (#2). tests: Migrate convtest util to autotest infrastructure Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e --- M .gitignore M configure.ac M tests/Makefile.am A tests/Transceiver52M/Makefile.am R tests/Transceiver52M/convolve_test.c R tests/Transceiver52M/convolve_test.ok M tests/testsuite.at D utils/convolvetest/Makefile 8 files changed, 26 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/43/5743/2 diff --git a/.gitignore b/.gitignore index bc6c036..2cc1b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ tests/CommonLibs/URLEncodeTest tests/CommonLibs/VectorTest tests/CommonLibs/PRBSTest +tests/Transceiver52M/convolve_test # automake/autoconf *.in diff --git a/configure.ac b/configure.ac index 3ad4b41..5cee4a6 100644 --- a/configure.ac +++ b/configure.ac @@ -174,6 +174,7 @@ Transceiver52M/x86/Makefile \ tests/Makefile \ tests/CommonLibs/Makefile \ + tests/Transceiver52M/Makefile \ ]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index c18bef3..d4589a4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ CommonLibs \ + Transceiver52M \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/Transceiver52M/Makefile.am b/tests/Transceiver52M/Makefile.am new file mode 100644 index 0000000..79f73c6 --- /dev/null +++ b/tests/Transceiver52M/Makefile.am @@ -0,0 +1,17 @@ +include $(top_srcdir)/Makefile.common + +AM_CFLAGS = -Wall -I$(top_srcdir)/Transciever52 $(STD_DEFINES_AND_INCLUDES) -g + +EXTRA_DIST = convolve_test.ok + +noinst_PROGRAMS = \ + convolve_test + +convolve_test_SOURCES = convolve_test.c +convolve_test_LDADD = $(COMMON_LA) $(ARCH_LA) +if HAVE_SSE3 +convolve_test_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS) +endif +if HAVE_SSE4_1 +convolve_test_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS) +endif diff --git a/utils/convolvetest/main.c b/tests/Transceiver52M/convolve_test.c similarity index 100% rename from utils/convolvetest/main.c rename to tests/Transceiver52M/convolve_test.c diff --git a/utils/convolvetest/convtest.ok b/tests/Transceiver52M/convolve_test.ok similarity index 100% rename from utils/convolvetest/convtest.ok rename to tests/Transceiver52M/convolve_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index 00e6002..c6ca848 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -43,3 +43,9 @@ cat $abs_srcdir/CommonLibs/VectorTest.ok > expout AT_CHECK([$abs_top_builddir/tests/CommonLibs/VectorTest], [], [expout], []) AT_CLEANUP + +AT_SETUP([convolve_test]) +AT_KEYWORDS([convolve_test]) +cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) +AT_CLEANUP diff --git a/utils/convolvetest/Makefile b/utils/convolvetest/Makefile deleted file mode 100644 index 1163d67..0000000 --- a/utils/convolvetest/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -all: main.o convolve_base.o convolve.o convolve_sse_3.o - gcc -g -Wall ./*.o -o convtest - -clean: - rm -f ./*.o - rm -f ./convtest - -main.o: main.c - gcc -g -Wall -c main.c - -convolve_base.o: ../../Transceiver52M/common/convolve_base.c - gcc -std=c99 -c ../../Transceiver52M/common/convolve_base.c - -convolve.o: ../../Transceiver52M/x86/convolve.c - gcc -std=c99 -c ../../Transceiver52M/x86/convolve.c -I ../../Transceiver52M/common/ -msse3 -DHAVE_SSE3 - -convolve_sse_3.o: ../../Transceiver52M/x86/convolve_sse_3.c - gcc -std=c99 -c ../../Transceiver52M/x86/convolve_sse_3.c -I ../../Transceiver52M/common/ -msse3 -DHAVE_SSE3 -- To view, visit https://gerrit.osmocom.org/5743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:17:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:17:56 +0000 Subject: [PATCH] osmo-trx[master]: arm/convert.c: Fix compilation error Message-ID: Review at https://gerrit.osmocom.org/5760 arm/convert.c: Fix compilation error Commit fe9769833fa74ea841f78c0e931130a70fc3aca9 aiming at cleaning stuff introduced a compilation error. Related: OS#2720 Change-Id: I6ce6e5ec3fdb1e3e8818e2cb674470ad54e38afb --- M Transceiver52M/arm/convert.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/60/5760/1 diff --git a/Transceiver52M/arm/convert.c b/Transceiver52M/arm/convert.c index 57796ea..3880b58 100644 --- a/Transceiver52M/arm/convert.c +++ b/Transceiver52M/arm/convert.c @@ -54,7 +54,6 @@ for (int i = 0; i < len % 4; i++) out[start + i] = (short) (in[start + i] * (*scale)); } -#endif void convert_float_short(short *out, const float *in, float scale, int len) { -- To view, visit https://gerrit.osmocom.org/5760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ce6e5ec3fdb1e3e8818e2cb674470ad54e38afb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:17:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:17:56 +0000 Subject: [PATCH] osmo-trx[master]: arm/convert.c: Add missing convert_init implementation Message-ID: Review at https://gerrit.osmocom.org/5761 arm/convert.c: Add missing convert_init implementation osmo-trx.cpp calls convert_init, which in case of building using --with-neon is not implemented and the compiler stops with an error. Error was introduced in 7e07cf23464532ca156fe4ea4430928da2cbbff1. Related: OS#2720 Change-Id: I9840d374d13b525b97f978ea0c5ed9e8421072a0 --- M Transceiver52M/arm/convert.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/61/5761/1 diff --git a/Transceiver52M/arm/convert.c b/Transceiver52M/arm/convert.c index 3880b58..c94a3d7 100644 --- a/Transceiver52M/arm/convert.c +++ b/Transceiver52M/arm/convert.c @@ -28,6 +28,9 @@ void neon_convert_ps_si16_4n(short *, const float *, const float *, int); void neon_convert_si16_ps_4n(float *, const short *, int); +void convert_init(void) { +} + /* 4*N 16-bit signed integer conversion with remainder */ static void neon_convert_si16_ps(float *out, const short *in, -- To view, visit https://gerrit.osmocom.org/5761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9840d374d13b525b97f978ea0c5ed9e8421072a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:17:57 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:17:57 +0000 Subject: [PATCH] osmo-trx[master]: .gitignore: Add missing test related files Message-ID: Review at https://gerrit.osmocom.org/5762 .gitignore: Add missing test related files Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/5762/1 diff --git a/.gitignore b/.gitignore index 2cc1b8f..76cd452 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,8 @@ INSTALL tests/package.m4 tests/testsuite +tests/atconfig +tests/testsuite.log # vim *.sw? -- To view, visit https://gerrit.osmocom.org/5762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:17:57 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:17:57 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... Message-ID: Review at https://gerrit.osmocom.org/5763 contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 53 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..82e73af 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,58 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + if [ "x${INSTR}" = "x--with-neon" ] || [ "x${INSTR}" = "x--with-neon-vfpv4" ]; then + #apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot + mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" + } + + mychroot() { + mychroot_nocwd -w / "$@" + } + + CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + OSMOTRX_DIR="${CONTRIB_DIR}/.." + PREFIX="${WORKSPACE:-/home/pespin/tmp/vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # This is not needed after switching to proot: + #if [ ! -f /proc/sys/fs/binfmt_misc/arm ]; then + # echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | tee /proc/sys/fs/binfmt_misc/register + #fi + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..b457c96 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -28,6 +28,8 @@ AT_SETUP([SocketsTest]) AT_KEYWORDS([SocketsTest]) +# Disabled for ARM builds as we use proot+qemu and fails due to https://github.com/proot-me/PRoot/issues/8 +AT_SKIP_IF(test "uname -m | grep x86") cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], [ignore]) AT_CLEANUP @@ -46,6 +48,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(test "uname -m | grep x86") cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:21:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:21:37 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 53 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..530236d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,58 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + if [ "x${INSTR}" = "x--with-neon" ] || [ "x${INSTR}" = "x--with-neon-vfpv4" ]; then + #apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot + mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" + } + + mychroot() { + mychroot_nocwd -w / "$@" + } + + CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + OSMOTRX_DIR="${CONTRIB_DIR}/.." + PREFIX="${WORKSPACE:-vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # This is not needed after switching to proot: + #if [ ! -f /proc/sys/fs/binfmt_misc/arm ]; then + # echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | tee /proc/sys/fs/binfmt_misc/register + #fi + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..b457c96 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -28,6 +28,8 @@ AT_SETUP([SocketsTest]) AT_KEYWORDS([SocketsTest]) +# Disabled for ARM builds as we use proot+qemu and fails due to https://github.com/proot-me/PRoot/issues/8 +AT_SKIP_IF(test "uname -m | grep x86") cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], [ignore]) AT_CLEANUP @@ -46,6 +48,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(test "uname -m | grep x86") cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:26:17 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 18:26:17 +0000 Subject: osmo-trx[master]: arm/convert.c: Fix compilation error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ce6e5ec3fdb1e3e8818e2cb674470ad54e38afb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Thu Jan 11 18:28:42 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 18:28:42 +0000 Subject: osmo-trx[master]: arm/convert.c: Add missing convert_init implementation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9840d374d13b525b97f978ea0c5ed9e8421072a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Thu Jan 11 18:28:58 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 18:28:58 +0000 Subject: osmo-trx[master]: .gitignore: Add missing test related files In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Thu Jan 11 18:32:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:32:12 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 2: Verified-1 This commit needs to be sent to jenkins once this commit is merged: https://gerrit.osmocom.org/#/c/5759/ (I651e182dfd62ef4b88d013d8b5960ce7e3562ecf) This way it will trigger build of ARM tests. -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Thu Jan 11 18:33:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 18:33:12 +0000 Subject: osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... In-Reply-To: References: Message-ID: Patch Set 1: Once this one is merged, we can test osmo-trx ARM builds in https://gerrit.osmocom.org/#/c/5763 -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 18:36:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 18:36:46 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5763/2/tests/testsuite.at File tests/testsuite.at: Line 32: AT_SKIP_IF(test "uname -m | grep x86") Are you sure this is correct? Looks like a test is disabled of x86* architectures... Correct me if I am wrong please. -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 11 19:19:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 19:19:01 +0000 Subject: [PATCH] osmo-trx[master]: .gitignore: Add missing test related files 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/5762 to look at the new patch set (#2). .gitignore: Add missing test related files Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 --- M .gitignore 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/62/5762/2 diff --git a/.gitignore b/.gitignore index 2cc1b8f..e966b37 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ INSTALL tests/package.m4 tests/testsuite +tests/atconfig +tests/testsuite.dir +tests/testsuite.log # vim *.sw? -- To view, visit https://gerrit.osmocom.org/5762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 11 19:19:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 19:19:01 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#3). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 51 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/3 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..530236d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,58 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + if [ "x${INSTR}" = "x--with-neon" ] || [ "x${INSTR}" = "x--with-neon-vfpv4" ]; then + #apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot + mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" + } + + mychroot() { + mychroot_nocwd -w / "$@" + } + + CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + OSMOTRX_DIR="${CONTRIB_DIR}/.." + PREFIX="${WORKSPACE:-vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # This is not needed after switching to proot: + #if [ ! -f /proc/sys/fs/binfmt_misc/arm ]; then + # echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | tee /proc/sys/fs/binfmt_misc/register + #fi + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..767ce92 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(test ! "uname -m | grep x86") cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 11 19:19:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 19:19:02 +0000 Subject: [PATCH] osmo-trx[master]: Remove UDDSocket class Message-ID: Review at https://gerrit.osmocom.org/5764 Remove UDDSocket class This class is not used anymore in osmo-trx, so we can safely remove it. Change-Id: I67f90aa3d6a2a5e92292436d10928e0705c8f8ff --- M CommonLibs/Sockets.cpp M CommonLibs/Sockets.h M tests/CommonLibs/SocketsTest.cpp 3 files changed, 1 insertion(+), 95 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/64/5764/1 diff --git a/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index 11e96dd..ce8e3d5 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -284,51 +284,4 @@ return ntohs(name.sin_port); } - - - - -UDDSocket::UDDSocket(const char* localPath, const char* remotePath) - :DatagramSocket() -{ - if (localPath!=NULL) open(localPath); - if (remotePath!=NULL) destination(remotePath); -} - - - -void UDDSocket::open(const char* localPath) -{ - // create - mSocketFD = socket(AF_UNIX,SOCK_DGRAM,0); - if (mSocketFD<0) { - perror("socket() failed"); - throw SocketError(); - } - - // bind - struct sockaddr_un address; - size_t length = sizeof(address); - bzero(&address,length); - address.sun_family = AF_UNIX; - strcpy(address.sun_path,localPath); - unlink(localPath); - if (bind(mSocketFD,(struct sockaddr*)&address,length)<0) { - perror("bind() failed"); - throw SocketError(); - } -} - - - -void UDDSocket::destination(const char* remotePath) -{ - struct sockaddr_un* unAddr = (struct sockaddr_un*)mDestination; - unAddr->sun_family = AF_UNIX; - strcpy(unAddr->sun_path,remotePath); -} - - - - // vim:ts=4:sw=4 diff --git a/CommonLibs/Sockets.h b/CommonLibs/Sockets.h index 8312843..71b8b22 100644 --- a/CommonLibs/Sockets.h +++ b/CommonLibs/Sockets.h @@ -166,26 +166,6 @@ }; - -/** Unix Domain Datagram Socket */ -class UDDSocket : public DatagramSocket { - -public: - - UDDSocket(const char* localPath=NULL, const char* remotePath=NULL); - - void destination(const char* remotePath); - - void open(const char* localPath); - - /** Give the return address of the most recently received packet. */ - const struct sockaddr_un* source() const { return (const struct sockaddr_un*)mSource; } - - size_t addressSize() const { return sizeof(struct sockaddr_un); } - -}; - - #endif diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index b51587d..235b8f3 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -53,38 +53,13 @@ return NULL; } - - -void *testReaderUnix(void *) -{ - UDDSocket readSocket("testDestination"); - readSocket.nonblocking(); - int rc = 0; - while (rc0) { - CERR("read: " << buf); - rc++; - } else { - sleep(2); - } - } - return NULL; -} - - int main(int argc, char * argv[] ) { Thread readerThreadIP; readerThreadIP.start(testReaderIP,NULL); - Thread readerThreadUnix; - readerThreadUnix.start(testReaderUnix,NULL); UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); - UDDSocket socket1U("testSource","testDestination"); CERR("socket1: " << socket1.port()); @@ -93,12 +68,10 @@ for (int i=0; i From gerrit-no-reply at lists.osmocom.org Thu Jan 11 19:19:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 19:19:37 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5763/2/tests/testsuite.at File tests/testsuite.at: Line 32: AT_SKIP_IF(test "uname -m | grep x86") > Are you sure this is correct? Yes indeed it's wrong, I got confused by the fact that it actually was being skipped inside the chroot when running with ARM. Strangely enough, if I run "uname -m" in the chroot, I get "armv7l", but the test is not skipped with AT_SKIP_IF (it does in x86 if I leave the option wrong as it was in this patch version). LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r /home/pespin/tmp/vm/qemu-img -w / -b /proc --root-id -q qemu-arm-static --root-id -w /osmo-trx -b /home/pespin/osmo-trx/contrib/..:/osmo-trx uname -m armv7l -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 11 19:30:29 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 19:30:29 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: I think in general it makes sense to separate this test to several ones, enabling or disabling them for particular architecture, instead of disabling... -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 21:22:06 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 21:22:06 +0000 Subject: [PATCH] openbsc[master]: libmsc: add support for both comp128v2 and comp128v3 Message-ID: Review at https://gerrit.osmocom.org/5765 libmsc: add support for both comp128v2 and comp128v3 This change adds support for both comp128v2 and comp128v3 GSM A3/A8 algorithms. Since they already implemented in libosmocore, the corresponding it's API is used. Change-Id: Ic761be0220397d100c9e6345d4d01af4889dc7c1 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/auth.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/ctrl_test_runner.py 5 files changed, 53 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/5765/1 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 57fa301..39c7458 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -54,6 +54,8 @@ AUTH_ALGO_NONE, AUTH_ALGO_XOR, AUTH_ALGO_COMP128v1, + AUTH_ALGO_COMP128v2, + AUTH_ALGO_COMP128v3, }; struct gsm_auth_info { diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c index 19def1e..8c8af11 100644 --- a/openbsc/src/libmsc/auth.c +++ b/openbsc/src/libmsc/auth.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -62,7 +63,8 @@ } static int -_use_comp128_v1(struct gsm_auth_info *ainfo, struct gsm_auth_tuple *atuple) +_use_comp128(struct gsm_auth_info *ainfo, struct gsm_auth_tuple *atuple, + enum gsm_auth_algo algo) { if (ainfo->a3a8_ki_len != A38_COMP128_KEY_LEN) { LOGP(DMM, LOGL_ERROR, "Invalid COMP128v1 key (len=%d) %s\n", @@ -71,7 +73,23 @@ return -1; } - comp128(ainfo->a3a8_ki, atuple->vec.rand, atuple->vec.sres, atuple->vec.kc); + switch (algo) { + case AUTH_ALGO_COMP128v1: + comp128(ainfo->a3a8_ki, atuple->vec.rand, + atuple->vec.sres, atuple->vec.kc); + break; + case AUTH_ALGO_COMP128v2: + comp128v2(ainfo->a3a8_ki, atuple->vec.rand, + atuple->vec.sres, atuple->vec.kc); + break; + case AUTH_ALGO_COMP128v3: + comp128v3(ainfo->a3a8_ki, atuple->vec.rand, + atuple->vec.sres, atuple->vec.kc); + break; + default: + /* Unsupported version */ + return -ENOTSUP; + } return 0; } @@ -139,7 +157,9 @@ break; case AUTH_ALGO_COMP128v1: - if (_use_comp128_v1(&ainfo, atuple)) + case AUTH_ALGO_COMP128v2: + case AUTH_ALGO_COMP128v3: + if (_use_comp128(&ainfo, atuple, ainfo.auth_algo)) return AUTH_NOT_AVAIL; break; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index c99dde4..8e4e8b6 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -41,6 +41,10 @@ return true; if (strcasecmp(alg, "comp128v1") == 0) return true; + if (strcasecmp(alg, "comp128v2") == 0) + return true; + if (strcasecmp(alg, "comp128v3") == 0) + return true; return false; } @@ -118,6 +122,10 @@ ainfo.auth_algo = AUTH_ALGO_XOR; else if (strcasecmp(alg, "comp128v1") == 0) ainfo.auth_algo = AUTH_ALGO_COMP128v1; + else if (strcasecmp(alg, "comp128v2") == 0) + ainfo.auth_algo = AUTH_ALGO_COMP128v2; + else if (strcasecmp(alg, "comp128v3") == 0) + ainfo.auth_algo = AUTH_ALGO_COMP128v3; rc = osmo_hexparse(ki, ainfo.a3a8_ki, sizeof(ainfo.a3a8_ki)); if (rc < 0) { diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index b88c139..a97e1ec 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -775,11 +775,13 @@ return CMD_SUCCESS; } -#define A3A8_ALG_TYPES "(none|xor|comp128v1)" +#define A3A8_ALG_TYPES "(none|xor|comp128v1|comp128v2|comp128v3)" #define A3A8_ALG_HELP \ "Use No A3A8 algorithm\n" \ "Use XOR algorithm\n" \ - "Use COMP128v1 algorithm\n" + "Use COMP128v1 algorithm\n" \ + "Use COMP128v2 algorithm\n" \ + "Use COMP128v3 algorithm\n" DEFUN(ena_subscr_a3a8, ena_subscr_a3a8_cmd, @@ -811,6 +813,12 @@ } else if (!strcasecmp(alg_str, "comp128v1")) { ainfo.auth_algo = AUTH_ALGO_COMP128v1; minlen = maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v2")) { + ainfo.auth_algo = AUTH_ALGO_COMP128v2; + minlen = maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v3")) { + ainfo.auth_algo = AUTH_ALGO_COMP128v3; + minlen = maxlen = A38_COMP128_KEY_LEN; } else { /* Unknown method */ subscr_put(subscr); diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index fb69027..b63dd27 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -496,6 +496,16 @@ self.assertEquals(r['var'], 'subscriber-modify-v1') self.assertEquals(r['value'], 'OK') + r = self.do_set('subscriber-modify-v1', '2620345,445566,comp128v2,00112233445566778899AABBCCDDEEFF') + self.assertEquals(r['mtype'], 'SET_REPLY') + self.assertEquals(r['var'], 'subscriber-modify-v1') + self.assertEquals(r['value'], 'OK') + + r = self.do_set('subscriber-modify-v1', '2620345,445566,comp128v3,00112233445566778899AABBCCDDEEFF') + self.assertEquals(r['mtype'], 'SET_REPLY') + self.assertEquals(r['var'], 'subscriber-modify-v1') + self.assertEquals(r['value'], 'OK') + r = self.do_set('subscriber-modify-v1', '2620345,445566,none') self.assertEquals(r['mtype'], 'SET_REPLY') self.assertEquals(r['var'], 'subscriber-modify-v1') -- To view, visit https://gerrit.osmocom.org/5765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic761be0220397d100c9e6345d4d01af4889dc7c1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 11 21:25:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 21:25:52 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: > I think in general it makes sense to separate this test to several > ones, enabling or disabling them for particular architecture, > instead of disabling... I'm disabling it for now due to a known bug (https://osmocom.org/issues/2826), but the test is written in a way that should work for any architecture. -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 21:34:45 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 11 Jan 2018 21:34:45 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: Ok, but probably, this test will also fail a CPU without SSE support, because it's expected in the *.ok file. This topic is probably for a separate commit ;) Anyway, great to see how OsmoTRX becomes better! -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 11 22:09:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 11 Jan 2018 22:09:57 +0000 Subject: [PATCH] osmo-ci[master]: Enable osmo-iuh submission Message-ID: Review at https://gerrit.osmocom.org/5766 Enable osmo-iuh submission It was disabled back in a days when it was dependent on a separate branch. Thisis no longer the case so we can enable it back. Also remove remaining leftovers. Change-Id: I5fd3bdab217b61f9ee50a5f1413b60d396535395 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh 2 files changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/66/5766/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index b2e6bc8..bd30fd7 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -78,7 +78,7 @@ build_default libosmo-sccp build_libsmpp34 build_default osmo-ggsn -#IU build_default osmo-iuh +build_default osmo-iuh build_osmopcu build_osmobts build_default osmo-mgw diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index d5ecad7..7aafa5e 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -35,7 +35,3 @@ done git clone git://git.sysmocom.de/sysmo-bts/layer1-api - -#IU git -C asn1c checkout aper-prefix -#IU git -C libosmo-netif checkout sysmocom/sctp -#IU git -C libosmo-sccp checkout sysmocom/iu -- To view, visit https://gerrit.osmocom.org/5766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fd3bdab217b61f9ee50a5f1413b60d396535395 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 11 23:21:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 11 Jan 2018 23:21:43 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: > Ok, but probably, this test will also fail a CPU without > SSE support, because it's expected in the *.ok file. Ah well, I realized now there's the "SSE" word in the output, but the way it checks is generic, I mean it works the same for ARM implementation since it uses the same API. We just need to get rid of the "SSE" strings in the .ok which may be misleading. I am waiting to see if issue #2826 is resolved as "it's fine to have slightly different output", in which case I will simply create different .ok files and create different tests to be run using the same binary. If values of the output vector should be the same, then for sure we can use only 1 binary/test for all archs. -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 04:37:41 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 04:37:41 +0000 Subject: [PATCH] libosmocore[master]: gsm: add gsm0808_speech_codec_type_names Message-ID: Review at https://gerrit.osmocom.org/5767 gsm: add gsm0808_speech_codec_type_names Used for logging Speech Codec List entries in osmo-bsc, during handover decision. Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/5767/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 6ae6855..ba347ef 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -6,6 +6,7 @@ #include #include #include +#include /* * this is from GSM 03.03 CGI but is copied in GSM 08.08 @@ -420,6 +421,10 @@ GSM0808_SCT_CSD = 0xfd, /*!< CSData (see also TS 26.103) */ }; +extern const struct value_string gsm0808_speech_codec_type_names[]; +static inline const char *gsm0808_speech_codec_type_name(enum gsm0808_speech_codec_type val) +{ return get_value_string(gsm0808_speech_codec_type_names, val); } + /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ enum gsm0808_chosen_enc_alg { GSM0808_ALG_ID_A5_0 = 0x01, diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index abf3d25..c0be374 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -842,4 +842,18 @@ return get_value_string(gsm0808_bssap_names, msg_type); } +const struct value_string gsm0808_speech_codec_type_names[] = { + { GSM0808_SCT_FR1, "FR1" }, + { GSM0808_SCT_FR2, "FR2" }, + { GSM0808_SCT_FR3, "FR3" }, + { GSM0808_SCT_FR4, "FR4" }, + { GSM0808_SCT_FR5, "FR5" }, + { GSM0808_SCT_HR1, "HR1" }, + { GSM0808_SCT_HR3, "HR3" }, + { GSM0808_SCT_HR4, "HR4" }, + { GSM0808_SCT_HR6, "HR6" }, + { GSM0808_SCT_CSD, "CSD" }, + { 0, NULL } +}; + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5611ba3..985ec83 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -172,6 +172,7 @@ gsm0808_dec_cell_id_list; gsm0808_chan_type_to_speech_codec; gsm0808_speech_codec_from_chan_type; +gsm0808_speech_codec_type_names; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/5767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 04:44:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 04:44:40 +0000 Subject: [PATCH] libosmocore[master]: logging-gsmtap: send only basename of source file Message-ID: Review at https://gerrit.osmocom.org/5768 logging-gsmtap: send only basename of source file GSMTAP doesn't have a lot of space for the source file name. It is better to send only the basename of the file, because only the first bit of a long path may not convey the source file at all, needing guess work from the line number. Before: "Source File Name: ../../../../src/libosmocore/src" After: "Source File Name: telnet_interface.c" Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 --- M src/logging_gsmtap.c 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/5768/1 diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index ec6757c..82535ad 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -64,6 +64,7 @@ const char *subsys_name = log_category_name(subsys); struct timeval tv; int rc; + const char *file_basename; /* get timestamp ASAP */ osmo_gettimeofday(&tv, NULL); @@ -86,6 +87,10 @@ osmo_strlcpy(golh->subsys, subsys_name+1, sizeof(golh->subsys)); else golh->subsys[0] = '\0'; + + /* strip all leading path elements from file, if any. */ + file_basename = strrchr(file, '/'); + file = (file_basename && file_basename[1])? file_basename + 1 : file; osmo_strlcpy(golh->src_file.name, file, sizeof(golh->src_file.name)); golh->src_file.line_nr = osmo_htonl(line); golh->level = level; -- To view, visit https://gerrit.osmocom.org/5768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 09:42:56 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 09:42:56 +0000 Subject: libosmocore[master]: gsm: add gsm0808_speech_codec_type_names In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 09:46:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 09:46:26 +0000 Subject: libosmocore[master]: logging-gsmtap: send only basename of source file In-Reply-To: References: Message-ID: Patch Set 1: Why not use basename()? -- To view, visit https://gerrit.osmocom.org/5768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 09:48:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 09:48:40 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: > doesn't require root access to run the tests Could you elaborate, why root access was necessary for tests before? -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx 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 Fri Jan 12 09:50:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 09:50:45 +0000 Subject: osmo-trx[master]: Remove UDDSocket class In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67f90aa3d6a2a5e92292436d10928e0705c8f8ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx 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 Fri Jan 12 10:33:24 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Jan 2018 10:33:24 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: > Could you elaborate, why root access was necessary for tests > before? root access was not necessary for tests before. But newly added ARM testing through qemu would usually require root access due to chroot and debootstrap requirements. However by using fakeroot and proot we can fake it and avoid requiring root access to run the new added parts. -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx 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 Fri Jan 12 12:39:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 12:39:58 +0000 Subject: libosmocore[master]: logging-gsmtap: send only basename of source file In-Reply-To: References: Message-ID: Patch Set 1: > Why not use basename()? because "Both dirname() and basename() may modify the contents of path, so it may be desirable to pass a copy when calling one of these functions." (man 3 basename) -- To view, visit https://gerrit.osmocom.org/5768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:02:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:02:24 +0000 Subject: libosmocore[master]: logging-gsmtap: send only basename of source file In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5768/1/src/logging_gsmtap.c File src/logging_gsmtap.c: Line 91: /* strip all leading path elements from file, if any. */ any particular reason we're not using "basename(3)" library function that any POSIX system should have? -- To view, visit https://gerrit.osmocom.org/5768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:02:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:02:57 +0000 Subject: libosmocore[master]: gsm: add gsm0808_speech_codec_type_names In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:03:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:03:02 +0000 Subject: [MERGED] libosmocore[master]: gsm: add gsm0808_speech_codec_type_names In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm: add gsm0808_speech_codec_type_names ...................................................................... gsm: add gsm0808_speech_codec_type_names Used for logging Speech Codec List entries in osmo-bsc, during handover decision. Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832 --- M include/osmocom/gsm/protocol/gsm_08_08.h M src/gsm/gsm0808.c M src/gsm/libosmogsm.map 3 files changed, 20 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/include/osmocom/gsm/protocol/gsm_08_08.h b/include/osmocom/gsm/protocol/gsm_08_08.h index 6ae6855..ba347ef 100644 --- a/include/osmocom/gsm/protocol/gsm_08_08.h +++ b/include/osmocom/gsm/protocol/gsm_08_08.h @@ -6,6 +6,7 @@ #include #include #include +#include /* * this is from GSM 03.03 CGI but is copied in GSM 08.08 @@ -420,6 +421,10 @@ GSM0808_SCT_CSD = 0xfd, /*!< CSData (see also TS 26.103) */ }; +extern const struct value_string gsm0808_speech_codec_type_names[]; +static inline const char *gsm0808_speech_codec_type_name(enum gsm0808_speech_codec_type val) +{ return get_value_string(gsm0808_speech_codec_type_names, val); } + /* GSM 08.08 3.2.2.44 Chosen Encryption Algorithm */ enum gsm0808_chosen_enc_alg { GSM0808_ALG_ID_A5_0 = 0x01, diff --git a/src/gsm/gsm0808.c b/src/gsm/gsm0808.c index abf3d25..c0be374 100644 --- a/src/gsm/gsm0808.c +++ b/src/gsm/gsm0808.c @@ -842,4 +842,18 @@ return get_value_string(gsm0808_bssap_names, msg_type); } +const struct value_string gsm0808_speech_codec_type_names[] = { + { GSM0808_SCT_FR1, "FR1" }, + { GSM0808_SCT_FR2, "FR2" }, + { GSM0808_SCT_FR3, "FR3" }, + { GSM0808_SCT_FR4, "FR4" }, + { GSM0808_SCT_FR5, "FR5" }, + { GSM0808_SCT_HR1, "HR1" }, + { GSM0808_SCT_HR3, "HR3" }, + { GSM0808_SCT_HR4, "HR4" }, + { GSM0808_SCT_HR6, "HR6" }, + { GSM0808_SCT_CSD, "CSD" }, + { 0, NULL } +}; + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 5611ba3..985ec83 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -172,6 +172,7 @@ gsm0808_dec_cell_id_list; gsm0808_chan_type_to_speech_codec; gsm0808_speech_codec_from_chan_type; +gsm0808_speech_codec_type_names; gsm0858_rsl_ul_meas_enc; -- To view, visit https://gerrit.osmocom.org/5767 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6418d16db333188e9bcd2b32b7216f277ae8832 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:04:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:04:37 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 3 Gerrit-Project: osmo-trx 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 Fri Jan 12 13:04:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:04:51 +0000 Subject: osmo-trx[master]: Remove UDDSocket class In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5764 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67f90aa3d6a2a5e92292436d10928e0705c8f8ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:05:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:05:00 +0000 Subject: osmo-trx[master]: .gitignore: Add missing test related files In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:06:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:07 +0000 Subject: osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Fri Jan 12 13:06:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:21 +0000 Subject: osmo-trx[master]: tests: InterThread: adapt to have reproducible output and en... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:06:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:24 +0000 Subject: osmo-trx[master]: tests: Timeval: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 12 13:06:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:26 +0000 Subject: osmo-trx[master]: tests: Log: adapt to have reproducible output and enable aut... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77c40230503acadef5f64ab2624cd872f9782b98 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 12 13:06:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:36 +0000 Subject: osmo-trx[master]: Sockets.cpp: Fix initialization of UDD socket In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:06:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:38 +0000 Subject: osmo-trx[master]: tests: Sockets: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 12 13:06:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:41 +0000 Subject: osmo-trx[master]: utils/convolvtest: Remove uneeded libosmocore dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1742146c31cadec8ce8afbbdae5777f076b212d4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:06:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:46 +0000 Subject: osmo-trx[master]: Move ARCH_LA to Makefile.common In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jan 12 13:06:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:50 +0000 Subject: osmo-trx[master]: tests: Migrate convtest util to autotest infrastructure In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jan 12 13:06:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:52 +0000 Subject: osmo-trx[master]: arm/convert.c: Fix compilation error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ce6e5ec3fdb1e3e8818e2cb674470ad54e38afb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:06:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:06:55 +0000 Subject: osmo-trx[master]: arm/convert.c: Add missing convert_init implementation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9840d374d13b525b97f978ea0c5ed9e8421072a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:11 +0000 Subject: osmo-trx[master]: cosmetic: AUTHORS: fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol 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 Fri Jan 12 13:07:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:19 +0000 Subject: [MERGED] osmo-trx[master]: cosmetic: AUTHORS: fix trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: AUTHORS: fix trailing whitespace ...................................................................... cosmetic: AUTHORS: fix trailing whitespace Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d --- M AUTHORS 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/AUTHORS b/AUTHORS index a956de5..7898188 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,18 +1,18 @@ # # Copyright 2008, 2009 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio 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, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License along # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -- To view, visit https://gerrit.osmocom.org/5724 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I92d9ad9a0fd69e88928a8f57920d39dcda67d59d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:19 +0000 Subject: [MERGED] osmo-trx[master]: arm/convert.c: Add missing convert_init implementation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: arm/convert.c: Add missing convert_init implementation ...................................................................... arm/convert.c: Add missing convert_init implementation osmo-trx.cpp calls convert_init, which in case of building using --with-neon is not implemented and the compiler stops with an error. Error was introduced in 7e07cf23464532ca156fe4ea4430928da2cbbff1. Related: OS#2720 Change-Id: I9840d374d13b525b97f978ea0c5ed9e8421072a0 --- M Transceiver52M/arm/convert.c 1 file changed, 3 insertions(+), 0 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/Transceiver52M/arm/convert.c b/Transceiver52M/arm/convert.c index 3880b58..c94a3d7 100644 --- a/Transceiver52M/arm/convert.c +++ b/Transceiver52M/arm/convert.c @@ -28,6 +28,9 @@ void neon_convert_ps_si16_4n(short *, const float *, const float *, int); void neon_convert_si16_ps_4n(float *, const short *, int); +void convert_init(void) { +} + /* 4*N 16-bit signed integer conversion with remainder */ static void neon_convert_si16_ps(float *out, const short *in, -- To view, visit https://gerrit.osmocom.org/5761 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9840d374d13b525b97f978ea0c5ed9e8421072a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:20 +0000 Subject: [MERGED] osmo-trx[master]: arm/convert.c: Fix compilation error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: arm/convert.c: Fix compilation error ...................................................................... arm/convert.c: Fix compilation error Commit fe9769833fa74ea841f78c0e931130a70fc3aca9 aiming at cleaning stuff introduced a compilation error. Related: OS#2720 Change-Id: I6ce6e5ec3fdb1e3e8818e2cb674470ad54e38afb --- M Transceiver52M/arm/convert.c 1 file changed, 0 insertions(+), 1 deletion(-) 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/Transceiver52M/arm/convert.c b/Transceiver52M/arm/convert.c index 57796ea..3880b58 100644 --- a/Transceiver52M/arm/convert.c +++ b/Transceiver52M/arm/convert.c @@ -54,7 +54,6 @@ for (int i = 0; i < len % 4; i++) out[start + i] = (short) (in[start + i] * (*scale)); } -#endif void convert_float_short(short *out, const float *in, float scale, int len) { -- To view, visit https://gerrit.osmocom.org/5760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ce6e5ec3fdb1e3e8818e2cb674470ad54e38afb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:20 +0000 Subject: [MERGED] osmo-trx[master]: tests: Migrate convtest util to autotest infrastructure In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: Migrate convtest util to autotest infrastructure ...................................................................... tests: Migrate convtest util to autotest infrastructure Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e --- M .gitignore M configure.ac M tests/Makefile.am A tests/Transceiver52M/Makefile.am R tests/Transceiver52M/convolve_test.c R tests/Transceiver52M/convolve_test.ok M tests/testsuite.at D utils/convolvetest/Makefile 8 files changed, 26 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index bc6c036..2cc1b8f 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ tests/CommonLibs/URLEncodeTest tests/CommonLibs/VectorTest tests/CommonLibs/PRBSTest +tests/Transceiver52M/convolve_test # automake/autoconf *.in diff --git a/configure.ac b/configure.ac index 3ad4b41..5cee4a6 100644 --- a/configure.ac +++ b/configure.ac @@ -174,6 +174,7 @@ Transceiver52M/x86/Makefile \ tests/Makefile \ tests/CommonLibs/Makefile \ + tests/Transceiver52M/Makefile \ ]) AC_OUTPUT diff --git a/tests/Makefile.am b/tests/Makefile.am index c18bef3..d4589a4 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,5 +1,6 @@ SUBDIRS = \ CommonLibs \ + Transceiver52M \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/Transceiver52M/Makefile.am b/tests/Transceiver52M/Makefile.am new file mode 100644 index 0000000..79f73c6 --- /dev/null +++ b/tests/Transceiver52M/Makefile.am @@ -0,0 +1,17 @@ +include $(top_srcdir)/Makefile.common + +AM_CFLAGS = -Wall -I$(top_srcdir)/Transciever52 $(STD_DEFINES_AND_INCLUDES) -g + +EXTRA_DIST = convolve_test.ok + +noinst_PROGRAMS = \ + convolve_test + +convolve_test_SOURCES = convolve_test.c +convolve_test_LDADD = $(COMMON_LA) $(ARCH_LA) +if HAVE_SSE3 +convolve_test_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS) +endif +if HAVE_SSE4_1 +convolve_test_CFLAGS = $(AM_CFLAGS) $(SIMD_FLAGS) +endif diff --git a/utils/convolvetest/main.c b/tests/Transceiver52M/convolve_test.c similarity index 100% rename from utils/convolvetest/main.c rename to tests/Transceiver52M/convolve_test.c diff --git a/utils/convolvetest/convtest.ok b/tests/Transceiver52M/convolve_test.ok similarity index 100% rename from utils/convolvetest/convtest.ok rename to tests/Transceiver52M/convolve_test.ok diff --git a/tests/testsuite.at b/tests/testsuite.at index 00e6002..c6ca848 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -43,3 +43,9 @@ cat $abs_srcdir/CommonLibs/VectorTest.ok > expout AT_CHECK([$abs_top_builddir/tests/CommonLibs/VectorTest], [], [expout], []) AT_CLEANUP + +AT_SETUP([convolve_test]) +AT_KEYWORDS([convolve_test]) +cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) +AT_CLEANUP diff --git a/utils/convolvetest/Makefile b/utils/convolvetest/Makefile deleted file mode 100644 index 1163d67..0000000 --- a/utils/convolvetest/Makefile +++ /dev/null @@ -1,18 +0,0 @@ -all: main.o convolve_base.o convolve.o convolve_sse_3.o - gcc -g -Wall ./*.o -o convtest - -clean: - rm -f ./*.o - rm -f ./convtest - -main.o: main.c - gcc -g -Wall -c main.c - -convolve_base.o: ../../Transceiver52M/common/convolve_base.c - gcc -std=c99 -c ../../Transceiver52M/common/convolve_base.c - -convolve.o: ../../Transceiver52M/x86/convolve.c - gcc -std=c99 -c ../../Transceiver52M/x86/convolve.c -I ../../Transceiver52M/common/ -msse3 -DHAVE_SSE3 - -convolve_sse_3.o: ../../Transceiver52M/x86/convolve_sse_3.c - gcc -std=c99 -c ../../Transceiver52M/x86/convolve_sse_3.c -I ../../Transceiver52M/common/ -msse3 -DHAVE_SSE3 -- To view, visit https://gerrit.osmocom.org/5743 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie682abf7e83de436d0f37f9f6e0664cb2f4d0c9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:20 +0000 Subject: [MERGED] osmo-trx[master]: Move ARCH_LA to Makefile.common In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move ARCH_LA to Makefile.common ...................................................................... Move ARCH_LA to Makefile.common It will later be used by other directories too (tests/Transceiver52M). Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 --- M Makefile.common M Transceiver52M/Makefile.am 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.common b/Makefile.common index c0fc850..e9820a4 100644 --- a/Makefile.common +++ b/Makefile.common @@ -32,4 +32,10 @@ COMMON_LA = $(top_builddir)/CommonLibs/libcommon.la GSM_LA = $(top_builddir)/GSM/libGSM.la +if ARCH_ARM +ARCH_LA = $(top_builddir)/Transceiver52M/arm/libarch.la +else +ARCH_LA = $(top_builddir)/Transceiver52M/x86/libarch.la +endif + MOSTLYCLEANFILES = *~ diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index dc6e597..8df2d34 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -26,12 +26,6 @@ SUBDIRS = arm x86 -if ARCH_ARM -ARCH_LA = arm/libarch.la -else -ARCH_LA = x86/libarch.la -endif - if USRP1 AM_CPPFLAGS += $(USRP_CFLAGS) else -- To view, visit https://gerrit.osmocom.org/5742 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ca9b7fc5e1377db971cb7da0b3496ba8d61c716 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:21 +0000 Subject: [MERGED] osmo-trx[master]: utils/convolvtest: Remove uneeded libosmocore dependency In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: utils/convolvtest: Remove uneeded libosmocore dependency ...................................................................... utils/convolvtest: Remove uneeded libosmocore dependency Change-Id: I1742146c31cadec8ce8afbbdae5777f076b212d4 --- M utils/convolvetest/Makefile M utils/convolvetest/main.c 2 files changed, 2 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/utils/convolvetest/Makefile b/utils/convolvetest/Makefile index d09a4cd..1163d67 100644 --- a/utils/convolvetest/Makefile +++ b/utils/convolvetest/Makefile @@ -1,5 +1,5 @@ all: main.o convolve_base.o convolve.o convolve_sse_3.o - gcc -g -Wall ./*.o -o convtest -losmocore + gcc -g -Wall ./*.o -o convtest clean: rm -f ./*.o diff --git a/utils/convolvetest/main.c b/utils/convolvetest/main.c index ff88ba5..f4a76c3 100644 --- a/utils/convolvetest/main.c +++ b/utils/convolvetest/main.c @@ -1,6 +1,6 @@ #include #include -#include +#include #include "../../Transceiver52M/common/convolve.h" #define TESTVEC_LEN 1000 -- To view, visit https://gerrit.osmocom.org/5741 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1742146c31cadec8ce8afbbdae5777f076b212d4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:22 +0000 Subject: [MERGED] osmo-trx[master]: tests: Sockets: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: Sockets: adapt to have reproducible output and enable autotest ...................................................................... tests: Sockets: adapt to have reproducible output and enable autotest Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c --- M tests/CommonLibs/SocketsTest.cpp A tests/CommonLibs/SocketsTest.ok M tests/testsuite.at 3 files changed, 13 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 3198a5e..b51587d 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -44,7 +44,7 @@ char buf[MAX_UDP_LENGTH]; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { - COUT("read: " << buf); + CERR("read: " << buf); rc++; } else { sleep(2); @@ -65,7 +65,7 @@ buf[MAX_UDP_LENGTH] = '\0'; int count = readSocket.read(buf, MAX_UDP_LENGTH); if (count>0) { - COUT("read: " << buf); + CERR("read: " << buf); rc++; } else { sleep(2); @@ -85,20 +85,22 @@ UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); UDDSocket socket1U("testSource","testDestination"); - - COUT("socket1: " << socket1.port()); + + CERR("socket1: " << socket1.port()); // give the readers time to open sleep(1); for (int i=0; i expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([SocketsTest]) +AT_KEYWORDS([SocketsTest]) +cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], [ignore]) +AT_CLEANUP AT_SETUP([TimevalTest]) AT_KEYWORDS([TimevalTest]) -- To view, visit https://gerrit.osmocom.org/5711 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5414076c6846b849973bcdeb3f2358b28dcb004c Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 12 13:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:22 +0000 Subject: [MERGED] osmo-trx[master]: Sockets.cpp: Fix initialization of UDD socket In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Sockets.cpp: Fix initialization of UDD socket ...................................................................... Sockets.cpp: Fix initialization of UDD socket Without this line, destination address for a UDD socket is left with incorrect value AF_UNSPEC. Later on when calling DatagramSocket:write(), sendto() fails with EINVAL. This commit fixes test SocketsTest.cpp. Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433 --- M CommonLibs/Sockets.cpp 1 file changed, 1 insertion(+), 0 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/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index a65d62b..11e96dd 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -324,6 +324,7 @@ void UDDSocket::destination(const char* remotePath) { struct sockaddr_un* unAddr = (struct sockaddr_un*)mDestination; + unAddr->sun_family = AF_UNIX; strcpy(unAddr->sun_path,remotePath); } -- To view, visit https://gerrit.osmocom.org/5710 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e1b7e743a781abdcf69aa9842b30be893633433 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:22 +0000 Subject: [MERGED] osmo-trx[master]: tests: Log: adapt to have reproducible output and enable aut... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: Log: adapt to have reproducible output and enable autotest ...................................................................... tests: Log: adapt to have reproducible output and enable autotest Change-Id: I77c40230503acadef5f64ab2624cd872f9782b98 --- M tests/CommonLibs/LogTest.cpp M tests/CommonLibs/LogTest.err M tests/CommonLibs/LogTest.ok M tests/testsuite.at 4 files changed, 91 insertions(+), 89 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/LogTest.cpp b/tests/CommonLibs/LogTest.cpp index 2245386..f64041d 100644 --- a/tests/CommonLibs/LogTest.cpp +++ b/tests/CommonLibs/LogTest.cpp @@ -41,21 +41,21 @@ { gLogInit("LogTest","NOTICE",LOG_LOCAL7); - LOG(EMERG) << " testing the logger."; - LOG(ALERT) << " testing the logger."; - LOG(CRIT) << " testing the logger."; - LOG(ERR) << " testing the logger."; - LOG(WARNING) << " testing the logger."; - LOG(NOTICE) << " testing the logger."; - LOG(INFO) << " testing the logger."; - LOG(DEBUG) << " testing the logger."; + Log(LOG_EMERG).get() << " testing the logger."; + Log(LOG_ALERT).get() << " testing the logger."; + Log(LOG_CRIT).get() << " testing the logger."; + Log(LOG_ERR).get() << " testing the logger."; + Log(LOG_WARNING).get() << " testing the logger."; + Log(LOG_NOTICE).get() << " testing the logger."; + Log(LOG_INFO).get() << " testing the logger."; + Log(LOG_DEBUG).get() << " testing the logger."; std::cout << "\n\n\n"; std::cout << "testing Alarms\n"; std::cout << "you should see three lines:" << std::endl; printAlarms(); std::cout << "----------- generating 20 alarms ----------" << std::endl; for (int i = 0 ; i < 20 ; ++i) { - LOG(ALERT) << i; + Log(LOG_ALERT).get() << i; } std::cout << "you should see ten lines with the numbers 10..19:" << std::endl; printAlarms(); diff --git a/tests/CommonLibs/LogTest.err b/tests/CommonLibs/LogTest.err index eee46b9..718ff40 100644 --- a/tests/CommonLibs/LogTest.err +++ b/tests/CommonLibs/LogTest.err @@ -1,24 +1,24 @@ -EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. -CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. -ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +EMERG testing the logger. +ALERT testing the logger. +CRIT testing the logger. +ERR testing the logger. +ALERT 0 +ALERT 1 +ALERT 2 +ALERT 3 +ALERT 4 +ALERT 5 +ALERT 6 +ALERT 7 +ALERT 8 +ALERT 9 +ALERT 10 +ALERT 11 +ALERT 12 +ALERT 13 +ALERT 14 +ALERT 15 +ALERT 16 +ALERT 17 +ALERT 18 +ALERT 19 diff --git a/tests/CommonLibs/LogTest.ok b/tests/CommonLibs/LogTest.ok index 724f053..e1211b0 100644 --- a/tests/CommonLibs/LogTest.ok +++ b/tests/CommonLibs/LogTest.ok @@ -1,59 +1,61 @@ -EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. -CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. -ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. -WARNING 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:48:main: testing the logger. -NOTICE 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:49:main: testing the logger. +EMERG testing the logger. +ALERT testing the logger. +CRIT testing the logger. +ERR testing the logger. +WARNING testing the logger. +NOTICE testing the logger. +INFO testing the logger. +DEBUG testing the logger. testing Alarms you should see three lines: # alarms = 4 -EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. -CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. -ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +EMERG testing the logger. +ALERT testing the logger. +CRIT testing the logger. +ERR testing the logger. ----------- generating 20 alarms ---------- -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +ALERT 0 +ALERT 1 +ALERT 2 +ALERT 3 +ALERT 4 +ALERT 5 +ALERT 6 +ALERT 7 +ALERT 8 +ALERT 9 +ALERT 10 +ALERT 11 +ALERT 12 +ALERT 13 +ALERT 14 +ALERT 15 +ALERT 16 +ALERT 17 +ALERT 18 +ALERT 19 you should see ten lines with the numbers 10..19: # alarms = 20 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 -ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +ALERT 0 +ALERT 1 +ALERT 2 +ALERT 3 +ALERT 4 +ALERT 5 +ALERT 6 +ALERT 7 +ALERT 8 +ALERT 9 +ALERT 10 +ALERT 11 +ALERT 12 +ALERT 13 +ALERT 14 +ALERT 15 +ALERT 16 +ALERT 17 +ALERT 18 +ALERT 19 diff --git a/tests/testsuite.at b/tests/testsuite.at index 8e9a541..f6b48af 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -13,12 +13,12 @@ AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], [ignore]) AT_CLEANUP -#AT_SETUP([LogTest]) -#AT_KEYWORDS([LogTest]) -#cat $abs_srcdir/CommonLibs/LogTest.ok > expout -#cat $abs_srcdir/CommonLibs/LogTest.err > experr -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) -#AT_CLEANUP +AT_SETUP([LogTest]) +AT_KEYWORDS([LogTest]) +cat $abs_srcdir/CommonLibs/LogTest.ok > expout +cat $abs_srcdir/CommonLibs/LogTest.err > experr +AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) +AT_CLEANUP AT_SETUP([PRBSTest]) AT_KEYWORDS([PRBSTest]) -- To view, visit https://gerrit.osmocom.org/5709 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77c40230503acadef5f64ab2624cd872f9782b98 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 12 13:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:22 +0000 Subject: [MERGED] osmo-trx[master]: tests: Timeval: adapt to have reproducible output and enable... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: Timeval: adapt to have reproducible output and enable autotest ...................................................................... tests: Timeval: adapt to have reproducible output and enable autotest Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 --- M tests/CommonLibs/TimevalTest.cpp M tests/CommonLibs/TimevalTest.ok M tests/testsuite.at 3 files changed, 23 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp index b4746f2..f579878 100644 --- a/tests/CommonLibs/TimevalTest.cpp +++ b/tests/CommonLibs/TimevalTest.cpp @@ -28,18 +28,31 @@ #include "Timeval.h" #include +#include using namespace std; int main(int argc, char *argv[]) { - Timeval then(10000); - cout << then.elapsed() << endl; + assert(then.elapsed() == -10000); + cerr << then << " elapsed: " << then.elapsed() << endl; + double then_seconds = then.seconds(); + double last_now = Timeval().seconds(); + long last_remaining = 10000; + int loops = 0; while (!then.passed()) { - cout << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + double tnow = Timeval().seconds(); + cerr << "now: " << tnow << " then: " << then << " remaining: " << then.remaining() << endl; + assert(last_now <= tnow && last_remaining >= then.remaining()); + assert(then_seconds == then.seconds()); usleep(500000); + loops++; } - cout << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + cerr << "now: " << Timeval() << " then: " << then << " remaining: " << then.remaining() << endl; + assert(then.remaining() <= 0); + assert(loops >= 18); + + printf("Done\n"); } diff --git a/tests/CommonLibs/TimevalTest.ok b/tests/CommonLibs/TimevalTest.ok index c97031d..a965a70 100644 --- a/tests/CommonLibs/TimevalTest.ok +++ b/tests/CommonLibs/TimevalTest.ok @@ -1,22 +1 @@ --10000 -now: 1515515602.357742 then: 1515515612.357710 remaining: 10000 -now: 1515515602.857837 then: 1515515612.357710 remaining: 9500 -now: 1515515603.357975 then: 1515515612.357710 remaining: 9000 -now: 1515515603.858163 then: 1515515612.357710 remaining: 8500 -now: 1515515604.358353 then: 1515515612.357710 remaining: 8000 -now: 1515515604.858465 then: 1515515612.357710 remaining: 7500 -now: 1515515605.358622 then: 1515515612.357710 remaining: 7000 -now: 1515515605.858745 then: 1515515612.357710 remaining: 6499 -now: 1515515606.358852 then: 1515515612.357710 remaining: 5999 -now: 1515515606.859055 then: 1515515612.357710 remaining: 5499 -now: 1515515607.359170 then: 1515515612.357710 remaining: 4999 -now: 1515515607.859349 then: 1515515612.357710 remaining: 4499 -now: 1515515608.359455 then: 1515515612.357710 remaining: 3999 -now: 1515515608.859549 then: 1515515612.357710 remaining: 3499 -now: 1515515609.359748 then: 1515515612.357710 remaining: 2998 -now: 1515515609.859865 then: 1515515612.357710 remaining: 2498 -now: 1515515610.360064 then: 1515515612.357710 remaining: 1998 -now: 1515515610.860223 then: 1515515612.357710 remaining: 1498 -now: 1515515611.360386 then: 1515515612.357710 remaining: 998 -now: 1515515611.860592 then: 1515515612.357710 remaining: 498 -now: 1515515612.360712 then: 1515515612.357710 remaining: -3 +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 5d519d2..8e9a541 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -32,11 +32,11 @@ #AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) #AT_CLEANUP -#AT_SETUP([TimevalTest]) -#AT_KEYWORDS([TimevalTest]) -#cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([TimevalTest]) +AT_KEYWORDS([TimevalTest]) +cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], [ignore]) +AT_CLEANUP AT_SETUP([VectorTest]) AT_KEYWORDS([VectorTest]) -- To view, visit https://gerrit.osmocom.org/5708 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a79892ba3c934879a171789e0edb357277acae4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Jan 12 13:07:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:22 +0000 Subject: [MERGED] osmo-trx[master]: tests: InterThread: adapt to have reproducible output and en... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: InterThread: adapt to have reproducible output and enable autotest ...................................................................... tests: InterThread: adapt to have reproducible output and enable autotest Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f --- M tests/CommonLibs/InterthreadTest.cpp M tests/CommonLibs/InterthreadTest.ok M tests/testsuite.at 3 files changed, 33 insertions(+), 91 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/InterthreadTest.cpp b/tests/CommonLibs/InterthreadTest.cpp index 03445d9..c131c2a 100644 --- a/tests/CommonLibs/InterthreadTest.cpp +++ b/tests/CommonLibs/InterthreadTest.cpp @@ -35,14 +35,20 @@ InterthreadQueue gQ; InterthreadMap gMap; +int q_last_read_val = -1; +int q_last_write_val; +int m_last_read_val; +int m_last_write_val; + void* qWriter(void*) { int *p; for (int i=0; i<20; i++) { p = new int; *p = i; - COUT("queue write " << *p); + CERR("queue write " << *p); gQ.write(p); + q_last_write_val = i; if (random()%2) sleep(1); } p = new int; @@ -56,8 +62,14 @@ bool done = false; while (!done) { int *p = gQ.read(); - COUT("queue read " << *p); - if (*p<0) done=true; + CERR("queue read " << *p); + if (*p<0) { + assert(q_last_read_val == 19 && *p == -1); + done = true; + } else { + assert(q_last_read_val == *p - 1); + q_last_read_val = *p; + } delete p; } return NULL; @@ -70,8 +82,9 @@ for (int i=0; i<20; i++) { p = new int; *p = i; - COUT("map write " << *p); + CERR("map write " << *p); gMap.write(i,p); + m_last_write_val = i; if (random()%2) sleep(1); } return NULL; @@ -81,7 +94,9 @@ { for (int i=0; i<20; i++) { int *p = gMap.read(i); - COUT("map read " << *p); + CERR("map read " << *p); + assert(*p == i); + m_last_read_val = *p; // InterthreadMap will delete the pointers // delete p; } @@ -109,6 +124,13 @@ qWriterThread.join(); mapReaderThread.join(); mapWriterThread.join(); + + assert(q_last_write_val == 19); + assert(q_last_read_val == 19); + assert(m_last_write_val == 19); + assert(m_last_read_val == 19); + + printf("Done\n"); } diff --git a/tests/CommonLibs/InterthreadTest.ok b/tests/CommonLibs/InterthreadTest.ok index db382bb..a965a70 100644 --- a/tests/CommonLibs/InterthreadTest.ok +++ b/tests/CommonLibs/InterthreadTest.ok @@ -1,81 +1 @@ -1515515500.150033 140715424245504: queue write 0 -1515515500.150105 140715423979264: map write 0 -1515515500.150132 140715423979264: map write 1 -1515515500.150143 140715424777984: queue read 0 -1515515500.150175 140715424511744: map read 0 -1515515500.150194 140715424511744: map read 1 -1515515501.150203 140715424245504: queue write 1 -1515515501.150288 140715423979264: map write 2 -1515515501.150334 140715424777984: queue read 1 -1515515501.150366 140715424511744: map read 2 -1515515502.150405 140715424245504: queue write 2 -1515515502.150488 140715423979264: map write 3 -1515515502.150533 140715424777984: queue read 2 -1515515502.150612 140715423979264: map write 4 -1515515502.150642 140715423979264: map write 5 -1515515502.150662 140715424511744: map read 3 -1515515502.150680 140715424511744: map read 4 -1515515502.150686 140715424511744: map read 5 -1515515503.150607 140715424245504: queue write 3 -1515515503.150709 140715424777984: queue read 3 -1515515503.150741 140715423979264: map write 6 -1515515503.150760 140715423979264: map write 7 -1515515503.150776 140715424511744: map read 6 -1515515503.150788 140715424511744: map read 7 -1515515504.150770 140715424245504: queue write 4 -1515515504.150839 140715424245504: queue write 5 -1515515504.150857 140715423979264: map write 8 -1515515504.150876 140715424777984: queue read 4 -1515515504.150904 140715424777984: queue read 5 -1515515504.150919 140715424511744: map read 8 -1515515505.150990 140715424245504: queue write 6 -1515515505.151066 140715423979264: map write 9 -1515515505.151095 140715424245504: queue write 7 -1515515505.151127 140715424245504: queue write 8 -1515515505.151143 140715424245504: queue write 9 -1515515505.151163 140715424245504: queue write 10 -1515515505.151179 140715424777984: queue read 6 -1515515505.151210 140715424777984: queue read 7 -1515515505.151217 140715424777984: queue read 8 -1515515505.151221 140715424777984: queue read 9 -1515515505.151226 140715424777984: queue read 10 -1515515505.151249 140715423979264: map write 10 -1515515505.151277 140715424511744: map read 9 -1515515505.151291 140715424511744: map read 10 -1515515505.151298 140715423979264: map write 11 -1515515505.151317 140715424511744: map read 11 -1515515506.151303 140715424245504: queue write 11 -1515515506.151386 140715423979264: map write 12 -1515515506.151414 140715424777984: queue read 11 -1515515506.151457 140715424511744: map read 12 -1515515506.151528 140715423979264: map write 13 -1515515506.151567 140715423979264: map write 14 -1515515506.151577 140715423979264: map write 15 -1515515506.151601 140715424511744: map read 13 -1515515506.151621 140715424511744: map read 14 -1515515506.151628 140715424511744: map read 15 -1515515507.151498 140715424245504: queue write 12 -1515515507.151606 140715424777984: queue read 12 -1515515507.151654 140715423979264: map write 16 -1515515507.151711 140715424511744: map read 16 -1515515508.151707 140715424245504: queue write 13 -1515515508.151778 140715423979264: map write 17 -1515515508.151816 140715423979264: map write 18 -1515515508.151830 140715424511744: map read 17 -1515515508.151870 140715424511744: map read 18 -1515515508.151904 140715423979264: map write 19 -1515515508.151963 140715424777984: queue read 13 -1515515508.151997 140715424511744: map read 19 -1515515509.151920 140715424245504: queue write 14 -1515515509.152023 140715424777984: queue read 14 -1515515510.152109 140715424245504: queue write 15 -1515515510.152218 140715424777984: queue read 15 -1515515511.152258 140715424245504: queue write 16 -1515515511.152380 140715424777984: queue read 16 -1515515512.152409 140715424245504: queue write 17 -1515515512.152449 140715424245504: queue write 18 -1515515512.152458 140715424777984: queue read 17 -1515515512.152477 140715424777984: queue read 18 -1515515513.152574 140715424245504: queue write 19 -1515515513.152674 140715424777984: queue read 19 -1515515513.152708 140715424777984: queue read -1 +Done diff --git a/tests/testsuite.at b/tests/testsuite.at index 2c1e0b5..5d519d2 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -7,11 +7,11 @@ AT_CHECK([$abs_top_builddir/tests/CommonLibs/BitVectorTest], [], [expout], []) AT_CLEANUP -#AT_SETUP([InterthreadTest]) -#AT_KEYWORDS([InterthreadTest]) -#cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout -#AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], []) -#AT_CLEANUP +AT_SETUP([InterthreadTest]) +AT_KEYWORDS([InterthreadTest]) +cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], [ignore]) +AT_CLEANUP #AT_SETUP([LogTest]) #AT_KEYWORDS([LogTest]) -- To view, visit https://gerrit.osmocom.org/5707 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I05d4067890b526bd72d2eb31cf76de43ee11e80f Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:23 +0000 Subject: [MERGED] osmo-trx[master]: Set up GNU Autotest infrastructure In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Set up GNU Autotest infrastructure ...................................................................... Set up GNU Autotest infrastructure Test files are moved from CommonLibs/ to tests/CommonLibs/. Some tests are disabled in autotest because they generate timedate related output which cannot exactly match against expected output. Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc --- M .gitignore M AUTHORS M CommonLibs/Makefile.am M Makefile.am M configure.ac R tests/CommonLibs/BitVectorTest.cpp A tests/CommonLibs/BitVectorTest.ok R tests/CommonLibs/InterthreadTest.cpp A tests/CommonLibs/InterthreadTest.ok R tests/CommonLibs/LogTest.cpp A tests/CommonLibs/LogTest.err A tests/CommonLibs/LogTest.ok A tests/CommonLibs/Makefile.am R tests/CommonLibs/PRBSTest.cpp A tests/CommonLibs/PRBSTest.ok R tests/CommonLibs/SocketsTest.cpp R tests/CommonLibs/TimevalTest.cpp A tests/CommonLibs/TimevalTest.ok R tests/CommonLibs/VectorTest.cpp A tests/CommonLibs/VectorTest.ok A tests/Makefile.am A tests/testsuite.at 22 files changed, 359 insertions(+), 113 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/.gitignore b/.gitignore index d560f19..bc6c036 100644 --- a/.gitignore +++ b/.gitignore @@ -5,17 +5,16 @@ Transceiver52M/osmo-trx # tests -CommonLibs/BitVectorTest -CommonLibs/ConfigurationTest -CommonLibs/F16Test -CommonLibs/InterthreadTest -CommonLibs/LogTest -CommonLibs/RegexpTest -CommonLibs/SocketsTest -CommonLibs/TimevalTest -CommonLibs/URLEncodeTest -CommonLibs/VectorTest -CommonLibs/PRBSTest +tests/CommonLibs/BitVectorTest +tests/CommonLibs/F16Test +tests/CommonLibs/InterthreadTest +tests/CommonLibs/LogTest +tests/CommonLibs/RegexpTest +tests/CommonLibs/SocketsTest +tests/CommonLibs/TimevalTest +tests/CommonLibs/URLEncodeTest +tests/CommonLibs/VectorTest +tests/CommonLibs/PRBSTest # automake/autoconf *.in @@ -41,6 +40,8 @@ missing stamp-h1 INSTALL +tests/package.m4 +tests/testsuite # vim *.sw? diff --git a/AUTHORS b/AUTHORS index 7898188..53a3c7d 100644 --- a/AUTHORS +++ b/AUTHORS @@ -23,31 +23,17 @@ CLI/CLI.h CommonLibs/Assert.h CommonLibs/BitVector.cpp - CommonLibs/BitVectorTest.cpp CommonLibs/Interthread.h - CommonLibs/InterthreadTest.cpp CommonLibs/LinkedLists.cpp CommonLibs/LinkedLists.h CommonLibs/Regexp.h - CommonLibs/RegexpTest.cpp CommonLibs/Sockets.cpp CommonLibs/Sockets.h - CommonLibs/SocketsTest.cpp CommonLibs/Threads.cpp CommonLibs/Threads.h CommonLibs/Timeval.cpp CommonLibs/Timeval.h - CommonLibs/TimevalTest.cpp CommonLibs/Vector.h - CommonLibs/VectorTest.cpp - Control/CallControl.cpp - Control/ControlCommon.cpp - Control/ControlCommon.h - Control/FACCHDispatch.cpp - Control/MobilityManagement.cpp - Control/PagerTest.cpp - Control/RadioResource.cpp - Control/SDCCHDispatch.cpp GSM/GSM610Tables.cpp GSM/GSM610Tables.h GSM/GSMCommon.cpp @@ -79,26 +65,15 @@ GSM/GSMTransfer.cpp GSM/GSMTransfer.h LICENSEBLOCK - SIP/SIPEngine.h - SIP/SIPInterface.h - SMS/SMSMessages.cpp - SMS/SMSMessages.h - SMS/SMSTransfer.cpp - SMS/SMSTransfer.h TRXManager/TRXManager.cpp Transceiver/Complex.h - tests/AGCHTest.cpp - tests/BeaconTest.cpp - tests/CallTest.cpp - tests/CallTest2.cpp - tests/LAPDmTest.cpp - tests/LoopbackTest.cpp - tests/RegistrationTest.cpp - tests/TRXSimulator.cpp + tests/CommonLibs/BitVectorTest.cpp + tests/CommonLibs/InterthreadTest.cpp + tests/CommonLibs/SocketsTest.cpp + tests/CommonLibs/TimevalTest.cpp + tests/CommonLibs/VectorTest.cpp Harvind S. Samra, hssamra at kestrelsp.com: - Control/PagerTest.cpp - Control/RadioResource.cpp GSM/GSMConfig.h GSM/GSMTransfer.h LICENSEBLOCK @@ -120,13 +95,6 @@ Transceiver/testRadio.cpp Raffi Sevlian, raffisev at gmail.com: - Control/CallControl.cpp - Control/ControlCommon.cpp - Control/ControlCommon.h - Control/FACCHDispatch.cpp - Control/MobilityManagement.cpp - Control/PagerTest.cpp - Control/RadioResource.cpp GSM/GSMCommon.h GSM/GSMConfig.h GSM/GSML1FEC.h @@ -151,32 +119,6 @@ GSM/GSMSAPMux.h GSM/GSMTransfer.h LICENSEBLOCK - SIP/SIPEngine.cpp - SIP/SIPInterface.cpp - SIP/SIPInterface.h - SIP/SIPMessage.cpp - SIP/SIPMessage.h - SIP/SIPUtility.cpp - SIP/SIPUtility.h - SMS/CMMessage.cpp - SMS/CMMessage.h - SMS/CMProcessor.cpp - SMS/CMProcessor.h - SMS/CMTest.cpp - SMS/RLMessage.cpp - SMS/RLMessage.h - SMS/RLProcessor.cpp - SMS/RLProcessor.h - SMS/SMSMessages.cpp - SMS/SMSMessages.h - SMS/SMSProcessors.cpp - SMS/SMSProcessors.h - SMS/SMSTransfer.cpp - SMS/SMSTransfer.h - SMS/TLMessage.cpp - SMS/TLMessage.h - SMS/TLProcessor.cpp - SMS/TLProcessor.h TRXManager/TRXManager.h Alon Levy, alonlevy1 at gmail.com diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index d42e82a..46cc143 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -38,17 +38,6 @@ Timeval.cpp \ Logger.cpp -noinst_PROGRAMS = \ - BitVectorTest \ - PRBSTest \ - InterthreadTest \ - SocketsTest \ - TimevalTest \ - VectorTest \ - LogTest - -# ReportingTest - noinst_HEADERS = \ BitVector.h \ PRBS.h \ @@ -59,30 +48,3 @@ Timeval.h \ Vector.h \ Logger.h - -BitVectorTest_SOURCES = BitVectorTest.cpp -BitVectorTest_LDADD = libcommon.la - -PRBSTest_SOURCES = PRBSTest.cpp - -InterthreadTest_SOURCES = InterthreadTest.cpp -InterthreadTest_LDADD = libcommon.la -InterthreadTest_LDFLAGS = -lpthread - -SocketsTest_SOURCES = SocketsTest.cpp -SocketsTest_LDADD = libcommon.la -SocketsTest_LDFLAGS = -lpthread - -TimevalTest_SOURCES = TimevalTest.cpp -TimevalTest_LDADD = libcommon.la - -VectorTest_SOURCES = VectorTest.cpp -VectorTest_LDADD = libcommon.la - -# ReportingTest_SOURCES = ReportingTest.cpp -# ReportingTest_LDADD = libcommon.la - -LogTest_SOURCES = LogTest.cpp -LogTest_LDADD = libcommon.la - -MOSTLYCLEANFILES += testSource testDestination diff --git a/Makefile.am b/Makefile.am index 658eae4..1e659a0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -30,7 +30,8 @@ SUBDIRS = \ CommonLibs \ GSM \ - Transceiver52M + Transceiver52M \ + tests EXTRA_DIST = \ autogen.sh \ diff --git a/configure.ac b/configure.ac index 1a9712a..3ad4b41 100644 --- a/configure.ac +++ b/configure.ac @@ -26,6 +26,7 @@ AC_CONFIG_AUX_DIR([.]) AC_CONFIG_MACRO_DIR([config]) AM_CONFIG_HEADER(config.h) +AC_CONFIG_TESTDIR(tests) AC_CANONICAL_BUILD AC_CANONICAL_HOST @@ -171,6 +172,8 @@ Transceiver52M/Makefile \ Transceiver52M/arm/Makefile \ Transceiver52M/x86/Makefile \ + tests/Makefile \ + tests/CommonLibs/Makefile \ ]) AC_OUTPUT diff --git a/CommonLibs/BitVectorTest.cpp b/tests/CommonLibs/BitVectorTest.cpp similarity index 100% rename from CommonLibs/BitVectorTest.cpp rename to tests/CommonLibs/BitVectorTest.cpp diff --git a/tests/CommonLibs/BitVectorTest.ok b/tests/CommonLibs/BitVectorTest.ok new file mode 100644 index 0000000..f959a08 --- /dev/null +++ b/tests/CommonLibs/BitVectorTest.ok @@ -0,0 +1,8 @@ +15 15 240 +000011110000 +101011110000 +175 +111101010000 +ts=abcdefgh +tp=0110000101100010011000110110010001100101011001100110011101101000000000 +ts=abcdefgh diff --git a/CommonLibs/InterthreadTest.cpp b/tests/CommonLibs/InterthreadTest.cpp similarity index 100% rename from CommonLibs/InterthreadTest.cpp rename to tests/CommonLibs/InterthreadTest.cpp diff --git a/tests/CommonLibs/InterthreadTest.ok b/tests/CommonLibs/InterthreadTest.ok new file mode 100644 index 0000000..db382bb --- /dev/null +++ b/tests/CommonLibs/InterthreadTest.ok @@ -0,0 +1,81 @@ +1515515500.150033 140715424245504: queue write 0 +1515515500.150105 140715423979264: map write 0 +1515515500.150132 140715423979264: map write 1 +1515515500.150143 140715424777984: queue read 0 +1515515500.150175 140715424511744: map read 0 +1515515500.150194 140715424511744: map read 1 +1515515501.150203 140715424245504: queue write 1 +1515515501.150288 140715423979264: map write 2 +1515515501.150334 140715424777984: queue read 1 +1515515501.150366 140715424511744: map read 2 +1515515502.150405 140715424245504: queue write 2 +1515515502.150488 140715423979264: map write 3 +1515515502.150533 140715424777984: queue read 2 +1515515502.150612 140715423979264: map write 4 +1515515502.150642 140715423979264: map write 5 +1515515502.150662 140715424511744: map read 3 +1515515502.150680 140715424511744: map read 4 +1515515502.150686 140715424511744: map read 5 +1515515503.150607 140715424245504: queue write 3 +1515515503.150709 140715424777984: queue read 3 +1515515503.150741 140715423979264: map write 6 +1515515503.150760 140715423979264: map write 7 +1515515503.150776 140715424511744: map read 6 +1515515503.150788 140715424511744: map read 7 +1515515504.150770 140715424245504: queue write 4 +1515515504.150839 140715424245504: queue write 5 +1515515504.150857 140715423979264: map write 8 +1515515504.150876 140715424777984: queue read 4 +1515515504.150904 140715424777984: queue read 5 +1515515504.150919 140715424511744: map read 8 +1515515505.150990 140715424245504: queue write 6 +1515515505.151066 140715423979264: map write 9 +1515515505.151095 140715424245504: queue write 7 +1515515505.151127 140715424245504: queue write 8 +1515515505.151143 140715424245504: queue write 9 +1515515505.151163 140715424245504: queue write 10 +1515515505.151179 140715424777984: queue read 6 +1515515505.151210 140715424777984: queue read 7 +1515515505.151217 140715424777984: queue read 8 +1515515505.151221 140715424777984: queue read 9 +1515515505.151226 140715424777984: queue read 10 +1515515505.151249 140715423979264: map write 10 +1515515505.151277 140715424511744: map read 9 +1515515505.151291 140715424511744: map read 10 +1515515505.151298 140715423979264: map write 11 +1515515505.151317 140715424511744: map read 11 +1515515506.151303 140715424245504: queue write 11 +1515515506.151386 140715423979264: map write 12 +1515515506.151414 140715424777984: queue read 11 +1515515506.151457 140715424511744: map read 12 +1515515506.151528 140715423979264: map write 13 +1515515506.151567 140715423979264: map write 14 +1515515506.151577 140715423979264: map write 15 +1515515506.151601 140715424511744: map read 13 +1515515506.151621 140715424511744: map read 14 +1515515506.151628 140715424511744: map read 15 +1515515507.151498 140715424245504: queue write 12 +1515515507.151606 140715424777984: queue read 12 +1515515507.151654 140715423979264: map write 16 +1515515507.151711 140715424511744: map read 16 +1515515508.151707 140715424245504: queue write 13 +1515515508.151778 140715423979264: map write 17 +1515515508.151816 140715423979264: map write 18 +1515515508.151830 140715424511744: map read 17 +1515515508.151870 140715424511744: map read 18 +1515515508.151904 140715423979264: map write 19 +1515515508.151963 140715424777984: queue read 13 +1515515508.151997 140715424511744: map read 19 +1515515509.151920 140715424245504: queue write 14 +1515515509.152023 140715424777984: queue read 14 +1515515510.152109 140715424245504: queue write 15 +1515515510.152218 140715424777984: queue read 15 +1515515511.152258 140715424245504: queue write 16 +1515515511.152380 140715424777984: queue read 16 +1515515512.152409 140715424245504: queue write 17 +1515515512.152449 140715424245504: queue write 18 +1515515512.152458 140715424777984: queue read 17 +1515515512.152477 140715424777984: queue read 18 +1515515513.152574 140715424245504: queue write 19 +1515515513.152674 140715424777984: queue read 19 +1515515513.152708 140715424777984: queue read -1 diff --git a/CommonLibs/LogTest.cpp b/tests/CommonLibs/LogTest.cpp similarity index 100% rename from CommonLibs/LogTest.cpp rename to tests/CommonLibs/LogTest.cpp diff --git a/tests/CommonLibs/LogTest.err b/tests/CommonLibs/LogTest.err new file mode 100644 index 0000000..eee46b9 --- /dev/null +++ b/tests/CommonLibs/LogTest.err @@ -0,0 +1,24 @@ +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 diff --git a/tests/CommonLibs/LogTest.ok b/tests/CommonLibs/LogTest.ok new file mode 100644 index 0000000..724f053 --- /dev/null +++ b/tests/CommonLibs/LogTest.ok @@ -0,0 +1,59 @@ +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +WARNING 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:48:main: testing the logger. +NOTICE 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:49:main: testing the logger. + + + +testing Alarms +you should see three lines: +# alarms = 4 +EMERG 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:44:main: testing the logger. +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:45:main: testing the logger. +CRIT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:46:main: testing the logger. +ERR 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:47:main: testing the logger. +----------- generating 20 alarms ---------- +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 +you should see ten lines with the numbers 10..19: +# alarms = 20 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 0 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 1 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 2 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 3 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 4 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 5 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 6 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 7 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 8 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 9 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 10 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 11 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 12 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 13 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 14 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 15 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 16 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 17 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 18 +ALERT 140239160588096 17:32:27.2 /home/pespin/dev/sysmocom/git/osmo-trx/tests/CommonLibs/LogTest.cpp:58:main: 19 diff --git a/tests/CommonLibs/Makefile.am b/tests/CommonLibs/Makefile.am new file mode 100644 index 0000000..6bd1852 --- /dev/null +++ b/tests/CommonLibs/Makefile.am @@ -0,0 +1,44 @@ +include $(top_srcdir)/Makefile.common + +AM_CPPFLAGS = -Wall -I$(top_srcdir)/CommonLibs $(STD_DEFINES_AND_INCLUDES) -g + +EXTRA_DIST = BitVectorTest.ok \ + PRBSTest.ok \ + InterthreadTest.ok \ + SocketsTest.ok \ + TimevalTest.ok \ + VectorTest.ok \ + LogTest.ok + +noinst_PROGRAMS = \ + BitVectorTest \ + PRBSTest \ + InterthreadTest \ + SocketsTest \ + TimevalTest \ + VectorTest \ + LogTest + +BitVectorTest_SOURCES = BitVectorTest.cpp +BitVectorTest_LDADD = $(COMMON_LA) + +PRBSTest_SOURCES = PRBSTest.cpp + +InterthreadTest_SOURCES = InterthreadTest.cpp +InterthreadTest_LDADD = $(COMMON_LA) +InterthreadTest_LDFLAGS = -lpthread + +SocketsTest_SOURCES = SocketsTest.cpp +SocketsTest_LDADD = $(COMMON_LA) +SocketsTest_LDFLAGS = -lpthread + +TimevalTest_SOURCES = TimevalTest.cpp +TimevalTest_LDADD = $(COMMON_LA) + +VectorTest_SOURCES = VectorTest.cpp +VectorTest_LDADD = $(COMMON_LA) + +LogTest_SOURCES = LogTest.cpp +LogTest_LDADD = $(COMMON_LA) + +MOSTLYCLEANFILES += testSource testDestination diff --git a/CommonLibs/PRBSTest.cpp b/tests/CommonLibs/PRBSTest.cpp similarity index 100% rename from CommonLibs/PRBSTest.cpp rename to tests/CommonLibs/PRBSTest.cpp diff --git a/tests/CommonLibs/PRBSTest.ok b/tests/CommonLibs/PRBSTest.ok new file mode 100644 index 0000000..d3fe378 --- /dev/null +++ b/tests/CommonLibs/PRBSTest.ok @@ -0,0 +1,4 @@ +1000010001100001001110010101011000011011110100110111001000101000010101101001111110110010010010110111111001001101010011001100000001100011001010001101001011111110100010110001110101100101100111100011111011101000001101011011011101100000101101011111010101010000001010010101111001011101110000001110011101001001111010111010100010010000110011100001011110110110011010000111011110000111111111000001111011111000101110011001000001001010011101101000111100111110011011000101010010001110001101101010111000100110001000100000000 +Period: 511 +1000000000000011000000000000101000000000001111000000000010001000000000110011000000001010101000000011111111000000100000001000001100000011000010100000101000111100001111001000100010001011001100110011101010101010100111111111111101000000000000111000000000001001000000000011011000000000101101000000001110111000000010011001000000110101011000001011111101000011100000111000100100001001001101100011011010110100101101111011101110110001100110011010010101010101110111111111110011000000000010101000000000111111000000001000001000000011000011000000101000101000001111001111000010001010001000110011110011001010100010101011111100111111100000101000000100001111000001100010001000010100110011000111101010101001000111111111011001000000001101011000000010111101000000111000111000001001001001000011011011011000101101101101001110110110111010011011011001110101101101010011110110111110100011011000011100101101000100101110111001101110011001010110010101011111010111111100001111000000100010001000001100110011000010101010101000111111111111001000000000001011000000000011101000000000100111000000001101001000000010111011000000111001101000001001010111000011011111001000101100001011001110100011101010011100100111110100101101000011101110111000100110011001001101010101011010111111111101111000000000110001000000001010011000000011110101000000100011111000001100100001000010101100011000111110100101001000011101111011000100110001101001101010010111010111110111001111000011001010001000101011110011001111100010101010000100111111110001101000000010010111000000110111001000001011001011000011101011101000100111100111001101000101001010111001111011111001010001100001011110010100011100010111100100100111000101101101001001110110111011010011011001101110101101010110011110111111010100011000001111100101000010000101111000110001110001001010010010011011110110110101100011011011110100101101100011101110110100100110011011101101010101100110111111110101011000000011111101000000100000111000001100001001000010100011011000111100101101001000101110111011001110011001101010010101010111110111111111000011000000001000101000000011001111000000101010001000001111110011000010000010101000110000111111001010001000001011110011000011100010101000100100111111001101101000001010110111000011111011001000100001101011001100010111101010100111000111111101001001000000111011011000001001101101000011010110111000101111011001001110001101011010010010111101110110111000110011011001001010101101011011111110111101100000011000110100000101001011100001111011100100010001100101100110010101110101010111110011111111000010100000001000111100000011001000100000101011001100001111101010100010000111111100110001000000101010011000001111110101000010000011111000110000100001001010001100011011110010100101100010111101110100111000110011101001001010100111011011111101001101100000111010110100001001111011100011010001100100101110010101101110010111110110010111000011010111001000101111001011001110001011101010010011100111110110100101000011011101111000101100110001001110101010011010011111110101110100000011110011100000100010100100001100111101100010101000110100111111001011101000001011100111000011100101001000100101111011001101110001101010110010010111111010110111000001111011001000010001101011000110010111101001010111000111011111001001001100001011011010100011101101111100100110110000101101011010001110111101110010011000110010110101001010111011111011111001100001100001010100010100011111100111100100000101000101100001111001110100010001010011100110011110100101010100011101111111100100110000000101101010000001110111110000010011000010000110101000110001011111001010011100001011110100100011100011101100100100100110101101101101011110110110111100011011011000100101101101001101110110111010110011011001111010101101010001111110111110010000011000010110000101000111010001111001001110010001011010010110011101110111010100110011001111101010101010000111111111110001000000000010011000000000110101000000001011111000000011100001000000100100011000001101100101000010110101111000111011110001001001100010011011010100110101101111101011110110000111100011010001000100101110011001101110010101010110010111111111010111000000001111001000000010001011000000110011101000001010100111000011111101001000100000111011001100001001101010100011010111111100101111000000101110001000001110010011000010010110101000110111011111001011001100001011101010100011100111111100100101000000101101111000001110110001000010011010011000110101110101001011110011111011100010100001100100111100010101101000100111110111001101000011001010111000101011111001001111100001011010000100011101110001100100110010010101101010110111110111111011000011000001101000101000010111001111000111001010001001001011110011011011100010101101100100111110110101101000011011110111000101100011001001110100101011010011101111101110100110000110011101010001010100111110011111101000010100000111000111100001001001000100011011011001100101101101010101110110111111110011011000000010101101000000111110111000001000011001000011000101011000101001111101001111010000111010001110001001110010010011010010110110101110111011011110011001101100010101010110100111111111011101000000001100111000000010101001000000111111011000001000001101000011000010111000101000111001001111001001011010001011011101110011101100110010100110101010111101011111111000111100000001001000100000011011001100000101101010100001110111111100010011000000100110101000001101011111000010111100001000111000100011001001001100101011011010101111101101111110000110110000010001011010000110011101110001010100110010011111101010110100000111111011100001000001100100011000010101100101000111110101111001000011110001011000100010011101001100110100111010101011101001111111100111010000000101001110000001111010010000010001110110000110010011010001010110101110011111011110010100001100010111100010100111000100111101001001101000111011010111001001101111001011010110001011101111010011100110001110100101010010011101111110110100110000011011101010000101100111110001110101000010010011111000110110100001001011011100011011101100100101100110101101110101011110110011111100011010100000100101111100001101110000100010110010001100111010110010101001111010111111010001111000001110010001000010010110011000110111010101001011001111111011101010000001100111110000010101000010000111111000110001000001001010011000011011110101000101100011111001110100100001010011101100011110100110100100011101011101100100111100110101101000101011110111001111100011001010000100101011110001101111100010010110000100110111010001101011001110010111101010010111000111110111001001000011001011011000101011101101001111100110111010000101011001110001111101010010010000111110110110001000011011010011000101101110101001110110011111010011010100001110101111100010011110000100110100010001101011100110010111100101010111000101111111001001110000001011010010000011101110110000100110011010001101010101110010111111110010111000000010111001000000111001011000001001011101000011011100111000101100101001001110101111011010011110001101110100010010110011100110111010100101011001111101111101010000110000111110001010001000010011110011000110100010101001011100111111011100101000001100101111000010101110001000111110010011001000010110101011000111011111101001001100000111011010100001001101111100011010110000100101111010001101110001110010110010010010111010110110111001111011011001010001101101011110010110111100010111011000100111001101001101001010111010111011111001111001100001010001010100011110011111100100010100000101100111100001110101000100010011111001100110100001010101011100011111111100100100000000101101100000001110110100000010011011100000110101100100001011110101100011100011110100100100100011101101101100100110110110101101011011011110111101101100011000110110100101001011011101111011101100110001100110101010010101011111110111111100000011000000100000101000001100001111000010100010001000111100110011001000101010101011001111111111101010000000000111110000000001000010000000011000110000000101001010000001111011110000010001100010000110010100110001010111101010011111000111110100001001000011100011011000100100101101001101101110111010110110011001111011010101010001101111111110010110000000010111010000000111001110000001001010010000011011110110000101100011010001110100101110010011101110010110100110010111011101010111001100111111001010101000001011111111000011100000001000100100000011001101100000101010110100001111111011100010000001100100110000010101101010000111110111110001000011000010011000101000110101001111001011111010001011100001110011100100010010100101100110111101110101011000110011111101001010100000111011111100001001100000100011010100001100101111100010101110000100111110010001101000010110010111000111010111001001001111001011011010001011101101110011100110110010100101011010111101111101111000110000110001001010001010011011110011110101100010100011110100111100100011101000101100100111001110101101001010011110111011110100011001100011100101010100100101111111101101110000000110110010000001011010110000011101111010000100110001110001101010010010010111110110110111000011011011001000101101101011001110110111101010011011000111110101101001000011110111011000100011001101001100101010111010101111111001111110000001010000010000011110000110000100010001010001100110011110010101010100010111111111100111000000000101001000000001111011000000010001101000000110010111000001010111001000011111001011000100001011101001100011100111010100100101001111101101111010000110110001110001011010010010011101110110110100110011011011101010101101100111111110110101000000011011111000000101100001000001110100011000010011100101000110100101111001011101110001011100110010011100101010110100101111111011101110000001100110010000010101010110000111111111010001000000001110011000000010010101000000110111111000001011000001000011101000011000100111000101001101001001111010111011010001111001101110010001010110010110011111010111010100001111001111100010001010000100110011110001101010100010010111111100110111000000101011001000001111101011000010000111101000110001000111001010011001001011110101011011100011111101100100100000110101101100001011110110100011100011011100100100101100101101101110101110110110011110011011010100010101101111100111110110000101000011010001111000101110010001001110010110011010010111010101110111001111110011001010000010101011110000111111100010001000000100110011000001101010101000010111111111000111000000001001001000000011011011000000101101101000001110110111000010011011001000110101101011001011110111101011100011000111100100101001000101101111011001110110001101010011010010111110101110111000011110011001000100010101011001100111111101010101000000111111111000001000000001000011000000011000101000000101001111000001111010001000010001110011000110010010101001010110111111011111011000001100001101000010100010111000111100111001001000101001011011001111011101101010001100110111110010101011000010111111101000111000000111001001000001001011011000011011101101000101100110111001110101011001010011111101011110100000111100011100001000100100100011001101101100101010110110101111111011011110000001101100010000010110100110000111011101010001001100111110011010101000010101111111000111110000001001000010000011011000110000101101001010001110111011110010011001100010110101010100111011111111101001100000000111010100000001001111100000011010000100000101110001100001110010010100010010110111100110111011000101011001101001111101010111010000111111001110001000001010010011000011110110101000100011011111001100101100001010101110100011111110011100100000010100101100000111101110100001000110011100011001010100100101011111101101111100000110110000100001011010001100011101110010100100110010111101101010111000110111111001001011000001011011101000011101100111000100110101001001101011111011010111100001101111000100010110001001100111010011010101001110101111111010011110000001110100010000010011100110000110100101010001011101111110011100110000010100101010000111101111110001000110000010011001010000110101011110001011111100010011100000100110100100001101011101100010111100110100111000101011101001001111100111011010000101001101110001111010110010010001111010110110010001111011010110010001101111010110010110001111010111010010001111001110110010001010011010110011110101111010100011110001111100100010010000101100110110001110101011010010011111101110110100000110011011100001010101100100011111110101100100000011110101100000100011110100001100100011100010101100100100111110101101101000011110110111000100011011001001100101101011010101110111101111110011000110000010101001010000111111011110001000001100010011000010100110101000111101011111001000111100001011001000100011101011001100100111101010101101000111111110111001000000011001011000000101011101000001111100111000010000101001000110001111011001010010001101011110110010111100011010111000100101111001001101110001011010110010011101111010110100110001111011101010010001100111110110010101000011010111111000101111000001001110001000011010010011000101110110101001110011011111010010101100001110111110100010011000011100110101000100101011111001101111100001010110000100011111010001100100001110010101100010010111110100110111000011101011001000100111101011001101000111101010111001000111111001011001000001011101011000011100111101000100101000111001101111001001010110001011011111010011101100001110100110100010011101011100110100111100101011101000101111100111001110000101001010010001111011110110010001100011010110010100101111010111101110001111000110010010001001010110110011011111011010101100001101111110100010110000011100111010000100101001110001101111010010010110001110110111010010011011001110110101101010011011110111110101100011000011110100101000100011101111001100100110001010101101010011111110111110100000011000011100000101000100100001111001101100010001010110100110011111011101010100001100111111100010101000000100111111000001101000001000010111000011000111001000101001001011001111011011101010001101100111110010110101000010111011111000111001100001001001010100011011011111100101101100000101110110100001110011011100010010101100100110111110101101011000011110111101000100011000111001100101001001010101111011011111110001101100000010010110100000110111011100001011001100100011101010101100100111111110101101000000011110111000000100011001000001100101011000010101111101000111110000111001000010001001011000110011011101001010101100111011111110101001100000011111010100000100001111100001100010000100010100110001100111101010010101000111110111111001000011000001011000101000011101001111000100111010001001101001110011010111010010101111001110111110001010011000010011110101000110100011111001011100100001011100101100011100101110100100101110011101101110010100110110010111101011010111000111101111001001000110001011011001010011101101011110100110111100011101011000100100111101001101101000111010110111001001111011001011010001101011101110010111100110010111000101010111001001111111001011010000001011101110000011100110010000100101010110001101111111010010110000001110111010000010011001110000110101010010001011111110110011100000011010100100000101111101100001110000110100010010001011100110110011100101011010100101111101111101110000110000110010001010001010110011110011111010100010100001111100111100010000101000100110001111001101010010001010111110110011111000011010100001000101111100011001110000100101010010001101111110110010110000011010111010000101111001110001110001010010010010011110110110110100011011011011100101101101100101110110110101110011011011110010101101100010111110110100111000011011101001000101100111011001110101001101010011111010111110100001111000011100010001000100100110011001101101010101010110111111111111011000000000001101000000000010111000000000111001000000001001011000000011011101000000101100111000001110101001000010011111011000110100001101001011100010111011100100111001100101101001010101110111011111110011001100000010101010100000111111111100001000000000100011000000001100101000000010101111000000111110001000001000010011000011000110101000101001011111001111011100001010001100100011110010101100100010111110101100111000011110101001000100011111011001100100001101010101100010111111110100111000000011101001000000100111011000001101001101000010111010111000111001111001001001010001011011011110011101101100010100110110100111101011011101000111101100111001000110101001011001011111011101011100001100111100100010101000101100111111001110101000001010011111000011110100001000100011100011001100100100101010101101101111111110110110000000011011010000000101101110000001110110010000010011010110000110101111010001011110001110011100010010010100100110110111101101011011000110111101101001011000110111011101001011001100111011101010101001100111111111010101000000001111111000000010000001000000110000011000001010000101000011110001111000100010010001001100110110011010101011010101111111101111110000000110000010000001010000110000011110001010000100010011110001100110100010010101011100110111111100101011000000101111101000001110000111000010010001001000110110011011001011010101101011101111110111100110000011000101010000101001111110001111010000010010001110000110110010010001011010110110011101111011010100110001101111101010010110000111110111010001000011001110011000101010010101001111110111111010000011000001110000101000010010001111000110110010001001011010110011011101111010101100110001111110101010010000011111110110000100000011010001100000101110010100001110010111100010010111000100110111001001101011001011010111101011101111000111100110001001000101010011011001111110101101010000011110111110000100011000010001100101000110010101111001010111110001011111000010011100001000110100100011001011101100101011100110101111100101011110000101111100010001110000100110010010001101010110110010111111011010111000001101111001000010110001011000111010011101001001110100111011010011101001101110100111010110011101001111010100111010001111101001110010000111010010110001001110111010011010011001110101110101010011110011111110100010100000011100111100000100101000100001101111001100010110001010100111010011111101001110100000111010011100001001110100100011010011101100101110100110101110011101011110010100111100010111101000100111000111001101001001001010111011011011111001101101100001010110110100011111011011100100001101100101100010110101110100111011110011101001100010100111010100111101001111101000111010000111001001110001001011010010011011101110110101100110011011110101010101100011111111110100100000000011101100000000100110100000001101011100000010111100100000111000101100001001001110100011011010011100101101110100101110110011101110011010100110010101111101010111110000111111000010001000001000110011000011001010101000101011111111001111100000001010000100000011110001100000100010010100001100110111100010101011000100111111101001101000000111010111000001001111001000011010001011000101110011101001110010100111010010111101001110111000111010011001001001110101011011010011111101101110100000110110011100001011010100100011101111101100100110000110101101010001011110111110011100011000010100100101000111101101111001000110110001011001011010011101011101110100111100110011101000101010100111001111111101001010000000111011110000001001100010000011010100110000101111101010001110000111110010010001000010110110011000111011010101001001101111111011010110000001101111010000010110001110000111010010010001001110110110011010011011010101110101101111110011110110000010100011010000111100101110001000101110010011001110010110101010010111011111110111001100000011001010100000101011111100001111100000100010000100001100110001100010101010010100111111110111101000000011000111000000101001001000001111011011000010001101101000110010110111001010111011001011111001101011100001010111100100011111000101100100001001110101100011010011110100101110100011101110011100100110010100101101010111101110111111000110011000001001010101000011011111111000101100000001001110100000011010011100000101110100100001110011101100010010100110100110111101011101011000111100111101001000101000111011001111001001101010001011010111110011101111000010100110001000111101010011001000111110101011001000011111101011000100000111101001100001000111010100011001001111100101011010000101111101110001110000110010010010001010110110110011111011011010100001101101111100010110110000100111011010001101001101110010111010110010111001111010111001010001111001011110010001011100010110011100100111010100101101001111101110111010000110011001110001010101010010011111111110110100000000011011100000000101100100000001110101100000010011110100000110100011100001011100100100011100101101100100101110110101101110011011110110010101100011010111110100101111000011101110001000100110010011001101010110101010111111011111111000001100000001000010100000011000111100000101001000100001111011001100010001101010100110010111111101010111000000111111001000001000001011000011000011101000101000100111001111001101001010001010111011110011111001100010100001010100111100011111101000100100000111001101100001001010110100011011111011100101100001100101110100010101110011100111110010100101000010111101111000111000110001001001001010011011011011110101101101100011110110110100100011011011101100101101100110101110110101011110011011111100010101100000100111110100001101000011100010111000100100111001001101101001011010110111011101111011001100110001101010101010010111111111110111000000000011001000000000101011000000001111101000000010000111000000110001001000001010011011000011110101101000100011110111001100100011001010101100101011111110101111100000011110000100000100010001100001100110010100010101010111100111111111000101000000001001111000000011010001000000101110011000001110010101000010010111111000110111000001001011001000011011101011000101100111101001110101000111010011111001001110100001011010011100011101110100100100110011101101101010100110110111111101011011000000111101101000001000110111000011001011001000101011101011001111100111101010000101000111110001111001000010010001011000110110011101001011010100111011101111101001100110000111010101010001001111111110011010000000010101110000000111110010000001000010110000011000111010000101001001110001111011010010010001101110110110010110011011010111010101101111001111110110001010000011010011110000101110100010001110011100110010010100101010110111101111111011000110000001101001010000010111011110000111001100010001001010100110011011111101010101100000111111110100001000000011100011000000100100101000001101101111000010110110001000111011010011001001101110101011010110011111101111010100000110001111100001010010000100011110110001100100011010010101100101110111110101110011000011110010101000100010111111001100111000001010101001000011111111011000100000001101001100000010111010100000111001111100001001010000100011011110001100101100010010101110100110111110011101011000010100111101000111101000111001000111001001011001001011011101011011101100111101100110101000110101011111001011111100001011100000100011100100001100100101100010101101110100111110110011101000011010100111000101111101001001110000111011010010001001101110110011010110011010101111010101111110001111110000010010000010000110110000110001011010001010011101110011110100110010100011101010111100100111111000101101000001001110111000011010011001000101110101011001110011111101010010100000111110111100001000011000100011000101001100101001111010101111010001111110001110010000010010010110000110110111010001011011001110011101101010010100110111110111101011000011000111101000101001000111001111011001001010001101011011110010111101100010111000110100111001001011101001011011100111011101100101001100110101111010101011110001111111100010010000000100110110000001101011010000010111101110000111000110010001001001010110011011011111010101101100001111110110100010000011011100110000101100101010001110101111110010011110000010110100010000111011100110001001100101010011010101111110101111110000011110000010000100010000110001100110001010010101010011110111111110100011000000011100101000000100101111000001101110001000010110010011000111010110101001001111011111011010001100001101110010100010110010111100111010111000101001111001001111010001011010001110011101110010010100110010110111101010111011000111111001101001000001010111011000011111001101000100001010111001100011111001010100100001011111101100011100000110100100100001011101101100011100110110100100101011011101101111101100110110000110101011010001011111101110011100000110010100100001010111101100011111000110100100001001011101100011011100110100101100101011101110101111100110011110000101010100010001111111100110010000000101010110000001111111010000010000001110000110000010010001010000110110011110001011010100010011101111100110100110000101011101010001111100111110010000101000010110001111000111010010001001001110110011011010011010101101110101111110110011110000011010100010000101111100110001110000101010010010001111110110110010000011011010110000101101111010001110110001110010011010010010110101110110111011110011011001100010101101010100111110111111101000011000000111000101000001001001111000011011010001000101101110011001110110010101010011010111111110101111000000011110001000000100010011000001100110101000010101011111000111111100001001000000100011011000001100101101000010101110111000111110011001001000010101011011000111111101101001000000110111011000001011001101000011101010111000100111111001001101000001011010111000011101111001000100110001011001101010011101010111110100111111000011101000001000100111000011001101001000101010111011001111111001101010000001010111110000011111000010000100001000110001100011001010010100101011110111101111100011000110000100101001010001101111011110010110001100010111010010100111001110111101001010011000111011110101001001100011111011010100100001101111101100010110000110100111010001011101001110011100111010010100101001110111101111010011000110001110101001010010011111011110110100001100011011100010100101100100111101110101101000110011110111001010100011001011111100101011100000101111100100001110000101100010010001110100110110010011101011010110100111101111011101000110001100111001010010101001011110111111011100011000001100100101000010101101111000111110110001001000011010011011000101110101101001110011110111010010100011001110111100101010011000101111110101001110000011111010010000100001110110001100010011010010100110101110111101011110011000111100010101001000100111111011001101000001101010111000010111111001000111000001011001001000011101011011000100111101101001101000110111010111001011001111001011101010001011100111110011100101000010100101111000111101110001001000110010011011001010110101101011111011110111100001100011000100010100101001100111101111010101000110001111111001010010000001011110110000011100011010000100100101110001101101110010010110110010110111011010111011001101111001101010110001010111111010011111000001110100001000010011100011000110100100101001011101101111011100110110001100101011010010101111101110111110000110011000010001010101000110011111111001010100000001011111100000011100000100000100100001100001101100010100010110100111100111011101000101001100111001111010101001010001111111011110010000001100010110000010100111010000111101001110001000111010010011001001110110101011010011011111101110101100000110011110100001010100011100011111100100100100000101101101100001110110110100010011011011100110101101100101011110110101111100011011110000100101100010001101110100110010110011101010111010100111111001111101000001010000111000011110001001000100010011011001100110101101010101011110111111111100011000000000100101000000001101111000000010110001000000111010011000001001110101000011010011111000101110100001001110011100011010010100100101110111101101110011000110110010101001011010111111011101111000001100110001000010101010011000111111110101001000000011111011000000100001101000001100010111000010100111001000111101001011001000111011101011001001100111101011010101000111101111111001000110000001011001010000011101011110000100111100010001101000100110010111001101010111001010111111001011111000001011100001000011100100011000100101100101001101110101111010110011110001111010100010010001111100110110010000101011010110001111101111010010000110001110110001010010011010011110110101110100011011110011100101100010100101110100111101110011101000110010100111001010111101001011111000111011100001001001100100011011010101100101101111110101110110000011110011010000100010101110001100111110010010101000010110111111000111011000001001001101000011011010111000101101111001001110110001011010011010011101110101110100110011110011101010100010100111111100111101000000101000111000001111001001000010001011011000110011101101001010100110111011111101011001100000111101010100001000111111100011001000000100101011000001101111101000010110000111000111010001001001001110011011011010010101101101110111110110110011000011011010101000101101111111001110110000001010011010000011110101110000100011110010001100100010110010101100111010111110101001111000011111010001000100001110011001100010010101010100110111111111101011000000000111101000000001000111000000011001001000000101011011000001111101101000010000110111000110001011001001010011101011011110100111101100011101000110100100111001011101101001011100110111011100101011001100101111101010101110000111111110010001000000010110011000000111010101000001001111111000011010000001000101110000011001110010000101010010110001111110111010010000011001110110000101010011010001111110101110010000011110010110000100010111010001100111001110010101001010010111111011110111000001100011001000010100101011000111101111101001000110000111011001010001001101011110011010111100010101111000100111110001001101000010011010111000110101111001001011110001011011100010011101100100110100110101101011101011110111100111100011000101000100101001111001101111010001010110001110011111010010010100001110110111100010011011000100110101101001101011110111010111100011001111000100101010001001101111110011010110000010101111010000111110001110001000010010010011000110110110101001011011011111011101101100001100110110100010101011011100111111101100101000000110101111000001011110001000011100010011000100100110101001101101011111010110111100001111011000100010001101001100110010111010101010111001111111111001010000000001011110000000011100010000000100100110000001101101010000010110111110000111011000010001001101000110011010111001010101111001011111110001011100000010011100100000110100101100001011101110100011100110011100100101010100101101111111101110110000000110011010000001010101110000011111110010000100000010110001100000111010010100001001110111100011010011000100101110101001101110011111010110010100001111010111100010001111000100110010001001101010110011010111111010101111000001111110001000010000010011000110000110101001010001011111011110011100001100010100100010100111101100111101000110101000111001011111001001011100001011011100100011101100101100100110101110101101011110011110111100010100011000100111100101001101000101111010111001110001111001010010010001011110110110011100011011010100100101101111101101110110000110110011010001011010101110011101111110010100110000010111101010000111000111110001001001000010011011011000110101101101001011110110111011100011011001100100101101010101101110111111110110011000000011010101000000101111111000001110000001000010010000011000110110000101001011010001111011101110010001100110010110010101010111010111111111001111000000001010001000000011110011000000100010101000001100111111000010101000001000111111000011001000001000101011000011001111101000101010000111001111110001001010000010011011110000110101100010001011110100110011100011101010100100100111111101101101000000110110111000001011011001000011101101011000100110111101001101011000111010111101001001111000111011010001001001101110011011010110010101101111010111110110001111000011010010001000101110110011001110011010101010010101111111110111110000000011000010000000101000110000001111001010000010001011110000110011100010001010100100110011111101101010100000110111111100001011000000100011101000001100100111000010101101001000111110111011001000011001101011000101010111101001111111000111010000001001001110000011011010010000101101110110001110110011010010011010101110110101111110011011110000010101100010000111110100110001000011101010011000100111110101001101000011111010111000100001111001001100010001011010100110011101111101010100110000111111101010001000000111110011000001000010101000011000111111000101001000001001111011000011010001101000101110010111001110010111001010010111001011110111001011100011001011100100101011100101101111100101110110000101110011010001110010101110010010111110010110111000010111011001000111001101011001001010111101011011111000111101100001001000110100011011001011100101101011100101110111100101110011000101110010101001110010111111010010111000001110111001000010011001011000110101011101001011111100111011100000101001100100001111010101100010001111110100110010000011101010110000100111111010001101000001110010111000010010111001000110111001011001011001011101011101011100111100111100101000101000101111001111001110001010001010010011110011110110100010100011011100111100101100101000101110101111001110011110001010010100010011110111100110100011000101011100101001111100101111010000101110001110001110010010010010010110110110110111011011011011001101101101101010110110110111111011011011000001101101101000010110110111000111011011001001001101101011011010110111101101111011000110110001101001011010010111011101110111001100110011001010101010101011111111111111100000000000000 +Period: 32767 diff --git a/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp similarity index 100% rename from CommonLibs/SocketsTest.cpp rename to tests/CommonLibs/SocketsTest.cpp diff --git a/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp similarity index 100% rename from CommonLibs/TimevalTest.cpp rename to tests/CommonLibs/TimevalTest.cpp diff --git a/tests/CommonLibs/TimevalTest.ok b/tests/CommonLibs/TimevalTest.ok new file mode 100644 index 0000000..c97031d --- /dev/null +++ b/tests/CommonLibs/TimevalTest.ok @@ -0,0 +1,22 @@ +-10000 +now: 1515515602.357742 then: 1515515612.357710 remaining: 10000 +now: 1515515602.857837 then: 1515515612.357710 remaining: 9500 +now: 1515515603.357975 then: 1515515612.357710 remaining: 9000 +now: 1515515603.858163 then: 1515515612.357710 remaining: 8500 +now: 1515515604.358353 then: 1515515612.357710 remaining: 8000 +now: 1515515604.858465 then: 1515515612.357710 remaining: 7500 +now: 1515515605.358622 then: 1515515612.357710 remaining: 7000 +now: 1515515605.858745 then: 1515515612.357710 remaining: 6499 +now: 1515515606.358852 then: 1515515612.357710 remaining: 5999 +now: 1515515606.859055 then: 1515515612.357710 remaining: 5499 +now: 1515515607.359170 then: 1515515612.357710 remaining: 4999 +now: 1515515607.859349 then: 1515515612.357710 remaining: 4499 +now: 1515515608.359455 then: 1515515612.357710 remaining: 3999 +now: 1515515608.859549 then: 1515515612.357710 remaining: 3499 +now: 1515515609.359748 then: 1515515612.357710 remaining: 2998 +now: 1515515609.859865 then: 1515515612.357710 remaining: 2498 +now: 1515515610.360064 then: 1515515612.357710 remaining: 1998 +now: 1515515610.860223 then: 1515515612.357710 remaining: 1498 +now: 1515515611.360386 then: 1515515612.357710 remaining: 998 +now: 1515515611.860592 then: 1515515612.357710 remaining: 498 +now: 1515515612.360712 then: 1515515612.357710 remaining: -3 diff --git a/CommonLibs/VectorTest.cpp b/tests/CommonLibs/VectorTest.cpp similarity index 100% rename from CommonLibs/VectorTest.cpp rename to tests/CommonLibs/VectorTest.cpp diff --git a/tests/CommonLibs/VectorTest.ok b/tests/CommonLibs/VectorTest.ok new file mode 100644 index 0000000..afe5162 --- /dev/null +++ b/tests/CommonLibs/VectorTest.ok @@ -0,0 +1,10 @@ +0 1 2 3 4 +10 11 12 13 14 +0 1 2 3 4 10 11 12 13 14 +0 1 2 +3 4 10 11 12 13 14 +8 8 8 8 8 8 8 8 8 8 +8 8 8 0 1 2 3 4 8 8 +1 2 3 +8 8 8 0 9 9 9 4 8 8 +9 9 9 diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..c18bef3 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,40 @@ +SUBDIRS = \ + CommonLibs \ + $(NULL) + +# The `:;' works around a Bash 3.2 bug when the output is not writeable. +$(srcdir)/package.m4: $(top_srcdir)/configure.ac + :;{ \ + echo '# Signature of the current package.' && \ + echo 'm4_define([AT_PACKAGE_NAME],' && \ + echo ' [$(PACKAGE_NAME)])' && \ + echo 'm4_define([AT_PACKAGE_TARNAME],' && \ + echo ' [$(PACKAGE_TARNAME)])' && \ + echo 'm4_define([AT_PACKAGE_VERSION],' && \ + echo ' [$(PACKAGE_VERSION)])' && \ + echo 'm4_define([AT_PACKAGE_STRING],' && \ + echo ' [$(PACKAGE_STRING)])' && \ + echo 'm4_define([AT_PACKAGE_BUGREPORT],' && \ + echo ' [$(PACKAGE_BUGREPORT)])'; \ + echo 'm4_define([AT_PACKAGE_URL],' && \ + echo ' [$(PACKAGE_URL)])'; \ + } >'$(srcdir)/package.m4' + +EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) +TESTSUITE = $(srcdir)/testsuite +DISTCLEANFILES = atconfig $(NULL) + +check-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' $(TESTSUITEFLAGS) + +installcheck-local: atconfig $(TESTSUITE) + $(SHELL) '$(TESTSUITE)' AUTOTEST_PATH='$(bindir)' $(TESTSUITEFLAGS) + +clean-local: + test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' --clean + +AUTOM4TE = $(SHELL) $(top_srcdir)/missing --run autom4te +AUTOTEST = $(AUTOM4TE) --language=autotest +$(TESTSUITE): $(srcdir)/testsuite.at $(srcdir)/package.m4 + $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at + mv $@.tmp $@ diff --git a/tests/testsuite.at b/tests/testsuite.at new file mode 100644 index 0000000..2c1e0b5 --- /dev/null +++ b/tests/testsuite.at @@ -0,0 +1,45 @@ +AT_INIT +AT_BANNER([Regression tests.]) + +AT_SETUP([BitVectorTest]) +AT_KEYWORDS([BitVectorTest]) +cat $abs_srcdir/CommonLibs/BitVectorTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/BitVectorTest], [], [expout], []) +AT_CLEANUP + +#AT_SETUP([InterthreadTest]) +#AT_KEYWORDS([InterthreadTest]) +#cat $abs_srcdir/CommonLibs/InterthreadTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/InterthreadTest], [], [expout], []) +#AT_CLEANUP + +#AT_SETUP([LogTest]) +#AT_KEYWORDS([LogTest]) +#cat $abs_srcdir/CommonLibs/LogTest.ok > expout +#cat $abs_srcdir/CommonLibs/LogTest.err > experr +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/LogTest], [], [expout], [experr]) +#AT_CLEANUP + +AT_SETUP([PRBSTest]) +AT_KEYWORDS([PRBSTest]) +cat $abs_srcdir/CommonLibs/PRBSTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/PRBSTest], [], [expout], []) +AT_CLEANUP + +#AT_SETUP([SocketsTest]) +#AT_KEYWORDS([SocketsTest]) +#cat $abs_srcdir/CommonLibs/SocketsTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/SocketsTest], [], [expout], []) +#AT_CLEANUP + +#AT_SETUP([TimevalTest]) +#AT_KEYWORDS([TimevalTest]) +#cat $abs_srcdir/CommonLibs/TimevalTest.ok > expout +#AT_CHECK([$abs_top_builddir/tests/CommonLibs/TimevalTest], [], [expout], []) +#AT_CLEANUP + +AT_SETUP([VectorTest]) +AT_KEYWORDS([VectorTest]) +cat $abs_srcdir/CommonLibs/VectorTest.ok > expout +AT_CHECK([$abs_top_builddir/tests/CommonLibs/VectorTest], [], [expout], []) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5706 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d6ba625968be09297642d18090c496490e9b8fc Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx 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 Fri Jan 12 13:07:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:23 +0000 Subject: [MERGED] osmo-trx[master]: .gitignore: Add missing test related files In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: .gitignore: Add missing test related files ...................................................................... .gitignore: Add missing test related files Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 --- M .gitignore 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 2cc1b8f..e966b37 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,9 @@ INSTALL tests/package.m4 tests/testsuite +tests/atconfig +tests/testsuite.dir +tests/testsuite.log # vim *.sw? -- To view, visit https://gerrit.osmocom.org/5762 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a82a2c0c97bbfa4877f148c89d121b4c3476176 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:07:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:07:23 +0000 Subject: [MERGED] osmo-trx[master]: Remove UDDSocket class In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove UDDSocket class ...................................................................... Remove UDDSocket class This class is not used anymore in osmo-trx, so we can safely remove it. Change-Id: I67f90aa3d6a2a5e92292436d10928e0705c8f8ff --- M CommonLibs/Sockets.cpp M CommonLibs/Sockets.h M tests/CommonLibs/SocketsTest.cpp 3 files changed, 1 insertion(+), 95 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/CommonLibs/Sockets.cpp b/CommonLibs/Sockets.cpp index 11e96dd..ce8e3d5 100644 --- a/CommonLibs/Sockets.cpp +++ b/CommonLibs/Sockets.cpp @@ -284,51 +284,4 @@ return ntohs(name.sin_port); } - - - - -UDDSocket::UDDSocket(const char* localPath, const char* remotePath) - :DatagramSocket() -{ - if (localPath!=NULL) open(localPath); - if (remotePath!=NULL) destination(remotePath); -} - - - -void UDDSocket::open(const char* localPath) -{ - // create - mSocketFD = socket(AF_UNIX,SOCK_DGRAM,0); - if (mSocketFD<0) { - perror("socket() failed"); - throw SocketError(); - } - - // bind - struct sockaddr_un address; - size_t length = sizeof(address); - bzero(&address,length); - address.sun_family = AF_UNIX; - strcpy(address.sun_path,localPath); - unlink(localPath); - if (bind(mSocketFD,(struct sockaddr*)&address,length)<0) { - perror("bind() failed"); - throw SocketError(); - } -} - - - -void UDDSocket::destination(const char* remotePath) -{ - struct sockaddr_un* unAddr = (struct sockaddr_un*)mDestination; - unAddr->sun_family = AF_UNIX; - strcpy(unAddr->sun_path,remotePath); -} - - - - // vim:ts=4:sw=4 diff --git a/CommonLibs/Sockets.h b/CommonLibs/Sockets.h index 8312843..71b8b22 100644 --- a/CommonLibs/Sockets.h +++ b/CommonLibs/Sockets.h @@ -166,26 +166,6 @@ }; - -/** Unix Domain Datagram Socket */ -class UDDSocket : public DatagramSocket { - -public: - - UDDSocket(const char* localPath=NULL, const char* remotePath=NULL); - - void destination(const char* remotePath); - - void open(const char* localPath); - - /** Give the return address of the most recently received packet. */ - const struct sockaddr_un* source() const { return (const struct sockaddr_un*)mSource; } - - size_t addressSize() const { return sizeof(struct sockaddr_un); } - -}; - - #endif diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index b51587d..235b8f3 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -53,38 +53,13 @@ return NULL; } - - -void *testReaderUnix(void *) -{ - UDDSocket readSocket("testDestination"); - readSocket.nonblocking(); - int rc = 0; - while (rc0) { - CERR("read: " << buf); - rc++; - } else { - sleep(2); - } - } - return NULL; -} - - int main(int argc, char * argv[] ) { Thread readerThreadIP; readerThreadIP.start(testReaderIP,NULL); - Thread readerThreadUnix; - readerThreadUnix.start(testReaderUnix,NULL); UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); - UDDSocket socket1U("testSource","testDestination"); CERR("socket1: " << socket1.port()); @@ -93,12 +68,10 @@ for (int i=0; i Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:08:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:08:03 +0000 Subject: osmo-ci[master]: Enable osmo-iuh submission In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fd3bdab217b61f9ee50a5f1413b60d396535395 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:08:05 +0000 Subject: osmo-ci[master]: Enable osmo-iuh submission In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fd3bdab217b61f9ee50a5f1413b60d396535395 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:08:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:08:08 +0000 Subject: [MERGED] osmo-ci[master]: Enable osmo-iuh submission In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Enable osmo-iuh submission ...................................................................... Enable osmo-iuh submission It was disabled back in a days when it was dependent on a separate branch. Thisis no longer the case so we can enable it back. Also remove remaining leftovers. Change-Id: I5fd3bdab217b61f9ee50a5f1413b60d396535395 --- M coverity/build_Osmocom.sh M coverity/prepare_source_Osmcocom.sh 2 files changed, 1 insertion(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index b2e6bc8..bd30fd7 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -78,7 +78,7 @@ build_default libosmo-sccp build_libsmpp34 build_default osmo-ggsn -#IU build_default osmo-iuh +build_default osmo-iuh build_osmopcu build_osmobts build_default osmo-mgw diff --git a/coverity/prepare_source_Osmcocom.sh b/coverity/prepare_source_Osmcocom.sh index d5ecad7..7aafa5e 100755 --- a/coverity/prepare_source_Osmcocom.sh +++ b/coverity/prepare_source_Osmcocom.sh @@ -35,7 +35,3 @@ done git clone git://git.sysmocom.de/sysmo-bts/layer1-api - -#IU git -C asn1c checkout aper-prefix -#IU git -C libosmo-netif checkout sysmocom/sctp -#IU git -C libosmo-sccp checkout sysmocom/iu -- To view, visit https://gerrit.osmocom.org/5766 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fd3bdab217b61f9ee50a5f1413b60d396535395 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:09:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:09:47 +0000 Subject: openbsc[master]: libmsc: add support for both comp128v2 and comp128v3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 please keep in mind that osmo-nitb is obsolete. We generally have a policy to only apply bug-fixes, and only upon explicit request. All development work has been at the post-NITB repositories for 1.5 years by now. Still, this patch is trivial enough to merge it. -- To view, visit https://gerrit.osmocom.org/5765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic761be0220397d100c9e6345d4d01af4889dc7c1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:10:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:10:30 +0000 Subject: osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:12:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:12:21 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/3376/7/src/gsm/gsm0480.c File src/gsm/gsm0480.c: Line 478: num_chars = uss_req_data[6]; do we actually verify that we have at least 6 bytes of data available in uss_rea_data[] buffer? What if the sender sent a short/truncated message? -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:13:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:13:16 +0000 Subject: libosmocore[master]: gsm0480: fix USSD OCTET STRING length In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/5712/4/include/osmocom/gsm/gsm0480.h File include/osmocom/gsm/gsm0480.h: Line 15: #define MAX_LEN_USSD_OCTET_STRING 160 normally, the constant should start with a term identifying where it originates, such as USSD_foo or GSM0480_FOO. -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:14:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:14:19 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3376/7/src/gsm/gsm0480.c File src/gsm/gsm0480.c: Line 478: num_chars = uss_req_data[6]; > do we actually verify that we have at least 6 bytes of data available in us Sorry, I must be blind. We verify 8 bytes above. -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:14:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:14:29 +0000 Subject: libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Fri Jan 12 13:15:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:15:00 +0000 Subject: libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Fri Jan 12 13:18:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:18:37 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/3381/7/include/osmocom/gsm/gsm0480.h File include/osmocom/gsm/gsm0480.h: Line 73: int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, the general "rule of thumb" in smocom coding style is is to follow "memcpy" notation, and have non-const output pointer first, followed by input arguments such as the const buffer. -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:19:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:19:09 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Fri Jan 12 13:19:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:19:37 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3381/7/include/osmocom/gsm/gsm0480.h File include/osmocom/gsm/gsm0480.h: Line 73: int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, > the general "rule of thumb" in smocom coding style is is to follow "memcpy" but then, all the other routines in this function don't seem to follow that rule. -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:19:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:19:58 +0000 Subject: libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Fri Jan 12 13:20:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:20:19 +0000 Subject: libosmocore[master]: ussd_test.c: fix rc / len debug output confusion In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5744 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:20:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:20:42 +0000 Subject: osmo-msc[master]: src/libmsc/ussd.c: drop useless forward declaration In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc 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 Fri Jan 12 13:20:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:20:52 +0000 Subject: osmo-msc[master]: msc/gsm_04_80.h: cosmetic: whitespace fix In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Fri Jan 12 13:21:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:21:04 +0000 Subject: osmo-msc[master]: msc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Fri Jan 12 13:23:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:23:47 +0000 Subject: libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 normally the clean thing to do here is to support both the old API/ABI and the new one. Merging you change would mean that no old versions of any openbsc/osmocom programs can be built against new versions of the library, which is not acceptable, sorry. -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:23:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:23:56 +0000 Subject: osmo-msc[master]: msc/gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc 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 Fri Jan 12 13:31:34 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 13:31:34 +0000 Subject: [MERGED] osmo-msc[master]: msc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: msc/gsm_04_80.h: clean up useless declarations ...................................................................... msc/gsm_04_80.h: clean up useless declarations This change removes a few USSD specific declarations, which are not actually used now, and probably accidentally migrated from legacy OpenBSC. Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7 --- M include/osmocom/msc/gsm_04_80.h 1 file changed, 0 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/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index d65f640..40ecfba 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -18,8 +18,4 @@ const char *text); int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); -int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, - const char *text); -int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - #endif -- To view, visit https://gerrit.osmocom.org/5732 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id57a24b92790d3ce0f9c7343d060f511e2b979c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:31:33 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 13:31:33 +0000 Subject: [MERGED] osmo-msc[master]: msc/gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: msc/gsm_04_80.h: use '#pragma once' instead of includes ...................................................................... msc/gsm_04_80.h: use '#pragma once' instead of includes This is a common include guard way for Osmocom projects. Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6 --- M include/osmocom/msc/gsm_04_80.h 1 file changed, 1 insertion(+), 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/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 52d2f4a..7da45a0 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -1,5 +1,4 @@ -#ifndef _GSM_04_80_H -#define _GSM_04_80_H +#pragma once #include #include @@ -17,5 +16,3 @@ int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - -#endif -- To view, visit https://gerrit.osmocom.org/5733 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a12a742719d4deba0b9dfa8bb330c1986a727f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:31:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 13:31:35 +0000 Subject: [MERGED] osmo-msc[master]: msc/gsm_04_80.h: cosmetic: whitespace fix In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: msc/gsm_04_80.h: cosmetic: whitespace fix ...................................................................... msc/gsm_04_80.h: cosmetic: whitespace fix Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c --- M include/osmocom/msc/gsm_04_80.h 1 file changed, 2 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/include/osmocom/msc/gsm_04_80.h b/include/osmocom/msc/gsm_04_80.h index 40ecfba..52d2f4a 100644 --- a/include/osmocom/msc/gsm_04_80.h +++ b/include/osmocom/msc/gsm_04_80.h @@ -8,10 +8,10 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, + const struct msgb *in_msg, const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, + const struct msgb *msg, const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, -- To view, visit https://gerrit.osmocom.org/5736 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3632c75cf2d2ce79b42b3b55ef50a72ab1bb94c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:31:36 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 13:31:36 +0000 Subject: [MERGED] osmo-msc[master]: src/libmsc/ussd.c: drop useless forward declaration In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: src/libmsc/ussd.c: drop useless forward declaration ...................................................................... src/libmsc/ussd.c: drop useless forward declaration There is no any significant reason to define static function 'send_own_number' after the code that calls it. Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2 --- M src/libmsc/ussd.c 1 file changed, 12 insertions(+), 16 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/libmsc/ussd.c b/src/libmsc/ussd.c index 7b450a2..eeab52a 100644 --- a/src/libmsc/ussd.c +++ b/src/libmsc/ussd.c @@ -39,9 +39,19 @@ /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; -/* Forward declarations of network-specific handler functions */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req); +/* A network-specific handler function */ +static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +{ + char *own_number = conn->vsub->msisdn; + char response_string[GSM_EXTENSION_LENGTH + 20]; + DEBUGP(DMM, "%s: MSISDN = %s\n", vlr_subscr_name(conn->vsub), + own_number); + + /* Need trailing CR as EOT character */ + snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); + return gsm0480_send_ussd_response(conn, msg, response_string, req); +} /* Entrypoint - handler function common to all mobile-originated USSDs */ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) @@ -87,18 +97,4 @@ } return rc; -} - -/* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) -{ - char *own_number = conn->vsub->msisdn; - char response_string[GSM_EXTENSION_LENGTH + 20]; - - DEBUGP(DMM, "%s: MSISDN = %s\n", vlr_subscr_name(conn->vsub), - own_number); - - /* Need trailing CR as EOT character */ - snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); } -- To view, visit https://gerrit.osmocom.org/5734 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f76f278c09489dccd96921610e8d06efa679ff2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:40:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 13:40:35 +0000 Subject: [MERGED] openbsc[master]: libmsc: add support for both comp128v2 and comp128v3 In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: libmsc: add support for both comp128v2 and comp128v3 ...................................................................... libmsc: add support for both comp128v2 and comp128v3 This change adds support for both comp128v2 and comp128v3 GSM A3/A8 algorithms. Since they already implemented in libosmocore, the corresponding it's API is used. Change-Id: Ic761be0220397d100c9e6345d4d01af4889dc7c1 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/libmsc/auth.c M openbsc/src/libmsc/ctrl_commands.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/tests/ctrl_test_runner.py 5 files changed, 53 insertions(+), 5 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 57fa301..39c7458 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -54,6 +54,8 @@ AUTH_ALGO_NONE, AUTH_ALGO_XOR, AUTH_ALGO_COMP128v1, + AUTH_ALGO_COMP128v2, + AUTH_ALGO_COMP128v3, }; struct gsm_auth_info { diff --git a/openbsc/src/libmsc/auth.c b/openbsc/src/libmsc/auth.c index 19def1e..8c8af11 100644 --- a/openbsc/src/libmsc/auth.c +++ b/openbsc/src/libmsc/auth.c @@ -25,6 +25,7 @@ #include #include +#include #include #include @@ -62,7 +63,8 @@ } static int -_use_comp128_v1(struct gsm_auth_info *ainfo, struct gsm_auth_tuple *atuple) +_use_comp128(struct gsm_auth_info *ainfo, struct gsm_auth_tuple *atuple, + enum gsm_auth_algo algo) { if (ainfo->a3a8_ki_len != A38_COMP128_KEY_LEN) { LOGP(DMM, LOGL_ERROR, "Invalid COMP128v1 key (len=%d) %s\n", @@ -71,7 +73,23 @@ return -1; } - comp128(ainfo->a3a8_ki, atuple->vec.rand, atuple->vec.sres, atuple->vec.kc); + switch (algo) { + case AUTH_ALGO_COMP128v1: + comp128(ainfo->a3a8_ki, atuple->vec.rand, + atuple->vec.sres, atuple->vec.kc); + break; + case AUTH_ALGO_COMP128v2: + comp128v2(ainfo->a3a8_ki, atuple->vec.rand, + atuple->vec.sres, atuple->vec.kc); + break; + case AUTH_ALGO_COMP128v3: + comp128v3(ainfo->a3a8_ki, atuple->vec.rand, + atuple->vec.sres, atuple->vec.kc); + break; + default: + /* Unsupported version */ + return -ENOTSUP; + } return 0; } @@ -139,7 +157,9 @@ break; case AUTH_ALGO_COMP128v1: - if (_use_comp128_v1(&ainfo, atuple)) + case AUTH_ALGO_COMP128v2: + case AUTH_ALGO_COMP128v3: + if (_use_comp128(&ainfo, atuple, ainfo.auth_algo)) return AUTH_NOT_AVAIL; break; diff --git a/openbsc/src/libmsc/ctrl_commands.c b/openbsc/src/libmsc/ctrl_commands.c index c99dde4..8e4e8b6 100644 --- a/openbsc/src/libmsc/ctrl_commands.c +++ b/openbsc/src/libmsc/ctrl_commands.c @@ -41,6 +41,10 @@ return true; if (strcasecmp(alg, "comp128v1") == 0) return true; + if (strcasecmp(alg, "comp128v2") == 0) + return true; + if (strcasecmp(alg, "comp128v3") == 0) + return true; return false; } @@ -118,6 +122,10 @@ ainfo.auth_algo = AUTH_ALGO_XOR; else if (strcasecmp(alg, "comp128v1") == 0) ainfo.auth_algo = AUTH_ALGO_COMP128v1; + else if (strcasecmp(alg, "comp128v2") == 0) + ainfo.auth_algo = AUTH_ALGO_COMP128v2; + else if (strcasecmp(alg, "comp128v3") == 0) + ainfo.auth_algo = AUTH_ALGO_COMP128v3; rc = osmo_hexparse(ki, ainfo.a3a8_ki, sizeof(ainfo.a3a8_ki)); if (rc < 0) { diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index b88c139..a97e1ec 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -775,11 +775,13 @@ return CMD_SUCCESS; } -#define A3A8_ALG_TYPES "(none|xor|comp128v1)" +#define A3A8_ALG_TYPES "(none|xor|comp128v1|comp128v2|comp128v3)" #define A3A8_ALG_HELP \ "Use No A3A8 algorithm\n" \ "Use XOR algorithm\n" \ - "Use COMP128v1 algorithm\n" + "Use COMP128v1 algorithm\n" \ + "Use COMP128v2 algorithm\n" \ + "Use COMP128v3 algorithm\n" DEFUN(ena_subscr_a3a8, ena_subscr_a3a8_cmd, @@ -811,6 +813,12 @@ } else if (!strcasecmp(alg_str, "comp128v1")) { ainfo.auth_algo = AUTH_ALGO_COMP128v1; minlen = maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v2")) { + ainfo.auth_algo = AUTH_ALGO_COMP128v2; + minlen = maxlen = A38_COMP128_KEY_LEN; + } else if (!strcasecmp(alg_str, "comp128v3")) { + ainfo.auth_algo = AUTH_ALGO_COMP128v3; + minlen = maxlen = A38_COMP128_KEY_LEN; } else { /* Unknown method */ subscr_put(subscr); diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index fb69027..b63dd27 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -496,6 +496,16 @@ self.assertEquals(r['var'], 'subscriber-modify-v1') self.assertEquals(r['value'], 'OK') + r = self.do_set('subscriber-modify-v1', '2620345,445566,comp128v2,00112233445566778899AABBCCDDEEFF') + self.assertEquals(r['mtype'], 'SET_REPLY') + self.assertEquals(r['var'], 'subscriber-modify-v1') + self.assertEquals(r['value'], 'OK') + + r = self.do_set('subscriber-modify-v1', '2620345,445566,comp128v3,00112233445566778899AABBCCDDEEFF') + self.assertEquals(r['mtype'], 'SET_REPLY') + self.assertEquals(r['var'], 'subscriber-modify-v1') + self.assertEquals(r['value'], 'OK') + r = self.do_set('subscriber-modify-v1', '2620345,445566,none') self.assertEquals(r['mtype'], 'SET_REPLY') self.assertEquals(r['var'], 'subscriber-modify-v1') -- To view, visit https://gerrit.osmocom.org/5765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic761be0220397d100c9e6345d4d01af4889dc7c1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:48:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:48:08 +0000 Subject: osmo-ggsn[master]: Add GTP message names In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/5758/1/gtp/gtp.h File gtp/gtp.h: Line 90: extern const struct value_string gtp_type_names[]; the general policy is to not only export the array, but also provide an inline function in the header file that wraps around the get_value_string() call. -- To view, visit https://gerrit.osmocom.org/5758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:48:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:48:55 +0000 Subject: libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:48:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:48:59 +0000 Subject: [MERGED] libosmocore[master]: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TLVP_PRESENT() should not return TRUE after tlv_parse() fails. ...................................................................... TLVP_PRESENT() should not return TRUE after tlv_parse() fails. If the length provided in the patcket exceeds the buffer length, tlv_parse() returns -2 but leaves tlv.val and tlv.len initializd. Many callers of tlv_parse() do not check its return value, but rely on TLVP_PRESENT() to see if a particular TLV was parsed successfully. By clearing tlv.val and tlv.len we make it less likely that those callers will use an overlong TLV length value. Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 --- M src/gsm/tlv_parser.c 1 file changed, 10 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/tlv_parser.c b/src/gsm/tlv_parser.c index ead856c..9b1fb17 100644 --- a/src/gsm/tlv_parser.c +++ b/src/gsm/tlv_parser.c @@ -127,7 +127,7 @@ * \param[in] def structure defining the valid TLV tags / configurations * \param[in] buf the input data buffer to be parsed * \param[in] buf_len length of the input data buffer - * \returns number of bytes consumed by the TLV entry / IE parsed + * \returns number of bytes consumed by the TLV entry / IE parsed; negative in case of error */ int tlv_parse_one(uint8_t *o_tag, uint16_t *o_len, const uint8_t **o_val, const struct tlv_definition *def, @@ -227,7 +227,7 @@ * \param[in] buf_len length of the input data buffer * \param[in] lv_tag an initial LV tag at the start of the buffer * \param[in] lv_tag2 a second initial LV tag following the \a lv_tag - * \returns number of bytes consumed by the TLV entry / IE parsed + * \returns number of bytes consumed by the TLV entry / IE parsed; negative in case of error */ int tlv_parse(struct tlv_parsed *dec, const struct tlv_definition *def, const uint8_t *buf, int buf_len, uint8_t lv_tag, @@ -244,8 +244,11 @@ dec->lv[lv_tag].val = &buf[ofs+1]; dec->lv[lv_tag].len = buf[ofs]; len = dec->lv[lv_tag].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag].val = NULL; + dec->lv[lv_tag].len = 0; return -2; + } num_parsed++; ofs += len; } @@ -255,8 +258,11 @@ dec->lv[lv_tag2].val = &buf[ofs+1]; dec->lv[lv_tag2].len = buf[ofs]; len = dec->lv[lv_tag2].len + 1; - if (ofs + len > buf_len) + if (ofs + len > buf_len) { + dec->lv[lv_tag2].val = NULL; + dec->lv[lv_tag2].len = 0; return -2; + } num_parsed++; ofs += len; } -- To view, visit https://gerrit.osmocom.org/5689 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4dda6938e1650b4bcaac45809a4763f86f5a9794 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:50:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:50:57 +0000 Subject: osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/5705/7/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 250: if (bts) we use curly braces if the block has multiple lines (even a wrapped line counts as multiple lines). -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:53:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:53:11 +0000 Subject: osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5752/3/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 392: if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) why are we aborting the loop if the paging failed? I mean, if there are 10 BTSs in the list that we can page on, and number 2 fails, why not page on all the other ones? chances are 9:1 that we still find the subscriber and he can communicate. -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:53:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:53:48 +0000 Subject: osmo-bsc[master]: Implement support for paging based on a Cell Global Identifier. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:54:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:54:40 +0000 Subject: osmo-bsc[master]: Implement support for paging based on LAC and CI. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5757/1/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 410: if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) same as in the other patch, I think we should still continue iterating the list and page on all BTSs we can page, no matter how many of them fail on the way. -- To view, visit https://gerrit.osmocom.org/5757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:56:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:56:12 +0000 Subject: osmo-ggsn[master]: Log GSN mode for unexpectde packets In-Reply-To: References: Message-ID: Patch Set 1: why? Do we assume a single program runs both SGSN and GGSN, or do we assume that the user/program/caller doesn't remember which mode was set? I find both highly unlikely. -- To view, visit https://gerrit.osmocom.org/5750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I36ee608182523709c795d8317095ae4fda4a7858 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn 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 Jan 12 13:57:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:57:09 +0000 Subject: libosmocore[master]: Log lapd_datalink state on errors In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 the two are orthogonal. the pointer will tell you which instance it is (if you log the pointer in other locations, too). The state will give you additional information, but it won't replace the pointere -- To view, visit https://gerrit.osmocom.org/5749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3141212fa74d045ee24a18eea1191d63cd15e0ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:57:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:57:46 +0000 Subject: libosmocore[master]: log: print loginfo assertions source In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:57:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:57:50 +0000 Subject: [MERGED] libosmocore[master]: log: print loginfo assertions source In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: log: print loginfo assertions source ...................................................................... log: print loginfo assertions source Print which function has triggered assert_loginfo(). It's handy in debugging logging-related issues in libosmocore. Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad --- M src/logging.c 1 file changed, 8 insertions(+), 8 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/src/logging.c b/src/logging.c index 20ec443..1e0b21b 100644 --- a/src/logging.c +++ b/src/logging.c @@ -182,11 +182,11 @@ NULL, }; -static void assert_loginfo(void) +static void assert_loginfo(const char *src) { if (!osmo_log_info) { fprintf(stderr, "ERROR: osmo_log_info == NULL! " - "You must call log_init() before using logging!\n"); + "You must call log_init() before using logging in %s()!\n", src); OSMO_ASSERT(osmo_log_info); } } @@ -223,7 +223,7 @@ { int i; - assert_loginfo(); + assert_loginfo(__func__); for (i = 0; i < osmo_log_info->num_cat; ++i) { if (osmo_log_info->cat[i].name == NULL) @@ -248,7 +248,7 @@ char *mask = strdup(_mask); char *category_token = NULL; - assert_loginfo(); + assert_loginfo(__func__); /* Disable everything to enable it afterwards */ for (i = 0; i < osmo_log_info->num_cat; ++i) @@ -653,7 +653,7 @@ struct log_target *target; unsigned int i; - assert_loginfo(); + assert_loginfo(__func__); target = talloc_zero(tall_log_ctx, struct log_target); if (!target) @@ -827,7 +827,7 @@ int size = strlen("logging level () ()") + 1; char *str; - assert_loginfo(); + assert_loginfo(__func__); for (i = 0; i < info->num_cat; i++) { if (info->cat[i].name == NULL) @@ -909,7 +909,7 @@ strlen(LOGGING_STR "Set the log level for a specified category\n") + 1; - assert_loginfo(); + assert_loginfo(__func__); for (i = 0; i < info->num_cat; i++) { if (info->cat[i].name == NULL) @@ -1028,7 +1028,7 @@ { struct log_target *tar; - assert_loginfo(); + assert_loginfo(__func__); subsys = map_subsys(subsys); -- To view, visit https://gerrit.osmocom.org/5748 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8418d0c431106f50aa8779cd89396f02373304ad Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:58:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:58:56 +0000 Subject: pysim[master]: utils: Functions to encode/decode EF SPN. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:59:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:59:11 +0000 Subject: pysim[master]: Fix comment: Ki -> OPC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:59:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:59:41 +0000 Subject: pysim[master]: ts_51_011: A file with MF/DF/EF constants from TS 51 011 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 13:59:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 13:59:54 +0000 Subject: pysim[master]: utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:00:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:00:34 +0000 Subject: pysim[master]: cards: Extend Card class with access functions for some of t... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:02:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 14:02:22 +0000 Subject: osmo-ci[master]: Install setuptools in docker images In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 I guess it's fine to also install it in images that aren't used by our jenkins jobs. Looks good, but haven't verified that it works. -- To view, visit https://gerrit.osmocom.org/5723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ecd96af2e2c0c7d141977639103d71e46c0cdc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:02:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:02:54 +0000 Subject: pysim[master]: pySim-prog: ADM code can be longer 8 digits, it's implementa... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:03:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:03:06 +0000 Subject: pysim[master]: pySim-prog: Replace magic numbers with a readable EF file name. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:03:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:03:31 +0000 Subject: pysim[master]: cards: Implement card type autodetection based on ATR. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:03:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 14:03:33 +0000 Subject: osmo-ci[master]: Install setuptools in docker images In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 actually, since the build of the docker images is currently broken, rather merge now and verify by seeing whether the failure is fixed. -- To view, visit https://gerrit.osmocom.org/5723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ecd96af2e2c0c7d141977639103d71e46c0cdc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:03:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 14:03:40 +0000 Subject: [MERGED] osmo-ci[master]: Install setuptools in docker images In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Install setuptools in docker images ...................................................................... Install setuptools in docker images Make sure that python-setuptools are installed for both python v2 and v3 to make sure osmo-python-tests can be installed. Change-Id: I3ecd96af2e2c0c7d141977639103d71e46c0cdc5 Related: OS#2821 --- M docker/Dockerfile.deb8_amd64 M docker/Dockerfile.deb8_i386 M docker/Dockerfile_osmocom_jenkins.amd64 3 files changed, 9 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 9b6a939..3fdcd6a 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -31,5 +31,8 @@ # building RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +# for osmo-python-tests +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools + # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile.deb8_i386 b/docker/Dockerfile.deb8_i386 index 51962f6..9beb188 100644 --- a/docker/Dockerfile.deb8_i386 +++ b/docker/Dockerfile.deb8_i386 @@ -31,5 +31,8 @@ # OsmocomBB RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi +# for osmo-python-tests +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools + # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 10c49c3..063199b 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -31,6 +31,9 @@ # building RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +# for osmo-python-tests +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools + # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc -- To view, visit https://gerrit.osmocom.org/5723 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ecd96af2e2c0c7d141977639103d71e46c0cdc5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:03:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:03:57 +0000 Subject: pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 3 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:04:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:04:13 +0000 Subject: pysim[master]: Make derive_milenage_opc and calculate_luhn publicly availab... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:04:29 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 14:04:29 +0000 Subject: [PATCH] osmo-ci[master]: docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh t... Message-ID: Review at https://gerrit.osmocom.org/5769 docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh to install No need to duplicate the install steps we have in osmo-python-tests/contrib now. Also runs the tests. Change-Id: Ibb8eb04e3a5c9c5dcc9b99c83425d2604378f960 --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/69/5769/1 diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 10c49c3..a84dbf5 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -38,4 +38,4 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client ADD http://git.osmocom.org/python/osmo-python-tests/patch /tmp/commit -RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && python2 ./setup.py install && python3 ./setup.py install +RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && ./contrib/jenkins.sh -- To view, visit https://gerrit.osmocom.org/5769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb8eb04e3a5c9c5dcc9b99c83425d2604378f960 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:05:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:05:06 +0000 Subject: osmo-ci[master]: docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh t... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb8eb04e3a5c9c5dcc9b99c83425d2604378f960 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:05:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:05:59 +0000 Subject: libosmocore[master]: Allow multiple 'log gsmtap' sinks In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore 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 Jan 12 14:06:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:06:03 +0000 Subject: [MERGED] libosmocore[master]: Allow multiple 'log gsmtap' sinks In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow multiple 'log gsmtap' sinks ...................................................................... Allow multiple 'log gsmtap' sinks Previously we've checked for existing log target with a given hostname from vty code but it was ignored inside the check so only the very first 'log gsmtap' entry was enabled while the rest were silently ignored. Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2 --- M src/logging.c 1 file changed, 9 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index 1e0b21b..e4f3e87 100644 --- a/src/logging.c +++ b/src/logging.c @@ -745,11 +745,18 @@ llist_for_each_entry(tgt, &osmo_log_target_list, entry) { if (tgt->type != type) continue; - if (tgt->type == LOG_TGT_TYPE_FILE) { + switch (tgt->type) { + case LOG_TGT_TYPE_FILE: if (!strcmp(fname, tgt->tgt_file.fname)) return tgt; - } else + break; + case LOG_TGT_TYPE_GSMTAP: + if (!strcmp(fname, tgt->tgt_gsmtap.hostname)) + return tgt; + break; + default: return tgt; + } } return NULL; } -- To view, visit https://gerrit.osmocom.org/5747 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fd8bda9e07d403a54735da30addb742e56538a2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:06:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:06:43 +0000 Subject: osmo-bsc[master]: bsc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc 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 Fri Jan 12 14:06:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:06:48 +0000 Subject: osmo-bsc[master]: bsc/gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee73e24a2438b6081a5d569db7d48725b564ee3a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc 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 Fri Jan 12 14:06:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:06:56 +0000 Subject: [MERGED] osmo-bsc[master]: bsc/gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc/gsm_04_80.h: use '#pragma once' instead of includes ...................................................................... bsc/gsm_04_80.h: use '#pragma once' instead of includes This is a common include guard way for Osmocom projects. Change-Id: Iee73e24a2438b6081a5d569db7d48725b564ee3a --- M include/osmocom/bsc/gsm_04_80.h 1 file changed, 1 insertion(+), 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/include/osmocom/bsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h index d65f640..dd699f2 100644 --- a/include/osmocom/bsc/gsm_04_80.h +++ b/include/osmocom/bsc/gsm_04_80.h @@ -1,5 +1,4 @@ -#ifndef _GSM_04_80_H -#define _GSM_04_80_H +#pragma once #include #include @@ -21,5 +20,3 @@ int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - -#endif -- To view, visit https://gerrit.osmocom.org/5731 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee73e24a2438b6081a5d569db7d48725b564ee3a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc 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 Fri Jan 12 14:06:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:06:56 +0000 Subject: [MERGED] osmo-bsc[master]: bsc/gsm_04_80.h: clean up useless declarations In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc/gsm_04_80.h: clean up useless declarations ...................................................................... bsc/gsm_04_80.h: clean up useless declarations This change removes a few USSD specific declarations, which are not actually used now, and probably accidentally migrated from legacy OpenBSC. Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 --- M include/osmocom/bsc/gsm_04_80.h 1 file changed, 0 insertions(+), 15 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/bsc/gsm_04_80.h b/include/osmocom/bsc/gsm_04_80.h index dd699f2..649ffe1 100644 --- a/include/osmocom/bsc/gsm_04_80.h +++ b/include/osmocom/bsc/gsm_04_80.h @@ -1,21 +1,6 @@ #pragma once -#include -#include -#include - struct gsm_subscriber_connection; - -int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, - const struct ss_request *req); -int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, - const struct ss_request *request); - -int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, - const char *text); -int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); -- To view, visit https://gerrit.osmocom.org/5725 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I060223349971a7fce169a018bf16eb91f0e20342 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc 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 Fri Jan 12 14:07:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:07:50 +0000 Subject: osmo-pcu[master]: cosmetic: inline single-use helper In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 you don't know if this might be needed from other(future) code, so i'd simply keep it -- To view, visit https://gerrit.osmocom.org/5730 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ec54ccd9c4bf8344fbd1dce91e8707f6b17b2f7 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 Fri Jan 12 14:08:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:08:15 +0000 Subject: osmo-pcu[master]: Use Timing Advance Index in UL assignments In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5729 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:10:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:10:35 +0000 Subject: osmo-pcu[master]: Rewrite EGPRS Packet Uplink Assignment In-Reply-To: References: Message-ID: Patch Set 1: I don't really see why the new code is an improvement over the old code. Also, I fail to see how this relates to OS#1526, so I guess it warrants an explanation in the commitlog -- To view, visit https://gerrit.osmocom.org/5726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:11:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:11:44 +0000 Subject: osmo-pcu[master]: Rewrite Packet Downlink Assignment In-Reply-To: References: Message-ID: Patch Set 1: ok, so we can reuse some of the functions introduced in the previous patch? Is that the purpose? If so, it needs to be stated/explained. -- To view, visit https://gerrit.osmocom.org/5727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:13:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:13:23 +0000 Subject: libosmocore[master]: libosmocodec: implement ECU (Error Concealment Unit) for FR In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:13:41 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 14:13:41 +0000 Subject: osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/5752/3/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 367: (unrelated whitespace change) Line 392: if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) > why are we aborting the loop if the paging failed? I mean, if there are 10 I see that the only failure page_subscriber() returns is currently a failure to allocate a subscriber. But I also think it is better to not cancel the loop, page_subsrciber() might change and then we have created an obscure bug. (Same for the other bts iterations). -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:13:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:13:46 +0000 Subject: osmo-pcu[master]: Avoid code duplication in TBF test In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7aa72f5aa66c5e9c255542c066b5494c098aab2 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 Fri Jan 12 14:14:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:14:10 +0000 Subject: osmo-pcu[master]: TBF: move window parameters to UL/DL level In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6 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 Fri Jan 12 14:14:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:14:20 +0000 Subject: osmo-pcu[master]: TBF-UL: add simpler test helper In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 Gerrit-PatchSet: 5 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 Fri Jan 12 14:15:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:15:03 +0000 Subject: [MERGED] libosmocore[master]: Deprecate gsm48_construct_ra() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Deprecate gsm48_construct_ra() ...................................................................... Deprecate gsm48_construct_ra() It's just a tiny wrapper around gsm48_encode_ra() with less strict type signature. Related OS#1640 Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 --- M include/osmocom/gsm/gsm48.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h index 3ebca18..69431de 100644 --- a/include/osmocom/gsm/gsm48.h +++ b/include/osmocom/gsm/gsm48.h @@ -40,7 +40,7 @@ /* Parse Routeing Area Identifier */ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf); void gsm48_encode_ra(struct gsm48_ra_id *out, const struct gprs_ra_id *raid); -int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid); +int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid) OSMO_DEPRECATED("Use gsm48_encode_ra() instead"); int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc); -- To view, visit https://gerrit.osmocom.org/5653 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79d6d1133afbf32e891a6b0e3a244c6885ea9614 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:16:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:16:01 +0000 Subject: osmo-sgsn[master]: Use gsm48_encode_ra() for RAI encoding In-Reply-To: References: Message-ID: Patch Set 2: how was this tested/velidated? gb_proxy changes are risky unless we start adding automatic testing for it either in osmo-gsm-tester or in osmo-ttcn3-test. -- To view, visit https://gerrit.osmocom.org/5680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:17:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:17:04 +0000 Subject: osmo-pcu[master]: Make TBF state private In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I217f4c4bac21dd584c8682928a080a1a6e9507e1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:17:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:17:10 +0000 Subject: [MERGED] osmo-pcu[master]: Make TBF state private In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make TBF state private ...................................................................... Make TBF state private Let's make sure no external function can mess with the TBF state. Change-Id: I217f4c4bac21dd584c8682928a080a1a6e9507e1 --- M src/tbf.cpp M src/tbf.h 2 files changed, 2 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf.cpp b/src/tbf.cpp index 9c1dac9..9e3a8ef 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -174,7 +174,6 @@ n3105(0), fT(0), num_fT_exp(0), - state(GPRS_RLCMAC_NULL), was_releasing(0), upgrade_to_multislot(0), bts(bts_), @@ -185,6 +184,7 @@ m_ms(NULL), m_ta(GSM48_TA_INVALID), m_ms_class(0), + state(GPRS_RLCMAC_NULL), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 9491f2a..943ec92 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -284,10 +284,6 @@ Meas(); } meas; - /* these should become protected but only after gprs_rlcmac_data.c - * stops to iterate over all tbf in its current form */ - enum gprs_rlcmac_tbf_state state; - /* Remember if the tbf was in wait_release state when we want to * schedule a new dl assignment */ uint8_t was_releasing; @@ -327,6 +323,7 @@ uint8_t m_ms_class; private: + enum gprs_rlcmac_tbf_state state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; -- To view, visit https://gerrit.osmocom.org/5207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I217f4c4bac21dd584c8682928a080a1a6e9507e1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:17:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:17:50 +0000 Subject: osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:17:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:17:52 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: cleanup state flag handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: cleanup state flag handling ...................................................................... TBF: cleanup state flag handling * introduce generic function to check whether particular flag was set for'a TBF and clear it if necessary. Use this instead of clear_poll_timeout_flag() * add function to explicitly set assignment and appropriate state flags Overall this makes the code easier to read and debug. Related: OS#1759 Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 --- 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, 36 insertions(+), 33 deletions(-) Approvals: Stefan Sperling: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 4bc792a..37a9c80 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1031,23 +1031,19 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - if ((new_tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) { + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { /* We now know that the PACCH really existed */ LOGPTBF(new_tbf, LOGL_INFO, "The TBF has been confirmed on the PACCH, " "changed type from CCCH to PACCH\n"); - new_tbf->state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } new_tbf->set_state(GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if ((new_tbf->state_flags & - (1 << GPRS_RLCMAC_FLAG_TO_DL_ASS))) { - new_tbf->state_flags &= - ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ASS); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - } + tbf_assign_control_ts(new_tbf); return; } @@ -1068,12 +1064,9 @@ 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 (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - } + tbf_assign_control_ts(new_tbf); /* there might be LLC packets waiting in the queue, but the DL * TBF might have been released while the UL TBF has been diff --git a/src/tbf.cpp b/src/tbf.cpp index 9e3a8ef..6847e18 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,8 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_state(GPRS_RLCMAC_ASSIGN); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -1511,8 +1510,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); + ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); 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 943ec92..6d7edbc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,8 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state); + bool check_n_clear(uint8_t state_flag); + void set_assigned_on(uint8_t state_flag, bool check_ccch); const char *state_name() const; const char *name() const; @@ -368,12 +370,33 @@ return tbf_state_name[state]; } +/* Set assignment state and corrsponding flags */ +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +{ + set_state(GPRS_RLCMAC_ASSIGN); + if (check_ccch) { + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + state_flags |= (1 << state_flag); + } else + state_flags |= (1 << state_flag); +} + inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) { LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; +} + +inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) +{ + if ((state_flags & (1 << state_flag))) { + state_flags &= ~(1 << state_flag); + return true; + } + + return false; } inline LListHead& gprs_rlcmac_tbf::list() @@ -451,7 +474,7 @@ int rcvd_dl_ack(bool final_ack, unsigned first_bsn, struct bitvec *rbb); struct msgb *create_dl_acked_block(uint32_t fn, uint8_t ts); void trigger_ass(struct gprs_rlcmac_tbf *old_tbf); - void clear_poll_timeout_flag(); + bool handle_ack_nack(); void request_dl_ack(); bool need_control_ts() const; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index b871bc3..e3b0a9d 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,9 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -505,8 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_state(GPRS_RLCMAC_ASSIGN); - state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -634,18 +631,12 @@ return bsn; } -void gprs_rlcmac_dl_tbf::clear_poll_timeout_flag() -{ - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); -} - bool gprs_rlcmac_dl_tbf::handle_ack_nack() { bool ack_recovered = false; state_flags |= (1 << GPRS_RLCMAC_FLAG_DL_ACK); - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK))) { - clear_poll_timeout_flag(); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ACK)) { ack_recovered = true; } @@ -856,7 +847,7 @@ if (is_final) T_START(this, T3191, bts_data()->t3191, 0, "final block (DL-TBF)", true); - clear_poll_timeout_flag(); + state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_DL_ACK); /* clear poll timeout flag */ /* Clear request flag */ m_dl_ack_requested = false; diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 45de7cd..6442b8f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -96,10 +96,8 @@ bool gprs_rlcmac_ul_tbf::ctrl_ack_to_toggle() { - if ((state_flags & (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK))) { - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); + if (check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ACK)) return true; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was set, now cleared */ - } state_flags |= (1 << GPRS_RLCMAC_FLAG_TO_UL_ACK); return false; /* GPRS_RLCMAC_FLAG_TO_UL_ACK was unset, now set */ -- To view, visit https://gerrit.osmocom.org/5367 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4560280c72f91700f2e19c6c7f6658dc29625c2 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:18:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:18:07 +0000 Subject: osmo-pcu[master]: TBF: log source of state transitions In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:18:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:18:40 +0000 Subject: gapk[master]: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:18:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:18:42 +0000 Subject: [MERGED] gapk[master]: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() ...................................................................... libgsmhr/libgsmhr.c: fix memory leak after gsmhr_exit() During the HR codec initialization, a part of the state is allocated, but not freed at exit. Let's fix this. Found during debugging with Valgrind: 4,932 bytes in 1 blocks are definitely lost in loss record 177 of 179 at 0x4C2AB80: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x6381C8F: gsmhr_init (libgsmhr.c:63) by 0x526DF62: osmo_gapk_pq_queue_codec (pq_codec.c:48) by 0x401ACE: make_processing_chain (app_osmo_gapk.c:573) by 0x401ACE: main (app_osmo_gapk.c:765) Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 --- M libgsmhr/libgsmhr.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Verified Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/libgsmhr/libgsmhr.c b/libgsmhr/libgsmhr.c index eca0ce0..305bbb6 100644 --- a/libgsmhr/libgsmhr.c +++ b/libgsmhr/libgsmhr.c @@ -79,6 +79,7 @@ EXPORT void gsmhr_exit(struct gsmhr *state) { + free(state->bss_save); free(state); } -- To view, visit https://gerrit.osmocom.org/5687 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9ead89c2272782de8d928f29753e6a523cf8834 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:19:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:19:01 +0000 Subject: gapk[master]: Fix BENCHMARK_STOP call for both AMR and FR codecs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:19:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:19:02 +0000 Subject: [MERGED] gapk[master]: Fix BENCHMARK_STOP call for both AMR and FR codecs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix BENCHMARK_STOP call for both AMR and FR codecs ...................................................................... Fix BENCHMARK_STOP call for both AMR and FR codecs The BENCHMARK_STOP should be called with a correct codec type and a correct operation type (encode or decode). Otherwise the results could be incorrect. Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608 --- M src/codec_amr.c M src/codec_fr.c 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Vadim Yanitskiy: Verified Harald Welte: Looks good to me, approved diff --git a/src/codec_amr.c b/src/codec_amr.c index 4aae733..ca614ed 100644 --- a/src/codec_amr.c +++ b/src/codec_amr.c @@ -78,7 +78,7 @@ (unsigned char*) cod, 1 ); - BENCHMARK_STOP(CODEC_EFR, 1); + BENCHMARK_STOP(CODEC_AMR, 1); return rv; } @@ -95,7 +95,7 @@ (short *) pcm, 0 ); - BENCHMARK_STOP(CODEC_EFR, 0); + BENCHMARK_STOP(CODEC_AMR, 0); return PCM_CANON_LEN; } diff --git a/src/codec_fr.c b/src/codec_fr.c index 2ce44b4..917f34b 100644 --- a/src/codec_fr.c +++ b/src/codec_fr.c @@ -74,7 +74,7 @@ memcpy(cod_b, cod, FR_CANON_LEN); BENCHMARK_START; rc = gsm_decode(gh, (gsm_byte*)cod_b, (gsm_signal*)pcm); - BENCHMARK_STOP(CODEC_FR, 1); + BENCHMARK_STOP(CODEC_FR, 0); if (rc < 0) return rc; return PCM_CANON_LEN; -- To view, visit https://gerrit.osmocom.org/5688 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie90e85ca8d9ec3175a58dde60525e0b7d6daf608 Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:21:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:21:57 +0000 Subject: osmo-msc[master]: libmsc: a_iface_bssap.c: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5424/2/src/libmsc/a_iface_bssap.c File src/libmsc/a_iface_bssap.c: Line 328: msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION)); > msgb_put() will panic if the length value provided in the data packet excee The point here is that the MSC side is the "trusted core network" and that we are encoding a 08.08 (DTAP) messsage from MSC to the phone. So if the MSC is sending something that's too large, then it *might* be acceptable to ASSERT. Better would be to verify that TLVP_LEN is not larger than what the 3GPP spec for 08.08 (48.008) says, and to ensure our new msgb always has at least as much space. -- To view, visit https://gerrit.osmocom.org/5424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:23:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:23:58 +0000 Subject: osmo-pcu[master]: Clarify RACH-related interfaces In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5656 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 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 Fri Jan 12 14:24:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:24:00 +0000 Subject: [MERGED] osmo-pcu[master]: Clarify RACH-related interfaces In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Clarify RACH-related interfaces ...................................................................... Clarify RACH-related interfaces * make is_11bit parameter into bool * remove is_single_block() from public interface and mark it as static * move logging outside of if ladder * move side-effects from is_single_block() into separate static functions * simplify UL-TBF allocation in case of 11-bit RACH This immediately makes it obvious that priority is never actually used despite being computed - seems like a leftover from merge of incomplete patch series. Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 Related: OS#1548 --- M src/bts.cpp M src/bts.h 2 files changed, 87 insertions(+), 82 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 37a9c80..c605967 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -615,7 +615,89 @@ return fn; } -int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, +static inline uint16_t mslot_class_from_ra(uint16_t ra, bool is_11bit) +{ + if (is_11bit) + return (ra & 0x3e0) >> 5; + + /* set multislot class to 0 for 8-bit RACH, since we don't know it yet */ + return 0; +} + +static inline uint16_t priority_from_ra(uint16_t ra, bool is_11bit) +{ + if (is_11bit) + return (ra & 0x18) >> 3; + + return 0; +} + +static inline bool is_single_block(bool force_two_phase, uint16_t ra, enum ph_burst_type burst_type, bool is_11bit) +{ + bool sb = false; + + if ((ra & 0xf8) == 0x70) + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block allocation\n"); + else if (force_two_phase) + LOGP(DRLCMAC, LOGL_DEBUG, + "MS requests single phase access, but we force two phase access [RACH is %s bit]\n", + is_11bit ? "11" : "8"); + + if (!is_11bit && (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { + + if ((ra & 0xf8) == 0x70) + sb = true; + else if (force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " + "phase access, but we force two phase " + "access\n"); + sb = true; + } + + } else if (is_11bit && + ((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + + if (!(ra & (1 << 10))) { + if (force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH " + "received. MS requests single phase " + "access but we force two phase " + "access\n"); + sb = true; + } else + sb = false; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH received." + "MS requests single block allocation\n"); + sb = true; + } + + } else if (is_11bit && + (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { + LOGP(DRLCMAC, LOGL_ERROR, + "Error: GPRS 11 bit RACH not supported\n"); + + } else if (burst_type == GSM_L1_BURST_TYPE_NONE) { + LOGP(DRLCMAC, LOGL_DEBUG, "pcu has not received burst type " + "from bts \n"); + + if ((ra & 0xf8) == 0x70) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " + "allocation\n"); + sb = true; + } else if (force_two_phase) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " + "phase access, but we force two phase " + "access\n"); + sb = true; + } + } + + return sb; +} + +int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit, enum ph_burst_type burst_type) { struct gprs_rlcmac_ul_tbf *tbf = NULL; @@ -626,8 +708,7 @@ int plen; uint8_t usf = 7; uint8_t tsc = 0, ta = qta2ta(qta); - uint16_t ms_class = 0; - uint16_t priority = 0; + uint16_t ms_class = mslot_class_from_ra(ra, is_11bit); bool failure = false; rach_frame(); @@ -642,7 +723,7 @@ "so we provide one: ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); - sb = is_single_block(ra, burst_type, is_11bit, &ms_class, &priority); + sb = is_single_block(m_bts.force_two_phase, ra, burst_type, is_11bit); if (sb) { rc = sba()->alloc(&trx_no, &ts_no, &sb_fn, ta); @@ -668,14 +749,7 @@ // Create new TBF /* FIXME: Copy and paste with other routines.. */ - if (is_11bit) { - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, - ms_class, 1); - } else { - /* set class to 0, since we don't know the multislot - * class yet */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1); - } + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, 1); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " @@ -732,73 +806,6 @@ bitvec_free(immediate_assignment); return rc; -} - -uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type, - uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority) -{ - uint8_t sb = 0, val = 0; - - if (!is_11bit && (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { - - if ((ra & 0xf8) == 0x70) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " - "allocation\n"); - sb = 1; - } else if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " - "phase access, but we force two phase " - "access\n"); - sb = 1; - } - - } else if (is_11bit && - ((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || - (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { - - val = !!(ra & (1 << 10)); - - if (!val) { - if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH " - "received. MS requests single phase " - "access but we force two phase " - "access\n"); - sb = 1; - } else { - sb = 0; - *ms_class = (ra & 0x3e0) >> 5; - *priority = (ra & 0x18) >> 3; - } - - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH received." - "MS requests single block allocation\n"); - sb = 1; - } - - } else if (is_11bit && - (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) { - LOGP(DRLCMAC, LOGL_ERROR, - "Error: GPRS 11 bit RACH not supported\n"); - - } else if (burst_type == GSM_L1_BURST_TYPE_NONE) { - LOGP(DRLCMAC, LOGL_DEBUG, "pcu has not received burst type " - "from bts \n"); - - if ((ra & 0xf8) == 0x70) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block " - "allocation\n"); - sb = 1; - } else if (m_bts.force_two_phase) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single " - "phase access, but we force two phase " - "access\n"); - sb = 1; - } - } - - return sb; } void BTS::snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi) diff --git a/src/bts.h b/src/bts.h index a32e87d..b1724c9 100644 --- a/src/bts.h +++ b/src/bts.h @@ -368,11 +368,9 @@ int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); - uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst_type, - uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority); uint32_t rfn_to_fn(int32_t rfn); - int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, + int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, bool is_11bit, enum ph_burst_type burst_type); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); -- To view, visit https://gerrit.osmocom.org/5656 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If189b7166a29a87ffb17a7a9bc560f674851fd53 Gerrit-PatchSet: 2 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 Fri Jan 12 14:24:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:24:22 +0000 Subject: osmo-hlr[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5604 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I112307b5eaf494062b2e8498ff2e9217fb8db925 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:24:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:24:25 +0000 Subject: [MERGED] osmo-hlr[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Enable sanitize for CI tests ...................................................................... Enable sanitize for CI tests Change-Id: I112307b5eaf494062b2e8498ff2e9217fb8db925 --- 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 b273517..eaf4f2b 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -36,7 +36,7 @@ cd "$base" autoreconf --install --force -./configure --enable-external-tests CFLAGS="-Werror" CPPFLAGS="-Werror" +./configure --enable-sanitize --enable-external-tests CFLAGS="-Werror" CPPFLAGS="-Werror" $MAKE $PARALLEL_MAKE $MAKE check || cat-testlogs.sh $MAKE distcheck || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/5604 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I112307b5eaf494062b2e8498ff2e9217fb8db925 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr 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 Fri Jan 12 14:24:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:24:44 +0000 Subject: osmo-sgsn[master]: contrib/jenkins.sh: Enable Werror In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5672 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd110c4eaecab5268e1f87c11ba96460bda274ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Jan 12 14:24:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:24:47 +0000 Subject: osmo-sgsn[master]: configure.ac: Enable Wall in CFLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:25:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:25:08 +0000 Subject: osmo-sgsn[master]: gtphub: make rate_ctr unique In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0e07f95c36de369bcd0691b8d0fd47c844abe5da Gerrit-PatchSet: 4 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:25:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:25:42 +0000 Subject: osmo-ttcn3-hacks[master]: Test control connection status query for MSC 0. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5632 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55faa1ec413629234e24831dbc05d8b0afec8099 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:25:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:25:44 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Test control connection status query for MSC 0. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Test control connection status query for MSC 0. ...................................................................... Test control connection status query for MSC 0. This new test exercises the new 'msc.0.connection_status' control command which is added in https://gerrit.osmocom.org/#/c/5630/ Change-Id: I55faa1ec413629234e24831dbc05d8b0afec8099 Related: OS#2729 --- M bsc/BSC_Tests.ttcn 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 4cf418e..0080fe0 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -871,6 +871,16 @@ setverdict(pass); } +testcase TC_ctrl_msc0_connection_status() runs on test_CT { + var charstring ctrl_resp; + + f_init(1); + f_bssap_reset(); + + f_ctrl_get_exp(IPA_CTRL, "msc.0.connection_status", "connected"); + setverdict(pass); +} + testcase TC_ctrl() runs on test_CT { var charstring ctrl_resp; @@ -1385,6 +1395,7 @@ control { execute( TC_ctrl_msc_connection_status() ); + execute( TC_ctrl_msc0_connection_status() ); execute( TC_ctrl() ); execute( TC_chan_act_noreply() ); execute( TC_chan_act_counter() ); -- To view, visit https://gerrit.osmocom.org/5632 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I55faa1ec413629234e24831dbc05d8b0afec8099 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:25:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:25:58 +0000 Subject: osmo-iuh[master]: iu_client.c: Remove unusued variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5666 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If841d403010a73722ff69617a51719421febab56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:26:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:26:01 +0000 Subject: [MERGED] osmo-iuh[master]: iu_client.c: Remove unusued variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: iu_client.c: Remove unusued variable ...................................................................... iu_client.c: Remove unusued variable Change-Id: If841d403010a73722ff69617a51719421febab56 --- M src/iu_client.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/iu_client.c b/src/iu_client.c index 0724220..0f89515 100644 --- a/src/iu_client.c +++ b/src/iu_client.c @@ -678,7 +678,6 @@ uint16_t lac, uint8_t rac, bool is_ps) { struct ranap_iu_rnc *rnc; - int rc; const char *log_msg; int log_level; int paged = 0; @@ -824,4 +823,3 @@ return 0; } - -- To view, visit https://gerrit.osmocom.org/5666 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If841d403010a73722ff69617a51719421febab56 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:26:28 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 14:26:28 +0000 Subject: [MERGED] osmo-pcu[master]: TBF-UL: add simpler test helper In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF-UL: add simpler test helper ...................................................................... TBF-UL: add simpler test helper Add function to set both V_R and V_Q values to 0 which is useful for TBF test. Related: OS#1759 Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 --- M src/rlc.h M tests/tbf/TbfTest.cpp 2 files changed, 9 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rlc.h b/src/rlc.h index a7e6cf3..fcc3edb 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -342,6 +342,7 @@ const void set_v_r(int); const void set_v_q(int); + void reset_state(); const uint16_t ssn() const; @@ -573,6 +574,12 @@ return is_in_window(bsn) && m_v_n.is_received(bsn) && offset_v_r < ws(); } +inline void gprs_rlc_ul_window::reset_state() +{ + m_v_r = 0; + m_v_q = 0; +} + inline const void gprs_rlc_ul_window::set_v_r(int v_r) { m_v_r = v_r; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 40cb313..44f42b9 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1722,8 +1722,7 @@ "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate URBB with length */ ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class, ul_tbf); @@ -1735,8 +1734,7 @@ send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.set_v_r(0); - ul_tbf->m_window.set_v_q(0); + ul_tbf->m_window.reset_state(); /* Function to generate CRBB */ bts->ws_base = 128; bts->ws_pdch = 64; -- To view, visit https://gerrit.osmocom.org/5337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I719abfbd5b88c694cbbd69d5c4dcb42baaca91b2 Gerrit-PatchSet: 7 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 Fri Jan 12 14:26:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:26:39 +0000 Subject: python/osmo-python-tests[master]: Add rate counter dumper In-Reply-To: References: Message-ID: Patch Set 13: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Gerrit-PatchSet: 13 Gerrit-Project: python/osmo-python-tests 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 Fri Jan 12 14:28:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:28:00 +0000 Subject: osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5685/1/src/libbsc/paging.c File src/libbsc/paging.c: Line 89: LOGP(DPAG, LOGL_INFO, "Going to send paging commands: bts: %d imsi: %s tmsi: " it's typically best practise to use something like "(bts=%d) " at the beginning of the line, similar like what we do in lchan_name and in other parts of the code. So the identification/context comes first, then the log message. -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:31:07 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 14:31:07 +0000 Subject: [MERGED] osmo-pcu[master]: TBF-DL: move priority computation into function In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF-DL: move priority computation into function ...................................................................... TBF-DL: move priority computation into function Improve readability by moving priority computation into separate function. Change-Id: Icdca0106a544036eaa94a25f0d4f84e4282f4568 --- M src/gprs_rlcmac_sched.cpp M src/tbf.h 2 files changed, 37 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 2350808..8925032 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -207,27 +207,41 @@ return NULL; } +static inline enum tbf_dl_prio tbf_compute_priority(const struct gprs_rlcmac_bts *bts, struct gprs_rlcmac_dl_tbf *tbf, + uint8_t ts, uint32_t fn, int age) +{ + const gprs_rlc_dl_window *w = tbf->window(); + int age_thresh1 = msecs_to_frames(200), + age_thresh2 = msecs_to_frames(OSMO_MIN(BTS::TIMER_T3190_MSEC/2, bts->dl_tbf_idle_msec)); + + if (tbf->is_control_ts(ts) && tbf->need_control_ts()) + return DL_PRIO_CONTROL; + + if (tbf->is_control_ts(ts) && age > age_thresh2 && age_thresh2 > 0) + return DL_PRIO_HIGH_AGE; + + if ((tbf->state_is(GPRS_RLCMAC_FLOW) && tbf->have_data()) || w->resend_needed() >= 0) + return DL_PRIO_NEW_DATA; + + if (tbf->is_control_ts(ts) && age > age_thresh1 && tbf->keep_open(fn)) + return DL_PRIO_LOW_AGE; + + if (!w->window_empty()) + return DL_PRIO_SENT_DATA; + + return DL_PRIO_NONE; +} + static struct msgb *sched_select_downlink(struct gprs_rlcmac_bts *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_pdch *pdch) { struct msgb *msg = NULL; struct gprs_rlcmac_dl_tbf *tbf, *prio_tbf = NULL; - enum { - DL_PRIO_NONE, - DL_PRIO_SENT_DATA, /* the data has been sent and not (yet) nacked */ - DL_PRIO_LOW_AGE, /* the age has reached the first threshold */ - DL_PRIO_NEW_DATA, /* the data has not been sent yet or nacked */ - DL_PRIO_HIGH_AGE, /* the age has reached the second threshold */ - DL_PRIO_CONTROL, /* a control block needs to be sent */ - } prio, max_prio = DL_PRIO_NONE; + enum tbf_dl_prio prio, max_prio = DL_PRIO_NONE; uint8_t i, tfi, prio_tfi; int age; - const int age_thresh1 = msecs_to_frames(200); - const int high_prio_msecs = - OSMO_MIN(BTS::TIMER_T3190_MSEC/2, bts->dl_tbf_idle_msec); - const int age_thresh2 = msecs_to_frames(high_prio_msecs); /* select downlink resource */ for (i = 0, tfi = pdch->next_dl_tfi; i < 32; @@ -251,20 +265,8 @@ age = tbf->frames_since_last_poll(fn); /* compute priority */ - if (tbf->is_control_ts(ts) && tbf->need_control_ts()) - prio = DL_PRIO_CONTROL; - else if (tbf->is_control_ts(ts) && - age > age_thresh2 && age_thresh2 > 0) - prio = DL_PRIO_HIGH_AGE; - else if ((tbf->state_is(GPRS_RLCMAC_FLOW) && tbf->have_data()) || - tbf->m_window.resend_needed() >= 0) - prio = DL_PRIO_NEW_DATA; - else if (tbf->is_control_ts(ts) && - age > age_thresh1 && tbf->keep_open(fn)) - prio = DL_PRIO_LOW_AGE; - else if (!tbf->m_window.window_empty()) - prio = DL_PRIO_SENT_DATA; - else + prio = tbf_compute_priority(bts, tbf, ts, fn, age); + if (prio == DL_PRIO_NONE) continue; /* get the TBF with the highest priority */ diff --git a/src/tbf.h b/src/tbf.h index 21762d3..059bc78 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -92,6 +92,15 @@ GPRS_RLCMAC_UL_TBF }; +enum tbf_dl_prio { + DL_PRIO_NONE, + DL_PRIO_SENT_DATA, /* the data has been sent and not (yet) nacked */ + DL_PRIO_LOW_AGE, /* the age has reached the first threshold */ + DL_PRIO_NEW_DATA, /* the data has not been sent yet or nacked */ + DL_PRIO_HIGH_AGE, /* the age has reached the second threshold */ + DL_PRIO_CONTROL, /* a control block needs to be sent */ +}; + enum tbf_counters { TBF_CTR_RLC_NACKED, }; -- To view, visit https://gerrit.osmocom.org/5341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icdca0106a544036eaa94a25f0d4f84e4282f4568 Gerrit-PatchSet: 5 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 Fri Jan 12 14:31:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 14:31:08 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: move window parameters to UL/DL level In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF: move window parameters to UL/DL level ...................................................................... TBF: move window parameters to UL/DL level The UL and DL TBF use different classes implementing window management. Hence it's better to use it explicitly instead of using the common window management superclass inside common TBF superclass. While at it, also remove the direct access to window class - use accessor functions instead. Related: OS#1759 Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6 --- M src/bts.cpp M src/encoding.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp 6 files changed, 42 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index c605967..14c05f2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1203,7 +1203,7 @@ num_blocks = Decoding::decode_gprs_acknack_bits( &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, &tbf->m_window); + &bsn_begin, &bsn_end, tbf->window()); LOGP(DRLCMAC, LOGL_DEBUG, "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " @@ -1279,8 +1279,8 @@ (void *)&ack_nack->EGPRS_AckNack.Desc, (int)offsetof(EGPRS_AckNack_t, Desc), (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->m_window.v_a(), - tbf->m_window.v_s(), + tbf->window()->v_a(), + tbf->window()->v_s(), osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); @@ -1290,7 +1290,7 @@ num_blocks = Decoding::decode_egprs_acknack_bits( &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, &tbf->m_window); + &bsn_begin, &bsn_end, tbf->window()); LOGP(DRLCMAC, LOGL_DEBUG, "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " diff --git a/src/encoding.cpp b/src/encoding.cpp index 87c6f08..b2da1e8 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -695,7 +695,7 @@ { bitvec_write_field(dest, &wp, tbf->current_cs().to_num() - 1, 2); // CHANNEL_CODING_COMMAND - write_packet_ack_nack_desc_gprs(bts, dest, wp, &tbf->m_window, is_final); + write_packet_ack_nack_desc_gprs(bts, dest, wp, tbf->window(), is_final); bitvec_write_field(dest, &wp, 1, 1); // 1: have CONTENTION_RESOLUTION_TLLI bitvec_write_field(dest, &wp, tbf->tlli(), 32); // CONTENTION_RESOLUTION_TLLI @@ -892,7 +892,7 @@ /* -2 for last bit 0 mandatory and REL5 not supported */ unsigned bits_ack_nack = dest->data_len * 8 - wp - 2; - write_packet_ack_nack_desc_egprs(bts, dest, wp, &tbf->m_window, is_final, bits_ack_nack); + write_packet_ack_nack_desc_egprs(bts, dest, wp, tbf->window(), is_final, bits_ack_nack); bitvec_write_field(dest, &wp, 0, 1); // fixed 0 bitvec_write_field(dest, &wp, 0, 1); // 0: don't have REL 5 diff --git a/src/tbf.cpp b/src/tbf.cpp index 6847e18..48cfb6f 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1491,6 +1491,11 @@ return ts == control_ts; } +gprs_rlc_ul_window *gprs_rlcmac_ul_tbf::window() +{ + return &m_window; +} + struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) { diff --git a/src/tbf.h b/src/tbf.h index 6d7edbc..21762d3 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -193,8 +193,6 @@ GprsMs *ms() const; void set_ms(GprsMs *ms); - gprs_rlc_window *window(); - uint8_t tsc() const; int rlcmac_diag(); @@ -456,7 +454,7 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf { gprs_rlcmac_dl_tbf(BTS *bts); - + gprs_rlc_dl_window *window(); void cleanup(); void enable_egprs(); /* dispatch Unitdata.DL messages */ @@ -496,7 +494,6 @@ * All states that need reset must be in this struct, so this is why * variables are in both (dl and ul) structs and not outside union. */ - gprs_rlc_dl_window m_window; int32_t m_tx_counter; /* count all transmitted blocks */ uint8_t m_wait_confirm; /* wait for CCCH IMM.ASS cnf */ bool m_dl_ack_requested; @@ -547,11 +544,18 @@ enum egprs_rlcmac_dl_spb get_egprs_dl_spb(int bsn); struct osmo_timer_list m_llc_timer; + + /* Please note that all variables below will be reset when changing + * from WAIT RELEASE back to FLOW state (re-use of TBF). + * All states that need reset must be in this struct, so this is why + * variables are in both (dl and ul) structs and not outside union. + */ + gprs_rlc_dl_window m_window; }; struct gprs_rlcmac_ul_tbf : public gprs_rlcmac_tbf { gprs_rlcmac_ul_tbf(BTS *bts); - + gprs_rlc_ul_window *window(); struct msgb *create_ul_ack(uint32_t fn, uint8_t ts); bool ctrl_ack_to_toggle(); bool handle_ctrl_ack(); @@ -590,7 +594,6 @@ * All states that need reset must be in this struct, so this is why * variables are in both (dl and ul) structs and not outside union. */ - gprs_rlc_ul_window m_window; int32_t m_rx_counter; /* count all received blocks */ uint8_t m_n3103; /* N3103 counter */ uint8_t m_usf[8]; /* list USFs per PDCH (timeslot) */ @@ -602,6 +605,13 @@ protected: void maybe_schedule_uplink_acknack(const gprs_rlc_data_info *rlc); + + /* Please note that all variables below will be reset when changing + * from WAIT RELEASE back to FLOW state (re-use of TBF). + * All states that need reset must be in this struct, so this is why + * variables are in both (dl and ul) structs and not outside union. + */ + gprs_rlc_ul_window m_window; }; #ifdef __cplusplus @@ -655,16 +665,6 @@ return static_cast(tbf); else return NULL; -} - -inline gprs_rlc_window *gprs_rlcmac_tbf::window() -{ - switch (direction) - { - case GPRS_RLCMAC_UL_TBF: return &as_ul_tbf(this)->m_window; - case GPRS_RLCMAC_DL_TBF: return &as_dl_tbf(this)->m_window; - } - return NULL; } #endif diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index e3b0a9d..45c9a8f 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -969,6 +969,11 @@ return lost * 100 / (lost + received); } +gprs_rlc_dl_window *gprs_rlcmac_dl_tbf::window() +{ + return &m_window; +} + int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, const struct bitvec *rbb) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index fbbe366..ac15b2c 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -297,9 +297,9 @@ /* Receive an ACK */ #define RCV_ACK(fin, tbf, rbb) do { \ - tbf->rcvd_dl_ack(fin, tbf->m_window.v_s(), rbb); \ + tbf->rcvd_dl_ack(fin, tbf->window()->v_s(), rbb); \ if (!fin) \ - OSMO_ASSERT(tbf->m_window.window_empty()); \ + OSMO_ASSERT(tbf->window()->window_empty()); \ } while(0) static void test_tbf_delayed_release() @@ -1725,7 +1725,7 @@ "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.reset_state(); + ul_tbf->window()->reset_state(); /* Function to generate URBB with length */ ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class, ul_tbf); @@ -1737,7 +1737,7 @@ send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); - ul_tbf->m_window.reset_state(); + ul_tbf->window()->reset_state(); /* Function to generate CRBB */ bts->ws_base = 128; bts->ws_pdch = 64; @@ -2529,7 +2529,7 @@ dl_tbf = create_dl_tbf(&the_bts, ms_class, egprs_ms_class, &trx_no); dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); - prlcdlwindow = &dl_tbf->m_window; + prlcdlwindow = dl_tbf->window(); prlcmvb = &prlcdlwindow->m_v_b; prlcdlwindow->m_v_s = 1288; prlcdlwindow->m_v_a = 1176; @@ -2561,7 +2561,7 @@ Decoding::decode_egprs_acknack_bits( &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, &dl_tbf->m_window); + &bsn_begin, &bsn_end, dl_tbf->window()); dl_tbf->rcvd_dl_ack( ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, @@ -2755,17 +2755,17 @@ } #define NACK(tbf, x) do { \ - tbf->m_window.m_v_b.mark_nacked(x); \ - OSMO_ASSERT(tbf->m_window.m_v_b.is_nacked(x)); \ + tbf->window()->m_v_b.mark_nacked(x); \ + OSMO_ASSERT(tbf->window()->m_v_b.is_nacked(x)); \ } while(0) #define CHECK_UNACKED(tbf, cs, bsn) do { \ - OSMO_ASSERT(tbf->m_window.m_v_b.is_unacked(bsn)); \ + OSMO_ASSERT(tbf->window()->m_v_b.is_unacked(bsn)); \ OSMO_ASSERT(tbf->m_rlc.block(bsn)->cs_current_trans.to_num() == cs); \ } while(0) #define CHECK_NACKED(tbf, cs, bsn) do { \ - OSMO_ASSERT(tbf->m_window.m_v_b.is_nacked(bsn)); \ + OSMO_ASSERT(tbf->window()->m_v_b.is_nacked(bsn)); \ OSMO_ASSERT(tbf->m_rlc.block(bsn)->cs_current_trans.to_num() == cs); \ } while(0) -- To view, visit https://gerrit.osmocom.org/5340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b55aa8947db65f7206adcf53ea32b74a831d9e6 Gerrit-PatchSet: 5 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 Fri Jan 12 14:31:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 14:31:08 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: unify EGPRS window calculation In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF: unify EGPRS window calculation ...................................................................... TBF: unify EGPRS window calculation Move actual calculation into shared function and use it to set window size for TBF. TBT test output requires cosmetic adjuestements due to extended debug output. Change-Id: Ib9f4a277082da3c71007f5f3b4f2acac8b994540 Related: OS#1759 --- 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, 57 insertions(+), 70 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/tbf.cpp b/src/tbf.cpp index 48cfb6f..4878a07 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -487,6 +487,14 @@ talloc_free(tbf); } +uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts_data, uint8_t slots) +{ + uint8_t num_pdch = pcu_bitcount(slots); + + return OSMO_MIN((num_pdch != 1) ? (128 * num_pdch) : 192, + OSMO_MAX(64, (bts_data->ws_base + num_pdch * bts_data->ws_pdch) / 32 * 32)); +} + int gprs_rlcmac_tbf::update() { struct gprs_rlcmac_bts *bts_data = bts->bts_data(); @@ -509,7 +517,7 @@ if (is_egprs_enabled()) { gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(this); if (dl_tbf) - dl_tbf->egprs_calc_window_size(); + dl_tbf->set_window_size(); } return 0; @@ -946,7 +954,7 @@ rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot); if (tbf->is_egprs_enabled()) - tbf->egprs_calc_ulwindow_size(); + tbf->set_window_size(); /* if no resource */ if (rc < 0) { @@ -1044,7 +1052,7 @@ } if (tbf->is_egprs_enabled()) { - tbf->egprs_calc_window_size(); + tbf->set_window_size(); tbf->m_dl_egprs_ctrs = rate_ctr_group_alloc(tbf, &tbf_dl_egprs_ctrg_desc, 0); if (!tbf->m_dl_egprs_ctrs) { LOGP(DRLCMAC, LOGL_ERROR, "Couldn't allocate EGPRS DL counters\n"); diff --git a/src/tbf.h b/src/tbf.h index 059bc78..6c9946e 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -492,7 +492,7 @@ int release(); int abort(); uint16_t window_size() const; - void egprs_calc_window_size(); + void set_window_size(); void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ @@ -594,8 +594,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); - void egprs_calc_ulwindow_size(); uint16_t window_size() const; + void set_window_size(); void update_coding_scheme_counter_ul(const GprsCodingScheme cs); /* Please note that all variables here will be reset when changing @@ -676,4 +676,6 @@ return NULL; } +uint16_t egprs_window_size(const struct gprs_rlcmac_bts *bts_data, uint8_t slots); + #endif diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 45c9a8f..6b8eda7 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1366,23 +1366,11 @@ return EGPRS_RLCMAC_DL_NO_RETX; } -void gprs_rlcmac_dl_tbf::egprs_calc_window_size() +void gprs_rlcmac_dl_tbf::set_window_size() { - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); - unsigned int num_pdch = pcu_bitcount(dl_slots()); - unsigned int ws = bts_data->ws_base + num_pdch * bts_data->ws_pdch; - - ws = (ws / 32) * 32; - ws = OSMO_MAX(64, ws); - - if (num_pdch == 1) - ws = OSMO_MIN(192, ws); - else - ws = OSMO_MIN(128 * num_pdch, ws); - - LOGP(DRLCMAC, LOGL_INFO, "%s: Setting EGPRS window size to %d\n", - name(), ws); - + uint16_t ws = egprs_window_size(bts->bts_data(), dl_slots()); + LOGP(DRLCMAC, LOGL_INFO, "%s: setting EGPRS DL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n", + name(), ws, bts->bts_data()->ws_base, pcu_bitcount(dl_slots()), bts->bts_data()->ws_pdch); m_window.set_ws(ws); } diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 6442b8f..83ac08f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -606,21 +606,10 @@ } } -void gprs_rlcmac_ul_tbf::egprs_calc_ulwindow_size() +void gprs_rlcmac_ul_tbf::set_window_size() { - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); - unsigned int num_pdch = pcu_bitcount(ul_slots()); - unsigned int ws = bts_data->ws_base + num_pdch * bts_data->ws_pdch; - ws = (ws / 32) * 32; - ws = OSMO_MAX(64, ws); - - if (num_pdch == 1) - ws = OSMO_MIN(192, ws); - else - ws = OSMO_MIN(128 * num_pdch, ws); - - LOGP(DRLCMAC, LOGL_INFO, "%s: Setting EGPRS window size to %d, base(%d) slots(%d) ws_pdch(%d)\n", - name(), ws, bts_data->ws_base, num_pdch, bts_data->ws_pdch); - + uint16_t ws = egprs_window_size(bts->bts_data(), ul_slots()); + LOGP(DRLCMAC, LOGL_INFO, "%s: setting EGPRS UL window size to %u, base(%u) slots(%u) ws_pdch(%u)\n", + name(), ws, bts->bts_data()->ws_base, pcu_bitcount(ul_slots()), bts->bts_data()->ws_pdch); m_window.set_ws(ws); } diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 3ed8678..57f7bd9 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3387,7 +3387,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 3c -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 384 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 384, base(128) slots(4) ws_pdch(64) ws(384) DL TBF slots: 0x3c, N: 4, WS: 384 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING @@ -3432,7 +3432,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): setting EGPRS UL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer T3169 [allocation (UL-TBF)] with 0 sec. 0 microsec. @@ -3484,7 +3484,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START @@ -3526,7 +3526,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): setting EGPRS UL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer T3169 [allocation (UL-TBF)] with 0 sec. 0 microsec. @@ -3741,7 +3741,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START @@ -3771,7 +3771,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -4130,7 +4130,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -4429,7 +4429,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -4683,7 +4683,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -4898,7 +4898,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5089,7 +5089,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5259,7 +5259,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5423,7 +5423,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5573,7 +5573,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5724,7 +5724,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5778,7 +5778,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5832,7 +5832,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5886,7 +5886,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -5959,7 +5959,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6032,7 +6032,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6105,7 +6105,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6178,7 +6178,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6239,7 +6239,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6300,7 +6300,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6361,7 +6361,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -6441,7 +6441,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): setting EGPRS UL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer T3169 [allocation (UL-TBF)] with 0 sec. 0 microsec. @@ -6523,7 +6523,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START @@ -6555,7 +6555,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 192 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 192, base(128) slots(1) ws_pdch(64) ws(192) DL TBF slots: 0x10, N: 1, WS: 192 ********** DL-TBF update ********** @@ -6572,7 +6572,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 5 PDCH(TS 5, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 384 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 384, base(128) slots(4) ws_pdch(64) ws(384) DL TBF slots: 0x3c, N: 4, WS: 384 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING @@ -6617,7 +6617,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): setting EGPRS UL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer T3169 [allocation (UL-TBF)] with 0 sec. 0 microsec. @@ -6687,7 +6687,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START @@ -6717,7 +6717,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 -TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW @@ -7077,7 +7077,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 192, base(128) slots(1) ws_pdch(64) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): setting EGPRS UL window size to 192, base(128) slots(1) ws_pdch(64) ws(192) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer T3169 [allocation (UL-TBF)] with 0 sec. 0 microsec. @@ -7941,7 +7941,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 7 Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 -TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 192 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 192, base(128) slots(1) ws_pdch(64) ws(192) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START -- To view, visit https://gerrit.osmocom.org/5355 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9f4a277082da3c71007f5f3b4f2acac8b994540 Gerrit-PatchSet: 4 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 Fri Jan 12 14:31:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 14:31:08 +0000 Subject: [MERGED] osmo-pcu[master]: Avoid code duplication in TBF test In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Avoid code duplication in TBF test ...................................................................... Avoid code duplication in TBF test Move repetitive checks into corresponding macros to avoid copy-pasted code. This also enables strickter checks some of which were apparently omitted while copy-pasting. This is part of preparation work to move to separate UL/DL windows. Related: OS#1759 Change-Id: If7aa72f5aa66c5e9c255542c066b5494c098aab2 --- M tests/tbf/TbfTest.cpp 1 file changed, 73 insertions(+), 120 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 44f42b9..fbbe366 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -295,6 +295,13 @@ printf("=== end %s ===\n", __func__); } +/* Receive an ACK */ +#define RCV_ACK(fin, tbf, rbb) do { \ + tbf->rcvd_dl_ack(fin, tbf->m_window.v_s(), rbb); \ + if (!fin) \ + OSMO_ASSERT(tbf->m_window.window_empty()); \ + } while(0) + static void test_tbf_delayed_release() { BTS the_bts; @@ -340,16 +347,13 @@ /* ACK all blocks */ memset(rbb, 0xff, sizeof(rbb)); - /* Receive an ACK */ - dl_tbf->rcvd_dl_ack(false, dl_tbf->m_window.v_s(), rbb); - OSMO_ASSERT(dl_tbf->m_window.window_empty()); + + RCV_ACK(false, dl_tbf, rbb); /* Receive an ACK */ /* Force sending of a single block containing an LLC dummy command */ request_dl_rlc_block(dl_tbf, &fn); - /* Receive an ACK */ - dl_tbf->rcvd_dl_ack(false, dl_tbf->m_window.v_s(), rbb); - OSMO_ASSERT(dl_tbf->m_window.window_empty()); + RCV_ACK(false, dl_tbf, rbb); /* Receive an ACK */ /* Timeout (make sure fn % 52 remains valid) */ fn += 52 * ((msecs_to_frames(bts->dl_tbf_idle_msec + 100) + 51)/ 52); @@ -357,8 +361,7 @@ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FINISHED)); - /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(true, dl_tbf->m_window.v_s(), rbb); + RCV_ACK(true, dl_tbf, rbb); /* Receive a final ACK */ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); @@ -2692,8 +2695,7 @@ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_FLOW)); - /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(true, dl_tbf->m_window.v_s(), rbb); + RCV_ACK(true, dl_tbf, rbb); /* Receive a final ACK */ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); @@ -2742,8 +2744,7 @@ { uint8_t rbb[64/8]; - /* Receive a final ACK */ - dl_tbf->rcvd_dl_ack(true, dl_tbf->m_window.v_s(), rbb); + RCV_ACK(true, dl_tbf, rbb); /* Receive a final ACK */ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); @@ -2752,6 +2753,30 @@ tbf_free(dl_tbf); } + +#define NACK(tbf, x) do { \ + tbf->m_window.m_v_b.mark_nacked(x); \ + OSMO_ASSERT(tbf->m_window.m_v_b.is_nacked(x)); \ + } while(0) + +#define CHECK_UNACKED(tbf, cs, bsn) do { \ + OSMO_ASSERT(tbf->m_window.m_v_b.is_unacked(bsn)); \ + OSMO_ASSERT(tbf->m_rlc.block(bsn)->cs_current_trans.to_num() == cs); \ + } while(0) + +#define CHECK_NACKED(tbf, cs, bsn) do { \ + OSMO_ASSERT(tbf->m_window.m_v_b.is_nacked(bsn)); \ + OSMO_ASSERT(tbf->m_rlc.block(bsn)->cs_current_trans.to_num() == cs); \ + } while(0) + +#define MAKE_ACKED(m, tbf, fn, cs, check_unacked) do { \ + m = tbf->create_dl_acked_block(fn, tbf->control_ts); \ + OSMO_ASSERT(m); \ + if (check_unacked) \ + CHECK_UNACKED(tbf, cs, 0); \ + else \ + CHECK_NACKED(tbf, cs, 0); \ + } while(0) static void egprs_spb_to_normal_validation(BTS *the_bts, unsigned int mcs, unsigned int demanded_mcs) @@ -2777,15 +2802,13 @@ fn = fn_add_blocks(fn, 1); /* Send first RLC data block BSN 0 */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); egprs2 = (struct gprs_rlc_dl_header_egprs_2 *) msg->data; bsn1 = (egprs2->bsn1_hi << 9) | (egprs2->bsn1_mid << 1) | (egprs2->bsn1_lo); - dl_tbf->m_window.m_v_b.mark_nacked(0); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + + NACK(dl_tbf, 0); + OSMO_ASSERT(bsn1 == 0); dl_tbf->ms()->set_current_cs_dl @@ -2795,10 +2818,7 @@ fn = fn_add_blocks(fn, 1); /* Send first segment with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, false); OSMO_ASSERT(dl_tbf->m_rlc.block(0)->spb_status.block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT); @@ -2809,10 +2829,7 @@ OSMO_ASSERT(egprs3->cps == 3); /* Send second segment with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, true); OSMO_ASSERT(dl_tbf->m_rlc.block(0)->spb_status.block_status_dl == EGPRS_RESEG_SECOND_SEG_SENT); @@ -2830,8 +2847,8 @@ (static_cast < GprsCodingScheme::Scheme > (GprsCodingScheme::CS4 + mcs)); - dl_tbf->m_window.m_v_b.mark_nacked(0); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + NACK(dl_tbf, 0); + msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); egprs2 = (struct gprs_rlc_dl_header_egprs_2 *) msg->data; @@ -2871,13 +2888,9 @@ fn = fn_add_blocks(fn, 1); /* Send first RLC data block BSN 0 */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); - dl_tbf->m_window.m_v_b.mark_nacked(0); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + NACK(dl_tbf, 0); dl_tbf->ms()->set_current_cs_dl (static_cast < GprsCodingScheme::Scheme > @@ -2886,10 +2899,7 @@ fn = fn_add_blocks(fn, 1); /* Send first segment with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, false); OSMO_ASSERT(dl_tbf->m_rlc.block(0)->spb_status.block_status_dl == EGPRS_RESEG_FIRST_SEG_SENT); @@ -2913,10 +2923,7 @@ } /* Send second segment with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, true); OSMO_ASSERT(dl_tbf->m_rlc.block(0)->spb_status.block_status_dl == EGPRS_RESEG_SECOND_SEG_SENT); @@ -2965,19 +2972,11 @@ ((mcs == 7) && (demanded_mcs < 7))) { fn = fn_add_blocks(fn, 1); /* Send 2 RLC data block */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); - OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); + CHECK_UNACKED(dl_tbf, mcs, 1); - dl_tbf->m_window.m_v_b.mark_nacked(0); - dl_tbf->m_window.m_v_b.mark_nacked(1); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + NACK(dl_tbf, 0); + NACK(dl_tbf, 1); /* Set the demanded MCS to demanded_mcs */ dl_tbf->ms()->set_current_cs_dl @@ -2986,43 +2985,26 @@ fn = fn_add_blocks(fn, 1); /* Retransmit the first RLC data block with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, true); + CHECK_NACKED(dl_tbf, mcs, 1); fn = fn_add_blocks(fn, 1); /* Retransmit the second RLC data block with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, true); + CHECK_UNACKED(dl_tbf, demanded_mcs, 1); } else if (((mcs == 5) && (demanded_mcs > 6)) || ((mcs == 6) && (demanded_mcs > 8))) { fn = fn_add_blocks(fn, 1); /* Send first RLC data block BSN 0 */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); fn = fn_add_blocks(fn, 1); /* Send second RLC data block BSN 1 */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); + CHECK_UNACKED(dl_tbf, mcs, 1); - dl_tbf->m_window.m_v_b.mark_nacked(0); - dl_tbf->m_window.m_v_b.mark_nacked(1); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + NACK(dl_tbf, 0); + NACK(dl_tbf, 1); dl_tbf->ms()->set_current_cs_dl (static_cast < GprsCodingScheme::Scheme > @@ -3030,63 +3012,34 @@ fn = fn_add_blocks(fn, 1); /* Send first, second RLC data blocks with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == demanded_mcs); - OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() - == demanded_mcs); + MAKE_ACKED(msg, dl_tbf, fn, demanded_mcs, true); + CHECK_UNACKED(dl_tbf, demanded_mcs, 1); } else if (mcs > 6) { /* No Mcs change cases are handled here for mcs > MCS6*/ fn = fn_add_blocks(fn, 1); /* Send first,second RLC data blocks */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); - OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); + CHECK_UNACKED(dl_tbf, mcs, 1); - dl_tbf->m_window.m_v_b.mark_nacked(0); - dl_tbf->m_window.m_v_b.mark_nacked(1); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(1)); + NACK(dl_tbf, 0); + NACK(dl_tbf, 1); fn = fn_add_blocks(fn, 1); /* Send first,second RLC data blocks with demanded_mcs*/ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(1)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); - OSMO_ASSERT(dl_tbf->m_rlc.block(1)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); + CHECK_UNACKED(dl_tbf, mcs, 1); } else { /* No MCS change cases are handled here for mcs <= MCS6*/ fn = fn_add_blocks(fn, 1); /* Send first RLC data block */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); - dl_tbf->m_window.m_v_b.mark_nacked(0); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_nacked(0)); + NACK(dl_tbf, 0); fn = fn_add_blocks(fn, 1); /* Send first RLC data block with demanded_mcs */ - msg = dl_tbf->create_dl_acked_block(fn, dl_tbf->control_ts); - OSMO_ASSERT(msg); - OSMO_ASSERT(dl_tbf->m_window.m_v_b.is_unacked(0)); - OSMO_ASSERT(dl_tbf->m_rlc.block(0)->cs_current_trans.to_num() - == mcs); + MAKE_ACKED(msg, dl_tbf, fn, mcs, true); } tbf_cleanup(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7aa72f5aa66c5e9c255542c066b5494c098aab2 Gerrit-PatchSet: 5 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 Fri Jan 12 14:31:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 14:31:13 +0000 Subject: osmo-pcu[master]: Fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5686/1/src/encoding.cpp File src/encoding.cpp: Line 83: *write_index += 2; why +2? I don't get it. we are setting a single bit, aren't we? -- To view, visit https://gerrit.osmocom.org/5686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc6cb8e72219df55f359f130e509167d841f11bd 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: Minh-Quang Nguyen Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 12 14:48:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 14:48:35 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: log source of state transitions 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/5209 to look at the new patch set (#5). TBF: log source of state transitions We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#1759 --- 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.cpp 6 files changed, 26 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/5209/5 diff --git a/src/bts.cpp b/src/bts.cpp index 14c05f2..c775778 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -759,7 +759,7 @@ failure = true; } else { tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); @@ -1045,7 +1045,7 @@ "changed type from CCCH to PACCH\n"); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) diff --git a/src/tbf.cpp b/src/tbf.cpp index 4878a07..2c383ad 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -730,7 +730,7 @@ m_n3101++; if (m_n3101 == bts->bts_data()->n3101) { LOGP(DRLCMAC, LOGL_NOTICE, " N3101 exceeded MAX (%u)\n", bts->bts_data()->n3101); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); return; } @@ -748,7 +748,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); - ul_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_RELEASING); T_START(ul_tbf, T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); return; } @@ -770,7 +770,7 @@ bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pua_poll_failed(); @@ -792,7 +792,7 @@ bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pda_poll_failed(); @@ -818,7 +818,7 @@ } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - dl_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_RELEASING); T_START(dl_tbf, T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); @@ -1109,7 +1109,7 @@ if (!dl_tbf->upgrade_to_multislot) { /* change state to FLOW, so scheduler * will start transmission */ - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); return; } @@ -1245,7 +1245,7 @@ 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); + TBF_SET_STATE(new_dl_tbf, GPRS_RLCMAC_FLOW); tbf_assign_control_ts(new_dl_tbf); /* stop pending assignment timer */ new_dl_tbf->t_stop(T0, "assignment (DL-TBF)"); @@ -1523,7 +1523,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); - ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); + TBF_SET_ASS_ON(ul_tbf, GPRS_RLCMAC_FLAG_PACCH, false); 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 6c9946e..bf6ce4c 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,9 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) +#define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) + struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -188,9 +191,9 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; - void set_state(enum gprs_rlcmac_tbf_state new_state); + void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); bool check_n_clear(uint8_t state_flag); - void set_assigned_on(uint8_t state_flag, bool check_ccch); + void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; const char *name() const; @@ -378,9 +381,9 @@ } /* Set assignment state and corrsponding flags */ -inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line) { - set_state(GPRS_RLCMAC_ASSIGN); + set_state(GPRS_RLCMAC_ASSIGN, file, line); if (check_ccch) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) state_flags |= (1 << state_flag); @@ -388,9 +391,9 @@ state_flags |= (1 << state_flag); } -inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) +inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line) { - LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 6b8eda7..5a42aa0 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,7 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); + TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -503,7 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); + TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -614,7 +614,7 @@ if (is_final) { request_dl_ack(); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); } /* dequeue next LLC frame, if any */ @@ -1109,7 +1109,7 @@ /* report all outstanding packets as received */ gprs_rlcmac_received_lost(this, received, 0); - set_state(GPRS_RLCMAC_WAIT_RELEASE); + TBF_SET_STATE(this, GPRS_RLCMAC_WAIT_RELEASE); /* start T3193 */ T_START(this, T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, @@ -1143,7 +1143,7 @@ * (partly) encoded in chunk 1 of block V(A). (optional) */ } - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); /* reset rlc states */ m_window.reset(); diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 83ac08f..eaf9c93 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -330,7 +330,7 @@ if (rdbi->cv == 0) { LOGP(DRLCMACUL, LOGL_DEBUG, "- Finished with UL " "TBF\n"); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); /* Reset N3103 counter. */ this->m_n3103 = 0; } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ac15b2c..9e21c73 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -176,7 +176,7 @@ /* "Establish" the DL TBF */ dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 15:18:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 15:18:17 +0000 Subject: [PATCH] osmo-ci[master]: Fix missing OsmoPCU gerrit verification Message-ID: Review at https://gerrit.osmocom.org/5770 Fix missing OsmoPCU gerrit verification The [yes, no] tuple was automatically converted to [True, False] by the jenkins-job-builder but the combination filter still used old literal check. Fix this by using boolean from the very beginning. Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b --- M jobs/gerrit-verifications.yml 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/70/5770/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b421e34..192d0ad 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -149,15 +149,15 @@ a1_name: FIRMWARE_VERSION a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] a2_name: with_vty - a2: !!python/tuple [yes ,no] + a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] combination_filter: > - (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || - (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master") - osmo-python-tests: repos_url: 'ssh://jenkins at gerrit.osmocom.org:29418/python/{repos}' -- To view, visit https://gerrit.osmocom.org/5770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 15:25:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 15:25:53 +0000 Subject: [PATCH] osmo-pcu[master]: Don't access TBF internals in vty functions Message-ID: Review at https://gerrit.osmocom.org/5771 Don't access TBF internals in vty functions Obtain corresponding window object of UL/DL TBF by using proper accessor function instead of direct access to private member. Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950 --- M src/pcu_vty_functions.cpp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/71/5771/1 diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 0a80a23..001164c 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -67,7 +67,7 @@ vty_out(vty, " CS=%s", tbf->current_cs().name()); if (ul_tbf) { - gprs_rlc_ul_window *win = &ul_tbf->m_window; + gprs_rlc_ul_window *win = ul_tbf->window(); vty_out(vty, " WS=%u V(Q)=%d V(R)=%d", ul_tbf->window_size(), win->v_q(), win->v_r()); vty_out(vty, "%s", VTY_NEWLINE); @@ -79,7 +79,7 @@ } } if (dl_tbf) { - gprs_rlc_dl_window *win = &dl_tbf->m_window; + gprs_rlc_dl_window *win = dl_tbf->window(); vty_out(vty, " WS=%u V(A)=%d V(S)=%d nBSN=%d%s", dl_tbf->window_size(), win->v_a(), win->v_s(), win->resend_needed(), win->window_stalled() ? " STALLED" : ""); -- To view, visit https://gerrit.osmocom.org/5771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 15:29:55 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 12 Jan 2018 15:29:55 +0000 Subject: osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... In-Reply-To: References: Message-ID: Patch Set 1: WHat's the expected way to verify this? I push it to jenkins using the jenkins job builder tools and then I retrigger a gerrit commit to see if it works nice? Then I Verify+1 and merge it. Fine with that? -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 15:32:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 15:32:13 +0000 Subject: [PATCH] osmo-pcu[master]: Fix jenkins.sh to match jenkins job axis filter Message-ID: Review at https://gerrit.osmocom.org/5772 Fix jenkins.sh to match jenkins job axis filter The 'yes/no' values are automatically converted to True/False upon jenkins job instantiation. Let's use those directly. Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/5772/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 05b9639..b7cfc3d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -51,9 +51,9 @@ exit 1 fi -if [ "$with_vty" = "yes" ]; then +if [ "$with_vty" = "True" ]; then PCU_CONFIG="$PCU_CONFIG --enable-vty-tests" -elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then +elif [ -z "$with_vty" -o "$with_vty" = "False" ]; then echo "VTY tests disabled" else echo 'Invalid $with_vty value:' $with_vty -- To view, visit https://gerrit.osmocom.org/5772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 15:43:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 15:43:48 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Add rate counter dumper 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/5029 to look at the new patch set (#14). Add rate counter dumper This simple tool dump all the rate counters available via ctrl interface to cvs file (or stdout). Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Fixes: OS#2550 --- M README M contrib/jenkins.sh A scripts/osmo_rate_ctr2csv.py M setup.py 4 files changed, 89 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/29/5029/14 diff --git a/README b/README index e85c1c4..2c04047 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ There are currently following scripts in this package: osmotestconfig.py - test that apps start/write with example configs soap.py - implementation of SOAP <-> Ctrl proxy implemented on top of Twisted +osmo_rate_ctr2csv.py - rate counter dumper on top of osmo_ipa osmo_interact_vty.py - pipe stdin/stdout to a VTY session osmo_interact_ctrl.py - pipe stdin/stdout to a CTRL port osmo_verify_transcript_vty.py - VTY testing by VTY session screen dumps diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ac67d85..08908a4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,7 +16,7 @@ rm -rf ./build PY3=python3 -PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" +PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmo_rate_ctr2csv.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" $PY3 ./setup.py install $PY3 tests/test_py3.py for f in $PY3_LIST diff --git a/scripts/osmo_rate_ctr2csv.py b/scripts/osmo_rate_ctr2csv.py new file mode 100644 index 0000000..1e3fc9f --- /dev/null +++ b/scripts/osmo_rate_ctr2csv.py @@ -0,0 +1,86 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2017 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from osmopy.osmo_ipa import Ctrl +import socket, argparse, sys, logging, csv + +__version__ = "0.0.1" # bump this on every non-trivial change + +def connect(host, port): + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + return sck + +def get_var(sck, var): + (_, c) = Ctrl().cmd(var, None) + sck.send(c) + return Ctrl().parse_kv(sck.recv(4096)) + +def get_interval(group_name, group_counters, interval): + log.debug('Getting %s counter values: %s...' % (group_name, interval)) + (_, c) = get_var(sock, 'rate_ctr.%s.%s' % (interval, group_name)) + for ctr in c.split(';'): + if len(ctr): + (k, v) = ctr.split() + group_counters[k] = group_counters.get(k, (group_name,)) + (v,) + return len(group_counters) + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Dump rate counters into csv via Osmocom CTRL protocol.') + p.add_argument('-v', '--version', action='version', version=("%(prog)s v" + __version__)) + p.add_argument('-p', '--port', type=int, default=4249, help="Port to use for CTRL interface, defaults to 4249") + p.add_argument('-c', '--ctrl', default='localhost', help="Adress to use for CTRL interface, defaults to localhost") + p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") + p.add_argument('--header', action='store_true', help="Prepend column header to output") + p.add_argument('-o', '--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout, help="Output file, defaults to stdout") + args = p.parse_args() + + log = logging.getLogger('rate_ctr2csv') + log.setLevel(logging.DEBUG if args.debug else logging.INFO) + log.addHandler(logging.StreamHandler(sys.stderr)) + + log.info('Connecting to %s:%d...' % (args.ctrl, args.port)) + sock = connect(args.ctrl, args.port) + + log.info('Getting rate counter groups info...') + (_, g) = get_var(sock, 'rate_ctr.*') + + w = csv.writer(args.output, dialect='unix') + total_groups = 0 + total_rows = 0 + + if args.header: + w.writerow(['group', 'counter', 'absolute', 'second', 'minute', 'hour', 'day']) + + for group in g.split(';'): + if len(group): + g_counters = {} + total_groups += 1 + total_rows += list(map(lambda x: get_interval(group, g_counters, x), ('abs', 'per_sec', 'per_min', 'per_hour', 'per_day')))[0] + for (k, (gr, absolute, per_sec, per_min, per_hour, per_day)) in g_counters.items(): + w.writerow([gr, k, absolute, per_sec, per_min, per_hour, per_day]) + + log.info('Completed: %d counters from %d groups received.' % (total_rows, total_groups)) diff --git a/setup.py b/setup.py index 3c12327..a8fd6e9 100755 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ elif sys.version_info.major == 3: scripts = [ "scripts/osmo_ctrl.py", + "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", "scripts/twisted_ipa.py", "scripts/osmo_interact_vty.py", -- To view, visit https://gerrit.osmocom.org/5029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Gerrit-PatchSet: 14 Gerrit-Project: python/osmo-python-tests 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 Fri Jan 12 15:47:34 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 15:47:34 +0000 Subject: [ABANDON] osmo-pcu[master]: Fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Fix wrong encoding of LH bits ...................................................................... Abandoned Superseded by "rewrite rest octets" patch series. -- To view, visit https://gerrit.osmocom.org/5686 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ibc6cb8e72219df55f359f130e509167d841f11bd 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: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:14:18 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 16:14:18 +0000 Subject: [PATCH] osmo-sgsn[master]: Remove unused bsc_version.c Message-ID: Review at https://gerrit.osmocom.org/5773 Remove unused bsc_version.c Change-Id: Ib3f52c3e4cbd08b28f99d613aa18c6b00c71ead9 --- M debian/copyright M src/libcommon/Makefile.am D src/libcommon/bsc_version.c 3 files changed, 0 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/73/5773/1 diff --git a/debian/copyright b/debian/copyright index 2ae974f..8094f2a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -123,7 +123,6 @@ src/gprs/sgsn_libgtp.c src/gprs/sgsn_main.c src/gprs/sgsn_vty.c - src/libcommon/bsc_version.c src/libcommon/common_vty.c src/libcommon/debug.c src/libcommon/gsm_data.c diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 0b258c0..737265b 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -18,7 +18,6 @@ $(NULL) libcommon_a_SOURCES = \ - bsc_version.c \ common_vty.c \ debug.c \ gsm_data.c \ diff --git a/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c deleted file mode 100644 index f0369bf..0000000 --- a/src/libcommon/bsc_version.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Hold the copyright and version string */ -/* (C) 2010-2016 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include "../../bscconfig.h" - -const char *openbsc_copyright = - "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n" - "Contributions by Daniel Willmann, Jan L?bbe, Stefan Schmidt\r\n" - "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n" - "License AGPLv3+: GNU AGPL version 3 or later \r\n" - "This is free software: you are free to change and redistribute it.\r\n" - "There is NO WARRANTY, to the extent permitted by law.\r\n"; - - -- To view, visit https://gerrit.osmocom.org/5773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3f52c3e4cbd08b28f99d613aa18c6b00c71ead9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:17:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 16:17:26 +0000 Subject: [MERGED] osmo-sgsn[master]: gtphub: make rate_ctr unique In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: gtphub: make rate_ctr unique ...................................................................... gtphub: make rate_ctr unique * compute unique rate counter index when allocating new gtphub tunnel * propagate rate counter allocation error to upper layers * log and gracefully handle tunnel allocation error Change-Id: I0e07f95c36de369bcd0691b8d0fd47c844abe5da Related: OS#2757 --- M src/gprs/gtphub.c 1 file changed, 25 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 76eebb1..b0e75ca 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -879,14 +879,14 @@ ofd->cb = NULL; } -static void gtphub_bind_init(struct gtphub_bind *b) +static void gtphub_bind_init(struct gtphub_bind *b, uint32_t idx) { ZERO_STRUCT(b); INIT_LLIST_HEAD(&b->peers); b->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, - >phub_ctrg_io_desc, 0); + >phub_ctrg_io_desc, idx); OSMO_ASSERT(b->counters_io); } @@ -913,7 +913,8 @@ static void gtphub_bind_free(struct gtphub_bind *b) { OSMO_ASSERT(llist_empty(&b->peers)); - rate_ctr_group_free(b->counters_io); + if (b->counters_io) + rate_ctr_group_free(b->counters_io); } static void gtphub_bind_stop(struct gtphub_bind *b) { @@ -1107,6 +1108,14 @@ talloc_free(tun); } +#define CTR_IDX(s, p, a, b) (a + s + (p + b) * 2) + +/* rate counter index for tunnels: [3; 6] */ +#define CTR_IDX_TUN(s, p) CTR_IDX(s, p, 1, 1) + +/* rate counter index for hubs: [7; 10] */ +#define CTR_IDX_HUB(s, p) CTR_IDX(s, p, 3, 2) + static struct gtphub_tunnel *gtphub_tunnel_new() { struct gtphub_tunnel *tun; @@ -1121,8 +1130,9 @@ struct gtphub_tunnel_endpoint *te = &tun->endpoint[side_idx][plane_idx]; te->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, >phub_ctrg_io_desc, - 0); - OSMO_ASSERT(te->counters_io); + CTR_IDX_TUN(side_idx, plane_idx)); + if (!te->counters_io) + return NULL; } tun->expiry_entry.del_cb = gtphub_tunnel_del_cb; @@ -1486,7 +1496,13 @@ } /* A new tunnel. */ - p->tun = tun = gtphub_tunnel_new(); + tun = gtphub_tunnel_new(); + if (!tun) { + LOG(LOGL_ERROR, "Failed to allocate new tunnel %s <-> %s\n", + gtphub_port_str(from_ctrl), gtphub_port_str(to_ctrl)); + return -1; + } + p->tun = tun; /* Create TEI mapping */ tun->tei_repl = nr_pool_next(&hub->tei_pool); @@ -2460,7 +2476,7 @@ int side_idx; int plane_idx; for_each_side_and_plane(side_idx, plane_idx) { - gtphub_bind_init(&hub->to_gsns[side_idx][plane_idx]); + gtphub_bind_init(&hub->to_gsns[side_idx][plane_idx], CTR_IDX_HUB(side_idx, plane_idx)); } hub->to_gsns[GTPH_SIDE_SGSN][GTPH_PLANE_CTRL].label = "SGSN Ctrl"; @@ -2709,8 +2725,9 @@ } pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx, - >phub_ctrg_io_desc, 0); + >phub_ctrg_io_desc, port); if (!pp->counters_io) { + LOG(LOGL_ERROR, "Failed to allocate rate counters for %s:%u\n", gsn_addr_to_str(&a->addr), port); talloc_free(pp); return NULL; } -- To view, visit https://gerrit.osmocom.org/5524 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e07f95c36de369bcd0691b8d0fd47c844abe5da Gerrit-PatchSet: 5 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:48:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:48:18 +0000 Subject: osmo-sgsn[master]: Remove unused bsc_version.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3f52c3e4cbd08b28f99d613aa18c6b00c71ead9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:48:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:48:23 +0000 Subject: [MERGED] osmo-sgsn[master]: Remove unused bsc_version.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove unused bsc_version.c ...................................................................... Remove unused bsc_version.c Change-Id: Ib3f52c3e4cbd08b28f99d613aa18c6b00c71ead9 --- M debian/copyright M src/libcommon/Makefile.am D src/libcommon/bsc_version.c 3 files changed, 0 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/debian/copyright b/debian/copyright index 2ae974f..8094f2a 100644 --- a/debian/copyright +++ b/debian/copyright @@ -123,7 +123,6 @@ src/gprs/sgsn_libgtp.c src/gprs/sgsn_main.c src/gprs/sgsn_vty.c - src/libcommon/bsc_version.c src/libcommon/common_vty.c src/libcommon/debug.c src/libcommon/gsm_data.c diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 0b258c0..737265b 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -18,7 +18,6 @@ $(NULL) libcommon_a_SOURCES = \ - bsc_version.c \ common_vty.c \ debug.c \ gsm_data.c \ diff --git a/src/libcommon/bsc_version.c b/src/libcommon/bsc_version.c deleted file mode 100644 index f0369bf..0000000 --- a/src/libcommon/bsc_version.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Hold the copyright and version string */ -/* (C) 2010-2016 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include "../../bscconfig.h" - -const char *openbsc_copyright = - "Copyright (C) 2008-2016 Harald Welte, Holger Freyther\r\n" - "Contributions by Daniel Willmann, Jan L?bbe, Stefan Schmidt\r\n" - "Dieter Spaar, Andreas Eversberg, Sylvain Munaut, Neels Hofmeyr\r\n\r\n" - "License AGPLv3+: GNU AGPL version 3 or later \r\n" - "This is free software: you are free to change and redistribute it.\r\n" - "There is NO WARRANTY, to the extent permitted by law.\r\n"; - - -- To view, visit https://gerrit.osmocom.org/5773 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3f52c3e4cbd08b28f99d613aa18c6b00c71ead9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:48:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:48:58 +0000 Subject: osmo-pcu[master]: Fix jenkins.sh to match jenkins job axis filter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:49:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:49:28 +0000 Subject: python/osmo-python-tests[master]: Add rate counter dumper In-Reply-To: References: Message-ID: Patch Set 14: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Gerrit-PatchSet: 14 Gerrit-Project: python/osmo-python-tests 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 Fri Jan 12 16:49:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:49:30 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Add rate counter dumper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add rate counter dumper ...................................................................... Add rate counter dumper This simple tool dump all the rate counters available via ctrl interface to cvs file (or stdout). Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Fixes: OS#2550 --- M README M contrib/jenkins.sh A scripts/osmo_rate_ctr2csv.py M setup.py 4 files changed, 89 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README b/README index e85c1c4..2c04047 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ There are currently following scripts in this package: osmotestconfig.py - test that apps start/write with example configs soap.py - implementation of SOAP <-> Ctrl proxy implemented on top of Twisted +osmo_rate_ctr2csv.py - rate counter dumper on top of osmo_ipa osmo_interact_vty.py - pipe stdin/stdout to a VTY session osmo_interact_ctrl.py - pipe stdin/stdout to a CTRL port osmo_verify_transcript_vty.py - VTY testing by VTY session screen dumps diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index ac67d85..08908a4 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -16,7 +16,7 @@ rm -rf ./build PY3=python3 -PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" +PY3_LIST="osmopy scripts/osmo_ctrl.py scripts/osmo_rate_ctr2csv.py scripts/osmodumpdoc.py scripts/osmotestvty.py scripts/osmotestconfig.py scripts/osmo_interact_ctrl.py scripts/osmo_interact_vty.py scripts/osmo_verify_transcript_ctrl.py scripts/osmo_verify_transcript_vty.py scripts/soap.py scripts/twisted_ipa.py" $PY3 ./setup.py install $PY3 tests/test_py3.py for f in $PY3_LIST diff --git a/scripts/osmo_rate_ctr2csv.py b/scripts/osmo_rate_ctr2csv.py new file mode 100644 index 0000000..1e3fc9f --- /dev/null +++ b/scripts/osmo_rate_ctr2csv.py @@ -0,0 +1,86 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2017 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from osmopy.osmo_ipa import Ctrl +import socket, argparse, sys, logging, csv + +__version__ = "0.0.1" # bump this on every non-trivial change + +def connect(host, port): + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + return sck + +def get_var(sck, var): + (_, c) = Ctrl().cmd(var, None) + sck.send(c) + return Ctrl().parse_kv(sck.recv(4096)) + +def get_interval(group_name, group_counters, interval): + log.debug('Getting %s counter values: %s...' % (group_name, interval)) + (_, c) = get_var(sock, 'rate_ctr.%s.%s' % (interval, group_name)) + for ctr in c.split(';'): + if len(ctr): + (k, v) = ctr.split() + group_counters[k] = group_counters.get(k, (group_name,)) + (v,) + return len(group_counters) + + +if __name__ == '__main__': + p = argparse.ArgumentParser(description='Dump rate counters into csv via Osmocom CTRL protocol.') + p.add_argument('-v', '--version', action='version', version=("%(prog)s v" + __version__)) + p.add_argument('-p', '--port', type=int, default=4249, help="Port to use for CTRL interface, defaults to 4249") + p.add_argument('-c', '--ctrl', default='localhost', help="Adress to use for CTRL interface, defaults to localhost") + p.add_argument('-d', '--debug', action='store_true', help="Enable debug log") + p.add_argument('--header', action='store_true', help="Prepend column header to output") + p.add_argument('-o', '--output', nargs='?', type=argparse.FileType('w'), default=sys.stdout, help="Output file, defaults to stdout") + args = p.parse_args() + + log = logging.getLogger('rate_ctr2csv') + log.setLevel(logging.DEBUG if args.debug else logging.INFO) + log.addHandler(logging.StreamHandler(sys.stderr)) + + log.info('Connecting to %s:%d...' % (args.ctrl, args.port)) + sock = connect(args.ctrl, args.port) + + log.info('Getting rate counter groups info...') + (_, g) = get_var(sock, 'rate_ctr.*') + + w = csv.writer(args.output, dialect='unix') + total_groups = 0 + total_rows = 0 + + if args.header: + w.writerow(['group', 'counter', 'absolute', 'second', 'minute', 'hour', 'day']) + + for group in g.split(';'): + if len(group): + g_counters = {} + total_groups += 1 + total_rows += list(map(lambda x: get_interval(group, g_counters, x), ('abs', 'per_sec', 'per_min', 'per_hour', 'per_day')))[0] + for (k, (gr, absolute, per_sec, per_min, per_hour, per_day)) in g_counters.items(): + w.writerow([gr, k, absolute, per_sec, per_min, per_hour, per_day]) + + log.info('Completed: %d counters from %d groups received.' % (total_rows, total_groups)) diff --git a/setup.py b/setup.py index 3c12327..a8fd6e9 100755 --- a/setup.py +++ b/setup.py @@ -28,6 +28,7 @@ elif sys.version_info.major == 3: scripts = [ "scripts/osmo_ctrl.py", + "scripts/osmo_rate_ctr2csv.py", "scripts/soap.py", "scripts/twisted_ipa.py", "scripts/osmo_interact_vty.py", -- To view, visit https://gerrit.osmocom.org/5029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I12b369434e4ee9b38f92872f297e1f3d4f0698c2 Gerrit-PatchSet: 14 Gerrit-Project: python/osmo-python-tests 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 Fri Jan 12 16:50:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:50:03 +0000 Subject: osmo-pcu[master]: Don't access TBF internals in vty functions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:50:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:50:06 +0000 Subject: [MERGED] osmo-pcu[master]: Don't access TBF internals in vty functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Don't access TBF internals in vty functions ...................................................................... Don't access TBF internals in vty functions Obtain corresponding window object of UL/DL TBF by using proper accessor function instead of direct access to private member. Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950 --- M src/pcu_vty_functions.cpp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 0a80a23..001164c 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -67,7 +67,7 @@ vty_out(vty, " CS=%s", tbf->current_cs().name()); if (ul_tbf) { - gprs_rlc_ul_window *win = &ul_tbf->m_window; + gprs_rlc_ul_window *win = ul_tbf->window(); vty_out(vty, " WS=%u V(Q)=%d V(R)=%d", ul_tbf->window_size(), win->v_q(), win->v_r()); vty_out(vty, "%s", VTY_NEWLINE); @@ -79,7 +79,7 @@ } } if (dl_tbf) { - gprs_rlc_dl_window *win = &dl_tbf->m_window; + gprs_rlc_dl_window *win = dl_tbf->window(); vty_out(vty, " WS=%u V(A)=%d V(S)=%d nBSN=%d%s", dl_tbf->window_size(), win->v_a(), win->v_s(), win->resend_needed(), win->window_stalled() ? " STALLED" : ""); -- To view, visit https://gerrit.osmocom.org/5771 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I89bcd2c2b0b6f120d40d20fd43c1e516de3e3950 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:50:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:50:44 +0000 Subject: osmo-ci[master]: Fix missing OsmoPCU gerrit verification In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:52:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:52:22 +0000 Subject: osmo-ci[master]: docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh t... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb8eb04e3a5c9c5dcc9b99c83425d2604378f960 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:52:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:52:25 +0000 Subject: [MERGED] osmo-ci[master]: docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh t... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh to install ...................................................................... docker osmo jenkins: osmo-py-tests: use contrib/jenkins.sh to install No need to duplicate the install steps we have in osmo-python-tests/contrib now. Also runs the tests. Change-Id: Ibb8eb04e3a5c9c5dcc9b99c83425d2604378f960 --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 063199b..45f722f 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -41,4 +41,4 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client ADD http://git.osmocom.org/python/osmo-python-tests/patch /tmp/commit -RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && python2 ./setup.py install && python3 ./setup.py install +RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && ./contrib/jenkins.sh -- To view, visit https://gerrit.osmocom.org/5769 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibb8eb04e3a5c9c5dcc9b99c83425d2604378f960 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:53:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:53:08 +0000 Subject: osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... In-Reply-To: References: Message-ID: Patch Set 1: > WHat's the expected way to verify this? I push it to jenkins using > the jenkins job builder tools and then I retrigger a gerrit commit > to see if it works nice? Then I Verify+1 and merge it. Fine with > that? Yes -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:53:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:53:28 +0000 Subject: osmo-pcu[master]: Fix jenkins.sh to match jenkins job axis filter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:55:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:55:14 +0000 Subject: libosmocore[master]: logging-gsmtap: send only basename of source file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:55:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:55:18 +0000 Subject: [MERGED] libosmocore[master]: logging-gsmtap: send only basename of source file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: logging-gsmtap: send only basename of source file ...................................................................... logging-gsmtap: send only basename of source file GSMTAP doesn't have a lot of space for the source file name. It is better to send only the basename of the file, because only the first bit of a long path may not convey the source file at all, needing guess work from the line number. Before: "Source File Name: ../../../../src/libosmocore/src" After: "Source File Name: telnet_interface.c" Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 --- M src/logging_gsmtap.c 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging_gsmtap.c b/src/logging_gsmtap.c index ec6757c..82535ad 100644 --- a/src/logging_gsmtap.c +++ b/src/logging_gsmtap.c @@ -64,6 +64,7 @@ const char *subsys_name = log_category_name(subsys); struct timeval tv; int rc; + const char *file_basename; /* get timestamp ASAP */ osmo_gettimeofday(&tv, NULL); @@ -86,6 +87,10 @@ osmo_strlcpy(golh->subsys, subsys_name+1, sizeof(golh->subsys)); else golh->subsys[0] = '\0'; + + /* strip all leading path elements from file, if any. */ + file_basename = strrchr(file, '/'); + file = (file_basename && file_basename[1])? file_basename + 1 : file; osmo_strlcpy(golh->src_file.name, file, sizeof(golh->src_file.name)); golh->src_file.line_nr = osmo_htonl(line); golh->level = level; -- To view, visit https://gerrit.osmocom.org/5768 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie8fc9e782bcf8fa6e2e957d02e7d73c3a7c2bca8 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:55:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 16:55:22 +0000 Subject: osmo-ci[master]: Fix missing OsmoPCU gerrit verification In-Reply-To: References: Message-ID: Patch Set 1: just quoting the "yes" "no" would spare us the rest of the changes, because then everything uses "yes" "no" like it did before jjb. But since the patches are already here I'd be fine. Can you verify that it works and V+1 plz -- To view, visit https://gerrit.osmocom.org/5770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:55:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:55:52 +0000 Subject: osmo-ci[master]: Notify per email about master branch build failure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:56:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:56:03 +0000 Subject: osmo-ci[master]: Notify per email about master branch build failure In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:56:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:56:05 +0000 Subject: [MERGED] osmo-ci[master]: Notify per email about master branch build failure In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Notify per email about master branch build failure ...................................................................... Notify per email about master branch build failure Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 --- M jobs/master-builds.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: lynxis lazus: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 3e2e5fb..ca1ef80 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -308,5 +308,8 @@ resolve-relative-paths: true - trigger: project: '{obj:trigger}' + - email: + recipients: gerrit-log at lists.osmocom.org + send-to-individuals: true # vim: expandtab tabstop=2 shiftwidth=2 -- To view, visit https://gerrit.osmocom.org/5692 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0a72d36d777ba582815b2cdef8130ee88c060b54 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 12 16:58:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 12 Jan 2018 16:58:37 +0000 Subject: [ABANDON] libosmocore[master]: Deprecate old counter functions In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Deprecate old counter functions ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I604ee50b175751f5cc9416cdca1f29c355273312 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:00:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 17:00:42 +0000 Subject: [PATCH] osmo-ci[master]: README: also hint at /n/home/dub8/.config/jenkins_job_builde... Message-ID: Review at https://gerrit.osmocom.org/5774 README: also hint at /n/home/dub8/.config/jenkins_job_builder/jenkins_jobs.ini Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee --- M jobs/README.adoc 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/74/5774/1 diff --git a/jobs/README.adoc b/jobs/README.adoc index 6532825..2bc8df2 100644 --- a/jobs/README.adoc +++ b/jobs/README.adoc @@ -9,9 +9,12 @@ apt-get install jenkins-job-builder -Have a jenkins-job-builder.ini file. Convenient is to place a system wide one, -if you're the only one using the system, at /etc/jenkins_jobs/jenkins_jobs.ini; -otherwise place one in here and pass it to jenkins-jobs using the --conf file. +Have a jenkins-job-builder.ini file. One of + + ~/.config/jenkins_jobs/jenkins_jobs.ini + /etc/jenkins_jobs/jenkins_jobs.ini + +or place one in here and pass it to jenkins-jobs using the --conf file. Make sure the file not world readable to minimally safeguard your jenkins password. -- To view, visit https://gerrit.osmocom.org/5774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:02:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 12 Jan 2018 17:02:59 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 4: > yes, we need a +V vote that someone verifies that the patch works > when applied to current master. In the lack of an automatic test on > jenkins, someone should run this manually and add V+1 bump: Alexander, I assumed you could verify and add your V+1 vote? -- 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: 4 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: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:07:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:07:13 +0000 Subject: [MERGED] osmo-pcu[master]: Fix jenkins.sh to match jenkins job axis filter In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix jenkins.sh to match jenkins job axis filter ...................................................................... Fix jenkins.sh to match jenkins job axis filter The 'yes/no' values are automatically converted to True/False upon jenkins job instantiation. Let's use those directly. Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b --- M contrib/jenkins.sh 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index 05b9639..b7cfc3d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -51,9 +51,9 @@ exit 1 fi -if [ "$with_vty" = "yes" ]; then +if [ "$with_vty" = "True" ]; then PCU_CONFIG="$PCU_CONFIG --enable-vty-tests" -elif [ -z "$with_vty" -o "$with_vty" = "no" ]; then +elif [ -z "$with_vty" -o "$with_vty" = "False" ]; then echo "VTY tests disabled" else echo 'Invalid $with_vty value:' $with_vty -- To view, visit https://gerrit.osmocom.org/5772 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib2100c8345d1f07f488de8170348fec9f877dd9b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:07:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:07:25 +0000 Subject: osmo-ci[master]: Fix missing OsmoPCU gerrit verification In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:07:27 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:07:27 +0000 Subject: [MERGED] osmo-ci[master]: Fix missing OsmoPCU gerrit verification In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix missing OsmoPCU gerrit verification ...................................................................... Fix missing OsmoPCU gerrit verification The [yes, no] tuple was automatically converted to [True, False] by the jenkins-job-builder but the combination filter still used old literal check. Fix this by using boolean from the very beginning. Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b --- M jobs/gerrit-verifications.yml 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b421e34..192d0ad 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -149,15 +149,15 @@ a1_name: FIRMWARE_VERSION a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] a2_name: with_vty - a2: !!python/tuple [yes ,no] + a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] combination_filter: > - (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || - (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master") - osmo-python-tests: repos_url: 'ssh://jenkins at gerrit.osmocom.org:29418/python/{repos}' -- To view, visit https://gerrit.osmocom.org/5770 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:09:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:09:47 +0000 Subject: osmo-ci[master]: README: also hint at /n/home/dub8/.config/jenkins_job_builde... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:13:04 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:13:04 +0000 Subject: [ABANDON] osmo-pcu[master]: cosmetic: inline single-use helper In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: cosmetic: inline single-use helper ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5730 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5ec54ccd9c4bf8344fbd1dce91e8707f6b17b2f7 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 Fri Jan 12 17:28:28 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:28:28 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: log source of state transitions 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/5209 to look at the new patch set (#7). TBF: log source of state transitions We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#1759 --- 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.cpp 6 files changed, 28 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/5209/7 diff --git a/src/bts.cpp b/src/bts.cpp index 14c05f2..873af73 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -759,7 +759,7 @@ failure = true; } else { tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); @@ -1045,7 +1045,7 @@ "changed type from CCCH to PACCH\n"); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) @@ -1070,7 +1070,7 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); diff --git a/src/tbf.cpp b/src/tbf.cpp index 4878a07..a1e4392 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,7 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); + TBF_SET_ASS_ON(tbf, GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -730,7 +730,7 @@ m_n3101++; if (m_n3101 == bts->bts_data()->n3101) { LOGP(DRLCMAC, LOGL_NOTICE, " N3101 exceeded MAX (%u)\n", bts->bts_data()->n3101); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); return; } @@ -748,7 +748,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); - ul_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_RELEASING); T_START(ul_tbf, T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); return; } @@ -770,7 +770,7 @@ bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pua_poll_failed(); @@ -792,7 +792,7 @@ bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pda_poll_failed(); @@ -818,7 +818,7 @@ } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - dl_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_RELEASING); T_START(dl_tbf, T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); @@ -1109,7 +1109,7 @@ if (!dl_tbf->upgrade_to_multislot) { /* change state to FLOW, so scheduler * will start transmission */ - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); return; } @@ -1245,7 +1245,7 @@ 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); + TBF_SET_STATE(new_dl_tbf, GPRS_RLCMAC_FLOW); tbf_assign_control_ts(new_dl_tbf); /* stop pending assignment timer */ new_dl_tbf->t_stop(T0, "assignment (DL-TBF)"); @@ -1523,7 +1523,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); - ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); + TBF_SET_ASS_ON(ul_tbf, GPRS_RLCMAC_FLAG_PACCH, false); 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 6c9946e..bf6ce4c 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,9 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) +#define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) + struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -188,9 +191,9 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; - void set_state(enum gprs_rlcmac_tbf_state new_state); + void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); bool check_n_clear(uint8_t state_flag); - void set_assigned_on(uint8_t state_flag, bool check_ccch); + void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; const char *name() const; @@ -378,9 +381,9 @@ } /* Set assignment state and corrsponding flags */ -inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line) { - set_state(GPRS_RLCMAC_ASSIGN); + set_state(GPRS_RLCMAC_ASSIGN, file, line); if (check_ccch) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) state_flags |= (1 << state_flag); @@ -388,9 +391,9 @@ state_flags |= (1 << state_flag); } -inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) +inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line) { - LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 6b8eda7..5a42aa0 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,7 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); + TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -503,7 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); + TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -614,7 +614,7 @@ if (is_final) { request_dl_ack(); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); } /* dequeue next LLC frame, if any */ @@ -1109,7 +1109,7 @@ /* report all outstanding packets as received */ gprs_rlcmac_received_lost(this, received, 0); - set_state(GPRS_RLCMAC_WAIT_RELEASE); + TBF_SET_STATE(this, GPRS_RLCMAC_WAIT_RELEASE); /* start T3193 */ T_START(this, T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, @@ -1143,7 +1143,7 @@ * (partly) encoded in chunk 1 of block V(A). (optional) */ } - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); /* reset rlc states */ m_window.reset(); diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 83ac08f..eaf9c93 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -330,7 +330,7 @@ if (rdbi->cv == 0) { LOGP(DRLCMACUL, LOGL_DEBUG, "- Finished with UL " "TBF\n"); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); /* Reset N3103 counter. */ this->m_n3103 = 0; } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ac15b2c..9e21c73 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -176,7 +176,7 @@ /* "Establish" the DL TBF */ dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 17:28:51 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 12 Jan 2018 17:28:51 +0000 Subject: [ABANDON] libosmocore[master]: Expand bitvec_write_field() In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Expand bitvec_write_field() ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/4292 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iee648d764de9f3e7ef850f40864ad701c83f61db Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 12 19:13:40 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Fri, 12 Jan 2018 19:13:40 +0000 Subject: osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Patch Set 4: Verified+1 -- 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: 4 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: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 19:14:01 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Fri, 12 Jan 2018 19:14:01 +0000 Subject: [MERGED] osmo-ci[master]: Use stow for dependency management In-Reply-To: References: Message-ID: Alexander Huemer has submitted this change and it was merged. Change subject: Use stow for dependency management ...................................................................... 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(-) Approvals: Alexander Huemer: Verified Neels Hofmeyr: Looks good to me, approved Harald Welte: Looks good to me, approved diff --git a/scripts/osmo-build-dep.sh b/scripts/osmo-build-dep.sh index 6e9ef86..35cb373 100755 --- a/scripts/osmo-build-dep.sh +++ b/scripts/osmo-build-dep.sh @@ -43,6 +43,14 @@ osmo-deps.sh "$project" "$branch" cd "$project" +# 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: merged Gerrit-Change-Id: I8f5012419495a656912b7b71e4f76ce102c6b63a Gerrit-PatchSet: 5 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 From gerrit-no-reply at lists.osmocom.org Fri Jan 12 19:46:43 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 19:46:43 +0000 Subject: openbsc[master]: libmsc: add support for both comp128v2 and comp128v3 In-Reply-To: References: Message-ID: Patch Set 1: > please keep in mind that osmo-nitb is obsolete. We generally have > a policy to only apply bug-fixes, and only upon explicit request. > All development work has been at the post-NITB repositories for 1.5 > years by now. Still, this patch is trivial enough to merge it. Yes, I know. This was an explicit request from Fairwaves, because they still do use the NiTB, and this feature was required. Moreover, this is also required personally for me, because I still use exactly NiTB for the OsmocomBB / trxcon development. It's faster and simpler to run a single binary for 5 minutes of testing, than running the whole separated infrastructure... -- To view, visit https://gerrit.osmocom.org/5765 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic761be0220397d100c9e6345d4d01af4889dc7c1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 12 19:50:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 12 Jan 2018 19:50:02 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 7: > but then, all the other routines in this function > don't seem to follow that rule. Moreover, for some functions here a positive return value means 'success', while rc=0 indicates an error ;) -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From admin at opensuse.org Fri Jan 12 19:54:25 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 19:54:25 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5a591290da63d_6b2436ef5c3274e8@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 181s] You may investigate any problem if you feel able to do so, in which [ 181s] case the test suite provides a good starting point. Its output may [ 181s] be found below `tests/testsuite.dir'. [ 181s] [ 181s] Makefile:678: recipe for target 'check-local' failed [ 181s] make[4]: *** [check-local] Error 1 [ 181s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 181s] Makefile:538: recipe for target 'check-am' failed [ 181s] make[3]: *** [check-am] Error 2 [ 181s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 181s] Makefile:390: recipe for target 'check-recursive' failed [ 181s] make[2]: *** [check-recursive] Error 1 [ 181s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 181s] Makefile:500: recipe for target 'check-recursive' failed [ 181s] make[1]: *** [check-recursive] Error 1 [ 181s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 181s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 181s] debian/rules:6: recipe for target 'build' failed [ 181s] make: *** [build] Error 2 [ 181s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 181s] [ 181s] lamb18 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:54:14 UTC 2018. [ 181s] [ 181s] ### VM INTERACTION START ### [ 184s] [ 175.378104] reboot: Power down [ 184s] ### VM INTERACTION END ### [ 184s] [ 184s] lamb18 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:54:17 UTC 2018. [ 184s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jan 12 19:54:25 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 19:54:25 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5a5912909c8b5_6b2436ef5c3273fa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 193s] You may investigate any problem if you feel able to do so, in which [ 193s] case the test suite provides a good starting point. Its output may [ 193s] be found below `tests/testsuite.dir'. [ 193s] [ 193s] Makefile:678: recipe for target 'check-local' failed [ 193s] make[4]: *** [check-local] Error 1 [ 193s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 193s] Makefile:538: recipe for target 'check-am' failed [ 193s] make[3]: *** [check-am] Error 2 [ 193s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 193s] Makefile:390: recipe for target 'check-recursive' failed [ 193s] make[2]: *** [check-recursive] Error 1 [ 193s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 193s] Makefile:500: recipe for target 'check-recursive' failed [ 193s] make[1]: *** [check-recursive] Error 1 [ 193s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 193s] dh_auto_test: make -j1 check returned exit code 2 [ 193s] debian/rules:6: recipe for target 'build' failed [ 193s] make: *** [build] Error 2 [ 193s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 193s] [ 193s] lamb01 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:54:13 UTC 2018. [ 193s] [ 193s] ### VM INTERACTION START ### [ 196s] [ 187.915462] reboot: Power down [ 196s] ### VM INTERACTION END ### [ 196s] [ 196s] lamb01 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:54:16 UTC 2018. [ 196s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jan 12 19:54:42 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 19:54:42 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5a59129196d66_6b2436ef5c327573@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 189s] case the test suite provides a good starting point. Its output may [ 189s] be found below `tests/testsuite.dir'. [ 189s] [ 189s] Makefile:664: recipe for target 'check-local' failed [ 189s] make[4]: *** [check-local] Error 1 [ 189s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 189s] Makefile:526: recipe for target 'check-am' failed [ 189s] make[3]: *** [check-am] Error 2 [ 189s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 189s] Makefile:378: recipe for target 'check-recursive' failed [ 189s] make[2]: *** [check-recursive] Error 1 [ 189s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 189s] Makefile:488: recipe for target 'check-recursive' failed [ 189s] make[1]: *** [check-recursive] Error 1 [ 189s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 189s] dh_auto_test: make -j1 check returned exit code 2 [ 189s] debian/rules:6: recipe for target 'build' failed [ 189s] make: *** [build] Error 2 [ 189s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 189s] [ 189s] lamb59 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:54:34 UTC 2018. [ 189s] [ 189s] ### VM INTERACTION START ### [ 190s] Powering off. [ 190s] [ 182.529445] reboot: Power down [ 190s] ### VM INTERACTION END ### [ 190s] [ 190s] lamb59 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:54:36 UTC 2018. [ 190s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jan 12 19:55:16 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 19:55:16 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5a5912ad546fc_6b2436ef5c3276bd@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 203s] You may investigate any problem if you feel able to do so, in which [ 203s] case the test suite provides a good starting point. Its output may [ 203s] be found below `tests/testsuite.dir'. [ 203s] [ 203s] Makefile:678: recipe for target 'check-local' failed [ 203s] make[4]: *** [check-local] Error 1 [ 203s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 203s] Makefile:538: recipe for target 'check-am' failed [ 203s] make[3]: *** [check-am] Error 2 [ 203s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 203s] Makefile:390: recipe for target 'check-recursive' failed [ 203s] make[2]: *** [check-recursive] Error 1 [ 203s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 203s] Makefile:500: recipe for target 'check-recursive' failed [ 203s] make[1]: *** [check-recursive] Error 1 [ 203s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 203s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 203s] debian/rules:6: recipe for target 'build' failed [ 203s] make: *** [build] Error 2 [ 203s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 203s] [ 203s] lamb72 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:55:11 UTC 2018. [ 203s] [ 203s] ### VM INTERACTION START ### [ 206s] [ 196.561692] reboot: Power down [ 206s] ### VM INTERACTION END ### [ 206s] [ 206s] lamb72 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:55:14 UTC 2018. [ 206s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jan 12 19:57:51 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 19:57:51 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5a591342bd792_6b2436ef5c3280df@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 340s] You may investigate any problem if you feel able to do so, in which [ 340s] case the test suite provides a good starting point. Its output may [ 340s] be found below `tests/testsuite.dir'. [ 340s] [ 340s] Makefile:678: recipe for target 'check-local' failed [ 340s] make[4]: *** [check-local] Error 1 [ 340s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 340s] Makefile:538: recipe for target 'check-am' failed [ 340s] make[3]: *** [check-am] Error 2 [ 340s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 340s] Makefile:390: recipe for target 'check-recursive' failed [ 340s] make[2]: *** [check-recursive] Error 1 [ 340s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 340s] Makefile:500: recipe for target 'check-recursive' failed [ 340s] make[1]: *** [check-recursive] Error 1 [ 340s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 340s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 340s] debian/rules:6: recipe for target 'build' failed [ 340s] make: *** [build] Error 2 [ 340s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 340s] [ 340s] cloud122 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:57:34 UTC 2018. [ 340s] [ 340s] ### VM INTERACTION START ### [ 344s] [ 309.824080] reboot: Power down [ 344s] ### VM INTERACTION END ### [ 344s] [ 344s] cloud122 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 19:57:38 UTC 2018. [ 344s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jan 12 20:08:42 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 20:08:42 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <5a5915d7df410_6b2436ef5c330930@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/aarch64 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 408s] case the test suite provides a good starting point. Its output may [ 408s] be found below `tests/testsuite.dir'. [ 408s] [ 408s] Makefile:678: recipe for target 'check-local' failed [ 408s] make[4]: *** [check-local] Error 1 [ 408s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 408s] Makefile:538: recipe for target 'check-am' failed [ 408s] make[3]: *** [check-am] Error 2 [ 408s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 408s] Makefile:390: recipe for target 'check-recursive' failed [ 408s] make[2]: *** [check-recursive] Error 1 [ 408s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 408s] Makefile:500: recipe for target 'check-recursive' failed [ 408s] make[1]: *** [check-recursive] Error 1 [ 408s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 408s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 408s] debian/rules:6: recipe for target 'build' failed [ 408s] make: *** [build] Error 2 [ 408s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 408s] [ 408s] armbuild24 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 20:08:32 UTC 2018. [ 408s] [ 408s] ### VM INTERACTION START ### [ 411s] [ 397.674862] SysRq : Power Off [ 411s] [ 397.675971] reboot: Power down [ 411s] ### VM INTERACTION END ### [ 411s] [ 411s] armbuild24 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 20:08:35 UTC 2018. [ 411s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Fri Jan 12 20:22:41 2018 From: admin at opensuse.org (OBS Notification) Date: Fri, 12 Jan 2018 20:22:41 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5a5919211488_6b2436ef5c337498@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 429s] case the test suite provides a good starting point. Its output may [ 429s] be found below `tests/testsuite.dir'. [ 429s] [ 429s] Makefile:678: recipe for target 'check-local' failed [ 429s] make[4]: *** [check-local] Error 1 [ 429s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 429s] Makefile:538: recipe for target 'check-am' failed [ 429s] make[3]: *** [check-am] Error 2 [ 429s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 429s] Makefile:390: recipe for target 'check-recursive' failed [ 429s] make[2]: *** [check-recursive] Error 1 [ 429s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 429s] Makefile:500: recipe for target 'check-recursive' failed [ 429s] make[1]: *** [check-recursive] Error 1 [ 429s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 429s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 429s] debian/rules:6: recipe for target 'build' failed [ 429s] make: *** [build] Error 2 [ 429s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 429s] [ 429s] armbuild02 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 20:22:33 UTC 2018. [ 429s] [ 429s] ### VM INTERACTION START ### [ 432s] [ 403.996262] SysRq : Power Off [ 432s] [ 404.017696] reboot: Power down [ 432s] ### VM INTERACTION END ### [ 432s] [ 432s] armbuild02 failed "build osmo-trx_0.2.0.20180112.dsc" at Fri Jan 12 20:22:36 UTC 2018. [ 432s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:46:37 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:46:37 +0000 Subject: [MERGED] pysim[master]: Fix comment: Ki -> OPC In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: Fix comment: Ki -> OPC ...................................................................... Fix comment: Ki -> OPC Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a --- M pySim-prog.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/pySim-prog.py b/pySim-prog.py index 3df18ba..728949e 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -367,7 +367,7 @@ else: ki = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]) - # Ki (random) + # OPC (random) if opts.opc is not None: opc = opts.opc if not re.match('^[0-9a-fA-F]{32}$', opc): -- To view, visit https://gerrit.osmocom.org/5713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I566cf7bc658c730b4381c0f145bfc4f805cca42a Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:48:54 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:48:54 +0000 Subject: pysim[master]: ts_51_011: A file with MF/DF/EF constants from TS 51 011 In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:49:02 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:49:02 +0000 Subject: [MERGED] pysim[master]: ts_51_011: A file with MF/DF/EF constants from TS 51 011 In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: ts_51_011: A file with MF/DF/EF constants from TS 51 011 ...................................................................... ts_51_011: A file with MF/DF/EF constants from TS 51 011 pySim has been using magic numbers to access various files which makes it hard to read, maintain and extend. With this file in place we can start replacing all those magic numbers with human readable names lile EF['IMSI'] instead of ['3F00', '7F20', '6F07']. Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 --- A pySim/ts_51_011.py 1 file changed, 251 insertions(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py new file mode 100644 index 0000000..754d57f --- /dev/null +++ b/pySim/ts_51_011.py @@ -0,0 +1,251 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- + +""" Various constants from ETSI TS 151.011 +""" + +# +# Copyright (C) 2017 Alexander.Chemeris +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# + +MF_num = '3F00' + +DF_num = { +'TELECOM': '7F10', + +'GSM': '7F20', +'IS-41': '7F22', +'FP-CTS': '7F23', + +'GRAPHICS': '5F50', + +'IRIDIUM': '5F30', +'GLOBST': '5F31', +'ICO': '5F32', +'ACeS': '5F33', + +'EIA/TIA-553': '5F40', +'CTS': '5F60', +'SOLSA': '5F70', + +'MExE': '5F3C', +} + +EF_num = { +# MF +'ICCID': '2FE2', +'ELP': '2F05', + +# DF_TELECOM +'ADN': '6F3A', +'FDN': '6F3B', +'SMS': '6F3C', +'CCP': '6F3D', +'MSISDN': '6F40', +'SMSP': '6F42', +'SMSS': '6F43', +'LND': '6F44', +'SMSR': '6F47', +'SDN': '6F49', +'EXT1': '6F4A', +'EXT2': '6F4B', +'EXT3': '6F4C', +'BDN': '6F4D', +'EXT4': '6F4E', +'CMI': '6F58', +'ECCP': '6F4F', + +# DF_GRAPHICS +'IMG': '4F20', + +# DF_SoLSA +'SAI': '4F30', +'SLL': '4F31', + +# DF_MExE +'MExE-ST': '4F40', +'ORPK': '4F41', +'ARPK': '4F42', +'TPRPK': '4F43', + +# DF_GSM +'LP': '6F05', +'IMSI': '6F07', +'Kc': '6F20', +'DCK': '6F2C', +'PLMNsel': '6F30', +'HPPLMN': '6F31', +'CNL': '6F32', +'ACMmax': '6F37', +'SST': '6F38', +'ACM': '6F39', +'GID1': '6F3E', +'GID2': '6F3F', +'PUCT': '6F41', +'CBMI': '6F45', +'SPN': '6F46', +'CBMID': '6F48', +'BCCH': '6F74', +'ACC': '6F78', +'FPLMN': '6F7B', +'LOCI': '6F7E', +'AD': '6FAD', +'PHASE': '6FAE', +'VGCS': '6FB1', +'VGCSS': '6FB2', +'VBS': '6FB3', +'VBSS': '6FB4', +'eMLPP': '6FB5', +'AAeM': '6FB6', +'ECC': '6FB7', +'CBMIR': '6F50', +'NIA': '6F51', +'KcGPRS': '6F52', +'LOCIGPRS': '6F53', +'SUME': '6F54', +'PLMNwAcT': '6F60', +'OPLMNwAcT': '6F61', +# Figure 8 names it HPLMNAcT, but in the text it's names it HPLMNwAcT +'HPLMNAcT': '6F62', +'HPLMNwAcT': '6F62', +'CPBCCH': '6F63', +'INVSCAN': '6F64', +'PNN': '6FC5', +'OPL': '6FC6', +'MBDN': '6FC7', +'EXT6': '6FC8', +'MBI': '6FC9', +'MWIS': '6FCA', +'CFIS': '6FCB', +'EXT7': '6FCC', +'SPDI': '6FCD', +'MMSN': '6FCE', +'EXT8': '6FCF', +'MMSICP': '6FD0', +'MMSUP': '6FD1', +'MMSUCP': '6FD2', +} + +DF = { +'TELECOM': [MF_num, DF_num['TELECOM']], + +'GSM': [MF_num, DF_num['GSM']], +'IS-41': [MF_num, DF_num['IS-41']], +'FP-CTS': [MF_num, DF_num['FP-CTS']], + +'GRAPHICS': [MF_num, DF_num['GRAPHICS']], + +'IRIDIUM': [MF_num, DF_num['IRIDIUM']], +'GLOBST': [MF_num, DF_num['GLOBST']], +'ICO': [MF_num, DF_num['ICO']], +'ACeS': [MF_num, DF_num['ACeS']], + +'EIA/TIA-553': [MF_num, DF_num['EIA/TIA-553']], +'CTS': [MF_num, DF_num['CTS']], +'SoLSA': [MF_num, DF_num['SOLSA']], + +'MExE': [MF_num, DF_num['MExE']], +} + + +EF = { +'ICCID': [MF_num, EF_num['ICCID']], +'ELP': [MF_num, EF_num['ELP']], + +'ADN': DF['TELECOM']+[EF_num['ADN']], +'FDN': DF['TELECOM']+[EF_num['FDN']], +'SMS': DF['TELECOM']+[EF_num['SMS']], +'CCP': DF['TELECOM']+[EF_num['CCP']], +'MSISDN': DF['TELECOM']+[EF_num['MSISDN']], +'SMSP': DF['TELECOM']+[EF_num['SMSP']], +'SMSS': DF['TELECOM']+[EF_num['SMSS']], +'LND': DF['TELECOM']+[EF_num['LND']], +'SMSR': DF['TELECOM']+[EF_num['SMSR']], +'SDN': DF['TELECOM']+[EF_num['SDN']], +'EXT1': DF['TELECOM']+[EF_num['EXT1']], +'EXT2': DF['TELECOM']+[EF_num['EXT2']], +'EXT3': DF['TELECOM']+[EF_num['EXT3']], +'BDN': DF['TELECOM']+[EF_num['BDN']], +'EXT4': DF['TELECOM']+[EF_num['EXT4']], +'CMI': DF['TELECOM']+[EF_num['CMI']], +'ECCP': DF['TELECOM']+[EF_num['ECCP']], + +'IMG': DF['GRAPHICS']+[EF_num['IMG']], + +'SAI': DF['SoLSA']+[EF_num['SAI']], +'SLL': DF['SoLSA']+[EF_num['SLL']], + +'MExE-ST': DF['MExE']+[EF_num['MExE-ST']], +'ORPK': DF['MExE']+[EF_num['ORPK']], +'ARPK': DF['MExE']+[EF_num['ARPK']], +'TPRPK': DF['MExE']+[EF_num['TPRPK']], + +'LP': DF['GSM']+[EF_num['LP']], +'IMSI': DF['GSM']+[EF_num['IMSI']], +'Kc': DF['GSM']+[EF_num['Kc']], +'DCK': DF['GSM']+[EF_num['DCK']], +'PLMNsel': DF['GSM']+[EF_num['PLMNsel']], +'HPPLMN': DF['GSM']+[EF_num['HPPLMN']], +'CNL': DF['GSM']+[EF_num['CNL']], +'ACMmax': DF['GSM']+[EF_num['ACMmax']], +'SST': DF['GSM']+[EF_num['SST']], +'ACM': DF['GSM']+[EF_num['ACM']], +'GID1': DF['GSM']+[EF_num['GID1']], +'GID2': DF['GSM']+[EF_num['GID2']], +'PUCT': DF['GSM']+[EF_num['PUCT']], +'CBMI': DF['GSM']+[EF_num['CBMI']], +'SPN': DF['GSM']+[EF_num['SPN']], +'CBMID': DF['GSM']+[EF_num['CBMID']], +'BCCH': DF['GSM']+[EF_num['BCCH']], +'ACC': DF['GSM']+[EF_num['ACC']], +'FPLMN': DF['GSM']+[EF_num['FPLMN']], +'LOCI': DF['GSM']+[EF_num['LOCI']], +'AD': DF['GSM']+[EF_num['AD']], +'PHASE': DF['GSM']+[EF_num['PHASE']], +'VGCS': DF['GSM']+[EF_num['VGCS']], +'VGCSS': DF['GSM']+[EF_num['VGCSS']], +'VBS': DF['GSM']+[EF_num['VBS']], +'VBSS': DF['GSM']+[EF_num['VBSS']], +'eMLPP': DF['GSM']+[EF_num['eMLPP']], +'AAeM': DF['GSM']+[EF_num['AAeM']], +'ECC': DF['GSM']+[EF_num['ECC']], +'CBMIR': DF['GSM']+[EF_num['CBMIR']], +'NIA': DF['GSM']+[EF_num['NIA']], +'KcGPRS': DF['GSM']+[EF_num['KcGPRS']], +'LOCIGPRS': DF['GSM']+[EF_num['LOCIGPRS']], +'SUME': DF['GSM']+[EF_num['SUME']], +'PLMNwAcT': DF['GSM']+[EF_num['PLMNwAcT']], +'OPLMNwAcT': DF['GSM']+[EF_num['OPLMNwAcT']], +# Figure 8 names it HPLMNAcT, but in the text it's names it HPLMNwAcT +'HPLMNAcT': DF['GSM']+[EF_num['HPLMNAcT']], +'HPLMNwAcT': DF['GSM']+[EF_num['HPLMNAcT']], +'CPBCCH': DF['GSM']+[EF_num['CPBCCH']], +'INVSCAN': DF['GSM']+[EF_num['INVSCAN']], +'PNN': DF['GSM']+[EF_num['PNN']], +'OPL': DF['GSM']+[EF_num['OPL']], +'MBDN': DF['GSM']+[EF_num['MBDN']], +'EXT6': DF['GSM']+[EF_num['EXT6']], +'MBI': DF['GSM']+[EF_num['MBI']], +'MWIS': DF['GSM']+[EF_num['MWIS']], +'CFIS': DF['GSM']+[EF_num['CFIS']], +'EXT7': DF['GSM']+[EF_num['EXT7']], +'SPDI': DF['GSM']+[EF_num['SPDI']], +'MMSN': DF['GSM']+[EF_num['MMSN']], +'EXT8': DF['GSM']+[EF_num['EXT8']], +'MMSICP': DF['GSM']+[EF_num['MMSICP']], +'MMSUP': DF['GSM']+[EF_num['MMSUP']], +'MMSUCP': DF['GSM']+[EF_num['MMSUCP']], +} -- To view, visit https://gerrit.osmocom.org/5714 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38f5d36d16b41b5d516a6a3e2ec1d09637883932 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:49:22 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:49:22 +0000 Subject: pysim[master]: utils: Functions to encode/decode EF SPN. In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:49:34 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:49:34 +0000 Subject: [MERGED] pysim[master]: utils: Functions to encode/decode EF SPN. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: utils: Functions to encode/decode EF SPN. ...................................................................... utils: Functions to encode/decode EF SPN. According to TS 51 011. Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334 --- M pySim/utils.py 1 file changed, 19 insertions(+), 0 deletions(-) Approvals: Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/utils.py b/pySim/utils.py index 84b613f..8463581 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -34,6 +34,12 @@ def i2h(s): return ''.join(['%02x'%(x) for x in s]) +def h2s(s): + return ''.join([chr((int(x,16)<<4)+int(y,16)) for x,y in zip(s[0::2], s[1::2]) if not (x == 'f' and y == 'f') ]) + +def s2h(s): + return b2h(s) + def swap_nibbles(s): return ''.join([x+y for x,y in zip(s[1::2], s[0::2])]) @@ -73,3 +79,16 @@ def enc_plmn(mcc, mnc): """Converts integer MCC/MNC into 6 bytes for EF""" return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3)) + +def dec_spn(ef): + byte1 = int(ef[0:2]) + hplmn_disp = (byte1&0x01 == 0x01) + oplmn_disp = (byte1&0x02 == 0x02) + name = h2s(ef[2:]) + return (name, hplmn_disp, oplmn_disp) + +def enc_spn(name, hplmn_disp=False, oplmn_disp=False): + byte1 = 0x00 + if hplmn_disp: byte1 = byte1|0x01 + if oplmn_disp: byte1 = byte1|0x02 + return i2h([byte1])+s2h(name) -- To view, visit https://gerrit.osmocom.org/5715 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida184bc5c81cc8c228b8981b703f77d017e53334 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:49:43 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:49:43 +0000 Subject: pysim[master]: utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 11:49:48 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 11:49:48 +0000 Subject: [MERGED] pysim[master]: utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 ...................................................................... utils: Fix documentation. 3+3=6 digits equals 3 bytes, not 6 Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 --- M pySim/utils.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/utils.py b/pySim/utils.py index 8463581..43d52dd 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -77,7 +77,7 @@ return swap_nibbles(rpad(iccid, 20)) def enc_plmn(mcc, mnc): - """Converts integer MCC/MNC into 6 bytes for EF""" + """Converts integer MCC/MNC into 3 bytes for EF""" return swap_nibbles(lpad('%d' % mcc, 3) + lpad('%d' % mnc, 3)) def dec_spn(ef): -- To view, visit https://gerrit.osmocom.org/5716 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2722d788a69976e1c64a9caf6cf3049af27f9a30 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 14:23:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Jan 2018 14:23:07 +0000 Subject: pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 14:25:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 13 Jan 2018 14:25:08 +0000 Subject: osmo-ci[master]: README: also hint at /n/home/dub8/.config/jenkins_job_builde... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:24:51 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:24:51 +0000 Subject: pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:24:57 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:24:57 +0000 Subject: pysim[master]: cards: Extend Card class with access functions for some of t... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:04 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:04 +0000 Subject: pysim[master]: pySim-prog: ADM code can be longer 8 digits, it's implementa... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:12 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:12 +0000 Subject: pysim[master]: pySim-prog: Replace magic numbers with a readable EF file name. In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:18 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:18 +0000 Subject: pysim[master]: cards: Implement card type autodetection based on ATR. In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:30 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:30 +0000 Subject: pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 3 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:39 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:39 +0000 Subject: pysim[master]: Make derive_milenage_opc and calculate_luhn publicly availab... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:53 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:53 +0000 Subject: [MERGED] pysim[master]: Make derive_milenage_opc and calculate_luhn publicly availab... In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: Make derive_milenage_opc and calculate_luhn publicly available through utils.py ...................................................................... Make derive_milenage_opc and calculate_luhn publicly available through utils.py Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01 --- M pySim-prog.py M pySim/utils.py 2 files changed, 22 insertions(+), 19 deletions(-) Approvals: Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim-prog.py b/pySim-prog.py index 44ca1fd..c08f43b 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -39,7 +39,7 @@ from pySim.commands import SimCardCommands from pySim.cards import _cards_classes -from pySim.utils import h2b, swap_nibbles, rpad +from pySim.utils import h2b, swap_nibbles, rpad, derive_milenage_opc, calculate_luhn def parse_options(): @@ -233,24 +233,6 @@ out.append(chr(x)) return ''.join(out) - -def calculate_luhn(cc): - num = map(int, str(cc)) - check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in num[::-2]]) % 10 - return 0 if check_digit == 10 else check_digit - -def derive_milenage_opc(ki_hex, op_hex): - """ - Run the milenage algorithm. - """ - from Crypto.Cipher import AES - from Crypto.Util.strxor import strxor - from pySim.utils import b2h - - # We pass in hex string and now need to work on bytes - aes = AES.new(h2b(ki_hex)) - opc_bytes = aes.encrypt(h2b(op_hex)) - return b2h(strxor(opc_bytes, h2b(op_hex))) def gen_parameters(opts): """Generates Name, ICCID, MCC, MNC, IMSI, SMSP, Ki, PIN-ADM from the diff --git a/pySim/utils.py b/pySim/utils.py index 43d52dd..17dc693 100644 --- a/pySim/utils.py +++ b/pySim/utils.py @@ -92,3 +92,24 @@ if hplmn_disp: byte1 = byte1|0x01 if oplmn_disp: byte1 = byte1|0x02 return i2h([byte1])+s2h(name) + +def derive_milenage_opc(ki_hex, op_hex): + """ + Run the milenage algorithm to calculate OPC from Ki and OP + """ + from Crypto.Cipher import AES + from Crypto.Util.strxor import strxor + from pySim.utils import b2h + + # We pass in hex string and now need to work on bytes + aes = AES.new(h2b(ki_hex)) + opc_bytes = aes.encrypt(h2b(op_hex)) + return b2h(strxor(opc_bytes, h2b(op_hex))) + +def calculate_luhn(cc): + """ + Calculate Luhn checksum used in e.g. ICCID and IMEI + """ + num = map(int, str(cc)) + check_digit = 10 - sum(num[-2::-2] + [sum(divmod(d * 2, 10)) for d in num[::-2]]) % 10 + return 0 if check_digit == 10 else check_digit -- To view, visit https://gerrit.osmocom.org/5745 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2effc85fd55da0981de0ada74dcb28b7e8e56a01 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:53 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:53 +0000 Subject: [MERGED] pysim[master]: cards: Add Fairwaves SIM implementation. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: cards: Add Fairwaves SIM implementation. ...................................................................... cards: Add Fairwaves SIM implementation. Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b --- M pySim/cards.py 1 file changed, 145 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/cards.py b/pySim/cards.py index 046766e..e324857 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -539,15 +539,158 @@ r = self._scc.select_file(['3f00', '7f10']) data, sw = self._scc.update_record('6f42', 1, lpad(p['smsp'], 104), force_len=True) + def erase(self): + return + + +class FairwavesSIM(Card): + """ + FairwavesSIM + + The SIM card is operating according to the standard. + For Ki/OP/OPC programming the following files are additionally open for writing: + 3F00/7F20/FF01 ? OP/OPC: + byte 1 = 0x01, bytes 2-17: OPC; + byte 1 = 0x00, bytes 2-17: OP; + 3F00/7F20/FF02: Ki + """ + + name = 'Fairwaves SIM' + # Propriatary files + _EF_num = { + 'Ki': 'FF02', + 'OP/OPC': 'FF01', + } + _EF = { + 'Ki': DF['GSM']+[_EF_num['Ki']], + 'OP/OPC': DF['GSM']+[_EF_num['OP/OPC']], + } + + def __init__(self, ssc): + super(FairwavesSIM, self).__init__(ssc) + self._adm_chv_num = 0x11 + self._adm2_chv_num = 0x12 + + + @classmethod + def autodetect(kls, scc): + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 44 22 06 10 00 00 01 A9"): + return kls(scc) + except: + return None + return None + + + def verify_adm2(self, key): + ''' + Authenticate with ADM2 key. + + Fairwaves SIM cards support hierarchical key structure and ADM2 key + is a key which has access to proprietary files (Ki and OP/OPC). + That said, ADM key inherits permissions of ADM2 key and thus we rarely + need ADM2 key per se. + ''' + (res, sw) = self._scc.verify_chv(self._adm2_chv_num, key) + return sw + + + def read_ki(self): + """ + Read Ki in proprietary file. + + Requires ADM1 access level + """ + return self._scc.read_binary(self._EF['Ki']) + + + def update_ki(self, ki): + """ + Set Ki in proprietary file. + + Requires ADM1 access level + """ + data, sw = self._scc.update_binary(self._EF['Ki'], ki) + return sw + + + def read_op_opc(self): + """ + Read Ki in proprietary file. + + Requires ADM1 access level + """ + (ef, sw) = self._scc.read_binary(self._EF['OP/OPC']) + type = 'OP' if ef[0:2] == '00' else 'OPC' + return ((type, ef[2:]), sw) + + + def update_op(self, op): + """ + Set OP in proprietary file. + + Requires ADM1 access level + """ + content = '00' + op + data, sw = self._scc.update_binary(self._EF['OP/OPC'], content) + return sw + + + def update_opc(self, opc): + """ + Set OPC in proprietary file. + + Requires ADM1 access level + """ + content = '01' + opc + data, sw = self._scc.update_binary(self._EF['OP/OPC'], content) + return sw + + + def program(self, p): + # authenticate as ADM1 + if not p['pin_adm']: + raise ValueError("Please provide a PIN-ADM as there is no default one") + sw = self.verify_adm(h2b(p['pin_adm'])) + if sw != '9000': + raise RuntimeError('Failed to authenticate with ADM key %s'%(p['pin_adm'],)) + + # TODO: Set operator name + if p.get('smsp') is not None: + sw = self.update_smsp(p['smsp']) + if sw != '9000': + print("Programming SMSP failed with code %s"%sw) + # This SIM doesn't support changing ICCID + if p.get('mcc') is not None and p.get('mnc') is not None: + sw = self.update_hplmn_act(p['mcc'], p['mnc']) + if sw != '9000': + print("Programming MCC/MNC failed with code %s"%sw) + if p.get('imsi') is not None: + sw = self.update_imsi(p['imsi']) + if sw != '9000': + print("Programming IMSI failed with code %s"%sw) + if p.get('ki') is not None: + sw = self.update_ki(p['ki']) + if sw != '9000': + print("Programming Ki failed with code %s"%sw) + if p.get('opc') is not None: + sw = self.update_opc(p['opc']) + if sw != '9000': + print("Programming OPC failed with code %s"%sw) + if p.get('acc') is not None: + sw = self.update_acc(p['acc']) + if sw != '9000': + print("Programming ACC failed with code %s"%sw) def erase(self): return - # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, - SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1 ] + SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1, + FairwavesSIM ] def card_autodetect(scc): for kls in _cards_classes: -- To view, visit https://gerrit.osmocom.org/5722 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia10ac433d3b0482bdf727c31f65a10042152797b Gerrit-PatchSet: 3 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:53 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:53 +0000 Subject: [MERGED] pysim[master]: cards: Implement card type autodetection based on ATR. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: cards: Implement card type autodetection based on ATR. ...................................................................... cards: Implement card type autodetection based on ATR. Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 --- M pySim/cards.py 1 file changed, 21 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/cards.py b/pySim/cards.py index db63d2b..046766e 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -25,6 +25,7 @@ from pySim.ts_51_011 import EF, DF from pySim.utils import * +from smartcard.util import toBytes class Card(object): @@ -418,7 +419,12 @@ @classmethod def autodetect(kls, scc): - # TODO: look for ATR 3B 7D 94 00 00 55 55 53 0A 74 86 93 0B 24 7C 4D 54 68 + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 7D 94 00 00 55 55 53 0A 74 86 93 0B 24 7C 4D 54 68"): + return kls(scc) + except: + return None return None def program(self, p): @@ -494,7 +500,12 @@ @classmethod def autodetect(kls, scc): - # TODO: look for ATR 3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 43 20 07 18 00 00 01 A5 + try: + # Look for ATR + if scc.get_atr() == toBytes("3B 9F 96 80 1F C7 80 31 A0 73 BE 21 13 67 43 20 07 18 00 00 01 A5"): + return kls(scc) + except: + return None return None def program(self, p): @@ -537,3 +548,11 @@ # In order for autodetection ... _cards_classes = [ FakeMagicSim, SuperSim, MagicSim, GrcardSim, SysmoSIMgr1, SysmoSIMgr2, SysmoUSIMgr1, SysmoUSIMSJS1 ] + +def card_autodetect(scc): + for kls in _cards_classes: + card = kls.autodetect(scc) + if card is not None: + card.reset() + return card + return None -- To view, visit https://gerrit.osmocom.org/5721 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1099a96626c0ce74243b47a8fdfa25b0d76a1ef3 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:54 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:54 +0000 Subject: [MERGED] pysim[master]: pySim-prog: Replace magic numbers with a readable EF file name. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: pySim-prog: Replace magic numbers with a readable EF file name. ...................................................................... pySim-prog: Replace magic numbers with a readable EF file name. Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af --- M pySim-prog.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim-prog.py b/pySim-prog.py index 2177d8c..44ca1fd 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -618,7 +618,7 @@ # Connect transport print "Insert card now (or CTRL-C to cancel)" sl.wait_for_card(newcardonly=not first) - (res,_) = scc.read_binary(['3f00', '7f20', '6f07']) + (res,_) = scc.read_binary(EF['IMSI']) imsi = swap_nibbles(res)[3:] else: imsi = opts.imsi -- To view, visit https://gerrit.osmocom.org/5720 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibda7d5a4132971e884f6d760baf20cd33025a2af Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:54 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:54 +0000 Subject: [MERGED] pysim[master]: pySim-prog: ADM code can be longer 8 digits, it's implementa... In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: pySim-prog: ADM code can be longer 8 digits, it's implementation specific. ...................................................................... pySim-prog: ADM code can be longer 8 digits, it's implementation specific. E.g. Fairwaves SIM cards have longer ADM codes. Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b --- M pySim-prog.py 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim-prog.py b/pySim-prog.py index 728949e..2177d8c 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -379,10 +379,9 @@ opc = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]) if opts.pin_adm is not None: - if len(opts.pin_adm) > 8: - raise ValueError("PIN-ADM needs to be <=8 digits") - pin_adm = ''.join(['%02x'%(ord(x)) for x in opts.pin_adm]) - pin_adm = rpad(pin_adm, 16) + pin_adm = opts.pin_adm + if not re.match('^([0-9a-fA-F][0-9a-fA-F])+$', pin_adm): + raise ValueError('ADM pin needs to be in hex format (even number of hex digits)') else: pin_adm = None -- To view, visit https://gerrit.osmocom.org/5719 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I87d61764eeba4bcf7525ee4778cb8f244930db9b Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:54 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:54 +0000 Subject: [MERGED] pysim[master]: cards: Extend Card class with access functions for some of t... In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: cards: Extend Card class with access functions for some of the standard EF files. ...................................................................... cards: Extend Card class with access functions for some of the standard EF files. Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 --- M pySim/cards.py 1 file changed, 67 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/cards.py b/pySim/cards.py index 9f678ab..db63d2b 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -7,6 +7,7 @@ # # Copyright (C) 2009-2010 Sylvain Munaut # Copyright (C) 2011 Harald Welte +# Copyright (C) 2017 Alexander.Chemeris # # 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 @@ -22,17 +23,81 @@ # along with this program. If not, see . # -from pySim.utils import b2h, h2b, swap_nibbles, rpad, lpad, enc_imsi, enc_iccid, enc_plmn - +from pySim.ts_51_011 import EF, DF +from pySim.utils import * class Card(object): def __init__(self, scc): self._scc = scc + self._adm_chv_num = 4 def reset(self): self._scc.reset_card() + def verify_adm(self, key): + ''' + Authenticate with ADM key + ''' + (res, sw) = self._scc.verify_chv(self._adm_chv_num, key) + return sw + + def read_iccid(self): + (res, sw) = self._scc.read_binary(EF['ICCID']) + if sw == '9000': + return (dec_iccid(res), sw) + else: + return (None, sw) + + def read_imsi(self): + (res, sw) = self._scc.read_binary(EF['IMSI']) + if sw == '9000': + return (dec_imsi(res), sw) + else: + return (None, sw) + + def update_imsi(self, imsi): + data, sw = self._scc.update_binary(EF['IMSI'], enc_imsi(imsi)) + return sw + + def update_acc(self, acc): + data, sw = self._scc.update_binary(EF['ACC'], lpad(acc, 4)) + return sw + + def update_hplmn_act(self, mcc, mnc, access_tech='FFFF'): + """ + Update Home PLMN with access technology bit-field + + See Section "10.3.37 EFHPLMNwAcT (HPLMN Selector with Access Technology)" + in ETSI TS 151 011 for the details of the access_tech field coding. + Some common values: + access_tech = '0080' # Only GSM is selected + access_tech = 'FFFF' # All technologues selected, even Reserved for Future Use ones + """ + # get size and write EF.HPLMNwAcT + r = self._scc.select_file(EF['HPLMNwAcT']) + size = int(r[-1][4:8], 16) + hplmn = enc_plmn(mcc, mnc) + content = hplmn + access_tech + data, sw = self._scc.update_binary(EF['HPLMNwAcT'], content + 'ffffff0000' * (size/5-1)) + return sw + + def update_smsp(self, smsp): + data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 84)) + return sw + + def read_spn(self): + (spn, sw) = self._scc.read_binary(EF['SPN']) + if sw == '9000': + return (dec_spn(spn), sw) + else: + return (None, sw) + + def update_spn(self, name, hplmn_disp=False, oplmn_disp=False): + content = enc_spn(name, hplmn_disp, oplmn_disp) + data, sw = self._scc.update_binary(EF['SPN'], rpad(content, 32)) + return sw + class _MagicSimBase(Card): """ -- To view, visit https://gerrit.osmocom.org/5718 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb7227fa7ebc837fccab456cbfad529f6ee81a28 Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Jan 13 15:25:54 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sat, 13 Jan 2018 15:25:54 +0000 Subject: [MERGED] pysim[master]: Add methods to get ATR for a card or a link. In-Reply-To: References: Message-ID: Alexander Chemeris has submitted this change and it was merged. Change subject: Add methods to get ATR for a card or a link. ...................................................................... Add methods to get ATR for a card or a link. Implemented for both serial and PCSC readers. Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc --- M pySim/commands.py M pySim/transport/pcsc.py M pySim/transport/serial.py 3 files changed, 19 insertions(+), 2 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Verified Harald Welte: Looks good to me, approved diff --git a/pySim/commands.py b/pySim/commands.py index 777dd24..eba915c 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -31,6 +31,9 @@ self._cla_byte = "a0" self.sel_ctrl = "0000" + def get_atr(self): + return self._tp.get_atr() + @property def cla_byte(self): return self._cla_byte diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index dc040c5..47c4185 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -56,6 +56,9 @@ except NoCardException: raise NoCardError() + def get_atr(self): + return self._con.getATR() + def disconnect(self): self._con.disconnect() diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py index 825c458..5b15b2f 100644 --- a/pySim/transport/serial.py +++ b/pySim/transport/serial.py @@ -46,6 +46,7 @@ ) self._rst_pin = rst self._debug = debug + self._atr = None def __del__(self): self._sl.close() @@ -91,6 +92,9 @@ def connect(self): self.reset_card() + def get_atr(self): + return self._atr + def disconnect(self): pass # Nothing to do really ... @@ -102,6 +106,7 @@ raise ProtocolError() def _reset_card(self): + self._atr = None rst_meth_map = { 'rts': self._sl.setRTS, 'dtr': self._sl.setDTR, @@ -133,18 +138,24 @@ return -1 t0 = ord(b) self._dbg_print("T0: 0x%x" % t0) + self._atr = [0x3b, ord(b)] for i in range(4): if t0 & (0x10 << i): - self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(self._rx_byte()))) + b = self._rx_byte() + self._atr.apend(ord(b)) + self._dbg_print("T%si = %x" % (chr(ord('A')+i), ord(b))) for i in range(0, t0 & 0xf): - self._dbg_print("Historical = %x" % ord(self._rx_byte())) + b = self._rx_byte() + self._atr.apend(ord(b)) + self._dbg_print("Historical = %x" % ord(b)) while True: x = self._rx_byte() if not x: break + self._atr.apend(ord(x)) self._dbg_print("Extra: %x" % ord(x)) return 1 -- To view, visit https://gerrit.osmocom.org/5717 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic12e4b115d24a8b7e483a5603dd6cec90ad289cc Gerrit-PatchSet: 2 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy From admin at opensuse.org Sat Jan 13 19:53:54 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 13 Jan 2018 19:53:54 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5a5a63e44bd0d_6b2436ef5c593988@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 182s] You may investigate any problem if you feel able to do so, in which [ 182s] case the test suite provides a good starting point. Its output may [ 182s] be found below `tests/testsuite.dir'. [ 182s] [ 182s] Makefile:678: recipe for target 'check-local' failed [ 182s] make[4]: *** [check-local] Error 1 [ 182s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 182s] Makefile:538: recipe for target 'check-am' failed [ 182s] make[3]: *** [check-am] Error 2 [ 182s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 182s] Makefile:390: recipe for target 'check-recursive' failed [ 182s] make[2]: *** [check-recursive] Error 1 [ 182s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 182s] Makefile:500: recipe for target 'check-recursive' failed [ 182s] make[1]: *** [check-recursive] Error 1 [ 182s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 182s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 182s] debian/rules:6: recipe for target 'build' failed [ 182s] make: *** [build] Error 2 [ 182s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 182s] [ 182s] lamb56 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:42 UTC 2018. [ 182s] [ 182s] ### VM INTERACTION START ### [ 185s] [ 175.612340] reboot: Power down [ 185s] ### VM INTERACTION END ### [ 185s] [ 185s] lamb56 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:45 UTC 2018. [ 185s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jan 13 19:53:54 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 13 Jan 2018 19:53:54 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5a5a63e49d1b5_6b2436ef5c5940f7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 185s] case the test suite provides a good starting point. Its output may [ 185s] be found below `tests/testsuite.dir'. [ 185s] [ 185s] Makefile:664: recipe for target 'check-local' failed [ 185s] make[4]: *** [check-local] Error 1 [ 185s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 185s] Makefile:526: recipe for target 'check-am' failed [ 185s] make[3]: *** [check-am] Error 2 [ 185s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 185s] Makefile:378: recipe for target 'check-recursive' failed [ 185s] make[2]: *** [check-recursive] Error 1 [ 185s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 185s] Makefile:488: recipe for target 'check-recursive' failed [ 185s] make[1]: *** [check-recursive] Error 1 [ 185s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 185s] dh_auto_test: make -j1 check returned exit code 2 [ 185s] debian/rules:6: recipe for target 'build' failed [ 185s] make: *** [build] Error 2 [ 185s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 185s] [ 185s] lamb28 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:46 UTC 2018. [ 185s] [ 185s] ### VM INTERACTION START ### [ 187s] Powering off. [ 187s] [ 178.236351] reboot: Power down [ 187s] ### VM INTERACTION END ### [ 187s] [ 187s] lamb28 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:48 UTC 2018. [ 187s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jan 13 19:53:54 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 13 Jan 2018 19:53:54 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5a5a63e3f0548_6b2436ef5c593842@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 185s] You may investigate any problem if you feel able to do so, in which [ 185s] case the test suite provides a good starting point. Its output may [ 185s] be found below `tests/testsuite.dir'. [ 185s] [ 185s] Makefile:678: recipe for target 'check-local' failed [ 185s] make[4]: *** [check-local] Error 1 [ 185s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 185s] Makefile:538: recipe for target 'check-am' failed [ 185s] make[3]: *** [check-am] Error 2 [ 185s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 185s] Makefile:390: recipe for target 'check-recursive' failed [ 185s] make[2]: *** [check-recursive] Error 1 [ 185s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 185s] Makefile:500: recipe for target 'check-recursive' failed [ 185s] make[1]: *** [check-recursive] Error 1 [ 185s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 185s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 185s] debian/rules:6: recipe for target 'build' failed [ 185s] make: *** [build] Error 2 [ 185s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 185s] [ 185s] lamb22 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:38 UTC 2018. [ 185s] [ 185s] ### VM INTERACTION START ### [ 188s] [ 177.829321] reboot: Power down [ 188s] ### VM INTERACTION END ### [ 188s] [ 188s] lamb22 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:42 UTC 2018. [ 188s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jan 13 19:54:11 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 13 Jan 2018 19:54:11 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5a5a63ff1fa4a_6b2436ef5c5941dc@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 193s] You may investigate any problem if you feel able to do so, in which [ 193s] case the test suite provides a good starting point. Its output may [ 193s] be found below `tests/testsuite.dir'. [ 193s] [ 193s] Makefile:678: recipe for target 'check-local' failed [ 193s] make[4]: *** [check-local] Error 1 [ 193s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 193s] Makefile:538: recipe for target 'check-am' failed [ 193s] make[3]: *** [check-am] Error 2 [ 193s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 193s] Makefile:390: recipe for target 'check-recursive' failed [ 193s] make[2]: *** [check-recursive] Error 1 [ 193s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 193s] Makefile:500: recipe for target 'check-recursive' failed [ 193s] make[1]: *** [check-recursive] Error 1 [ 193s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 193s] dh_auto_test: make -j1 check returned exit code 2 [ 193s] debian/rules:6: recipe for target 'build' failed [ 193s] make: *** [build] Error 2 [ 193s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 193s] [ 193s] lamb22 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:51 UTC 2018. [ 193s] [ 193s] ### VM INTERACTION START ### [ 196s] [ 187.861742] reboot: Power down [ 196s] ### VM INTERACTION END ### [ 196s] [ 196s] lamb22 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:53:54 UTC 2018. [ 196s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jan 13 19:54:28 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 13 Jan 2018 19:54:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5a5a63ff96271_6b2436ef5c5942f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 211s] You may investigate any problem if you feel able to do so, in which [ 211s] case the test suite provides a good starting point. Its output may [ 211s] be found below `tests/testsuite.dir'. [ 211s] [ 211s] Makefile:678: recipe for target 'check-local' failed [ 211s] make[4]: *** [check-local] Error 1 [ 211s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 211s] Makefile:538: recipe for target 'check-am' failed [ 211s] make[3]: *** [check-am] Error 2 [ 211s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 211s] Makefile:390: recipe for target 'check-recursive' failed [ 211s] make[2]: *** [check-recursive] Error 1 [ 211s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 211s] Makefile:500: recipe for target 'check-recursive' failed [ 211s] make[1]: *** [check-recursive] Error 1 [ 211s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 211s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 211s] debian/rules:6: recipe for target 'build' failed [ 211s] make: *** [build] Error 2 [ 211s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 211s] [ 211s] lamb27 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:54:15 UTC 2018. [ 211s] [ 211s] ### VM INTERACTION START ### [ 214s] [ 203.884801] reboot: Power down [ 214s] ### VM INTERACTION END ### [ 214s] [ 214s] lamb27 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 19:54:19 UTC 2018. [ 214s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sat Jan 13 20:11:19 2018 From: admin at opensuse.org (OBS Notification) Date: Sat, 13 Jan 2018 20:11:19 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <5a5a67fdbcf06_6b2436ef5c594959@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/aarch64 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 431s] case the test suite provides a good starting point. Its output may [ 431s] be found below `tests/testsuite.dir'. [ 431s] [ 431s] Makefile:678: recipe for target 'check-local' failed [ 431s] make[4]: *** [check-local] Error 1 [ 431s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 431s] Makefile:538: recipe for target 'check-am' failed [ 431s] make[3]: *** [check-am] Error 2 [ 431s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 431s] Makefile:390: recipe for target 'check-recursive' failed [ 431s] make[2]: *** [check-recursive] Error 1 [ 431s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 431s] Makefile:500: recipe for target 'check-recursive' failed [ 431s] make[1]: *** [check-recursive] Error 1 [ 431s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 431s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 431s] debian/rules:6: recipe for target 'build' failed [ 431s] make: *** [build] Error 2 [ 431s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 431s] [ 431s] obs-arm-3 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 20:11:02 UTC 2018. [ 431s] [ 431s] ### VM INTERACTION START ### [ 434s] [ 409.560513] sysrq: SysRq : Power Off [ 434s] [ 409.563523] reboot: Power down [ 434s] ### VM INTERACTION END ### [ 434s] [ 434s] obs-arm-3 failed "build osmo-trx_0.2.0.20180113.dsc" at Sat Jan 13 20:11:06 UTC 2018. [ 434s] -- 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 Jan 14 09:58:22 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Sun, 14 Jan 2018 09:58:22 +0000 Subject: gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Patch Set 1: -Code-Review I've got the "abandon" button, but the point of this patch was to check if I have ability to give "+2" or "-2" for new patches (sorry for posting this reply in the wrong place before). -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Max Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: fix USSD OCTET STRING length confusion In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5712 to look at the new patch set (#5). gsm0480: fix USSD OCTET STRING length confusion According to the GSM 04.80 (version 5.0.0) specification Annex A "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD OCTET STRING is 160 bytes. Thus according to ETSI TS 123 038 (version 10.0.0) specification 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. The remaining 6 bits are set to zero. This change defines both mentioned values: - GSM0408_USSD_OCTET_STRING_LEN 160 - GSM0408_USSD_7BIT_STRING_LEN 182 keeping the old MAX_LEN_USSD_STRING 'as is' due to compatibility reasons. Now the new value is used for ss_request structure, while old one is still used for deprecated ussd_request structure. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c 2 files changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5712/5 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 672ffe5..000c0b0 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,27 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +/** + * According to the GSM 04.80 (version 5.0.0) specification Annex A + * "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD + * OCTET STRING field is 160 bytes. + */ +#define GSM0408_USSD_OCTET_STRING_LEN 160 + +/** + * Thus according to ETSI TS 123 038 (version 10.0.0) specification + * 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's + * possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. + * The remaining 6 bits are set to zero. + */ +#define GSM0408_USSD_7BIT_STRING_LEN 182 + +/** + * DEPRECATED: this definition doesn't follow any specification, + * so we only keep it for compatibility reasons. It's strongly + * recommended to use correct definitions above. + */ +#define MAX_LEN_USSD_STRING 31 /* deprecated */ struct ussd_request { @@ -23,7 +43,7 @@ struct ss_request { uint8_t opcode; uint8_t ss_code; - uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; + uint8_t ussd_text[GSM0408_USSD_OCTET_STRING_LEN]; uint8_t transaction_id; uint8_t invoke_id; }; diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d7c2978..4898e32 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -456,8 +456,8 @@ (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { num_chars = (uss_req_data[6] * 8) / 7; /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + if (num_chars > GSM0408_USSD_7BIT_STRING_LEN) + num_chars = GSM0408_USSD_7BIT_STRING_LEN; gsm_7bit_decode_n_ussd((char *)req->ussd_text, sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3376 to look at the new patch set (#8). gsm0480: handle UnstructuredSS Request with DSC != 0x0F According to GSM 04.08, 4.4.2 "ASN.1 data types": the USSD-DataCodingScheme shall indicate use of the default alphabet using the 0x0F value. Previously, the UnstructuredSS Request messages with not default alphabet were not being handled. Let's fix this. Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/3376/8 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 2bd6565..9e71a86 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -453,9 +453,18 @@ if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) return 0; + /* Get DCS (Data Coding Scheme) */ dcs = uss_req_data[4]; + + /** + * According to GSM 04.08, 4.4.2 "ASN.1 data types": + * the USSD-DataCodingScheme shall indicate use of + * the default alphabet using the 0x0F value. + */ if (dcs == 0x0F) { + /* Calculate the amount of 7-bit characters */ num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ if (num_chars > GSM0408_USSD_7BIT_STRING_LEN) num_chars = GSM0408_USSD_7BIT_STRING_LEN; @@ -464,6 +473,17 @@ sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); return 1; + } else { + /* Get the amount of 8-bit characters */ + num_chars = uss_req_data[6]; + + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > GSM0408_USSD_OCTET_STRING_LEN) + num_chars = GSM0408_USSD_OCTET_STRING_LEN; + + memcpy(req->ussd_text, &(uss_req_data[7]), num_chars); + + return 1; } return 0; -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3377 to look at the new patch set (#8). gsm0480: parse GSM0480_MTYPE_FACILITY separately Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa --- M src/gsm/gsm0480.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/3377/8 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 9e71a86..7b0fa6d 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -196,6 +196,8 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req); +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, @@ -286,8 +288,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - case GSM0480_MTYPE_FACILITY: rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + break; + case GSM0480_MTYPE_FACILITY: + rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", @@ -299,6 +303,18 @@ return rc; } +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct ss_request *req) +{ + uint8_t facility_length; + + facility_length = ss_facility[0]; + if (len - 1 < facility_length) + return 0; + + return parse_facility_ie(ss_facility + 1, facility_length, req); +} + static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct ss_request *req) { -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3378 to look at the new patch set (#8). gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 82 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3378/8 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 7b0fa6d..29d98a6 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -372,6 +376,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -451,6 +458,81 @@ return rc; } +/* Parse a Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 0; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > GSM0408_USSD_OCTET_STRING_LEN) + num_chars = GSM0408_USSD_OCTET_STRING_LEN; + + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3381 to look at the new patch set (#8). gsm0480: expose the gsm0480_parse_ss_facility_ie() Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/81/3381/8 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 000c0b0..963ae9b 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -50,6 +50,8 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *request); +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct ss_request *req); struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 9e27aab..82946a3 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -200,8 +200,6 @@ struct ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct ss_request *req); -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct ss_request *req); static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, @@ -316,7 +314,8 @@ if (len - 1 < facility_length) return 0; - return parse_facility_ie(ss_facility + 1, facility_length, req); + return gsm0480_parse_ss_facility_ie(ss_facility + 1, + facility_length, req); } static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, @@ -338,7 +337,7 @@ case GSM48_IE_CAUSE: break; case GSM0480_IE_FACILITY: - rc = parse_facility_ie(ss_ie + 2, iei_length, req); + rc = gsm0480_parse_ss_facility_ie(ss_ie + 2, iei_length, req); break; case GSM0480_IE_SS_VERSION: break; @@ -352,8 +351,8 @@ return rc; } -static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, - struct ss_request *req) +int gsm0480_parse_ss_facility_ie(const uint8_t *facility_ie, uint16_t length, + struct ss_request *req) { int rc = 1; uint8_t offset = 0; diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 985ec83..de9cdaa 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -90,6 +90,7 @@ gsm0480_create_ussd_release_complete; gsm0480_decode_ussd_request; gsm0480_decode_ss_request; +gsm0480_parse_ss_facility_ie; gsm0480_wrap_facility; gsm0480_wrap_invoke; -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3373 to look at the new patch set (#8). gsm0480: skip length check for 'RELEASE COMPLETE' message According to GSM 04.80 Section 2.5 'Release complete' Table 2.5, the 'RELEASE COMPLETE' message payload is optional, so let's drop the length check in gsm0480_decode_ss_request() for this type. Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 --- M src/gsm/gsm0480.c 1 file changed, 10 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/3373/8 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 71470e5..d7c2978 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -249,11 +249,18 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { + uint8_t msg_type = hdr->msg_type & 0x3F; int rc = 0; - if (len < sizeof(*hdr) + 2) { - LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); - return 0; + /** + * GSM 04.80 Section 2.5 'Release complete' Table 2.5 + * payload is optional for 'RELEASE COMPLETE' message + */ + if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (len < sizeof(*hdr) + 2) { + LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); + return 0; + } } if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 14 10:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 10:59:46 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#8). gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/3375/8 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 4898e32..2bd6565 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -439,33 +439,34 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req) { - int rc = 0; - int num_chars; + uint8_t num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > GSM0408_USSD_7BIT_STRING_LEN) - num_chars = GSM0408_USSD_7BIT_STRING_LEN; - gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), - &(uss_req_data[7]), num_chars); - rc = 1; - } - } + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; + + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > GSM0408_USSD_7BIT_STRING_LEN) + num_chars = GSM0408_USSD_7BIT_STRING_LEN; + + gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:00:46 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 11:00:46 +0000 Subject: [ABANDON] libosmocore[master]: gsm0480: modify USSD structures to support external handling In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. Change subject: gsm0480: modify USSD structures to support external handling ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/3374 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5f8972b86cd4dcb54b643a24b5794a87c8758073 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:01:00 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 11:01:00 +0000 Subject: [ABANDON] openbsc[master]: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. Change subject: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5740 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ic7fed57115dfa9f06a48adced86cd2fb7779139e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:01:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 11:01:10 +0000 Subject: [ABANDON] osmo-msc[master]: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. Change subject: gsm0480: fix GSM 04.80 libosmocore API / ABI compatibility ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5735 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I9b3a4a169d4a473dd0547815d84a28e24997446f Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:02:37 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 11:02:37 +0000 Subject: [MERGED] libosmocore[master]: ussd_test.c: fix rc / len debug output confusion In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: ussd_test.c: fix rc / len debug output confusion ...................................................................... ussd_test.c: fix rc / len debug output confusion Both len and rc values were swapped in the test output. Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309 --- M tests/ussd/ussd_test.c M tests/ussd/ussd_test.ok 2 files changed, 52 insertions(+), 52 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/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 40b4317..bf6d731 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -140,13 +140,13 @@ for (i = size; i > sizeof(struct gsm48_hdr); --i) { int rc = parse_ussd(&ussd_request[0], i); - printf("Result for %d is %d\n", rc, i); + printf("Result for len=%d is %d\n", i, rc); } printf("Mangling the container now\n"); for (i = size; i > sizeof(struct gsm48_hdr) + 2; --i) { int rc = parse_mangle_ussd(&ussd_request[0], i); - printf("Result for %d is %d\n", rc, i); + printf("Result for len=%d is %d\n", i, rc); } printf(" case test for 7 bit encode\n"); diff --git a/tests/ussd/ussd_test.ok b/tests/ussd/ussd_test.ok index 69ea53c..aff383e 100644 --- a/tests/ussd/ussd_test.ok +++ b/tests/ussd/ussd_test.ok @@ -1,57 +1,57 @@ Tested if it still works. Text was: **321# interrogateSS CFU text..'' code 33 Testing parsing a USSD request and truncated versions -Result for 1 is 28 -Result for 1 is 27 -Result for 1 is 26 -Result for 1 is 25 -Result for 0 is 24 -Result for 0 is 23 -Result for 0 is 22 -Result for 0 is 21 -Result for 0 is 20 -Result for 0 is 19 -Result for 0 is 18 -Result for 0 is 17 -Result for 0 is 16 -Result for 0 is 15 -Result for 0 is 14 -Result for 0 is 13 -Result for 0 is 12 -Result for 0 is 11 -Result for 0 is 10 -Result for 0 is 9 -Result for 0 is 8 -Result for 0 is 7 -Result for 0 is 6 -Result for 0 is 5 -Result for 0 is 4 -Result for 0 is 3 +Result for len=28 is 1 +Result for len=27 is 1 +Result for len=26 is 1 +Result for len=25 is 1 +Result for len=24 is 0 +Result for len=23 is 0 +Result for len=22 is 0 +Result for len=21 is 0 +Result for len=20 is 0 +Result for len=19 is 0 +Result for len=18 is 0 +Result for len=17 is 0 +Result for len=16 is 0 +Result for len=15 is 0 +Result for len=14 is 0 +Result for len=13 is 0 +Result for len=12 is 0 +Result for len=11 is 0 +Result for len=10 is 0 +Result for len=9 is 0 +Result for len=8 is 0 +Result for len=7 is 0 +Result for len=6 is 0 +Result for len=5 is 0 +Result for len=4 is 0 +Result for len=3 is 0 Mangling the container now -Result for 0 is 28 -Result for 0 is 27 -Result for 1 is 26 -Result for 1 is 25 -Result for 0 is 24 -Result for 0 is 23 -Result for 0 is 22 -Result for 0 is 21 -Result for 0 is 20 -Result for 0 is 19 -Result for 0 is 18 -Result for 0 is 17 -Result for 0 is 16 -Result for 0 is 15 -Result for 0 is 14 -Result for 0 is 13 -Result for 0 is 12 -Result for 0 is 11 -Result for 0 is 10 -Result for 0 is 9 -Result for 0 is 8 -Result for 0 is 7 -Result for 0 is 6 -Result for 1 is 5 +Result for len=28 is 0 +Result for len=27 is 0 +Result for len=26 is 1 +Result for len=25 is 1 +Result for len=24 is 0 +Result for len=23 is 0 +Result for len=22 is 0 +Result for len=21 is 0 +Result for len=20 is 0 +Result for len=19 is 0 +Result for len=18 is 0 +Result for len=17 is 0 +Result for len=16 is 0 +Result for len=15 is 0 +Result for len=14 is 0 +Result for len=13 is 0 +Result for len=12 is 0 +Result for len=11 is 0 +Result for len=10 is 0 +Result for len=9 is 0 +Result for len=8 is 0 +Result for len=7 is 0 +Result for len=6 is 0 +Result for len=5 is 1 case test for 7 bit encode original = 30 31 32 33 34 35 36 37 encoded = b0 98 6c 46 ab d9 6e -- To view, visit https://gerrit.osmocom.org/5744 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iebd82531c6ced5d16b15dad4ff4ce654c82db309 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:13:31 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 11:13:31 +0000 Subject: gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Max Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:49:46 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 11:49:46 +0000 Subject: libosmocore[master]: gsm0480: fix USSD OCTET STRING length confusion In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 Looks good now -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 14 11:50:24 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 11:50:24 +0000 Subject: libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Sun Jan 14 11:50:37 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 11:50:37 +0000 Subject: libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Sun Jan 14 11:50:52 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 11:50:52 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Sun Jan 14 12:03:42 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 12:03:42 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: fix USSD OCTET STRING length confusion In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5712 to look at the new patch set (#6). gsm0480: fix USSD OCTET STRING length confusion According to the GSM 04.80 (version 5.0.0) specification Annex A "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD OCTET STRING is 160 bytes. Thus according to ETSI TS 123 038 (version 10.0.0) specification 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. The remaining 6 bits are set to zero. This change defines both mentioned values: - GSM0480_USSD_OCTET_STRING_LEN 160 - GSM0480_USSD_7BIT_STRING_LEN 182 keeping the old MAX_LEN_USSD_STRING 'as is' due to compatibility reasons. Now the new value is used for ss_request structure, while old one is still used for deprecated ussd_request structure. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c 2 files changed, 24 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5712/6 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 672ffe5..0dfd868 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,27 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +/** + * According to the GSM 04.80 (version 5.0.0) specification Annex A + * "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD + * OCTET STRING field is 160 bytes. + */ +#define GSM0480_USSD_OCTET_STRING_LEN 160 + +/** + * Thus according to ETSI TS 123 038 (version 10.0.0) specification + * 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's + * possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. + * The remaining 6 bits are set to zero. + */ +#define GSM0480_USSD_7BIT_STRING_LEN 182 + +/** + * DEPRECATED: this definition doesn't follow any specification, + * so we only keep it for compatibility reasons. It's strongly + * recommended to use correct definitions above. + */ +#define MAX_LEN_USSD_STRING 31 /* deprecated */ struct ussd_request { @@ -23,7 +43,7 @@ struct ss_request { uint8_t opcode; uint8_t ss_code; - uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; + uint8_t ussd_text[GSM0480_USSD_OCTET_STRING_LEN]; uint8_t transaction_id; uint8_t invoke_id; }; diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d7c2978..dcf487a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -456,8 +456,8 @@ (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { num_chars = (uss_req_data[6] * 8) / 7; /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) + num_chars = GSM0480_USSD_7BIT_STRING_LEN; gsm_7bit_decode_n_ussd((char *)req->ussd_text, sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 14 12:03:42 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 12:03:42 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3376 to look at the new patch set (#9). gsm0480: handle UnstructuredSS Request with DSC != 0x0F According to GSM 04.08, 4.4.2 "ASN.1 data types": the USSD-DataCodingScheme shall indicate use of the default alphabet using the 0x0F value. Previously, the UnstructuredSS Request messages with not default alphabet were not being handled. Let's fix this. Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/3376/9 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 11c66e9..b0b28e4 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -453,9 +453,18 @@ if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) return 0; + /* Get DCS (Data Coding Scheme) */ dcs = uss_req_data[4]; + + /** + * According to GSM 04.08, 4.4.2 "ASN.1 data types": + * the USSD-DataCodingScheme shall indicate use of + * the default alphabet using the 0x0F value. + */ if (dcs == 0x0F) { + /* Calculate the amount of 7-bit characters */ num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) num_chars = GSM0480_USSD_7BIT_STRING_LEN; @@ -464,6 +473,17 @@ sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); return 1; + } else { + /* Get the amount of 8-bit characters */ + num_chars = uss_req_data[6]; + + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > GSM0480_USSD_OCTET_STRING_LEN) + num_chars = GSM0480_USSD_OCTET_STRING_LEN; + + memcpy(req->ussd_text, &(uss_req_data[7]), num_chars); + + return 1; } return 0; -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 12:03:42 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 12:03:42 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3378 to look at the new patch set (#9). gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 82 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/3378/9 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 17657c7..fdec3d2 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -372,6 +376,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -451,6 +458,81 @@ return rc; } +/* Parse a Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 0; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > GSM0480_USSD_OCTET_STRING_LEN) + num_chars = GSM0480_USSD_OCTET_STRING_LEN; + + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 12:03:42 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 12:03:42 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3375 to look at the new patch set (#9). gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/75/3375/9 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index dcf487a..11c66e9 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -439,33 +439,34 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req) { - int rc = 0; - int num_chars; + uint8_t num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) - num_chars = GSM0480_USSD_7BIT_STRING_LEN; - gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), - &(uss_req_data[7]), num_chars); - rc = 1; - } - } + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; + + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) + num_chars = GSM0480_USSD_7BIT_STRING_LEN; + + gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 12:47:27 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 12:47:27 +0000 Subject: libosmocore[master]: gsm0480: fix USSD OCTET STRING length confusion In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 14 12:47:41 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 12:47:41 +0000 Subject: libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Sun Jan 14 12:47:49 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 12:47:49 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Sun Jan 14 12:48:20 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 14 Jan 2018 12:48:20 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Sun Jan 14 17:31:10 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 14 Jan 2018 17:31:10 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Fix absolute import issue in py3 Message-ID: Review at https://gerrit.osmocom.org/5777 Fix absolute import issue in py3 As of 577f2a95e4f01c58a0a4f4ccb3b70d9c048b626e in osmo-ci, the contrib/jenkins.sh isused forinstallation. This causes the issue with python3 because test coded use absolute import by default. Fix this by adding relative path and import from ../osmopy to make sure test code uses the current module and not the one which might be already installed in the system. Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 --- M tests/test_py3.py 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/77/5777/1 diff --git a/tests/test_py3.py b/tests/test_py3.py index 3a96d9f..909d057 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -2,7 +2,12 @@ # just a smoke test for osmopy -import asyncio, random +import asyncio, random, sys, os + +# we have to use this ugly hack to workaroundbrokenrelative imports in py3: +# from ..osmopy.osmo_ipa import Ctrl +# does not work as expected +sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from osmopy.osmo_ipa import Ctrl from osmopy import __version__ -- To view, visit https://gerrit.osmocom.org/5777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 14 17:33:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 14 Jan 2018 17:33:36 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Fix absolute import issue in py3 In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5777 to look at the new patch set (#2). Fix absolute import issue in py3 As of 577f2a95e4f01c58a0a4f4ccb3b70d9c048b626e in osmo-ci, the contrib/jenkins.sh isused forinstallation. This causes the issue with python3 because test coded use absolute import by default. Fix this by adding relative path and import from ../osmopy to make sure test code uses the current module and not the one which might be already installed in the system. Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 --- M osmopy/__init__.py M tests/test_py3.py 2 files changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/77/5777/2 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index d3d3005..c3d4b8c 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.0.7' +__version__ = '0.0.8' __all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] diff --git a/tests/test_py3.py b/tests/test_py3.py index 3a96d9f..909d057 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -2,7 +2,12 @@ # just a smoke test for osmopy -import asyncio, random +import asyncio, random, sys, os + +# we have to use this ugly hack to workaroundbrokenrelative imports in py3: +# from ..osmopy.osmo_ipa import Ctrl +# does not work as expected +sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from osmopy.osmo_ipa import Ctrl from osmopy import __version__ -- To view, visit https://gerrit.osmocom.org/5777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Sun Jan 14 18:43:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 18:43:48 +0000 Subject: [PATCH] gapk[master]: Merge branch 'fixeria/lib' Message-ID: Review at https://gerrit.osmocom.org/5778 Merge branch 'fixeria/lib' TO BE DONE, TESTING... Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/78/5778/1 -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 14 18:46:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 14 Jan 2018 18:46:02 +0000 Subject: libosmocore[master]: Add function to properly encode RAI In-Reply-To: References: Message-ID: Patch Set 5: (2 comments) General note: the comments on already merged patches are very easy to miss. Unless there's smth really wrong with the patch,it's better to make follow-up patch/ticket/email to make sure it's not lost accidentally. https://gerrit.osmocom.org/#/c/5652/5/src/gb/gprs_bssgp.c File src/gb/gprs_bssgp.c: Line 256: gsm48_encode_ra((struct gsm48_ra_id *)buf, raid); > This code could cause unaligned access on some hardware platforms because w Neat, feel free to send the fix in a separate patch. Although I think we first have to actually hit the issue and than fix it. Which hw are you referring to? https://gerrit.osmocom.org/#/c/5652/5/src/gsm/gsm48.c File src/gsm/gsm48.c: Line 703: > Why was the comment removed? Without the comment (mnc < 100) becomes less o To me the comment clarified nothing - I still have to look into spec to understand it. I think reference to particular spec paragraph is more helpful. -- To view, visit https://gerrit.osmocom.org/5652 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31f9605277f4945f207c2c44ff82e62399f8db74 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jan 14 18:47:13 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 18:47:13 +0000 Subject: gapk[master]: Merge branch 'fixeria/lib' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 No commit description yet. No response from Sylvain yet. -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 14 18:47:47 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 14 Jan 2018 18:47:47 +0000 Subject: gapk[master]: Merge branch 'fixeria/lib' In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 14 19:21:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 14 Jan 2018 19:21:23 +0000 Subject: [ABANDON] osmo-ggsn[master]: Log GSN mode for unexpectde packets In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Log GSN mode for unexpectde packets ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5750 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I36ee608182523709c795d8317095ae4fda4a7858 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 14 19:29:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 14 Jan 2018 19:29:49 +0000 Subject: libosmocore[master]: Use python 3 for utilities In-Reply-To: References: Message-ID: Patch Set 2: > should we immediately reject Python 2 support? We're rejecting nothing - the patch only changes shebang, so the scripts will continue to work with python2 just as before if it's used explicitly. The only difference is the default version. > Is it discussed anywhere? Not that I know of. I haven't thought that changing default version of libosmocore internal build helpers warrants additional discussion. Feel free to start one in ML if you see use case where making this change might affect external users. -- To view, visit https://gerrit.osmocom.org/5657 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d34aed124b00c5dd2ab1bcc84bbfa8c620282cc Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-Reviewer: tnt Gerrit-HasComments: No From admin at opensuse.org Sun Jan 14 19:53:58 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Jan 2018 19:53:58 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5a5bb572e0197_6b2436ef5c1142182@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 166s] You may investigate any problem if you feel able to do so, in which [ 166s] case the test suite provides a good starting point. Its output may [ 166s] be found below `tests/testsuite.dir'. [ 166s] [ 166s] Makefile:678: recipe for target 'check-local' failed [ 166s] make[4]: *** [check-local] Error 1 [ 166s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:538: recipe for target 'check-am' failed [ 166s] make[3]: *** [check-am] Error 2 [ 166s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:390: recipe for target 'check-recursive' failed [ 166s] make[2]: *** [check-recursive] Error 1 [ 166s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 166s] Makefile:500: recipe for target 'check-recursive' failed [ 166s] make[1]: *** [check-recursive] Error 1 [ 166s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 166s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 166s] debian/rules:6: recipe for target 'build' failed [ 166s] make: *** [build] Error 2 [ 166s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 166s] [ 166s] build78 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:53:47 UTC 2018. [ 166s] [ 166s] ### VM INTERACTION START ### [ 169s] [ 160.703846] reboot: Power down [ 169s] ### VM INTERACTION END ### [ 169s] [ 169s] build78 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:53:51 UTC 2018. [ 169s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jan 14 19:54:15 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Jan 2018 19:54:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5a5bb5741af7f_6b2436ef5c1142239@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 200s] case the test suite provides a good starting point. Its output may [ 200s] be found below `tests/testsuite.dir'. [ 200s] [ 200s] Makefile:664: recipe for target 'check-local' failed [ 200s] make[4]: *** [check-local] Error 1 [ 200s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 200s] Makefile:526: recipe for target 'check-am' failed [ 200s] make[3]: *** [check-am] Error 2 [ 200s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 200s] Makefile:378: recipe for target 'check-recursive' failed [ 200s] make[2]: *** [check-recursive] Error 1 [ 200s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 200s] Makefile:488: recipe for target 'check-recursive' failed [ 200s] make[1]: *** [check-recursive] Error 1 [ 200s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 200s] dh_auto_test: make -j1 check returned exit code 2 [ 200s] debian/rules:6: recipe for target 'build' failed [ 200s] make: *** [build] Error 2 [ 200s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 200s] [ 200s] lamb09 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:54:10 UTC 2018. [ 200s] [ 200s] ### VM INTERACTION START ### [ 202s] Powering off. [ 202s] [ 193.792400] reboot: Power down [ 202s] ### VM INTERACTION END ### [ 202s] [ 202s] lamb09 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:54:12 UTC 2018. [ 202s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jan 14 19:54:32 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Jan 2018 19:54:32 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5a5bb595ae3cd_6b2436ef5c11423d2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 196s] You may investigate any problem if you feel able to do so, in which [ 196s] case the test suite provides a good starting point. Its output may [ 196s] be found below `tests/testsuite.dir'. [ 196s] [ 196s] Makefile:678: recipe for target 'check-local' failed [ 196s] make[4]: *** [check-local] Error 1 [ 196s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 196s] Makefile:538: recipe for target 'check-am' failed [ 196s] make[3]: *** [check-am] Error 2 [ 196s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 196s] Makefile:390: recipe for target 'check-recursive' failed [ 196s] make[2]: *** [check-recursive] Error 1 [ 196s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 196s] Makefile:500: recipe for target 'check-recursive' failed [ 196s] make[1]: *** [check-recursive] Error 1 [ 196s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 196s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 196s] debian/rules:6: recipe for target 'build' failed [ 196s] make: *** [build] Error 2 [ 196s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 196s] [ 196s] lamb74 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:54:28 UTC 2018. [ 196s] [ 196s] ### VM INTERACTION START ### [ 199s] [ 191.420576] reboot: Power down [ 200s] ### VM INTERACTION END ### [ 200s] [ 200s] lamb74 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:54:31 UTC 2018. [ 200s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jan 14 19:54:49 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Jan 2018 19:54:49 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5a5bb596a9681_6b2436ef5c11424ea@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 213s] You may investigate any problem if you feel able to do so, in which [ 213s] case the test suite provides a good starting point. Its output may [ 213s] be found below `tests/testsuite.dir'. [ 213s] [ 213s] Makefile:678: recipe for target 'check-local' failed [ 213s] make[4]: *** [check-local] Error 1 [ 213s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 213s] Makefile:538: recipe for target 'check-am' failed [ 213s] make[3]: *** [check-am] Error 2 [ 213s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 213s] Makefile:390: recipe for target 'check-recursive' failed [ 213s] make[2]: *** [check-recursive] Error 1 [ 213s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 213s] Makefile:500: recipe for target 'check-recursive' failed [ 213s] make[1]: *** [check-recursive] Error 1 [ 213s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 213s] dh_auto_test: make -j1 check returned exit code 2 [ 213s] debian/rules:6: recipe for target 'build' failed [ 213s] make: *** [build] Error 2 [ 213s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 213s] [ 213s] lamb25 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:54:32 UTC 2018. [ 213s] [ 213s] ### VM INTERACTION START ### [ 216s] [ 208.905827] reboot: Power down [ 216s] ### VM INTERACTION END ### [ 216s] [ 216s] lamb25 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:54:35 UTC 2018. [ 216s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jan 14 19:57:25 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Jan 2018 19:57:25 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5a5bb62b95568_6b2436ef5c1142518@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 342s] You may investigate any problem if you feel able to do so, in which [ 342s] case the test suite provides a good starting point. Its output may [ 342s] be found below `tests/testsuite.dir'. [ 342s] [ 342s] Makefile:678: recipe for target 'check-local' failed [ 342s] make[4]: *** [check-local] Error 1 [ 342s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 342s] Makefile:538: recipe for target 'check-am' failed [ 342s] make[3]: *** [check-am] Error 2 [ 342s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 342s] Makefile:390: recipe for target 'check-recursive' failed [ 342s] make[2]: *** [check-recursive] Error 1 [ 342s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 342s] Makefile:500: recipe for target 'check-recursive' failed [ 342s] make[1]: *** [check-recursive] Error 1 [ 342s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 342s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 342s] debian/rules:6: recipe for target 'build' failed [ 342s] make: *** [build] Error 2 [ 342s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 342s] [ 342s] cloud126 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:57:03 UTC 2018. [ 342s] [ 342s] ### VM INTERACTION START ### [ 346s] [ 306.585966] reboot: Power down [ 347s] ### VM INTERACTION END ### [ 347s] [ 347s] cloud126 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 19:57:08 UTC 2018. [ 347s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Sun Jan 14 20:02:15 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 14 Jan 2018 20:02:15 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <5a5bb755d6f54_6b2436ef5c1142933@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/aarch64 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 665s] case the test suite provides a good starting point. Its output may [ 665s] be found below `tests/testsuite.dir'. [ 665s] [ 665s] Makefile:678: recipe for target 'check-local' failed [ 665s] make[4]: *** [check-local] Error 1 [ 665s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 665s] Makefile:538: recipe for target 'check-am' failed [ 665s] make[3]: *** [check-am] Error 2 [ 665s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 665s] Makefile:390: recipe for target 'check-recursive' failed [ 665s] make[2]: *** [check-recursive] Error 1 [ 665s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 665s] Makefile:500: recipe for target 'check-recursive' failed [ 665s] make[1]: *** [check-recursive] Error 1 [ 665s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 665s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 665s] debian/rules:6: recipe for target 'build' failed [ 665s] make: *** [build] Error 2 [ 665s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 665s] [ 665s] obs-arm-4 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 20:01:58 UTC 2018. [ 665s] [ 665s] ### VM INTERACTION START ### [ 668s] [ 629.902605] sysrq: SysRq : Power Off [ 668s] [ 629.913244] reboot: Power down [ 668s] ### VM INTERACTION END ### [ 668s] [ 668s] obs-arm-4 failed "build osmo-trx_0.2.0.20180114.dsc" at Sun Jan 14 20:02:01 UTC 2018. [ 668s] -- 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 Jan 14 21:18:09 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 14 Jan 2018 21:18:09 +0000 Subject: [PATCH] osmo-pcu[master]: Fix sanitizer build Message-ID: Review at https://gerrit.osmocom.org/5779 Fix sanitizer build Add sanitizer flags to linker as well to resolve link error. Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b --- M configure.ac 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/79/5779/1 diff --git a/configure.ac b/configure.ac index 8a8b93c..56e2057 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,7 @@ then CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" + LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined" fi AC_ARG_ENABLE(profile, -- To view, visit https://gerrit.osmocom.org/5779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:44:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:44:32 +0000 Subject: [PATCH] osmo-trx[master]: tests: SocketTests: Pick OS-assigned instead of setting one ... Message-ID: Review at https://gerrit.osmocom.org/5780 tests: SocketTests: Pick OS-assigned instead of setting one manually This fixes failures if the port is already being taken by other apps or if this test is run several times concurrently in the same system. Change-Id: Iea213375e489a56cf8ed3e47fe814e17c288803e --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/80/5780/1 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 235b8f3..9a7d6f0 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -35,14 +35,14 @@ static const int gNumToSend = 10; -void *testReaderIP(void *) +void *testReaderIP(void *param) { - UDPSocket readSocket("127.0.0.1", 5934, "localhost", 5061); - readSocket.nonblocking(); + UDPSocket *readSocket = (UDPSocket *)param; + readSocket->nonblocking(); int rc = 0; while (rcread(buf, MAX_UDP_LENGTH); if (count>0) { CERR("read: " << buf); rc++; @@ -56,12 +56,13 @@ int main(int argc, char * argv[] ) { + UDPSocket readSocket("127.0.0.1", 0); + UDPSocket socket1("127.0.0.1", 0, "localhost", readSocket.port()); + + CERR("socket1: " << socket1.port() << ", readSocket: " << readSocket.port()); + Thread readerThreadIP; - readerThreadIP.start(testReaderIP,NULL); - - UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); - - CERR("socket1: " << socket1.port()); + readerThreadIP.start(testReaderIP, &readSocket); // give the readers time to open sleep(1); -- To view, visit https://gerrit.osmocom.org/5780 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iea213375e489a56cf8ed3e47fe814e17c288803e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:44:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:44:32 +0000 Subject: [PATCH] osmo-trx[master]: tests: SocketsTest: Avoid hang forever if test fails Message-ID: Review at https://gerrit.osmocom.org/5781 tests: SocketsTest: Avoid hang forever if test fails Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/81/5781/1 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 9a7d6f0..43c0616 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -30,10 +30,16 @@ #include "Threads.h" #include #include - +#include +#include static const int gNumToSend = 10; +static void sigalarm_handler(int foo) +{ + printf("FAIL: test did not run successfully\n"); + exit(EXIT_FAILURE); +} void *testReaderIP(void *param) { @@ -55,6 +61,15 @@ int main(int argc, char * argv[] ) { + int count; + + if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) { + perror("signal"); + exit(EXIT_FAILURE); + } + + /* If the test takes longer than 2*gNumToSend seconds, abort it */ + alarm(2* gNumToSend); UDPSocket readSocket("127.0.0.1", 0); UDPSocket socket1("127.0.0.1", 0, "localhost", readSocket.port()); -- To view, visit https://gerrit.osmocom.org/5781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:44:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:44:33 +0000 Subject: [PATCH] osmo-trx[master]: tests: SocketsTest: Fail test on write fail Message-ID: Review at https://gerrit.osmocom.org/5782 tests: SocketsTest: Fail test on write fail Change-Id: Ib6b778a2225339ebd2eaa80b3fca6ee8d8646b23 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/82/5782/1 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 43c0616..c4e31d8 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -83,7 +83,12 @@ sleep(1); for (int i=0; i From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:48:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:48:44 +0000 Subject: [PATCH] osmo-ci[master]: master-builds.yml: osmo-sgsn: Remove duplicated concurrent a... Message-ID: Review at https://gerrit.osmocom.org/5783 master-builds.yml: osmo-sgsn: Remove duplicated concurrent attribute Change-Id: I32938d4c1854ce65faa718eccaecb5e3143dbcd0 --- M jobs/master-builds.yml 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/83/5783/1 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index ca1ef80..b5ec651 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -215,7 +215,6 @@ (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") - osmo-sgsn: - concurrent: true a1_name: IU a1: !!python/tuple [--enable-iu, --disable-iu] concurrent: true -- To view, visit https://gerrit.osmocom.org/5783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32938d4c1854ce65faa718eccaecb5e3143dbcd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:48:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:48:44 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: Build osmo-trx with different opti... Message-ID: Review at https://gerrit.osmocom.org/5784 gerrit-verifications.yml: Build osmo-trx with different optimization instruction sets enabled Change-Id: I1d73165a397d98d8fb630f7adec45f00887c139a --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/84/5784/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 192d0ad..9cb12a5 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -179,6 +179,9 @@ - osmo-trx: slave_axis: !!python/tuple [OsmocomBuild1] + a1_name: INSTR + a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] + concurrent: true - osmocom-bb - osmo-tetra -- To view, visit https://gerrit.osmocom.org/5784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1d73165a397d98d8fb630f7adec45f00887c139a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:50:29 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:50:29 +0000 Subject: osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 09:50:47 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 09:50:47 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Build osmo-trx with different opti... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d73165a397d98d8fb630f7adec45f00887c139a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:04:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 10:04:22 +0000 Subject: [PATCH] osmo-pcu[master]: Allocate global context for TypesTest Message-ID: Review at https://gerrit.osmocom.org/5785 Allocate global context for TypesTest Missing allocation leads to LSAN error: ==24997==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 230 byte(s) in 2 object(s) allocated from: #0 0x7feaa1b2fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7feaa13dbc80 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x5c80) Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 SUMMARY: AddressSanitizer: 230 byte(s) leaked in 2 allocation(s). --- M tests/types/TypesTest.cpp 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/85/5785/1 diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index ff78c87..5c4da22 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -481,6 +481,11 @@ int main(int argc, char **argv) { + tall_pcu_ctx = talloc_named_const(NULL, 1, "types test context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); -- To view, visit https://gerrit.osmocom.org/5785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:31:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 10:31:33 +0000 Subject: [PATCH] osmo-pcu[master]: Set V_N and V_B to known initial state Message-ID: Review at https://gerrit.osmocom.org/5786 Set V_N and V_B to known initial state Reset V_N and V_B in UL/DL window class constructors to make sure we always start from known initial state. Related: OS#1759 Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Fixes: CID70468, CID70469. --- M src/rlc.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/5786/1 diff --git a/src/rlc.h b/src/rlc.h index fcc3edb..aac6b13 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -506,6 +506,7 @@ : m_v_s(0) , m_v_a(0) { + reset(); } inline const uint16_t gprs_rlc_dl_window::v_s() const @@ -552,6 +553,7 @@ : m_v_r(0) , m_v_q(0) { + m_v_n.reset(); } inline bool gprs_rlc_ul_window::is_in_window(uint16_t bsn) const -- To view, visit https://gerrit.osmocom.org/5786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:35:38 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 10:35:38 +0000 Subject: osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5685/1/src/libbsc/paging.c File src/libbsc/paging.c: Line 89: LOGP(DPAG, LOGL_INFO, "Going to send paging commands: bts: %d imsi: %s tmsi: " > it's typically best practise to use something like "(bts=%d) " at the begin Sure. Changed as suggested. I have to admit that such consistency in logging style is a bit hard for me to find (with grep), but that's probably just because I'm unfamiliar with this code base. -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:39:56 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 10:39:56 +0000 Subject: [PATCH] osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5685 to look at the new patch set (#3). Show the BTS number for outgoing paging commands in debug log. Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e --- M src/libbsc/paging.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/85/5685/3 diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 314dfdd..be272f5 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -86,8 +86,8 @@ log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub); - LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: " - "0x%08x for ch. type %d (attempt %d)\n", request->bsub->imsi, + LOGP(DPAG, LOGL_INFO, "(bts=%d) Going to send paging commands: imsi: %s tmsi: " + "0x%08x for ch. type %d (attempt %d)\n", bts->nr, request->bsub->imsi, request->bsub->tmsi, request->chan_type, request->attempts); if (request->bsub->tmsi == GSM_RESERVED_TMSI) -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:40:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 10:40:57 +0000 Subject: osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5685/1/src/libbsc/paging.c File src/libbsc/paging.c: Line 89: LOGP(DPAG, LOGL_INFO, "Going to send paging commands: bts: %d imsi: %s tmsi: " > Sure. Changed as suggested. I forgot to run git add again... Please see patchset 3 instead of 2. -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:46:37 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 10:46:37 +0000 Subject: osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Patch Set 7: (1 comment) https://gerrit.osmocom.org/#/c/5705/7/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 250: if (bts) > we use curly braces if the block has multiple lines (even a wrapped line co Noted. Another proposed follow-up change (https://gerrit.osmocom.org/#/c/5752/) will remove this if-statement again so I'll submit this change (5705) as it is. -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 10:46:43 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 10:46:43 +0000 Subject: [MERGED] osmo-bsc[master]: Implement support for paging based on CI (cell identifier). In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Implement support for paging based on CI (cell identifier). ...................................................................... Implement support for paging based on CI (cell identifier). This builds upon https://gerrit.osmocom.org/#/c/5698/ which implements support for paging by LAI. The ttcn3 test TC_paging_imsi_nochan_ci passes with this code when run in isolation. It does not pass if another paging test (such as TC_paging_imsi_nochan_lai) is executed beforehand. This problem looks similar to the scenario tested in TC_paging_imsi_a_reset. Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Depends: Ic3c62ff0fccea586794ea4b3c275a0685cc9326e Related: OS#2753 --- M include/osmocom/bsc/osmo_bsc_grace.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c 3 files changed, 92 insertions(+), 44 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/osmo_bsc_grace.h b/include/osmocom/bsc/osmo_bsc_grace.h index b7950ce..d78e41c 100644 --- a/include/osmocom/bsc/osmo_bsc_grace.h +++ b/include/osmocom/bsc/osmo_bsc_grace.h @@ -30,6 +30,7 @@ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, + struct gsm_bts *bts); #endif diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index ada4b66..a02ea9e 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,11 +228,12 @@ return 0; } -/* Page a subscriber based on TMSI and LAC. +/* Page a subscriber based on TMSI and LAC in the specified MSC. + * If BTS is not NULL, page the subscriber via this particular BTS. * A non-zero return value indicates a fatal out of memory condition. */ static int -page_subscriber(struct bsc_msc_data *msc, uint32_t tmsi, uint32_t lac, - const char *mi_string, uint8_t chan_needed) +page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, + uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; @@ -246,9 +247,14 @@ subscr->lac = lac; subscr->tmsi = tmsi; - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + if (bts) + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); + else + LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc); + subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); @@ -343,6 +349,29 @@ LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ + case CELL_IDENT_CI: { + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + struct gsm_bts *bts; + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity == ci) + break; + } + + if (bts) { + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) + break; + } else + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", + mi_string, ci); + remain -= sizeof(*ci_be); + ci_be++; + } + break; + } + case CELL_IDENT_LAI_AND_LAC: { struct gsm48_loc_area_id lai; int i = 0; @@ -358,7 +387,7 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " @@ -375,7 +404,7 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, tmsi, lac, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) break; remain -= sizeof(*lacp_be); lacp_be++; @@ -388,7 +417,7 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; @@ -396,7 +425,7 @@ LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) + if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) break; break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index f16a19a..93ca9b9 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -50,44 +50,62 @@ return paging_request(msc->network, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* - * continue if the BTS is not excluded from the lock - */ - if (!bts->excl_from_rf_lock) - continue; - - /* in case of no lac patching is in place, check the BTS */ - if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) - continue; - - /* - * now page on this bts - */ - paging_request_bts(bts, subscr, chan_needed, msc); - }; - - /* All bts are either off or in the grace period */ - return 0; -} - -/** - * Try to not page if everything the cell is not on. - */ -int bsc_grace_paging_request(enum signal_rf rf_policy, +/* Return value is like paging_request_bts(): + * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ +static int locked_paging_bts(struct gsm_bts *bts, struct bsc_subscr *subscr, int chan_needed, struct bsc_msc_data *msc) { + /* Return error if the BTS is not excluded from the lock. */ + if (!bts->excl_from_rf_lock) + return 0; + + /* in case of no lac patching is in place, check the BTS */ + if (msc->core_lac == -1 && subscr->lac != bts->location_area_code) + return 0; + + return paging_request_bts(bts, subscr, chan_needed, msc); +} + +static int locked_paging(struct bsc_subscr *subscr, int chan_needed, + struct bsc_msc_data *msc) +{ + struct gsm_bts *bts = NULL; + int num_pages = 0; + + /* + * Check if there is any BTS that is on for the given lac. Start + * with NULL and iterate through all bts. + * All other bts are either off or in the grace period. + */ + llist_for_each_entry(bts, &msc->network->bts_list, list) + num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); + + return num_pages; +} + +/** + * Page a subscriber in an MSC. + * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock + * \param[in] subscr subscriber we want to page + * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE + * \param[in] msc MSC which has issued this paging + * \param[in] bts if not NULL, page via this particular BTS + * \returns number of BTS on which we issued the paging + */ +int bsc_grace_paging_request(enum signal_rf rf_policy, + struct bsc_subscr *subscr, + int chan_needed, + struct bsc_msc_data *msc, + struct gsm_bts *bts) +{ + if (bts) { + if (rf_policy == S_RF_ON) + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); + } + if (rf_policy == S_RF_ON) return normal_paging(subscr, chan_needed, msc); return locked_paging(subscr, chan_needed, msc); -- To view, visit https://gerrit.osmocom.org/5705 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Gerrit-PatchSet: 8 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:00:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:00:27 +0000 Subject: [PATCH] osmo-trx[master]: tests: SocketsTest: Avoid hang forever if test fails In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5781 to look at the new patch set (#2). tests: SocketsTest: Avoid hang forever if test fails Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 15 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/81/5781/2 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 9a7d6f0..bde86b8 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -30,10 +30,16 @@ #include "Threads.h" #include #include - +#include +#include static const int gNumToSend = 10; +static void sigalarm_handler(int foo) +{ + printf("FAIL: test did not run successfully\n"); + exit(EXIT_FAILURE); +} void *testReaderIP(void *param) { @@ -56,6 +62,14 @@ int main(int argc, char * argv[] ) { + if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) { + perror("signal"); + exit(EXIT_FAILURE); + } + + /* If the test takes longer than 2*gNumToSend seconds, abort it */ + alarm(2* gNumToSend); + UDPSocket readSocket("127.0.0.1", 0); UDPSocket socket1("127.0.0.1", 0, "localhost", readSocket.port()); -- To view, visit https://gerrit.osmocom.org/5781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:00:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:00:27 +0000 Subject: [PATCH] osmo-trx[master]: tests: SocketsTest: Fail test on write fail In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5782 to look at the new patch set (#2). tests: SocketsTest: Fail test on write fail Change-Id: Ib6b778a2225339ebd2eaa80b3fca6ee8d8646b23 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/82/5782/2 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index bde86b8..c4e31d8 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -61,6 +61,7 @@ int main(int argc, char * argv[] ) { + int count; if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) { perror("signal"); @@ -82,7 +83,12 @@ sleep(1); for (int i=0; i Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:00:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:00:28 +0000 Subject: [PATCH] osmo-trx[master]: tests: TimevalTest: refactor and avoid double comparison Message-ID: Review at https://gerrit.osmocom.org/5787 tests: TimevalTest: refactor and avoid double comparison Before this patch, the experession assert(then_secondws==then.seconds()) was failing in x86 architecture (and passing when adding a fprintf to debug it). Avoid comparing the double values with == as that's usually a bad idea, since the processor can output slightly different results for the same operation depending on how it is optimized. Use timespec() instead to check the invariant. Take the chance to refactor some variables around to make the test easier to read. Change-Id: Id4324be8ece86d371b1acb46bbd97856dfed241d --- M tests/CommonLibs/TimevalTest.cpp 1 file changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/87/5787/1 diff --git a/tests/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp index f579878..61a92c9 100644 --- a/tests/CommonLibs/TimevalTest.cpp +++ b/tests/CommonLibs/TimevalTest.cpp @@ -29,24 +29,30 @@ #include "Timeval.h" #include #include +#include using namespace std; int main(int argc, char *argv[]) { - Timeval then(10000); - assert(then.elapsed() == -10000); - cerr << then << " elapsed: " << then.elapsed() << endl; - double then_seconds = then.seconds(); - double last_now = Timeval().seconds(); long last_remaining = 10000; + Timeval then(last_remaining); + assert(then.elapsed() == -last_remaining); + cerr << then << " elapsed: " << then.elapsed() << endl; + + /* Check that last_remaining parameter affects setting time in the future */ + usleep(10000); + double increased_time_secs = Timeval().seconds(); + assert(increased_time_secs <= then.seconds()); + + struct timespec invariant_time = then.timespec(); int loops = 0; while (!then.passed()) { - double tnow = Timeval().seconds(); - cerr << "now: " << tnow << " then: " << then << " remaining: " << then.remaining() << endl; - assert(last_now <= tnow && last_remaining >= then.remaining()); - assert(then_seconds == then.seconds()); + struct timespec tspecnow = then.timespec(); + cerr << "now: " << Timeval().seconds() << " then: " << then << " remaining: " << then.remaining() << endl; + assert(last_remaining >= then.remaining()); + assert(tspecnow.tv_sec == invariant_time.tv_sec && tspecnow.tv_nsec == invariant_time.tv_nsec); usleep(500000); loops++; } -- To view, visit https://gerrit.osmocom.org/5787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4324be8ece86d371b1acb46bbd97856dfed241d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:04:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:04:03 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#6). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 51 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/6 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..9d0d996 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,58 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + if [ "x${INSTR}" = "x--with-neon" ] || [ "x${INSTR}" = "x--with-neon-vfpv4" ]; then + #apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot + mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" + } + + mychroot() { + mychroot_nocwd -w / "$@" + } + + CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + OSMOTRX_DIR="${CONTRIB_DIR}/.." + PREFIX="${WORKSPACE:-vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # This is not needed after switching to proot: + #if [ ! -f /proc/sys/fs/binfmt_misc/arm ]; then + # echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | tee /proc/sys/fs/binfmt_misc/register + #fi + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + PATH="$PATH:/usr/sbin:/sbin" fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..767ce92 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(test ! "uname -m | grep x86") cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 6 Gerrit-Project: osmo-trx 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 Mon Jan 15 11:07:09 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 11:07:09 +0000 Subject: [PATCH] osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... 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/5752 to look at the new patch set (#4). Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c. We can now either page an invidual BTS directly or page several BTS in a given location area. This decision is taken based on the contents of the cell identifier list in the paging request. Select a set of BTS for paging while processing the cell identifier list, rather than requiring the paging layer to loop over all BTS in the MSC. This change requires some adjustment in bssap_test. In particular, this test must now add a BTS to its network in order to pass. The purpose of this change is to make the layering a bit cleaner. There is one functional change: We no longer abort paging if paging fails for a particular BTS. Instead, we keep trying to page on other BTS. Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Suggested-by: Harald Welte Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Related: OS#2753 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 5 files changed, 51 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/52/5752/4 diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 2b1bc50..2be71c3 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -56,8 +56,6 @@ }; /* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc); int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index a02ea9e..ef3cc42 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,14 +228,16 @@ return 0; } -/* Page a subscriber based on TMSI and LAC in the specified MSC. - * If BTS is not NULL, page the subscriber via this particular BTS. - * A non-zero return value indicates a fatal out of memory condition. */ +/* Page a subscriber based on TMSI and LAC via the specified BTS. + * The msc parameter is the MSC which issued the corresponding paging request. + * Returns 1 if the paging request could be issued, 0 if not. + * A negative return value indicates an error. */ static int page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; + int ret; subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, mi_string); @@ -247,19 +249,15 @@ subscr->lac = lac; subscr->tmsi = tmsi; - if (bts) - LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", - bts->nr, mi_string, tmsi, tmsi, lac); - else - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc, bts); + ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); - return 0; + return ret; } /* GSM 08.08 ? 3.2.1.19 */ @@ -277,6 +275,7 @@ const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; + struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -353,7 +352,6 @@ uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { uint16_t ci = osmo_load16be(ci_be); - struct gsm_bts *bts; llist_for_each_entry(bts, &msc->network->bts_list, list) { if (bts->cell_identity == ci) @@ -361,11 +359,12 @@ } if (bts) { - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) - break; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); } else LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", mi_string, ci); + remain -= sizeof(*ci_be); ci_be++; } @@ -387,13 +386,16 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } } else LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - remain -= sizeof(lai); i++; } @@ -404,8 +406,12 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } remain -= sizeof(*lacp_be); lacp_be++; } @@ -417,16 +423,20 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 93ca9b9..705933c 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -34,22 +34,6 @@ } -static int normal_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - /* we can't page by lac.. we need to page everything */ - if (msc->core_lac != -1) { - struct gsm_bts *bts; - - llist_for_each_entry(bts, &msc->network->bts_list, list) - paging_request_bts(bts, subscr, chan_needed, msc); - - return 0; - } - - return paging_request(msc->network, subscr, chan_needed, msc); -} - /* Return value is like paging_request_bts(): * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ static int locked_paging_bts(struct gsm_bts *bts, @@ -68,31 +52,14 @@ return paging_request_bts(bts, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - int num_pages = 0; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - * All other bts are either off or in the grace period. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) - num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); - - return num_pages; -} - /** * Page a subscriber in an MSC. * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock * \param[in] subscr subscriber we want to page * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE * \param[in] msc MSC which has issued this paging - * \param[in] bts if not NULL, page via this particular BTS - * \returns number of BTS on which we issued the paging + * \param[in] bts The BTS to issue the paging on + * \returns 1 if paging was issued to the BTS, 0 if not */ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, @@ -100,15 +67,9 @@ struct bsc_msc_data *msc, struct gsm_bts *bts) { - if (bts) { - if (rf_policy == S_RF_ON) - return paging_request_bts(bts, subscr, chan_needed, msc); - return locked_paging_bts(bts, subscr, chan_needed, msc); - } - if (rf_policy == S_RF_ON) - return normal_paging(subscr, chan_needed, msc); - return locked_paging(subscr, chan_needed, msc); + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); } static int handle_sub(struct gsm_lchan *lchan, const char *text) diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index c97393d..1d8fe77 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -41,9 +42,9 @@ /* override, requires '-Wl,--wrap=bsc_grace_paging_request' */ int __real_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, struct gsm_bts *bts); int __wrap_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) + struct bsc_msc_data *msc, struct gsm_bts *bts) { if (subscr->lac == GSM_LAC_RESERVED_ALL_BTS) fprintf(stderr, "BSC paging started on entire BSS (%u)\n", subscr->lac); @@ -86,6 +87,7 @@ int rc; struct gsm_network *net; struct bsc_msc_data *msc; + struct gsm_bts *bts; net = bsc_network_init(NULL, 1, 1); net->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf); @@ -93,6 +95,12 @@ msc = talloc_zero(net, struct bsc_msc_data); msc->network = net; + + bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_UNKNOWN, 0); + if (bts == NULL) { + fprintf(stderr, "gsm_bts_alloc_register() returned NULL\n"); + return; + } log_set_log_level(osmo_stderr_target, LOGL_DEBUG); @@ -102,6 +110,7 @@ msg = msgb_from_hex("test_cell_identifier", 1024, cell_identifier_tests[i].msg); gl_expect_lac = cell_identifier_tests[i].expect_lac; + bts->location_area_code = (gl_expect_lac == GSM_LAC_RESERVED_ALL_BTS ? 0 : gl_expect_lac); rc = bsc_handle_udt(msc, msg, msgb_l2len(msg)); fprintf(stderr, "bsc_handle_udt() returned %d\n", rc); diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index f24ff7c..abe1def 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -2,14 +2,14 @@ 0: DMSC Rx MSC UDT: 00 16 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 03 05 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 1: DMSC Rx MSC UDT: 00 14 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 01 06 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe BSC paging started on entire BSS (65534) bsc_handle_udt() returned 0 @@ -22,6 +22,6 @@ 3: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:08:10 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 11:08:10 +0000 Subject: osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Patch Set 3: (2 comments) https://gerrit.osmocom.org/#/c/5752/3/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 367: > (unrelated whitespace change) This empty line was added intentionally for visual spacing. Are we trying to avoid such extra blank lines in osmocom? Line 392: if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) > I see that the only failure page_subscriber() returns is currently a failur OK, the new patchset keeps iterating the BTS list in case of failure. -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:10:10 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 11:10:10 +0000 Subject: [PATCH] osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... 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/5752 to look at the new patch set (#5). Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c. We can now either page an invidual BTS directly or page several BTS in a given location area. This decision is taken based on the contents of the cell identifier list in the paging request. Select a set of BTS for paging while processing the cell identifier list, rather than requiring the paging layer to loop over all BTS in the MSC. This change requires some adjustment in bssap_test. In particular, this test must now add a BTS to its network in order to pass. The purpose of this change is to make the layering a bit cleaner. There is one functional change: We no longer abort paging if paging fails for a particular BTS. Instead, we keep trying to page on other BTS. Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Suggested-by: Harald Welte Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Related: OS#2753 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 5 files changed, 54 insertions(+), 75 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/52/5752/5 diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 2b1bc50..2be71c3 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -56,8 +56,6 @@ }; /* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc); int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index a02ea9e..e3a30f5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,14 +228,16 @@ return 0; } -/* Page a subscriber based on TMSI and LAC in the specified MSC. - * If BTS is not NULL, page the subscriber via this particular BTS. - * A non-zero return value indicates a fatal out of memory condition. */ +/* Page a subscriber based on TMSI and LAC via the specified BTS. + * The msc parameter is the MSC which issued the corresponding paging request. + * Returns 1 if the paging request could be issued, 0 if not. + * A negative return value indicates an error. */ static int page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; + int ret; subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, mi_string); @@ -247,19 +249,15 @@ subscr->lac = lac; subscr->tmsi = tmsi; - if (bts) - LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", - bts->nr, mi_string, tmsi, tmsi, lac); - else - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc, bts); + ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); - return 0; + return ret; } /* GSM 08.08 ? 3.2.1.19 */ @@ -277,6 +275,7 @@ const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; + struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -353,7 +352,6 @@ uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { uint16_t ci = osmo_load16be(ci_be); - struct gsm_bts *bts; llist_for_each_entry(bts, &msc->network->bts_list, list) { if (bts->cell_identity == ci) @@ -361,11 +359,12 @@ } if (bts) { - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) - break; - } else + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } else { LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", mi_string, ci); + } remain -= sizeof(*ci_be); ci_be++; } @@ -387,13 +386,17 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; - } else + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } + } else { LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - + } remain -= sizeof(lai); i++; } @@ -404,8 +407,12 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } remain -= sizeof(*lacp_be); lacp_be++; } @@ -417,16 +424,20 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 93ca9b9..705933c 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -34,22 +34,6 @@ } -static int normal_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - /* we can't page by lac.. we need to page everything */ - if (msc->core_lac != -1) { - struct gsm_bts *bts; - - llist_for_each_entry(bts, &msc->network->bts_list, list) - paging_request_bts(bts, subscr, chan_needed, msc); - - return 0; - } - - return paging_request(msc->network, subscr, chan_needed, msc); -} - /* Return value is like paging_request_bts(): * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ static int locked_paging_bts(struct gsm_bts *bts, @@ -68,31 +52,14 @@ return paging_request_bts(bts, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - int num_pages = 0; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - * All other bts are either off or in the grace period. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) - num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); - - return num_pages; -} - /** * Page a subscriber in an MSC. * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock * \param[in] subscr subscriber we want to page * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE * \param[in] msc MSC which has issued this paging - * \param[in] bts if not NULL, page via this particular BTS - * \returns number of BTS on which we issued the paging + * \param[in] bts The BTS to issue the paging on + * \returns 1 if paging was issued to the BTS, 0 if not */ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, @@ -100,15 +67,9 @@ struct bsc_msc_data *msc, struct gsm_bts *bts) { - if (bts) { - if (rf_policy == S_RF_ON) - return paging_request_bts(bts, subscr, chan_needed, msc); - return locked_paging_bts(bts, subscr, chan_needed, msc); - } - if (rf_policy == S_RF_ON) - return normal_paging(subscr, chan_needed, msc); - return locked_paging(subscr, chan_needed, msc); + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); } static int handle_sub(struct gsm_lchan *lchan, const char *text) diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index c97393d..1d8fe77 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -41,9 +42,9 @@ /* override, requires '-Wl,--wrap=bsc_grace_paging_request' */ int __real_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, struct gsm_bts *bts); int __wrap_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) + struct bsc_msc_data *msc, struct gsm_bts *bts) { if (subscr->lac == GSM_LAC_RESERVED_ALL_BTS) fprintf(stderr, "BSC paging started on entire BSS (%u)\n", subscr->lac); @@ -86,6 +87,7 @@ int rc; struct gsm_network *net; struct bsc_msc_data *msc; + struct gsm_bts *bts; net = bsc_network_init(NULL, 1, 1); net->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf); @@ -93,6 +95,12 @@ msc = talloc_zero(net, struct bsc_msc_data); msc->network = net; + + bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_UNKNOWN, 0); + if (bts == NULL) { + fprintf(stderr, "gsm_bts_alloc_register() returned NULL\n"); + return; + } log_set_log_level(osmo_stderr_target, LOGL_DEBUG); @@ -102,6 +110,7 @@ msg = msgb_from_hex("test_cell_identifier", 1024, cell_identifier_tests[i].msg); gl_expect_lac = cell_identifier_tests[i].expect_lac; + bts->location_area_code = (gl_expect_lac == GSM_LAC_RESERVED_ALL_BTS ? 0 : gl_expect_lac); rc = bsc_handle_udt(msc, msg, msgb_l2len(msg)); fprintf(stderr, "bsc_handle_udt() returned %d\n", rc); diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index f24ff7c..abe1def 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -2,14 +2,14 @@ 0: DMSC Rx MSC UDT: 00 16 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 03 05 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 1: DMSC Rx MSC UDT: 00 14 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 01 06 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe BSC paging started on entire BSS (65534) bsc_handle_udt() returned 0 @@ -22,6 +22,6 @@ 3: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:11:14 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 11:11:14 +0000 Subject: osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/5752/3/src/osmo-bsc/osmo_bsc_bssap.c File src/osmo-bsc/osmo_bsc_bssap.c: Line 367: > This empty line was added intentionally for visual spacing. Nevermind, I've pushed another patch set which renders this moot because this else block requires braces anyway. -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:13:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:13:42 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#7). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 51 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/7 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..d4f2a52 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,58 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + if [ "x${INSTR}" = "x--with-neon" ] || [ "x${INSTR}" = "x--with-neon-vfpv4" ]; then + #apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot + mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" + } + + mychroot() { + mychroot_nocwd -w / "$@" + } + + CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + OSMOTRX_DIR="${CONTRIB_DIR}/.." + PREFIX="${WORKSPACE:-vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # This is not needed after switching to proot: + #if [ ! -f /proc/sys/fs/binfmt_misc/arm ]; then + # echo ':arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-static:' | tee /proc/sys/fs/binfmt_misc/register + #fi + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + PATH="$PATH:/usr/sbin:/sbin" fakeroot debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..767ce92 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(test ! "uname -m | grep x86") cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 7 Gerrit-Project: osmo-trx 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 Mon Jan 15 11:15:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:15:20 +0000 Subject: osmo-trx[master]: tests: SocketTests: Pick OS-assigned instead of setting one ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5780 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iea213375e489a56cf8ed3e47fe814e17c288803e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:15:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 11:15:26 +0000 Subject: [PATCH] osmo-sgsn[master]: Generate random IOV-UI and send it via XID Message-ID: Review at https://gerrit.osmocom.org/5788 Generate random IOV-UI and send it via XID This ensures that encryption is using random IV value as per-spec instead of hard-coded 0. Change-Id: I7b6e2268cb28451434116463ecd3ce5f68400832 Fixes: OS#1794 --- M include/osmocom/sgsn/gprs_llc.h M src/gprs/gprs_llc.c 2 files changed, 27 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/88/5788/1 diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h index 376ae9a..f5643da 100644 --- a/include/osmocom/sgsn/gprs_llc.h +++ b/include/osmocom/sgsn/gprs_llc.h @@ -238,6 +238,8 @@ int gprs_llgmm_reset_oldmsg(struct msgb* oldmsg, uint8_t sapi, struct gprs_llc_llme *llme); +bool gprs_llgmm_gen_iov_ui(struct gprs_llc_llme *llme); + /* Set of LL-XID negotiation (See also: TS 101 351, Section 7.2.2.4) */ int gprs_ll_xid_req(struct gprs_llc_lle *lle, struct gprs_llc_xid_field *l3_xid_field); diff --git a/src/gprs/gprs_llc.c b/src/gprs/gprs_llc.c index 6c92f83..11c5cc5 100644 --- a/src/gprs/gprs_llc.c +++ b/src/gprs/gprs_llc.c @@ -49,6 +49,19 @@ /* BEGIN XID RELATED */ +bool gprs_llgmm_gen_iov_ui(struct gprs_llc_llme *llme) +{ + if (llme->algo != GPRS_ALGO_GEA0) { + int rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); + if (rc < 0) { + LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); + return false; + } + return true; + } + return false; +} + /* Generate XID message */ static int gprs_llc_generate_xid(uint8_t *bytes, int bytes_len, struct gprs_llc_xid_field *l3_xid_field, @@ -58,9 +71,15 @@ LLIST_HEAD(xid_fields); + struct gprs_llc_xid_field xid_iov_ui; struct gprs_llc_xid_field xid_version; struct gprs_llc_xid_field xid_n201u; struct gprs_llc_xid_field xid_n201i; + + bool iov = gprs_llgmm_gen_iov_ui(llme); + xid_iov_ui.type = GPRS_LLC_XID_T_IOV_UI; + xid_iov_ui.data = (uint8_t *) &llme->iov_ui; + xid_iov_ui.data_len = 4; xid_version.type = GPRS_LLC_XID_T_VERSION; xid_version.data = (uint8_t *) "\x00"; @@ -75,6 +94,10 @@ xid_n201i.data_len = 2; /* Add locally managed XID Fields */ + if (iov) + llist_add(&xid_iov_ui.list, &xid_fields); + LOGP(DLLC, LOGL_NOTICE, "XID gen with iov %d\n", iov); + llist_add(&xid_version.list, &xid_fields); llist_add(&xid_n201u.list, &xid_fields); llist_add(&xid_n201i.list, &xid_fields); @@ -1074,12 +1097,7 @@ uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - - rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); - if (rc < 0) { - LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); - return rc; - } + gprs_llgmm_gen_iov_ui(llme); /* Generate XID message */ xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, @@ -1108,12 +1126,7 @@ uint8_t *xid; LOGP(DLLC, LOGL_NOTICE, "LLGM Reset\n"); - - rc = osmo_get_rand_id((uint8_t *) &llme->iov_ui, 4); - if (rc < 0) { - LOGP(DLLC, LOGL_ERROR, "osmo_get_rand_id() failed for LLC XID reset: %s\n", strerror(-rc)); - return rc; - } + gprs_llgmm_gen_iov_ui(llme); /* Generate XID message */ xid_bytes_len = gprs_llc_generate_xid_for_gmm_reset(xid_bytes, -- To view, visit https://gerrit.osmocom.org/5788 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7b6e2268cb28451434116463ecd3ce5f68400832 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:15:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:15:37 +0000 Subject: osmo-trx[master]: tests: SocketsTest: Avoid hang forever if test fails In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:16:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:16:00 +0000 Subject: osmo-trx[master]: tests: SocketsTest: Fail test on write fail In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5782 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6b778a2225339ebd2eaa80b3fca6ee8d8646b23 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:16:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 11:16:25 +0000 Subject: osmo-sgsn[master]: Generate random IOV-UI and send it via XID In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Not ready for merge yet, published to abandon old OpenBSC patch. -- To view, visit https://gerrit.osmocom.org/5788 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b6e2268cb28451434116463ecd3ce5f68400832 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:16:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:16:37 +0000 Subject: osmo-trx[master]: tests: TimevalTest: refactor and avoid double comparison In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id4324be8ece86d371b1acb46bbd97856dfed241d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:16:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 11:16:55 +0000 Subject: [ABANDON] openbsc[master]: Generate random IOV-UI and send it via XID In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Generate random IOV-UI and send it via XID ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1462 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ia71d6ac668a629d0377dd5c685e1dcd166def1a4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:17:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:17:22 +0000 Subject: [MERGED] osmo-trx[master]: tests: TimevalTest: refactor and avoid double comparison In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: tests: TimevalTest: refactor and avoid double comparison ...................................................................... tests: TimevalTest: refactor and avoid double comparison Before this patch, the experession assert(then_secondws==then.seconds()) was failing in x86 architecture (and passing when adding a fprintf to debug it). Avoid comparing the double values with == as that's usually a bad idea, since the processor can output slightly different results for the same operation depending on how it is optimized. Use timespec() instead to check the invariant. Take the chance to refactor some variables around to make the test easier to read. Change-Id: Id4324be8ece86d371b1acb46bbd97856dfed241d --- M tests/CommonLibs/TimevalTest.cpp 1 file changed, 15 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/TimevalTest.cpp b/tests/CommonLibs/TimevalTest.cpp index f579878..61a92c9 100644 --- a/tests/CommonLibs/TimevalTest.cpp +++ b/tests/CommonLibs/TimevalTest.cpp @@ -29,24 +29,30 @@ #include "Timeval.h" #include #include +#include using namespace std; int main(int argc, char *argv[]) { - Timeval then(10000); - assert(then.elapsed() == -10000); - cerr << then << " elapsed: " << then.elapsed() << endl; - double then_seconds = then.seconds(); - double last_now = Timeval().seconds(); long last_remaining = 10000; + Timeval then(last_remaining); + assert(then.elapsed() == -last_remaining); + cerr << then << " elapsed: " << then.elapsed() << endl; + + /* Check that last_remaining parameter affects setting time in the future */ + usleep(10000); + double increased_time_secs = Timeval().seconds(); + assert(increased_time_secs <= then.seconds()); + + struct timespec invariant_time = then.timespec(); int loops = 0; while (!then.passed()) { - double tnow = Timeval().seconds(); - cerr << "now: " << tnow << " then: " << then << " remaining: " << then.remaining() << endl; - assert(last_now <= tnow && last_remaining >= then.remaining()); - assert(then_seconds == then.seconds()); + struct timespec tspecnow = then.timespec(); + cerr << "now: " << Timeval().seconds() << " then: " << then << " remaining: " << then.remaining() << endl; + assert(last_remaining >= then.remaining()); + assert(tspecnow.tv_sec == invariant_time.tv_sec && tspecnow.tv_nsec == invariant_time.tv_nsec); usleep(500000); loops++; } -- To view, visit https://gerrit.osmocom.org/5787 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id4324be8ece86d371b1acb46bbd97856dfed241d Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:17:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:17:22 +0000 Subject: [MERGED] osmo-trx[master]: tests: SocketsTest: Fail test on write fail In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: tests: SocketsTest: Fail test on write fail ...................................................................... tests: SocketsTest: Fail test on write fail Change-Id: Ib6b778a2225339ebd2eaa80b3fca6ee8d8646b23 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index bde86b8..c4e31d8 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -61,6 +61,7 @@ int main(int argc, char * argv[] ) { + int count; if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) { perror("signal"); @@ -82,7 +83,12 @@ sleep(1); for (int i=0; i Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:17:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:17:23 +0000 Subject: [MERGED] osmo-trx[master]: tests: SocketsTest: Avoid hang forever if test fails In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: tests: SocketsTest: Avoid hang forever if test fails ...................................................................... tests: SocketsTest: Avoid hang forever if test fails Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 15 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 9a7d6f0..bde86b8 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -30,10 +30,16 @@ #include "Threads.h" #include #include - +#include +#include static const int gNumToSend = 10; +static void sigalarm_handler(int foo) +{ + printf("FAIL: test did not run successfully\n"); + exit(EXIT_FAILURE); +} void *testReaderIP(void *param) { @@ -56,6 +62,14 @@ int main(int argc, char * argv[] ) { + if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) { + perror("signal"); + exit(EXIT_FAILURE); + } + + /* If the test takes longer than 2*gNumToSend seconds, abort it */ + alarm(2* gNumToSend); + UDPSocket readSocket("127.0.0.1", 0); UDPSocket socket1("127.0.0.1", 0, "localhost", readSocket.port()); -- To view, visit https://gerrit.osmocom.org/5781 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia95e216a2ab6d397ab02c828b70f2b95d1671257 Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:17:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:17:23 +0000 Subject: [MERGED] osmo-trx[master]: tests: SocketTests: Pick OS-assigned instead of setting one ... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: tests: SocketTests: Pick OS-assigned instead of setting one manually ...................................................................... tests: SocketTests: Pick OS-assigned instead of setting one manually This fixes failures if the port is already being taken by other apps or if this test is run several times concurrently in the same system. Change-Id: Iea213375e489a56cf8ed3e47fe814e17c288803e --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 10 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index 235b8f3..9a7d6f0 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -35,14 +35,14 @@ static const int gNumToSend = 10; -void *testReaderIP(void *) +void *testReaderIP(void *param) { - UDPSocket readSocket("127.0.0.1", 5934, "localhost", 5061); - readSocket.nonblocking(); + UDPSocket *readSocket = (UDPSocket *)param; + readSocket->nonblocking(); int rc = 0; while (rcread(buf, MAX_UDP_LENGTH); if (count>0) { CERR("read: " << buf); rc++; @@ -56,12 +56,13 @@ int main(int argc, char * argv[] ) { + UDPSocket readSocket("127.0.0.1", 0); + UDPSocket socket1("127.0.0.1", 0, "localhost", readSocket.port()); + + CERR("socket1: " << socket1.port() << ", readSocket: " << readSocket.port()); + Thread readerThreadIP; - readerThreadIP.start(testReaderIP,NULL); - - UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934); - - CERR("socket1: " << socket1.port()); + readerThreadIP.start(testReaderIP, &readSocket); // give the readers time to open sleep(1); -- To view, visit https://gerrit.osmocom.org/5780 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iea213375e489a56cf8ed3e47fe814e17c288803e Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:17:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:17:25 +0000 Subject: osmo-ci[master]: master-builds.yml: osmo-sgsn: Remove duplicated concurrent a... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32938d4c1854ce65faa718eccaecb5e3143dbcd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:17:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:17:43 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: Build osmo-trx with different opti... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1d73165a397d98d8fb630f7adec45f00887c139a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:18:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:18:08 +0000 Subject: osmo-pcu[master]: Fix sanitizer build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b 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 Mon Jan 15 11:18:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:18:32 +0000 Subject: osmo-pcu[master]: Allocate global context for TypesTest In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 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 Mon Jan 15 11:18:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:18:43 +0000 Subject: osmo-ci[master]: master-builds.yml: osmo-sgsn: Remove duplicated concurrent a... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32938d4c1854ce65faa718eccaecb5e3143dbcd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:18:47 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:18:47 +0000 Subject: [MERGED] osmo-ci[master]: master-builds.yml: osmo-sgsn: Remove duplicated concurrent a... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: master-builds.yml: osmo-sgsn: Remove duplicated concurrent attribute ...................................................................... master-builds.yml: osmo-sgsn: Remove duplicated concurrent attribute Change-Id: I32938d4c1854ce65faa718eccaecb5e3143dbcd0 --- M jobs/master-builds.yml 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index ca1ef80..b5ec651 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -215,7 +215,6 @@ (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") - osmo-sgsn: - concurrent: true a1_name: IU a1: !!python/tuple [--enable-iu, --disable-iu] concurrent: true -- To view, visit https://gerrit.osmocom.org/5783 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32938d4c1854ce65faa718eccaecb5e3143dbcd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:18:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:18:48 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: Build osmo-trx with different opti... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: gerrit-verifications.yml: Build osmo-trx with different optimization instruction sets enabled ...................................................................... gerrit-verifications.yml: Build osmo-trx with different optimization instruction sets enabled Change-Id: I1d73165a397d98d8fb630f7adec45f00887c139a --- M jobs/gerrit-verifications.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 192d0ad..9cb12a5 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -179,6 +179,9 @@ - osmo-trx: slave_axis: !!python/tuple [OsmocomBuild1] + a1_name: INSTR + a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] + concurrent: true - osmocom-bb - osmo-tetra -- To view, visit https://gerrit.osmocom.org/5784 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1d73165a397d98d8fb630f7adec45f00887c139a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:18:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 11:18:48 +0000 Subject: [MERGED] osmo-ci[master]: master-builds.yml: Build osmo-trx with different optimizatio... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: master-builds.yml: Build osmo-trx with different optimization instruction sets enabled ...................................................................... master-builds.yml: Build osmo-trx with different optimization instruction sets enabled Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf --- M jobs/master-builds.yml 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index b5ec651..84a97a9 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -236,6 +236,9 @@ - osmo-trx: slave_axis: !!python/tuple [OsmocomBuild1] + a1_name: INSTR + a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] + concurrent: true - osmocom-bb -- To view, visit https://gerrit.osmocom.org/5759 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I651e182dfd62ef4b88d013d8b5960ce7e3562ecf Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:19:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:19:27 +0000 Subject: osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:21:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 11:21:54 +0000 Subject: osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:22:26 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 11:22:26 +0000 Subject: [PATCH] osmo-bsc[master]: Implement support for paging based on a Cell Global 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/5756 to look at the new patch set (#3). Implement support for paging based on a Cell Global Identifier. This is essentially a case which combines paging by LAI and CI. Depends: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 50 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/56/5756/3 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index e3a30f5..04541c2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -260,6 +260,19 @@ return ret; } +/* Decode 5-byte LAI list element data (see TS 08.08 3.2.2.27) into MCC/MNC/LAC. + * Return 0 if successful, negative on error. */ +static int +decode_lai(const uint8_t *data, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) +{ + struct gsm48_loc_area_id lai; + + /* Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + memcpy(&lai, data, sizeof(lai)); /* don't byte swap yet */ + + return gsm48_decode_lai(&lai, mcc, mnc, lac) != 0 ? -1 : 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) @@ -348,6 +361,40 @@ LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ + case CELL_IDENT_WHOLE_GLOBAL: { + uint16_t ci; + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { + uint16_t *ci_be; + size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); + if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); + ci = osmo_load16be(ci_be); + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } + } else { + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + } + remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); + i++; + } + } + case CELL_IDENT_CI: { uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { @@ -372,13 +419,9 @@ } case CELL_IDENT_LAI_AND_LAC: { - struct gsm48_loc_area_id lai; int i = 0; - while (remain >= sizeof(lai)) { - /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). - * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ - memcpy(&lai, &data[1 + i * sizeof(lai)], sizeof(lai)); /* don't byte swap yet */ - if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + while (remain >= sizeof(struct gsm48_loc_area_id)) { + if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " "for BSS (0x%x), paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); @@ -397,7 +440,7 @@ "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); } - remain -= sizeof(lai); + remain -= sizeof(struct gsm48_loc_area_id); i++; } break; -- To view, visit https://gerrit.osmocom.org/5756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 11:50:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 11:50:43 +0000 Subject: python/osmo-python-tests[master]: Fix absolute import issue in py3 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 (1 comment) I have reservations but if this fixes the build... you decide https://gerrit.osmocom.org/#/c/5777/2/tests/test_py3.py File tests/test_py3.py: Line 8: # from ..osmopy.osmo_ipa import Ctrl In osmo-gsm-tester we use 'from . import foo'. Also possible could be a symlink ln -s ../osmopy . which would allow 'from osmopy', as we use in the scripts/ subdir. Also possible would be invoking the script with a PYTHONPATH env variable set. I'd prefer either of those to mangling the python path ... I know I also did that some while back in some vty tests py scripts in openbsc.git IIRC, but I didn't know better back then. -- To view, visit https://gerrit.osmocom.org/5777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:20:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 12:20:57 +0000 Subject: python/osmo-python-tests[master]: Fix absolute import issue in py3 In-Reply-To: References: Message-ID: Patch Set 2: > In osmo-gsm-tester we use 'from . import foo'. That won't work because tests are in separate subdirectory so we should go one level up. > possible could be a symlink I'd rather keep it in one single place next to comment with explanation. > with a PYTHONPATH env variable set I think this is discouraged. Also see previous comment. > I'd prefer either of those to mangling the python path I'd prefer to make "from ..osmopy" working but let's first fix the immediate problem at hand and do "nice to have" things later on. -- To view, visit https://gerrit.osmocom.org/5777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests 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-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:21:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 12:21:00 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Fix absolute import issue in py3 In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix absolute import issue in py3 ...................................................................... Fix absolute import issue in py3 As of 577f2a95e4f01c58a0a4f4ccb3b70d9c048b626e in osmo-ci, the contrib/jenkins.sh isused forinstallation. This causes the issue with python3 because test coded use absolute import by default. Fix this by adding relative path and import from ../osmopy to make sure test code uses the current module and not the one which might be already installed in the system. Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 --- M osmopy/__init__.py M tests/test_py3.py 2 files changed, 7 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/osmopy/__init__.py b/osmopy/__init__.py index d3d3005..c3d4b8c 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.0.7' +__version__ = '0.0.8' __all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] diff --git a/tests/test_py3.py b/tests/test_py3.py index 3a96d9f..909d057 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -2,7 +2,12 @@ # just a smoke test for osmopy -import asyncio, random +import asyncio, random, sys, os + +# we have to use this ugly hack to workaroundbrokenrelative imports in py3: +# from ..osmopy.osmo_ipa import Ctrl +# does not work as expected +sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from osmopy.osmo_ipa import Ctrl from osmopy import __version__ -- To view, visit https://gerrit.osmocom.org/5777 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ac3c0d45fb2e1d18646048703ac405be1c7e539 Gerrit-PatchSet: 2 Gerrit-Project: python/osmo-python-tests 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-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:50:40 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 12:50:40 +0000 Subject: [PATCH] osmo-ci[master]: docker: debian: install stow, now used in various builds Message-ID: Review at https://gerrit.osmocom.org/5789 docker: debian: install stow, now used in various builds Recent change I8f5012419495a656912b7b71e4f76ce102c6b63a adds use of stow in osmo-build-dep.sh, hence our jenkins build processes now require the 'stow' dependency. Add 'stow' to our debian docker images, used for various builds (those that invoke 'docker' in the jobs/master-builds.yml and jobs/gerrit-verifications.yml to produce concurrent builds). Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 --- M docker/Dockerfile.deb8_amd64 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/89/5789/1 diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 3fdcd6a..4d9966f 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -29,7 +29,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi # building -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow # for osmo-python-tests RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools -- To view, visit https://gerrit.osmocom.org/5789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:53:27 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 12:53:27 +0000 Subject: [PATCH] osmo-ci[master]: docker: debian: install stow, now used in various builds In-Reply-To: References: Message-ID: docker: debian: install stow, now used in various builds Recent change I8f5012419495a656912b7b71e4f76ce102c6b63a adds use of stow in osmo-build-dep.sh, hence our jenkins build processes now require the 'stow' dependency. Add 'stow' to our debian docker images, used for various builds (those that invoke 'docker' in the jobs/master-builds.yml and jobs/gerrit-verifications.yml to produce concurrent builds). Note: the Dockerfile.deb8_i386 doesn't seem to be used, currently. Add stow there anyway. Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 --- M docker/Dockerfile.deb8_amd64 M docker/Dockerfile.deb8_i386 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/89/5789/2 diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 3fdcd6a..4d9966f 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -29,7 +29,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi # building -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow # for osmo-python-tests RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools diff --git a/docker/Dockerfile.deb8_i386 b/docker/Dockerfile.deb8_i386 index 9beb188..4d8498c 100644 --- a/docker/Dockerfile.deb8_i386 +++ b/docker/Dockerfile.deb8_i386 @@ -6,7 +6,7 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget make # building -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc g++ make git RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sudo -- To view, visit https://gerrit.osmocom.org/5789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:53:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 12:53:56 +0000 Subject: osmo-ci[master]: README: also hint at /n/home/dub8/.config/jenkins_job_builde... In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:53:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 12:53:57 +0000 Subject: [MERGED] osmo-ci[master]: README: also hint at /n/home/dub8/.config/jenkins_job_builde... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: README: also hint at /n/home/dub8/.config/jenkins_job_builder/jenkins_jobs.ini ...................................................................... README: also hint at /n/home/dub8/.config/jenkins_job_builder/jenkins_jobs.ini Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee --- M jobs/README.adoc 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/README.adoc b/jobs/README.adoc index 6532825..2bc8df2 100644 --- a/jobs/README.adoc +++ b/jobs/README.adoc @@ -9,9 +9,12 @@ apt-get install jenkins-job-builder -Have a jenkins-job-builder.ini file. Convenient is to place a system wide one, -if you're the only one using the system, at /etc/jenkins_jobs/jenkins_jobs.ini; -otherwise place one in here and pass it to jenkins-jobs using the --conf file. +Have a jenkins-job-builder.ini file. One of + + ~/.config/jenkins_jobs/jenkins_jobs.ini + /etc/jenkins_jobs/jenkins_jobs.ini + +or place one in here and pass it to jenkins-jobs using the --conf file. Make sure the file not world readable to minimally safeguard your jenkins password. -- To view, visit https://gerrit.osmocom.org/5774 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8bb6792ab061edd3d688e387fa69cd8637617dee Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:54:20 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 12:54:20 +0000 Subject: osmo-ci[master]: docker: debian: install stow, now used in various builds In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 12:54:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 12:54:22 +0000 Subject: [MERGED] osmo-ci[master]: docker: debian: install stow, now used in various builds In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: docker: debian: install stow, now used in various builds ...................................................................... docker: debian: install stow, now used in various builds Recent change I8f5012419495a656912b7b71e4f76ce102c6b63a adds use of stow in osmo-build-dep.sh, hence our jenkins build processes now require the 'stow' dependency. Add 'stow' to our debian docker images, used for various builds (those that invoke 'docker' in the jobs/master-builds.yml and jobs/gerrit-verifications.yml to produce concurrent builds). Note: the Dockerfile.deb8_i386 doesn't seem to be used, currently. Add stow there anyway. Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 --- M docker/Dockerfile.deb8_amd64 M docker/Dockerfile.deb8_i386 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 3fdcd6a..4d9966f 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -29,7 +29,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi # building -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow # for osmo-python-tests RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools diff --git a/docker/Dockerfile.deb8_i386 b/docker/Dockerfile.deb8_i386 index 9beb188..4d8498c 100644 --- a/docker/Dockerfile.deb8_i386 +++ b/docker/Dockerfile.deb8_i386 @@ -6,7 +6,7 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends wget make # building -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc g++ make git RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends sudo -- To view, visit https://gerrit.osmocom.org/5789 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a44ba5ed130a3311460185507f76151c6daa7f1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:00:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:00:33 +0000 Subject: [PATCH] osmo-ci[master]: docker: debian: install stow IN THE RIGHT dockerfile Message-ID: Review at https://gerrit.osmocom.org/5790 docker: debian: install stow IN THE RIGHT dockerfile Recent change I8f5012419495a656912b7b71e4f76ce102c6b63a adds use of stow in osmo-build-dep.sh, hence our jenkins build processes now require the 'stow' dependency. Add 'stow' to our debian docker images, used for various builds (those that invoke 'docker' in the jobs/master-builds.yml and jobs/gerrit-verifications.yml to produce concurrent builds). A recent commit made this change in the Dockerfile.deb8_* dockerfiles, in the assumption that the jenkins one would depend on that, which is actually not the case. Instead, add stow in the dockerfile that is actually used in the jenkins jobs. (It is not harmful to still keep the added dependency in the other two dockerfiles.) Change-Id: If97176f4aea66c42a6820f14ceb4b91369841ca0 --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/90/5790/1 diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 45f722f..547790c 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -38,7 +38,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc # and all -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client stow ADD http://git.osmocom.org/python/osmo-python-tests/patch /tmp/commit RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && ./contrib/jenkins.sh -- To view, visit https://gerrit.osmocom.org/5790 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If97176f4aea66c42a6820f14ceb4b91369841ca0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:00:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:00:59 +0000 Subject: osmo-ci[master]: docker: debian: install stow IN THE RIGHT dockerfile In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5790 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If97176f4aea66c42a6820f14ceb4b91369841ca0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:01:04 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:01:04 +0000 Subject: [MERGED] osmo-ci[master]: docker: debian: install stow IN THE RIGHT dockerfile In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: docker: debian: install stow IN THE RIGHT dockerfile ...................................................................... docker: debian: install stow IN THE RIGHT dockerfile Recent change I8f5012419495a656912b7b71e4f76ce102c6b63a adds use of stow in osmo-build-dep.sh, hence our jenkins build processes now require the 'stow' dependency. Add 'stow' to our debian docker images, used for various builds (those that invoke 'docker' in the jobs/master-builds.yml and jobs/gerrit-verifications.yml to produce concurrent builds). A recent commit made this change in the Dockerfile.deb8_* dockerfiles, in the assumption that the jenkins one would depend on that, which is actually not the case. Instead, add stow in the dockerfile that is actually used in the jenkins jobs. (It is not harmful to still keep the added dependency in the other two dockerfiles.) Change-Id: If97176f4aea66c42a6820f14ceb4b91369841ca0 --- M docker/Dockerfile_osmocom_jenkins.amd64 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 45f722f..547790c 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -38,7 +38,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc # and all -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y doxygen g++ libtalloc-dev libpcsclite-dev make gcc pkgconf libtool autoconf autoconf-archive automake libortp-dev asciidoc mscgen git libsctp-dev libpcap-dev osc libc-ares-dev libgps-dev libsofia-sip-ua-glib-dev libssl-dev libsqlite3-dev libusb-dev libffi-dev libfftw3-dev flex bison libdbi-dev libsnmp-dev libncurses5-dev libgsm1-dev python-minimal python3 libdbd-sqlite3 cppcheck htop libgmp-dev gawk texinfo flex bison bc libsigsegv-dev libffi-dev libusb-1.0-0-dev libreadline-dev debhelper devscripts gcc-arm-none-eabi git-buildpackage dh-systemd dh-autoreconf bc openssh-client stow ADD http://git.osmocom.org/python/osmo-python-tests/patch /tmp/commit RUN git clone git://git.osmocom.org/python/osmo-python-tests && cd osmo-python-tests && ./contrib/jenkins.sh -- To view, visit https://gerrit.osmocom.org/5790 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If97176f4aea66c42a6820f14ceb4b91369841ca0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:10:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 13:10:37 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Print version before tests Message-ID: Review at https://gerrit.osmocom.org/5791 Print version before tests This helps with debugging of import-related issues - we know the version under test before the test has a chance to hang. Change-Id: If13cba60a19e9c15885355f85def4d134fa37993 Related: OS#2821 --- M osmopy/__init__.py M tests/test_py3.py 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/91/5791/1 diff --git a/osmopy/__init__.py b/osmopy/__init__.py index c3d4b8c..4e818ed 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.0.8' +__version__ = '0.0.9' __all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] diff --git a/tests/test_py3.py b/tests/test_py3.py index 909d057..1c0c19b 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -38,6 +38,8 @@ test_host = '127.0.0.5' test_port = str(random.randint(1025, 60000)) + print('Testing v%s on %s:%s' % (__version__, test_host, test_port)) + # Each client connection will create a new protocol instance server = loop.run_until_complete(loop.create_server(CtrlProtocol, test_host, test_port)) -- To view, visit https://gerrit.osmocom.org/5791 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If13cba60a19e9c15885355f85def4d134fa37993 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:17:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:17:52 +0000 Subject: [PATCH] osmo-ci[master]: docker: rebuild: if building fails, try a --no-cache build Message-ID: Review at https://gerrit.osmocom.org/5792 docker: rebuild: if building fails, try a --no-cache build Building a docker image depending on a debian upstream has the problem that an intermediate build result will depend on an APT package archive that is probable to become outdated. It's necessary to do an 'apt-get update' regularly to get the newest package archives and be able to install new packages. We never know which 'apt-get install' steps we might be editing, so we'd have to add an 'apt-get update' before each, or use an ADD line to find out whether the package archive has changed, before each and every apt-get install step. We're likely to miss those in the future, and it would be a large, complex change. Instead, try to build the docker image with --no-cache in case a cached build has failed. This should fetch the most recent debian upstream with a proper archive. Fixes the current problem that the rebuild_osmocom_jenkins_image.sh is stuck on various build slaves, should trigger a --no-cache build on each slave. Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/92/5792/1 diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index 4b2d359..b49292a 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -1,2 +1,4 @@ #!/bin/sh -docker build -t osmocom:amd64 - < Dockerfile_osmocom_jenkins.amd64 +# In case the debian apt archive has become out of sync, try a --no-cache build if it fails. +docker build -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . \ + || docker build --no-cache -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . -- To view, visit https://gerrit.osmocom.org/5792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:25:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 13:25:36 +0000 Subject: [PATCH] python/osmo-python-tests[master]: Fix install in the presence of old modules Message-ID: Review at https://gerrit.osmocom.org/5793 Fix install in the presence of old modules If older incompatible version of osmopython is already available, it might be chosen fori mport instead of current version. Fix this by explicitly prepending the proper version to path. Change-Id: Icbe2af1e3815406213be29e0c0360432dc9fd6fb Related: OS#2821 --- M tests/test_py3.py 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/python/osmo-python-tests refs/changes/93/5793/1 diff --git a/tests/test_py3.py b/tests/test_py3.py index 1c0c19b..0d526a9 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -7,7 +7,7 @@ # we have to use this ugly hack to workaroundbrokenrelative imports in py3: # from ..osmopy.osmo_ipa import Ctrl # does not work as expected -sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from osmopy.osmo_ipa import Ctrl from osmopy import __version__ -- To view, visit https://gerrit.osmocom.org/5793 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbe2af1e3815406213be29e0c0360432dc9fd6fb Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:26:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:26:52 +0000 Subject: osmo-ci[master]: docker: rebuild: if building fails, try a --no-cache build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:26:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:26:55 +0000 Subject: [MERGED] osmo-ci[master]: docker: rebuild: if building fails, try a --no-cache build In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: docker: rebuild: if building fails, try a --no-cache build ...................................................................... docker: rebuild: if building fails, try a --no-cache build Building a docker image depending on a debian upstream has the problem that an intermediate build result will depend on an APT package archive that is probable to become outdated. It's necessary to do an 'apt-get update' regularly to get the newest package archives and be able to install new packages. We never know which 'apt-get install' steps we might be editing, so we'd have to add an 'apt-get update' before each, or use an ADD line to find out whether the package archive has changed, before each and every apt-get install step. We're likely to miss those in the future, and it would be a large, complex change. Instead, try to build the docker image with --no-cache in case a cached build has failed. This should fetch the most recent debian upstream with a proper archive. Fixes the current problem that the rebuild_osmocom_jenkins_image.sh is stuck on various build slaves, should trigger a --no-cache build on each slave. Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3 --- M docker/rebuild_osmocom_jenkins_image.sh 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/docker/rebuild_osmocom_jenkins_image.sh b/docker/rebuild_osmocom_jenkins_image.sh index 4b2d359..b49292a 100755 --- a/docker/rebuild_osmocom_jenkins_image.sh +++ b/docker/rebuild_osmocom_jenkins_image.sh @@ -1,2 +1,4 @@ #!/bin/sh -docker build -t osmocom:amd64 - < Dockerfile_osmocom_jenkins.amd64 +# In case the debian apt archive has become out of sync, try a --no-cache build if it fails. +docker build -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . \ + || docker build --no-cache -t osmocom:amd64 -f Dockerfile_osmocom_jenkins.amd64 . -- To view, visit https://gerrit.osmocom.org/5792 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37110287dabd53d3537d94ecd74cf513396971b3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:42:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 13:42:02 +0000 Subject: osmo-bsc[master]: Implement support for paging based on a Cell Global Identifier. In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:42:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 13:42:57 +0000 Subject: osmo-bsc[master]: Implement support for paging based on LAC and CI. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:54:47 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:54:47 +0000 Subject: python/osmo-python-tests[master]: Print version before tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 jenkins should always print the git hashes, but if you need this... -- To view, visit https://gerrit.osmocom.org/5791 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If13cba60a19e9c15885355f85def4d134fa37993 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:55:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 13:55:03 +0000 Subject: python/osmo-python-tests[master]: Fix install in the presence of old modules In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5793 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbe2af1e3815406213be29e0c0360432dc9fd6fb Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:56:46 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 13:56:46 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Fix install in the presence of old modules In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix install in the presence of old modules ...................................................................... Fix install in the presence of old modules If older incompatible version of osmopython is already available, it might be chosen fori mport instead of current version. Fix this by explicitly prepending the proper version to path. Change-Id: Icbe2af1e3815406213be29e0c0360432dc9fd6fb Related: OS#2821 --- M tests/test_py3.py 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/test_py3.py b/tests/test_py3.py index 1c0c19b..0d526a9 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -7,7 +7,7 @@ # we have to use this ugly hack to workaroundbrokenrelative imports in py3: # from ..osmopy.osmo_ipa import Ctrl # does not work as expected -sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.realpath(__file__)))) from osmopy.osmo_ipa import Ctrl from osmopy import __version__ -- To view, visit https://gerrit.osmocom.org/5793 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbe2af1e3815406213be29e0c0360432dc9fd6fb Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Mon Jan 15 13:56:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 13:56:47 +0000 Subject: [MERGED] python/osmo-python-tests[master]: Print version before tests In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Print version before tests ...................................................................... Print version before tests This helps with debugging of import-related issues - we know the version under test before the test has a chance to hang. Change-Id: If13cba60a19e9c15885355f85def4d134fa37993 Related: OS#2821 --- M osmopy/__init__.py M tests/test_py3.py 2 files changed, 3 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/osmopy/__init__.py b/osmopy/__init__.py index c3d4b8c..4e818ed 100644 --- a/osmopy/__init__.py +++ b/osmopy/__init__.py @@ -1,4 +1,4 @@ #!/usr/bin/env python -__version__ = '0.0.8' +__version__ = '0.0.9' __all__ = ['obscvty', 'osmoutil', 'osmo_ipa', 'osmo_interact'] diff --git a/tests/test_py3.py b/tests/test_py3.py index 909d057..1c0c19b 100644 --- a/tests/test_py3.py +++ b/tests/test_py3.py @@ -38,6 +38,8 @@ test_host = '127.0.0.5' test_port = str(random.randint(1025, 60000)) + print('Testing v%s on %s:%s' % (__version__, test_host, test_port)) + # Each client connection will create a new protocol instance server = loop.run_until_complete(loop.create_server(CtrlProtocol, test_host, test_port)) -- To view, visit https://gerrit.osmocom.org/5791 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If13cba60a19e9c15885355f85def4d134fa37993 Gerrit-PatchSet: 1 Gerrit-Project: python/osmo-python-tests 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-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Jan 15 14:03:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 14:03:45 +0000 Subject: [PATCH] osmo-pcu[master]: Fix sanitizer build 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/5779 to look at the new patch set (#2). Fix sanitizer build Add sanitizer flags to linker as well to resolve linker error. Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b --- M configure.ac 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/79/5779/2 diff --git a/configure.ac b/configure.ac index 8a8b93c..56e2057 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,7 @@ then CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" + LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined" fi AC_ARG_ENABLE(profile, -- To view, visit https://gerrit.osmocom.org/5779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 14:03:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 14:03:45 +0000 Subject: [PATCH] osmo-pcu[master]: Allocate global context for TypesTest 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/5785 to look at the new patch set (#2). Allocate global context for TypesTest Missing allocation leads to LSAN error: ==24997==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 230 byte(s) in 2 object(s) allocated from: #0 0x7feaa1b2fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7feaa13dbc80 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x5c80) Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 SUMMARY: AddressSanitizer: 230 byte(s) leaked in 2 allocation(s). --- M tests/types/TypesTest.cpp 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/85/5785/2 diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index ff78c87..5c4da22 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -481,6 +481,11 @@ int main(int argc, char **argv) { + tall_pcu_ctx = talloc_named_const(NULL, 1, "types test context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); -- To view, visit https://gerrit.osmocom.org/5785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 14:15:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 14:15:28 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: mgcp_network: typo in log Message-ID: Review at https://gerrit.osmocom.org/5794 cosmetic: mgcp_network: typo in log Change-Id: Ia7675e52fe1082d21bd68dcf54fe34c0f0326f11 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/94/5794/1 diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index bd6bec9..6cecbb0 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -905,7 +905,7 @@ *proto = fd == &conn->end.rtp ? MGCP_PROTO_RTP : MGCP_PROTO_RTCP; LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x ", ENDPOINT_NUMBER(endp)); - LOGPC(DRTP, LOGL_DEBUG, "receiveing from %s %s %d\n", + LOGPC(DRTP, LOGL_DEBUG, "receiving from %s %s %d\n", conn->conn->name, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", ENDPOINT_NUMBER(endp), -- To view, visit https://gerrit.osmocom.org/5794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7675e52fe1082d21bd68dcf54fe34c0f0326f11 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From admin at opensuse.org Mon Jan 15 14:28:57 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 14:28:57 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5a5cbabdce776_18fe344f54740916@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 363s] case the test suite provides a good starting point. Its output may [ 363s] be found below `tests/testsuite.dir'. [ 363s] [ 363s] Makefile:678: recipe for target 'check-local' failed [ 363s] make[4]: *** [check-local] Error 1 [ 363s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 363s] Makefile:538: recipe for target 'check-am' failed [ 363s] make[3]: *** [check-am] Error 2 [ 363s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 363s] Makefile:390: recipe for target 'check-recursive' failed [ 363s] make[2]: *** [check-recursive] Error 1 [ 363s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 363s] Makefile:500: recipe for target 'check-recursive' failed [ 363s] make[1]: *** [check-recursive] Error 1 [ 363s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 363s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 363s] debian/rules:6: recipe for target 'build' failed [ 363s] make: *** [build] Error 2 [ 363s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 363s] [ 363s] armbuild22 failed "build osmo-trx_0.2.0.20180114.dsc" at Mon Jan 15 14:28:41 UTC 2018. [ 363s] [ 363s] ### VM INTERACTION START ### [ 366s] [ 352.140958] SysRq : Power Off [ 366s] [ 352.142394] reboot: Power down [ 366s] ### VM INTERACTION END ### [ 366s] [ 366s] armbuild22 failed "build osmo-trx_0.2.0.20180114.dsc" at Mon Jan 15 14:28:44 UTC 2018. [ 366s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Jan 15 15:17:48 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 15 Jan 2018 15:17:48 +0000 Subject: [PATCH] osmo-msc[master]: Improve an error message in db_init(). Message-ID: Review at https://gerrit.osmocom.org/5795 Improve an error message in db_init(). If we cannot open a connection to the sqlite3 database, show the name of the database we failed to access, and also hint at the fact that a likely reason for the problem is a missing sqlite3 driver for libdbi. Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c --- M src/libmsc/db.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/5795/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28004f7..7007c7a 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -614,7 +614,8 @@ conn = dbi_conn_new_r("sqlite3", inst); if (conn == NULL) { - LOGP(DDB, LOGL_FATAL, "Failed to create connection.\n"); + LOGP(DDB, LOGL_FATAL, "Failed to create database connection to sqlite3 db '%s'; " + "Is the sqlite3 database driver for libdbi installed on this system?\n", name); return 1; } -- To view, visit https://gerrit.osmocom.org/5795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 15 15:45:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 15:45:35 +0000 Subject: [PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly Message-ID: Review at https://gerrit.osmocom.org/5796 Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 15 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/1 diff --git a/configure.ac b/configure.ac index 8a8b93c..1e640fa 100644 --- a/configure.ac +++ b/configure.ac @@ -64,8 +64,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) +AC_ARG_WITH([sysmocom], [AS_HELP_STRING([--with-sysmocom=INCLUDE_DIR], [Location of the sysmocom API header files])], + [sysmocom_cflags="-I$withval"],[sysmocom_cflags=""]) +AC_SUBST([SYSMOCOM_CFLAGS], $sysmocom_cflags) AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +if test "$enable_sysmocom" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $SYSMOCOM_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found using $sysmocom_cflags])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..b1fbb6a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmocom=$deps/layer1-headers/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..9054757 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,7 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += $(SYSMOCOM_CFLAGS) -I$(srcdir)/osmo-bts-sysmo EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 15:49:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 15:49:22 +0000 Subject: osmo-mgw[master]: cosmetic: mgcp_network: typo in log In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7675e52fe1082d21bd68dcf54fe34c0f0326f11 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 15:50:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 15:50:10 +0000 Subject: osmo-pcu[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 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 Mon Jan 15 15:50:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 15:50:28 +0000 Subject: osmo-msc[master]: Improve an error message in db_init(). In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 15:55:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 15:55:59 +0000 Subject: osmo-pcu[master]: Fix sanitizer build In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b Gerrit-PatchSet: 2 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 Mon Jan 15 15:56:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 15:56:08 +0000 Subject: [PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly 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/5796 to look at the new patch set (#2). Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/2 diff --git a/configure.ac b/configure.ac index 8a8b93c..1e640fa 100644 --- a/configure.ac +++ b/configure.ac @@ -64,8 +64,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) +AC_ARG_WITH([sysmocom], [AS_HELP_STRING([--with-sysmocom=INCLUDE_DIR], [Location of the sysmocom API header files])], + [sysmocom_cflags="-I$withval"],[sysmocom_cflags=""]) +AC_SUBST([SYSMOCOM_CFLAGS], $sysmocom_cflags) AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +if test "$enable_sysmocom" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $SYSMOCOM_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found using $sysmocom_cflags])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..b1fbb6a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmocom=$deps/layer1-headers/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..eb0ac9e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,8 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += $(SYSMOCOM_CFLAGS) -I$(srcdir)/osmo-bts-sysmo +AM_CFLAGS += $(SYSMOCOM_CFLAGS) EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 15:57:13 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 15:57:13 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#8). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 56 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/8 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..d04147a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,63 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + CONTRIB_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" + OSMOTRX_DIR="${CONTRIB_DIR}/.." + PREFIX="${WORKSPACE:-vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 8 Gerrit-Project: osmo-trx 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 Mon Jan 15 15:59:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 15:59:53 +0000 Subject: [PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly 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/5796 to look at the new patch set (#3). Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 16 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/3 diff --git a/configure.ac b/configure.ac index 8a8b93c..1e640fa 100644 --- a/configure.ac +++ b/configure.ac @@ -64,8 +64,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) +AC_ARG_WITH([sysmocom], [AS_HELP_STRING([--with-sysmocom=INCLUDE_DIR], [Location of the sysmocom API header files])], + [sysmocom_cflags="-I$withval"],[sysmocom_cflags=""]) +AC_SUBST([SYSMOCOM_CFLAGS], $sysmocom_cflags) AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +if test "$enable_sysmocom" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $SYSMOCOM_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found using $sysmocom_cflags])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..b1fbb6a 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmocom=$deps/layer1-headers/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..118cfa7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,8 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += $(SYSMOCOM_CFLAGS) -I$(srcdir)/osmo-bts-sysmo +AM_CFLAGS = $(SYSMOCOM_CFLAGS) EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 16:05:11 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 16:05:11 +0000 Subject: [PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly 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/5796 to look at the new patch set (#4). Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 17 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/4 diff --git a/configure.ac b/configure.ac index 8a8b93c..1e640fa 100644 --- a/configure.ac +++ b/configure.ac @@ -64,8 +64,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) +AC_ARG_WITH([sysmocom], [AS_HELP_STRING([--with-sysmocom=INCLUDE_DIR], [Location of the sysmocom API header files])], + [sysmocom_cflags="-I$withval"],[sysmocom_cflags=""]) +AC_SUBST([SYSMOCOM_CFLAGS], $sysmocom_cflags) AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +if test "$enable_sysmocom" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS $SYSMOCOM_CFLAGS -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found using $sysmocom_cflags])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..ec5398e 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmocom=$deps/layer1-headers/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then @@ -78,7 +76,7 @@ autoreconf --install --force ./configure $PCU_CONFIG -$MAKE $PARALLEL_MAKE +$MAKE $PARALLEL_MAKE V=1 DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" AM_DISTCHECK_CONFIGURE_FLAGS="$PCU_CONFIG" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..118cfa7 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,8 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += $(SYSMOCOM_CFLAGS) -I$(srcdir)/osmo-bts-sysmo +AM_CFLAGS = $(SYSMOCOM_CFLAGS) EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 16:24:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 16:24:45 +0000 Subject: osmo-pcu[master]: Allocate global context for TypesTest In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/5785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 16:24:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 16:24:48 +0000 Subject: osmo-pcu[master]: Fix sanitizer build In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/5779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 16:24:50 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 16:24:50 +0000 Subject: [MERGED] osmo-pcu[master]: Fix sanitizer build In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix sanitizer build ...................................................................... Fix sanitizer build Add sanitizer flags to linker as well to resolve linker error. Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b --- M configure.ac 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 8a8b93c..56e2057 100644 --- a/configure.ac +++ b/configure.ac @@ -42,6 +42,7 @@ then CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined" CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" + LDFLAGS="$LDFLAGS -fsanitize=address -fsanitize=undefined" fi AC_ARG_ENABLE(profile, -- To view, visit https://gerrit.osmocom.org/5779 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I695baaf8ce78ed938f6f71c40d17120fa690338b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 16:24:51 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 15 Jan 2018 16:24:51 +0000 Subject: [MERGED] osmo-pcu[master]: Allocate global context for TypesTest In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Allocate global context for TypesTest ...................................................................... Allocate global context for TypesTest Missing allocation leads to LSAN error: ==24997==ERROR: LeakSanitizer: detected memory leaks Indirect leak of 230 byte(s) in 2 object(s) allocated from: #0 0x7feaa1b2fb50 in __interceptor_malloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xdeb50) #1 0x7feaa13dbc80 in _talloc_zero (/usr/lib/x86_64-linux-gnu/libtalloc.so.2+0x5c80) Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 SUMMARY: AddressSanitizer: 230 byte(s) leaked in 2 allocation(s). --- M tests/types/TypesTest.cpp 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index ff78c87..5c4da22 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -481,6 +481,11 @@ int main(int argc, char **argv) { + tall_pcu_ctx = talloc_named_const(NULL, 1, "types test context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); osmo_init_logging(&gprs_log_info); log_set_use_color(osmo_stderr_target, 0); log_set_print_filename(osmo_stderr_target, 0); -- To view, visit https://gerrit.osmocom.org/5785 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I62c03dad353f459abcdb7a18a69b7782da38dfb7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 15 16:41:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 16:41:16 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#9). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 55 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/9 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..88c32e8 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,62 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh + PREFIX="${WORKSPACE:-vm}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 9 Gerrit-Project: osmo-trx 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 Mon Jan 15 17:08:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 17:08:33 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#10). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 55 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/10 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..981ad4d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,62 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh + ROOTFS_PREFIX="${ROOTFS_PREFIX:-/opt}" + ROOTFS="${PREFIX}/qemu-img" + mkdir -p $PREFIX + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 10 Gerrit-Project: osmo-trx 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 Mon Jan 15 17:10:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 17:10:02 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#11). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 55 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/11 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..65b67e5 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,62 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh + ROOTFS_PREFIX="${ROOTFS_PREFIX:-/opt}" + ROOTFS="${ROOTFS_PREFIX}/qemu-img" + mkdir -p "${ROOTFS_PREFIX}" + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 11 Gerrit-Project: osmo-trx 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 Mon Jan 15 17:16:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 17:16:31 +0000 Subject: osmocom-bb[master]: bsic decoding of neighbour cells in dedicated mode and parti... In-Reply-To: References: Message-ID: Patch Set 1: Note that a detailed description of this patch can be found in http://lists.osmocom.org/pipermail/openbsc/2018-January/011648.html Help required for non-sync Handover Muhammad Awais Aslam mawais.aslam985 at gmail.com Mon Jan 15 13:31:32 UTC 2018 Quoting: We took code related to handover from the osmocom-bb jolly branch by manually adding/deleting stuff in the master branch as updating to the latest copy was giving us issues. We added code from the ?Safely change TPU offset on TS change or sync change? commit till the ?Use only sel_si for information about the current cell? commit. Using the handover code in the jolly branch and after making the changes we were able to obtain the handover command from the BTS. The synchronized handover case works sometimes though still not every time, however the non-synchronized case doesn't work at all as we are not able to get the physical information command from the new cell. I'll explain the changes/additions we made to achieve this. Firstly, we noted that in dedicated mode SB burst was not being detected. Changes were required at three main places in order to correctly perform FB/SB detection: - It was seen that the results for SB were being read from DSP API location dsp_api.db_r->a_sch which is for the idle mode. The results had to be read from the dsp_api.ndb->a_sch26 location for the dedicated case if TCH_SB_DSP_TASK is used. - After reading the FB we needed to update the quarter-bit offset of the TPU using the TOA of the FB to sync it with the start of frame of the neighbour cell in order to catch the SB (by changing the vaule of l1s.tpu_offset using the TOA of the FB). - Frequency compensation needed to be performed using the afc_correct function before reading the SB. * We actually kind of cheated a bit by adding 3 frames to the original idle frame in order to give us more time to perform FB/SB detection including the synchronizations mentioned above. This was because we weren't that proficient with the code and someone with more understanding could do this better. The call did not get dropped. We used the initial added ?idle? frame to perform the quarter-bit and frequency compensation which was reversed in the idle frame with the response function to tune back to the serving cell. These things, when added to the code did the trick and BSIC of the neighbours was obtained. Once the BSICs were decoded the measurement report sent to the BTS became meaningful and the handover command was received. Upon receiving handover command, access bursts needed to be sent on the new channel which again was not currently being implemented properly as in order to tune to the new cell we needed to know its quarter-bit offset for start of frame, frequency compensation and absolute frame number which were not previously being obtained. Now that we were able to detect FB and SB these values were stored for the neighbours following detection of these bursts and were used to tune to a neighbour cell in case of a handover to it before the sending of access bursts. However, here is where we are stuck. We were expecting a physical information message following the access bursts but were not able to receive it due to which the handover failed. If only that could be achieved we believe handover should be successful. Either we are not syncing properly to the new cell or we might not be following GSM protocol properly. We also might not be reading the FACCH properly for physical information message after tuning to the new cell as we couldn't really understand that bit very well. We wanted someone expertise on this matter and were hoping our work could be of use. -- To view, visit https://gerrit.osmocom.org/5490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib01460b796d2107c4599d327e184eb42340999d2 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Muhammad Awais Aslam Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:18:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 17:18:12 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#12). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 55 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/12 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..6db2891 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,62 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh + ROOTFS_PREFIX="${ROOTFS_PREFIX:-/opt}" + ROOTFS="${ROOTFS_PREFIX}/qemu-img" + mkdir -p "${ROOTFS_PREFIX}" + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" -b "$(which osmo-clean-workspace.sh):/usr/bin/osmo-clean-workspace.sh" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 12 Gerrit-Project: osmo-trx 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 Mon Jan 15 17:21:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 17:21:22 +0000 Subject: [PATCH] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5763 to look at the new patch set (#13). contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 55 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/63/5763/13 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..11def5c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,62 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh + ROOTFS_PREFIX="${ROOTFS_PREFIX:-/opt}" + ROOTFS="${ROOTFS_PREFIX}/qemu-img" + mkdir -p "${ROOTFS_PREFIX}" + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev git + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" -b "$(which osmo-clean-workspace.sh):/usr/bin/osmo-clean-workspace.sh" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 13 Gerrit-Project: osmo-trx 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 Mon Jan 15 17:33:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:33:20 +0000 Subject: [PATCH] openbsc[master]: mgcp_transcoding_test: Add LIBOSMOABIS_CFLAGS Message-ID: Review at https://gerrit.osmocom.org/5797 mgcp_transcoding_test: Add LIBOSMOABIS_CFLAGS Currently, we see the following failure: make[3]: Entering directory '/build/openbsc/tests/mgcp' CC mgcp_transcoding_test.o CC mgcp_test.o In file included from ../../include/openbsc/gsm_data.h:176:0, from mgcp_transcoding_test.c:14: ../../include/openbsc/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include ^ compilation terminated. as gsm_data.h includes gsm_data_shared.h, which includes the e1_input.h from libosmo-abis, we need to list libosmo-abis in the CFLAGS. Change-Id: I27c25adfc6ee2c6f07315f3bc76fa7a70202ac4d --- M openbsc/tests/mgcp/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/97/5797/1 diff --git a/openbsc/tests/mgcp/Makefile.am b/openbsc/tests/mgcp/Makefile.am index 4b18036..33e921f 100644 --- a/openbsc/tests/mgcp/Makefile.am +++ b/openbsc/tests/mgcp/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_FLAGS) \ $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBBCG729_CFLAGS) \ -- To view, visit https://gerrit.osmocom.org/5797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27c25adfc6ee2c6f07315f3bc76fa7a70202ac4d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:41:06 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 17:41:06 +0000 Subject: [PATCH] osmo-ci[master]: jobs: osmo-trx: Set slave_axis to use only debian9 Message-ID: Review at https://gerrit.osmocom.org/5798 jobs: osmo-trx: Set slave_axis to use only debian9 Debian 8 contains quite old qemu and proot packages which have some issues running the chroot infrastructure set up in osmo-trx's jenkins.sh. Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/98/5798/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 9cb12a5..4e553ea 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -178,7 +178,7 @@ - osmo-sip-connector - osmo-trx: - slave_axis: !!python/tuple [OsmocomBuild1] + slave_axis: !!python/tuple [linux_amd64_debian9] a1_name: INSTR a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] concurrent: true diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 84a97a9..b98513a 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -235,7 +235,7 @@ - osmo-tetra - osmo-trx: - slave_axis: !!python/tuple [OsmocomBuild1] + slave_axis: !!python/tuple [linux_amd64_debian9] a1_name: INSTR a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] concurrent: true -- To view, visit https://gerrit.osmocom.org/5798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:41:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:41:36 +0000 Subject: osmo-ci[master]: jobs: osmo-trx: Set slave_axis to use only debian9 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:41:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:41:41 +0000 Subject: openbsc[master]: mgcp_transcoding_test: Add LIBOSMOABIS_CFLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27c25adfc6ee2c6f07315f3bc76fa7a70202ac4d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:41:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:41:42 +0000 Subject: [MERGED] openbsc[master]: mgcp_transcoding_test: Add LIBOSMOABIS_CFLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp_transcoding_test: Add LIBOSMOABIS_CFLAGS ...................................................................... mgcp_transcoding_test: Add LIBOSMOABIS_CFLAGS Currently, we see the following failure: make[3]: Entering directory '/build/openbsc/tests/mgcp' CC mgcp_transcoding_test.o CC mgcp_test.o In file included from ../../include/openbsc/gsm_data.h:176:0, from mgcp_transcoding_test.c:14: ../../include/openbsc/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include ^ compilation terminated. as gsm_data.h includes gsm_data_shared.h, which includes the e1_input.h from libosmo-abis, we need to list libosmo-abis in the CFLAGS. Change-Id: I27c25adfc6ee2c6f07315f3bc76fa7a70202ac4d --- M openbsc/tests/mgcp/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/tests/mgcp/Makefile.am b/openbsc/tests/mgcp/Makefile.am index 4b18036..33e921f 100644 --- a/openbsc/tests/mgcp/Makefile.am +++ b/openbsc/tests/mgcp/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_FLAGS) \ $(LIBOSMONETIF_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(LIBBCG729_CFLAGS) \ -- To view, visit https://gerrit.osmocom.org/5797 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27c25adfc6ee2c6f07315f3bc76fa7a70202ac4d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:47:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:47:43 +0000 Subject: osmocom-bb[master]: bsic decoding of neighbour cells in dedicated mode and parti... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 (8 comments) Hi Muhammad. Thanks for your submission. However, I had to stop after reviewing about one third of the patch, as it seems you have not been using git properly and the patch is removing lots of code from current master. Please make sure to submit a clean patch on top of current master, which only adsd the intended changes without changing any other parts or even removing features like LUA. Thanks! https://gerrit.osmocom.org/#/c/5490/1/src/host/layer23/src/common/l1ctl.c File src/host/layer23/src/common/l1ctl.c: Line 24: //MTZ please don't submit changes like this (//MTZ) Line 62: int count_test1=0; where is this variable used? PS1, Line 164: in we have an elaborate logging system and don't use printf. same applies for all similar printf() calls below https://gerrit.osmocom.org/#/c/5490/1/src/host/layer23/src/common/logging.c File src/host/layer23/src/common/logging.c: Line 130 why were those removed? Maybe you need to rebase your patch on top of latest master? https://gerrit.osmocom.org/#/c/5490/1/src/host/layer23/src/common/main.c File src/host/layer23/src/common/main.c: Line 249: sprintf(ms->name, "1"); unrelated change https://gerrit.osmocom.org/#/c/5490/1/src/host/layer23/src/common/sim.c File src/host/layer23/src/common/sim.c: Line 32: extern void *l23_ctx; why not keep 'ms' as talloc context? https://gerrit.osmocom.org/#/c/5490/1/src/host/layer23/src/mobile/Makefile.am File src/host/layer23/src/mobile/Makefile.am: Line 3 why are you removing LUA support. Please stop doing that. https://gerrit.osmocom.org/#/c/5490/1/src/host/layer23/src/mobile/gsm322.c File src/host/layer23/src/mobile/gsm322.c: Line 5124: char filename[PATH_MAX]; unrelated change -- To view, visit https://gerrit.osmocom.org/5490 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib01460b796d2107c4599d327e184eb42340999d2 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Muhammad Awais Aslam Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:49:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:49:53 +0000 Subject: osmo-pcu[master]: Set V_N and V_B to known initial state In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Gerrit-PatchSet: 2 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 Mon Jan 15 17:50:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 17:50:02 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 13: Sorry for the all the noise related to this patch. It seems to be working fine now. I ended up pregenerating the image and keeping it inside the jenkins slave (lxc container) in /opt/qemu-img, as otherwise it took really long building the image everytime the job had to run. Once it gets merged, I will: - Update the Jenkins Node Setup stating the required dependencies and explaining that the qemu-img has to be placed in /opt/qemu-img. -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 13 Gerrit-Project: osmo-trx 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 Mon Jan 15 17:54:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:54:46 +0000 Subject: [PATCH] osmo-mgw[master]: osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS, LIBS} Message-ID: Review at https://gerrit.osmocom.org/5799 osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS,LIBS} The osmo-mgw gerrit build is currently failing with the following error: make[3]: Entering directory '/build/src/osmo-bsc_mgcp' CC mgcp_main.o In file included from ../../include/osmocom/legacy_mgcp/mgcp_internal.h:146:0, from mgcp_main.c:36: ../../include/osmocom/legacy_mgcp/osmux.h:4:33: fatal error: osmocom/netif/osmux.h: No such file or directory #include ^ compilation terminated. Let's make sure we're adding the required flags/libs for libosmonetif dependency Change-Id: I402314532590498a6340dc14101a32b605cd5e09 --- M src/osmo-bsc_mgcp/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/5799/1 diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index 4529a33..e8a6f46 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(LIBBCG729_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -24,6 +25,7 @@ $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I402314532590498a6340dc14101a32b605cd5e09 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 15 17:57:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 17:57:12 +0000 Subject: [PATCH] osmo-mgw[master]: osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS, LIBS} In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5799 to look at the new patch set (#2). osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS,LIBS} The osmo-mgw gerrit build is currently failing with the following error: make[3]: Entering directory '/build/src/osmo-bsc_mgcp' CC mgcp_main.o In file included from ../../include/osmocom/legacy_mgcp/mgcp_internal.h:146:0, from mgcp_main.c:36: ../../include/osmocom/legacy_mgcp/osmux.h:4:33: fatal error: osmocom/netif/osmux.h: No such file or directory #include ^ compilation terminated. Let's make sure we're adding the required flags/libs for libosmonetif dependency Change-Id: I402314532590498a6340dc14101a32b605cd5e09 --- M src/osmo-bsc_mgcp/Makefile.am M src/osmo-mgw/Makefile.am 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/5799/2 diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index 4529a33..e8a6f46 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(LIBBCG729_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -24,6 +25,7 @@ $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ $(NULL) diff --git a/src/osmo-mgw/Makefile.am b/src/osmo-mgw/Makefile.am index 0e12beb..3cbddf5 100644 --- a/src/osmo-mgw/Makefile.am +++ b/src/osmo-mgw/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -23,4 +24,5 @@ $(top_builddir)/src/libosmo-mgcp/libosmo-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I402314532590498a6340dc14101a32b605cd5e09 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:00:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:00:00 +0000 Subject: [PATCH] osmo-mgw[master]: osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS, LIBS} In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5799 to look at the new patch set (#3). osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS,LIBS} The osmo-mgw gerrit build is currently failing with the following error: make[3]: Entering directory '/build/src/osmo-bsc_mgcp' CC mgcp_main.o In file included from ../../include/osmocom/legacy_mgcp/mgcp_internal.h:146:0, from mgcp_main.c:36: ../../include/osmocom/legacy_mgcp/osmux.h:4:33: fatal error: osmocom/netif/osmux.h: No such file or directory #include ^ compilation terminated. Let's make sure we're adding the required flags/libs for libosmonetif dependency Related: OS#2829 Change-Id: I402314532590498a6340dc14101a32b605cd5e09 --- M src/osmo-bsc_mgcp/Makefile.am M src/osmo-mgw/Makefile.am 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/99/5799/3 diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index 4529a33..e8a6f46 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(LIBBCG729_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -24,6 +25,7 @@ $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ $(NULL) diff --git a/src/osmo-mgw/Makefile.am b/src/osmo-mgw/Makefile.am index 0e12beb..3cbddf5 100644 --- a/src/osmo-mgw/Makefile.am +++ b/src/osmo-mgw/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -23,4 +24,5 @@ $(top_builddir)/src/libosmo-mgcp/libosmo-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I402314532590498a6340dc14101a32b605cd5e09 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:00:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:00:17 +0000 Subject: osmo-mgw[master]: osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS,LIBS} In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I402314532590498a6340dc14101a32b605cd5e09 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:00:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:00:20 +0000 Subject: [MERGED] osmo-mgw[master]: osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS, LIBS} In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS,LIBS} ...................................................................... osmo-bsc_mgcp: Add LIBOSMONETIF_{CFLAGS,LIBS} The osmo-mgw gerrit build is currently failing with the following error: make[3]: Entering directory '/build/src/osmo-bsc_mgcp' CC mgcp_main.o In file included from ../../include/osmocom/legacy_mgcp/mgcp_internal.h:146:0, from mgcp_main.c:36: ../../include/osmocom/legacy_mgcp/osmux.h:4:33: fatal error: osmocom/netif/osmux.h: No such file or directory #include ^ compilation terminated. Let's make sure we're adding the required flags/libs for libosmonetif dependency Related: OS#2829 Change-Id: I402314532590498a6340dc14101a32b605cd5e09 --- M src/osmo-bsc_mgcp/Makefile.am M src/osmo-mgw/Makefile.am 2 files changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc_mgcp/Makefile.am b/src/osmo-bsc_mgcp/Makefile.am index 4529a33..e8a6f46 100644 --- a/src/osmo-bsc_mgcp/Makefile.am +++ b/src/osmo-bsc_mgcp/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(LIBBCG729_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -24,6 +25,7 @@ $(top_builddir)/src/libosmo-legacy-mgcp/libosmo-legacy-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(LIBBCG729_LIBS) \ $(LIBRARY_GSM) \ $(NULL) diff --git a/src/osmo-mgw/Makefile.am b/src/osmo-mgw/Makefile.am index 0e12beb..3cbddf5 100644 --- a/src/osmo-mgw/Makefile.am +++ b/src/osmo-mgw/Makefile.am @@ -8,6 +8,7 @@ -Wall \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMONETIF_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) @@ -23,4 +24,5 @@ $(top_builddir)/src/libosmo-mgcp/libosmo-mgcp.la \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOVTY_LIBS) \ + $(LIBOSMONETIF_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5799 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I402314532590498a6340dc14101a32b605cd5e09 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:13:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:13:21 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 13: why keeping it in /opt and not in the workspace? The per-job directories on each slave are persistent, aren't they? At least when I log in via SSH I always see plenty of those directories? -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 13 Gerrit-Project: osmo-trx 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 Mon Jan 15 18:27:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 15 Jan 2018 18:27:01 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 13: > why keeping it in /opt and not in the workspace? The per-job > directories on each slave are persistent, aren't they? At least > when I log in via SSH I always see plenty of those directories? They are not persistent in the sense that they get cleaned everytime by osmo-clean-workspace.sh, so the git directory stays there but the generated image would be cleaned, and then next time would need to be re-generated. A solution for this would be adding a env var or a parameter to osmo-clean-workspace.sh to have a list of directories to skip (it's apparently easy with git clean -e). For now I decided to have it in /opt in a similar way as we already have the toolchain /opt/poky/, since the rootfs in /opt/qemu-img is mostly used readonly because we do all the work only inside /opt/qemu-img/osmo-trx which is actually fake since proot is bind-mounting it to our workspace. This way we set up the image once per jenkins node and we forget about it (we document it of course ;). -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 13 Gerrit-Project: osmo-trx 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 Mon Jan 15 18:27:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:27:22 +0000 Subject: [PATCH] osmo-bsc[master]: Add LIBOSMOSIGTRAN_CFLAGS to libcommon, libcommon-cs, libfil... Message-ID: Review at https://gerrit.osmocom.org/5800 Add LIBOSMOSIGTRAN_CFLAGS to libcommon, libcommon-cs, libfilter, utils The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the sigtran header path is always specified where needed Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M src/utils/Makefile.am 4 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/1 diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..8cca1d7 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..a494c88 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOASIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..1eb5662 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 78d4965..8f05334 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -9,6 +9,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:32:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:32:52 +0000 Subject: [PATCH] osmo-bsc[master]: Add LIBOSMOSIGTRAN_CFLAGS to libcommon, libcommon-cs, libfil... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5800 to look at the new patch set (#2). Add LIBOSMOSIGTRAN_CFLAGS to libcommon, libcommon-cs, libfilter, utils The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the sigtran header path is always specified where needed Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M src/utils/Makefile.am 4 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/2 diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..8cca1d7 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..963f31b 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..1eb5662 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 78d4965..8f05334 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -9,6 +9,7 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:33:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 18:33:37 +0000 Subject: [PATCH] osmo-bsc[master]: handover_decision: Fix condition for power budget handover a... Message-ID: Review at https://gerrit.osmocom.org/5801 handover_decision: Fix condition for power budget handover attempt Handover attempt for power budget case should be performed every N SACCH frames, where N = Power Budget Interval. First measurement report with mr->nr = 0 was used for the first handover attempt in this case, which is not correct, because first usable report should have mr->nr = net->handover.pwr_interval-1. Moreover using the first measurement report with mr->nr = 0 for handover attempt could lead to unnecessary handover, because usually av_rxlev for first measurement report from MS is worse than for following reports. Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e --- M src/libbsc/handover_decision.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/01/5801/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 09c7eaa..c637e25 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -294,7 +294,7 @@ return attempt_handover(mr); /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == 0) + if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) return attempt_handover(mr); return 0; -- To view, visit https://gerrit.osmocom.org/5801 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Ivan Kluchnikov From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:33:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 18:33:37 +0000 Subject: [PATCH] osmo-bsc[master]: handover_decision: log HO causes more accurately Message-ID: Review at https://gerrit.osmocom.org/5802 handover_decision: log HO causes more accurately Tweaked-by: nhofmeyr at sysmocom.de Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 --- M src/libbsc/handover_decision.c 1 file changed, 15 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/5802/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index c637e25..583a2dc 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -230,7 +230,7 @@ rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); switch (rc) { case 0: - LOGPC(DHO, LOGL_INFO, "Starting handover\n"); + LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); break; case -ENOSPC: LOGPC(DHO, LOGL_INFO, "No channel available\n"); @@ -278,20 +278,30 @@ /* Interference HO */ if (rxlev2dbm(av_rxlev) > -85 && - meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) + meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Interference HO av_rxlev=%d dbm\n", + rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Bad Quality */ - if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) + if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Bad Quality av_rxlev=%d dbm\n", rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Low Level */ - if (rxlev2dbm(av_rxlev) <= -110) + if (rxlev2dbm(av_rxlev) <= -110) { + LOGPC(DHO, LOGL_INFO, "HO cause: Low Level av_rxlev=%d dbm\n", rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Distance */ - if (mr->ms_l1.ta > net->handover.max_distance) + if (mr->ms_l1.ta > net->handover.max_distance) { + LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dbm ta=%u\n", + rxlev2dbm(av_rxlev), mr->ms_l1.ta); return attempt_handover(mr); + } /* Power Budget AKA Better Cell */ if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) -- To view, visit https://gerrit.osmocom.org/5802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Ivan Kluchnikov From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:34:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:34:10 +0000 Subject: osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Patch Set 13: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 13 Gerrit-Project: osmo-trx 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 Mon Jan 15 18:36:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:36:23 +0000 Subject: [PATCH] osmo-bsc[master]: Add missing CFLAGS to libcommon, libcommon-cs, libfilter, utils In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5800 to look at the new patch set (#3). Add missing CFLAGS to libcommon, libcommon-cs, libfilter, utils The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the sigtran + mgcp-legacy header path is always specified where needed Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M src/utils/Makefile.am 4 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/3 diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..1c108be 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS)) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..c66cbcd 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..1eb5662 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 78d4965..f95516a 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -9,6 +9,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:39:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:39:37 +0000 Subject: [PATCH] osmo-bsc[master]: Add missing CFLAGS to libcommon, libcommon-cs, libfilter, utils In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5800 to look at the new patch set (#4). Add missing CFLAGS to libcommon, libcommon-cs, libfilter, utils The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the sigtran + mgcp-legacy header path is always specified where needed Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M src/utils/Makefile.am 4 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/4 diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..b3a0260 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..c66cbcd 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..1eb5662 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 78d4965..f95516a 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -9,6 +9,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 18:41:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 18:41:15 +0000 Subject: [PATCH] osmo-bsc[master]: Add missing CFLAGS to libcommon, libcommon-cs, libfilter, utils In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5800 to look at the new patch set (#5). Add missing CFLAGS to libcommon, libcommon-cs, libfilter, utils The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the sigtran + mgcp-legacy header path is always specified where needed Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M src/libbsc/Makefile.am M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M src/utils/Makefile.am 5 files changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/5 diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index fc12d05..3f000f2 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..b3a0260 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..c66cbcd 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..1eb5662 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/utils/Makefile.am b/src/utils/Makefile.am index 78d4965..f95516a 100644 --- a/src/utils/Makefile.am +++ b/src/utils/Makefile.am @@ -9,6 +9,8 @@ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 19:06:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 19:06:02 +0000 Subject: [PATCH] osmo-bsc[master]: Don't make libcommon, libcommon-cs, libfilter, utils depend ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5800 to look at the new patch set (#6). Don't make libcommon, libcommon-cs, libfilter, utils depend on mgcp/sigtran The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the common gsm_data.h doesn't include any sccp or mgcp headers, neither directly nor indirectly. Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M include/osmocom/bsc/gsm_data.h 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/6 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 0ff5811..ed2a95c 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -12,12 +12,14 @@ #include #include -#include #include #include #include +struct mgcp_client_conf; +struct mgcp_client; +struct mgcp_ctx; /** annotations for msgb ownership */ #define __uses -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 19:14:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 19:14:30 +0000 Subject: [PATCH] osmo-bsc[master]: Make libcommon, libcommon-cs, libfilter, utils depend on mgc... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5800 to look at the new patch set (#7). Make libcommon, libcommon-cs, libfilter, utils depend on mgcp/sigtran The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the common gsm_data.h have all required CFLAGS to compile. Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/Makefile.am M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M tests/bsc/Makefile.am 6 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5800/7 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 0ff5811..ed2a95c 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -12,12 +12,14 @@ #include #include -#include #include #include #include +struct mgcp_client_conf; +struct mgcp_client; +struct mgcp_ctx; /** annotations for msgb ownership */ #define __uses diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index fc12d05..3ac1c0b 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOMGCP_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..8cca1d7 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..c66cbcd 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..8b0597b 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index ebeb1ed..9d95ead 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 15 19:32:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 19:32:29 +0000 Subject: osmo-bsc[master]: Make libcommon, libcommon-cs, libfilter, utils depend on mgc... In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 15 19:32:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 19:32:32 +0000 Subject: [MERGED] osmo-bsc[master]: Make libcommon, libcommon-cs, libfilter, utils depend on mgc... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make libcommon, libcommon-cs, libfilter, utils depend on mgcp/sigtran ...................................................................... Make libcommon, libcommon-cs, libfilter, utils depend on mgcp/sigtran The stow-enabled jenkins builds are currently failing like below: make[3]: Entering directory '/build/src/libcommon' CC bsc_version.o CC common_vty.o CC debug.o CC gsm_data.o In file included from debug.c:34:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from common_vty.c:27:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. In file included from gsm_data.c:37:0: ../../include/osmocom/bsc/gsm_data.h:15:38: fatal error: osmocom/sigtran/sccp_sap.h: No such file or directory #include ^ compilation terminated. Let's make sure the common gsm_data.h have all required CFLAGS to compile. Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/Makefile.am M src/libcommon-cs/Makefile.am M src/libcommon/Makefile.am M src/libfilter/Makefile.am M tests/bsc/Makefile.am 6 files changed, 11 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 0ff5811..ed2a95c 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -12,12 +12,14 @@ #include #include -#include #include #include #include +struct mgcp_client_conf; +struct mgcp_client; +struct mgcp_ctx; /** annotations for msgb ownership */ #define __uses diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index fc12d05..3ac1c0b 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOMGCP_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon-cs/Makefile.am b/src/libcommon-cs/Makefile.am index 21c2745..8cca1d7 100644 --- a/src/libcommon-cs/Makefile.am +++ b/src/libcommon-cs/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index ec997b7..c66cbcd 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/src/libfilter/Makefile.am b/src/libfilter/Makefile.am index 41a75bd..8b0597b 100644 --- a/src/libfilter/Makefile.am +++ b/src/libfilter/Makefile.am @@ -10,6 +10,8 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOVTY_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ + $(LIBOSMOLEGACYMGCP_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) diff --git a/tests/bsc/Makefile.am b/tests/bsc/Makefile.am index ebeb1ed..9d95ead 100644 --- a/tests/bsc/Makefile.am +++ b/tests/bsc/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOGSM_CFLAGS) \ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOLEGACYMGCP_CFLAGS) \ + $(LIBOSMOSIGTRAN_CFLAGS) \ $(COVERAGE_CFLAGS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5800 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30b75db6ffba227b05b5413b84b15f69e0c213f2 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Mon Jan 15 19:56:37 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 19:56:37 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5a5d078538657_18fe344f548247fa@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 318s] You may investigate any problem if you feel able to do so, in which [ 318s] case the test suite provides a good starting point. Its output may [ 318s] be found below `tests/testsuite.dir'. [ 318s] [ 318s] Makefile:678: recipe for target 'check-local' failed [ 318s] make[4]: *** [check-local] Error 1 [ 318s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 318s] Makefile:538: recipe for target 'check-am' failed [ 318s] make[3]: *** [check-am] Error 2 [ 318s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 318s] Makefile:390: recipe for target 'check-recursive' failed [ 318s] make[2]: *** [check-recursive] Error 1 [ 318s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 318s] Makefile:500: recipe for target 'check-recursive' failed [ 318s] make[1]: *** [check-recursive] Error 1 [ 318s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 318s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 318s] debian/rules:6: recipe for target 'build' failed [ 318s] make: *** [build] Error 2 [ 318s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 318s] [ 318s] cloud122 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:56:26 UTC 2018. [ 318s] [ 318s] ### VM INTERACTION START ### [ 322s] [ 298.013327] reboot: Power down [ 322s] ### VM INTERACTION END ### [ 322s] [ 322s] cloud122 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:56:30 UTC 2018. [ 322s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jan 15 19:57:28 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 19:57:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5a5d07c15db52_18fe344f548249be@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 364s] You may investigate any problem if you feel able to do so, in which [ 364s] case the test suite provides a good starting point. Its output may [ 364s] be found below `tests/testsuite.dir'. [ 364s] [ 364s] Makefile:678: recipe for target 'check-local' failed [ 364s] make[4]: *** [check-local] Error 1 [ 364s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 364s] Makefile:538: recipe for target 'check-am' failed [ 364s] make[3]: *** [check-am] Error 2 [ 364s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 364s] Makefile:390: recipe for target 'check-recursive' failed [ 364s] make[2]: *** [check-recursive] Error 1 [ 364s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 364s] Makefile:500: recipe for target 'check-recursive' failed [ 364s] make[1]: *** [check-recursive] Error 1 [ 364s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 364s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 364s] debian/rules:6: recipe for target 'build' failed [ 364s] make: *** [build] Error 2 [ 364s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 364s] [ 364s] cloud105 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:57:09 UTC 2018. [ 364s] [ 364s] ### VM INTERACTION START ### [ 367s] [ 315.767602] reboot: Power down [ 368s] ### VM INTERACTION END ### [ 368s] [ 368s] cloud105 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:57:14 UTC 2018. [ 368s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jan 15 19:57:28 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 19:57:28 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5a5d07c21ed84_18fe344f5482507f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 350s] You may investigate any problem if you feel able to do so, in which [ 350s] case the test suite provides a good starting point. Its output may [ 350s] be found below `tests/testsuite.dir'. [ 350s] [ 350s] Makefile:678: recipe for target 'check-local' failed [ 350s] make[4]: *** [check-local] Error 1 [ 350s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 350s] Makefile:538: recipe for target 'check-am' failed [ 350s] make[3]: *** [check-am] Error 2 [ 350s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 350s] Makefile:390: recipe for target 'check-recursive' failed [ 350s] make[2]: *** [check-recursive] Error 1 [ 350s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 350s] Makefile:500: recipe for target 'check-recursive' failed [ 350s] make[1]: *** [check-recursive] Error 1 [ 350s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 350s] dh_auto_test: make -j1 check returned exit code 2 [ 350s] debian/rules:6: recipe for target 'build' failed [ 350s] make: *** [build] Error 2 [ 350s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 350s] [ 350s] cloud105 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:57:23 UTC 2018. [ 350s] [ 350s] ### VM INTERACTION START ### [ 354s] [ 332.643960] reboot: Power down [ 354s] ### VM INTERACTION END ### [ 354s] [ 354s] cloud105 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:57:27 UTC 2018. [ 354s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jan 15 19:57:47 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 19:57:47 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5a5d07c2aca4d_18fe344f548251bf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-trx failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 377s] You may investigate any problem if you feel able to do so, in which [ 377s] case the test suite provides a good starting point. Its output may [ 377s] be found below `tests/testsuite.dir'. [ 377s] [ 377s] Makefile:678: recipe for target 'check-local' failed [ 377s] make[4]: *** [check-local] Error 1 [ 377s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 377s] Makefile:538: recipe for target 'check-am' failed [ 377s] make[3]: *** [check-am] Error 2 [ 377s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 377s] Makefile:390: recipe for target 'check-recursive' failed [ 377s] make[2]: *** [check-recursive] Error 1 [ 377s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 377s] Makefile:500: recipe for target 'check-recursive' failed [ 377s] make[1]: *** [check-recursive] Error 1 [ 377s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 377s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 377s] debian/rules:6: recipe for target 'build' failed [ 377s] make: *** [build] Error 2 [ 377s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 377s] [ 377s] cloud124 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:57:37 UTC 2018. [ 377s] [ 377s] ### VM INTERACTION START ### [ 380s] [ 338.605442] reboot: Power down [ 381s] ### VM INTERACTION END ### [ 381s] [ 381s] cloud124 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:57:42 UTC 2018. [ 381s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jan 15 19:58:55 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 19:58:55 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5a5d081f85e76_18fe344f548274bf@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_8.0/i586 Package network:osmocom:nightly/osmo-trx failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 388s] case the test suite provides a good starting point. Its output may [ 388s] be found below `tests/testsuite.dir'. [ 388s] [ 388s] Makefile:664: recipe for target 'check-local' failed [ 388s] make[4]: *** [check-local] Error 1 [ 388s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 388s] Makefile:526: recipe for target 'check-am' failed [ 388s] make[3]: *** [check-am] Error 2 [ 388s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 388s] Makefile:378: recipe for target 'check-recursive' failed [ 388s] make[2]: *** [check-recursive] Error 1 [ 388s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 388s] Makefile:488: recipe for target 'check-recursive' failed [ 388s] make[1]: *** [check-recursive] Error 1 [ 388s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 388s] dh_auto_test: make -j1 check returned exit code 2 [ 388s] debian/rules:6: recipe for target 'build' failed [ 388s] make: *** [build] Error 2 [ 388s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 388s] [ 388s] cloud131 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:58:42 UTC 2018. [ 388s] [ 388s] ### VM INTERACTION START ### [ 389s] Powering off. [ 389s] [ 370.798840] reboot: Power down [ 390s] ### VM INTERACTION END ### [ 390s] [ 390s] cloud131 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 19:58:45 UTC 2018. [ 390s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Jan 15 20:12:03 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 15 Jan 2018 20:12:03 +0000 Subject: [MERGED] libosmocore[master]: libosmocodec: implement ECU (Error Concealment Unit) for FR In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: libosmocodec: implement ECU (Error Concealment Unit) for FR ...................................................................... libosmocodec: implement ECU (Error Concealment Unit) for FR When a bad GSM voice frame is received, it's being replaced by a silence frame. This may cause unpleasant audio effects. This change implements a functionality to craft a replacement frame from the last known good frame. Currently, only FR is supported, support for other codecs may be added latter. Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 --- M TODO-RELEASE M include/Makefile.am A include/osmocom/codec/ecu.h M src/codec/Makefile.am A src/codec/ecu_fr.c M tests/Makefile.am A tests/codec/codec_ecu_fr_test.c A tests/codec/codec_ecu_fr_test.ok M tests/testsuite.at 9 files changed, 535 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index a5def79..782ba19 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,3 +9,4 @@ #library what description / commit summary line core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h +codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) diff --git a/include/Makefile.am b/include/Makefile.am index 09f5ca6..f95d90c 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,6 +1,7 @@ BUILT_SOURCES = osmocom/gsm/gsm0503.h nobase_include_HEADERS = \ + osmocom/codec/ecu.h \ osmocom/codec/codec.h \ osmocom/codec/gsm610_bits.h \ osmocom/core/application.h \ diff --git a/include/osmocom/codec/ecu.h b/include/osmocom/codec/ecu.h new file mode 100644 index 0000000..f7a29a0 --- /dev/null +++ b/include/osmocom/codec/ecu.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include + +#include + +/* Codec independent ECU state */ +struct osmo_ecu_fr_state { + bool subsequent_lost_frame; + uint8_t frame_backup[GSM_FR_BYTES]; +}; + +void osmo_ecu_fr_reset(struct osmo_ecu_fr_state *state, uint8_t *frame); +int osmo_ecu_fr_conceal(struct osmo_ecu_fr_state *state, uint8_t *frame); diff --git a/src/codec/Makefile.am b/src/codec/Makefile.am index b4df5da..f77d910 100644 --- a/src/codec/Makefile.am +++ b/src/codec/Makefile.am @@ -13,6 +13,6 @@ lib_LTLIBRARIES = libosmocodec.la -libosmocodec_la_SOURCES = gsm610.c gsm620.c gsm660.c gsm690.c +libosmocodec_la_SOURCES = gsm610.c gsm620.c gsm660.c gsm690.c ecu_fr.c libosmocodec_la_LDFLAGS = -version-info $(LIBVERSION) -no-undefined libosmocodec_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/codec/ecu_fr.c b/src/codec/ecu_fr.c new file mode 100644 index 0000000..d4ea741 --- /dev/null +++ b/src/codec/ecu_fr.c @@ -0,0 +1,165 @@ +/* + * (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2017 by Philipp Maier + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include +#include + +#include + +#include +#include +#include + +/* See also GSM 06.11, chapter 6 Example solution */ +#define GSM610_XMAXC_REDUCE 4 +#define GSM610_XMAXC_LEN 6 + +/** + * Reduce the XMAXC field. When the XMAXC field reaches + * zero the function will return true. + */ +static bool reduce_xmaxcr(struct bitvec *frame_bitvec, + const unsigned int index) +{ + unsigned int field_index; + uint64_t field; + + field_index = index; + field = bitvec_read_field(frame_bitvec, &field_index, GSM610_XMAXC_LEN); + if (field > GSM610_XMAXC_REDUCE) + field -= GSM610_XMAXC_REDUCE; + else + field = 0; + + field_index = index; + bitvec_write_field(frame_bitvec, &field_index, field, GSM610_XMAXC_LEN); + + return field == 0; +} + +/** + * Reduce all XMAXC fields in the frame. When all XMAXC fields + * reach zero, then the function will return true. + */ +static bool reduce_xmaxcr_all(struct bitvec *frame_bitvec) +{ + bool silent = false; + + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC00)) + silent = true; + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC10)) + silent = true; + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC20)) + silent = true; + if (reduce_xmaxcr(frame_bitvec, GSM610_RTP_XMAXC30)) + silent = true; + + return silent; +} + +/* Use certain modifications to conceal the errors in a full rate frame */ +static int conceal_frame(uint8_t *frame) +{ + struct bitvec *frame_bitvec; + unsigned int len; + bool silent; + int rc = 0; + + /* In case we already deal with a silent frame, + * there is nothing to, we just abort immediately */ + if (osmo_fr_check_sid(frame, GSM_FR_BYTES)) + return 0; + + /* Attempt to allocate memory for bitvec */ + frame_bitvec = bitvec_alloc(GSM_FR_BYTES, NULL); + if (!frame_bitvec) + return -ENOMEM; + + /* Convert a frame to bitvec */ + len = bitvec_unpack(frame_bitvec, frame); + if (len != GSM_FR_BYTES) { + rc = -EIO; + goto leave; + } + + /* Fudge frame parameters */ + silent = reduce_xmaxcr_all(frame_bitvec); + + /* If we reached silence level, mute the frame + * completely, this also means that we can + * save the bitvec_pack operation */ + if (silent) { + memset(frame, 0x00, GSM_FR_BYTES); + frame[0] = 0xd0; + goto leave; + } + + /* Convert back to packed byte form */ + len = bitvec_pack(frame_bitvec, frame); + if (len != GSM_FR_BYTES) { + rc = -EIO; + goto leave; + } + +leave: + bitvec_free(frame_bitvec); + return rc; +} + +/** + * To be called when a good frame is received. + * This function will then create a backup of the frame + * and reset the internal state. + */ +void osmo_ecu_fr_reset(struct osmo_ecu_fr_state *state, uint8_t *frame) +{ + state->subsequent_lost_frame = false; + memcpy(state->frame_backup, frame, GSM_FR_BYTES); +} + +/** + * To be called when a bad frame is received. + * This function will then generate a replacement frame + * that can be used to conceal the dropout. + */ +int osmo_ecu_fr_conceal(struct osmo_ecu_fr_state *state, uint8_t *frame) +{ + int rc; + + /* For subsequent frames we run the error concealment + * functions on the backed up frame before we restore + * the backup */ + if (state->subsequent_lost_frame) { + rc = conceal_frame(state->frame_backup); + if (rc) + return rc; + } + + /* Restore the backed up frame and set flag in case + * we receive even more bad frames */ + memcpy(frame, state->frame_backup, GSM_FR_BYTES); + state->subsequent_lost_frame = true; + + return 0; +} diff --git a/tests/Makefile.am b/tests/Makefile.am index 78542b2..877a302 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -17,7 +17,8 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test gsm23003/gsm23003_test + stats/stats_test prbs/prbs_test gsm23003/gsm23003_test \ + codec/codec_ecu_fr_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -136,6 +137,9 @@ codec_codec_test_SOURCES = codec/codec_test.c codec_codec_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la +codec_codec_ecu_fr_test_SOURCES = codec/codec_ecu_fr_test.c +codec_codec_ecu_fr_test_LDADD = $(LDADD) $(top_builddir)/src/codec/libosmocodec.la + loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c loggingrb_loggingrb_test_LDADD = $(LDADD) @@ -205,11 +209,13 @@ gsm0808/gsm0808_test.ok gb/bssgp_fc_tests.err \ gb/bssgp_fc_tests.ok gb/bssgp_fc_tests.sh \ gb/gprs_bssgp_test.ok gb/gprs_ns_test.ok gea/gea_test.ok \ - gprs/gprs_test.ok kasumi/kasumi_test.ok codec/codec_test.ok \ + gprs/gprs_test.ok kasumi/kasumi_test.ok \ msgfile/msgfile_test.ok msgfile/msgconfig.cfg \ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ loggingrb/logging_test.err strrb/strrb_test.ok \ + codec/codec_test.ok \ + codec/codec_ecu_fr_test.ok \ vty/vty_test.ok \ vty/fail_not_de-indented.cfg \ vty/fail_tabs_and_spaces.cfg \ diff --git a/tests/codec/codec_ecu_fr_test.c b/tests/codec/codec_ecu_fr_test.c new file mode 100644 index 0000000..0fdc489 --- /dev/null +++ b/tests/codec/codec_ecu_fr_test.c @@ -0,0 +1,146 @@ +#include +#include +#include + +#include +#include + +#include +#include + +/* Set with sample full-rate voice frames and some intentional dropouts */ +static const char *fr_frames_hex[] = { + "d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723", + "d8eb83699a66c036ec89b7246e6034dc8d48948620589b7256e3a6603b2371b8da", + "d967abaa1cbe4035238da6ace4c036d46ec69ba600391c4eb8a2b040591c6a3924", + "d8e8a42662c240472469b91bd2e0452291b6dba600495b8e38dcb020491a71c91b", + "da2aac1ddbb00036e46e26dcec6039138db923822047137248e3560048e38dc8e3", + "d929ab2a9b5240395b6dc72ba020469c8d551c5440349c9148e36a4036a372471b", + "d9eb93215bb8a0271c69c724682036db71c71a94a0372491b72bee4044eb71b923", + "d9ab9aa19abc40391b6e5ae2ee40471b91c6dbe820492291b8e4b84036e47238db", + "d96b9be9db782044e371b55cb200389491c69b8ea034e271c8d3808038ec6db8e3", + "d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd", + "BAD", + "d9ea9c219ce60046e38d3724e0c034e56e36eb7e0038d471b8dcb260491b8dbb23", + "d9e89be9d9e0a0391b6dd6a4624029247138e3a2a04713922524de0036db69d91c", + "d9699422a2b6a048dd90c91c6a802b6259395c8880575b4a58e4ac20269d7248d4", + "d967ac5b1baae0371c71b8ab9c804a9e8e58a55a8038626ec8dcb640395c7244dc", + "d9e8a3e262e68027638db52b88a038634e471a7ec049136e3b1bc8402923adcad2", + "d8eab36e1bbe0046e34d491b608035137658d3524044e48e375cdac0472b9238d4", + "d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b", + "BAD", + "BAD", + "d8e6a2e1d3d2605b1376c8d35280392451391cbc80392a71b6db8aa049238dc8ab", + "d9a87ba1a3982048eb8a471cac00472b4e391bbc40292489b71cc200495b8d3ae3", + "d9278b2a1ba4c0475b8dc722d6e0491b5228da70204ae36dc71d94a056a29236e3", + "d9ec9be2129520392335598c50c04b5bad3d4ba680789b69df5a5aa0469cd1b4da", + "d8ea932623e660669b8e4a9dd8a03aa32a76e466e028d396cc9bbe4047256dc8e5", + "d96a94215aa0403aab713f22e8e024e68db91ab6a027abd1a55b6e804aec9146e4", + "d867ac21e270a0350d6ac91a724037247246d2a6c0396c89d6dc562049244e48d5", + "d8a9b460d3b48026a4ad471b7c20452491b69bbc803ae48db722ee00292491a8db", + "d928a3e1d3b24036e37244abf02047634d371b74c047637148a29ac03b234e38e3", + "d9ab9b21d2e0c0471c693aec54e044dbae46dc7c20391badb724ee8038e469bb15", + "d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963", + "BAD", + "BAD", + "BAD", + "BAD", + "BAD", + "BAD", + "d92c8b6d5aee4034ebb22724862047145634a5c0a038e371b8e4a880485c89dd25", + "d8e78b29e3c6c038dba9d91beca04723ad491cda80471471b6ec7ae03b1396b91b", + "d8a78b25e37a0022dd8a46dc68a0351bad391bde2046e56dd8dc96c038e396d89b", + "d8a88c255ab6e038e38e48dbde8038ad8dc8db8ec0376372b564b44038e49234dc", + "d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3", + "d8ee9bea5ae4003ae371b713eae05adc91995a5ea064dcc9571e786026ed51c52c", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d92aab696190c046e26e392cae0026a376a8dc662048d291b75b54c04ad3ae3b1b", + "d8e7a469627a6038e289cb1baca0569b8db6dddec026dc8e38e5dc803722722d23", + "d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713", + "BAD", + "d7299c19a3be8024e58ea7a49f20a522963ad976e0a76ecd92b38500cb62aa4c94", + "d7eb6c6262eee02b2c42e79a60a0aa55aed68a7f00ad358e10fad960e55a39396d", + "d970858dd2ab61d91355ebc15ca1a6a7ca48a05cc0dae66f2523c2a1bad3825daa", + "d8f0844a23ad20da50d6de025e81c37392b9039cc0c764c1bd1e94c1b699736a98", + "d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763", + "d2577a1cda50004924924924500049249249245000492492492450004923924924", + NULL +}; + +/* Example of a good frame */ +static const char *sample_frame_hex = \ + "d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da"; + +/** + * Start with a good voice frame and then simulate 20 consecutive bad frames, + * watching how the error concealment decreases the XMAXC parameters. + */ +void test_fr_concealment(void) +{ + struct osmo_ecu_fr_state state; + uint8_t frame[GSM_FR_BYTES]; + int i, rc; + + /* Parse frame from string to hex */ + osmo_hexparse(sample_frame_hex, frame, GSM_FR_BYTES); + + printf("Start with: %s\n", sample_frame_hex); + + /* Reset the ECU with the proposed known good frame */ + osmo_ecu_fr_reset(&state, frame); + + /* Now pretend that we do not receive any good frames anymore */ + for (i = 0; i < 20; i++) { + rc = osmo_ecu_fr_conceal(&state, frame); + OSMO_ASSERT(rc == 0); + + printf("conceal: %02i, result: %s\n", + i, osmo_hexdump_nospc(frame, GSM_FR_BYTES)); + } +} + +/* Simulate a real life situation: voice frames with a few dropouts */ +void test_fr_concealment_realistic() +{ + struct osmo_ecu_fr_state state; + uint8_t frame[GSM_FR_BYTES]; + unsigned int frame_len; + int rc, i = 0; + + while (fr_frames_hex[i] != NULL) { + /* Debug print */ + printf("Frame No. %03i:\n", i); + + /* Good or bad frame? */ + frame_len = strlen(fr_frames_hex[i]) / 2; + if (frame_len == GSM_FR_BYTES) { + printf(" * input: %s\n", fr_frames_hex[i]); + osmo_hexparse(fr_frames_hex[i], frame, GSM_FR_BYTES); + osmo_ecu_fr_reset(&state, frame); + } else { + printf(" * input: (bad)\n"); + memset(frame, 0x00, GSM_FR_BYTES); + rc = osmo_ecu_fr_conceal(&state, frame); + OSMO_ASSERT(rc == 0); + } + + /* Print result */ + printf(" * output: %s\n", + osmo_hexdump_nospc(frame, GSM_FR_BYTES)); + + /* Go to the next frame */ + i++; + } +} + +int main(int argc, char **argv) +{ + /* Perform actual tests */ + test_fr_concealment(); + test_fr_concealment_realistic(); + + return 0; +} diff --git a/tests/codec/codec_ecu_fr_test.ok b/tests/codec/codec_ecu_fr_test.ok new file mode 100644 index 0000000..6e20099 --- /dev/null +++ b/tests/codec/codec_ecu_fr_test.ok @@ -0,0 +1,192 @@ +Start with: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da +conceal: 00, result: d9ec9be212901f802335598c501f805bad3d4ba01f809b69df5a501f809cd1b4da +conceal: 01, result: d9ec9be212901d802335598c501d805bad3d4ba01d809b69df5a501d809cd1b4da +conceal: 02, result: d9ec9be212901b802335598c501b805bad3d4ba01b809b69df5a501b809cd1b4da +conceal: 03, result: d9ec9be2129019802335598c5019805bad3d4ba019809b69df5a5019809cd1b4da +conceal: 04, result: d9ec9be2129017802335598c5017805bad3d4ba017809b69df5a5017809cd1b4da +conceal: 05, result: d9ec9be2129015802335598c5015805bad3d4ba015809b69df5a5015809cd1b4da +conceal: 06, result: d9ec9be2129013802335598c5013805bad3d4ba013809b69df5a5013809cd1b4da +conceal: 07, result: d9ec9be2129011802335598c5011805bad3d4ba011809b69df5a5011809cd1b4da +conceal: 08, result: d9ec9be212900f802335598c500f805bad3d4ba00f809b69df5a500f809cd1b4da +conceal: 09, result: d9ec9be212900d802335598c500d805bad3d4ba00d809b69df5a500d809cd1b4da +conceal: 10, result: d9ec9be212900b802335598c500b805bad3d4ba00b809b69df5a500b809cd1b4da +conceal: 11, result: d9ec9be2129009802335598c5009805bad3d4ba009809b69df5a5009809cd1b4da +conceal: 12, result: d9ec9be2129007802335598c5007805bad3d4ba007809b69df5a5007809cd1b4da +conceal: 13, result: d9ec9be2129005802335598c5005805bad3d4ba005809b69df5a5005809cd1b4da +conceal: 14, result: d9ec9be2129003802335598c5003805bad3d4ba003809b69df5a5003809cd1b4da +conceal: 15, result: d9ec9be2129001802335598c5001805bad3d4ba001809b69df5a5001809cd1b4da +conceal: 16, result: d00000000000000000000000000000000000000000000000000000000000000000 +conceal: 17, result: d00000000000000000000000000000000000000000000000000000000000000000 +conceal: 18, result: d00000000000000000000000000000000000000000000000000000000000000000 +conceal: 19, result: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 000: + * input: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 + * output: d9aa93ae63de00471a91b95b8660471392b4a2daa037628f391c624039258dc723 +Frame No. 001: + * input: d8eb83699a66c036ec89b7246e6034dc8d48948620589b7256e3a6603b2371b8da + * output: d8eb83699a66c036ec89b7246e6034dc8d48948620589b7256e3a6603b2371b8da +Frame No. 002: + * input: d967abaa1cbe4035238da6ace4c036d46ec69ba600391c4eb8a2b040591c6a3924 + * output: d967abaa1cbe4035238da6ace4c036d46ec69ba600391c4eb8a2b040591c6a3924 +Frame No. 003: + * input: d8e8a42662c240472469b91bd2e0452291b6dba600495b8e38dcb020491a71c91b + * output: d8e8a42662c240472469b91bd2e0452291b6dba600495b8e38dcb020491a71c91b +Frame No. 004: + * input: da2aac1ddbb00036e46e26dcec6039138db923822047137248e3560048e38dc8e3 + * output: da2aac1ddbb00036e46e26dcec6039138db923822047137248e3560048e38dc8e3 +Frame No. 005: + * input: d929ab2a9b5240395b6dc72ba020469c8d551c5440349c9148e36a4036a372471b + * output: d929ab2a9b5240395b6dc72ba020469c8d551c5440349c9148e36a4036a372471b +Frame No. 006: + * input: d9eb93215bb8a0271c69c724682036db71c71a94a0372491b72bee4044eb71b923 + * output: d9eb93215bb8a0271c69c724682036db71c71a94a0372491b72bee4044eb71b923 +Frame No. 007: + * input: d9ab9aa19abc40391b6e5ae2ee40471b91c6dbe820492291b8e4b84036e47238db + * output: d9ab9aa19abc40391b6e5ae2ee40471b91c6dbe820492291b8e4b84036e47238db +Frame No. 008: + * input: d96b9be9db782044e371b55cb200389491c69b8ea034e271c8d3808038ec6db8e3 + * output: d96b9be9db782044e371b55cb200389491c69b8ea034e271c8d3808038ec6db8e3 +Frame No. 009: + * input: d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd + * output: d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd +Frame No. 010: + * input: (bad) + * output: d9aa9365e3f060375c6db6ebc4c02764b1c51b78a0571c91a723de6049248dc8dd +Frame No. 011: + * input: d9ea9c219ce60046e38d3724e0c034e56e36eb7e0038d471b8dcb260491b8dbb23 + * output: d9ea9c219ce60046e38d3724e0c034e56e36eb7e0038d471b8dcb260491b8dbb23 +Frame No. 012: + * input: d9e89be9d9e0a0391b6dd6a4624029247138e3a2a04713922524de0036db69d91c + * output: d9e89be9d9e0a0391b6dd6a4624029247138e3a2a04713922524de0036db69d91c +Frame No. 013: + * input: d9699422a2b6a048dd90c91c6a802b6259395c8880575b4a58e4ac20269d7248d4 + * output: d9699422a2b6a048dd90c91c6a802b6259395c8880575b4a58e4ac20269d7248d4 +Frame No. 014: + * input: d967ac5b1baae0371c71b8ab9c804a9e8e58a55a8038626ec8dcb640395c7244dc + * output: d967ac5b1baae0371c71b8ab9c804a9e8e58a55a8038626ec8dcb640395c7244dc +Frame No. 015: + * input: d9e8a3e262e68027638db52b88a038634e471a7ec049136e3b1bc8402923adcad2 + * output: d9e8a3e262e68027638db52b88a038634e471a7ec049136e3b1bc8402923adcad2 +Frame No. 016: + * input: d8eab36e1bbe0046e34d491b608035137658d3524044e48e375cdac0472b9238d4 + * output: d8eab36e1bbe0046e34d491b608035137658d3524044e48e375cdac0472b9238d4 +Frame No. 017: + * input: d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b + * output: d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b +Frame No. 018: + * input: (bad) + * output: d9689ba5e3d260491b516adb5e4027256e27227ee0351c8e549a5c60492471971b +Frame No. 019: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 020: + * input: d8e6a2e1d3d2605b1376c8d35280392451391cbc80392a71b6db8aa049238dc8ab + * output: d8e6a2e1d3d2605b1376c8d35280392451391cbc80392a71b6db8aa049238dc8ab +Frame No. 021: + * input: d9a87ba1a3982048eb8a471cac00472b4e391bbc40292489b71cc200495b8d3ae3 + * output: d9a87ba1a3982048eb8a471cac00472b4e391bbc40292489b71cc200495b8d3ae3 +Frame No. 022: + * input: d9278b2a1ba4c0475b8dc722d6e0491b5228da70204ae36dc71d94a056a29236e3 + * output: d9278b2a1ba4c0475b8dc722d6e0491b5228da70204ae36dc71d94a056a29236e3 +Frame No. 023: + * input: d9ec9be2129520392335598c50c04b5bad3d4ba680789b69df5a5aa0469cd1b4da + * output: d9ec9be2129520392335598c50c04b5bad3d4ba680789b69df5a5aa0469cd1b4da +Frame No. 024: + * input: d8ea932623e660669b8e4a9dd8a03aa32a76e466e028d396cc9bbe4047256dc8e5 + * output: d8ea932623e660669b8e4a9dd8a03aa32a76e466e028d396cc9bbe4047256dc8e5 +Frame No. 025: + * input: d96a94215aa0403aab713f22e8e024e68db91ab6a027abd1a55b6e804aec9146e4 + * output: d96a94215aa0403aab713f22e8e024e68db91ab6a027abd1a55b6e804aec9146e4 +Frame No. 026: + * input: d867ac21e270a0350d6ac91a724037247246d2a6c0396c89d6dc562049244e48d5 + * output: d867ac21e270a0350d6ac91a724037247246d2a6c0396c89d6dc562049244e48d5 +Frame No. 027: + * input: d8a9b460d3b48026a4ad471b7c20452491b69bbc803ae48db722ee00292491a8db + * output: d8a9b460d3b48026a4ad471b7c20452491b69bbc803ae48db722ee00292491a8db +Frame No. 028: + * input: d928a3e1d3b24036e37244abf02047634d371b74c047637148a29ac03b234e38e3 + * output: d928a3e1d3b24036e37244abf02047634d371b74c047637148a29ac03b234e38e3 +Frame No. 029: + * input: d9ab9b21d2e0c0471c693aec54e044dbae46dc7c20391badb724ee8038e469bb15 + * output: d9ab9b21d2e0c0471c693aec54e044dbae46dc7c20391badb724ee8038e469bb15 +Frame No. 030: + * input: d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963 + * output: d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963 +Frame No. 031: + * input: (bad) + * output: d9a99361a276403b1a6ad6dcd40026e489c8e3bc40371c4dc564e2c036e28eb963 +Frame No. 032: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 033: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 034: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 035: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 036: + * input: (bad) + * output: d00000000000000000000000000000000000000000000000000000000000000000 +Frame No. 037: + * input: d92c8b6d5aee4034ebb22724862047145634a5c0a038e371b8e4a880485c89dd25 + * output: d92c8b6d5aee4034ebb22724862047145634a5c0a038e371b8e4a880485c89dd25 +Frame No. 038: + * input: d8e78b29e3c6c038dba9d91beca04723ad491cda80471471b6ec7ae03b1396b91b + * output: d8e78b29e3c6c038dba9d91beca04723ad491cda80471471b6ec7ae03b1396b91b +Frame No. 039: + * input: d8a78b25e37a0022dd8a46dc68a0351bad391bde2046e56dd8dc96c038e396d89b + * output: d8a78b25e37a0022dd8a46dc68a0351bad391bde2046e56dd8dc96c038e396d89b +Frame No. 040: + * input: d8a88c255ab6e038e38e48dbde8038ad8dc8db8ec0376372b564b44038e49234dc + * output: d8a88c255ab6e038e38e48dbde8038ad8dc8db8ec0376372b564b44038e49234dc +Frame No. 041: + * input: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 + * output: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 +Frame No. 042: + * input: d8ee9bea5ae4003ae371b713eae05adc91995a5ea064dcc9571e786026ed51c52c + * output: d8ee9bea5ae4003ae371b713eae05adc91995a5ea064dcc9571e786026ed51c52c +Frame No. 043: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 044: + * input: d92aab696190c046e26e392cae0026a376a8dc662048d291b75b54c04ad3ae3b1b + * output: d92aab696190c046e26e392cae0026a376a8dc662048d291b75b54c04ad3ae3b1b +Frame No. 045: + * input: d8e7a469627a6038e289cb1baca0569b8db6dddec026dc8e38e5dc803722722d23 + * output: d8e7a469627a6038e289cb1baca0569b8db6dddec026dc8e38e5dc803722722d23 +Frame No. 046: + * input: d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713 + * output: d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713 +Frame No. 047: + * input: (bad) + * output: d8a88c299b64c03a548a58e37420272c6dd76b92c0471c9236dbc0e0551c71c713 +Frame No. 048: + * input: d7299c19a3be8024e58ea7a49f20a522963ad976e0a76ecd92b38500cb62aa4c94 + * output: d7299c19a3be8024e58ea7a49f20a522963ad976e0a76ecd92b38500cb62aa4c94 +Frame No. 049: + * input: d7eb6c6262eee02b2c42e79a60a0aa55aed68a7f00ad358e10fad960e55a39396d + * output: d7eb6c6262eee02b2c42e79a60a0aa55aed68a7f00ad358e10fad960e55a39396d +Frame No. 050: + * input: d970858dd2ab61d91355ebc15ca1a6a7ca48a05cc0dae66f2523c2a1bad3825daa + * output: d970858dd2ab61d91355ebc15ca1a6a7ca48a05cc0dae66f2523c2a1bad3825daa +Frame No. 051: + * input: d8f0844a23ad20da50d6de025e81c37392b9039cc0c764c1bd1e94c1b699736a98 + * output: d8f0844a23ad20da50d6de025e81c37392b9039cc0c764c1bd1e94c1b699736a98 +Frame No. 052: + * input: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 + * output: d9708ce6a39ce049646646a2c1a0272496b29a66c037db562863ace0795b55b2e3 +Frame No. 053: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 054: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 055: + * input: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 + * output: d9299421d2944036ed69b8e572a048e36d551cd480571d4ec95be680356c69c763 +Frame No. 056: + * input: d2577a1cda50004924924924500049249249245000492492492450004923924924 + * output: d2577a1cda50004924924924500049249249245000492492492450004923924924 diff --git a/tests/testsuite.at b/tests/testsuite.at index 81730ee..0ec852c 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -157,6 +157,12 @@ AT_CHECK([$abs_top_builddir/tests/codec/codec_test], [0], [expout], [ignore]) AT_CLEANUP +AT_SETUP([codec_ecu_fr]) +AT_KEYWORDS([codec_ecu_fr]) +cat $abs_srcdir/codec/codec_ecu_fr_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/codec/codec_ecu_fr_test], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([fr]) AT_KEYWORDS([fr]) cat $abs_srcdir/fr/fr_test.ok > expout -- To view, visit https://gerrit.osmocom.org/5421 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I06a21f60db01bfe1c2b838f93866fad1d53fdcd1 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: dexter From admin at opensuse.org Mon Jan 15 21:05:46 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 21:05:46 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5a5d17ccc2ace_18fe344f54843527@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 481s] case the test suite provides a good starting point. Its output may [ 481s] be found below `tests/testsuite.dir'. [ 481s] [ 481s] Makefile:678: recipe for target 'check-local' failed [ 481s] make[4]: *** [check-local] Error 1 [ 481s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 481s] Makefile:538: recipe for target 'check-am' failed [ 481s] make[3]: *** [check-am] Error 2 [ 481s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 481s] Makefile:390: recipe for target 'check-recursive' failed [ 481s] make[2]: *** [check-recursive] Error 1 [ 481s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 481s] Makefile:500: recipe for target 'check-recursive' failed [ 481s] make[1]: *** [check-recursive] Error 1 [ 481s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 481s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 481s] debian/rules:6: recipe for target 'build' failed [ 481s] make: *** [build] Error 2 [ 481s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 481s] [ 481s] armbuild17 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 21:05:42 UTC 2018. [ 481s] [ 481s] ### VM INTERACTION START ### [ 484s] [ 444.329442] SysRq : Power Off [ 484s] [ 444.330776] reboot: Power down [ 484s] ### VM INTERACTION END ### [ 484s] [ 484s] armbuild17 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 21:05:45 UTC 2018. [ 484s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Mon Jan 15 20:12:54 2018 From: admin at opensuse.org (OBS Notification) Date: Mon, 15 Jan 2018 20:12:54 +0000 Subject: Build failure of network:osmocom:nightly/osmo-trx in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <5a5d0b5eb29e4_18fe344f5482969c@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-trx/Debian_9.0/aarch64 Package network:osmocom:nightly/osmo-trx failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-trx Last lines of build log: [ 1297s] case the test suite provides a good starting point. Its output may [ 1297s] be found below `tests/testsuite.dir'. [ 1297s] [ 1297s] Makefile:678: recipe for target 'check-local' failed [ 1297s] make[4]: *** [check-local] Error 1 [ 1297s] make[4]: Leaving directory '/usr/src/packages/BUILD/tests' [ 1297s] Makefile:538: recipe for target 'check-am' failed [ 1297s] make[3]: *** [check-am] Error 2 [ 1297s] make[3]: Leaving directory '/usr/src/packages/BUILD/tests' [ 1297s] Makefile:390: recipe for target 'check-recursive' failed [ 1297s] make[2]: *** [check-recursive] Error 1 [ 1297s] make[2]: Leaving directory '/usr/src/packages/BUILD/tests' [ 1297s] Makefile:500: recipe for target 'check-recursive' failed [ 1297s] make[1]: *** [check-recursive] Error 1 [ 1297s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 1297s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 1297s] debian/rules:6: recipe for target 'build' failed [ 1297s] make: *** [build] Error 2 [ 1297s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 1297s] [ 1297s] obs-arm-3 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 20:12:40 UTC 2018. [ 1297s] [ 1297s] ### VM INTERACTION START ### [ 1300s] [ 1203.656108] sysrq: SysRq : Power Off [ 1300s] [ 1203.685074] reboot: Power down [ 1301s] ### VM INTERACTION END ### [ 1301s] [ 1301s] obs-arm-3 failed "build osmo-trx_0.2.0.20180115.dsc" at Mon Jan 15 20:12:44 UTC 2018. [ 1301s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Mon Jan 15 22:30:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 15 Jan 2018 22:30:27 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Add "SourceInfoFormat := Single; " to all test configs Message-ID: Review at https://gerrit.osmocom.org/5803 Add "SourceInfoFormat := Single;" to all test configs This will make sure that all log files will contain information about the .ttcn source file name and line number that has caused the log, which is extremely useful during debugging. Change-Id: Id6785757f20279ba84b34747f878baf67d065b20 --- M bsc-nat/IPA_Test.cfg M bsc/BSC_Tests.cfg M ggsn_tests/GGSN_Tests.cfg M gprs_gb/Test.cfg M mgw/MGCP_Test.cfg M selftest/Selftest.cfg M sysinfo/Test.cfg 7 files changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/03/5803/1 diff --git a/bsc-nat/IPA_Test.cfg b/bsc-nat/IPA_Test.cfg index 3a34102..617e349 100644 --- a/bsc-nat/IPA_Test.cfg +++ b/bsc-nat/IPA_Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/bsc/BSC_Tests.cfg b/bsc/BSC_Tests.cfg index 5fd3203..fcb1055 100644 --- a/bsc/BSC_Tests.cfg +++ b/bsc/BSC_Tests.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC #FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index a7f4681..e97578c 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; ConsoleMask := DEBUG | LOG_ALL | MATCHING | DEBUG_TESTPORT LoggerPlugins := { JUnitLogger := "libjunitlogger2" } diff --git a/gprs_gb/Test.cfg b/gprs_gb/Test.cfg index 2155628..2f11dfb 100644 --- a/gprs_gb/Test.cfg +++ b/gprs_gb/Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #*.FileMask := LOG_ALL ConsoleMask := ERROR | WARNING | TESTCASE | TIMEROP_START | DEBUG_ENCDEC diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg index 75989fe..00e3d7c 100644 --- a/mgw/MGCP_Test.cfg +++ b/mgw/MGCP_Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/selftest/Selftest.cfg b/selftest/Selftest.cfg index 1eed017..ffa0edb 100644 --- a/selftest/Selftest.cfg +++ b/selftest/Selftest.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC #FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/sysinfo/Test.cfg b/sysinfo/Test.cfg index 16e0dd6..56696f4 100644 --- a/sysinfo/Test.cfg +++ b/sysinfo/Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; [MODULE_PARAMETERS] -- To view, visit https://gerrit.osmocom.org/5803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id6785757f20279ba84b34747f878baf67d065b20 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 15 22:31:42 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 22:31:42 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator Message-ID: Review at https://gerrit.osmocom.org/5804 hnbgw_rua.c: log: fix integer format for cN_DomainIndicator Fixes: CID#135219 Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0 --- M src/hnbgw_rua.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/04/5804/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b2b8792..e918c47 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -198,7 +198,7 @@ is_ps = true; break; default: - LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", + LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %ld\n", cN_DomainIndicator); return -1; } -- To view, visit https://gerrit.osmocom.org/5804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 22:31:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 22:31:43 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw_rua: fix dereference of unset pointer Message-ID: Review at https://gerrit.osmocom.org/5805 hnbgw_rua: fix dereference of unset pointer In the UNITDATA case, there is no map, so a) initialize map as NULL and b) print the RUA ctx id directly from local var context_id instead. Fixes: CID#181969 Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe --- M src/hnbgw_rua.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/05/5805/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index e918c47..40d1d94 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -181,7 +181,7 @@ { struct msgb *msg; struct osmo_scu_prim *prim; - struct hnbgw_context_map *map; + struct hnbgw_context_map *map = NULL; struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink; struct osmo_sccp_addr *remote_addr; bool is_ps; @@ -218,7 +218,7 @@ DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, no scu_conn_id)\n", cn_domain_indicator_to_str(cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr), - map->rua_ctx_id); + context_id); break; default: map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); -- To view, visit https://gerrit.osmocom.org/5805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 22:31:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 22:31:43 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw_cn: rx ranap: set rc in all cases Message-ID: Review at https://gerrit.osmocom.org/5806 hnbgw_cn: rx ranap: set rc in all cases There don't seem to be any evaluations of the rc, nevertheless return well-defined values. Fixes: CID#181968 Change-Id: I59295388564e5d270da32db6e7488755231f8a11 --- M src/hnbgw_cn.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/06/5806/1 diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index c48f4b7..ede00c8 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -19,6 +19,7 @@ */ #include +#include #include #include @@ -209,10 +210,12 @@ LOGP(DRANAP, LOGL_NOTICE, "Received unsupported RANAP " "unsuccessful outcome procedure %ld from CN, ignoring\n", pdu->choice.unsuccessfulOutcome.procedureCode); + rc = -ENOTSUP; break; default: LOGP(DRANAP, LOGL_NOTICE, "Received suspicious RANAP " "presence %u from CN, ignoring\n", pdu->present); + rc = -EINVAL; break; } -- To view, visit https://gerrit.osmocom.org/5806 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59295388564e5d270da32db6e7488755231f8a11 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 22:31:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 22:31:43 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw_hnbap: fix missing return in rx [un]successful outcome Message-ID: Review at https://gerrit.osmocom.org/5807 hnbgw_hnbap: fix missing return in rx [un]successful outcome Fixes: CID#57732 CID#57733 Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832 --- M src/hnbgw_hnbap.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/07/5807/1 diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 058a42a..fab520d 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -522,12 +522,14 @@ static int hnbgw_rx_successful_outcome_msg(struct hnb_context *hnb, SuccessfulOutcome_t *msg) { - + /* We don't care much about HNBAP */ + return 0; } static int hnbgw_rx_unsuccessful_outcome_msg(struct hnb_context *hnb, UnsuccessfulOutcome_t *msg) { - + /* We don't care much about HNBAP */ + return 0; } -- To view, visit https://gerrit.osmocom.org/5807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Jan 15 22:40:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 15 Jan 2018 22:40:50 +0000 Subject: [PATCH] osmo-iuh[master]: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome Message-ID: Review at https://gerrit.osmocom.org/5808 cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome HNBAP isn't really that important to osmo-hnbgw operation, all we do is service the few requests so that the other side is happy and uses our Iuh. Nevertheless, could at least log if an UnsuccessfulOutcome was received. Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1 --- M src/hnbgw_hnbap.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/08/5808/1 diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index fab520d..2746c21 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -529,6 +529,10 @@ static int hnbgw_rx_unsuccessful_outcome_msg(struct hnb_context *hnb, UnsuccessfulOutcome_t *msg) { /* We don't care much about HNBAP */ + LOGP(DHNBAP, LOGL_ERROR, "Received Unsuccessful Outcome, procedureCode %ld, criticality %ld," + " from '%s', cell mcc %u mnc %u lac %u rac %u sac %u cid %u\n", + msg->procedureCode, msg->criticality, hnb->identity_info, + hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, hnb->id.sac, hnb->id.cid); return 0; } -- To view, visit https://gerrit.osmocom.org/5808 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:07 +0000 Subject: [PATCH] libosmocore[master]: logging: add ability to log the log-level with API and vty Message-ID: Review at https://gerrit.osmocom.org/5809 logging: add ability to log the log-level with API and vty Log the log level string after the category name, if enabled. The default behavior remains unchanged. Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 42 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/5809/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 922cbf6..1e809d0 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -298,6 +298,9 @@ void (*raw_output)(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap); + + /* Should the log level be printed? */ + bool print_level; }; /* use the above macros */ @@ -320,6 +323,7 @@ void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); +void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); const char* log_category_name(int subsys); diff --git a/src/logging.c b/src/logging.c index e4f3e87..80fc7d2 100644 --- a/src/logging.c +++ b/src/logging.c @@ -353,6 +353,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } + if (target->print_level) { + ret = snprintf(buf + offset, rem, "%s ", log_level_str(level)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } if (target->print_filename) { ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", subsys, file, line); @@ -608,6 +614,17 @@ target->print_category = print_category; } +/*! Enable or disable printing of the log level name. + * \param[in] target Log target to be affected + * \param[in] print_catname Enable (1) or disable (0) filenames + * + * Print the log level name in front of every log message. + */ +void log_set_print_level(struct log_target *target, int print_level) +{ + target->print_level = (bool)print_level; +} + /*! Set the global log level for a given log target * \param[in] target Log target to be affected * \param[in] log_level New global log level diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index dc457ff..5914822 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -203,6 +203,23 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_level, + logging_prnt_level_cmd, + "logging print level (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the log level name\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_level(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -734,6 +751,8 @@ else vty_out(vty, " logging timestamp %u%s", tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); + if (tgt->print_level) + vty_out(vty, " logging print level 1%s", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -783,6 +802,7 @@ install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); + install_element_ve(&logging_prnt_level_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -799,6 +819,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:08 +0000 Subject: [PATCH] libosmocore[master]: logging: color the log level Message-ID: Review at https://gerrit.osmocom.org/5810 logging: color the log level When log_set_use_color() is enabled, color the log level string according to the log level. The log line before and after the log level is printed in the category's color. ERROR and FATAL are red, NOTICE is yellow, INFO is green and DEBUG is blue. The default behavior remains unchanged. Change-Id: If2e52ae9ab83e538e04321c338e3fdffb2c7f9d3 --- M src/logging.c 1 file changed, 26 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/10/5810/1 diff --git a/src/logging.c b/src/logging.c index 80fc7d2..c01294c 100644 --- a/src/logging.c +++ b/src/logging.c @@ -298,6 +298,23 @@ return NULL; } +static const struct value_string level_colors[] = { + { LOGL_DEBUG, "\033[1;34m" }, + { LOGL_INFO, "\033[1;32m" }, + { LOGL_NOTICE, "\033[1;33m" }, + { LOGL_ERROR, "\033[1;31m" }, + { LOGL_FATAL, "\033[1;31m" }, + { 0, NULL } +}; + +static const char *level_color(int level) +{ + const char *c = get_value_string_or_null(level_colors, level); + if (!c) + return get_value_string(level_colors, LOGL_FATAL); + return c; +} + const char* log_category_name(int subsys) { if (subsys < osmo_log_info->num_cat) @@ -312,12 +329,13 @@ { char buf[4096]; int ret, len = 0, offset = 0, rem = sizeof(buf); + const char *c_subsys = NULL; /* are we using color */ if (target->use_color) { - const char *c = color(subsys); - if (c) { - ret = snprintf(buf + offset, rem, "%s", c); + c_subsys = color(subsys); + if (c_subsys) { + ret = snprintf(buf + offset, rem, c_subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); @@ -354,7 +372,11 @@ OSMO_SNPRINTF_RET(ret, rem, offset, len); } if (target->print_level) { - ret = snprintf(buf + offset, rem, "%s ", log_level_str(level)); + ret = snprintf(buf + offset, rem, "%s%s%s%s ", + target->use_color ? level_color(level) : "", + log_level_str(level), + target->use_color ? "\033[0;m" : "", + c_subsys ? c_subsys : ""); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2e52ae9ab83e538e04321c338e3fdffb2c7f9d3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:08 +0000 Subject: [PATCH] libosmocore[master]: logging: color the log category according to level Message-ID: Review at https://gerrit.osmocom.org/5811 logging: color the log category according to level When log_set_use_color() is enabled, color the log category string according to the log level. The log line before and after the log category is printed in the category's configured color. ERROR and FATAL are red, NOTICE is yellow, INFO is green and DEBUG is blue. The default behavior remains unchanged; If color is enabled, the category string will now always be colored in the log level color, not the log category color, and will stand out from the rest of the line. Change-Id: I84f886ac880e9056a666bbb231ae06cbaaf65f44 --- M src/logging.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/11/5811/1 diff --git a/src/logging.c b/src/logging.c index c01294c..a6aa7eb 100644 --- a/src/logging.c +++ b/src/logging.c @@ -366,7 +366,11 @@ OSMO_SNPRINTF_RET(ret, rem, offset, len); } if (target->print_category) { - ret = snprintf(buf + offset, rem, "%s ", log_category_name(subsys)); + ret = snprintf(buf + offset, rem, "%s%s%s%s ", + target->use_color ? level_color(level) : "", + log_category_name(subsys), + target->use_color ? "\033[0;m" : "", + c_subsys ? c_subsys : ""); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I84f886ac880e9056a666bbb231ae06cbaaf65f44 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:08 +0000 Subject: [PATCH] libosmocore[master]: logging: separate the '<000b>' subsys from filename logging Message-ID: Review at https://gerrit.osmocom.org/5812 logging: separate the '<000b>' subsys from filename logging Allow to log only the source filename and omit the (weird) hex output of the logging subsystem. The default behavior and old API usage remains unchanged. To remain backwards compatible: - Add a new flag to the end of struct log_target. - Interpret the log_set_print_filename(tgt, 1) as the legacy behavior of printing the category along. Print without the hex-category when log_set_print_filename() is called with 2 as parameter instead of 1. Document this in API doc. A VTY command is following in a subsequent patch. Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 --- M include/osmocom/core/logging.h M src/logging.c 2 files changed, 22 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5812/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 1e809d0..149ef82 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -301,6 +301,8 @@ /* Should the log level be printed? */ bool print_level; + /* With filename output, should the subsys be printed as hex like '<000b>'? */ + bool print_filename_subsys_hex; }; /* use the above macros */ diff --git a/src/logging.c b/src/logging.c index a6aa7eb..254afeb 100644 --- a/src/logging.c +++ b/src/logging.c @@ -385,9 +385,14 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } + if (target->print_filename && target->print_filename_subsys_hex) { + ret = snprintf(buf + offset, rem, "<%4.4x> ", subsys); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } if (target->print_filename) { - ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", - subsys, file, line); + ret = snprintf(buf + offset, rem, "%s:%d ", file, line); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); @@ -620,13 +625,22 @@ target->print_ext_timestamp = print_timestamp; } -/*! Enable or disable printing of the filename while logging +/*! Enable or disable printing of the filename while logging. + * Note, legacy behavior is to always log the subsystem (a.k.a. category) as + * '<000b>' hex representation along with the filename. Passing 1 as value + * enables this legacy behavior, as backwards compatible API. Passing 2 as + * value enables filenames, but omits the hex representation of the subsystem. + * Note that log_set_print_category() logs a human readable representation of + * the subsystem, independently from the source filename. * \param[in] target Log target to be affected - * \param[in] print_filename Enable (1) or disable (0) filenames + * \param[in] print_filename Enable (1) or disable (0) filenames, + * or 2 to enable filenames and omit the + * subsystem in hex representation. */ void log_set_print_filename(struct log_target *target, int print_filename) { - target->print_filename = print_filename; + target->print_filename = print_filename ? 1 : 0; + target->print_filename_subsys_hex = (print_filename == 2)? false : true; } /*! Enable or disable printing of the category name @@ -723,6 +737,7 @@ target->use_color = 1; target->print_timestamp = 0; target->print_filename = 1; + target->print_filename_subsys_hex = true; /* global log level */ target->loglevel = 0; -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:09 +0000 Subject: [PATCH] libosmocore[master]: logging: vty: add 'logging print file (0|1|with-cat)' cmd Message-ID: Review at https://gerrit.osmocom.org/5813 logging: vty: add 'logging print file (0|1|with-cat)' cmd Add a VTY command that allows configuring the output of source filename. So far, this was not configurable by VTY at all. Accomodate the (what I see as) legacy behavior of including the log category in hex form as argument 'with-cat'. 0 disables file output, 1 enables only file output without the hex category. The default behavior on startup still is to log file and hex category, to stay backwards compatible. Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc --- M src/vty/logging_vty.c 1 file changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/5813/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 5914822..4e2cefc 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -220,6 +220,30 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_file, + logging_prnt_file_cmd, + "logging print file (0|1|with-cat)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the source file and line\n" + "Prefix each log message with the subsys in hex and the source file and line" + " (legacy behavior)\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + int val; + + if (!tgt) + return CMD_WARNING; + + if (!strcmp(argv[0], "with-cat")) + val = 1; + else + val = atoi(argv[0])? 2 : 0; + log_set_print_filename(tgt, val); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -753,6 +777,9 @@ tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); + if (tgt->print_filename) + vty_out(vty, " logging print file %s%s", + tgt->print_filename_subsys_hex? "with-cat" : "1", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -803,6 +830,7 @@ install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); install_element_ve(&logging_prnt_level_cmd); + install_element_ve(&logging_prnt_file_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -820,6 +848,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_file_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:09 +0000 Subject: [PATCH] libosmocore[master]: logging: allow to log only the basename of each source Message-ID: Review at https://gerrit.osmocom.org/5814 logging: allow to log only the basename of each source In the VTY print filename command, add another parameter 'basename' to yield: logging print filename (0|1|basename|with-cat) In the C API, add another function log_set_print_basename() (when set overrides log_set_print_filename()), and to struct log_target add another flag print_basename. Rationale: especially when not building directly in the source dir, the paths to the source files can become rather long. Usually, just the basename of the file is sufficient to identify the source line. I see printout of the hex representation of the logging category as legacy behavior, so I don't bother to also allow printing the basename along with the hex category. Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 42 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/5814/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 149ef82..ba4c535 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -303,6 +303,8 @@ bool print_level; /* With filename output, should the subsys be printed as hex like '<000b>'? */ bool print_filename_subsys_hex; + /* With filename output, print just the basename? */ + bool print_basename; }; /* use the above macros */ @@ -324,6 +326,7 @@ void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); +void log_set_print_basename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); diff --git a/src/logging.c b/src/logging.c index 254afeb..969ad34 100644 --- a/src/logging.c +++ b/src/logging.c @@ -323,6 +323,14 @@ return NULL; } +static const char *const_basename(const char *path) +{ + const char *bn = strrchr(path, '/'); + if (!bn || !bn[1]) + return path; + return bn + 1; +} + static void _output(struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap) @@ -385,13 +393,18 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } - if (target->print_filename && target->print_filename_subsys_hex) { - ret = snprintf(buf + offset, rem, "<%4.4x> ", subsys); + if (target->print_basename) { + ret = snprintf(buf + offset, rem, "%s:%d ", const_basename(file), line); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); - } - if (target->print_filename) { + } else if (target->print_filename) { + if (target->print_filename_subsys_hex) { + ret = snprintf(buf + offset, rem, "<%4.4x> ", subsys); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } ret = snprintf(buf + offset, rem, "%s:%d ", file, line); if (ret < 0) goto err; @@ -643,6 +656,18 @@ target->print_filename_subsys_hex = (print_filename == 2)? false : true; } +/*! Enable or disable printing of the filename's basename while logging. + * If both log_set_print_filename() and log_set_print_basename() are enabled, + * log_set_print_basename() overrides and only the basename (without hex + * category) is printed. + * \param[in] target Log target to be affected. + * \param[in] print_basename Enable (1) or disable (0) basenames. + */ +void log_set_print_basename(struct log_target *target, int print_basename) +{ + target->print_basename = (bool)print_basename; +} + /*! Enable or disable printing of the category name * \param[in] target Log target to be affected * \param[in] print_catname Enable (1) or disable (0) filenames diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 4e2cefc..5f61067 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -222,11 +222,12 @@ DEFUN(logging_prnt_file, logging_prnt_file_cmd, - "logging print file (0|1|with-cat)", + "logging print file (0|1|basename|with-cat)", LOGGING_STR "Log output settings\n" "Configure log message\n" "Don't prefix each log message\n" "Prefix each log message with the source file and line\n" + "Prefix each log message with the source file's basename (strip leading paths) and line\n" "Prefix each log message with the subsys in hex and the source file and line" " (legacy behavior)\n") { @@ -236,6 +237,14 @@ if (!tgt) return CMD_WARNING; + if (!strcmp(argv[0], "basename")) { + log_set_print_basename(tgt, 1); + /* log_set_print_basename() overrides log_set_print_filename(), + * so no need to change its value. */ + return CMD_SUCCESS; + } else + log_set_print_basename(tgt, 0); + if (!strcmp(argv[0], "with-cat")) val = 1; else -- To view, visit https://gerrit.osmocom.org/5814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:09 +0000 Subject: [PATCH] libosmocore[master]: logging: allow adding separators to the extended-timestamp Message-ID: Review at https://gerrit.osmocom.org/5815 logging: allow adding separators to the extended-timestamp Add a log target config to allow separating the extended timestamp. Before: 20180116014434681 After: 2018-01-16 01:44:34.681 The default behavior, previous API argument behavior and VTY command behavior remain unchanged. In the C API, enable the separators by passing 2 to log_set_print_extended_timestamp(). Passing 1 still produces the unseparated extended-timestamp as before. In the struct log_target, add a separate flag to the end to stay ABI compatible. The print_ext_timestamp is a single-bit field, which we could enlarge assuming the struct is never packed, but adding a new flag is safer. In the VTY, add a new argument 'separated': logging print extended-timestamp (0|1|separated) Rationale: when reading log files, parsing the timestamp manually can be cumbersome. Human eyes aren't good at counting digits, I keep getting the minutes, seconds and millis wrong and waste my time on every glance. Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 23 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/5815/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index ba4c535..87452ec 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -305,6 +305,8 @@ bool print_filename_subsys_hex; /* With filename output, print just the basename? */ bool print_basename; + /* Add human-readable separators to the extended-timestamp */ + bool print_ext_timestamp_separators; }; /* use the above macros */ diff --git a/src/logging.c b/src/logging.c index 969ad34..1ce8878 100644 --- a/src/logging.c +++ b/src/logging.c @@ -353,9 +353,12 @@ if (target->print_ext_timestamp) { struct tm tm; struct timeval tv; + const char *ts_fmt = target->print_ext_timestamp_separators + ? "%04d-%02d-%02d %02d:%02d:%02d.%03d " + : "%04d%02d%02d%02d%02d%02d%03d "; osmo_gettimeofday(&tv, NULL); localtime_r(&tv.tv_sec, &tm); - ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", + ret = snprintf(buf + offset, rem, ts_fmt, tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, tm.tm_hour, tm.tm_min, tm.tm_sec, (int)(tv.tv_usec / 1000)); @@ -627,15 +630,17 @@ /*! Enable or disable printing of extended timestamps while logging * \param[in] target Log target to be affected - * \param[in] print_timestamp Enable (1) or disable (0) timestamps + * \param[in] print_timestamp Enable (1) or disable (0) timestamps, + * or 2 to enable with human readable separators. * * When both timestamp and extended timestamp is enabled then only * the extended timestamp will be used. The format of the timestamp - * is YYYYMMDDhhmmssnnn. + * is YYYYMMDDhhmmssnnn, or YYYY-MM-DD hh:mm:ss.nnn if 2 is passed as argument. */ void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp) { - target->print_ext_timestamp = print_timestamp; + target->print_ext_timestamp = print_timestamp ? 1 : 0; + target->print_ext_timestamp_separators = (print_timestamp == 2); } /*! Enable or disable printing of the filename while logging. diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 5f61067..e4e9bfe 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -171,18 +171,24 @@ DEFUN(logging_prnt_ext_timestamp, logging_prnt_ext_timestamp_cmd, - "logging print extended-timestamp (0|1)", + "logging print extended-timestamp (0|1|separated)", LOGGING_STR "Log output settings\n" "Configure log message timestamping\n" "Don't prefix each log message\n" - "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") + "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n" + "Prefix each log message with current timestamp with YYYY-MM-DD hh:mm:ss.nnn\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); + int val; if (!tgt) return CMD_WARNING; - log_set_print_extended_timestamp(tgt, atoi(argv[0])); + if (!strcmp(argv[0], "separated")) + val = 2; + else + val = atoi(argv[0]); + log_set_print_extended_timestamp(tgt, val); return CMD_SUCCESS; } @@ -780,7 +786,9 @@ vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); if (tgt->print_ext_timestamp) - vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); + vty_out(vty, " logging print extended-timestamp %s%s", + tgt->print_ext_timestamp_separators? "separated" : "1", + VTY_NEWLINE); else vty_out(vty, " logging timestamp %u%s", tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/5815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 02:34:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 02:34:09 +0000 Subject: [PATCH] libosmocore[master]: cosmetic: logging: if color is disabled, don't print "" Message-ID: Review at https://gerrit.osmocom.org/5816 cosmetic: logging: if color is disabled, don't print "" If color output is disabled, skip the empty snprintf() to (not) clear the ANSI color. Also, no need to use a format string of "%s", just pass the string constant directly. That is a micro optimisation as well as clarification of the code. Change-Id: Ie7cb06de160830d2f8ee5718246c0fe311f68d49 --- M src/logging.c 1 file changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/16/5816/1 diff --git a/src/logging.c b/src/logging.c index 1ce8878..fce259f 100644 --- a/src/logging.c +++ b/src/logging.c @@ -419,11 +419,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); - ret = snprintf(buf + offset, rem, "%s", - target->use_color ? "\033[0;m" : ""); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + if (target->use_color) { + ret = snprintf(buf + offset, rem, "\033[0;m"); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } err: buf[sizeof(buf)-1] = '\0'; target->output(target, level, buf); -- To view, visit https://gerrit.osmocom.org/5816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7cb06de160830d2f8ee5718246c0fe311f68d49 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 08:44:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 08:44:28 +0000 Subject: osmo-ci[master]: jobs: osmo-trx: Set slave_axis to use only debian9 In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 08:44:33 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 08:44:33 +0000 Subject: [MERGED] osmo-ci[master]: jobs: osmo-trx: Set slave_axis to use only debian9 In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: jobs: osmo-trx: Set slave_axis to use only debian9 ...................................................................... jobs: osmo-trx: Set slave_axis to use only debian9 Debian 8 contains quite old qemu and proot packages which have some issues running the chroot infrastructure set up in osmo-trx's jenkins.sh. Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Pau Espin Pedrol: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 9cb12a5..4e553ea 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -178,7 +178,7 @@ - osmo-sip-connector - osmo-trx: - slave_axis: !!python/tuple [OsmocomBuild1] + slave_axis: !!python/tuple [linux_amd64_debian9] a1_name: INSTR a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] concurrent: true diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 84a97a9..b98513a 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -235,7 +235,7 @@ - osmo-tetra - osmo-trx: - slave_axis: !!python/tuple [OsmocomBuild1] + slave_axis: !!python/tuple [linux_amd64_debian9] a1_name: INSTR a1: !!python/tuple [--with-sse, --with-neon, --with-neon-vfpv4] concurrent: true -- To view, visit https://gerrit.osmocom.org/5798 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24665880fff5a5b918bb6ffaf1e7bb51ae860b0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 16 08:45:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 08:45:12 +0000 Subject: [MERGED] osmo-trx[master]: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests ... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set ...................................................................... contrib/jenkins.sh: Use qemu+proot+debootstrap to run tests with ARM instruction set The following logic doesn't require root access to run the tests, which means we can easily run it inside jenkins. Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 --- M contrib/jenkins.sh M tests/testsuite.at 2 files changed, 55 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index f31579e..11def5c 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -1,12 +1,62 @@ #!/bin/sh set -ex -osmo-clean-workspace.sh +substr() { [ -z "${2##*$1*}" ]; } + +#apt-get install qemu qemu-user-static qemu-system-arm debootstrap fakeroot proot +mychroot_nocwd() { + # LC_ALL + LANGUAGE set to avoid lots of print errors due to locale not being set inside container + # PATH is needed to be able to reach binaries like ldconfig without logging in to root, which adds the paths to PATH. + # PROOT_NO_SECCOMP is requried due to proot bug #106 + LC_ALL=C LANGUAGE=C PATH="$PATH:/usr/sbin:/sbin" PROOT_NO_SECCOMP=1 proot -r "$ROOTFS" -w / -b /proc --root-id -q qemu-arm-static "$@" +} + +mychroot() { + mychroot_nocwd -w / "$@" +} + +if [ -z "${INSIDE_CHROOT}" ]; then + + osmo-clean-workspace.sh + + # Only use ARM chroot if host is not ARM and the target is ARM: + if ! $(substr "arm" "$(uname -m)") && [ "x${INSTR}" = "x--with-neon" -o "x${INSTR}" = "x--with-neon-vfpv4" ]; then + + OSMOTRX_DIR="$PWD" # we assume we are called as contrib/jenkins.sh + ROOTFS_PREFIX="${ROOTFS_PREFIX:-/opt}" + ROOTFS="${ROOTFS_PREFIX}/qemu-img" + mkdir -p "${ROOTFS_PREFIX}" + + # Prepare chroot: + if [ ! -d "$ROOTFS" ]; then + mkdir -p "$ROOTFS" + if [ "x${USE_DEBOOTSTRAP}" = "x1" ]; then + fakeroot qemu-debootstrap --foreign --include="linux-image-armmp-lpae" --arch=armhf stretch "$ROOTFS" http://ftp.de.debian.org/debian/ + # Hack to avoid debootstrap trying to mount /proc, as it will fail with "no permissions" and anyway proot takes care of it: + sed -i "s/setup_proc//g" "$ROOTFS/debootstrap/suite-script" + mychroot /debootstrap/debootstrap --second-stage --verbose http://ftp.de.debian.org/debian/ + else + wget -nc -q "https://uk.images.linuxcontainers.org/images/debian/stretch/armhf/default/20180114_22:42/rootfs.tar.xz" + tar -xf rootfs.tar.xz -C "$ROOTFS/" || true + echo "nameserver 8.8.8.8" > "$ROOTFS/etc/resolv.conf" + fi + mychroot -b /dev apt-get update + mychroot apt-get -y install build-essential dh-autoreconf pkg-config libuhd-dev libusb-1.0-0-dev libusb-dev git + fi + # Run jenkins.sh inside the chroot: + INSIDE_CHROOT=1 mychroot_nocwd -w /osmo-trx -b "$OSMOTRX_DIR:/osmo-trx" -b "$(which osmo-clean-workspace.sh):/usr/bin/osmo-clean-workspace.sh" ./contrib/jenkins.sh + exit 0 + fi +fi + +### BUILD osmo-trx autoreconf --install --force -./configure +./configure $INSTR $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -osmo-clean-workspace.sh +if [ -z "x${INSIDE_CHROOT}" ]; then + osmo-clean-workspace.sh +fi diff --git a/tests/testsuite.at b/tests/testsuite.at index c6ca848..ca979e5 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,6 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) +# Disabled for ARM builds as it gives different output than x86, see OS#2826 +AT_SKIP_IF(! uname -m | grep x86) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5763 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba3f4de008662805d8ffc46e1f473e407b088fb8 Gerrit-PatchSet: 13 Gerrit-Project: osmo-trx 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 Tue Jan 16 10:35:17 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 10:35:17 +0000 Subject: [PATCH] osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... Message-ID: Review at https://gerrit.osmocom.org/5817 tests: convolve: Disable due to difference in output in different archs Let's disable this test in order to have passing jenkins jobs until we find a better way to properly test this for different architectures. Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb --- M tests/testsuite.at 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/17/5817/1 diff --git a/tests/testsuite.at b/tests/testsuite.at index ca979e5..f84225e 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,8 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) -# Disabled for ARM builds as it gives different output than x86, see OS#2826 -AT_SKIP_IF(! uname -m | grep x86) +# Different results for i686, x86_64 and ARM. see OS#2826, OS#2828, and https://lists.osmocom.org/pipermail/openbsc/2018-January/011655.html +AT_SKIP_IF(true) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:06:30 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 11:06:30 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies Message-ID: Review at https://gerrit.osmocom.org/5818 Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M tests/misc/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/1 diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:29:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:29:52 +0000 Subject: osmo-iuh[master]: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:30:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:30:07 +0000 Subject: osmo-iuh[master]: hnbgw_rua: fix dereference of unset pointer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:30:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:30:21 +0000 Subject: osmo-iuh[master]: hnbgw_cn: rx ranap: set rc in all cases In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5806 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59295388564e5d270da32db6e7488755231f8a11 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:30:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:30:31 +0000 Subject: osmo-iuh[master]: hnbgw_hnbap: fix missing return in rx [un]successful outcome In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:30:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:30:58 +0000 Subject: osmo-iuh[master]: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5808 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:31:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:31:00 +0000 Subject: [MERGED] osmo-iuh[master]: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome ...................................................................... cosmetic: hnbgw: hnbap: log rx of unsuccessful outcome HNBAP isn't really that important to osmo-hnbgw operation, all we do is service the few requests so that the other side is happy and uses our Iuh. Nevertheless, could at least log if an UnsuccessfulOutcome was received. Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1 --- M src/hnbgw_hnbap.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index fab520d..2746c21 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -529,6 +529,10 @@ static int hnbgw_rx_unsuccessful_outcome_msg(struct hnb_context *hnb, UnsuccessfulOutcome_t *msg) { /* We don't care much about HNBAP */ + LOGP(DHNBAP, LOGL_ERROR, "Received Unsuccessful Outcome, procedureCode %ld, criticality %ld," + " from '%s', cell mcc %u mnc %u lac %u rac %u sac %u cid %u\n", + msg->procedureCode, msg->criticality, hnb->identity_info, + hnb->id.mcc, hnb->id.mnc, hnb->id.lac, hnb->id.rac, hnb->id.sac, hnb->id.cid); return 0; } -- To view, visit https://gerrit.osmocom.org/5808 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3f309dc2d3436798e9e76bcc2ebd82403ea538a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:31:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:31:00 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw_hnbap: fix missing return in rx [un]successful outcome In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw_hnbap: fix missing return in rx [un]successful outcome ...................................................................... hnbgw_hnbap: fix missing return in rx [un]successful outcome Fixes: CID#57732 CID#57733 Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832 --- M src/hnbgw_hnbap.c 1 file changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 058a42a..fab520d 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -522,12 +522,14 @@ static int hnbgw_rx_successful_outcome_msg(struct hnb_context *hnb, SuccessfulOutcome_t *msg) { - + /* We don't care much about HNBAP */ + return 0; } static int hnbgw_rx_unsuccessful_outcome_msg(struct hnb_context *hnb, UnsuccessfulOutcome_t *msg) { - + /* We don't care much about HNBAP */ + return 0; } -- To view, visit https://gerrit.osmocom.org/5807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iddf76d23c2c7d5824e82708f7da013c88411e832 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:31:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:31:01 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw_cn: rx ranap: set rc in all cases In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw_cn: rx ranap: set rc in all cases ...................................................................... hnbgw_cn: rx ranap: set rc in all cases There don't seem to be any evaluations of the rc, nevertheless return well-defined values. Fixes: CID#181968 Change-Id: I59295388564e5d270da32db6e7488755231f8a11 --- M src/hnbgw_cn.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index c48f4b7..ede00c8 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -19,6 +19,7 @@ */ #include +#include #include #include @@ -209,10 +210,12 @@ LOGP(DRANAP, LOGL_NOTICE, "Received unsupported RANAP " "unsuccessful outcome procedure %ld from CN, ignoring\n", pdu->choice.unsuccessfulOutcome.procedureCode); + rc = -ENOTSUP; break; default: LOGP(DRANAP, LOGL_NOTICE, "Received suspicious RANAP " "presence %u from CN, ignoring\n", pdu->present); + rc = -EINVAL; break; } -- To view, visit https://gerrit.osmocom.org/5806 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59295388564e5d270da32db6e7488755231f8a11 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:31:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:31:01 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw_rua: fix dereference of unset pointer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw_rua: fix dereference of unset pointer ...................................................................... hnbgw_rua: fix dereference of unset pointer In the UNITDATA case, there is no map, so a) initialize map as NULL and b) print the RUA ctx id directly from local var context_id instead. Fixes: CID#181969 Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe --- M src/hnbgw_rua.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index e918c47..40d1d94 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -181,7 +181,7 @@ { struct msgb *msg; struct osmo_scu_prim *prim; - struct hnbgw_context_map *map; + struct hnbgw_context_map *map = NULL; struct hnbgw_cnlink *cn = hnb->gw->sccp.cnlink; struct osmo_sccp_addr *remote_addr; bool is_ps; @@ -218,7 +218,7 @@ DEBUGP(DRUA, "rua_to_scu() %s to %s, rua_ctx_id %u (unitdata, no scu_conn_id)\n", cn_domain_indicator_to_str(cN_DomainIndicator), osmo_sccp_addr_dump(remote_addr), - map->rua_ctx_id); + context_id); break; default: map = context_map_alloc_by_hnb(hnb, context_id, is_ps, cn); -- To view, visit https://gerrit.osmocom.org/5805 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73f508b719b61a389e10cbad1bafad1650634abe Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:31:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:31:01 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw_rua.c: log: fix integer format for cN_DomainIndicator ...................................................................... hnbgw_rua.c: log: fix integer format for cN_DomainIndicator Fixes: CID#135219 Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0 --- M src/hnbgw_rua.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index b2b8792..e918c47 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -198,7 +198,7 @@ is_ps = true; break; default: - LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %u\n", + LOGP(DRUA, LOGL_ERROR, "Unsupported Domain %ld\n", cN_DomainIndicator); return -1; } -- To view, visit https://gerrit.osmocom.org/5804 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I32c11100c87a59f34d7c1fefd2f0037e5d63f0e0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:32:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:32:13 +0000 Subject: libosmocore[master]: logging: color the log category according to level In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I84f886ac880e9056a666bbb231ae06cbaaf65f44 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:33:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:33:56 +0000 Subject: libosmocore[master]: logging: separate the '<000b>' subsys from filename logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I think the feature is useful. By the way, the "Weird" format with <> comes from syslog, AFAIR. However, what I don't like is hiding it in a seemingly unrelated API that is about logging the file name. -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:34:23 +0000 Subject: libosmocore[master]: logging: vty: add 'logging print file (0|1|with-cat)' cmd In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5813/1//COMMIT_MSG Commit Message: Line 7: logging: vty: add 'logging print file (0|1|with-cat)' cmd why does the category related to the file name? -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:35:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:35:49 +0000 Subject: libosmocore[master]: logging: allow adding separators to the extended-timestamp In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5815/1//COMMIT_MSG Commit Message: Line 17: log_set_print_extended_timestamp(). Passing 1 still produces the unseparated please introduce some meaningful enum in addition to the magic numbers -- To view, visit https://gerrit.osmocom.org/5815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 11:36:07 +0000 Subject: libosmocore[master]: cosmetic: logging: if color is disabled, don't print "" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7cb06de160830d2f8ee5718246c0fe311f68d49 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:47:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 11:47:32 +0000 Subject: [PATCH] osmo-trx[master]: Remove unneeded libdl dependency Message-ID: Review at https://gerrit.osmocom.org/5819 Remove unneeded libdl dependency Closes: OS#1929 Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd --- M CommonLibs/Makefile.am M Makefile.am M Transceiver52M/Makefile.am 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/19/5819/1 diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index 46cc143..fa0b285 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) -AM_CXXFLAGS = -Wall -O3 -g -ldl -lpthread +AM_CXXFLAGS = -Wall -O3 -g -lpthread EXTRA_DIST = \ example.config \ diff --git a/Makefile.am b/Makefile.am index 1e659a0..71f7b91 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,9 +22,9 @@ ACLOCAL_AMFLAGS = -I config AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) -AM_CXXFLAGS = -Wall -pthread -ldl -#AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread -ldl -#AM_CFLAGS = -Wall -O2 -NDEBUG -pthread -ldl +AM_CXXFLAGS = -Wall -pthread +#AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread +#AM_CFLAGS = -Wall -O2 -NDEBUG -pthread # Order must be preserved SUBDIRS = \ diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 8df2d34..f56ce06 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/common -AM_CXXFLAGS = -ldl -lpthread +AM_CXXFLAGS = -lpthread SUBDIRS = arm x86 -- To view, visit https://gerrit.osmocom.org/5819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:58:27 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 16 Jan 2018 11:58:27 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I don't think to disable it is a good idea. Why not improve it? I think Thomas Tsou and/or Vadim had suggestions how to do that. -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 11:59:05 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 16 Jan 2018 11:59:05 +0000 Subject: osmo-trx[master]: Remove unneeded libdl dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:07:50 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 12:07:50 +0000 Subject: [PATCH] osmo-bts[master]: Allow specifying sysmocom headers explicitly Message-ID: Review at https://gerrit.osmocom.org/5820 Allow specifying sysmocom headers explicitly The headers for other models are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. This fixes the issue after moving to stow for jenkins tests. Change-Id: Ibe4e9965ce887b82c3aa32e0bb0fc5cc6a527112 --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am 3 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/5820/1 diff --git a/configure.ac b/configure.ac index 89443d0..6c571d6 100644 --- a/configure.ac +++ b/configure.ac @@ -59,10 +59,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..f4f5da2 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" build_bts "osmo-bts-sysmo" "$configure_flags" diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe4e9965ce887b82c3aa32e0bb0fc5cc6a527112 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:15:41 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 12:15:41 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#2). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 5 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/2 diff --git a/configure.ac b/configure.ac index 89443d0..6c571d6 100644 --- a/configure.ac +++ b/configure.ac @@ -59,10 +59,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..f4f5da2 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" build_bts "osmo-bts-sysmo" "$configure_flags" diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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 Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:16:34 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 12:16:34 +0000 Subject: [ABANDON] osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Allow specifying sysmocom headers explicitly ...................................................................... Abandoned Merged into previous commit. -- To view, visit https://gerrit.osmocom.org/5820 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ibe4e9965ce887b82c3aa32e0bb0fc5cc6a527112 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:21:54 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 12:21:54 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: > I don't think to disable it is a good idea. Why not improve it? I > think Thomas Tsou and/or Vadim had suggestions how to do that. I'm open to improvements, but I saw no suggestions so far, so until they come in, it may be a good idea to disable this test to have new osmo-trx being built in OBS. Anyway there was no test being run at all until a few days ago and at least now we build-test and we run several run-tests. -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:25:55 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 16 Jan 2018 12:25:55 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: I think you should send an e-mail to the mailing list, as not everyone is reading Gerrit. I've stumbled upon this patch completely accidentally and I haven't seen any discussions. -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:27:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 12:27:32 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: > I think you should send an e-mail to the mailing list, as not > everyone is reading Gerrit. I've stumbled upon this patch > completely accidentally and I haven't seen any discussions. I did send en e-mail to the ml, link to it is even inside the commit in testsuite.at: https://lists.osmocom.org/pipermail/openbsc/2018-January/011655.html -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:35:48 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 16 Jan 2018 12:35:48 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: I see. It was just yesterday so I assume neither Thomas nor Vadim have read it. Could you try pinging Thomas specifically about this? -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:35:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 12:35:53 +0000 Subject: [PATCH] osmo-hlr[master]: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS Message-ID: Review at https://gerrit.osmocom.org/5821 fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6 --- M tests/db/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/21/5821/1 diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index 55b1655..d5fce65 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -6,6 +6,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) @@ -27,6 +28,7 @@ $(top_srcdir)/src/logging.c \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ $(SQLITE3_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:41:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 12:41:07 +0000 Subject: libosmocore[master]: logging: separate the '<000b>' subsys from filename logging In-Reply-To: References: Message-ID: Patch Set 1: I would gladly separate the hex category out to its own logging config api, the only reason why I'm continuing to tie it with the filename is backwards compat. If you agree that we completely untie it from the filename (and that changing the logging API behavior is acceptable) I'll change the patches. -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 Gerrit-PatchSet: 1 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 Tue Jan 16 12:42:24 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 12:42:24 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#3). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. To propagate dependencies properly, sysmobts-calib was converted to automake. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M configure.ac M contrib/jenkins_sysmobts.sh A contrib/sysmobts-calib/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 6 files changed, 24 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/3 diff --git a/configure.ac b/configure.ac index 89443d0..616d3b7 100644 --- a/configure.ac +++ b/configure.ac @@ -59,10 +59,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) @@ -179,6 +188,7 @@ src/osmo-bts-octphy/Makefile include/Makefile include/osmo-bts/Makefile + contrib/sysmobts-calib/Makefile tests/Makefile tests/paging/Makefile tests/agch/Makefile diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..f4f5da2 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" build_bts "osmo-bts-sysmo" "$configure_flags" diff --git a/contrib/sysmobts-calib/Makefile.am b/contrib/sysmobts-calib/Makefile.am new file mode 100644 index 0000000..26275ab --- /dev/null +++ b/contrib/sysmobts-calib/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +noinst_PROGRAMS = sysmobts-calib +noinst_HEADERS = sysmobts-layer1.h + +sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c +sysmobts_calib_test_LDADD = -lrt diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:42:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 12:42:54 +0000 Subject: osmo-hlr[master]: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:42:57 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 12:42:57 +0000 Subject: [MERGED] osmo-hlr[master]: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS ...................................................................... fix build: db_test: missing LIBOSMOABIS_CFLAGS and _LIBS Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6 --- M tests/db/Makefile.am 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/db/Makefile.am b/tests/db/Makefile.am index 55b1655..d5fce65 100644 --- a/tests/db/Makefile.am +++ b/tests/db/Makefile.am @@ -6,6 +6,7 @@ -ggdb3 \ $(LIBOSMOCORE_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ $(SQLITE3_CFLAGS) \ $(NULL) @@ -27,6 +28,7 @@ $(top_srcdir)/src/logging.c \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ $(SQLITE3_LIBS) \ $(NULL) -- To view, visit https://gerrit.osmocom.org/5821 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2539f5dc7a512a57ad36c460a11195ccbd84d7d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:50:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 12:50:55 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#4). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. To propagate dependencies properly, sysmobts-calib was converted to automake. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh A contrib/sysmobts-calib/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 7 files changed, 25 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/4 diff --git a/Makefile.am b/Makefile.am index 4832c84..347a89b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -SUBDIRS = include src tests +SUBDIRS = include src tests contrib/sysmobts-calib # package the contrib and doc diff --git a/configure.ac b/configure.ac index 89443d0..616d3b7 100644 --- a/configure.ac +++ b/configure.ac @@ -59,10 +59,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) @@ -179,6 +188,7 @@ src/osmo-bts-octphy/Makefile include/Makefile include/osmo-bts/Makefile + contrib/sysmobts-calib/Makefile tests/Makefile tests/paging/Makefile tests/agch/Makefile diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..f4f5da2 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" build_bts "osmo-bts-sysmo" "$configure_flags" diff --git a/contrib/sysmobts-calib/Makefile.am b/contrib/sysmobts-calib/Makefile.am new file mode 100644 index 0000000..26275ab --- /dev/null +++ b/contrib/sysmobts-calib/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +noinst_PROGRAMS = sysmobts-calib +noinst_HEADERS = sysmobts-layer1.h + +sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c +sysmobts_calib_test_LDADD = -lrt diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:52:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 12:52:53 +0000 Subject: [PATCH] osmo-bts[master]: jenkins_common.sh: fix build_bts distcheck for more than one... Message-ID: Review at https://gerrit.osmocom.org/5822 jenkins_common.sh: fix build_bts distcheck for more than one conf_flag Passing configure flags in DISTCHECK_CONFIGURE_FLAGS requires enclosing all flags in quotes. Currently we seem to have no callers with more than one configure flag, so we were lucky not to break there. Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb --- M contrib/jenkins_common.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/22/5822/1 diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index cc1b5b3..bdb12d5 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -43,5 +43,5 @@ ./configure $conf_flags $MAKE $PARALLEL_MAKE $MAKE check || cat-testlogs.sh - DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE distcheck || cat-testlogs.sh } -- To view, visit https://gerrit.osmocom.org/5822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 12:59:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 12:59:17 +0000 Subject: [PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly 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/5796 to look at the new patch set (#6). Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/6 diff --git a/configure.ac b/configure.ac index 56e2057..84502d6 100644 --- a/configure.ac +++ b/configure.ac @@ -65,8 +65,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) -AC_MSG_RESULT([$enable_sysmocom_dsp]) -AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) +AC_MSG_RESULT([$enable_sysmocom_bts]) +AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") +if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..af25c69 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmobts=$inst/include/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..7d2a62e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,7 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 6 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 Tue Jan 16 13:07:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:07:56 +0000 Subject: [PATCH] osmo-msc[master]: fix build: missing LIBOSMORANAP flags in libmsc Message-ID: Review at https://gerrit.osmocom.org/5823 fix build: missing LIBOSMORANAP flags in libmsc Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed --- M src/libmsc/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/23/5823/1 diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7dfb047..3ff97a3 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -15,6 +15,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(NULL) noinst_HEADERS = \ -- To view, visit https://gerrit.osmocom.org/5823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:09:30 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:09:30 +0000 Subject: [PATCH] osmo-sgsn[master]: fix build: missing LIBGTP_CFLAGS in sgsn_test Message-ID: Review at https://gerrit.osmocom.org/5824 fix build: missing LIBGTP_CFLAGS in sgsn_test Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6 --- M tests/sgsn/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/24/5824/1 diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 802811d..8692fc3 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBCARES_CFLAGS) \ + $(LIBGTP_CFLAGS) \ $(NULL) if BUILD_IU AM_CFLAGS += \ -- To view, visit https://gerrit.osmocom.org/5824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:10:27 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 13:10:27 +0000 Subject: [PATCH] osmo-pcu[master]: Allow specifying sysmocom headers explicitly 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/5796 to look at the new patch set (#7). Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 15 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/96/5796/7 diff --git a/configure.ac b/configure.ac index 56e2057..3706b6c 100644 --- a/configure.ac +++ b/configure.ac @@ -65,8 +65,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..af25c69 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmobts=$inst/include/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..7d2a62e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,7 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 7 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 Tue Jan 16 13:17:43 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 13:17:43 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#5). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. To propagate dependencies properly, sysmobts-calib was converted to automake. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh D contrib/sysmobts-calib/Makefile A contrib/sysmobts-calib/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 8 files changed, 25 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/5 diff --git a/Makefile.am b/Makefile.am index 4832c84..322de36 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,16 +1,12 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -SUBDIRS = include src tests +SUBDIRS = include src tests contrib/sysmobts-calib # package the contrib and doc EXTRA_DIST = \ 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 \ - contrib/sysmobts-calib/sysmobts-layer1.c \ - contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ diff --git a/configure.ac b/configure.ac index 89443d0..616d3b7 100644 --- a/configure.ac +++ b/configure.ac @@ -59,10 +59,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) @@ -179,6 +188,7 @@ src/osmo-bts-octphy/Makefile include/Makefile include/osmo-bts/Makefile + contrib/sysmobts-calib/Makefile tests/Makefile tests/paging/Makefile tests/agch/Makefile diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..f4f5da2 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" build_bts "osmo-bts-sysmo" "$configure_flags" diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile deleted file mode 100644 index a5d4b99..0000000 --- a/contrib/sysmobts-calib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror -LIBS=`pkg-config --libs libosmocore libosmogsm` - -all: sysmobts-calib - -sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o - $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS) - -clean: - @rm -f sysmobts-calib *.o diff --git a/contrib/sysmobts-calib/Makefile.am b/contrib/sysmobts-calib/Makefile.am new file mode 100644 index 0000000..26275ab --- /dev/null +++ b/contrib/sysmobts-calib/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +noinst_PROGRAMS = sysmobts-calib +noinst_HEADERS = sysmobts-layer1.h + +sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c +sysmobts_calib_test_LDADD = -lrt diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:19:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:19:51 +0000 Subject: osmo-msc[master]: fix build: missing LIBOSMORANAP flags in libmsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:19:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:19:53 +0000 Subject: [MERGED] osmo-msc[master]: fix build: missing LIBOSMORANAP flags in libmsc In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix build: missing LIBOSMORANAP flags in libmsc ...................................................................... fix build: missing LIBOSMORANAP flags in libmsc Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed --- M src/libmsc/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 7dfb047..3ff97a3 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -15,6 +15,7 @@ $(LIBOSMOSIGTRAN_CFLAGS) \ $(LIBOSMOSCCP_CFLAGS) \ $(LIBOSMOMGCPCLIENT_CFLAGS) \ + $(LIBOSMORANAP_CFLAGS) \ $(NULL) noinst_HEADERS = \ -- To view, visit https://gerrit.osmocom.org/5823 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f498a2d008571d3eb8753bede0847fa7ab704ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:19:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:19:59 +0000 Subject: osmo-sgsn[master]: fix build: missing LIBGTP_CFLAGS in sgsn_test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn 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 Jan 16 13:20:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:20:03 +0000 Subject: [MERGED] osmo-sgsn[master]: fix build: missing LIBGTP_CFLAGS in sgsn_test In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix build: missing LIBGTP_CFLAGS in sgsn_test ...................................................................... fix build: missing LIBGTP_CFLAGS in sgsn_test Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6 --- M tests/sgsn/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/sgsn/Makefile.am b/tests/sgsn/Makefile.am index 802811d..8692fc3 100644 --- a/tests/sgsn/Makefile.am +++ b/tests/sgsn/Makefile.am @@ -10,6 +10,7 @@ $(LIBOSMOABIS_CFLAGS) \ $(LIBOSMOGSM_CFLAGS) \ $(LIBCARES_CFLAGS) \ + $(LIBGTP_CFLAGS) \ $(NULL) if BUILD_IU AM_CFLAGS += \ -- To view, visit https://gerrit.osmocom.org/5824 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I250cadecaf90238df1afa6997e5d165fb9eee8b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:23:42 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 16 Jan 2018 13:23:42 +0000 Subject: [MERGED] osmo-bsc[master]: Move BTS selection for paging from osmo_bsc_grace.c into osm... In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c. ...................................................................... Move BTS selection for paging from osmo_bsc_grace.c into osmo_bsc_bssap.c. We can now either page an invidual BTS directly or page several BTS in a given location area. This decision is taken based on the contents of the cell identifier list in the paging request. Select a set of BTS for paging while processing the cell identifier list, rather than requiring the paging layer to loop over all BTS in the MSC. This change requires some adjustment in bssap_test. In particular, this test must now add a BTS to its network in order to pass. The purpose of this change is to make the layering a bit cleaner. There is one functional change: We no longer abort paging if paging fails for a particular BTS. Instead, we keep trying to page on other BTS. Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Suggested-by: Harald Welte Depends: Ic7772e75c3d7fb0df6e17e118bb33b3248352d4d Related: OS#2753 --- M include/osmocom/bsc/paging.h M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_grace.c M tests/bssap/bssap_test.c M tests/bssap/bssap_test.err 5 files changed, 54 insertions(+), 75 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/paging.h b/include/osmocom/bsc/paging.h index 2b1bc50..2be71c3 100644 --- a/include/osmocom/bsc/paging.h +++ b/include/osmocom/bsc/paging.h @@ -56,8 +56,6 @@ }; /* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, int type, - struct bsc_msc_data *msc); int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, int type, struct bsc_msc_data *msc); diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index a02ea9e..e3a30f5 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -228,14 +228,16 @@ return 0; } -/* Page a subscriber based on TMSI and LAC in the specified MSC. - * If BTS is not NULL, page the subscriber via this particular BTS. - * A non-zero return value indicates a fatal out of memory condition. */ +/* Page a subscriber based on TMSI and LAC via the specified BTS. + * The msc parameter is the MSC which issued the corresponding paging request. + * Returns 1 if the paging request could be issued, 0 if not. + * A negative return value indicates an error. */ static int page_subscriber(struct bsc_msc_data *msc, struct gsm_bts *bts, uint32_t tmsi, uint32_t lac, const char *mi_string, uint8_t chan_needed) { struct bsc_subscr *subscr; + int ret; subscr = bsc_subscr_find_or_create_by_imsi(msc->network->bsc_subscribers, mi_string); @@ -247,19 +249,15 @@ subscr->lac = lac; subscr->tmsi = tmsi; - if (bts) - LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", - bts->nr, mi_string, tmsi, tmsi, lac); - else - LOGP(DMSC, LOGL_INFO, "Paging request from MSC IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", mi_string, tmsi, tmsi, lac); + LOGP(DMSC, LOGL_INFO, "Paging request from MSC BTS: %d IMSI: '%s' TMSI: '0x%x/%u' LAC: 0x%x\n", + bts->nr, mi_string, tmsi, tmsi, lac); - bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, - subscr, chan_needed, msc, bts); + ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, subscr, chan_needed, msc, bts); /* the paging code has grabbed its own references */ bsc_subscr_put(subscr); - return 0; + return ret; } /* GSM 08.08 ? 3.2.1.19 */ @@ -277,6 +275,7 @@ const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; + struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -353,7 +352,6 @@ uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { uint16_t ci = osmo_load16be(ci_be); - struct gsm_bts *bts; llist_for_each_entry(bts, &msc->network->bts_list, list) { if (bts->cell_identity == ci) @@ -361,11 +359,12 @@ } if (bts) { - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) != 0) - break; - } else + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } else { LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", mi_string, ci); + } remain -= sizeof(*ci_be); ci_be++; } @@ -387,13 +386,17 @@ break; } if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; - } else + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } + } else { LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); - + } remain -= sizeof(lai); i++; } @@ -404,8 +407,12 @@ lacp_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*lacp_be)) { lac = osmo_load16be(lacp_be); - if (page_subscriber(msc, NULL, tmsi, lac, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + } remain -= sizeof(*lacp_be); lacp_be++; } @@ -417,16 +424,20 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - if (page_subscriber(msc, NULL, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed) != 0) - break; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } break; } diff --git a/src/osmo-bsc/osmo_bsc_grace.c b/src/osmo-bsc/osmo_bsc_grace.c index 93ca9b9..705933c 100644 --- a/src/osmo-bsc/osmo_bsc_grace.c +++ b/src/osmo-bsc/osmo_bsc_grace.c @@ -34,22 +34,6 @@ } -static int normal_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - /* we can't page by lac.. we need to page everything */ - if (msc->core_lac != -1) { - struct gsm_bts *bts; - - llist_for_each_entry(bts, &msc->network->bts_list, list) - paging_request_bts(bts, subscr, chan_needed, msc); - - return 0; - } - - return paging_request(msc->network, subscr, chan_needed, msc); -} - /* Return value is like paging_request_bts(): * returns 1 on success (one BTS was paged); 0 in case of error (e.g. TRX down) */ static int locked_paging_bts(struct gsm_bts *bts, @@ -68,31 +52,14 @@ return paging_request_bts(bts, subscr, chan_needed, msc); } -static int locked_paging(struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) -{ - struct gsm_bts *bts = NULL; - int num_pages = 0; - - /* - * Check if there is any BTS that is on for the given lac. Start - * with NULL and iterate through all bts. - * All other bts are either off or in the grace period. - */ - llist_for_each_entry(bts, &msc->network->bts_list, list) - num_pages += locked_paging_bts(bts, subscr, chan_needed, msc); - - return num_pages; -} - /** * Page a subscriber in an MSC. * \param[in] rf_policy if not S_RF_ON, page only BTSs which are not excluded from the RF lock * \param[in] subscr subscriber we want to page * \param[in] chan_needed value of the GSM0808_IE_CHANNEL_NEEDED IE * \param[in] msc MSC which has issued this paging - * \param[in] bts if not NULL, page via this particular BTS - * \returns number of BTS on which we issued the paging + * \param[in] bts The BTS to issue the paging on + * \returns 1 if paging was issued to the BTS, 0 if not */ int bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, @@ -100,15 +67,9 @@ struct bsc_msc_data *msc, struct gsm_bts *bts) { - if (bts) { - if (rf_policy == S_RF_ON) - return paging_request_bts(bts, subscr, chan_needed, msc); - return locked_paging_bts(bts, subscr, chan_needed, msc); - } - if (rf_policy == S_RF_ON) - return normal_paging(subscr, chan_needed, msc); - return locked_paging(subscr, chan_needed, msc); + return paging_request_bts(bts, subscr, chan_needed, msc); + return locked_paging_bts(bts, subscr, chan_needed, msc); } static int handle_sub(struct gsm_lchan *lchan, const char *text) diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c index c97393d..1d8fe77 100644 --- a/tests/bssap/bssap_test.c +++ b/tests/bssap/bssap_test.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -41,9 +42,9 @@ /* override, requires '-Wl,--wrap=bsc_grace_paging_request' */ int __real_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc); + struct bsc_msc_data *msc, struct gsm_bts *bts); int __wrap_bsc_grace_paging_request(enum signal_rf rf_policy, struct bsc_subscr *subscr, int chan_needed, - struct bsc_msc_data *msc) + struct bsc_msc_data *msc, struct gsm_bts *bts) { if (subscr->lac == GSM_LAC_RESERVED_ALL_BTS) fprintf(stderr, "BSC paging started on entire BSS (%u)\n", subscr->lac); @@ -86,6 +87,7 @@ int rc; struct gsm_network *net; struct bsc_msc_data *msc; + struct gsm_bts *bts; net = bsc_network_init(NULL, 1, 1); net->bsc_data->rf_ctrl = talloc_zero(NULL, struct osmo_bsc_rf); @@ -93,6 +95,12 @@ msc = talloc_zero(net, struct bsc_msc_data); msc->network = net; + + bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_UNKNOWN, 0); + if (bts == NULL) { + fprintf(stderr, "gsm_bts_alloc_register() returned NULL\n"); + return; + } log_set_log_level(osmo_stderr_target, LOGL_DEBUG); @@ -102,6 +110,7 @@ msg = msgb_from_hex("test_cell_identifier", 1024, cell_identifier_tests[i].msg); gl_expect_lac = cell_identifier_tests[i].expect_lac; + bts->location_area_code = (gl_expect_lac == GSM_LAC_RESERVED_ALL_BTS ? 0 : gl_expect_lac); rc = bsc_handle_udt(msc, msg, msgb_l2len(msg)); fprintf(stderr, "bsc_handle_udt() returned %d\n", rc); diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index f24ff7c..abe1def 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -2,14 +2,14 @@ 0: DMSC Rx MSC UDT: 00 16 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 03 05 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 1: DMSC Rx MSC UDT: 00 14 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 01 06 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0xfffe BSC paging started on entire BSS (65534) bsc_handle_udt() returned 0 @@ -22,6 +22,6 @@ 3: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 00 f1 10 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Paging request from MSC IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 +DMSC Paging request from MSC BTS: 0 IMSI: '515029600703449' TMSI: '0x1084460/17319008' LAC: 0x65 BSC paging started with LAC 101 bsc_handle_udt() returned 0 -- To view, visit https://gerrit.osmocom.org/5752 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:25:20 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 16 Jan 2018 13:25:20 +0000 Subject: [MERGED] osmo-bsc[master]: Implement support for paging based on a Cell Global Identifier. In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Implement support for paging based on a Cell Global Identifier. ...................................................................... Implement support for paging based on a Cell Global Identifier. This is essentially a case which combines paging by LAI and CI. Depends: Ic1c72c7f83e53988eb9fedf314b1dc459836833d Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Related: OS#2751 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 50 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index e3a30f5..04541c2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -260,6 +260,19 @@ return ret; } +/* Decode 5-byte LAI list element data (see TS 08.08 3.2.2.27) into MCC/MNC/LAC. + * Return 0 if successful, negative on error. */ +static int +decode_lai(const uint8_t *data, uint16_t *mcc, uint16_t *mnc, uint16_t *lac) +{ + struct gsm48_loc_area_id lai; + + /* Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ + memcpy(&lai, data, sizeof(lai)); /* don't byte swap yet */ + + return gsm48_decode_lai(&lai, mcc, mnc, lac) != 0 ? -1 : 0; +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) @@ -348,6 +361,40 @@ LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ + case CELL_IDENT_WHOLE_GLOBAL: { + uint16_t ci; + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { + uint16_t *ci_be; + size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); + if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + lac = GSM_LAC_RESERVED_ALL_BTS; + break; + } + ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); + ci = osmo_load16be(ci_be); + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } + } else { + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + } + remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); + i++; + } + } + case CELL_IDENT_CI: { uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { @@ -372,13 +419,9 @@ } case CELL_IDENT_LAI_AND_LAC: { - struct gsm48_loc_area_id lai; int i = 0; - while (remain >= sizeof(lai)) { - /* Parse and decode 5-byte LAI list element (see TS 08.08 3.2.2.27). - * Copy data to stack to prevent unaligned access in gsm48_decode_lai(). */ - memcpy(&lai, &data[1 + i * sizeof(lai)], sizeof(lai)); /* don't byte swap yet */ - if (gsm48_decode_lai(&lai, &mcc, &mnc, &lac) != 0) { + while (remain >= sizeof(struct gsm48_loc_area_id)) { + if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " "for BSS (0x%x), paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); @@ -397,7 +440,7 @@ "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); } - remain -= sizeof(lai); + remain -= sizeof(struct gsm48_loc_area_id); i++; } break; -- To view, visit https://gerrit.osmocom.org/5756 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:28:50 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 16 Jan 2018 13:28:50 +0000 Subject: [MERGED] osmo-bsc[master]: Implement support for paging based on LAC and CI. In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Implement support for paging based on LAC and CI. ...................................................................... Implement support for paging based on LAC and CI. This is a simple combination of the LAC and CI cases which have already been implemented. The BSC_Tests.TC_paging_imsi_nochan_lac_ci ttcn3 test passes. The switch statement in bssmap_handle_paging() is getting a bit large, and scoping of local variables could be improved. I will focus on cleaning this up later once paging functionality is complete. Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127 Depends: Id83f8b3b1ce80a39417176d99fd09f3b394fd19c Related: OS#2752 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 24 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 04541c2..1894561 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -395,6 +395,30 @@ } } + case CELL_IDENT_LAC_AND_CI: { + uint16_t ci, *ci_be; + lacp_be = (uint16_t *)(&data[1]); + ci_be = (uint16_t *)(&data[3]); + while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) { + lac = osmo_load16be(lacp_be); + ci = osmo_load16be(ci_be); + + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) + break; + } + + remain -= sizeof(*lacp_be) + sizeof(*ci_be); + lacp_be++; + ci_be++; + } + break; + } + case CELL_IDENT_CI: { uint16_t *ci_be = (uint16_t *)(&data[1]); while (remain >= sizeof(*ci_be)) { -- To view, visit https://gerrit.osmocom.org/5757 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7f596663a97a1db1a00f115a366f4a5a271c127 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:40:31 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 16 Jan 2018 13:40:31 +0000 Subject: [MERGED] osmo-bsc[master]: Show the BTS number for outgoing paging commands in debug log. In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Show the BTS number for outgoing paging commands in debug log. ...................................................................... Show the BTS number for outgoing paging commands in debug log. Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e --- M src/libbsc/paging.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c index 314dfdd..be272f5 100644 --- a/src/libbsc/paging.c +++ b/src/libbsc/paging.c @@ -86,8 +86,8 @@ log_set_context(LOG_CTX_BSC_SUBSCR, request->bsub); - LOGP(DPAG, LOGL_INFO, "Going to send paging commands: imsi: %s tmsi: " - "0x%08x for ch. type %d (attempt %d)\n", request->bsub->imsi, + LOGP(DPAG, LOGL_INFO, "(bts=%d) Going to send paging commands: imsi: %s tmsi: " + "0x%08x for ch. type %d (attempt %d)\n", bts->nr, request->bsub->imsi, request->bsub->tmsi, request->chan_type, request->attempts); if (request->bsub->tmsi == GSM_RESERVED_TMSI) -- To view, visit https://gerrit.osmocom.org/5685 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7b6e03087fc2dfecb6235c5ed1494d3c9b4bbf0e Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:40:39 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 16 Jan 2018 13:40:39 +0000 Subject: [MERGED] osmo-msc[master]: Improve an error message in db_init(). In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Improve an error message in db_init(). ...................................................................... Improve an error message in db_init(). If we cannot open a connection to the sqlite3 database, show the name of the database we failed to access, and also hint at the fact that a likely reason for the problem is a missing sqlite3 driver for libdbi. Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c --- M src/libmsc/db.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28004f7..7007c7a 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -614,7 +614,8 @@ conn = dbi_conn_new_r("sqlite3", inst); if (conn == NULL) { - LOGP(DDB, LOGL_FATAL, "Failed to create connection.\n"); + LOGP(DDB, LOGL_FATAL, "Failed to create database connection to sqlite3 db '%s'; " + "Is the sqlite3 database driver for libdbi installed on this system?\n", name); return 1; } -- To view, visit https://gerrit.osmocom.org/5795 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1c0026e882984b4358ce116ec4a7ad40340517c Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:44:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 13:44:47 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#6). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. To propagate dependencies properly, sysmobts-calib was converted to automake. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh D contrib/sysmobts-calib/Makefile A contrib/sysmobts-calib/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 8 files changed, 38 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/6 diff --git a/Makefile.am b/Makefile.am index 4832c84..89a0eec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,15 +2,14 @@ SUBDIRS = include src tests +if ENABLE_SYSMOBTS_CALIB +SUBDIRS += contrib/sysmobts-calib +endif # package the contrib and doc EXTRA_DIST = \ 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 \ - contrib/sysmobts-calib/sysmobts-layer1.c \ - contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ diff --git a/configure.ac b/configure.ac index 89443d0..8604691 100644 --- a/configure.ac +++ b/configure.ac @@ -54,15 +54,32 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) +AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) +AC_ARG_ENABLE(sysmobts-calib, + AC_HELP_STRING([--enable-sysmobts-calib], + [enable code for sysmobts calibration tool [default=no]]), + [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"]) +AC_MSG_RESULT([$enable_sysmobts_calib]) +AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes") + AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) AC_ARG_ENABLE(sysmocom-bts, AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) @@ -179,6 +196,7 @@ src/osmo-bts-octphy/Makefile include/Makefile include/osmo-bts/Makefile + contrib/sysmobts-calib/Makefile tests/Makefile tests/paging/Makefile tests/agch/Makefile diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..f9d5bf6 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,13 +16,13 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" - -build_bts "osmo-bts-sysmo" "$configure_flags" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then - $MAKE -C contrib/sysmobts-calib + $configure_flags="$configure_flags --enable-sysmobts-calib" fi +build_bts "osmo-bts-sysmo" "$configure_flags" + osmo-clean-workspace.sh diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile deleted file mode 100644 index a5d4b99..0000000 --- a/contrib/sysmobts-calib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror -LIBS=`pkg-config --libs libosmocore libosmogsm` - -all: sysmobts-calib - -sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o - $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS) - -clean: - @rm -f sysmobts-calib *.o diff --git a/contrib/sysmobts-calib/Makefile.am b/contrib/sysmobts-calib/Makefile.am new file mode 100644 index 0000000..26275ab --- /dev/null +++ b/contrib/sysmobts-calib/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +noinst_PROGRAMS = sysmobts-calib +noinst_HEADERS = sysmobts-layer1.h + +sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c +sysmobts_calib_test_LDADD = -lrt diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:52:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 13:52:25 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#7). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. To propagate dependencies properly, sysmobts-calib was converted to automake. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh D contrib/sysmobts-calib/Makefile A contrib/sysmobts-calib/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 8 files changed, 38 insertions(+), 22 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/7 diff --git a/Makefile.am b/Makefile.am index 4832c84..89a0eec 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,15 +2,14 @@ SUBDIRS = include src tests +if ENABLE_SYSMOBTS_CALIB +SUBDIRS += contrib/sysmobts-calib +endif # package the contrib and doc EXTRA_DIST = \ 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 \ - contrib/sysmobts-calib/sysmobts-layer1.c \ - contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ diff --git a/configure.ac b/configure.ac index 89443d0..8604691 100644 --- a/configure.ac +++ b/configure.ac @@ -54,15 +54,32 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) +AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) +AC_ARG_ENABLE(sysmobts-calib, + AC_HELP_STRING([--enable-sysmobts-calib], + [enable code for sysmobts calibration tool [default=no]]), + [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"]) +AC_MSG_RESULT([$enable_sysmobts_calib]) +AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes") + AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) AC_ARG_ENABLE(sysmocom-bts, AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) @@ -179,6 +196,7 @@ src/osmo-bts-octphy/Makefile include/Makefile include/osmo-bts/Makefile + contrib/sysmobts-calib/Makefile tests/Makefile tests/paging/Makefile tests/agch/Makefile diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..88aef3d 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,13 +16,13 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" - -build_bts "osmo-bts-sysmo" "$configure_flags" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then - $MAKE -C contrib/sysmobts-calib + configure_flags="$configure_flags --enable-sysmobts-calib" fi +build_bts "osmo-bts-sysmo" "$configure_flags" + osmo-clean-workspace.sh diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile deleted file mode 100644 index a5d4b99..0000000 --- a/contrib/sysmobts-calib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror -LIBS=`pkg-config --libs libosmocore libosmogsm` - -all: sysmobts-calib - -sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o - $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS) - -clean: - @rm -f sysmobts-calib *.o diff --git a/contrib/sysmobts-calib/Makefile.am b/contrib/sysmobts-calib/Makefile.am new file mode 100644 index 0000000..26275ab --- /dev/null +++ b/contrib/sysmobts-calib/Makefile.am @@ -0,0 +1,9 @@ +AM_CPPFLAGS = $(all_includes) -I$(SYSMOBTS_INCDIR) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) +LDFLAGS = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) + +noinst_PROGRAMS = sysmobts-calib +noinst_HEADERS = sysmobts-layer1.h + +sysmobts_calib_test_SOURCES = sysmobts-calib.c sysmobts-layer1.c +sysmobts_calib_test_LDADD = -lrt diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..667ebdd 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:55:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 13:55:12 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 (2 comments) would be nice to split this patch https://gerrit.osmocom.org/#/c/5818/5/configure.ac File configure.ac: Line 62: AC_MSG_RESULT([$enable_sysmobts_calib]) With this patch it seems that this alone does not work: ./configure --with-sysmobts=foo and that the old invocation ./configure --enable-sysmocom-bts also no longer works on its own? I think... * we should keep the old --enable-sysmocom-bts option so we don't produce build fallout everywhere. It should yield exactly the previous behavior: * we need a $sysmobts_incdir default so that --enable-sysmocom-bts works without issuing --with-sysmobts=. * when --with-sysmobts was passed, $enable_sysmocom_bts should also be set to yes. https://gerrit.osmocom.org/#/c/5818/5/contrib/sysmobts-calib/Makefile.am File contrib/sysmobts-calib/Makefile.am: Line 2: AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) shouldn't this also include the sysmobts header CFLAGS? -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 16 13:57:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 13:57:47 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: > it is even inside the commit in testsuite.at Might make sense to prefix it with FIXME so it'll jump out when grepping the sources. -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:08:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:08:45 +0000 Subject: osmo-pcu[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 7: The remaining issue with vty check puzzles me: unable to reproduce it locally and it somehow only happens with single fw version although vty commands are generic ones. -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:11:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:11:40 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 7: > would be nice to split this patch agree but how do you plan to merge it? - all the parts are necessary to unbreak jenkins tests. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:14:30 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 14:14:30 +0000 Subject: [PATCH] asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs Message-ID: Review at https://gerrit.osmocom.org/5825 fix jenkins build: add contrib/jenkins.sh expected by jobs Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 --- A contrib/jenkins.sh 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/asn1c refs/changes/25/5825/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100644 index 0000000..1b09c8b --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# jenkins build helper script for asn1c. This is how we build on jenkins.osmocom.org + +set -ex + +osmo-clean-workspace.sh + +set +x +echo +echo +echo +echo " =============================== asn1c ===============================" +echo +set -x + +./configure # CFLAGS="-Werror" CPPFLAGS="-Werror" #-Werror currently broken +$MAKE $PARALLEL_MAKE +$MAKE check +#$MAKE distcheck # distcheck currently broken + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 Gerrit-PatchSet: 1 Gerrit-Project: asn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:17:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 14:17:51 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 7: > agree but how do you plan to merge it? - all the parts are > necessary to unbreak jenkins tests. we can always remove the "V-1" and give it a V+1 manually. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:18:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 14:18:57 +0000 Subject: osmo-bsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5801 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:20:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 14:20:38 +0000 Subject: osmo-bsc[master]: handover_decision: log HO causes more accurately In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/5802/2/src/libbsc/handover_decision.c File src/libbsc/handover_decision.c: Line 282: LOGPC(DHO, LOGL_INFO, "HO cause: Interference HO av_rxlev=%d dbm\n", "dBm" with uppercase B. Please fix, thanks! -- To view, visit https://gerrit.osmocom.org/5802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:21:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 14:21:11 +0000 Subject: osmo-bts[master]: jenkins_common.sh: fix build_bts distcheck for more than one... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:21:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 16 Jan 2018 14:21:27 +0000 Subject: asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 Gerrit-PatchSet: 1 Gerrit-Project: asn1c 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 Jan 16 14:25:17 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 14:25:17 +0000 Subject: [PATCH] asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs 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/5825 to look at the new patch set (#2). fix jenkins build: add contrib/jenkins.sh expected by jobs Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 --- A contrib/jenkins.sh 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/asn1c refs/changes/25/5825/2 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..1b09c8b --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# jenkins build helper script for asn1c. This is how we build on jenkins.osmocom.org + +set -ex + +osmo-clean-workspace.sh + +set +x +echo +echo +echo +echo " =============================== asn1c ===============================" +echo +set -x + +./configure # CFLAGS="-Werror" CPPFLAGS="-Werror" #-Werror currently broken +$MAKE $PARALLEL_MAKE +$MAKE check +#$MAKE distcheck # distcheck currently broken + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 Gerrit-PatchSet: 2 Gerrit-Project: asn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:31:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 14:31:01 +0000 Subject: [PATCH] osmo-bsc[master]: handover_decision: log HO causes more accurately 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/5802 to look at the new patch set (#3). handover_decision: log HO causes more accurately Tweaked-by: nhofmeyr at sysmocom.de Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 --- M src/libbsc/handover_decision.c 1 file changed, 15 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/5802/3 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index c637e25..3bca05f 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -230,7 +230,7 @@ rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); switch (rc) { case 0: - LOGPC(DHO, LOGL_INFO, "Starting handover\n"); + LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); break; case -ENOSPC: LOGPC(DHO, LOGL_INFO, "No channel available\n"); @@ -278,20 +278,30 @@ /* Interference HO */ if (rxlev2dbm(av_rxlev) > -85 && - meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) + meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Interference HO av_rxlev=%d dBm\n", + rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Bad Quality */ - if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) + if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Bad Quality av_rxlev=%d dBm\n", rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Low Level */ - if (rxlev2dbm(av_rxlev) <= -110) + if (rxlev2dbm(av_rxlev) <= -110) { + LOGPC(DHO, LOGL_INFO, "HO cause: Low Level av_rxlev=%d dBm\n", rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Distance */ - if (mr->ms_l1.ta > net->handover.max_distance) + if (mr->ms_l1.ta > net->handover.max_distance) { + LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%u\n", + rxlev2dbm(av_rxlev), mr->ms_l1.ta); return attempt_handover(mr); + } /* Power Budget AKA Better Cell */ if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) -- To view, visit https://gerrit.osmocom.org/5802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:31:48 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 14:31:48 +0000 Subject: asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 Gerrit-PatchSet: 2 Gerrit-Project: asn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:31:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 14:31:50 +0000 Subject: [MERGED] asn1c[master]: fix jenkins build: add contrib/jenkins.sh expected by jobs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix jenkins build: add contrib/jenkins.sh expected by jobs ...................................................................... fix jenkins build: add contrib/jenkins.sh expected by jobs Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 --- A contrib/jenkins.sh 1 file changed, 21 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..1b09c8b --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,21 @@ +#!/bin/sh +# jenkins build helper script for asn1c. This is how we build on jenkins.osmocom.org + +set -ex + +osmo-clean-workspace.sh + +set +x +echo +echo +echo +echo " =============================== asn1c ===============================" +echo +set -x + +./configure # CFLAGS="-Werror" CPPFLAGS="-Werror" #-Werror currently broken +$MAKE $PARALLEL_MAKE +$MAKE check +#$MAKE distcheck # distcheck currently broken + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5825 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ef4b9ce3080ce9cad9ed92ead01619b0d6f91f4 Gerrit-PatchSet: 2 Gerrit-Project: asn1c Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:35:47 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 16 Jan 2018 14:35:47 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: @alexander: On top of sending the mail to the ml, I already assigned a task to Tsou a few days ago too (https://osmocom.org/issues/2826). I think that counts as pinging specifically. @max: I can prefix it with FIXME but anyway it's quite visible since everytime you run the tests it outputs "skipped" for that specific test. You can then go check and see the comment. -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:36:42 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 16 Jan 2018 14:36:42 +0000 Subject: [PATCH] osmo-bsc[master]: Split paging cases in bssmap_handle_paging() off into helper... Message-ID: Review at https://gerrit.osmocom.org/5826 Split paging cases in bssmap_handle_paging() off into helper functions. This is mostly no-op code refactoring which makes it easier to maintain the code for each paging case and reduces the scope of several local variables. Also, ensure that paging failures where no matching BTS was found are logged consistently in all cases. The log level changes from ERROR to NOTICE since this is not necessarily a fatal condition. Change-Id: If8fdf425145791f4904a70e295bdc3c7d0f4d5f6 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 186 insertions(+), 130 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/26/5826/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 1894561..799cb46 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -273,6 +273,179 @@ return gsm48_decode_lai(&lai, mcc, mnc, lac) != 0 ? -1 : 0; } +static void +page_all_bts(struct bsc_msc_data *msc, uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } +} + +static void +page_cgi(struct bsc_msc_data *msc, const uint8_t *data, uint8_t data_length, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t ci; + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { + uint16_t mcc, mnc, lac, *ci_be; + size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); + if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + page_all_bts(msc, tmsi, mi_string, chan_needed); + return; + } + ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); + ci = osmo_load16be(ci_be); + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d and CI %d not found\n", + mi_string, lac, ci); + } + } else { + LOGP(DMSC, LOGL_DEBUG, "Paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + } + remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); + i++; + } +} + +static void +page_lac_and_ci(struct bsc_msc_data *msc, const uint8_t *data, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t *lacp_be, *ci_be; + lacp_be = (uint16_t *)(&data[1]); + ci_be = (uint16_t *)(&data[3]); + while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) { + uint16_t lac = osmo_load16be(lacp_be); + uint16_t ci = osmo_load16be(ci_be); + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d and CI %d not found\n", + mi_string, lac, ci); + } + remain -= sizeof(*lacp_be) + sizeof(*ci_be); + lacp_be++; + ci_be++; + } +} + +static void +page_ci(struct bsc_msc_data *msc, const uint8_t *data, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity != ci) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with CI %d not found\n", + mi_string, ci); + } + remain -= sizeof(*ci_be); + ci_be++; + } +} + +static void +page_lai_and_lac(struct bsc_msc_data *msc, const uint8_t *data, size_t data_length, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id)) { + uint16_t mcc, mnc, lac; + if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + page_all_bts(msc, tmsi, mi_string, chan_needed); + return; + } + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d not found\n", + mi_string, lac); + } + } else { + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + } + remain -= sizeof(struct gsm48_loc_area_id); + i++; + } +} + +static void +page_lac(struct bsc_msc_data *msc, const uint8_t *data, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t *lacp_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*lacp_be)) { + uint16_t lac = osmo_load16be(lacp_be); + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d not found\n", + mi_string, lac); + } + remain -= sizeof(*lacp_be); + lacp_be++; + } +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) @@ -280,15 +453,11 @@ struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; - uint16_t lac, *lacp_be; - uint16_t mcc; - uint16_t mnc; uint8_t data_length; int remain; const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; - struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -353,136 +522,29 @@ cell_ident = data[0] & 0xf; remain -= 1; /* cell ident consumed */ - /* Default fallback: page entire BSS */ - lac = GSM_LAC_RESERVED_ALL_BTS; - switch (cell_ident) { case CELL_IDENT_NO_CELL: LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ - case CELL_IDENT_WHOLE_GLOBAL: { - uint16_t ci; - int i = 0; - while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { - uint16_t *ci_be; - size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); - if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " - "for BSS (0x%x), paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); - lac = GSM_LAC_RESERVED_ALL_BTS; - break; - } - ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); - ci = osmo_load16be(ci_be); - if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - if (bts->cell_identity != ci) - continue; - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) - break; - } - } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " - "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, - msc->network->country_code, msc->network->network_code); - } - remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); - i++; - } - } - - case CELL_IDENT_LAC_AND_CI: { - uint16_t ci, *ci_be; - lacp_be = (uint16_t *)(&data[1]); - ci_be = (uint16_t *)(&data[3]); - while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) { - lac = osmo_load16be(lacp_be); - ci = osmo_load16be(ci_be); - - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - if (bts->cell_identity != ci) - continue; - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) - break; - } - - remain -= sizeof(*lacp_be) + sizeof(*ci_be); - lacp_be++; - ci_be++; - } + case CELL_IDENT_WHOLE_GLOBAL: + page_cgi(msc, data, data_length, remain, tmsi, mi_string, chan_needed); break; - } - case CELL_IDENT_CI: { - uint16_t *ci_be = (uint16_t *)(&data[1]); - while (remain >= sizeof(*ci_be)) { - uint16_t ci = osmo_load16be(ci_be); - - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->cell_identity == ci) - break; - } - - if (bts) { - /* ignore errors from page_subscriber(); keep trying other BTS */ - page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); - } else { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", - mi_string, ci); - } - remain -= sizeof(*ci_be); - ci_be++; - } + case CELL_IDENT_LAC_AND_CI: + page_lac_and_ci(msc, data, remain, tmsi, mi_string, chan_needed); break; - } - case CELL_IDENT_LAI_AND_LAC: { - int i = 0; - while (remain >= sizeof(struct gsm48_loc_area_id)) { - if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " - "for BSS (0x%x), paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); - lac = GSM_LAC_RESERVED_ALL_BTS; - break; - } - if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - /* ignore errors from page_subscriber(); keep trying other BTS */ - page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); - } - } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " - "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, - msc->network->country_code, msc->network->network_code); - } - remain -= sizeof(struct gsm48_loc_area_id); - i++; - } + case CELL_IDENT_CI: + page_ci(msc, data, remain, tmsi, mi_string, chan_needed); break; - } + + case CELL_IDENT_LAI_AND_LAC: + page_lai_and_lac(msc, data, data_length, remain, tmsi, mi_string, chan_needed); + break; case CELL_IDENT_LAC: - lacp_be = (uint16_t *)(&data[1]); - while (remain >= sizeof(*lacp_be)) { - lac = osmo_load16be(lacp_be); - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - /* ignore errors from page_subscriber(); keep trying other BTS */ - page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); - } - remain -= sizeof(*lacp_be); - lacp_be++; - } + page_lac(msc, data, remain, tmsi, mi_string, chan_needed); break; case CELL_IDENT_BSS: @@ -491,20 +553,14 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* ignore errors from page_subscriber(); try all BTS */ - page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); - } + page_all_bts(msc, tmsi, mi_string, chan_needed); break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* ignore errors from page_subscriber(); try all BTS */ - page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); - } + page_all_bts(msc, tmsi, mi_string, chan_needed); break; } -- To view, visit https://gerrit.osmocom.org/5826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8fdf425145791f4904a70e295bdc3c7d0f4d5f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:36:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:36:55 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies 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/5818 to look at the new patch set (#8). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. To propagate dependencies properly, sysmobts-calib was moved into osmo-bts-sysmo/misc. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M .gitignore M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh D contrib/sysmobts-calib/Makefile M src/osmo-bts-sysmo/Makefile.am R src/osmo-bts-sysmo/misc/sysmobts-calib.c R src/osmo-bts-sysmo/misc/sysmobts-layer1.c R src/osmo-bts-sysmo/misc/sysmobts-layer1.h M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 11 files changed, 34 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/8 diff --git a/.gitignore b/.gitignore index 2e8c884..1780e1c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,7 @@ core core.* -contrib/sysmobts-calib/sysmobts-calib - +src/osmo-bts-sysmo/sysmobts-calib src/osmo-bts-sysmo/l1fwd-proxy src/osmo-bts-sysmo/osmo-bts-sysmo src/osmo-bts-sysmo/osmo-bts-sysmo-remote diff --git a/Makefile.am b/Makefile.am index 4832c84..dc42574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,10 +7,6 @@ EXTRA_DIST = \ 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 \ - contrib/sysmobts-calib/sysmobts-layer1.c \ - contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ diff --git a/configure.ac b/configure.ac index 89443d0..1c3efe0 100644 --- a/configure.ac +++ b/configure.ac @@ -54,15 +54,32 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) +AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) +AC_ARG_ENABLE(sysmobts-calib, + AC_HELP_STRING([--enable-sysmobts-calib], + [enable code for sysmobts calibration tool [default=no]]), + [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"]) +AC_MSG_RESULT([$enable_sysmobts_calib]) +AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes") + AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) AC_ARG_ENABLE(sysmocom-bts, AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..88aef3d 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,13 +16,13 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" - -build_bts "osmo-bts-sysmo" "$configure_flags" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then - $MAKE -C contrib/sysmobts-calib + configure_flags="$configure_flags --enable-sysmobts-calib" fi +build_bts "osmo-bts-sysmo" "$configure_flags" + osmo-clean-workspace.sh diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile deleted file mode 100644 index a5d4b99..0000000 --- a/contrib/sysmobts-calib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror -LIBS=`pkg-config --libs libosmocore libosmogsm` - -all: sysmobts-calib - -sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o - $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS) - -clean: - @rm -f sysmobts-calib *.o diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..b837d3a 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,9 +1,10 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ + misc/sysmobts-layer1.h \ l1_fwd.h l1_if.h l1_transp.h eeprom.h utils.h oml_router.h bin_PROGRAMS = osmo-bts-sysmo osmo-bts-sysmo-remote l1fwd-proxy sysmobts-mgr sysmobts-util @@ -20,6 +21,13 @@ l1fwd_proxy_SOURCES = l1_fwd_main.c l1_transp_hw.c l1fwd_proxy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD) +if ENABLE_SYSMOBTS_CALIB +bin_PROGRAMS = sysmobts-calib + +sysmobts_calib_SOURCES = misc/sysmobts-calib.c misc/sysmobts-layer1.c +sysmobts_calib_LDADD = -lrt $(COMMON_LDADD) +endif + sysmobts_mgr_SOURCES = \ misc/sysmobts_mgr.c misc/sysmobts_misc.c \ misc/sysmobts_par.c misc/sysmobts_nl.c \ diff --git a/contrib/sysmobts-calib/sysmobts-calib.c b/src/osmo-bts-sysmo/misc/sysmobts-calib.c similarity index 100% rename from contrib/sysmobts-calib/sysmobts-calib.c rename to src/osmo-bts-sysmo/misc/sysmobts-calib.c diff --git a/contrib/sysmobts-calib/sysmobts-layer1.c b/src/osmo-bts-sysmo/misc/sysmobts-layer1.c similarity index 100% rename from contrib/sysmobts-calib/sysmobts-layer1.c rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.c diff --git a/contrib/sysmobts-calib/sysmobts-layer1.h b/src/osmo-bts-sysmo/misc/sysmobts-layer1.h similarity index 100% rename from contrib/sysmobts-calib/sysmobts-layer1.h rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.h diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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 Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:37:31 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:37:31 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 7: Ok, than I'll first make it work with jenkins as a single patch and than resubmit splitted version. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:53:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:53:15 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies 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/5818 to look at the new patch set (#9). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Let's make sure that tests have all required CFLAGS/LIBS to build by allowing to specify sysmobts headers location explicitly similar to other BTS models. Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 5 files changed, 14 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/9 diff --git a/configure.ac b/configure.ac index 2181743..1c3efe0 100644 --- a/configure.ac +++ b/configure.ac @@ -67,10 +67,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 852542b..88aef3d 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 6e917e7..b837d3a 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:53:16 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:53:16 +0000 Subject: [PATCH] osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo Message-ID: Review at https://gerrit.osmocom.org/5827 Move sysmobts-calib into osmo-bts-sysmo It's prerequisite for jenkins tests fix after migration to stow. The sysmobts-calib uses hand-coded Makefile instead of automake which makes it hard to properly propagate build flags. Also, make it optional to enable excluding it from certain jenkins tests. Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 --- M .gitignore M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh D contrib/sysmobts-calib/Makefile M src/osmo-bts-sysmo/Makefile.am R src/osmo-bts-sysmo/misc/sysmobts-calib.c R src/osmo-bts-sysmo/misc/sysmobts-layer1.c R src/osmo-bts-sysmo/misc/sysmobts-layer1.h 9 files changed, 20 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/27/5827/1 diff --git a/.gitignore b/.gitignore index 2e8c884..1780e1c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,7 @@ core core.* -contrib/sysmobts-calib/sysmobts-calib - +src/osmo-bts-sysmo/sysmobts-calib src/osmo-bts-sysmo/l1fwd-proxy src/osmo-bts-sysmo/osmo-bts-sysmo src/osmo-bts-sysmo/osmo-bts-sysmo-remote diff --git a/Makefile.am b/Makefile.am index 4832c84..dc42574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,10 +7,6 @@ EXTRA_DIST = \ 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 \ - contrib/sysmobts-calib/sysmobts-layer1.c \ - contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ diff --git a/configure.ac b/configure.ac index 89443d0..2181743 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,14 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) +AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) +AC_ARG_ENABLE(sysmobts-calib, + AC_HELP_STRING([--enable-sysmobts-calib], + [enable code for sysmobts calibration tool [default=no]]), + [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"]) +AC_MSG_RESULT([$enable_sysmobts_calib]) +AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes") + AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) AC_ARG_ENABLE(sysmocom-bts, AC_HELP_STRING([--enable-sysmocom-bts], diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..852542b 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -18,11 +18,11 @@ configure_flags="--enable-sysmocom-bts" -build_bts "osmo-bts-sysmo" "$configure_flags" - # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then - $MAKE -C contrib/sysmobts-calib + configure_flags="$configure_flags --enable-sysmobts-calib" fi +build_bts "osmo-bts-sysmo" "$configure_flags" + osmo-clean-workspace.sh diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile deleted file mode 100644 index a5d4b99..0000000 --- a/contrib/sysmobts-calib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror -LIBS=`pkg-config --libs libosmocore libosmogsm` - -all: sysmobts-calib - -sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o - $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS) - -clean: - @rm -f sysmobts-calib *.o diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..6e917e7 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -4,6 +4,7 @@ EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ + misc/sysmobts-layer1.h \ l1_fwd.h l1_if.h l1_transp.h eeprom.h utils.h oml_router.h bin_PROGRAMS = osmo-bts-sysmo osmo-bts-sysmo-remote l1fwd-proxy sysmobts-mgr sysmobts-util @@ -20,6 +21,13 @@ l1fwd_proxy_SOURCES = l1_fwd_main.c l1_transp_hw.c l1fwd_proxy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD) +if ENABLE_SYSMOBTS_CALIB +bin_PROGRAMS = sysmobts-calib + +sysmobts_calib_SOURCES = misc/sysmobts-calib.c misc/sysmobts-layer1.c +sysmobts_calib_LDADD = -lrt $(COMMON_LDADD) +endif + sysmobts_mgr_SOURCES = \ misc/sysmobts_mgr.c misc/sysmobts_misc.c \ misc/sysmobts_par.c misc/sysmobts_nl.c \ diff --git a/contrib/sysmobts-calib/sysmobts-calib.c b/src/osmo-bts-sysmo/misc/sysmobts-calib.c similarity index 100% rename from contrib/sysmobts-calib/sysmobts-calib.c rename to src/osmo-bts-sysmo/misc/sysmobts-calib.c diff --git a/contrib/sysmobts-calib/sysmobts-layer1.c b/src/osmo-bts-sysmo/misc/sysmobts-layer1.c similarity index 100% rename from contrib/sysmobts-calib/sysmobts-layer1.c rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.c diff --git a/contrib/sysmobts-calib/sysmobts-layer1.h b/src/osmo-bts-sysmo/misc/sysmobts-layer1.h similarity index 100% rename from contrib/sysmobts-calib/sysmobts-layer1.h rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.h -- To view, visit https://gerrit.osmocom.org/5827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:55:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:55:55 +0000 Subject: osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Note: we have to set V+1 manually because this is incomplete fix split off from 5818 as requested. -- To view, visit https://gerrit.osmocom.org/5827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 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-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 14:56:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 14:56:02 +0000 Subject: osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/5827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 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-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 15:06:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 15:06:37 +0000 Subject: osmo-pcu[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 Verified+1 Even more peculiar - sometimes it fails in one, sometimes in another fw version. Seems like this has nothing to do with the code, but some kind of race condition. I think we can safely merge this and figure out fix for unrelated issue in a separate patch. -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 15:38:39 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 15:38:39 +0000 Subject: [PATCH] osmo-ggsn[master]: Add GTP message names 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/5758 to look at the new patch set (#2). Add GTP message names Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 51 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/58/5758/2 diff --git a/gtp/gtp.c b/gtp/gtp.c index b36e0c6..0d6d896 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -86,6 +86,51 @@ return VERSION; } +const struct value_string gtp_type_names[] = { + { GTP_ECHO_REQ, "Echo Request" }, + { GTP_ECHO_RSP, "Echo Response" }, + { GTP_NOT_SUPPORTED, "Version Not Supported" }, + { GTP_ALIVE_REQ, "Node Alive Request" }, + { GTP_ALIVE_RSP, "Node Alive Response" }, + { GTP_REDIR_REQ, "Redirection Request" }, + { GTP_REDIR_RSP, "Redirection Response" }, + { GTP_CREATE_PDP_REQ, "Create PDP Context Request" }, + { GTP_CREATE_PDP_RSP, "Create PDP Context Response" }, + { GTP_UPDATE_PDP_REQ, "Update PDP Context Request" }, + { GTP_UPDATE_PDP_RSP, "Update PDP Context Response" }, + { GTP_DELETE_PDP_REQ, "Delete PDP Context Request" }, + { GTP_DELETE_PDP_RSP, "Delete PDP Context Response" }, + { GTP_ERROR, "Error Indication" }, + { GTP_PDU_NOT_REQ, "PDU Notification Request" }, + { GTP_PDU_NOT_RSP, "PDU Notification Response" }, + { GTP_PDU_NOT_REJ_REQ, "PDU Notification Reject Request" }, + { GTP_PDU_NOT_REJ_RSP, "PDU Notification Reject Response" }, + { GTP_SUPP_EXT_HEADER, "Supported Extension Headers Notification" }, + { GTP_SND_ROUTE_REQ, "Send Routeing Information for GPRS Request" }, + { GTP_SND_ROUTE_RSP, "Send Routeing Information for GPRS Response" }, + { GTP_FAILURE_REQ, "Failure Report Request" }, + { GTP_FAILURE_RSP, "Failure Report Response" }, + { GTP_MS_PRESENT_REQ, "Note MS GPRS Present Request" }, + { GTP_MS_PRESENT_RSP, "Note MS GPRS Present Response" }, + { GTP_IDEN_REQ, "Identification Request" }, + { GTP_IDEN_RSP, "Identification Response" }, + { GTP_SGSN_CONTEXT_REQ,"SGSN Context Request" }, + { GTP_SGSN_CONTEXT_RSP,"SGSN Context Response" }, + { GTP_SGSN_CONTEXT_ACK,"SGSN Context Acknowledge" }, + { GTP_FWD_RELOC_REQ, "Forward Relocation Request" }, + { GTP_FWD_RELOC_RSP, "Forward Relocation Response" }, + { GTP_FWD_RELOC_COMPL, "Forward Relocation Complete" }, + { GTP_RELOC_CANCEL_REQ,"Relocation Cancel Request" }, + { GTP_RELOC_CANCEL_RSP,"Relocation Cancel Response" }, + { GTP_FWD_SRNS, "Forward SRNS Context" }, + { GTP_FWD_RELOC_ACK, "Forward Relocation Complete Acknowledge" }, + { GTP_FWD_SRNS_ACK, "Forward SRNS Context Acknowledge" }, + { GTP_DATA_TRAN_REQ, "Data Record Transfer Request" }, + { GTP_DATA_TRAN_RSP, "Data Record Transfer Response" }, + { GTP_GPDU, "G-PDU" }, + { 0, NULL } +}; + /* gtp_new */ /* gtp_free */ diff --git a/gtp/gtp.h b/gtp/gtp.h index d189ded..8f8e293 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -12,6 +12,8 @@ #ifndef _GTP_H #define _GTP_H +#include + #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -85,6 +87,10 @@ /* 242-254 For future use. */ #define GTP_GPDU 255 /* G-PDU */ +extern const struct value_string gtp_type_names[]; +static inline const char *gtp_type_name(uint8_t val) +{ return get_value_string(gtp_type_names, val); } + /* GTP information element cause codes from 29.060 v3.9.0 7.7 */ /* */ #define GTPCAUSE_REQ_IMSI 0 /* Request IMSI */ -- To view, visit https://gerrit.osmocom.org/5758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 16 15:54:24 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 15:54:24 +0000 Subject: [PATCH] osmo-ggsn[master]: Fix stow-enabled jenkins build failure Message-ID: Review at https://gerrit.osmocom.org/5828 Fix stow-enabled jenkins build failure The error is: CC gtp-kernel.o gtp-kernel.c:19:26: fatal error: libgtpnl/gtp.h: No such file or directory #include ^ compilation terminated. Fix it by using proper CFLAGS/LIBS for libgtpnl. Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33 --- M ggsn/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/28/5828/1 diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 8a468a9..6b2232f 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -7,8 +7,8 @@ osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL -AM_CFLAGS += -DGTP_KERNEL -osmo_ggsn_LDADD += -lgtpnl +AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS) +osmo_ggsn_LDADD += $(LIBGTPNL_LIBS) endif osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -- To view, visit https://gerrit.osmocom.org/5828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 16 16:08:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 16:08:06 +0000 Subject: [PATCH] libosmocore[master]: Log lapd_datalink state on errors Message-ID: Review at https://gerrit.osmocom.org/5829 Log lapd_datalink state on errors It's not very useful to get just the raw pointer address in case of lapd_datalink receive error. Log it's state in addition. Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 --- M src/gsm/lapd_core.c 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/5829/1 diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 5d87154..a2ff230 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1505,7 +1505,7 @@ /* G.2.2 Wrong value of the C/R bit */ if (lctx->cr == dl->cr.rem2loc.resp) { LOGP(DLLAPD, LOGL_ERROR, - "I frame response not allowed (dl=%p)\n", dl); + "I frame response not allowed (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_FRM_UNIMPL, lctx); return -EINVAL; @@ -1517,7 +1517,7 @@ * primitive with cause "I frame with incorrect length" * is sent to the mobile management entity. */ LOGP(DLLAPD, LOGL_ERROR, - "I frame length not allowed (dl=%p)\n", dl); + "I frame length not allowed (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_LEN, lctx); return -EIO; @@ -1529,7 +1529,7 @@ * mobile management entity. */ if (lctx->more && length < lctx->n201) { LOGP(DLLAPD, LOGL_ERROR, - "I frame with M bit too short (dl=%p)\n", dl); + "I frame with M bit too short (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_MBITS, lctx); return -EIO; @@ -1545,7 +1545,7 @@ case LAPD_STATE_SABM_SENT: case LAPD_STATE_DISC_SENT: LOGP(DLLAPD, LOGL_NOTICE, - "I frame ignored in this state (dl=%p)\n", dl); + "I frame ignored in state %s (dl=%p)\n", lapd_state_name(dl->state), dl); msgb_free(msg); return 0; } @@ -1553,7 +1553,7 @@ /* 5.7.1: N(s) sequence error */ if (ns != dl->v_recv) { LOGP(DLLAPD, LOGL_NOTICE, "N(S) sequence error: N(S)=%u, " - "V(R)=%u (dl=%p)\n", ns, dl->v_recv, dl); + "V(R)=%u (dl=%p state %s)\n", ns, dl->v_recv, dl, lapd_state_name(dl->state)); /* discard data */ msgb_free(msg); if (dl->seq_err_cond != 1) { -- To view, visit https://gerrit.osmocom.org/5829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 16 16:08:12 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 16:08:12 +0000 Subject: [ABANDON] libosmocore[master]: Log lapd_datalink state on errors In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Log lapd_datalink state on errors ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5749 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I3141212fa74d045ee24a18eea1191d63cd15e0ed Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Tue Jan 16 16:14:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 16:14:22 +0000 Subject: libosmocore[master]: Log lapd_datalink state on errors In-Reply-To: References: Message-ID: Patch Set 1: Resubmission of https://gerrit.osmocom.org/#/c/5749/ due to following error: remote: Processing changes: refs: 1, done To ssh://gerrit.osmocom.org:29418/libosmocore ! [remote rejected] HEAD -> refs/publish/master/log (commit already exists (in the change)) error: failed to push some refs to 'ssh://max at gerrit.osmocom.org:29418/libosmocore' -- To view, visit https://gerrit.osmocom.org/5829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 17:07:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 17:07:48 +0000 Subject: [PATCH] osmo-bts[master]: Enable optional static builds Message-ID: Review at https://gerrit.osmocom.org/5830 Enable optional static builds The default (for both manual and .deb builds) is to use shared build (as before) - the static build is entirely optional. Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/30/5830/1 diff --git a/configure.ac b/configure.ac index 89443d0..4a670ad 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,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) -- To view, visit https://gerrit.osmocom.org/5830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 16 17:56:44 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 16 Jan 2018 17:56:44 +0000 Subject: [PATCH] libosmocore[master]: fsm: fix double llist_del in osmo_fsm_inst_term() Message-ID: Review at https://gerrit.osmocom.org/5831 fsm: fix double llist_del in osmo_fsm_inst_term() llist_del(&fi->proc.child) is executed always, regardless whether a parent is configured or not. This may lead into a double llist_del when the child has been previously unlinked. - check if fi->proc.parent is set, and only then execute llist_del(&fi->proc.child); Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac --- M src/fsm.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/31/5831/1 diff --git a/src/fsm.c b/src/fsm.c index 0bdcd9d..f9effc4 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -483,10 +483,11 @@ /* delete ourselves from the parent */ parent = fi->proc.parent; - if (parent) + if (parent) { LOGPFSMSRC(fi, file, line, "Removing from parent %s\n", osmo_fsm_inst_name(parent)); - llist_del(&fi->proc.child); + llist_del(&fi->proc.child); + } /* call destructor / clean-up function */ if (fi->fsm->cleanup) -- To view, visit https://gerrit.osmocom.org/5831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 16 17:56:47 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 16 Jan 2018 17:56:47 +0000 Subject: [PATCH] libosmocore[master]: fsm: add function osmo_fsm_inst_set_parent() Message-ID: Review at https://gerrit.osmocom.org/5832 fsm: add function osmo_fsm_inst_set_parent() At the moment it is not possible to unlink a child from from its parent, nor is it possible to assign a new parent to a child FSM. - Make it possible to unlink childs from a parent. - Make it possible to change the parent of a child Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/5832/1 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2fbb250..1ae638b 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -150,6 +150,9 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event); +void osmo_fsm_inst_set_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event); void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); diff --git a/src/fsm.c b/src/fsm.c index f9effc4..187d316 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -272,13 +272,35 @@ LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); + osmo_fsm_inst_set_parent(fi, parent, parent_term_event); return fi; } +/*! set parent instance of an FSM. + * \param[in] fi Descriptor of the to-be-allocated FSM. + * \param[in] new_parent New parent FSM instance. + * \param[in] new_parent_term_event Event to be sent to parent when terminating. */ +void osmo_fsm_inst_set_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event) +{ + /* If a parent already exists, unlink first */ + if (fi->proc.parent) { + fi->proc.parent = NULL; + fi->proc.parent_term_event = 0; + llist_del(&fi->proc.child); + } + + /* Add new parent */ + if (new_parent) { + fi->proc.parent = new_parent; + fi->proc.parent_term_event = new_parent_term_event; + llist_add(&fi->proc.child, &new_parent->proc.children); + + } +} + /*! delete a given instance of a FSM * \param[in] fsm The FSM to be un-registered and deleted */ -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 16 22:57:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 22:57:35 +0000 Subject: osmo-ggsn[master]: Fix stow-enabled jenkins build failure In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn 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 Tue Jan 16 22:57:38 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 22:57:38 +0000 Subject: [MERGED] osmo-ggsn[master]: Fix stow-enabled jenkins build failure In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Fix stow-enabled jenkins build failure ...................................................................... Fix stow-enabled jenkins build failure The error is: CC gtp-kernel.o gtp-kernel.c:19:26: fatal error: libgtpnl/gtp.h: No such file or directory #include ^ compilation terminated. Fix it by using proper CFLAGS/LIBS for libgtpnl. Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33 --- M ggsn/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/Makefile.am b/ggsn/Makefile.am index 8a468a9..6b2232f 100644 --- a/ggsn/Makefile.am +++ b/ggsn/Makefile.am @@ -7,8 +7,8 @@ osmo_ggsn_LDADD = @EXEC_LDADD@ -lgtp -L../gtp ../lib/libmisc.a $(LIBOSMOCORE_LIBS) $(LIBOSMOCTRL_LIBS) $(LIBOSMOVTY_LIBS) if ENABLE_GTP_KERNEL -AM_CFLAGS += -DGTP_KERNEL -osmo_ggsn_LDADD += -lgtpnl +AM_CFLAGS += -DGTP_KERNEL $(LIBGTPNL_CFLAGS) +osmo_ggsn_LDADD += $(LIBGTPNL_LIBS) endif osmo_ggsn_DEPENDENCIES = ../gtp/libgtp.la ../lib/libmisc.a -- To view, visit https://gerrit.osmocom.org/5828 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a24076778ea3ce263ac27211a6f45f935155b33 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Jan 16 23:09:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 23:09:34 +0000 Subject: osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Thanks for splitting this off into another patch. I'm not sure we should move the code around though. I was about to argue how src/ should be for the osmo-bts variants, with common/ and the various hardware platforms; but I see that there already is the sysmobts_mgr in src/osmo-bts-sysmo/misc as well. So I'd be fine with it after all, but would like confirmation from someone else (i.e. laforge). Then the course of action would be to merge this patch even though jenkins cannot verify it, because the V+1 from jenkins on https://gerrit.osmocom.org/5818 does verify that this code works. -- To view, visit https://gerrit.osmocom.org/5827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 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-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 23:11:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 16 Jan 2018 23:11:35 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: Code-Review-1 looks good, except I still insist on sane configure option semantics as described in earlier comment. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 23:33:17 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Tue, 16 Jan 2018 23:33:17 +0000 Subject: [PATCH] osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations' Message-ID: Review at https://gerrit.osmocom.org/5833 Remove 11-bit RACH support from 'Known Limitations' Support for 11-bit RACH support was added to libosmocore with https://gerrit.osmocom.org/#/c/5062 Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 --- M README.md 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/33/5833/1 diff --git a/README.md b/README.md index 43c27b2..5e6355d 100644 --- a/README.md +++ b/README.md @@ -123,5 +123,4 @@ * TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865) * No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855) - * No 11bit RACH support (https://osmocom.org/issues/1854) * No CBCH support (https://osmocom.org/issues/1617) -- To view, visit https://gerrit.osmocom.org/5833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer From gerrit-no-reply at lists.osmocom.org Tue Jan 16 23:40:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 16 Jan 2018 23:40:52 +0000 Subject: osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations' In-Reply-To: References: Message-ID: Patch Set 1: Curious, have you tested that it actually works? -- To view, visit https://gerrit.osmocom.org/5833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 16 23:48:09 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Tue, 16 Jan 2018 23:48:09 +0000 Subject: osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations' In-Reply-To: References: Message-ID: Patch Set 1: > Curious, have you tested that it actually works? The reason why the build is failing at the moment is that https://gerrit.osmocom.org/#/c/5818/ is not yet merged. -- To view, visit https://gerrit.osmocom.org/5833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From admin at opensuse.org Wed Jan 17 03:51:32 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 17 Jan 2018 03:51:32 +0000 Subject: Build failure of network:osmocom:nightly/libosmocore in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5a5ec84f8e1fd_2475ad6f604183ca@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: [ 28s] [113/237] installing autopoint-0.19.8.1-1ubuntu2 [ 28s] [114/237] installing libp11-kit-dev-0.23.2-5 [ 28s] [115/237] installing file-1:5.28-2ubuntu1 [ 29s] [116/237] installing libacl1-2.2.52-3 [ 29s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 29s] [117/237] installing libgmp-dev-2:6.1.1+dfsg-1 [ 29s] [118/237] installing libsasl2-2-2.1.26.dfsg1-15 [ 29s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 29s] [119/237] installing libselinux1-2.5-3 [ 29s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 29s] [120/237] installing zlib1g-dev-1:1.2.8.dfsg-2ubuntu5 [ 29s] [121/237] installing bison-2:3.0.4.dfsg-1 [ 29s] update-alternatives: using /usr/bin/bison.yacc to provide /usr/bin/yacc (yacc) in auto mode [ 29s] [122/237] installing libhcrypto4-heimdal-1.7~git20150920+dfsg-4ubuntu1 [ 29s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 29s] [123/237] installing libmpc3-1.0.3-1 [ 29s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 29s] [124/237] installing libxml2-2.9.4+dfsg1-2 [ 29s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 30s] [125/237] installing libkrb5-3-1.14.3+dfsg-2 [ 30s] Processing triggers for libc-bin (2.24-3ubuntu1) ... [ 30s] [126/237] installing libllvm3.8-1:3.8.1-12ubuntu1 [28837s] qemu-system-x86_64: terminating on signal 15 from pid 5767 () [28837s] ### VM INTERACTION END ### [28837s] No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl) [28837s] or the build host has a kernel or hardware problem... Job seems to be stuck here, killed. (after 28800 seconds of inactivity) -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:32 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:32 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: add specification reference to SS message type Message-ID: Review at https://gerrit.osmocom.org/5834 gsm0480: add specification reference to SS message type Change-Id: Iff0210e995053e270939a774db33f55b22545204 --- M src/gsm/gsm0480.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/5834/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 328a8c0..8319b19 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -285,6 +285,7 @@ int rc = 1; uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ + /* Table 2.1: Messages for call independent SS control */ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); -- To view, visit https://gerrit.osmocom.org/5834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff0210e995053e270939a774db33f55b22545204 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:36 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:36 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: pass exact GSM 04.80 payload length to parse_ss() Message-ID: Review at https://gerrit.osmocom.org/5835 gsm0480: pass exact GSM 04.80 payload length to parse_ss() Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4 --- M src/gsm/gsm0480.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/35/5835/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 8319b19..75388b9 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -232,7 +232,7 @@ req->transaction_id = hdr->proto_discr & 0x70; ss.transaction_id = req->transaction_id; - rc = parse_ss(hdr, len, &ss); + rc = parse_ss(hdr, len - sizeof(*hdr), &ss); /* convert from ss_request to legacy ussd_request */ req->transaction_id = ss.transaction_id; @@ -271,7 +271,7 @@ if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { req->transaction_id = hdr->proto_discr & 0x70; - rc = parse_ss(hdr, len, req); + rc = parse_ss(hdr, len - sizeof(*hdr), req); } if (!rc) @@ -293,10 +293,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + rc &= parse_ss_info_elements(&hdr->data[0], len, req); break; case GSM0480_MTYPE_FACILITY: - rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); + rc &= parse_ss_facility(&hdr->data[0], len, req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", -- To view, visit https://gerrit.osmocom.org/5835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:36 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:36 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: move SS request length check to parse_ss() Message-ID: Review at https://gerrit.osmocom.org/5836 gsm0480: move SS request length check to parse_ss() Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc --- M src/gsm/gsm0480.c 1 file changed, 11 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/36/5836/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 75388b9..25f97a2 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -255,19 +255,7 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { - uint8_t msg_type = hdr->msg_type & 0x3F; int rc = 0; - - /** - * GSM 04.80 Section 2.5 'Release complete' Table 2.5 - * payload is optional for 'RELEASE COMPLETE' message - */ - if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { - if (len < sizeof(*hdr) + 2) { - LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); - return 0; - } - } if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { req->transaction_id = hdr->proto_discr & 0x70; @@ -285,6 +273,17 @@ int rc = 1; uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ + /** + * GSM 04.80 Section 2.5 'Release complete' Table 2.5 + * payload is optional for 'RELEASE COMPLETE' message + */ + if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (len < 2) { + LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); + return 0; + } + } + /* Table 2.1: Messages for call independent SS control */ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: -- To view, visit https://gerrit.osmocom.org/5836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:36 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:36 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: refactor gsm0480_decode_ss_request Message-ID: Review at https://gerrit.osmocom.org/5837 gsm0480: refactor gsm0480_decode_ss_request Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1 --- M src/gsm/gsm0480.c 1 file changed, 14 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/5837/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 25f97a2..ca00999 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -255,17 +255,24 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { - int rc = 0; + uint8_t pdisc; - if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { - req->transaction_id = hdr->proto_discr & 0x70; - rc = parse_ss(hdr, len - sizeof(*hdr), req); + /** + * Check Protocol Discriminator + * see TS GSM 04.07 and GSM 04.80 + */ + pdisc = gsm48_hdr_pdisc(hdr); + if (pdisc != GSM48_PDISC_NC_SS) { + LOGP(0, LOGL_ERROR, "Dropping message with " + "unsupported pdisc=%02x\n", pdisc); + return 0; } - if (!rc) - LOGP(0, LOGL_DEBUG, "Error occurred while parsing received SS!\n"); + /* GSM 04.80 3.3 Transaction Identifier */ + req->transaction_id = hdr->proto_discr & 0x70; - return rc; + /* Parse SS request */ + return parse_ss(hdr, len - sizeof(*hdr), req); } static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) -- To view, visit https://gerrit.osmocom.org/5837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:37 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:37 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: correct parse_ss_info_elements() declaration Message-ID: Review at https://gerrit.osmocom.org/5838 gsm0480: correct parse_ss_info_elements() declaration Change-Id: I64df293188908c7eb10a61941db76656340d3a8e --- M src/gsm/gsm0480.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/5838/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ca00999..e3856a5 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -198,7 +198,7 @@ uint16_t len, struct ss_request *req); static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, struct ss_request *req); -static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, +static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, struct ss_request *req); -- To view, visit https://gerrit.osmocom.org/5838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64df293188908c7eb10a61941db76656340d3a8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:37 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:37 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse all SS info elements in a message Message-ID: Review at https://gerrit.osmocom.org/5839 gsm0480: parse all SS info elements in a message Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 --- M src/gsm/gsm0480.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/5839/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index e3856a5..0f30250 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -334,11 +334,15 @@ uint8_t iei; uint8_t iei_length; + /* We need at least two bytes */ + if (len < 2) + return 0; + iei = ss_ie[0]; iei_length = ss_ie[1]; /* If the data does not fit, report an error */ - if (len - 2 < iei_length) + if (iei_length + 2 > len) return 0; switch (iei) { @@ -356,6 +360,11 @@ break; } + /* A message may contain multiple IEs */ + if (iei_length + 2 + 2 < len) + rc &= parse_ss_info_elements(ss_ie + iei_length + 2, + len - iei_length - 2, req); + return rc; } -- To view, visit https://gerrit.osmocom.org/5839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 06:46:38 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 06:46:38 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse optional IEs for RELEASE COMPLETE message Message-ID: Review at https://gerrit.osmocom.org/5840 gsm0480: parse optional IEs for RELEASE COMPLETE message According to GSM 04.80 section 2.5 "Release complete", a message of the mentioned type may contain optional IEs, such as Cause and Facility. Let's parse them. Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222 --- M src/gsm/gsm0480.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/5840/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 0f30250..0072812 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -295,7 +295,11 @@ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); - /* could also parse out the optional Cause/Facility data */ + + /* Parse optional Cause and/or Facility data */ + if (len >= 2) + rc &= parse_ss_info_elements(&hdr->data[0], len, req); + req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: -- To view, visit https://gerrit.osmocom.org/5840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:20:54 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 08:20:54 +0000 Subject: gr-gsm[master]: README.md: Turn URLs into hyperlinks (video, mailing list) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:21:20 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 08:21:20 +0000 Subject: gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:21:25 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 08:21:25 +0000 Subject: [MERGED] gr-gsm[master]: README.md: Change mailing list address to osmocom.org In-Reply-To: References: Message-ID: Piotr Krysik has submitted this change and it was merged. Change subject: README.md: Change mailing list address to osmocom.org ...................................................................... README.md: Change mailing list address to osmocom.org Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 --- M README.md 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Piotr Krysik: Looks good to me, approved; Verified Harald Welte: Looks good to me, but someone else must approve diff --git a/README.md b/README.md index 86ca1e8..983873d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ ============ Current gr-gsm project's mailing list address is following: -gr-gsm at googlegroups.com +gr-gsm at lists.osmocom.org Mailing list is a place for general discussions, questions about the usage and installation. In case of problem with installation please try to provide full information that will help reproducing it. Minimum information should contain: - operating system with version, @@ -20,9 +20,9 @@ - version of gnuradio (it can be obtained with: gnuradio-companion --version) - error messages (in case of pybombs installation they can be obtained after switching it to verbous mode with -v option). -To join the group with any e-mail addres (google account is not required) use this link: +To join the group with any e-mail address, use this link: -https://groups.google.com/forum/#!forum/gr-gsm/join +https://lists.osmocom.org/mailman/listinfo/gr-gsm Development =========== -- To view, visit https://gerrit.osmocom.org/5634 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7b474138444f0ceea160f74df4b693030ea07a8 Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:21:26 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 08:21:26 +0000 Subject: [MERGED] gr-gsm[master]: README.md: Turn URLs into hyperlinks (video, mailing list) In-Reply-To: References: Message-ID: Piotr Krysik has submitted this change and it was merged. Change subject: README.md: Turn URLs into hyperlinks (video, mailing list) ...................................................................... README.md: Turn URLs into hyperlinks (video, mailing list) Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f --- M README.md 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Piotr Krysik: Looks good to me, approved; Verified Vadim Yanitskiy: Looks good to me, but someone else must approve diff --git a/README.md b/README.md index 983873d..b31b679 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To join the group with any e-mail address, use this link: -https://lists.osmocom.org/mailman/listinfo/gr-gsm + Development =========== @@ -34,7 +34,7 @@ ====== Short presentation of *Airprobe*'like application of *gr-gsm*: -https://www.youtube.com/watch?v=Eofnb7zr8QE + Credits ======= -- To view, visit https://gerrit.osmocom.org/5635 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iacf7c4b13b0e32ea7761b859f7422ab630c8616f Gerrit-PatchSet: 2 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:22:01 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 08:22:01 +0000 Subject: gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Max Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:23:22 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 08:23:22 +0000 Subject: gr-gsm[master]: I've got the "abandon" button, but the point of this patch w... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 This was a result of me clicking the "floow up" button instead of "reply". Rejecting it then :). -- To view, visit https://gerrit.osmocom.org/5776 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb4ffab11837f6381e88f61e568e523609a34bca Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Piotr Krysik Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 08:43:29 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 08:43:29 +0000 Subject: gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Patch Set 1: > Patch Set 1: Code-Review-2 Feel free to 'Abandon' this change. No need to keep it anymore ;) -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Max Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:04:36 2018 From: gerrit-no-reply at lists.osmocom.org (Piotr Krysik) Date: Wed, 17 Jan 2018 09:04:36 +0000 Subject: [ABANDON] gr-gsm[master]: Just a change to be discarded in gerrit In-Reply-To: References: Message-ID: Piotr Krysik has abandoned this change. Change subject: Just a change to be discarded in gerrit ...................................................................... Abandoned Rejected it, now lets abandon it :) -- To view, visit https://gerrit.osmocom.org/5690 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ice89f3757e9ef672e7b8910f19d5e9512f94ba04 Gerrit-PatchSet: 1 Gerrit-Project: gr-gsm Gerrit-Branch: master Gerrit-Owner: Piotr Krysik Gerrit-Reviewer: Max Gerrit-Reviewer: Piotr Krysik Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:10:53 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 09:10:53 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: parse all SS info elements in a message In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5839 to look at the new patch set (#2). gsm0480: parse all SS info elements in a message Some SS messages (e.g. RELEASE COMPLETE) may contai multiple IEs (Information Elements). Let's parse them all. Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 --- M src/gsm/gsm0480.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/5839/2 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index e3856a5..0f30250 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -334,11 +334,15 @@ uint8_t iei; uint8_t iei_length; + /* We need at least two bytes */ + if (len < 2) + return 0; + iei = ss_ie[0]; iei_length = ss_ie[1]; /* If the data does not fit, report an error */ - if (len - 2 < iei_length) + if (iei_length + 2 > len) return 0; switch (iei) { @@ -356,6 +360,11 @@ break; } + /* A message may contain multiple IEs */ + if (iei_length + 2 + 2 < len) + rc &= parse_ss_info_elements(ss_ie + iei_length + 2, + len - iei_length - 2, req); + return rc; } -- To view, visit https://gerrit.osmocom.org/5839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 09:10:57 +0000 Subject: [PATCH] libosmocore[master]: tests/ussd: fix wrong GSM 04.80 payload length Message-ID: Review at https://gerrit.osmocom.org/5841 tests/ussd: fix wrong GSM 04.80 payload length Previously the same length value was used for both ussd_request and interrogate_ss payloads, despite they are different. Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d --- M tests/ussd/ussd_test.c 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/5841/1 diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index bf6d731..8d88dbb 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -120,24 +120,28 @@ int main(int argc, char **argv) { struct ss_request req; - const int size = sizeof(ussd_request); + uint16_t size; int i; struct msgb *msg; osmo_init_logging(&info); memset(&req, 0, sizeof(req)); - gsm0480_decode_ss_request((struct gsm48_hdr *) ussd_request, size, &req); + gsm0480_decode_ss_request((struct gsm48_hdr *) ussd_request, + sizeof(ussd_request), &req); printf("Tested if it still works. Text was: %s\n", req.ussd_text); memset(&req, 0, sizeof(req)); - gsm0480_decode_ss_request((struct gsm48_hdr *) interrogate_ss, size, &req); + gsm0480_decode_ss_request((struct gsm48_hdr *) interrogate_ss, + sizeof(interrogate_ss), &req); OSMO_ASSERT(strlen((char *) req.ussd_text) == 0); OSMO_ASSERT(req.ss_code == 33); printf("interrogateSS CFU text..'%s' code %d\n", req.ussd_text, req.ss_code); printf("Testing parsing a USSD request and truncated versions\n"); + size = sizeof(ussd_request); + for (i = size; i > sizeof(struct gsm48_hdr); --i) { int rc = parse_ussd(&ussd_request[0], i); printf("Result for len=%d is %d\n", i, rc); -- To view, visit https://gerrit.osmocom.org/5841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:27:12 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 09:27:12 +0000 Subject: osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 > the build is failing I wasn't referring to compilation. Have you tried to run it with actual phone and verified that 11-bit RACH was used? The ticket referred to in README is still open. I'd be surprised if adding support to libosmocore would mean that it'll be automatically used in osmo-bts. So if you indeed tested, please share your configs and test setup details in OS#1854. We should first close the ticket and than remove it from readme. -- To view, visit https://gerrit.osmocom.org/5833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:35:13 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 09:35:13 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: > this alone does not work Yes, just like --with-litecell15 won't enable LC15 support. > no longer works on its own? It does, if headers are placed in default include directory (/usr/include). Which is exactly the same behavior as with LC15. I think we should minimize the difference between BTS variants when it comes to ./configure > insist on sane configure option semantics I think that the proposed change is way more sane: having different semantics for similar BTS models is worse than adjusting build once. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:38:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:38:58 +0000 Subject: osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 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-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:40:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 09:40:59 +0000 Subject: [MERGED] osmo-bts[master]: Move sysmobts-calib into osmo-bts-sysmo In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Move sysmobts-calib into osmo-bts-sysmo ...................................................................... Move sysmobts-calib into osmo-bts-sysmo It's prerequisite for jenkins tests fix after migration to stow. The sysmobts-calib uses hand-coded Makefile instead of automake which makes it hard to properly propagate build flags. Also, make it optional to enable excluding it from certain jenkins tests. Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 --- M .gitignore M Makefile.am M configure.ac M contrib/jenkins_sysmobts.sh D contrib/sysmobts-calib/Makefile M src/osmo-bts-sysmo/Makefile.am R src/osmo-bts-sysmo/misc/sysmobts-calib.c R src/osmo-bts-sysmo/misc/sysmobts-layer1.c R src/osmo-bts-sysmo/misc/sysmobts-layer1.h 9 files changed, 20 insertions(+), 19 deletions(-) Approvals: Max: Looks good to me, but someone else must approve; Verified Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved diff --git a/.gitignore b/.gitignore index 2e8c884..1780e1c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,8 +22,7 @@ core core.* -contrib/sysmobts-calib/sysmobts-calib - +src/osmo-bts-sysmo/sysmobts-calib src/osmo-bts-sysmo/l1fwd-proxy src/osmo-bts-sysmo/osmo-bts-sysmo src/osmo-bts-sysmo/osmo-bts-sysmo-remote diff --git a/Makefile.am b/Makefile.am index 4832c84..dc42574 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,10 +7,6 @@ EXTRA_DIST = \ 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 \ - contrib/sysmobts-calib/sysmobts-layer1.c \ - contrib/sysmobts-calib/sysmobts-layer1.h \ doc/examples/sysmo/osmo-bts.cfg \ doc/examples/sysmo/sysmobts-mgr.cfg \ doc/examples/virtual/openbsc-virtual.cfg \ diff --git a/configure.ac b/configure.ac index 89443d0..2181743 100644 --- a/configure.ac +++ b/configure.ac @@ -54,6 +54,14 @@ PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0) PKG_CHECK_MODULES(ORTP, ortp) +AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool]) +AC_ARG_ENABLE(sysmobts-calib, + AC_HELP_STRING([--enable-sysmobts-calib], + [enable code for sysmobts calibration tool [default=no]]), + [enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"]) +AC_MSG_RESULT([$enable_sysmobts_calib]) +AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes") + AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support]) AC_ARG_ENABLE(sysmocom-bts, AC_HELP_STRING([--enable-sysmocom-bts], diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index faeb7c9..852542b 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -18,11 +18,11 @@ configure_flags="--enable-sysmocom-bts" -build_bts "osmo-bts-sysmo" "$configure_flags" - # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then - $MAKE -C contrib/sysmobts-calib + configure_flags="$configure_flags --enable-sysmobts-calib" fi +build_bts "osmo-bts-sysmo" "$configure_flags" + osmo-clean-workspace.sh diff --git a/contrib/sysmobts-calib/Makefile b/contrib/sysmobts-calib/Makefile deleted file mode 100644 index a5d4b99..0000000 --- a/contrib/sysmobts-calib/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror -LIBS=`pkg-config --libs libosmocore libosmogsm` - -all: sysmobts-calib - -sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o - $(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS) - -clean: - @rm -f sysmobts-calib *.o diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index c48b77c..6e917e7 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -4,6 +4,7 @@ EXTRA_DIST = misc/sysmobts_mgr.h misc/sysmobts_misc.h misc/sysmobts_par.h \ misc/sysmobts_eeprom.h misc/sysmobts_nl.h femtobts.h hw_misc.h \ + misc/sysmobts-layer1.h \ l1_fwd.h l1_if.h l1_transp.h eeprom.h utils.h oml_router.h bin_PROGRAMS = osmo-bts-sysmo osmo-bts-sysmo-remote l1fwd-proxy sysmobts-mgr sysmobts-util @@ -20,6 +21,13 @@ l1fwd_proxy_SOURCES = l1_fwd_main.c l1_transp_hw.c l1fwd_proxy_LDADD = $(top_builddir)/src/common/libbts.a $(COMMON_LDADD) +if ENABLE_SYSMOBTS_CALIB +bin_PROGRAMS = sysmobts-calib + +sysmobts_calib_SOURCES = misc/sysmobts-calib.c misc/sysmobts-layer1.c +sysmobts_calib_LDADD = -lrt $(COMMON_LDADD) +endif + sysmobts_mgr_SOURCES = \ misc/sysmobts_mgr.c misc/sysmobts_misc.c \ misc/sysmobts_par.c misc/sysmobts_nl.c \ diff --git a/contrib/sysmobts-calib/sysmobts-calib.c b/src/osmo-bts-sysmo/misc/sysmobts-calib.c similarity index 100% rename from contrib/sysmobts-calib/sysmobts-calib.c rename to src/osmo-bts-sysmo/misc/sysmobts-calib.c diff --git a/contrib/sysmobts-calib/sysmobts-layer1.c b/src/osmo-bts-sysmo/misc/sysmobts-layer1.c similarity index 100% rename from contrib/sysmobts-calib/sysmobts-layer1.c rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.c diff --git a/contrib/sysmobts-calib/sysmobts-layer1.h b/src/osmo-bts-sysmo/misc/sysmobts-layer1.h similarity index 100% rename from contrib/sysmobts-calib/sysmobts-layer1.h rename to src/osmo-bts-sysmo/misc/sysmobts-layer1.h -- To view, visit https://gerrit.osmocom.org/5827 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:42:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:42:23 +0000 Subject: libosmocore[master]: fsm: fix double llist_del in osmo_fsm_inst_term() In-Reply-To: References: Message-ID: Patch Set 1: llist_del Form an empty list is a safe Operation. So is tzhis a purely cosmetic fix orcdid you See any real world issue? -- To view, visit https://gerrit.osmocom.org/5831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:44:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:44:14 +0000 Subject: libosmocore[master]: fsm: add function osmo_fsm_inst_set_parent() In-Reply-To: References: Message-ID: Patch Set 1: Lets cxall it change patent, not set -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:44:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:44:54 +0000 Subject: libosmocore[master]: Log lapd_datalink state on errors In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:45:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:45:36 +0000 Subject: osmo-bts[master]: Enable optional static builds In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda 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 Jan 17 09:46:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:46:18 +0000 Subject: osmo-ggsn[master]: Add GTP message names In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn 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 Jan 17 09:47:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 09:47:48 +0000 Subject: [MERGED] libosmocore[master]: Log lapd_datalink state on errors In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Log lapd_datalink state on errors ...................................................................... Log lapd_datalink state on errors It's not very useful to get just the raw pointer address in case of lapd_datalink receive error. Log it's state in addition. Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 --- M src/gsm/lapd_core.c 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/lapd_core.c b/src/gsm/lapd_core.c index 5d87154..a2ff230 100644 --- a/src/gsm/lapd_core.c +++ b/src/gsm/lapd_core.c @@ -1505,7 +1505,7 @@ /* G.2.2 Wrong value of the C/R bit */ if (lctx->cr == dl->cr.rem2loc.resp) { LOGP(DLLAPD, LOGL_ERROR, - "I frame response not allowed (dl=%p)\n", dl); + "I frame response not allowed (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_FRM_UNIMPL, lctx); return -EINVAL; @@ -1517,7 +1517,7 @@ * primitive with cause "I frame with incorrect length" * is sent to the mobile management entity. */ LOGP(DLLAPD, LOGL_ERROR, - "I frame length not allowed (dl=%p)\n", dl); + "I frame length not allowed (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_LEN, lctx); return -EIO; @@ -1529,7 +1529,7 @@ * mobile management entity. */ if (lctx->more && length < lctx->n201) { LOGP(DLLAPD, LOGL_ERROR, - "I frame with M bit too short (dl=%p)\n", dl); + "I frame with M bit too short (dl=%p state %s)\n", dl, lapd_state_name(dl->state)); msgb_free(msg); mdl_error(MDL_CAUSE_IFRM_INC_MBITS, lctx); return -EIO; @@ -1545,7 +1545,7 @@ case LAPD_STATE_SABM_SENT: case LAPD_STATE_DISC_SENT: LOGP(DLLAPD, LOGL_NOTICE, - "I frame ignored in this state (dl=%p)\n", dl); + "I frame ignored in state %s (dl=%p)\n", lapd_state_name(dl->state), dl); msgb_free(msg); return 0; } @@ -1553,7 +1553,7 @@ /* 5.7.1: N(s) sequence error */ if (ns != dl->v_recv) { LOGP(DLLAPD, LOGL_NOTICE, "N(S) sequence error: N(S)=%u, " - "V(R)=%u (dl=%p)\n", ns, dl->v_recv, dl); + "V(R)=%u (dl=%p state %s)\n", ns, dl->v_recv, dl, lapd_state_name(dl->state)); /* discard data */ msgb_free(msg); if (dl->seq_err_cond != 1) { -- To view, visit https://gerrit.osmocom.org/5829 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie8c5df262312f886f509113f2707e36811df3bd5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:47:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 09:47:59 +0000 Subject: [MERGED] osmo-ggsn[master]: Add GTP message names In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add GTP message names ...................................................................... Add GTP message names Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e --- M gtp/gtp.c M gtp/gtp.h 2 files changed, 51 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index b36e0c6..0d6d896 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -86,6 +86,51 @@ return VERSION; } +const struct value_string gtp_type_names[] = { + { GTP_ECHO_REQ, "Echo Request" }, + { GTP_ECHO_RSP, "Echo Response" }, + { GTP_NOT_SUPPORTED, "Version Not Supported" }, + { GTP_ALIVE_REQ, "Node Alive Request" }, + { GTP_ALIVE_RSP, "Node Alive Response" }, + { GTP_REDIR_REQ, "Redirection Request" }, + { GTP_REDIR_RSP, "Redirection Response" }, + { GTP_CREATE_PDP_REQ, "Create PDP Context Request" }, + { GTP_CREATE_PDP_RSP, "Create PDP Context Response" }, + { GTP_UPDATE_PDP_REQ, "Update PDP Context Request" }, + { GTP_UPDATE_PDP_RSP, "Update PDP Context Response" }, + { GTP_DELETE_PDP_REQ, "Delete PDP Context Request" }, + { GTP_DELETE_PDP_RSP, "Delete PDP Context Response" }, + { GTP_ERROR, "Error Indication" }, + { GTP_PDU_NOT_REQ, "PDU Notification Request" }, + { GTP_PDU_NOT_RSP, "PDU Notification Response" }, + { GTP_PDU_NOT_REJ_REQ, "PDU Notification Reject Request" }, + { GTP_PDU_NOT_REJ_RSP, "PDU Notification Reject Response" }, + { GTP_SUPP_EXT_HEADER, "Supported Extension Headers Notification" }, + { GTP_SND_ROUTE_REQ, "Send Routeing Information for GPRS Request" }, + { GTP_SND_ROUTE_RSP, "Send Routeing Information for GPRS Response" }, + { GTP_FAILURE_REQ, "Failure Report Request" }, + { GTP_FAILURE_RSP, "Failure Report Response" }, + { GTP_MS_PRESENT_REQ, "Note MS GPRS Present Request" }, + { GTP_MS_PRESENT_RSP, "Note MS GPRS Present Response" }, + { GTP_IDEN_REQ, "Identification Request" }, + { GTP_IDEN_RSP, "Identification Response" }, + { GTP_SGSN_CONTEXT_REQ,"SGSN Context Request" }, + { GTP_SGSN_CONTEXT_RSP,"SGSN Context Response" }, + { GTP_SGSN_CONTEXT_ACK,"SGSN Context Acknowledge" }, + { GTP_FWD_RELOC_REQ, "Forward Relocation Request" }, + { GTP_FWD_RELOC_RSP, "Forward Relocation Response" }, + { GTP_FWD_RELOC_COMPL, "Forward Relocation Complete" }, + { GTP_RELOC_CANCEL_REQ,"Relocation Cancel Request" }, + { GTP_RELOC_CANCEL_RSP,"Relocation Cancel Response" }, + { GTP_FWD_SRNS, "Forward SRNS Context" }, + { GTP_FWD_RELOC_ACK, "Forward Relocation Complete Acknowledge" }, + { GTP_FWD_SRNS_ACK, "Forward SRNS Context Acknowledge" }, + { GTP_DATA_TRAN_REQ, "Data Record Transfer Request" }, + { GTP_DATA_TRAN_RSP, "Data Record Transfer Response" }, + { GTP_GPDU, "G-PDU" }, + { 0, NULL } +}; + /* gtp_new */ /* gtp_free */ diff --git a/gtp/gtp.h b/gtp/gtp.h index d189ded..8f8e293 100644 --- a/gtp/gtp.h +++ b/gtp/gtp.h @@ -12,6 +12,8 @@ #ifndef _GTP_H #define _GTP_H +#include + #define GTP_MODE_GGSN 1 #define GTP_MODE_SGSN 2 @@ -85,6 +87,10 @@ /* 242-254 For future use. */ #define GTP_GPDU 255 /* G-PDU */ +extern const struct value_string gtp_type_names[]; +static inline const char *gtp_type_name(uint8_t val) +{ return get_value_string(gtp_type_names, val); } + /* GTP information element cause codes from 29.060 v3.9.0 7.7 */ /* */ #define GTPCAUSE_REQ_IMSI 0 /* Request IMSI */ -- To view, visit https://gerrit.osmocom.org/5758 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I65eb80db4bcdc6da4d267bef3b907d3f98942a2e Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:49:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:49:28 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: I leave it up to neels. We shouldn't break existing semantics -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:50:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:50:38 +0000 Subject: osmo-bsc[master]: Split paging cases in bssmap_handle_paging() off into helper... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Very nice -- To view, visit https://gerrit.osmocom.org/5826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8fdf425145791f4904a70e295bdc3c7d0f4d5f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:51:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:51:13 +0000 Subject: osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:51:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:51:16 +0000 Subject: [MERGED] osmo-trx[master]: tests: convolve: Disable due to difference in output in diff... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: convolve: Disable due to difference in output in different archs ...................................................................... tests: convolve: Disable due to difference in output in different archs Let's disable this test in order to have passing jenkins jobs until we find a better way to properly test this for different architectures. Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb --- M tests/testsuite.at 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Alexander Chemeris: I would prefer this is not merged as is diff --git a/tests/testsuite.at b/tests/testsuite.at index ca979e5..f84225e 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -46,8 +46,8 @@ AT_SETUP([convolve_test]) AT_KEYWORDS([convolve_test]) -# Disabled for ARM builds as it gives different output than x86, see OS#2826 -AT_SKIP_IF(! uname -m | grep x86) +# Different results for i686, x86_64 and ARM. see OS#2826, OS#2828, and https://lists.osmocom.org/pipermail/openbsc/2018-January/011655.html +AT_SKIP_IF(true) cat $abs_srcdir/Transceiver52M/convolve_test.ok > expout AT_CHECK([$abs_top_builddir/tests/Transceiver52M/convolve_test], [], [expout], []) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5817 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2320309bc8c1c20e2de6ef2e0f17472c68de80cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: fixeria Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:52:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:52:48 +0000 Subject: osmo-bsc[master]: handover_decision: log HO causes more accurately In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:53:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:53:12 +0000 Subject: [MERGED] osmo-bsc[master]: handover_decision: log HO causes more accurately In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: handover_decision: log HO causes more accurately ...................................................................... handover_decision: log HO causes more accurately Tweaked-by: nhofmeyr at sysmocom.de Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 --- M src/libbsc/handover_decision.c 1 file changed, 15 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index c637e25..3bca05f 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -230,7 +230,7 @@ rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); switch (rc) { case 0: - LOGPC(DHO, LOGL_INFO, "Starting handover\n"); + LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); break; case -ENOSPC: LOGPC(DHO, LOGL_INFO, "No channel available\n"); @@ -278,20 +278,30 @@ /* Interference HO */ if (rxlev2dbm(av_rxlev) > -85 && - meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) + meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Interference HO av_rxlev=%d dBm\n", + rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Bad Quality */ - if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) + if (meas_rep_n_out_of_m_be(mr->lchan, dqual, 3, 4, 5)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Bad Quality av_rxlev=%d dBm\n", rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Low Level */ - if (rxlev2dbm(av_rxlev) <= -110) + if (rxlev2dbm(av_rxlev) <= -110) { + LOGPC(DHO, LOGL_INFO, "HO cause: Low Level av_rxlev=%d dBm\n", rxlev2dbm(av_rxlev)); return attempt_handover(mr); + } /* Distance */ - if (mr->ms_l1.ta > net->handover.max_distance) + if (mr->ms_l1.ta > net->handover.max_distance) { + LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%u\n", + rxlev2dbm(av_rxlev), mr->ms_l1.ta); return attempt_handover(mr); + } /* Power Budget AKA Better Cell */ if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) -- To view, visit https://gerrit.osmocom.org/5802 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib0a0787ac8b877ac63455d72886389b546e7a337 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:53:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:53:13 +0000 Subject: [MERGED] osmo-bsc[master]: handover_decision: Fix condition for power budget handover a... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: handover_decision: Fix condition for power budget handover attempt ...................................................................... handover_decision: Fix condition for power budget handover attempt Handover attempt for power budget case should be performed every N SACCH frames, where N = Power Budget Interval. First measurement report with mr->nr = 0 was used for the first handover attempt in this case, which is not correct, because first usable report should have mr->nr = net->handover.pwr_interval-1. Moreover using the first measurement report with mr->nr = 0 for handover attempt could lead to unnecessary handover, because usually av_rxlev for first measurement report from MS is worse than for following reports. Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e --- M src/libbsc/handover_decision.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 09c7eaa..c637e25 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -294,7 +294,7 @@ return attempt_handover(mr); /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == 0) + if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) return attempt_handover(mr); return 0; -- To view, visit https://gerrit.osmocom.org/5801 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7f54a4cb179eaa9e5eb147b9477633ac618e69e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:54:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:54:53 +0000 Subject: libosmocore[master]: logging: add ability to log the log-level with API and vty In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 09:55:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 09:55:13 +0000 Subject: libosmocore[master]: logging: color the log level In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2e52ae9ab83e538e04321c338e3fdffb2c7f9d3 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:01:53 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Wed, 17 Jan 2018 10:01:53 +0000 Subject: [MERGED] osmo-bsc[master]: Split paging cases in bssmap_handle_paging() off into helper... In-Reply-To: References: Message-ID: Stefan Sperling has submitted this change and it was merged. Change subject: Split paging cases in bssmap_handle_paging() off into helper functions. ...................................................................... Split paging cases in bssmap_handle_paging() off into helper functions. This is mostly no-op code refactoring which makes it easier to maintain the code for each paging case and reduces the scope of several local variables. Also, ensure that paging failures where no matching BTS was found are logged consistently in all cases. The log level changes from ERROR to NOTICE since this is not necessarily a fatal condition. Change-Id: If8fdf425145791f4904a70e295bdc3c7d0f4d5f6 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 186 insertions(+), 130 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 1894561..799cb46 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -273,6 +273,179 @@ return gsm48_decode_lai(&lai, mcc, mnc, lac) != 0 ? -1 : 0; } +static void +page_all_bts(struct bsc_msc_data *msc, uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + /* ignore errors from page_subscriber(); try all BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + } +} + +static void +page_cgi(struct bsc_msc_data *msc, const uint8_t *data, uint8_t data_length, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t ci; + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { + uint16_t mcc, mnc, lac, *ci_be; + size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); + if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + page_all_bts(msc, tmsi, mi_string, chan_needed); + return; + } + ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); + ci = osmo_load16be(ci_be); + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d and CI %d not found\n", + mi_string, lac, ci); + } + } else { + LOGP(DMSC, LOGL_DEBUG, "Paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + } + remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); + i++; + } +} + +static void +page_lac_and_ci(struct bsc_msc_data *msc, const uint8_t *data, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t *lacp_be, *ci_be; + lacp_be = (uint16_t *)(&data[1]); + ci_be = (uint16_t *)(&data[3]); + while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) { + uint16_t lac = osmo_load16be(lacp_be); + uint16_t ci = osmo_load16be(ci_be); + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + if (bts->cell_identity != ci) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d and CI %d not found\n", + mi_string, lac, ci); + } + remain -= sizeof(*lacp_be) + sizeof(*ci_be); + lacp_be++; + ci_be++; + } +} + +static void +page_ci(struct bsc_msc_data *msc, const uint8_t *data, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t *ci_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*ci_be)) { + uint16_t ci = osmo_load16be(ci_be); + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->cell_identity != ci) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with CI %d not found\n", + mi_string, ci); + } + remain -= sizeof(*ci_be); + ci_be++; + } +} + +static void +page_lai_and_lac(struct bsc_msc_data *msc, const uint8_t *data, size_t data_length, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + int i = 0; + while (remain >= sizeof(struct gsm48_loc_area_id)) { + uint16_t mcc, mnc, lac; + if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { + LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " + "for BSS (0x%x), paging entire BSS anyway (%s)\n", + mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); + page_all_bts(msc, tmsi, mi_string, chan_needed); + return; + } + if (mcc == msc->network->country_code && mnc == msc->network->network_code) { + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d not found\n", + mi_string, lac); + } + } else { + LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, + msc->network->country_code, msc->network->network_code); + } + remain -= sizeof(struct gsm48_loc_area_id); + i++; + } +} + +static void +page_lac(struct bsc_msc_data *msc, const uint8_t *data, size_t remain, + uint32_t tmsi, const char *mi_string, uint8_t chan_needed) +{ + uint16_t *lacp_be = (uint16_t *)(&data[1]); + while (remain >= sizeof(*lacp_be)) { + uint16_t lac = osmo_load16be(lacp_be); + int paged = 0; + struct gsm_bts *bts; + llist_for_each_entry(bts, &msc->network->bts_list, list) { + if (bts->location_area_code != lac) + continue; + /* ignore errors from page_subscriber(); keep trying other BTS */ + page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); + paged = 1; + } + if (!paged) { + LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: BTS with LAC %d not found\n", + mi_string, lac); + } + remain -= sizeof(*lacp_be); + lacp_be++; + } +} + /* GSM 08.08 ? 3.2.1.19 */ static int bssmap_handle_paging(struct bsc_msc_data *msc, struct msgb *msg, unsigned int payload_length) @@ -280,15 +453,11 @@ struct tlv_parsed tp; char mi_string[GSM48_MI_SIZE]; uint32_t tmsi = GSM_RESERVED_TMSI; - uint16_t lac, *lacp_be; - uint16_t mcc; - uint16_t mnc; uint8_t data_length; int remain; const uint8_t *data; uint8_t chan_needed = RSL_CHANNEED_ANY; uint8_t cell_ident; - struct gsm_bts *bts; tlv_parse(&tp, gsm0808_att_tlvdef(), msg->l4h + 1, payload_length - 1, 0, 0); remain = payload_length - 1; @@ -353,136 +522,29 @@ cell_ident = data[0] & 0xf; remain -= 1; /* cell ident consumed */ - /* Default fallback: page entire BSS */ - lac = GSM_LAC_RESERVED_ALL_BTS; - switch (cell_ident) { case CELL_IDENT_NO_CELL: LOGP(DMSC, LOGL_NOTICE, "Ignoring no-op paging request for IMSI %s\n", mi_string); return 0; /* nothing to do */ - case CELL_IDENT_WHOLE_GLOBAL: { - uint16_t ci; - int i = 0; - while (remain >= sizeof(struct gsm48_loc_area_id) + sizeof(ci)) { - uint16_t *ci_be; - size_t lai_offset = 1 + i * (sizeof(struct gsm48_loc_area_id) + sizeof(ci)); - if (decode_lai(&data[lai_offset], &mcc, &mnc, &lac) != 0) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " - "for BSS (0x%x), paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); - lac = GSM_LAC_RESERVED_ALL_BTS; - break; - } - ci_be = (uint16_t *)(&data[lai_offset + sizeof(struct gsm48_loc_area_id)]); - ci = osmo_load16be(ci_be); - if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - if (bts->cell_identity != ci) - continue; - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) - break; - } - } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " - "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, - msc->network->country_code, msc->network->network_code); - } - remain -= sizeof(struct gsm48_loc_area_id) + sizeof(ci); - i++; - } - } - - case CELL_IDENT_LAC_AND_CI: { - uint16_t ci, *ci_be; - lacp_be = (uint16_t *)(&data[1]); - ci_be = (uint16_t *)(&data[3]); - while (remain >= sizeof(*lacp_be) + sizeof(*ci_be)) { - lac = osmo_load16be(lacp_be); - ci = osmo_load16be(ci_be); - - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - if (bts->cell_identity != ci) - continue; - if (page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed) < 0) - break; - } - - remain -= sizeof(*lacp_be) + sizeof(*ci_be); - lacp_be++; - ci_be++; - } + case CELL_IDENT_WHOLE_GLOBAL: + page_cgi(msc, data, data_length, remain, tmsi, mi_string, chan_needed); break; - } - case CELL_IDENT_CI: { - uint16_t *ci_be = (uint16_t *)(&data[1]); - while (remain >= sizeof(*ci_be)) { - uint16_t ci = osmo_load16be(ci_be); - - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->cell_identity == ci) - break; - } - - if (bts) { - /* ignore errors from page_subscriber(); keep trying other BTS */ - page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); - } else { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: BTS with cell identifier %d not found\n", - mi_string, ci); - } - remain -= sizeof(*ci_be); - ci_be++; - } + case CELL_IDENT_LAC_AND_CI: + page_lac_and_ci(msc, data, remain, tmsi, mi_string, chan_needed); break; - } - case CELL_IDENT_LAI_AND_LAC: { - int i = 0; - while (remain >= sizeof(struct gsm48_loc_area_id)) { - if (decode_lai(&data[1 + i * sizeof(struct gsm48_loc_area_id)], &mcc, &mnc, &lac) != 0) { - LOGP(DMSC, LOGL_ERROR, "Paging IMSI %s: Invalid LAI in Cell Identifier List " - "for BSS (0x%x), paging entire BSS anyway (%s)\n", - mi_string, CELL_IDENT_BSS, osmo_hexdump(data, data_length)); - lac = GSM_LAC_RESERVED_ALL_BTS; - break; - } - if (mcc == msc->network->country_code && mnc == msc->network->network_code) { - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - /* ignore errors from page_subscriber(); keep trying other BTS */ - page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); - } - } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " - "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, - msc->network->country_code, msc->network->network_code); - } - remain -= sizeof(struct gsm48_loc_area_id); - i++; - } + case CELL_IDENT_CI: + page_ci(msc, data, remain, tmsi, mi_string, chan_needed); break; - } + + case CELL_IDENT_LAI_AND_LAC: + page_lai_and_lac(msc, data, data_length, remain, tmsi, mi_string, chan_needed); + break; case CELL_IDENT_LAC: - lacp_be = (uint16_t *)(&data[1]); - while (remain >= sizeof(*lacp_be)) { - lac = osmo_load16be(lacp_be); - llist_for_each_entry(bts, &msc->network->bts_list, list) { - if (bts->location_area_code != lac) - continue; - /* ignore errors from page_subscriber(); keep trying other BTS */ - page_subscriber(msc, bts, tmsi, lac, mi_string, chan_needed); - } - remain -= sizeof(*lacp_be); - lacp_be++; - } + page_lac(msc, data, remain, tmsi, mi_string, chan_needed); break; case CELL_IDENT_BSS: @@ -491,20 +553,14 @@ " has invalid length: %u, paging entire BSS anyway (%s)\n", mi_string, CELL_IDENT_BSS, data_length, osmo_hexdump(data, data_length)); } - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* ignore errors from page_subscriber(); try all BTS */ - page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); - } + page_all_bts(msc, tmsi, mi_string, chan_needed); break; default: LOGP(DMSC, LOGL_NOTICE, "Paging IMSI %s: unimplemented Cell Identifier List (0x%x)," " paging entire BSS instead (%s)\n", mi_string, cell_ident, osmo_hexdump(data, data_length)); - llist_for_each_entry(bts, &msc->network->bts_list, list) { - /* ignore errors from page_subscriber(); try all BTS */ - page_subscriber(msc, bts, tmsi, GSM_LAC_RESERVED_ALL_BTS, mi_string, chan_needed); - } + page_all_bts(msc, tmsi, mi_string, chan_needed); break; } -- To view, visit https://gerrit.osmocom.org/5826 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8fdf425145791f4904a70e295bdc3c7d0f4d5f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:40:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:40:03 +0000 Subject: libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Wed Jan 17 10:40:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:40:28 +0000 Subject: libosmocore[master]: gsm0480: fix USSD OCTET STRING length confusion In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:42:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:42:34 +0000 Subject: libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:42:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:42:47 +0000 Subject: libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:43:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:43:02 +0000 Subject: libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:43:58 +0000 Subject: libosmocore[master]: gsm0480: add specification reference to SS message type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff0210e995053e270939a774db33f55b22545204 Gerrit-PatchSet: 1 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 Wed Jan 17 10:44:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:44:19 +0000 Subject: libosmocore[master]: gsm0480: pass exact GSM 04.80 payload length to parse_ss() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4 Gerrit-PatchSet: 1 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 Wed Jan 17 10:44:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:44:30 +0000 Subject: libosmocore[master]: gsm0480: move SS request length check to parse_ss() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc Gerrit-PatchSet: 1 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 Wed Jan 17 10:44:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:44:42 +0000 Subject: libosmocore[master]: gsm0480: refactor gsm0480_decode_ss_request In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1 Gerrit-PatchSet: 1 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 Wed Jan 17 10:44:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:44:50 +0000 Subject: libosmocore[master]: gsm0480: correct parse_ss_info_elements() declaration In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64df293188908c7eb10a61941db76656340d3a8e Gerrit-PatchSet: 1 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 Wed Jan 17 10:45:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:10 +0000 Subject: libosmocore[master]: tests/ussd: fix wrong GSM 04.80 payload length In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d Gerrit-PatchSet: 1 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 Wed Jan 17 10:45:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:20 +0000 Subject: libosmocore[master]: gsm0480: parse all SS info elements in a message In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 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 Wed Jan 17 10:45:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:29 +0000 Subject: libosmocore[master]: gsm0480: parse optional IEs for RELEASE COMPLETE message In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222 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 Wed Jan 17 10:45:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:41 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: parse optional IEs for RELEASE COMPLETE message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: parse optional IEs for RELEASE COMPLETE message ...................................................................... gsm0480: parse optional IEs for RELEASE COMPLETE message According to GSM 04.80 section 2.5 "Release complete", a message of the mentioned type may contain optional IEs, such as Cause and Facility. Let's parse them. Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222 --- M src/gsm/gsm0480.c 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 0f30250..0072812 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -295,7 +295,11 @@ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); - /* could also parse out the optional Cause/Facility data */ + + /* Parse optional Cause and/or Facility data */ + if (len >= 2) + rc &= parse_ss_info_elements(&hdr->data[0], len, req); + req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: -- To view, visit https://gerrit.osmocom.org/5840 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8fc1f6bae472b0b264b6158f372b6cce255b222 Gerrit-PatchSet: 3 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 Wed Jan 17 10:45:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:41 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: parse all SS info elements in a message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: parse all SS info elements in a message ...................................................................... gsm0480: parse all SS info elements in a message Some SS messages (e.g. RELEASE COMPLETE) may contai multiple IEs (Information Elements). Let's parse them all. Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 --- M src/gsm/gsm0480.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index e3856a5..0f30250 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -334,11 +334,15 @@ uint8_t iei; uint8_t iei_length; + /* We need at least two bytes */ + if (len < 2) + return 0; + iei = ss_ie[0]; iei_length = ss_ie[1]; /* If the data does not fit, report an error */ - if (len - 2 < iei_length) + if (iei_length + 2 > len) return 0; switch (iei) { @@ -356,6 +360,11 @@ break; } + /* A message may contain multiple IEs */ + if (iei_length + 2 + 2 < len) + rc &= parse_ss_info_elements(ss_ie + iei_length + 2, + len - iei_length - 2, req); + return rc; } -- To view, visit https://gerrit.osmocom.org/5839 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I20cc59c25fdbda176bcf76437174cda829518d60 Gerrit-PatchSet: 3 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 Wed Jan 17 10:45:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:41 +0000 Subject: [MERGED] libosmocore[master]: tests/ussd: fix wrong GSM 04.80 payload length In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests/ussd: fix wrong GSM 04.80 payload length ...................................................................... tests/ussd: fix wrong GSM 04.80 payload length Previously the same length value was used for both ussd_request and interrogate_ss payloads, despite they are different. Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d --- M tests/ussd/ussd_test.c 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index bf6d731..8d88dbb 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -120,24 +120,28 @@ int main(int argc, char **argv) { struct ss_request req; - const int size = sizeof(ussd_request); + uint16_t size; int i; struct msgb *msg; osmo_init_logging(&info); memset(&req, 0, sizeof(req)); - gsm0480_decode_ss_request((struct gsm48_hdr *) ussd_request, size, &req); + gsm0480_decode_ss_request((struct gsm48_hdr *) ussd_request, + sizeof(ussd_request), &req); printf("Tested if it still works. Text was: %s\n", req.ussd_text); memset(&req, 0, sizeof(req)); - gsm0480_decode_ss_request((struct gsm48_hdr *) interrogate_ss, size, &req); + gsm0480_decode_ss_request((struct gsm48_hdr *) interrogate_ss, + sizeof(interrogate_ss), &req); OSMO_ASSERT(strlen((char *) req.ussd_text) == 0); OSMO_ASSERT(req.ss_code == 33); printf("interrogateSS CFU text..'%s' code %d\n", req.ussd_text, req.ss_code); printf("Testing parsing a USSD request and truncated versions\n"); + size = sizeof(ussd_request); + for (i = size; i > sizeof(struct gsm48_hdr); --i) { int rc = parse_ussd(&ussd_request[0], i); printf("Result for len=%d is %d\n", i, rc); -- To view, visit https://gerrit.osmocom.org/5841 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I90ae7c51b75dcdb9d8ee042af23d127e6db8771d 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 Wed Jan 17 10:45:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:42 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: correct parse_ss_info_elements() declaration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: correct parse_ss_info_elements() declaration ...................................................................... gsm0480: correct parse_ss_info_elements() declaration Change-Id: I64df293188908c7eb10a61941db76656340d3a8e --- M src/gsm/gsm0480.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index ca00999..e3856a5 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -198,7 +198,7 @@ uint16_t len, struct ss_request *req); static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, struct ss_request *req); -static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, +static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, struct ss_request *req); -- To view, visit https://gerrit.osmocom.org/5838 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64df293188908c7eb10a61941db76656340d3a8e 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 Wed Jan 17 10:45:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:42 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: refactor gsm0480_decode_ss_request In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: refactor gsm0480_decode_ss_request ...................................................................... gsm0480: refactor gsm0480_decode_ss_request Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1 --- M src/gsm/gsm0480.c 1 file changed, 14 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 25f97a2..ca00999 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -255,17 +255,24 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { - int rc = 0; + uint8_t pdisc; - if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { - req->transaction_id = hdr->proto_discr & 0x70; - rc = parse_ss(hdr, len - sizeof(*hdr), req); + /** + * Check Protocol Discriminator + * see TS GSM 04.07 and GSM 04.80 + */ + pdisc = gsm48_hdr_pdisc(hdr); + if (pdisc != GSM48_PDISC_NC_SS) { + LOGP(0, LOGL_ERROR, "Dropping message with " + "unsupported pdisc=%02x\n", pdisc); + return 0; } - if (!rc) - LOGP(0, LOGL_DEBUG, "Error occurred while parsing received SS!\n"); + /* GSM 04.80 3.3 Transaction Identifier */ + req->transaction_id = hdr->proto_discr & 0x70; - return rc; + /* Parse SS request */ + return parse_ss(hdr, len - sizeof(*hdr), req); } static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) -- To view, visit https://gerrit.osmocom.org/5837 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba734db97ab516f8fce816c4e4225b97b93619f1 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 Wed Jan 17 10:45:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:43 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: move SS request length check to parse_ss() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: move SS request length check to parse_ss() ...................................................................... gsm0480: move SS request length check to parse_ss() Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc --- M src/gsm/gsm0480.c 1 file changed, 11 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 75388b9..25f97a2 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -255,19 +255,7 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { - uint8_t msg_type = hdr->msg_type & 0x3F; int rc = 0; - - /** - * GSM 04.80 Section 2.5 'Release complete' Table 2.5 - * payload is optional for 'RELEASE COMPLETE' message - */ - if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { - if (len < sizeof(*hdr) + 2) { - LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); - return 0; - } - } if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { req->transaction_id = hdr->proto_discr & 0x70; @@ -285,6 +273,17 @@ int rc = 1; uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ + /** + * GSM 04.80 Section 2.5 'Release complete' Table 2.5 + * payload is optional for 'RELEASE COMPLETE' message + */ + if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (len < 2) { + LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); + return 0; + } + } + /* Table 2.1: Messages for call independent SS control */ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: -- To view, visit https://gerrit.osmocom.org/5836 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e7ce5bd97f3a8731924264c92afb9a7183937dc 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 Wed Jan 17 10:45:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:43 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: pass exact GSM 04.80 payload length to parse_ss() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: pass exact GSM 04.80 payload length to parse_ss() ...................................................................... gsm0480: pass exact GSM 04.80 payload length to parse_ss() Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4 --- M src/gsm/gsm0480.c 1 file changed, 4 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 8319b19..75388b9 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -232,7 +232,7 @@ req->transaction_id = hdr->proto_discr & 0x70; ss.transaction_id = req->transaction_id; - rc = parse_ss(hdr, len, &ss); + rc = parse_ss(hdr, len - sizeof(*hdr), &ss); /* convert from ss_request to legacy ussd_request */ req->transaction_id = ss.transaction_id; @@ -271,7 +271,7 @@ if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { req->transaction_id = hdr->proto_discr & 0x70; - rc = parse_ss(hdr, len, req); + rc = parse_ss(hdr, len - sizeof(*hdr), req); } if (!rc) @@ -293,10 +293,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + rc &= parse_ss_info_elements(&hdr->data[0], len, req); break; case GSM0480_MTYPE_FACILITY: - rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); + rc &= parse_ss_facility(&hdr->data[0], len, req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", -- To view, visit https://gerrit.osmocom.org/5835 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9608d4ad16d7581320615c140beaac36628c31a4 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 Wed Jan 17 10:45:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:43 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: add specification reference to SS message type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: add specification reference to SS message type ...................................................................... gsm0480: add specification reference to SS message type Change-Id: Iff0210e995053e270939a774db33f55b22545204 --- M src/gsm/gsm0480.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 328a8c0..8319b19 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -285,6 +285,7 @@ int rc = 1; uint8_t msg_type = hdr->msg_type & 0x3F; /* message-type - section 3.4 */ + /* Table 2.1: Messages for call independent SS control */ switch (msg_type) { case GSM0480_MTYPE_RELEASE_COMPLETE: LOGP(0, LOGL_DEBUG, "SS Release Complete\n"); -- To view, visit https://gerrit.osmocom.org/5834 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff0210e995053e270939a774db33f55b22545204 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 Wed Jan 17 10:45:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:44 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: handle GSM0480_CTYPE_RETURN_RESULT ...................................................................... gsm0480: handle GSM0480_CTYPE_RETURN_RESULT Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf --- M src/gsm/gsm0480.c 1 file changed, 82 insertions(+), 0 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 17657c7..fdec3d2 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -204,6 +204,10 @@ struct ss_request *req); static int parse_ss_invoke(const uint8_t *invoke_data, uint16_t length, struct ss_request *req); +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct ss_request *req); +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct ss_request *req); static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req); static int parse_ss_for_bs_req(const uint8_t *ss_req_data, @@ -372,6 +376,9 @@ req); break; case GSM0480_CTYPE_RETURN_RESULT: + rc &= parse_ss_return_result(facility_ie+2, + component_length, + req); break; case GSM0480_CTYPE_RETURN_ERROR: break; @@ -451,6 +458,81 @@ return rc; } +/* Parse a Return Result component - see table 3.4 */ +static int parse_ss_return_result(const uint8_t *rr_data, uint16_t length, + struct ss_request *req) +{ + uint8_t operation_code; + uint8_t offset; + + if (length < 3) + return 0; + + /* Mandatory part */ + if (rr_data[0] != GSM0480_COMPIDTAG_INVOKE_ID) { + LOGP(0, LOGL_DEBUG, "Unexpected GSM 04.80 Component-ID tag " + "0x%02x (expecting Invoke ID tag)\n", rr_data[0]); + return 0; + } + + offset = rr_data[1] + 2; + req->invoke_id = rr_data[2]; + + if (offset >= length) + return 0; + + if (rr_data[offset] != GSM_0480_SEQUENCE_TAG) + return 0; + + if (offset + 2 > length) + return 0; + + offset += 2; + operation_code = rr_data[offset + 2]; + req->opcode = operation_code; + + switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: + case GSM0480_OP_CODE_PROCESS_USS_REQ: + return parse_process_uss_req(rr_data + offset + 3, + length - offset - 3, req); + case GSM0480_OP_CODE_PROCESS_USS_DATA: + return parse_process_uss_data(rr_data + offset + 3, + length - offset - 3, req); + default: + LOGP(0, LOGL_DEBUG, "GSM 04.80 operation code 0x%02x " + "is not yet handled\n", operation_code); + return 0; + } + + return 1; +} + +static int parse_process_uss_data(const uint8_t *uss_req_data, uint16_t length, + struct ss_request *req) +{ + uint8_t num_chars; + + /* we need at least that much */ + if (length < 3) + return 0; + + if (uss_req_data[0] != ASN1_IA5_STRING_TAG) + return 0; + + num_chars = uss_req_data[1]; + if (num_chars > length - 2) + return 0; + + if (num_chars > GSM0480_USSD_OCTET_STRING_LEN) + num_chars = GSM0480_USSD_OCTET_STRING_LEN; + + memcpy(req->ussd_text, uss_req_data + 2, num_chars); + + return 1; +} + /* Parse the parameters of a Process UnstructuredSS Request */ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req) -- To view, visit https://gerrit.osmocom.org/3378 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8fb2856acbbf4c53e7d53200a37bc8f79e763bcf Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:45:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:44 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: handle UnstructuredSS Request with DSC != 0x0F In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: handle UnstructuredSS Request with DSC != 0x0F ...................................................................... gsm0480: handle UnstructuredSS Request with DSC != 0x0F According to GSM 04.08, 4.4.2 "ASN.1 data types": the USSD-DataCodingScheme shall indicate use of the default alphabet using the 0x0F value. Previously, the UnstructuredSS Request messages with not default alphabet were not being handled. Let's fix this. Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 0 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 11c66e9..b0b28e4 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -453,9 +453,18 @@ if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) return 0; + /* Get DCS (Data Coding Scheme) */ dcs = uss_req_data[4]; + + /** + * According to GSM 04.08, 4.4.2 "ASN.1 data types": + * the USSD-DataCodingScheme shall indicate use of + * the default alphabet using the 0x0F value. + */ if (dcs == 0x0F) { + /* Calculate the amount of 7-bit characters */ num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) num_chars = GSM0480_USSD_7BIT_STRING_LEN; @@ -464,6 +473,17 @@ sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); return 1; + } else { + /* Get the amount of 8-bit characters */ + num_chars = uss_req_data[6]; + + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > GSM0480_USSD_OCTET_STRING_LEN) + num_chars = GSM0480_USSD_OCTET_STRING_LEN; + + memcpy(req->ussd_text, &(uss_req_data[7]), num_chars); + + return 1; } return 0; -- To view, visit https://gerrit.osmocom.org/3376 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I73d602f6f20b0afe7600d16bbd432069ae7be788 Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:45:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:45 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: clean up the parse_process_uss_req() code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: clean up the parse_process_uss_req() code ...................................................................... gsm0480: clean up the parse_process_uss_req() code This change reduces the degree of code nesting... Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 --- M src/gsm/gsm0480.c 1 file changed, 20 insertions(+), 19 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index dcf487a..11c66e9 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -439,33 +439,34 @@ static int parse_process_uss_req(const uint8_t *uss_req_data, uint16_t length, struct ss_request *req) { - int rc = 0; - int num_chars; + uint8_t num_chars; uint8_t dcs; - /* we need at least that much */ if (length < 8) return 0; + if (uss_req_data[0] != GSM_0480_SEQUENCE_TAG) + return 0; - if (uss_req_data[0] == GSM_0480_SEQUENCE_TAG) { - if (uss_req_data[2] == ASN1_OCTET_STRING_TAG) { - dcs = uss_req_data[4]; - if ((dcs == 0x0F) && - (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { - num_chars = (uss_req_data[6] * 8) / 7; - /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) - num_chars = GSM0480_USSD_7BIT_STRING_LEN; - gsm_7bit_decode_n_ussd((char *)req->ussd_text, - sizeof(req->ussd_text), - &(uss_req_data[7]), num_chars); - rc = 1; - } - } + /* Both 2th and 5th should be equal to ASN1_OCTET_STRING_TAG */ + if ((uss_req_data[2] & uss_req_data[5]) != ASN1_OCTET_STRING_TAG) + return 0; + + dcs = uss_req_data[4]; + if (dcs == 0x0F) { + num_chars = (uss_req_data[6] * 8) / 7; + /* Prevent a mobile-originated buffer-overrun! */ + if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) + num_chars = GSM0480_USSD_7BIT_STRING_LEN; + + gsm_7bit_decode_n_ussd((char *)req->ussd_text, + sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); + + return 1; } - return rc; + + return 0; } /* Parse the parameters of a Interrogate/Activate/DeactivateSS Request */ -- To view, visit https://gerrit.osmocom.org/3375 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I467f75794c5ac9df75c001245b18bbdfcfaadd88 Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:45:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:46 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: fix USSD OCTET STRING length confusion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: fix USSD OCTET STRING length confusion ...................................................................... gsm0480: fix USSD OCTET STRING length confusion According to the GSM 04.80 (version 5.0.0) specification Annex A "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD OCTET STRING is 160 bytes. Thus according to ETSI TS 123 038 (version 10.0.0) specification 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. The remaining 6 bits are set to zero. This change defines both mentioned values: - GSM0480_USSD_OCTET_STRING_LEN 160 - GSM0480_USSD_7BIT_STRING_LEN 182 keeping the old MAX_LEN_USSD_STRING 'as is' due to compatibility reasons. Now the new value is used for ss_request structure, while old one is still used for deprecated ussd_request structure. Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c 2 files changed, 24 insertions(+), 4 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/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index 672ffe5..0dfd868 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -7,7 +7,27 @@ #include #include -#define MAX_LEN_USSD_STRING 31 +/** + * According to the GSM 04.80 (version 5.0.0) specification Annex A + * "Expanded ASN.1 Module "SS-Protocol", the maximum size of a USSD + * OCTET STRING field is 160 bytes. + */ +#define GSM0480_USSD_OCTET_STRING_LEN 160 + +/** + * Thus according to ETSI TS 123 038 (version 10.0.0) specification + * 6.1.2.3 "USSD packing of 7 bit characters", in 160 octets, it's + * possible to pack (160 * 8) / 7 = 182.8, that is 182 characters. + * The remaining 6 bits are set to zero. + */ +#define GSM0480_USSD_7BIT_STRING_LEN 182 + +/** + * DEPRECATED: this definition doesn't follow any specification, + * so we only keep it for compatibility reasons. It's strongly + * recommended to use correct definitions above. + */ +#define MAX_LEN_USSD_STRING 31 /* deprecated */ struct ussd_request { @@ -23,7 +43,7 @@ struct ss_request { uint8_t opcode; uint8_t ss_code; - uint8_t ussd_text[MAX_LEN_USSD_STRING + 1]; + uint8_t ussd_text[GSM0480_USSD_OCTET_STRING_LEN]; uint8_t transaction_id; uint8_t invoke_id; }; diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d7c2978..dcf487a 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -456,8 +456,8 @@ (uss_req_data[5] == ASN1_OCTET_STRING_TAG)) { num_chars = (uss_req_data[6] * 8) / 7; /* Prevent a mobile-originated buffer-overrun! */ - if (num_chars > MAX_LEN_USSD_STRING) - num_chars = MAX_LEN_USSD_STRING; + if (num_chars > GSM0480_USSD_7BIT_STRING_LEN) + num_chars = GSM0480_USSD_7BIT_STRING_LEN; gsm_7bit_decode_n_ussd((char *)req->ussd_text, sizeof(req->ussd_text), &(uss_req_data[7]), num_chars); -- To view, visit https://gerrit.osmocom.org/5712 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6dead74f9ecea079752ff2400cdaf7c30187784e Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:45:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:46 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: skip length check for 'RELEASE COMPLETE' message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: skip length check for 'RELEASE COMPLETE' message ...................................................................... gsm0480: skip length check for 'RELEASE COMPLETE' message According to GSM 04.80 Section 2.5 'Release complete' Table 2.5, the 'RELEASE COMPLETE' message payload is optional, so let's drop the length check in gsm0480_decode_ss_request() for this type. Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 --- M src/gsm/gsm0480.c 1 file changed, 10 insertions(+), 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 71470e5..d7c2978 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -249,11 +249,18 @@ int gsm0480_decode_ss_request(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req) { + uint8_t msg_type = hdr->msg_type & 0x3F; int rc = 0; - if (len < sizeof(*hdr) + 2) { - LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); - return 0; + /** + * GSM 04.80 Section 2.5 'Release complete' Table 2.5 + * payload is optional for 'RELEASE COMPLETE' message + */ + if (msg_type != GSM0480_MTYPE_RELEASE_COMPLETE) { + if (len < sizeof(*hdr) + 2) { + LOGP(0, LOGL_DEBUG, "SS Request is too short.\n"); + return 0; + } } if (gsm48_hdr_pdisc(hdr) == GSM48_PDISC_NC_SS) { -- To view, visit https://gerrit.osmocom.org/3373 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63b7f8ce403169a9dbdbdb031db16693de2196d6 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:45:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:47 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA ...................................................................... gsm0480: handle GSM0480_OP_CODE_PROCESS_USS_DATA Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 --- M src/gsm/gsm0480.c 1 file changed, 5 insertions(+), 0 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 4d87974..328a8c0 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -437,6 +437,11 @@ length - offset - 3, req); break; + case GSM0480_OP_CODE_PROCESS_USS_DATA: + rc = parse_process_uss_data(invoke_data + offset + 3, + length - offset - 3, + req); + break; case GSM0480_OP_CODE_ACTIVATE_SS: case GSM0480_OP_CODE_DEACTIVATE_SS: case GSM0480_OP_CODE_INTERROGATE_SS: -- To view, visit https://gerrit.osmocom.org/3380 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I470290c2b544555e53cedd849b1d6a961db7b5a4 Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:45:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:47 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ ...................................................................... gsm0480: handle USS_NOTIFY and USS_REQUEST with PROCESS_USS_REQ Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e --- M src/gsm/gsm0480.c 1 file changed, 2 insertions(+), 0 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index fdec3d2..4d87974 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -430,6 +430,8 @@ uint8_t operation_code = invoke_data[offset+2]; req->opcode = operation_code; switch (operation_code) { + case GSM0480_OP_CODE_USS_NOTIFY: + case GSM0480_OP_CODE_USS_REQUEST: case GSM0480_OP_CODE_PROCESS_USS_REQ: rc = parse_process_uss_req(invoke_data + offset + 3, length - offset - 3, -- To view, visit https://gerrit.osmocom.org/3379 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7cc6a966dfc17d37e22338ecc1f239f908a9f2e Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:45:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:45:48 +0000 Subject: [MERGED] libosmocore[master]: gsm0480: parse GSM0480_MTYPE_FACILITY separately In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0480: parse GSM0480_MTYPE_FACILITY separately ...................................................................... gsm0480: parse GSM0480_MTYPE_FACILITY separately Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa --- M src/gsm/gsm0480.c 1 file changed, 17 insertions(+), 1 deletion(-) 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/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index b0b28e4..17657c7 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -196,6 +196,8 @@ /* Forward declarations */ static int parse_ss(const struct gsm48_hdr *hdr, uint16_t len, struct ss_request *req); +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct ss_request *req); static int parse_ss_info_elements(const uint8_t *ussd_ie, uint16_t len, struct ss_request *req); static int parse_facility_ie(const uint8_t *facility_ie, uint16_t length, @@ -286,8 +288,10 @@ req->ussd_text[0] = 0xFF; break; case GSM0480_MTYPE_REGISTER: - case GSM0480_MTYPE_FACILITY: rc &= parse_ss_info_elements(&hdr->data[0], len - sizeof(*hdr), req); + break; + case GSM0480_MTYPE_FACILITY: + rc &= parse_ss_facility(&hdr->data[0], len - sizeof(*hdr), req); break; default: LOGP(0, LOGL_DEBUG, "Unknown GSM 04.80 message-type field 0x%02x\n", @@ -299,6 +303,18 @@ return rc; } +static int parse_ss_facility(const uint8_t *ss_facility, uint16_t len, + struct ss_request *req) +{ + uint8_t facility_length; + + facility_length = ss_facility[0]; + if (len - 1 < facility_length) + return 0; + + return parse_facility_ie(ss_facility + 1, facility_length, req); +} + static int parse_ss_info_elements(const uint8_t *ss_ie, uint16_t len, struct ss_request *req) { -- To view, visit https://gerrit.osmocom.org/3377 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e029c436a50fa8c2823ea39c5d123ee701becfa Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy 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 Jan 17 10:47:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:47:11 +0000 Subject: osmo-ttcn3-hacks[master]: Add generic link functions In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-2 as indicated, the proper solution is to use .tpd XML files as documented in the TITAN reference manual. However, I think we have more urgent things than to improve the build system at this point. -- To view, visit https://gerrit.osmocom.org/5315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2aaab05ebe19e5f18c03806069197be0e1304a0b Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:47:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:47:50 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: Add generic link functions In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Add generic link functions ...................................................................... Abandoned TPD files are the TITAN standard way of handling this properly -- To view, visit https://gerrit.osmocom.org/5315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2aaab05ebe19e5f18c03806069197be0e1304a0b Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:47:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:47:56 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: GPRS/Gb: use generic linker In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: GPRS/Gb: use generic linker ...................................................................... Abandoned TPD files are the TITAN standard way of handling this properly -- To view, visit https://gerrit.osmocom.org/5316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I713b8dffe298e3e878a4760a82f1ad0d42e0aacf Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:48:14 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 10:48:14 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 9: Code-Review-1 I am not sure if we really need this change. Alexander? -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:06 +0000 Subject: osmo-pcu[master]: Rewrite EGPRS Packet Uplink Assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:08 +0000 Subject: osmo-pcu[master]: Rewrite Packet Downlink Assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:10 +0000 Subject: osmo-pcu[master]: Rewrite Packet Uplink Assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5728 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:15 +0000 Subject: [MERGED] osmo-pcu[master]: Rewrite Packet Uplink Assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rewrite Packet Uplink Assignment ...................................................................... Rewrite Packet Uplink Assignment Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ?10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. The tests are adjusted accordingly. Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3 Related: OS#1526 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 63 insertions(+), 63 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/encoding.cpp b/src/encoding.cpp index 279bbfe..e96894f 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -230,50 +230,51 @@ return 0; } -static int write_ia_rest_uplink( - gprs_rlcmac_ul_tbf *tbf, - bitvec * dest, unsigned& wp, - uint8_t usf, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx) +/* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets ::= Packet Uplink Assignment */ +static inline int write_ia_rest_uplink(const gprs_rlcmac_ul_tbf *tbf, bitvec * dest, + uint8_t usf, uint32_t fn, uint8_t alpha, uint8_t gamma, int8_t ta_idx) { - OSMO_ASSERT(!tbf || !tbf->is_egprs_enabled()); + int rc; - // GMS 04.08 10.5.2.37b 10.5.2.16 - bitvec_write_field(dest, &wp, 3, 2); // "HH" - bitvec_write_field(dest, &wp, 0, 2); // "0" Packet Uplink Assignment - if (tbf == NULL) { - bitvec_write_field(dest, &wp, 0, 1); // Block Allocation : Single Block Allocation - if (alpha) { - bitvec_write_field(dest, &wp,0x1,1); // ALPHA = present - bitvec_write_field(dest, &wp,alpha,4); // ALPHA = present - } else - bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present - bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter - write_tai(dest, wp, ta_idx); - bitvec_write_field(dest, &wp, 1, 1); // TBF_STARTING_TIME_FLAG - bitvec_write_field(dest, &wp,(fn / (26 * 51)) % 32,5); // T1' - bitvec_write_field(dest, &wp,fn % 51,6); // T3 - bitvec_write_field(dest, &wp,fn % 26,5); // T2 + set_H(dest); set_H(dest); + set_0(dest); set_0(dest); /* 00 Packet Uplink Assignment */ + + if (tbf) { + set_1(dest); /* Multi Block Allocation */ + + rc = write_tfi_usf(dest, tbf, usf); + check(rc); + + /* 3GPP TS 44.060 Table 11.2.28.2 Channel Coding Indicator */ + rc = bitvec_set_u64(dest, tbf->current_cs().to_num() - 1, 2, false); /* CHANNEL_CODING_COMMAND */ + check(rc); + + rc = bitvec_set_bit(dest, (bit_value)tbf->tlli()); /* TLLI_BLOCK_CHANNEL_CODING */ + check(rc); + + rc = write_alpha_gamma(dest, alpha, gamma); + check(rc); + + set_0(dest); /* No TIMING_ADVANCE_INDEX */ + set_0(dest); /* No TBF_STARTING_TIME */ } else { - bitvec_write_field(dest, &wp, 1, 1); // Block Allocation : Not Single Block Allocation - bitvec_write_field(dest, &wp, tbf->tfi(), 5); // TFI_ASSIGNMENT Temporary Flow Identity - bitvec_write_field(dest, &wp, 0, 1); // POLLING - bitvec_write_field(dest, &wp, 0, 1); // ALLOCATION_TYPE: dynamic - bitvec_write_field(dest, &wp, usf, 3); // USF - bitvec_write_field(dest, &wp, 0, 1); // USF_GRANULARITY - bitvec_write_field(dest, &wp, 0, 1); // "0" power control: Not Present - bitvec_write_field(dest, &wp, tbf->current_cs().to_num()-1, 2); // CHANNEL_CODING_COMMAND - bitvec_write_field(dest, &wp, 1, 1); // TLLI_BLOCK_CHANNEL_CODING - if (alpha) { - bitvec_write_field(dest, &wp,0x1,1); // ALPHA = present - bitvec_write_field(dest, &wp,alpha,4); // ALPHA - } else - bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present - bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter - /* note: there is no choise for TAI and no starting time */ - bitvec_write_field(dest, &wp, 0, 1); // switch TIMING_ADVANCE_INDEX = off - bitvec_write_field(dest, &wp, 0, 1); // TBF_STARTING_TIME_FLAG + set_0(dest); /* Single Block Allocation */ + rc = write_alpha_gamma(dest, alpha, gamma); + check(rc); + + /* A 'Timing Advance index' shall not be allocated at a Single Block allocation. + A 'TBF Starting Time' shall be allocated at a Single Block allocation. */ + set_0(dest); + set_1(dest); + + rc = write_tbf_start_time(dest, fn); /* TBF_STARTING_TIME */ + check(rc); + + set_L(dest); /* No P0 nor PR_MODE */ + set_L(dest); /* No Additions for R99 */ + set_L(dest); /* No Additions for Rel-6 */ } + return 0; } @@ -481,22 +482,21 @@ plen = wp / 8; + dest->cur_bit = wp; if (downlink) { if (!as_dl_tbf(tbf)) { LOGP(DRLCMACDL, LOGL_ERROR, "Cannot encode DL IMMEDIATE ASSIGNMENT without TBF\n"); return -EINVAL; } - dest->cur_bit = wp; rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, polling, gsm48_ta_is_valid(ta), fn, alpha, gamma, ta_idx); } else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || - (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { - dest->cur_bit = wp; + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx, burst_type, ra); - } else - rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, wp, - usf, fn, - alpha, gamma, ta_idx); + else { + OSMO_ASSERT(!as_ul_tbf(tbf) || !as_ul_tbf(tbf)->is_egprs_enabled()); + rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx); + } if (rc < 0) { LOGP(DRLCMAC, LOGL_ERROR, diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index d032a0f..b37d31e 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1561,7 +1561,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2195,7 +2195,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -6871,7 +6871,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6896,7 +6896,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6921,7 +6921,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6946,7 +6946,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6971,7 +6971,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6996,7 +6996,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -7021,7 +7021,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9054,7 +9054,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9079,7 +9079,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9104,7 +9104,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9129,7 +9129,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9154,7 +9154,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9179,7 +9179,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9204,7 +9204,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -- To view, visit https://gerrit.osmocom.org/5728 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44db2eeea7448ff67e688ae716487bc6dbfc96a3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:15 +0000 Subject: [MERGED] osmo-pcu[master]: Rewrite Packet Downlink Assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rewrite Packet Downlink Assignment ...................................................................... Rewrite Packet Downlink Assignment Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ?10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. The tests are adjusted accordingly. Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Related: OS#1526 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 108 insertions(+), 83 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/encoding.cpp b/src/encoding.cpp index 7b711b8..279bbfe 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -44,6 +44,21 @@ #define set_H(bv) set_x(bv, H) /* { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } */ +static inline int write_ta_index(bitvec *dest, int8_t tai) +{ + int rc; + + if (tai < 0) /* No TIMING_ADVANCE_INDEX: */ + set_0(dest); + + /* TIMING_ADVANCE_INDEX: */ + set_1(dest); + rc = bitvec_set_u64(dest, tai, 4, false); + check(rc); + + return 0; +} + static inline bool write_tai(bitvec *dest, unsigned& wp, int8_t tai) { if (tai < 0) { /* No TIMING_ADVANCE_INDEX: */ @@ -159,52 +174,58 @@ return 0; } -static int write_ia_rest_downlink( - gprs_rlcmac_dl_tbf *tbf, - bitvec * dest, unsigned& wp, - uint8_t polling, bool ta_valid, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx) +/* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets ::= Packet Downlink Assignment */ +static inline int write_ia_rest_downlink(const gprs_rlcmac_dl_tbf *tbf, bitvec *dest, + bool polling, bool ta_valid, uint32_t fn, + uint8_t alpha, uint8_t gamma, int8_t ta_idx) { - if (!tbf) { - LOGP(DRLCMACDL, LOGL_ERROR, - "Cannot encode DL IMMEDIATE ASSIGNMENT without TBF\n"); - return -EINVAL; - } - // GSM 04.08 10.5.2.16 IA Rest Octets - bitvec_write_field(dest, &wp, 3, 2); // "HH" - bitvec_write_field(dest, &wp, 1, 2); // "01" Packet Downlink Assignment - bitvec_write_field(dest, &wp,tbf->tlli(),32); // TLLI - bitvec_write_field(dest, &wp,0x1,1); // switch TFI : on - bitvec_write_field(dest, &wp,tbf->tfi(),5); // TFI - bitvec_write_field(dest, &wp,0x0,1); // RLC acknowledged mode - if (alpha) { - bitvec_write_field(dest, &wp,0x1,1); // ALPHA = present - bitvec_write_field(dest, &wp,alpha,4); // ALPHA - } else { - bitvec_write_field(dest, &wp,0x0,1); // ALPHA = not present - } - bitvec_write_field(dest, &wp,gamma,5); // GAMMA power control parameter - bitvec_write_field(dest, &wp,polling,1); // Polling Bit - bitvec_write_field(dest, &wp, ta_valid, 1); // N. B: NOT related to TAI! - write_tai(dest, wp, ta_idx); + int rc; + + set_H(dest); set_H(dest); + set_0(dest); set_1(dest); /* 00 Packet Downlink Assignment */ + + rc = bitvec_set_u64(dest, tbf->tlli(), 32, false); /* TLLI */ + check(rc); + + set_1(dest); + rc = bitvec_set_u64(dest, tbf->tfi(), 5, false); /* TFI_ASSIGNMENT */ + check(rc); + + /* RLC acknowledged mode */ + set_0(dest); /* RLC_MODE */ + + rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ + check(rc); + + rc = bitvec_set_bit(dest, (bit_value)polling); /* POLLING */ + check(rc); + + /* N. B: NOT related to TAI! */ + rc = bitvec_set_bit(dest, (bit_value)ta_valid); /* TA_VALID */ + check(rc); + + rc = write_ta_index(dest, ta_idx); + check(rc); + if (polling) { - bitvec_write_field(dest, &wp,0x1,1); // TBF Starting TIME present - bitvec_write_field(dest, &wp,(fn / (26 * 51)) % 32,5); // T1' - bitvec_write_field(dest, &wp,fn % 51,6); // T3 - bitvec_write_field(dest, &wp,fn % 26,5); // T2 - } else { - bitvec_write_field(dest, &wp,0x0,1); // TBF Starting TIME present - } - bitvec_write_field(dest, &wp,0x0,1); // P0 not present - // bitvec_write_field(dest, &wp,0x1,1); // P0 not present - // bitvec_write_field(dest, &wp,,0xb,4); + set_1(dest); + rc = write_tbf_start_time(dest, fn); /* TBF_STARTING_TIME */ + check(rc); + } else + set_0(dest); /* No TBF_STARTING_TIME */ + + set_0(dest); /* No P0 nor PR_MODE */ + if (tbf->is_egprs_enabled()) { - /* see GMS 44.018, 10.5.2.16 */ - bitvec_write_field(dest, &wp, 1, 1); // "H" - write_ws(dest, &wp, tbf->window_size()); // EGPRS Window Size - bitvec_write_field(dest, &wp, 0x0, 2); // LINK_QUALITY_MEASUREMENT_MODE - bitvec_write_field(dest, &wp, 0, 1); // BEP_PERIOD2 not present - } + set_H(dest); + rc = bitvec_set_u64(dest, enc_ws(tbf->window_size()), 5, false); /* EGPRS Window Size */ + check(rc); + + /* The mobile station shall not report measurements: (see 3GPP TS 44.060 Table 11.2.7.1) */ + set_0(dest); set_0(dest); /* LINK_QUALITY_MEASUREMENT_MODE */ + set_1(dest); /* No BEP_PERIOD2 */ + } else + set_L(dest); /* No Additions for Rel-6 */ return 0; } @@ -460,11 +481,15 @@ plen = wp / 8; - if (downlink) - rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, wp, - polling, gsm48_ta_is_valid(ta), fn, - alpha, gamma, ta_idx); - else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + if (downlink) { + if (!as_dl_tbf(tbf)) { + LOGP(DRLCMACDL, LOGL_ERROR, "Cannot encode DL IMMEDIATE ASSIGNMENT without TBF\n"); + return -EINVAL; + } + dest->cur_bit = wp; + rc = write_ia_rest_downlink(as_dl_tbf(tbf), dest, polling, gsm48_ta_is_valid(ta), fn, + alpha, gamma, ta_idx); + } else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { dest->cur_bit = wp; rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx, burst_type, ra); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 57f7bd9..d032a0f 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -625,7 +625,7 @@ TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -651,7 +651,7 @@ TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 0f 8b 2b 2b 2b TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -677,7 +677,7 @@ TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 0f 8b 2b 2b 2b TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -703,7 +703,7 @@ TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 0f 8b 2b 2b 2b TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -729,7 +729,7 @@ TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 0f 8b 2b 2b 2b TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -755,7 +755,7 @@ TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 0f 8b 2b 2b 2b TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -781,7 +781,7 @@ TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 0f 8b 2b 2b 2b TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -807,7 +807,7 @@ TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 0f 8b 2b 2b 2b TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -833,7 +833,7 @@ TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 0f 8b 2b 2b 2b TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -859,7 +859,7 @@ TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 0f 8b 2b 2b 2b TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -885,7 +885,7 @@ TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 0f 8b 2b 2b 2b TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -911,7 +911,7 @@ TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 0f 8b 2b 2b 2b TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -937,7 +937,7 @@ TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 0f 8b 2b 2b 2b TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -963,7 +963,7 @@ TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 0f 8b 2b 2b 2b TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -989,7 +989,7 @@ TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 0f 8b 2b 2b 2b TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1015,7 +1015,7 @@ TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 0f 8b 2b 2b 2b TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1041,7 +1041,7 @@ TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 0f 8b 2b 2b 2b TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1067,7 +1067,7 @@ TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 0f 8b 2b 2b 2b TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1093,7 +1093,7 @@ TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 0f 8b 2b 2b 2b TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1119,7 +1119,7 @@ TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 0f 8b 2b 2b 2b TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1145,7 +1145,7 @@ TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 0f 8b 2b 2b 2b TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1171,7 +1171,7 @@ TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 0f 8b 2b 2b 2b TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1197,7 +1197,7 @@ TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 0f 8b 2b 2b 2b TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1223,7 +1223,7 @@ TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 0f 8b 2b 2b 2b TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1249,7 +1249,7 @@ TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 0f 8b 2b 2b 2b TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1275,7 +1275,7 @@ TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 0f 8b 2b 2b 2b TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1301,7 +1301,7 @@ TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 0f 8b 2b 2b 2b TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1327,7 +1327,7 @@ TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 0f 8b 2b 2b 2b TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1353,7 +1353,7 @@ TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 0f 8b 2b 2b 2b TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1379,7 +1379,7 @@ TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 0f 8b 2b 2b 2b TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1405,7 +1405,7 @@ TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 0f 8b 2b 2b 2b TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1431,7 +1431,7 @@ TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 0f 8b 2b 2b 2b TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1465,7 +1465,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 03 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes Modifying MS object, TLLI = 0xc0123456, TA 220 -> 0 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes @@ -1494,7 +1494,7 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 23 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==0) - Sending new block at BSN 0, CS=CS-1 @@ -1608,7 +1608,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=7 TA=7 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: -- To view, visit https://gerrit.osmocom.org/5727 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I52ec9b07413daabba8cd5f1fba5c7b3af6a33389 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:16 +0000 Subject: [MERGED] osmo-pcu[master]: Rewrite EGPRS Packet Uplink Assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Rewrite EGPRS Packet Uplink Assignment ...................................................................... Rewrite EGPRS Packet Uplink Assignment Use bitvec_set_*() directly without external write pointer tracking to simplify the code. This is part of IA Rest Octets (3GPP TS 44.018 ?10.5.2.16) which is the last part of the message so it should not interfere with the rest of encoding functions. Reusable fragments are split into static helpers. Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Related: OS#1526 --- M src/encoding.cpp 1 file changed, 117 insertions(+), 55 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/encoding.cpp b/src/encoding.cpp index b2da1e8..7b711b8 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -36,6 +36,13 @@ #include #include +#define check(rc) { if (rc < 0) return rc; } +#define set_x(bv, x) { if (bitvec_set_bit(bv, x) < 0) return -EOWNERDEAD; } +#define set_0(bv) set_x(bv, ZERO) +#define set_1(bv) set_x(bv, ONE) +#define set_L(bv) set_x(bv, L) +#define set_H(bv) set_x(bv, H) + /* { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } */ static inline bool write_tai(bitvec *dest, unsigned& wp, int8_t tai) { @@ -86,6 +93,70 @@ write_ta(dest, wp, ta); if (write_tai(dest, wp, tai)) /* TIMING_ADVANCE_TIMESLOT_NUMBER: */ bitvec_write_field(dest, &wp, ts, 3); +} + +/* 3GPP TS 44.018 ? 10.5.2.16: + { 0 | 1 < ALPHA : bit (4) > } + < GAMMA : bit (5) > +*/ +static inline int write_alpha_gamma(bitvec *dest, uint8_t alpha, uint8_t gamma) +{ + int rc; + + if (alpha) { + set_1(dest); + rc = bitvec_set_u64(dest, alpha, 4, false); /* ALPHA */ + check(rc); + } else + set_0(dest); /* No ALPHA */ + + rc = bitvec_set_u64(dest, gamma, 5, false); /* GAMMA */ + check(rc); + + return 0; +} + +/* TBF_STARTING_TIME -- same as 3GPP TS 44.018 ?10.5.2.38 Starting Time without tag: */ +static inline int write_tbf_start_time(bitvec *dest, uint32_t fn) +{ + int rc; + + /* Set values according to 3GPP TS 44.018 Table 10.5.2.38.1 */ + rc = bitvec_set_u64(dest, (fn / (26 * 51)) % 32, 5, false); /* T1' */ + check(rc); + rc = bitvec_set_u64(dest, fn % 51, 6, false); /* T3 */ + check(rc); + rc = bitvec_set_u64(dest, fn % 26, 5, false); /* T2 */ + + return rc; +} + +/* 3GPP TS 44.018 ? 10.5.2.16: + < TFI_ASSIGNMENT : bit (5) > + < POLLING : bit > + 0 -- The value '1' was allocated in an earlier version of the protocol and shall not be used. + < USF: bit (3) > + < USF_GRANULARITY : bit > + { 0 | 1 < P0 : bit (4) > < PR_MODE : bit (1) > } +*/ +static inline int write_tfi_usf(bitvec *dest, const gprs_rlcmac_ul_tbf *tbf, uint8_t usf) +{ + int rc; + + rc = bitvec_set_u64(dest, tbf->tfi(), 5, false); /* TFI_ASSIGNMENT */ + check(rc); + + set_0(dest); /* POLLING -- no action is required from MS */ + + set_0(dest); /* '1' was allocated in an earlier spec version and shall not be used */ + + rc = bitvec_set_u64(dest, usf, 3, false); /* USF */ + check(rc); + set_0(dest); /* USF_GRANULARITY -- the mobile station shall transmit one RLC/MAC block */ + + set_0(dest); /* No P0 nor PR_MODE */ + + return 0; } static int write_ia_rest_downlink( @@ -185,68 +256,60 @@ return 0; } -static int write_ia_rest_egprs_uplink( - gprs_rlcmac_ul_tbf *tbf, - bitvec * dest, unsigned& wp, - uint8_t usf, uint32_t fn, - uint8_t alpha, uint8_t gamma, int8_t ta_idx, - enum ph_burst_type burst_type, uint16_t ra) +/* 3GPP TS 44.018 ?10.5.2.16 IA Rest Octets ::= EGPRS Packet Uplink Assignment */ +static inline int write_ia_rest_egprs_uplink(const gprs_rlcmac_ul_tbf *tbf, bitvec *dest, + uint8_t usf, uint32_t fn, + uint8_t alpha, uint8_t gamma, int8_t ta_idx, + enum ph_burst_type burst_type, uint16_t ra) { - uint8_t extended_ra = 0; + int rc; - extended_ra = (ra & 0x1F); + set_L(dest); set_H(dest); + set_0(dest); set_0(dest); /* 00 EGPRS Packet Uplink Assignment */ - bitvec_write_field(dest, &wp, 1, 2); /* LH */ - bitvec_write_field(dest, &wp, 0, 2); /* 0 EGPRS Uplink Assignment */ - bitvec_write_field(dest, &wp, extended_ra, 5); /* Extended RA */ - bitvec_write_field(dest, &wp, 0, 1); /* Access technology Request */ + rc = bitvec_set_u64(dest, ra & 0x1F, 5, false); /* Extended RA */ + check(rc); - if (tbf == NULL) { + set_0(dest); /* No Access Technologies Request */ - bitvec_write_field(dest, &wp, 0, 1); /* multiblock allocation */ + if (tbf) { + set_1(dest); /* Single Block Allocation */ - if (alpha) { - bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */ - bitvec_write_field(dest, &wp, alpha, 4); /* ALPHA */ - } else { - bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = no */ - } + rc = write_tfi_usf(dest, tbf, usf); + check(rc); - bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power contrl */ - bitvec_write_field(dest, &wp, (fn / (26 * 51)) % 32, 5);/* T1' */ - bitvec_write_field(dest, &wp, fn % 51, 6); /* T3 */ - bitvec_write_field(dest, &wp, fn % 26, 5); /* T2 */ - bitvec_write_field(dest, &wp, 0, 2); /* Radio block allocation */ + /* 3GPP TS 44.060 ?12.10d EGPRS Modulation and coding Scheme description: */ + rc = bitvec_set_u64(dest, tbf->current_cs().to_num() - 1, 4, false); /* EGPRS CHANNEL_CODING_COMMAND */ + check(rc); - bitvec_write_field(dest, &wp, 0, 1); + rc = bitvec_set_bit(dest, (bit_value)tbf->tlli()); /* TLLI_BLOCK_CHANNEL_CODING */ + set_0(dest); /* No BEP_PERIOD2 */ + + /* Retransmitted RLC data blocks shall not be re-segmented: (see 3GPP TS 44.060 ?12.10e) */ + set_0(dest); /* RESEGMENT */ + + rc = bitvec_set_u64(dest, enc_ws(tbf->window_size()), 5, false); /* EGPRS Window Size */ + check(rc); + + rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ + check(rc); + + set_0(dest); /* No TIMING_ADVANCE_INDEX */ + set_0(dest); /* No TBF_STARTING_TIME */ + bitvec_set_bit(dest, L); /* No Additions for Rel-7 */ } else { - bitvec_write_field(dest, &wp, 1, 1); /* single block alloc */ - bitvec_write_field(dest, &wp, tbf->tfi(), 5);/* TFI assignment */ - bitvec_write_field(dest, &wp, 0, 1); /* polling bit */ - bitvec_write_field(dest, &wp, 0, 1); /* constant */ - bitvec_write_field(dest, &wp, usf, 3); /* USF bit */ - bitvec_write_field(dest, &wp, 0, 1); /* USF granularity */ - bitvec_write_field(dest, &wp, 0, 1); /* P0 */ - /* MCS */ - bitvec_write_field(dest, &wp, tbf->current_cs().to_num()-1, 4); - /* tlli channel block */ - bitvec_write_field(dest, &wp, tbf->tlli(), 1); - bitvec_write_field(dest, &wp, 0, 1); /* BEP period present */ - bitvec_write_field(dest, &wp, 0, 1); /* resegmentation */ - write_ws(dest, &wp, tbf->window_size()); /* EGPRS window size */ + set_0(dest); /* Multi Block Allocation */ - if (alpha) { - bitvec_write_field(dest, &wp, 0x1, 1); /* ALPHA =yes */ - bitvec_write_field(dest, &wp, alpha, 4); /* ALPHA */ - } else { - bitvec_write_field(dest, &wp, 0x0, 1); /* ALPHA = no */ - } + rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ + check(rc); - bitvec_write_field(dest, &wp, gamma, 5); /* GAMMA power contrl */ - bitvec_write_field(dest, &wp, 0, 1); /* TIMING_ADVANCE_INDEX */ - bitvec_write_field(dest, &wp, 0, 1); /* TBF_STARTING_TIME_FLAG */ - bitvec_write_field(dest, &wp, 0, 1); /* NULL */ + rc = write_tbf_start_time(dest, fn); /* TBF_STARTING_TIME */ + check(rc); + + set_0(dest); /* NUMBER OF RADIO BLOCKS ALLOCATED: */ + set_0(dest); /* 1 radio block reserved for uplink transmission */ + set_0(dest); /* No P0 */ } return 0; @@ -402,11 +465,10 @@ polling, gsm48_ta_is_valid(ta), fn, alpha, gamma, ta_idx); else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || - (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) - rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, wp, - usf, fn, - alpha, gamma, ta_idx, burst_type, ra); - else + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + dest->cur_bit = wp; + rc = write_ia_rest_egprs_uplink(as_ul_tbf(tbf), dest, usf, fn, alpha, gamma, ta_idx, burst_type, ra); + } else rc = write_ia_rest_uplink(as_ul_tbf(tbf), dest, wp, usf, fn, alpha, gamma, ta_idx); -- To view, visit https://gerrit.osmocom.org/5726 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2139fb347b3290621bbc3f6a031f7f213d372e65 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Jan 17 10:50:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 10:50:16 +0000 Subject: [MERGED] osmo-pcu[master]: Use Timing Advance Index in UL assignments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use Timing Advance Index in UL assignments ...................................................................... Use Timing Advance Index in UL assignments Write TAI (if available) when generating Rest Octets for UL Assignment. This should not affect actual PCU behavior because TAI is not yet supported by upper layers but we have to adjust corresponding tests anyway. Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 22 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/encoding.cpp b/src/encoding.cpp index e96894f..39cbe24 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -255,7 +255,9 @@ rc = write_alpha_gamma(dest, alpha, gamma); check(rc); - set_0(dest); /* No TIMING_ADVANCE_INDEX */ + rc = write_ta_index(dest, ta_idx); + check(rc); + set_0(dest); /* No TBF_STARTING_TIME */ } else { set_0(dest); /* Single Block Allocation */ @@ -317,7 +319,9 @@ rc = write_alpha_gamma(dest, alpha, gamma); /* ALPHA and GAMMA */ check(rc); - set_0(dest); /* No TIMING_ADVANCE_INDEX */ + rc = write_ta_index(dest, ta_idx); + check(rc); + set_0(dest); /* No TBF_STARTING_TIME */ bitvec_set_bit(dest, L); /* No Additions for Rel-7 */ } else { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index b37d31e..da2c2dd 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1561,7 +1561,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2195,7 +2195,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 00 01 01 f1 22 33 44 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -6871,7 +6871,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6896,7 +6896,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6921,7 +6921,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6946,7 +6946,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6971,7 +6971,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6996,7 +6996,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -7021,7 +7021,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9054,7 +9054,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9079,7 +9079,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9104,7 +9104,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9129,7 +9129,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9154,7 +9154,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9179,7 +9179,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -9204,7 +9204,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 0b 2b 2b 2b 2b 2b 2b 2b +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- -- To view, visit https://gerrit.osmocom.org/5729 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8b17be78a46c0bc17516b7c90f35aa4768010ae4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Minh-Quang Nguyen From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:11:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:11:56 +0000 Subject: osmo-ttcn3-hacks[master]: Add "SourceInfoFormat := Single; " to all test configs In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id6785757f20279ba84b34747f878baf67d065b20 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:12:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:12:12 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Add "SourceInfoFormat := Single; " to all test configs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add "SourceInfoFormat := Single;" to all test configs ...................................................................... Add "SourceInfoFormat := Single;" to all test configs This will make sure that all log files will contain information about the .ttcn source file name and line number that has caused the log, which is extremely useful during debugging. Change-Id: Id6785757f20279ba84b34747f878baf67d065b20 --- M bsc-nat/IPA_Test.cfg M bsc/BSC_Tests.cfg M ggsn_tests/GGSN_Tests.cfg M gprs_gb/Test.cfg M mgw/MGCP_Test.cfg M selftest/Selftest.cfg M sysinfo/Test.cfg 7 files changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc-nat/IPA_Test.cfg b/bsc-nat/IPA_Test.cfg index 3a34102..617e349 100644 --- a/bsc-nat/IPA_Test.cfg +++ b/bsc-nat/IPA_Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/bsc/BSC_Tests.cfg b/bsc/BSC_Tests.cfg index 5fd3203..fcb1055 100644 --- a/bsc/BSC_Tests.cfg +++ b/bsc/BSC_Tests.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC #FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index a7f4681..e97578c 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; ConsoleMask := DEBUG | LOG_ALL | MATCHING | DEBUG_TESTPORT LoggerPlugins := { JUnitLogger := "libjunitlogger2" } diff --git a/gprs_gb/Test.cfg b/gprs_gb/Test.cfg index 2155628..2f11dfb 100644 --- a/gprs_gb/Test.cfg +++ b/gprs_gb/Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #*.FileMask := LOG_ALL ConsoleMask := ERROR | WARNING | TESTCASE | TIMEROP_START | DEBUG_ENCDEC diff --git a/mgw/MGCP_Test.cfg b/mgw/MGCP_Test.cfg index 75989fe..00e3d7c 100644 --- a/mgw/MGCP_Test.cfg +++ b/mgw/MGCP_Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/selftest/Selftest.cfg b/selftest/Selftest.cfg index 1eed017..ffa0edb 100644 --- a/selftest/Selftest.cfg +++ b/selftest/Selftest.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; #FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; #ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC #FileMask := LOG_ALL | TTCN_MATCHING; diff --git a/sysinfo/Test.cfg b/sysinfo/Test.cfg index 16e0dd6..56696f4 100644 --- a/sysinfo/Test.cfg +++ b/sysinfo/Test.cfg @@ -1,4 +1,5 @@ [LOGGING] +SourceInfoFormat := Single; [MODULE_PARAMETERS] -- To view, visit https://gerrit.osmocom.org/5803 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id6785757f20279ba84b34747f878baf67d065b20 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:13:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:13:38 +0000 Subject: libosmocore[master]: logging: separate the '<000b>' subsys from filename logging In-Reply-To: References: Message-ID: Patch Set 1: > I would gladly separate the hex category out to its own logging > config api, the only reason why I'm continuing to tie it with the > filename is backwards compat. If you agree that we completely untie > it from the filename (and that changing the logging API behavior is > acceptable) I'll change the patches. I'm not sure why we would change the behavoir? If we just add a new function which can disable the printing of th ehex category prefix, and make sure that the start-up default is "enabled", how are we breaking compatibility? -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 Gerrit-PatchSet: 1 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 Wed Jan 17 11:13:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:13:59 +0000 Subject: [MERGED] libosmocore[master]: logging: color the log level In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: logging: color the log level ...................................................................... logging: color the log level When log_set_use_color() is enabled, color the log level string according to the log level. The log line before and after the log level is printed in the category's color. ERROR and FATAL are red, NOTICE is yellow, INFO is green and DEBUG is blue. The default behavior remains unchanged. Change-Id: If2e52ae9ab83e538e04321c338e3fdffb2c7f9d3 --- M src/logging.c 1 file changed, 26 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index 80fc7d2..c01294c 100644 --- a/src/logging.c +++ b/src/logging.c @@ -298,6 +298,23 @@ return NULL; } +static const struct value_string level_colors[] = { + { LOGL_DEBUG, "\033[1;34m" }, + { LOGL_INFO, "\033[1;32m" }, + { LOGL_NOTICE, "\033[1;33m" }, + { LOGL_ERROR, "\033[1;31m" }, + { LOGL_FATAL, "\033[1;31m" }, + { 0, NULL } +}; + +static const char *level_color(int level) +{ + const char *c = get_value_string_or_null(level_colors, level); + if (!c) + return get_value_string(level_colors, LOGL_FATAL); + return c; +} + const char* log_category_name(int subsys) { if (subsys < osmo_log_info->num_cat) @@ -312,12 +329,13 @@ { char buf[4096]; int ret, len = 0, offset = 0, rem = sizeof(buf); + const char *c_subsys = NULL; /* are we using color */ if (target->use_color) { - const char *c = color(subsys); - if (c) { - ret = snprintf(buf + offset, rem, "%s", c); + c_subsys = color(subsys); + if (c_subsys) { + ret = snprintf(buf + offset, rem, c_subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); @@ -354,7 +372,11 @@ OSMO_SNPRINTF_RET(ret, rem, offset, len); } if (target->print_level) { - ret = snprintf(buf + offset, rem, "%s ", log_level_str(level)); + ret = snprintf(buf + offset, rem, "%s%s%s%s ", + target->use_color ? level_color(level) : "", + log_level_str(level), + target->use_color ? "\033[0;m" : "", + c_subsys ? c_subsys : ""); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5810 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2e52ae9ab83e538e04321c338e3fdffb2c7f9d3 Gerrit-PatchSet: 2 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 Wed Jan 17 11:13:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:13:59 +0000 Subject: [MERGED] libosmocore[master]: logging: add ability to log the log-level with API and vty In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: logging: add ability to log the log-level with API and vty ...................................................................... logging: add ability to log the log-level with API and vty Log the log level string after the category name, if enabled. The default behavior remains unchanged. Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 42 insertions(+), 0 deletions(-) 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 922cbf6..1e809d0 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -298,6 +298,9 @@ void (*raw_output)(struct log_target *target, int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap); + + /* Should the log level be printed? */ + bool print_level; }; /* use the above macros */ @@ -320,6 +323,7 @@ void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); +void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); const char* log_category_name(int subsys); diff --git a/src/logging.c b/src/logging.c index e4f3e87..80fc7d2 100644 --- a/src/logging.c +++ b/src/logging.c @@ -353,6 +353,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } + if (target->print_level) { + ret = snprintf(buf + offset, rem, "%s ", log_level_str(level)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } if (target->print_filename) { ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", subsys, file, line); @@ -608,6 +614,17 @@ target->print_category = print_category; } +/*! Enable or disable printing of the log level name. + * \param[in] target Log target to be affected + * \param[in] print_catname Enable (1) or disable (0) filenames + * + * Print the log level name in front of every log message. + */ +void log_set_print_level(struct log_target *target, int print_level) +{ + target->print_level = (bool)print_level; +} + /*! Set the global log level for a given log target * \param[in] target Log target to be affected * \param[in] log_level New global log level diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index dc457ff..5914822 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -203,6 +203,23 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_level, + logging_prnt_level_cmd, + "logging print level (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the log level name\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_level(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -734,6 +751,8 @@ else vty_out(vty, " logging timestamp %u%s", tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); + if (tgt->print_level) + vty_out(vty, " logging print level 1%s", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -783,6 +802,7 @@ install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); + install_element_ve(&logging_prnt_level_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -799,6 +819,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5809 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie6be365cfa6aeabdf115bff19bac198440c9adf1 Gerrit-PatchSet: 2 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 Wed Jan 17 11:13:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:13:59 +0000 Subject: [MERGED] libosmocore[master]: logging: color the log category according to level In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: logging: color the log category according to level ...................................................................... logging: color the log category according to level When log_set_use_color() is enabled, color the log category string according to the log level. The log line before and after the log category is printed in the category's configured color. ERROR and FATAL are red, NOTICE is yellow, INFO is green and DEBUG is blue. The default behavior remains unchanged; If color is enabled, the category string will now always be colored in the log level color, not the log category color, and will stand out from the rest of the line. Change-Id: I84f886ac880e9056a666bbb231ae06cbaaf65f44 --- M src/logging.c 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index c01294c..a6aa7eb 100644 --- a/src/logging.c +++ b/src/logging.c @@ -366,7 +366,11 @@ OSMO_SNPRINTF_RET(ret, rem, offset, len); } if (target->print_category) { - ret = snprintf(buf + offset, rem, "%s ", log_category_name(subsys)); + ret = snprintf(buf + offset, rem, "%s%s%s%s ", + target->use_color ? level_color(level) : "", + log_category_name(subsys), + target->use_color ? "\033[0;m" : "", + c_subsys ? c_subsys : ""); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5811 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I84f886ac880e9056a666bbb231ae06cbaaf65f44 Gerrit-PatchSet: 2 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 Wed Jan 17 11:14:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 11:14:33 +0000 Subject: libosmocore[master]: NS: use monotonic clock In-Reply-To: References: Message-ID: Patch Set 5: Those are 2 different things: 1) osmo_gettimeofday() used inside libosmocore for elapsed time computations in osmo_timers_*() 2) osmo_gettimeofday() used externally for elapsed time computations Those are pretty-much independent. The main difference is that corresponding "struct timeval" is internal parameter in 1) and managed by caller in 2). Because of that moving to monotonic time in 1) won't help with 2) - we still have to go and manually change it. Similarly, moving 2) to monotonic time won't affect 1) at all. This patch series address case 2) only. The 1) is more intrusive because it's also used to mock time in tests. -- To view, visit https://gerrit.osmocom.org/5104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6949601a80747f0de1a05e0790a1bace209efbf Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:14:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:14:55 +0000 Subject: [MERGED] osmo-mgw[master]: cosmetic: mgcp_network: typo in log In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: mgcp_network: typo in log ...................................................................... cosmetic: mgcp_network: typo in log Change-Id: Ia7675e52fe1082d21bd68dcf54fe34c0f0326f11 --- M src/libosmo-mgcp/mgcp_network.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index bd6bec9..6cecbb0 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -905,7 +905,7 @@ *proto = fd == &conn->end.rtp ? MGCP_PROTO_RTP : MGCP_PROTO_RTCP; LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x ", ENDPOINT_NUMBER(endp)); - LOGPC(DRTP, LOGL_DEBUG, "receiveing from %s %s %d\n", + LOGPC(DRTP, LOGL_DEBUG, "receiving from %s %s %d\n", conn->conn->name, inet_ntoa(addr->sin_addr), ntohs(addr->sin_port)); LOGP(DRTP, LOGL_DEBUG, "endpoint:0x%x conn:%s\n", ENDPOINT_NUMBER(endp), -- To view, visit https://gerrit.osmocom.org/5794 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7675e52fe1082d21bd68dcf54fe34c0f0326f11 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:17:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:17:41 +0000 Subject: osmo-pcu[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:17:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:17:43 +0000 Subject: [MERGED] osmo-pcu[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow specifying sysmocom headers explicitly ...................................................................... Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. While at it, unify header fixup code with the one used in OsmoBTS. Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 --- M configure.ac M contrib/jenkins.sh M src/Makefile.am 3 files changed, 15 insertions(+), 6 deletions(-) Approvals: Max: Looks good to me, but someone else must approve; Verified Harald Welte: Looks good to me, approved diff --git a/configure.ac b/configure.ac index 56e2057..3706b6c 100644 --- a/configure.ac +++ b/configure.ac @@ -65,8 +65,19 @@ AC_HELP_STRING([--enable-sysmocom-dsp], [enable code for sysmocom DSP [default=no]]), [enable_sysmocom_dsp="$enableval"],[enable_sysmocom_dsp="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_dsp]) AM_CONDITIONAL(ENABLE_SYSMODSP, test "x$enable_sysmocom_dsp" = "xyes") +if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) + CPPFLAGS=$oldCPPFLAGS +fi AC_MSG_CHECKING([whether to enable direct PHY access for PDCH of NuRAN Wireless Litecell 1.5 BTS]) AC_ARG_ENABLE(lc15bts-phy, diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index b7cfc3d..af25c69 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -26,15 +26,13 @@ # Collect configure options for osmo-pcu PCU_CONFIG="" if [ "$with_dsp" = sysmo ]; then - PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp" + PCU_CONFIG="$PCU_CONFIG --enable-sysmocom-dsp --with-sysmobts=$inst/include/" # For direct sysmo DSP access, provide the SysmoBTS Layer 1 API cd "$deps" osmo-layer1-headers.sh sysmo - cd layer1-headers - api_incl="$inst/include/sysmocom/femtobts/" - mkdir -p "$api_incl" - cp include/*.h "$api_incl" + mkdir -p "$inst/include/sysmocom/femtobts" + ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" cd "$base" elif [ "$with_dsp" = lc15 ]; then diff --git a/src/Makefile.am b/src/Makefile.am index a6e98e5..7d2a62e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,7 +103,7 @@ osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP -AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo +AM_CPPFLAGS += -I$(srcdir)/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) EXTRA_DIST = \ osmo-bts-sysmo/sysmo_l1_if.c \ -- To view, visit https://gerrit.osmocom.org/5796 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5248e8b389fd240b4d5a0bcf6c954d6115262462 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:19:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:19:01 +0000 Subject: gapk[master]: Merge branch 'fixeria/lib' In-Reply-To: References: Message-ID: Patch Set 1: @tnt: any feedbackk on this patch series? -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:19:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:19:05 +0000 Subject: gapk[master]: Merge branch 'fixeria/lib' In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 1 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:20:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 11:20:02 +0000 Subject: libosmocore[master]: logging: allow to log only the basename of each source In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 11:26:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 11:26:01 +0000 Subject: osmo-sgsn[master]: Use gsm48_encode_ra() for RAI encoding In-Reply-To: References: Message-ID: Patch Set 2: Indeed, this was not tested against actual gbproxy. The change is rather cosmetic: explicit struct type used instead of void * but this can wait until we have more elaborate test infrastructure for gbproxy. -- To view, visit https://gerrit.osmocom.org/5680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:04:20 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 17 Jan 2018 12:04:20 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: RSL_Emulation: Initialize the ConnectionTable Message-ID: Review at https://gerrit.osmocom.org/5842 RSL_Emulation: Initialize the ConnectionTable By default all the elements in the conn table seem to be considered . f_cid_create() manages to set ra, ra_fn and comp_ref in the ConnectionData element, but checking for ispresent(ConnectionTable[i].ra) still returns false while log(ConnectionTable[i].ra) returns 23. Setting every optional element to omit as f_cid_clear() does before using the connection table seems to solve this issue. The assignment_fr_* tests now continue after receiving the Immediate Assignment, but still fail after receiving the CM Service Request. Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d --- M library/RSL_Emulation.ttcn 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/5842/1 diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 7c5a168..2c33dfe 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -214,6 +214,11 @@ var integer cid; var integer i; + /* Initialize the ConnectionTable */ + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + f_cid_clear(i); + } + while (true) { alt { [] IPA_PT.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { -- To view, visit https://gerrit.osmocom.org/5842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:04:21 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 17 Jan 2018 12:04:21 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Initialize ExpectTable before use Message-ID: Review at https://gerrit.osmocom.org/5843 BSSMAP_Emulation: Initialize ExpectTable before use The assignment_fr_* tests now go through to the point where the BSC sends a CRCX to the mgw. Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba --- M library/BSSMAP_Emulation.ttcn 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/43/5843/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 153fb86..8475d55 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -297,6 +297,7 @@ g_bssmap_id := id; f_conn_table_init(); + f_expect_table_init(); while (true) { var BSSAP_N_UNITDATA_ind ud_ind; @@ -518,5 +519,11 @@ setverdict(fail, "No space left in ExpectTable"); } +private function f_expect_table_init() +runs on BSSMAP_Emulation_CT { + for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { + ExpectTable[i].l3_payload := omit; + } +} } -- To view, visit https://gerrit.osmocom.org/5843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:09:00 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 17 Jan 2018 12:09:00 +0000 Subject: osmo-ttcn3-hacks[master]: RSL_Emulation: Initialize the ConnectionTable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 I'll make the init routine here a function as well -- To view, visit https://gerrit.osmocom.org/5842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:16:04 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Wed, 17 Jan 2018 12:16:04 +0000 Subject: osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations' In-Reply-To: References: Message-ID: Patch Set 1: > I wasn't referring to compilation. Have you tried to run it with > actual phone and verified that 11-bit RACH was used? The ticket > referred to in README is still open. I'd be surprised if adding > support to libosmocore would mean that it'll be automatically used > in osmo-bts. > > So if you indeed tested, please share your configs and test setup > details in OS#1854. We should first close the ticket and than > remove it from readme. Yes you are right. I drew the wrong conclusion. -- To view, visit https://gerrit.osmocom.org/5833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:18:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 12:18:32 +0000 Subject: osmo-bts[master]: Remove 11-bit RACH support from 'Known Limitations' In-Reply-To: References: Message-ID: Patch Set 1: Ok, let's keep in this in gerrit until OS#1854 is resolved and than we can merge this. Updating readme is easily overlooked so thanks for sending this. -- To view, visit https://gerrit.osmocom.org/5833 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:24:38 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 17 Jan 2018 12:24:38 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: RSL_Emulation: Initialize the ConnectionTable In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5842 to look at the new patch set (#2). RSL_Emulation: Initialize the ConnectionTable By default all the elements in the conn table seem to be considered . f_cid_create() manages to set ra, ra_fn and comp_ref in the ConnectionData element, but checking for ispresent(ConnectionTable[i].ra) still returns false while log(ConnectionTable[i].ra) returns 23. Setting every optional element to omit as f_cid_clear() does before using the connection table seems to solve this issue. The assignment_fr_* tests now continue after receiving the Immediate Assignment, but still fail after receiving the CM Service Request. Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d --- M library/RSL_Emulation.ttcn 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/5842/2 diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 7c5a168..a19e627 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -214,6 +214,8 @@ var integer cid; var integer i; + f_conn_table_init(); + while (true) { alt { [] IPA_PT.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { @@ -315,5 +317,14 @@ } } +private function f_conn_table_init() +runs on RSL_Emulation_CT { + var integer i; + + /* Initialize the ConnectionTable */ + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + f_cid_clear(i); + } +} } -- To view, visit https://gerrit.osmocom.org/5842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:25:04 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 12:25:04 +0000 Subject: [PATCH] libosmocore[master]: tests: fix LDADD: link libosmovty from current build Message-ID: Review at https://gerrit.osmocom.org/5844 tests: fix LDADD: link libosmovty from current build Do not link against the system-wide installed libosmovty during build. Instead, use the locally built one: add libosmovty.la to LDADD explicitly. It might be more accurate to add this linking only to those tests that really require it, but on the one hand ctrl_test (which raises an error) doesn't even seem to use libosmovty, and on the other hand I don't want to spend time analysing each and every test for which libs it links now. I am being lazy and find it sufficient that the tests still work after linking libosmovty to all of them. I got: /usr/local/lib/libosmovty.so.4: undefined reference to `log_set_print_basename' collect2: error: ld returned 1 exit status Makefile:964: recipe for target 'ctrl/ctrl_test' failed because a system installation of libosmovty was from a branch with a new symbol expected present in libosmocore.la (log_set_print_basename), followed by a build of current master which lacks that symbol. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 --- M tests/Makefile.am 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5844/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index 877a302..4eeb471 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) AM_LDFLAGS = -LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) +LDADD = $(top_builddir)/src/libosmocore.la \ + $(top_builddir)/src/vty/libosmovty.la \ + $(TALLOC_LIBS) check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ smscb/smscb_test bits/bitrev_test a5/a5_test \ @@ -146,7 +148,7 @@ strrb_strrb_test_SOURCES = strrb/strrb_test.c vty_vty_test_SOURCES = vty/vty_test.c -vty_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la +vty_vty_test_LDADD = $(LDADD) sim_sim_test_SOURCES = sim/sim_test.c sim_sim_test_LDADD = $(LDADD) $(top_builddir)/src/sim/libosmosim.la \ -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:26:47 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 12:26:47 +0000 Subject: [PATCH] libosmocore[master]: fix -Werror build: logging.c: always use literal with snprintf Message-ID: Review at https://gerrit.osmocom.org/5845 fix -Werror build: logging.c: always use literal with snprintf A recent commit added an snprintf that passes a pointer to a literal directly to snprintf. Since passing pointers to printf formats is a vulnerability in case user supplied data may be passed in the format, modern compilers warn against that, which breaks our -Werror builds. Even though this is just a pointer to a literal, it needs to be an actual literal to make compilers happy. Use printf("%s", c) instead of printf(c). Note that our current build slave's gcc does not enforce that yet, while newer compilers do. Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/5845/1 diff --git a/src/logging.c b/src/logging.c index a6aa7eb..9b37bf5 100644 --- a/src/logging.c +++ b/src/logging.c @@ -335,7 +335,7 @@ if (target->use_color) { c_subsys = color(subsys); if (c_subsys) { - ret = snprintf(buf + offset, rem, c_subsys); + ret = snprintf(buf + offset, rem, "%s", c_subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:28:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 12:28:32 +0000 Subject: [PATCH] libosmocore[master]: fix -Werror build: logging.c: always use literal with snprintf In-Reply-To: References: Message-ID: fix -Werror build: logging.c: always use literal with snprintf A recent commit added an snprintf that passes a pointer to a literal directly to snprintf. Since passing pointers to printf formats is a vulnerability in case user supplied data may be passed in the format, modern compilers warn against that, which breaks our -Werror builds. Even though this is just a pointer to a literal, it needs to be an actual literal to make compilers happy. Use printf("%s", c) instead of printf(c). Note that our current build slave's gcc does not enforce that yet, while newer compilers do. logging.c:338:4: warning: format not a string literal and no format arguments [-Wformat-security] ret = snprintf(buf + offset, rem, c_subsys); Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/5845/2 diff --git a/src/logging.c b/src/logging.c index a6aa7eb..9b37bf5 100644 --- a/src/logging.c +++ b/src/logging.c @@ -335,7 +335,7 @@ if (target->use_color) { c_subsys = color(subsys); if (c_subsys) { - ret = snprintf(buf + offset, rem, c_subsys); + ret = snprintf(buf + offset, rem, "%s", c_subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec 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 Jan 17 12:29:18 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 12:29:18 +0000 Subject: libosmocore[master]: fix -Werror build: logging.c: always use literal with snprintf In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec 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 Wed Jan 17 12:29:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 12:29:19 +0000 Subject: [MERGED] libosmocore[master]: fix -Werror build: logging.c: always use literal with snprintf In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix -Werror build: logging.c: always use literal with snprintf ...................................................................... fix -Werror build: logging.c: always use literal with snprintf A recent commit added an snprintf that passes a pointer to a literal directly to snprintf. Since passing pointers to printf formats is a vulnerability in case user supplied data may be passed in the format, modern compilers warn against that, which breaks our -Werror builds. Even though this is just a pointer to a literal, it needs to be an actual literal to make compilers happy. Use printf("%s", c) instead of printf(c). Note that our current build slave's gcc does not enforce that yet, while newer compilers do. logging.c:338:4: warning: format not a string literal and no format arguments [-Wformat-security] ret = snprintf(buf + offset, rem, c_subsys); Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec --- M src/logging.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/src/logging.c b/src/logging.c index a6aa7eb..9b37bf5 100644 --- a/src/logging.c +++ b/src/logging.c @@ -335,7 +335,7 @@ if (target->use_color) { c_subsys = color(subsys); if (c_subsys) { - ret = snprintf(buf + offset, rem, c_subsys); + ret = snprintf(buf + offset, rem, "%s", c_subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); -- To view, visit https://gerrit.osmocom.org/5845 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa4eb8a9fab66dcd987986065351b4a06421f1ec 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 Jan 17 12:49:12 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 12:49:12 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/5844/1/tests/Makefile.am File tests/Makefile.am: Line 5: $(top_builddir)/src/vty/libosmovty.la \ Seems like unrelated cosmetic change, but we shouldn't consider it merge blocker. Line 151: vty_vty_test_LDADD = $(LDADD) That's unnecessary: LDADD is used by default so you can just remove the line entirely. -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:57:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 12:57:06 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Initialize ExpectTable before use In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:57:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 12:57:08 +0000 Subject: osmo-ttcn3-hacks[master]: RSL_Emulation: Initialize the ConnectionTable In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:57:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 12:57:10 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: RSL_Emulation: Initialize the ConnectionTable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL_Emulation: Initialize the ConnectionTable ...................................................................... RSL_Emulation: Initialize the ConnectionTable By default all the elements in the conn table seem to be considered . f_cid_create() manages to set ra, ra_fn and comp_ref in the ConnectionData element, but checking for ispresent(ConnectionTable[i].ra) still returns false while log(ConnectionTable[i].ra) returns 23. Setting every optional element to omit as f_cid_clear() does before using the connection table seems to solve this issue. The assignment_fr_* tests now continue after receiving the Immediate Assignment, but still fail after receiving the CM Service Request. Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d --- M library/RSL_Emulation.ttcn 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index 7c5a168..a19e627 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -214,6 +214,8 @@ var integer cid; var integer i; + f_conn_table_init(); + while (true) { alt { [] IPA_PT.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { @@ -315,5 +317,14 @@ } } +private function f_conn_table_init() +runs on RSL_Emulation_CT { + var integer i; + + /* Initialize the ConnectionTable */ + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + f_cid_clear(i); + } +} } -- To view, visit https://gerrit.osmocom.org/5842 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24205425c5b6ae5b8a0f6288ba89ea5a1dc4669d Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Wed Jan 17 12:57:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 12:57:10 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Initialize ExpectTable before use In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Emulation: Initialize ExpectTable before use ...................................................................... BSSMAP_Emulation: Initialize ExpectTable before use The assignment_fr_* tests now go through to the point where the BSC sends a CRCX to the mgw. Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba --- M library/BSSMAP_Emulation.ttcn 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 153fb86..8475d55 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -297,6 +297,7 @@ g_bssmap_id := id; f_conn_table_init(); + f_expect_table_init(); while (true) { var BSSAP_N_UNITDATA_ind ud_ind; @@ -518,5 +519,11 @@ setverdict(fail, "No space left in ExpectTable"); } +private function f_expect_table_init() +runs on BSSMAP_Emulation_CT { + for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { + ExpectTable[i].l3_payload := omit; + } +} } -- To view, visit https://gerrit.osmocom.org/5843 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic5a128861ae7b1a4cf8158e43c59c52ebd2a20ba Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:00:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:00:54 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC_Types: Add templates for most MNCC messages Message-ID: Review at https://gerrit.osmocom.org/5846 MNCC_Types: Add templates for most MNCC messages This adds templates for sending and receiving MNCC messages from the external MNCC handler point of view, i.e. as required for MSC testing. The inverse templates will be needed if we want to implement emulation of the MSC side of MNCC. Change-Id: I77665aaf589bdaa9dc0aa6a5daa431fafdc2b383 --- M library/MNCC_Types.ttcn 1 file changed, 1,058 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/46/5846/1 diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 956a1ae..2c08e27 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -252,6 +252,9 @@ int pcp }; +type int MNCC_notify (0..127); +type int MNCC_keypad (0..127); + type enumerated MNCC_bcap { GSM_MNCC_BCAP_SPEECH (0), GSM_MNCC_BCAP_UNR_DIG (1), @@ -281,9 +284,9 @@ int clir_inv, int signal optional, - int keypad optional, + MNCC_keypad keypad optional, int more, - int notify (0..127), + MNCC_notify notify, int emergency optional, charstring imsi, @@ -353,14 +356,14 @@ } } -template MNCC_PDU ts_MNCC_SETUP(uint32_t call_id, charstring called, charstring calling) := { - msg_type := MNCC_SETUP_REQ, +template MNCC_PDU ts_MNCC_SIMPLE(MNCC_MsgType msg_type, uint32_t call_id) := { + msg_type := msg_type, u := { signal := { callref := call_id, - bearer_cap := ts_MNCC_bcap_voice, - called := valueof(ts_MNCC_number(called)), - calling := valueof(ts_MNCC_number(calling)), + bearer_cap := omit, + called := omit, + calling := omit, redirecting := omit, connected := omit, cause := omit, @@ -376,12 +379,1059 @@ more := 0, notify := 0, emergency := omit, - imsi := "1234", + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +template MNCC_PDU tr_MNCC_SIMPLE(template MNCC_MsgType msg_type, template uint32_t call_id) := { + msg_type := msg_type, + u := { + signal := { + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + + + +/* MT: MSC <- MNCC: SETUP.req from ext. MNCC handler to MSC */ +template MNCC_PDU ts_MNCC_SETUP_req(uint32_t call_id, charstring called, charstring calling, charstring imsi := "") := { + msg_type := MNCC_SETUP_REQ, + u := { + signal := { /* See 24.008 9.3.23.1 */ + callref := call_id, + bearer_cap := ts_MNCC_bcap_voice, /* mandatory */ + called := valueof(ts_MNCC_number(called)), /* optional */ + calling := valueof(ts_MNCC_number(calling)), /* optional */ + redirecting := omit, /* optional */ + connected := omit, + cause := omit, + progress := omit, /* optional */ + useruser := omit, /* optional */ + facility := omit, /* optional */ + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, /* optional */ + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := imsi, lchan_type := 0, lchan_mode := 0 } } }; +/* MT: MSC -> MNCC: Respons to SETUP.req */ +template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id := ?, template MNCC_number connected := *, + template charstring imsi := ?) := { + msg_type := MNCC_SETUP_RSP, + u := { + signal := { /* See 24.008 9.3.5 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := connected, + cause := omit, + progress := omit, + useruser := *, + facility := *, + cccap := omit, + ssversion := *, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := imsi, + lchan_type := ?, + lchan_mode := ? + } + } +}; + +/* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */ +template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template MNCC_number called := ?, + template MNCC_number calling := *, template charstring imsi :=?) := { + msg_type := MNCC_SETUP_IND, + u := { + signal := { /* See 24.008 9.3.23.2 */ + callref := call_id, + bearer_cap := ?, /* mandatory */ + called := called, /* mandatory */ + calling := calling, /* optional */ + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := *, /* optional */ + facility := *, /* optional */ + cccap := *, /* optional */ + ssversion := *, /* optional */ + clir_sup := ?, /* optional */ + clir_inv := ?, /* optional */ + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := imsi, + lchan_type := ?, + lchan_mode := ? + } + } + +} + +/* MO: MSC <- MNCC: SETUP.cnf; Response to SETUP.ind */ +template MNCC_PDU ts_MNCC_SETUP_CNF(uint32_t call_id, template MNCC_number connected := omit) := { + msg_type := MNCC_SETUP_CNF, + u := { + signal := { /* See 24.008 9.3.5 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := connected, + cause := omit, + progress := *, + useruser := *, + facility := *, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := "", + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* MO: MSC <- MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ +template MNCC_PDU ts_MNCC_SETUP_COMPL_req(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ + +/* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */ +template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */ + +/* MT: MSC -> MNCC: REJ.req; reject MT call */ +template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template MNCC_cause cause := *) := { + msg_type := MNCC_REJ_REQ, + u := { + signal := { /* See 24.008 9.3.19 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := *, + facility := *, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* MO: MSC <- MNCC: REJ.ind; reject MO call */ +template MNCC_PDU ts_MNCC_REJ_ind(uint32_t call_id, template MNCC_cause cause := omit) := { + msg_type := MNCC_REJ_IND, + u := { + signal := { /* See 24.008 9.3.19 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MT: MSC <- MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ +template MNCC_PDU ts_MNCC_CALL_CONF_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, + template MNCC_cause cause := omit, + template MNCC_cccap cccap := omit) := { + msg_type := MNCC_CALL_CONF_IND, + u := { + signal := { /* See 24.008 9.3.2 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := cccap, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MO: MSC <- MNCC: CALL_PROC.req; call establishment initiated in network */ +template MNCC_PDU ts_MNCC_CALL_PROC_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, + template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_cccap cccap := omit) := { + msg_type := MNCC_CALL_PROC_REQ, + u := { + signal := { /* See 24.008 9.3.2 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := omit, + facility := fac, + cccap := cccap, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */ +template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_PROGRESS_REQ, + u := { + signal := { /* See 24.008 9.3.17 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := uu, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MO: MSC <- MNCC: ALERT.req; indicate that user alerting has been initiated */ +template MNCC_PDU ts_MNCC_ALERT_req(uint32_t call_id, template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_ALERT_REQ, + u := { + signal := { /* See 24.008 9.3.1 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + + +/* MT: MSC -> MNCC: ALERRT.ind; indicates that mobile user alerting has been initiated */ +template MNCC_PDU tr_MNCC_ALERT_ind(template uint32_t call_id, template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_ALERT_REQ, + u := { + signal := { /* See 24.008 9.3.1 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: NOTIFY.req; request to send information pertaining to a call (such as user suspended) */ +template MNCC_PDU ts_MNCC_NOTIFY_req(uint32_t call_id, MNCC_notify notify) := { + msg_type := MNCC_NOTIFY_REQ, + u := { + signal := { /* See 24.008 9.3.16 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := notify, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: NOTIFY.ind; indication to the mobile user */ +template MNCC_PDU tr_MNCC_NOTIFY_ind(template uint32_t call_id, template MNCC_notify notify) := { + msg_type := MNCC_NOTIFY_IND, + u := { + signal := { /* See 24.008 9.3.16 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := notify, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC -> MNCC: DISC.ind; mobile user requests disconnect */ +template MNCC_PDU tr_MNCC_DISC_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?, + template MNCC_progress prog := *, + template charstring fac := *, + template MNCC_useruser uu := *) := { + msg_type := MNCC_DISC_IND, + u := { + signal := { /* See 24.008 9.3.7 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: DISC.req; indicate disconnect to mobile user */ +template MNCC_PDU ts_MNCC_DISC_req(uint32_t call_id, MNCC_cause cause, + template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_DISC_REQ, + u := { + signal := { /* See 24.008 9.3.7 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: REL.ind; mobile user informs network that user wants to release call + MM */ +template MNCC_PDU tr_MNCC_REL_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?, + template charstring fac := *, template MNCC_useruser uu := *) := { + msg_type := MNCC_REL_IND, + u := { + signal := { /* See 24.008 9.3.18 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: REL.req; indicate to mobile user tat network intents to release MM */ +template MNCC_PDU ts_MNCC_REL_req(uint32_t call_id, MNCC_cause cause, + template charstring fac := omit, template MNCC_useruser uu := omit) := { + msg_type := MNCC_REL_REQ, + u := { + signal := { /* See 24.008 9.3.18 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: REL.cnf; confirm REL_req */ +template MNCC_PDU tr_MNCC_REL_cnf(template uint32_t call_id := ?, template MNCC_cause cause := ?, + template charstring fac := *, template MNCC_useruser uu := *) +modifies tr_MNCC_REL_ind := { + msg_type := MNCC_REL_CNF +}; + +/* : MSC <- MNCC: FACILITY.req; request transmission of facility */ +template MNCC_PDU ts_MNCC_FACILITY_req(uint32_t call_id, charstring fac) := { + msg_type := MNCC_FACILITY_REQ, + u := { + signal := { /* See 24.008 9.3.9 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: FACILITY.req; indicate reception of facility */ +template MNCC_PDU tr_MNCC_FACILITY_ind(template uint32_t call_id := ?, template charstring fac := ?) := { + msg_type := MNCC_FACILITY_IND, + u := { + signal := { /* See 24.008 9.3.9 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC -> MNCC: START_DTMF.ind; MS has */ +template MNCC_PDU tr_MNCC_START_DTMF_ind(template uint32_t call_id := ?, template MNCC_keypad keypad := ?) := { + msg_type := MNCC_START_DTMF_IND, + u := { + signal := { /* See 24.008 9.3.24 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := keypad, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */ +template MNCC_PDU ts_MNCC_START_DTMF_rsp(uint32_t call_id, MNCC_keypad keypad) := { + msg_type := MNCC_START_DTMF_RSP, + u := { + signal := { /* See 24.008 9.3.25 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := keypad, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */ +template MNCC_PDU ts_MNCC_START_DTMF_rej(uint32_t call_id, MNCC_cause cause) := { + msg_type := MNCC_START_DTMF_REJ, + u := { + signal := { /* See 24.008 9.3.26 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: STOP_DTMF.ind */ +template MNCC_PDU tr_MNCC_STOP_DTMF_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_STOP_DTMF_IND, call_id); /* See 24.008 9.3.29 */ + +/* : MSC <- MNCC: STOP_DTMF.rsp; Acknowledge stop of DTMF */ +template MNCC_PDU ts_MNCC_STOP_DTMF_rsp(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_STOP_DTMF_RSP, call_id); /* See 24.008 9.3.30 */ + +/* : MSC -> MNCC: MODIFY.ind; request to start MO in-call modification */ +template MNCC_PDU tr_MNCC_MODIFY_ind(template uint32_t call_id := ?, template MNCC_bearer_cap bcap := ?) := { + msg_type := MNCC_MODIFY_IND, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: MODIFY.rsp; tespond to MO in-call modification */ +template MNCC_PDU ts_MNCC_MODIFY_rsp(uint32_t call_id, MNCC_bearer_cap bcap) := { + msg_type := MNCC_MODIFY_RSP, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC <- MNCC: MODIFY.req; request to start MT in-call modification */ +template MNCC_PDU ts_MNCC_MODIFY_req(uint32_t call_id, MNCC_bearer_cap bcap) := { + msg_type := MNCC_MODIFY_REQ, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: MODIFY.cnf; MS has responded to MT in-call modification */ +template MNCC_PDU tr_MNCC_MODIFY_cnf(template uint32_t call_id := ?, + template MNCC_bearer_cap bcap := ?) := { + msg_type := MNCC_MODIFY_CNF, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: Request transmission of USERINFO to MS */ +template MNCC_PDU ts_MNCC_USERINFO_req(uint32_t call_id, MNCC_useruser uu, integer more) := { + msg_type := MNCC_USERINFO_REQ, + u := { + signal := { /* See 24.008 9.3.31 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := uu, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := more, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: Indicate reception of USERINFO from MS */ +template MNCC_PDU tr_MNCC_USERINFO_ind(template uint32_t call_id := ?, template MNCC_useruser uu := ?, + integer more) := { + msg_type := MNCC_USERINFO_IND, + u := { + signal := { /* See 24.008 9.3.31 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := uu, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := more, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: HOLD.ind; MS requests hold of call */ +template MNCC_PDU tr_MNCC_HOLD_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_HOLD_IND, call_id); /* See 24.008 9.3.10 */ + +/* : MSC <- MNCC: HOLD.cnf; network confirms hold of call */ +template MNCC_PDU ts_MNCC_HOLD_cnf(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_HOLD_CNF, call_id); /* See 24.008 9.3.11 */ + +/* : MSC <- MNCC: HOLD.rej; network rejects hold of call */ +template MNCC_PDU ts_MNCC_HOLD_rej(uint32_t call_id, MNCC_cause cause) := { + msg_type := MNCC_HOLD_REJ, + u := { + signal := { /* See 24.008 9.3.12 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: RETRIEVE.ind; MS requests retrieval of held call */ +template MNCC_PDU tr_MNCC_RETRIEVE_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_RETRIEVE_IND, call_id); /* See 24.008 9.3.20 */ + +/* : MSC <- MNCC: RETRIEVE.cnf; network confirms retrieve of call */ +template MNCC_PDU ts_MNCC_RETRIEVE_cnf(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_RETRIEVE_CNF, call_id); /* See 24.008 9.3.21 */ + +/* : MSC <- MNCC: RETRIEVE.rej; network rejects retrieve of call */ +template MNCC_PDU ts_MNCC_RETRIEVE_rej(uint32_t call_id, MNCC_cause cause) +modifies ts_MNCC_HOLD_rej := { /* See 24.008 9.3.22 */ + msg_type := MNCC_RETRIEVE_REJ +} + + +template MNCC_PDU ts_MNCC_SIMPLE_RTP(MNCC_MsgType msg_type, uint32_t call_id) := { + msg_type := msg_type, + u := { + rtp := { + callref := call_id, + ip := 0, + rtp_port := 0, + payload_type := 0, + payload_msg_type := 0 + } + } +} + +/* MSC <- MNCC: RTP_CREATE.req; request creation of RTP */ +template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id); + +/* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */ +template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := { + msg_type := MNCC_RTP_CREATE, + u := { + rtp := { + callref := call_id, + ip := ?, + rtp_port := ?, + payload_type := ?, + payload_msg_type := ? + } + } +} + +/* MSC <- MNCC: RTP_CONNECT.req; request connect of RTP */ +template MNCC_PDU ts_MNCC_RTP_CONNECT(uint32_t call_id, uint32_t ip, uint32_t rtp_port, uint32_t pt) := { + msg_type := MNCC_RTP_CONNECT, + u := { + rtp := { + callref := call_id, + ip := ip, + rtp_port := rtp_port, + payload_type := pt, + payload_msg_type := 0 + } + } +} + +/* MSC <- MNCC: RTP_FREE.req; request connect of RTP */ +template MNCC_PDU ts_MNCC_RTP_FREE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_FREE, call_id); } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/5846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I77665aaf589bdaa9dc0aa6a5daa431fafdc2b383 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:00:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:00:54 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC: Add some useful templates / helper functions Message-ID: Review at https://gerrit.osmocom.org/5847 MNCC: Add some useful templates / helper functions Change-Id: I59374f9f17600bd405b52dd3a0bcdb39b9ac9adc --- M library/MNCC_CodecPort.ttcn M library/MNCC_Types.ttcn 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/5847/1 diff --git a/library/MNCC_CodecPort.ttcn b/library/MNCC_CodecPort.ttcn index ce62e39..14dc90b 100644 --- a/library/MNCC_CodecPort.ttcn +++ b/library/MNCC_CodecPort.ttcn @@ -46,5 +46,19 @@ }; +template MNCC_send_data t_SD_MNCC(integer id, template MNCC_PDU pdu) := { + data := pdu, + id := id +} + +template MNCC_send_data t_SD_MNCC_MSGT(integer id, template MNCC_MsgType msg_type) := { + data := { + msg_type := msg_type, + u := ? + }, + id := id +} + + } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 2c08e27..62fe3a0 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -1434,4 +1434,17 @@ /* MSC <- MNCC: RTP_FREE.req; request connect of RTP */ template MNCC_PDU ts_MNCC_RTP_FREE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_FREE, call_id); +function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t { + if (ischosen(pdu.u.rtp)) { + return pdu.u.rtp.callref; + } else if (ischosen(pdu.u.data)) { + return pdu.u.data.callref; + } else if (ischosen(pdu.u.signal)) { + return pdu.u.signal.callref; + } else { + setverdict(fail, "Unable to determine Callref for MNCC", pdu); + self.stop + } +} + } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/5847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I59374f9f17600bd405b52dd3a0bcdb39b9ac9adc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:00:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:00:55 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC: Make sure all unused fields are set to omit, not 'unbo... Message-ID: Review at https://gerrit.osmocom.org/5848 MNCC: Make sure all unused fields are set to omit, not 'unbound' Change-Id: I0ef3afa19d4ad5e011a7c0d86f8367461608e163 --- M library/MNCC_EncDec.cc 1 file changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/48/5848/1 diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc index eec3897..2c68cb1 100644 --- a/library/MNCC_EncDec.cc +++ b/library/MNCC_EncDec.cc @@ -218,6 +218,11 @@ in_mncc = (struct gsm_mncc *) ttcn_buffer.get_read_data(); + sign.set_implicit_omit(); + hello.set_implicit_omit(); + data.set_implicit_omit(); + rtp.set_implicit_omit(); + switch (in_mncc->msg_type) { case MNCC_SOCKET_HELLO: in_hello = (const struct gsm_mncc_hello *) in_mncc; -- To view, visit https://gerrit.osmocom.org/5848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ef3afa19d4ad5e011a7c0d86f8367461608e163 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:00:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:00:55 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC_Types: Add enumerated for cause location + cause coding Message-ID: Review at https://gerrit.osmocom.org/5849 MNCC_Types: Add enumerated for cause location + cause coding Change-Id: If67691a7a18cdde726dfcab48fdfc7b29bd518b4 --- M library/MNCC_Types.ttcn 1 file changed, 26 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/49/5849/1 diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 62fe3a0..7bd47ee 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -214,6 +214,26 @@ GSM48_SCR_IND_NETW_PROVIDED (3) }; +/* 24.008 Table 10.5.122 */ +type enumerated GSM48_cause_coding { + GSM48_CAUSE_CS_Q931 ('00'B), + GSM48_CAUSE_CS_RSVD ('01'B), + GSM48_CAUSE_CS_NATIONAL ('10'B), + GSM48_CAUSE_CS_GSM ('11'B) +} + +type enumerated GSM48_cause_loc { + GSM48_CAUSE_LOC_USER ('0000'B), + GSM48_CAUSE_LOC_PRN_S_LU ('0001'B), + GSM48_CAUSE_LOC_PUN_S_LU ('0010'B), + GSM48_CAUSE_LOC_TRANS_NET ('0011'B), + GSM48_CAUSE_LOC_PUN_S_RU ('0100'B), + GSM48_CAUSE_LOC_PRN_S_RU ('0101'B), + GSM48_CAUSE_LOC_INN_NET ('0111'B), + GSM48_CAUSE_LOC_NET_BEYOND ('1010'B) +} + + template MNCC_number ts_MNCC_number(charstring number, GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL, @@ -228,13 +248,16 @@ } type record MNCC_cause { - int location, - int coding, + GSM48_cause_loc location, + GSM48_cause_coding coding, int rec, int rec_val, int val, octetstring diag -}; +} with { + variant (location) "FIELDLENGTH(32)"; + variant (coding) "FIELDLENGTH(32)"; +} type record MNCC_useruser { int proto, -- To view, visit https://gerrit.osmocom.org/5849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If67691a7a18cdde726dfcab48fdfc7b29bd518b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:03:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 13:03:53 +0000 Subject: [PATCH] osmo-pcu[master]: Drop vty tests Message-ID: Review at https://gerrit.osmocom.org/5850 Drop vty tests There're no OsmoPCU-specific tests, just generic check for "show version" and alike which are verified by other projects anyway. In case of OsmoPCU those are proved unreliable and cause sporadic failures in jenkins test. The likely way forward seems to be osmo_verify_transcript_vty.py tests so let's remove unstable tests for now to unbreak the build. Change-Id: Iddd3cd637747902f20f0b6c3b56ba12ccaf0deb3 --- M tests/Makefile.am 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/50/5850/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index 04136f5..d54570c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -138,7 +138,6 @@ # Python testing if ENABLE_VTY_TESTS python-tests: $(BUILT_SOURCES) - osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v else -- To view, visit https://gerrit.osmocom.org/5850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iddd3cd637747902f20f0b6c3b56ba12ccaf0deb3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:23:11 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 17 Jan 2018 13:23:11 +0000 Subject: libosmocore[master]: fsm: fix double llist_del in osmo_fsm_inst_term() In-Reply-To: References: Message-ID: Patch Set 1: > llist_del Form an empty list is a safe Operation. So is tzhis a > purely cosmetic fix orcdid you See any real world issue? Yes, https://gerrit.osmocom.org/5832 causes a segfault in osmo_fsm_inst_term() when osmo_fsm_inst_unlink_parent() was called before. I see a problem with llist_del() in linuxlist.h. llist_del() overwrites entry->next and entry->prev with LLIST_POISONn values. But before doing this it executes __list_del() which dereferences entry->prev and entry->next. When we run llist_del() a second time we segfault because we try to dereference ethe LLIST_POISONn addresses we assigned to the pointers last time. We could check the addresses in llist_del() but I did not want to change the behaviour of llist_del(), probably there is a good reason why it is built that way. -- To view, visit https://gerrit.osmocom.org/5831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:23:52 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 17 Jan 2018 13:23:52 +0000 Subject: [PATCH] libosmocore[master]: fsm: add functions for unlinking and changing parents In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5832 to look at the new patch set (#2). fsm: add functions for unlinking and changing parents At the moment it is not possible to unlink a child from from its parent, nor is it possible to assign a new parent to a child FSM. - osmo_fsm_inst_unlink_parent(): Make it possible to unlink childs from a parent. - osmo_fsm_inst_change_parent(): Make it possible to change the parent of a child. Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 37 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/5832/2 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2fbb250..83164cd 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -150,6 +150,10 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event); +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi); +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event); void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); diff --git a/src/fsm.c b/src/fsm.c index f9effc4..4b8e526 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -272,13 +272,43 @@ LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); + osmo_fsm_inst_change_parent(fi, parent, parent_term_event); return fi; } +/*! unlink child FSM from its parent FSM. + * \param[in] fi Descriptor of the child FSM to unlink. */ +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi) +{ + if (fi->proc.parent) { + talloc_steal(NULL, fi); + fi->proc.parent = NULL; + fi->proc.parent_term_event = 0; + llist_del(&fi->proc.child); + } +} + +/*! change parent instance of an FSM. + * \param[in] fi Descriptor of the to-be-allocated FSM. + * \param[in] new_parent New parent FSM instance. + * \param[in] new_parent_term_event Event to be sent to parent when terminating. */ +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event) +{ + /* Make sure a possibly existing old parent is unlinked first */ + osmo_fsm_inst_unlink_parent(fi); + + /* Add new parent */ + if (new_parent) { + talloc_steal(new_parent, fi); + fi->proc.parent = new_parent; + fi->proc.parent_term_event = new_parent_term_event; + llist_add(&fi->proc.child, &new_parent->proc.children); + } +} + /*! delete a given instance of a FSM * \param[in] fsm The FSM to be un-registered and deleted */ -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:30:10 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 13:30:10 +0000 Subject: [PATCH] osmo-ci[master]: Fix missing OsmoPCU master build Message-ID: Review at https://gerrit.osmocom.org/5851 Fix missing OsmoPCU master build Similar to Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b fix the master branch builds. Change-Id: Icdd53a7cb037324a568e8eab529716e030e00583 --- M jobs/master-builds.yml 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/51/5851/1 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index b98513a..2275539 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -204,15 +204,15 @@ a1_name: FIRMWARE_VERSION a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] a2_name: with_vty - a2: !!python/tuple [yes ,no] + a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] combination_filter: > - (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || - (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master") - osmo-sgsn: a1_name: IU -- To view, visit https://gerrit.osmocom.org/5851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icdd53a7cb037324a568e8eab529716e030e00583 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:33:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:33:05 +0000 Subject: libosmocore[master]: fsm: fix double llist_del in osmo_fsm_inst_term() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:33:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:33:28 +0000 Subject: [MERGED] libosmocore[master]: fsm: fix double llist_del in osmo_fsm_inst_term() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fsm: fix double llist_del in osmo_fsm_inst_term() ...................................................................... fsm: fix double llist_del in osmo_fsm_inst_term() llist_del(&fi->proc.child) is executed always, regardless whether a parent is configured or not. This may lead into a double llist_del when the child has been previously unlinked. - check if fi->proc.parent is set, and only then execute llist_del(&fi->proc.child); Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac --- M src/fsm.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/fsm.c b/src/fsm.c index 0bdcd9d..f9effc4 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -483,10 +483,11 @@ /* delete ourselves from the parent */ parent = fi->proc.parent; - if (parent) + if (parent) { LOGPFSMSRC(fi, file, line, "Removing from parent %s\n", osmo_fsm_inst_name(parent)); - llist_del(&fi->proc.child); + llist_del(&fi->proc.child); + } /* call destructor / clean-up function */ if (fi->fsm->cleanup) -- To view, visit https://gerrit.osmocom.org/5831 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b33d508c8a11b72fbf30125088a882894d9e6ac Gerrit-PatchSet: 2 Gerrit-Project: libosmocore 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 Wed Jan 17 13:33:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:33:50 +0000 Subject: osmo-ci[master]: Fix missing OsmoPCU master build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icdd53a7cb037324a568e8eab529716e030e00583 Gerrit-PatchSet: 1 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 Jan 17 13:33:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:33:51 +0000 Subject: [MERGED] osmo-ci[master]: Fix missing OsmoPCU master build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix missing OsmoPCU master build ...................................................................... Fix missing OsmoPCU master build Similar to Idac6e53b1e0addbcb5b6c99b8051e1e0ad26bc5b fix the master branch builds. Change-Id: Icdd53a7cb037324a568e8eab529716e030e00583 --- M jobs/master-builds.yml 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index b98513a..2275539 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -204,15 +204,15 @@ a1_name: FIRMWARE_VERSION a1: !!python/tuple [master, v2017.01, origin/nrw/litecell15-next] a2_name: with_vty - a2: !!python/tuple [yes ,no] + a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] combination_filter: > - (with_vty == "yes" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || - (with_vty == "yes" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || - (with_vty == "no" && with_dsp == "none" && FIRMWARE_VERSION=="master") + (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="v2017.01") || + (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="origin/nrw/litecell15-next") || + (with_vty == "False" && with_dsp == "none" && FIRMWARE_VERSION=="master") - osmo-sgsn: a1_name: IU -- To view, visit https://gerrit.osmocom.org/5851 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icdd53a7cb037324a568e8eab529716e030e00583 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:50 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC_Types: Add templates for most MNCC messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I77665aaf589bdaa9dc0aa6a5daa431fafdc2b383 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:53 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC: Add some useful templates / helper functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I59374f9f17600bd405b52dd3a0bcdb39b9ac9adc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:55 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC: Make sure all unused fields are set to omit, not 'unbo... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ef3afa19d4ad5e011a7c0d86f8367461608e163 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:56 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC_Types: Add enumerated for cause location + cause coding In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If67691a7a18cdde726dfcab48fdfc7b29bd518b4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:58 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC_Types: Add enumerated for cause location + cause coding In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC_Types: Add enumerated for cause location + cause coding ...................................................................... MNCC_Types: Add enumerated for cause location + cause coding Change-Id: If67691a7a18cdde726dfcab48fdfc7b29bd518b4 --- M library/MNCC_Types.ttcn 1 file changed, 26 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 62fe3a0..7bd47ee 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -214,6 +214,26 @@ GSM48_SCR_IND_NETW_PROVIDED (3) }; +/* 24.008 Table 10.5.122 */ +type enumerated GSM48_cause_coding { + GSM48_CAUSE_CS_Q931 ('00'B), + GSM48_CAUSE_CS_RSVD ('01'B), + GSM48_CAUSE_CS_NATIONAL ('10'B), + GSM48_CAUSE_CS_GSM ('11'B) +} + +type enumerated GSM48_cause_loc { + GSM48_CAUSE_LOC_USER ('0000'B), + GSM48_CAUSE_LOC_PRN_S_LU ('0001'B), + GSM48_CAUSE_LOC_PUN_S_LU ('0010'B), + GSM48_CAUSE_LOC_TRANS_NET ('0011'B), + GSM48_CAUSE_LOC_PUN_S_RU ('0100'B), + GSM48_CAUSE_LOC_PRN_S_RU ('0101'B), + GSM48_CAUSE_LOC_INN_NET ('0111'B), + GSM48_CAUSE_LOC_NET_BEYOND ('1010'B) +} + + template MNCC_number ts_MNCC_number(charstring number, GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL, @@ -228,13 +248,16 @@ } type record MNCC_cause { - int location, - int coding, + GSM48_cause_loc location, + GSM48_cause_coding coding, int rec, int rec_val, int val, octetstring diag -}; +} with { + variant (location) "FIELDLENGTH(32)"; + variant (coding) "FIELDLENGTH(32)"; +} type record MNCC_useruser { int proto, -- To view, visit https://gerrit.osmocom.org/5849 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If67691a7a18cdde726dfcab48fdfc7b29bd518b4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:58 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC: Make sure all unused fields are set to omit, not 'unbo... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC: Make sure all unused fields are set to omit, not 'unbound' ...................................................................... MNCC: Make sure all unused fields are set to omit, not 'unbound' Change-Id: I0ef3afa19d4ad5e011a7c0d86f8367461608e163 --- M library/MNCC_EncDec.cc 1 file changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc index eec3897..2c68cb1 100644 --- a/library/MNCC_EncDec.cc +++ b/library/MNCC_EncDec.cc @@ -218,6 +218,11 @@ in_mncc = (struct gsm_mncc *) ttcn_buffer.get_read_data(); + sign.set_implicit_omit(); + hello.set_implicit_omit(); + data.set_implicit_omit(); + rtp.set_implicit_omit(); + switch (in_mncc->msg_type) { case MNCC_SOCKET_HELLO: in_hello = (const struct gsm_mncc_hello *) in_mncc; -- To view, visit https://gerrit.osmocom.org/5848 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ef3afa19d4ad5e011a7c0d86f8367461608e163 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:59 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC: Add some useful templates / helper functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC: Add some useful templates / helper functions ...................................................................... MNCC: Add some useful templates / helper functions Change-Id: I59374f9f17600bd405b52dd3a0bcdb39b9ac9adc --- M library/MNCC_CodecPort.ttcn M library/MNCC_Types.ttcn 2 files changed, 27 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_CodecPort.ttcn b/library/MNCC_CodecPort.ttcn index ce62e39..14dc90b 100644 --- a/library/MNCC_CodecPort.ttcn +++ b/library/MNCC_CodecPort.ttcn @@ -46,5 +46,19 @@ }; +template MNCC_send_data t_SD_MNCC(integer id, template MNCC_PDU pdu) := { + data := pdu, + id := id +} + +template MNCC_send_data t_SD_MNCC_MSGT(integer id, template MNCC_MsgType msg_type) := { + data := { + msg_type := msg_type, + u := ? + }, + id := id +} + + } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 2c08e27..62fe3a0 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -1434,4 +1434,17 @@ /* MSC <- MNCC: RTP_FREE.req; request connect of RTP */ template MNCC_PDU ts_MNCC_RTP_FREE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_FREE, call_id); +function f_mncc_get_call_id(MNCC_PDU pdu) return uint32_t { + if (ischosen(pdu.u.rtp)) { + return pdu.u.rtp.callref; + } else if (ischosen(pdu.u.data)) { + return pdu.u.data.callref; + } else if (ischosen(pdu.u.signal)) { + return pdu.u.signal.callref; + } else { + setverdict(fail, "Unable to determine Callref for MNCC", pdu); + self.stop + } +} + } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/5847 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I59374f9f17600bd405b52dd3a0bcdb39b9ac9adc Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 13:34:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 13:34:59 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC_Types: Add templates for most MNCC messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC_Types: Add templates for most MNCC messages ...................................................................... MNCC_Types: Add templates for most MNCC messages This adds templates for sending and receiving MNCC messages from the external MNCC handler point of view, i.e. as required for MSC testing. The inverse templates will be needed if we want to implement emulation of the MSC side of MNCC. Change-Id: I77665aaf589bdaa9dc0aa6a5daa431fafdc2b383 --- M library/MNCC_Types.ttcn 1 file changed, 1,058 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 956a1ae..2c08e27 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -252,6 +252,9 @@ int pcp }; +type int MNCC_notify (0..127); +type int MNCC_keypad (0..127); + type enumerated MNCC_bcap { GSM_MNCC_BCAP_SPEECH (0), GSM_MNCC_BCAP_UNR_DIG (1), @@ -281,9 +284,9 @@ int clir_inv, int signal optional, - int keypad optional, + MNCC_keypad keypad optional, int more, - int notify (0..127), + MNCC_notify notify, int emergency optional, charstring imsi, @@ -353,14 +356,14 @@ } } -template MNCC_PDU ts_MNCC_SETUP(uint32_t call_id, charstring called, charstring calling) := { - msg_type := MNCC_SETUP_REQ, +template MNCC_PDU ts_MNCC_SIMPLE(MNCC_MsgType msg_type, uint32_t call_id) := { + msg_type := msg_type, u := { signal := { callref := call_id, - bearer_cap := ts_MNCC_bcap_voice, - called := valueof(ts_MNCC_number(called)), - calling := valueof(ts_MNCC_number(calling)), + bearer_cap := omit, + called := omit, + calling := omit, redirecting := omit, connected := omit, cause := omit, @@ -376,12 +379,1059 @@ more := 0, notify := 0, emergency := omit, - imsi := "1234", + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +template MNCC_PDU tr_MNCC_SIMPLE(template MNCC_MsgType msg_type, template uint32_t call_id) := { + msg_type := msg_type, + u := { + signal := { + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + + + +/* MT: MSC <- MNCC: SETUP.req from ext. MNCC handler to MSC */ +template MNCC_PDU ts_MNCC_SETUP_req(uint32_t call_id, charstring called, charstring calling, charstring imsi := "") := { + msg_type := MNCC_SETUP_REQ, + u := { + signal := { /* See 24.008 9.3.23.1 */ + callref := call_id, + bearer_cap := ts_MNCC_bcap_voice, /* mandatory */ + called := valueof(ts_MNCC_number(called)), /* optional */ + calling := valueof(ts_MNCC_number(calling)), /* optional */ + redirecting := omit, /* optional */ + connected := omit, + cause := omit, + progress := omit, /* optional */ + useruser := omit, /* optional */ + facility := omit, /* optional */ + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, /* optional */ + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := imsi, lchan_type := 0, lchan_mode := 0 } } }; +/* MT: MSC -> MNCC: Respons to SETUP.req */ +template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id := ?, template MNCC_number connected := *, + template charstring imsi := ?) := { + msg_type := MNCC_SETUP_RSP, + u := { + signal := { /* See 24.008 9.3.5 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := connected, + cause := omit, + progress := omit, + useruser := *, + facility := *, + cccap := omit, + ssversion := *, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := imsi, + lchan_type := ?, + lchan_mode := ? + } + } +}; + +/* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */ +template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template MNCC_number called := ?, + template MNCC_number calling := *, template charstring imsi :=?) := { + msg_type := MNCC_SETUP_IND, + u := { + signal := { /* See 24.008 9.3.23.2 */ + callref := call_id, + bearer_cap := ?, /* mandatory */ + called := called, /* mandatory */ + calling := calling, /* optional */ + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := *, /* optional */ + facility := *, /* optional */ + cccap := *, /* optional */ + ssversion := *, /* optional */ + clir_sup := ?, /* optional */ + clir_inv := ?, /* optional */ + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := imsi, + lchan_type := ?, + lchan_mode := ? + } + } + +} + +/* MO: MSC <- MNCC: SETUP.cnf; Response to SETUP.ind */ +template MNCC_PDU ts_MNCC_SETUP_CNF(uint32_t call_id, template MNCC_number connected := omit) := { + msg_type := MNCC_SETUP_CNF, + u := { + signal := { /* See 24.008 9.3.5 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := connected, + cause := omit, + progress := *, + useruser := *, + facility := *, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := "", + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* MO: MSC <- MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ +template MNCC_PDU ts_MNCC_SETUP_COMPL_req(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ + +/* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */ +template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 9.3.6 */ + +/* MT: MSC -> MNCC: REJ.req; reject MT call */ +template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template MNCC_cause cause := *) := { + msg_type := MNCC_REJ_REQ, + u := { + signal := { /* See 24.008 9.3.19 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := *, + facility := *, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* MO: MSC <- MNCC: REJ.ind; reject MO call */ +template MNCC_PDU ts_MNCC_REJ_ind(uint32_t call_id, template MNCC_cause cause := omit) := { + msg_type := MNCC_REJ_IND, + u := { + signal := { /* See 24.008 9.3.19 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MT: MSC <- MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ +template MNCC_PDU ts_MNCC_CALL_CONF_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, + template MNCC_cause cause := omit, + template MNCC_cccap cccap := omit) := { + msg_type := MNCC_CALL_CONF_IND, + u := { + signal := { /* See 24.008 9.3.2 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := cccap, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MO: MSC <- MNCC: CALL_PROC.req; call establishment initiated in network */ +template MNCC_PDU ts_MNCC_CALL_PROC_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, + template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_cccap cccap := omit) := { + msg_type := MNCC_CALL_PROC_REQ, + u := { + signal := { /* See 24.008 9.3.2 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := omit, + facility := fac, + cccap := cccap, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */ +template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_PROGRESS_REQ, + u := { + signal := { /* See 24.008 9.3.17 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := uu, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* MO: MSC <- MNCC: ALERT.req; indicate that user alerting has been initiated */ +template MNCC_PDU ts_MNCC_ALERT_req(uint32_t call_id, template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_ALERT_REQ, + u := { + signal := { /* See 24.008 9.3.1 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + + +/* MT: MSC -> MNCC: ALERRT.ind; indicates that mobile user alerting has been initiated */ +template MNCC_PDU tr_MNCC_ALERT_ind(template uint32_t call_id, template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_ALERT_REQ, + u := { + signal := { /* See 24.008 9.3.1 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: NOTIFY.req; request to send information pertaining to a call (such as user suspended) */ +template MNCC_PDU ts_MNCC_NOTIFY_req(uint32_t call_id, MNCC_notify notify) := { + msg_type := MNCC_NOTIFY_REQ, + u := { + signal := { /* See 24.008 9.3.16 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := notify, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: NOTIFY.ind; indication to the mobile user */ +template MNCC_PDU tr_MNCC_NOTIFY_ind(template uint32_t call_id, template MNCC_notify notify) := { + msg_type := MNCC_NOTIFY_IND, + u := { + signal := { /* See 24.008 9.3.16 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := notify, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC -> MNCC: DISC.ind; mobile user requests disconnect */ +template MNCC_PDU tr_MNCC_DISC_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?, + template MNCC_progress prog := *, + template charstring fac := *, + template MNCC_useruser uu := *) := { + msg_type := MNCC_DISC_IND, + u := { + signal := { /* See 24.008 9.3.7 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: DISC.req; indicate disconnect to mobile user */ +template MNCC_PDU ts_MNCC_DISC_req(uint32_t call_id, MNCC_cause cause, + template MNCC_progress prog := omit, + template charstring fac := omit, + template MNCC_useruser uu := omit) := { + msg_type := MNCC_DISC_REQ, + u := { + signal := { /* See 24.008 9.3.7 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := prog, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: REL.ind; mobile user informs network that user wants to release call + MM */ +template MNCC_PDU tr_MNCC_REL_ind(template uint32_t call_id := ?, template MNCC_cause cause := ?, + template charstring fac := *, template MNCC_useruser uu := *) := { + msg_type := MNCC_REL_IND, + u := { + signal := { /* See 24.008 9.3.18 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: REL.req; indicate to mobile user tat network intents to release MM */ +template MNCC_PDU ts_MNCC_REL_req(uint32_t call_id, MNCC_cause cause, + template charstring fac := omit, template MNCC_useruser uu := omit) := { + msg_type := MNCC_REL_REQ, + u := { + signal := { /* See 24.008 9.3.18 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := uu, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: REL.cnf; confirm REL_req */ +template MNCC_PDU tr_MNCC_REL_cnf(template uint32_t call_id := ?, template MNCC_cause cause := ?, + template charstring fac := *, template MNCC_useruser uu := *) +modifies tr_MNCC_REL_ind := { + msg_type := MNCC_REL_CNF +}; + +/* : MSC <- MNCC: FACILITY.req; request transmission of facility */ +template MNCC_PDU ts_MNCC_FACILITY_req(uint32_t call_id, charstring fac) := { + msg_type := MNCC_FACILITY_REQ, + u := { + signal := { /* See 24.008 9.3.9 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: FACILITY.req; indicate reception of facility */ +template MNCC_PDU tr_MNCC_FACILITY_ind(template uint32_t call_id := ?, template charstring fac := ?) := { + msg_type := MNCC_FACILITY_IND, + u := { + signal := { /* See 24.008 9.3.9 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := fac, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC -> MNCC: START_DTMF.ind; MS has */ +template MNCC_PDU tr_MNCC_START_DTMF_ind(template uint32_t call_id := ?, template MNCC_keypad keypad := ?) := { + msg_type := MNCC_START_DTMF_IND, + u := { + signal := { /* See 24.008 9.3.24 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := keypad, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */ +template MNCC_PDU ts_MNCC_START_DTMF_rsp(uint32_t call_id, MNCC_keypad keypad) := { + msg_type := MNCC_START_DTMF_RSP, + u := { + signal := { /* See 24.008 9.3.25 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := keypad, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC <- MNCC: START_DTMF.rsp; Acknowledge start of DTMF */ +template MNCC_PDU ts_MNCC_START_DTMF_rej(uint32_t call_id, MNCC_cause cause) := { + msg_type := MNCC_START_DTMF_REJ, + u := { + signal := { /* See 24.008 9.3.26 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: STOP_DTMF.ind */ +template MNCC_PDU tr_MNCC_STOP_DTMF_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_STOP_DTMF_IND, call_id); /* See 24.008 9.3.29 */ + +/* : MSC <- MNCC: STOP_DTMF.rsp; Acknowledge stop of DTMF */ +template MNCC_PDU ts_MNCC_STOP_DTMF_rsp(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_STOP_DTMF_RSP, call_id); /* See 24.008 9.3.30 */ + +/* : MSC -> MNCC: MODIFY.ind; request to start MO in-call modification */ +template MNCC_PDU tr_MNCC_MODIFY_ind(template uint32_t call_id := ?, template MNCC_bearer_cap bcap := ?) := { + msg_type := MNCC_MODIFY_IND, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: MODIFY.rsp; tespond to MO in-call modification */ +template MNCC_PDU ts_MNCC_MODIFY_rsp(uint32_t call_id, MNCC_bearer_cap bcap) := { + msg_type := MNCC_MODIFY_RSP, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC <- MNCC: MODIFY.req; request to start MT in-call modification */ +template MNCC_PDU ts_MNCC_MODIFY_req(uint32_t call_id, MNCC_bearer_cap bcap) := { + msg_type := MNCC_MODIFY_REQ, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: MODIFY.cnf; MS has responded to MT in-call modification */ +template MNCC_PDU tr_MNCC_MODIFY_cnf(template uint32_t call_id := ?, + template MNCC_bearer_cap bcap := ?) := { + msg_type := MNCC_MODIFY_CNF, + u := { + signal := { /* See 24.008 9.3.14 */ + callref := call_id, + bearer_cap := bcap, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := *, + imsi := ?, + lchan_type := ?, + lchan_mode := ? + } + } +} + +/* : MSC <- MNCC: Request transmission of USERINFO to MS */ +template MNCC_PDU ts_MNCC_USERINFO_req(uint32_t call_id, MNCC_useruser uu, integer more) := { + msg_type := MNCC_USERINFO_REQ, + u := { + signal := { /* See 24.008 9.3.31 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := uu, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := more, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: Indicate reception of USERINFO from MS */ +template MNCC_PDU tr_MNCC_USERINFO_ind(template uint32_t call_id := ?, template MNCC_useruser uu := ?, + integer more) := { + msg_type := MNCC_USERINFO_IND, + u := { + signal := { /* See 24.008 9.3.31 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := omit, + progress := omit, + useruser := uu, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := more, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: HOLD.ind; MS requests hold of call */ +template MNCC_PDU tr_MNCC_HOLD_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_HOLD_IND, call_id); /* See 24.008 9.3.10 */ + +/* : MSC <- MNCC: HOLD.cnf; network confirms hold of call */ +template MNCC_PDU ts_MNCC_HOLD_cnf(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_HOLD_CNF, call_id); /* See 24.008 9.3.11 */ + +/* : MSC <- MNCC: HOLD.rej; network rejects hold of call */ +template MNCC_PDU ts_MNCC_HOLD_rej(uint32_t call_id, MNCC_cause cause) := { + msg_type := MNCC_HOLD_REJ, + u := { + signal := { /* See 24.008 9.3.12 */ + callref := call_id, + bearer_cap := omit, + called := omit, + calling := omit, + redirecting := omit, + connected := omit, + cause := cause, + progress := omit, + useruser := omit, + facility := omit, + cccap := omit, + ssversion := omit, + clir_sup := 0, + clir_inv := 0, + signal := omit, + keypad := omit, + more := 0, + notify := 0, + emergency := omit, + imsi := "", + lchan_type := 0, + lchan_mode := 0 + } + } +} + +/* : MSC -> MNCC: RETRIEVE.ind; MS requests retrieval of held call */ +template MNCC_PDU tr_MNCC_RETRIEVE_ind(template uint32_t call_id := ?) := + tr_MNCC_SIMPLE(MNCC_RETRIEVE_IND, call_id); /* See 24.008 9.3.20 */ + +/* : MSC <- MNCC: RETRIEVE.cnf; network confirms retrieve of call */ +template MNCC_PDU ts_MNCC_RETRIEVE_cnf(uint32_t call_id) := + ts_MNCC_SIMPLE(MNCC_RETRIEVE_CNF, call_id); /* See 24.008 9.3.21 */ + +/* : MSC <- MNCC: RETRIEVE.rej; network rejects retrieve of call */ +template MNCC_PDU ts_MNCC_RETRIEVE_rej(uint32_t call_id, MNCC_cause cause) +modifies ts_MNCC_HOLD_rej := { /* See 24.008 9.3.22 */ + msg_type := MNCC_RETRIEVE_REJ +} + + +template MNCC_PDU ts_MNCC_SIMPLE_RTP(MNCC_MsgType msg_type, uint32_t call_id) := { + msg_type := msg_type, + u := { + rtp := { + callref := call_id, + ip := 0, + rtp_port := 0, + payload_type := 0, + payload_msg_type := 0 + } + } +} + +/* MSC <- MNCC: RTP_CREATE.req; request creation of RTP */ +template MNCC_PDU ts_MNCC_RTP_CREATE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_CREATE, call_id); + +/* MSC -> MNCC: RTP_CREATE.rsp; acknowledge creation of RTP (stating MSC side IP/Port) */ +template MNCC_PDU tr_MNCC_RTP_CREATE(template uint32_t call_id := ?) := { + msg_type := MNCC_RTP_CREATE, + u := { + rtp := { + callref := call_id, + ip := ?, + rtp_port := ?, + payload_type := ?, + payload_msg_type := ? + } + } +} + +/* MSC <- MNCC: RTP_CONNECT.req; request connect of RTP */ +template MNCC_PDU ts_MNCC_RTP_CONNECT(uint32_t call_id, uint32_t ip, uint32_t rtp_port, uint32_t pt) := { + msg_type := MNCC_RTP_CONNECT, + u := { + rtp := { + callref := call_id, + ip := ip, + rtp_port := rtp_port, + payload_type := pt, + payload_msg_type := 0 + } + } +} + +/* MSC <- MNCC: RTP_FREE.req; request connect of RTP */ +template MNCC_PDU ts_MNCC_RTP_FREE(uint32_t call_id) := ts_MNCC_SIMPLE_RTP(MNCC_RTP_FREE, call_id); } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/5846 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I77665aaf589bdaa9dc0aa6a5daa431fafdc2b383 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:02:05 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 14:02:05 +0000 Subject: [PATCH] osmo-ci[master]: Install pip tool into containers Message-ID: Review at https://gerrit.osmocom.org/5852 Install pip tool into containers The pip(2|3) tool is the officially recommended tool to deal with Python packages [1] with much greater flexibility compared to invoking setup.py directly. As a preparation step for using it to install osmo-python-tests let's add it to container images. [1] https://packaging.python.org/guides/tool-recommendations/ Change-Id: If2702c71cd268ca688e9ecc264f8cd1257c27899 --- M docker/Dockerfile.deb8_amd64 M docker/Dockerfile.deb8_i386 M docker/Dockerfile_osmocom_jenkins.amd64 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/52/5852/1 diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 4d9966f..f32a3c3 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -32,7 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow # for osmo-python-tests -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools python3-pip python-pip # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile.deb8_i386 b/docker/Dockerfile.deb8_i386 index 4d8498c..c9b3aa9 100644 --- a/docker/Dockerfile.deb8_i386 +++ b/docker/Dockerfile.deb8_i386 @@ -32,7 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi # for osmo-python-tests -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools python3-pip python-pip # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 547790c..12154b3 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -32,7 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf # for osmo-python-tests -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools python3-pip python-pip # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc -- To view, visit https://gerrit.osmocom.org/5852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If2702c71cd268ca688e9ecc264f8cd1257c27899 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:07:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 14:07:57 +0000 Subject: [ABANDON] osmo-pcu[master]: Drop vty tests In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Drop vty tests ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5850 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iddd3cd637747902f20f0b6c3b56ba12ccaf0deb3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:33:18 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Jan 2018 14:33:18 +0000 Subject: [PATCH] osmo-bts[master]: bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to ... Message-ID: Review at https://gerrit.osmocom.org/5854 bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func The move includes a small logic change: If there's a mismatch between the rsp and the cmd, now we bts_shutdown instead of blindly skipping expected RSP and continuing with sending the next CMD in the queue. The change is specially not a problem since next patches are improving the logic furthermore to account for duplicates, different parameters, etc. Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e --- M src/osmo-bts-trx/trx_if.c 1 file changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/54/5854/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8123de0..74a2257 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -416,12 +416,8 @@ "transceiver (%s) rejected TRX command " "with response: '%s'\n", phy_instance_name(pinst), buf); -rsp_error: - if (tcm->critical) { - bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); - /* keep tcm list, so process is stopped */ - return -EIO; - } + if (tcm->critical) + goto rsp_error; } /* remove command from list */ @@ -434,6 +430,11 @@ buf); return 0; + +rsp_error: + bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); + /* keep tcm list, so process is stopped */ + return -EIO; } -- To view, visit https://gerrit.osmocom.org/5854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:33:17 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Jan 2018 14:33:17 +0000 Subject: [PATCH] osmo-bts[master]: bts-trx: trx_if.c: Log timedout+retransmitted CMD Message-ID: Review at https://gerrit.osmocom.org/5853 bts-trx: trx_if.c: Log timedout+retransmitted CMD Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a --- M src/osmo-bts-trx/trx_if.c 1 file changed, 7 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/53/5853/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 57fd953..8123de0 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -167,9 +167,14 @@ static void trx_ctrl_timer_cb(void *data) { struct trx_l1h *l1h = data; + struct trx_ctrl_msg *tcm = NULL; - LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s\n", - phy_instance_name(l1h->phy_inst)); + /* get first command */ + OSMO_ASSERT(!llist_empty(&l1h->trx_ctrl_list)); + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); + + LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s (%s)\n", + phy_instance_name(l1h->phy_inst), tcm->cmd); trx_ctrl_send(l1h); } -- To view, visit https://gerrit.osmocom.org/5853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:33:18 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Jan 2018 14:33:18 +0000 Subject: [PATCH] osmo-bts[master]: bts-trx: trx_if.c: Improve parsing of received RSP messages ... Message-ID: Review at https://gerrit.osmocom.org/5855 bts-trx: trx_if.c: Improve parsing of received RSP messages from TRX First the cached CMD sent (struct trx_ctrl_msg) is reworked to have the cmdname and the params in different buffers for easier comparison with RSP later. For the receive path (trx_ctrl_read_cb), new function helpers are added to parse the buffer into cmdname+params+code (parse_rsp) and to compare if a given RSP matches the current CMD we sent (cmd_matches_rsp). The reasoning behind this patch is that a way to check for parameters when receiving a RSP will be needed in future work, as before this patch checking of parameters is ignored. This commit is a preparation for commit to check for duplicated responses. Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034 --- M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h 2 files changed, 131 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/55/5855/1 diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 74a2257..a8026d4 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -146,16 +146,20 @@ static void trx_ctrl_send(struct trx_l1h *l1h) { struct trx_ctrl_msg *tcm; + char buf[1500]; + int len; /* get first command */ if (llist_empty(&l1h->trx_ctrl_list)) return; tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - LOGP(DTRX, LOGL_DEBUG, "Sending control '%s' to %s\n", tcm->cmd, - phy_instance_name(l1h->phy_inst)); + len = snprintf(buf, sizeof(buf), "CMD %s%s%s", tcm->cmd, tcm->params_len ? " ":"", tcm->params); + OSMO_ASSERT(len < sizeof(buf)); + + LOGP(DTRX, LOGL_DEBUG, "Sending control '%s' to %s\n", buf, phy_instance_name(l1h->phy_inst)); /* send command */ - send(l1h->trx_ofd_ctrl.fd, tcm->cmd, strlen(tcm->cmd)+1, 0); + send(l1h->trx_ofd_ctrl.fd, buf, len+1, 0); /* start timer */ l1h->trx_ctrl_timer.cb = trx_ctrl_timer_cb; @@ -173,8 +177,9 @@ OSMO_ASSERT(!llist_empty(&l1h->trx_ctrl_list)); tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s (%s)\n", - phy_instance_name(l1h->phy_inst), tcm->cmd); + LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s (CMD %s%s%s)\n", + phy_instance_name(l1h->phy_inst), + tcm->cmd, tcm->params_len ? " ":"", tcm->params); trx_ctrl_send(l1h); } @@ -193,8 +198,9 @@ const char *fmt, ...) { struct trx_ctrl_msg *tcm; + struct trx_ctrl_msg *prev = NULL; va_list ap; - int l, pending; + int pending; if (!transceiver_available && !(!strcmp(cmd, "POWEROFF") || !strcmp(cmd, "POWERON"))) { @@ -209,21 +215,29 @@ tcm = talloc_zero(tall_bts_ctx, struct trx_ctrl_msg); if (!tcm) return -ENOMEM; - if (fmt && fmt[0]) { - l = snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "CMD %s ", cmd); - va_start(ap, fmt); - vsnprintf(tcm->cmd + l, sizeof(tcm->cmd) - l - 1, fmt, ap); - va_end(ap); - } else - snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "CMD %s", cmd); + snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "%s", cmd); tcm->cmd[sizeof(tcm->cmd)-1] = '\0'; - tcm->cmd_len = strlen(cmd); + tcm->cmd_len = strlen(tcm->cmd); + if (fmt && fmt[0]) { + va_start(ap, fmt); + vsnprintf(tcm->params, sizeof(tcm->params) - 1, fmt, ap); + va_end(ap); + tcm->params[sizeof(tcm->params)-1] = '\0'; + tcm->params_len = strlen(tcm->params); + } else { + tcm->params[0] ='\0'; + tcm->params_len = 0; + } tcm->critical = critical; /* Avoid adding consecutive duplicate messages, eg: two consecutive POWEROFF */ + if(pending) + prev = llist_entry(l1h->trx_ctrl_list.prev, struct trx_ctrl_msg, list); + if (!pending || - strcmp(tcm->cmd, llist_entry(l1h->trx_ctrl_list.prev, struct trx_ctrl_msg, list)->cmd)) { - LOGP(DTRX, LOGL_INFO, "Enqueuing TRX control command '%s'\n", tcm->cmd); + !(strcmp(tcm->cmd, prev->cmd) == 0 && strcmp(tcm->params, prev->params) == 0)) { + LOGP(DTRX, LOGL_INFO, "Enqueuing TRX control command 'CMD %s%s%s'\n", + tcm->cmd, tcm->params_len ? " ":"", tcm->params); llist_add_tail(&tcm->list, &l1h->trx_ctrl_list); } @@ -354,80 +368,124 @@ return trx_ctrl_cmd(l1h, 1, "NOHANDOVER", "%d %d", tn, ss); } +static int parse_rsp(const char *buf_in, size_t len_in, char *cmdname_out, size_t cmdname_len, + char *params_out, size_t params_len, int *status) +{ + char *p, *k; + + if (strncmp(buf_in, "RSP ", 4)) + goto parse_err; + + /* Get the RSP cmd name */ + if (!(p = strchr(buf_in + 4, ' '))) + goto parse_err; + + if (p - buf_in >= cmdname_len) { + LOGP(DTRX, LOGL_ERROR, "cmdname buffer too small %lu >= %lu\n", + p - buf_in, cmdname_len); + goto parse_err; + } + + cmdname_out[0] = '\0'; + strncat(cmdname_out, buf_in + 4, p - buf_in - 4); + + /* Now comes the status code of the response */ + p++; + if (sscanf(p, "%d", status) != 1) + goto parse_err; + + /* Now copy back the parameters */ + k = strchr(p, ' '); + if (k) + k++; + else + k = p + strlen(p); + + if (strlen(k) >= params_len) { + LOGP(DTRX, LOGL_ERROR, "params buffer too small %lu >= %lu\n", + strlen(k), params_len); + goto parse_err; + } + params_out[0] = '\0'; + strcat(params_out, k); + return 0; + +parse_err: + LOGP(DTRX, LOGL_NOTICE, "Unknown message on ctrl port: %s\n", + buf_in); + return -1; +} + +static bool cmd_matches_rsp(struct trx_ctrl_msg *tcm, char *rspname, char* params) +{ + if (strcmp(tcm->cmd, rspname)) + return false; + + /* For SETSLOT we also need to check if it's the response for the + specific timeslot. For other commands such as SETRXGAIN, it is + expected that they can return different values */ + if (strcmp(tcm->cmd, "SETSLOT") == 0 && strcmp(tcm->params, params)) + return false; + + return true; +} + /*! 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; struct phy_instance *pinst = l1h->phy_inst; - char buf[1500]; + char buf[1500], cmdname[50], params[100]; int len, resp; + struct trx_ctrl_msg *tcm; len = recv(ofd->fd, buf, sizeof(buf) - 1, 0); if (len <= 0) return len; buf[len] = '\0'; - if (!strncmp(buf, "RSP ", 4)) { - struct trx_ctrl_msg *tcm; - char *p; - int rsp_len = 0; + if (parse_rsp(buf, len, cmdname, sizeof(cmdname), params, sizeof(params), &resp) < 0) + return 0; - /* calculate the length of response item */ - p = strchr(buf + 4, ' '); - if (p) - rsp_len = p - buf - 4; - else - rsp_len = strlen(buf) - 4; + LOGP(DTRX, LOGL_INFO, "Response message: '%s'\n", buf); - LOGP(DTRX, LOGL_INFO, "Response message: '%s'\n", buf); + /* abort timer and send next message, if any */ + if (osmo_timer_pending(&l1h->trx_ctrl_timer)) + osmo_timer_del(&l1h->trx_ctrl_timer); - /* abort timer and send next message, if any */ - if (osmo_timer_pending(&l1h->trx_ctrl_timer)) - osmo_timer_del(&l1h->trx_ctrl_timer); + /* get command for response message */ + if (llist_empty(&l1h->trx_ctrl_list)) { + LOGP(DTRX, LOGL_NOTICE, "Response message without " + "command\n"); + return -EINVAL; + } + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, + list); - /* get command for response message */ - if (llist_empty(&l1h->trx_ctrl_list)) { - LOGP(DTRX, LOGL_NOTICE, "Response message without " - "command\n"); - return -EINVAL; - } - tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, - list); + /* check if response matches command */ + if (!cmd_matches_rsp(tcm, cmdname, params)) { + LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, + "Response message '%s' does not match command " + "message 'CMD %s%s%s'\n", + buf, tcm->cmd, tcm->params_len ? " ":"", tcm->params); + goto rsp_error; + } - /* check if response matches command */ - if (rsp_len != tcm->cmd_len) { - notmatch: - LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, - "Response message '%s' does not match command " - "message '%s'\n", buf, tcm->cmd); + /* check for response code */ + if (resp) { + LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, + "transceiver (%s) rejected TRX command " + "with response: '%s'\n", + phy_instance_name(pinst), buf); + if (tcm->critical) goto rsp_error; - } - OSMO_ASSERT(strlen(buf+4) >= rsp_len); - OSMO_ASSERT(strlen(tcm->cmd+4) >= rsp_len); - if (!!strncmp(buf + 4, tcm->cmd + 4, rsp_len)) - goto notmatch; + } - /* check for response code */ - resp = 0; - if (p) - sscanf(p + 1, "%d", &resp); - if (resp) { - LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, - "transceiver (%s) rejected TRX command " - "with response: '%s'\n", - phy_instance_name(pinst), buf); - if (tcm->critical) - goto rsp_error; - } + /* remove command from list */ + llist_del(&tcm->list); + talloc_free(tcm); - /* remove command from list */ - llist_del(&tcm->list); - talloc_free(tcm); - - trx_ctrl_send(l1h); - } else - LOGP(DTRX, LOGL_NOTICE, "Unknown message on ctrl port: %s\n", - buf); + trx_ctrl_send(l1h); return 0; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 076e35e..b161044 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -7,8 +7,10 @@ struct trx_ctrl_msg { struct llist_head list; - char cmd[128]; + char cmd[28]; + char params[100]; int cmd_len; + int params_len; int critical; }; -- To view, visit https://gerrit.osmocom.org/5855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:33:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Jan 2018 14:33:19 +0000 Subject: [PATCH] osmo-bts[master]: bts-trx: Detect duplicated responses for retransmitted commands Message-ID: Review at https://gerrit.osmocom.org/5856 bts-trx: Detect duplicated responses for retransmitted commands It was detected that under some conditions, osmo-trx (with limesdr) may take a long time to answer to CMDs, which means trx_ctrl_timer will trigger re-transmitting the last sent but yet unacked CMD. Due to the high latency in osmo-trx, the original AND the rentrasnmited CMD are handled after a while and RSP messages are sent for both. When osmo-bts-trx receives the first RSP, it was marking the CMD as acked and carried on with next one. Then, when the RSP from the retransmited CMD arrives, it already lost state and doesn't know where does that come from. As a result, osmo-bts-trx shutdowns. The issue can be seen in the following truncated log from osmo-bts-trx with TRX category enabled: 20180117135228175 Enqueuing TRX control command 'CMD RXTUNE 1782000' 20180117135228175 Enqueuing TRX control command 'CMD TXTUNE 1877000' 20180117135228175 Enqueuing TRX control command 'CMD SETTSC 7' 20180117135228175 Enqueuing TRX control command 'CMD POWERON' 20180117135228175 Enqueuing TRX control command 'CMD SETRXGAIN 1' 20180117135228175 Enqueuing TRX control command 'CMD SETPOWER 20' 20180117135228175 Enqueuing TRX control command 'CMD SETSLOT 0 5' ... 20180117135249829 Response message: 'RSP POWEROFF 0' 20180117135249855 Response message: 'RSP RXTUNE 0 1782000' 20180117135249876 Response message: 'RSP TXTUNE 0 1877000' 20180117135249876 Response message: 'RSP SETTSC 0 7' 20180117135250648 Response message: 'RSP POWERON 0' 20180117135251150 Response message: 'RSP SETRXGAIN 0 0' 20180117135253151 No response from transceiver for phy0.0 (CMD SETPOWER 20) 20180117135253777 Response message: 'RSP SETPOWER 0 20' 20180117135254535 Clock indication: fn=2018878 20180117135255777 No response from transceiver for phy0.0 (CMD SETSLOT 0 5) ... 20180117135256858 Response message: 'RSP SETPOWER 0 20' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETPOWER 0 20' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETSLOT 0 0 5' Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a --- M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c 2 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/56/5856/1 diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index d978c44..e7b5386 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -3,6 +3,7 @@ #include #include +#include "trx_if.h" struct trx_config { uint8_t poweron; /* poweron(1) or poweroff(0) */ @@ -46,6 +47,8 @@ struct trx_l1h { struct llist_head trx_ctrl_list; + /* Latest RSPed cmd, used to catch duplicate RSPs from sent retransmissions */ + struct trx_ctrl_msg *last_acked; //struct gsm_bts_trx *trx; struct phy_instance *phy_inst; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a8026d4..35698ef 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -455,6 +455,12 @@ /* get command for response message */ if (llist_empty(&l1h->trx_ctrl_list)) { + /* RSP from a retransmission, skip it */ + if (l1h->last_acked && cmd_matches_rsp(l1h->last_acked, cmdname, params)) { + LOGP(DTRX, LOGL_NOTICE, "Discarding duplicated RSP " + "from old CMD '%s'\n", buf); + return 0; + } LOGP(DTRX, LOGL_NOTICE, "Response message without " "command\n"); return -EINVAL; @@ -464,6 +470,12 @@ /* check if response matches command */ if (!cmd_matches_rsp(tcm, cmdname, params)) { + /* RSP from a retransmission, skip it */ + if (l1h->last_acked && cmd_matches_rsp(l1h->last_acked, cmdname, params)) { + LOGP(DTRX, LOGL_NOTICE, "Discarding duplicated RSP " + "from old CMD '%s'\n", buf); + return 0; + } LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, "Response message '%s' does not match command " "message 'CMD %s%s%s'\n", @@ -481,9 +493,10 @@ goto rsp_error; } - /* remove command from list */ + /* remove command from list, save it to last_acked and removed previous last_acked */ llist_del(&tcm->list); - talloc_free(tcm); + talloc_free(l1h->last_acked); + l1h->last_acked = tcm; trx_ctrl_send(l1h); @@ -621,6 +634,7 @@ llist_del(&tcm->list); talloc_free(tcm); } + talloc_free(l1h->last_acked); } /*! close the TRX for given handle (data + control socket) */ -- To view, visit https://gerrit.osmocom.org/5856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:54:32 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 14:54:32 +0000 Subject: [PATCH] gapk[master]: Merge branch 'fixeria/lib' into master In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5778 to look at the new patch set (#2). Merge branch 'fixeria/lib' into master The previous GAPK implementation was represented by a single executable. So, all audio transcoding operations were available only via calling the 'gapk' binary. This approach didn't allow external applications to benefit from using GAPK API directly. The following set of changes separates the common code into a shared library called 'libosmogapk', linking the 'gapk' binary against it: - 95e6664 Introduce a shared 'libosmogapk' library - 30209ce Install GAPK headers to '${includedir}/osmocom/gapk/' - a8d4657 Add an 'osmo_gapk' prefix to the exposed symbols - 40d59f1 Add a pkg-config manifest for libosmogapk - 4f0a47d Add the symbol export map for libosmogapk All memory management operations are now based on talloc library: - 3c20dac libosmogapk: use talloc for memory management - 5cabe1e osmo-gapk: use talloc for memory management Integrated Osmocom logging framework: - c35ba8a libosmogapk: use Osmocom logging framework - 4b7cd2c osmo-gapk: drop useless printf calls - 0fe18af osmo-gapk: use Osmocom logging framework - 11943bf osmo-gapk: adjust application verbosity Integrated GNU Autotest environment and basic test coverage: - f069eb3 Init automake test environment - 1fe6a9b tests: add procqueue test - 3e9e57f tests: add pq_file test - 9d2b15d tests: add pq_rtp test - f59f3f1 tests: add format / codec transcoding tests For more details, see commits history. Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da --- 0 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/gapk refs/changes/78/5778/2 -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 2 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Wed Jan 17 14:59:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 14:59:35 +0000 Subject: gapk[master]: Merge branch 'fixeria/lib' into master In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 > @tnt: any feedbackk on this patch series? Harald, @tnt answered in IRC: > (19:13:39) tnt: fixeria: gapk lib looks fine to me from a > quick glance. I tend to agree with Harald's comment on the ML Both issues you mentioned were resolved. -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 2 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:04:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 15:04:44 +0000 Subject: [PATCH] libosmocore[master]: logging: separate the '<000b>' subsys from filename 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/5812 to look at the new patch set (#2). logging: separate the '<000b>' subsys from filename logging Do not include the category as hex in the log_set_print_filename() flag, add separate API to switch that: log_set_print_category_hex(). The default behavior is to still include the hex category at the same place in the log output, but when calling log_set_print_filename(0) now, the hex category will now remain, until log_set_print_category_hex(0) is called. Add VTY command 'logging print category-hex (0|1)'. Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 39 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5812/2 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 1e809d0..f68991e 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -301,6 +301,8 @@ /* Should the log level be printed? */ bool print_level; + /* Should we print the subsys in hex like '<000b>'? */ + bool print_category_hex; }; /* use the above macros */ @@ -323,6 +325,7 @@ void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); +void log_set_print_category_hex(struct log_target *target, int); void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); diff --git a/src/logging.c b/src/logging.c index e6e09e0..650598f 100644 --- a/src/logging.c +++ b/src/logging.c @@ -385,9 +385,14 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } + if (target->print_category_hex) { + ret = snprintf(buf + offset, rem, "<%4.4x> ", subsys); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } if (target->print_filename) { - ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", - subsys, file, line); + ret = snprintf(buf + offset, rem, "%s:%d ", file, line); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); @@ -641,6 +646,15 @@ target->print_category = print_category; } +/*! Enable or disable printing of the category number in hex ('<000b>'). + * \param[in] target Log target to be affected. + * \param[in] print_category_hex Enable (1) or disable (0) hex category. + */ +void log_set_print_category_hex(struct log_target *target, int print_category_hex) +{ + target->print_category_hex = print_category_hex; +} + /*! Enable or disable printing of the log level name. * \param[in] target Log target to be affected * \param[in] print_catname Enable (1) or disable (0) filenames @@ -724,6 +738,7 @@ target->use_color = 1; target->print_timestamp = 0; target->print_filename = 1; + target->print_category_hex = true; /* global log level */ target->loglevel = 0; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 5914822..fd76d04 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -203,6 +203,23 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_cat_hex, + logging_prnt_cat_hex_cmd, + "logging print category-hex (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with category/subsystem nr in hex ('<000b>')\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_category_hex(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_prnt_level, logging_prnt_level_cmd, "logging print level (0|1)", @@ -802,6 +819,7 @@ install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); + install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -819,6 +837,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 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 Wed Jan 17 15:04:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 15:04:44 +0000 Subject: [PATCH] libosmocore[master]: logging: vty: add 'logging print file (0|1|with-cat)' cmd In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5813 to look at the new patch set (#2). logging: vty: add 'logging print file (0|1|with-cat)' cmd Add a VTY command that allows configuring the output of source filename. So far, this was not configurable by VTY at all. Accomodate the (what I see as) legacy behavior of including the log category in hex form as argument 'with-cat'. 0 disables file output, 1 enables only file output without the hex category. The default behavior on startup still is to log file and hex category, to stay backwards compatible. Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc --- M src/vty/logging_vty.c 1 file changed, 21 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/5813/2 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index fd76d04..bccc278 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -237,6 +237,23 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_file, + logging_prnt_file_cmd, + "logging print file (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the source file and line\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_filename(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -770,6 +787,8 @@ tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); + if (tgt->print_filename) + vty_out(vty, " logging print file 1%s", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -821,6 +840,7 @@ install_element_ve(&logging_prnt_cat_cmd); install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); + install_element_ve(&logging_prnt_file_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -839,6 +859,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_file_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc Gerrit-PatchSet: 2 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 Wed Jan 17 15:04:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 15:04:44 +0000 Subject: [PATCH] libosmocore[master]: logging: allow to log only the basename of each source 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/5814 to look at the new patch set (#2). logging: allow to log only the basename of each source In the VTY print filename command, add another parameter 'basename' to yield: logging print filename (0|1|basename|with-cat) In the C API, add another function log_set_print_basename() (when set overrides log_set_print_filename()), and to struct log_target add another flag print_basename. Rationale: especially when not building directly in the source dir, the paths to the source files can become rather long. Usually, just the basename of the file is sufficient to identify the source line. I see printout of the hex representation of the logging category as legacy behavior, so I don't bother to also allow printing the basename along with the hex category. Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 40 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/5814/2 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index f68991e..68dac98 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -303,6 +303,8 @@ bool print_level; /* Should we print the subsys in hex like '<000b>'? */ bool print_category_hex; + /* With filename output, print just the basename? */ + bool print_basename; }; /* use the above macros */ @@ -324,6 +326,7 @@ void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); +void log_set_print_basename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); void log_set_print_category_hex(struct log_target *target, int); void log_set_print_level(struct log_target *target, int); diff --git a/src/logging.c b/src/logging.c index 650598f..0ec12ab 100644 --- a/src/logging.c +++ b/src/logging.c @@ -323,6 +323,14 @@ return NULL; } +static const char *const_basename(const char *path) +{ + const char *bn = strrchr(path, '/'); + if (!bn || !bn[1]) + return path; + return bn + 1; +} + static void _output(struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap) @@ -391,7 +399,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } - if (target->print_filename) { + if (target->print_basename) { + ret = snprintf(buf + offset, rem, "%s:%d ", const_basename(file), line); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } else if (target->print_filename) { ret = snprintf(buf + offset, rem, "%s:%d ", file, line); if (ret < 0) goto err; @@ -635,6 +648,18 @@ target->print_filename = print_filename; } +/*! Enable or disable printing of the filename's basename while logging. + * If both log_set_print_filename() and log_set_print_basename() are enabled, + * log_set_print_basename() overrides and only the basename (without hex + * category) is printed. + * \param[in] target Log target to be affected. + * \param[in] print_basename Enable (1) or disable (0) basenames. + */ +void log_set_print_basename(struct log_target *target, int print_basename) +{ + target->print_basename = (bool)print_basename; +} + /*! Enable or disable printing of the category name * \param[in] target Log target to be affected * \param[in] print_catname Enable (1) or disable (0) filenames diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index bccc278..48f6871 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -239,17 +239,26 @@ DEFUN(logging_prnt_file, logging_prnt_file_cmd, - "logging print file (0|1)", + "logging print file (0|1|basename)", LOGGING_STR "Log output settings\n" "Configure log message\n" "Don't prefix each log message\n" - "Prefix each log message with the source file and line\n") + "Prefix each log message with the source file and line\n" + "Prefix each log message with the source file's basename (strip leading paths) and line\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); if (!tgt) return CMD_WARNING; + if (!strcmp(argv[0], "basename")) { + log_set_print_basename(tgt, 1); + /* log_set_print_basename() overrides log_set_print_filename(), + * so no need to change its value. */ + return CMD_SUCCESS; + } else + log_set_print_basename(tgt, 0); + log_set_print_filename(tgt, atoi(argv[0])); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/5814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e Gerrit-PatchSet: 2 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 Wed Jan 17 15:04:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 15:04:44 +0000 Subject: [PATCH] libosmocore[master]: logging: allow adding separators to the extended-timestamp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5815 to look at the new patch set (#2). logging: allow adding separators to the extended-timestamp Add a log target config to allow separating the extended timestamp. Before: 20180116014434681 After: 2018-01-16 01:44:34.681 In the VTY, add a new argument 'separated': logging print extended-timestamp (0|1|separated) Rationale: when reading log files, parsing the timestamp manually can be cumbersome. Human eyes aren't good at counting digits, I keep getting the minutes, seconds and millis wrong and waste my time on every glance. Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 16 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/5815/2 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 2014a1a..e57ac98 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -225,6 +225,7 @@ LOG_TIMESTAMP_NONE, LOG_TIMESTAMP_EPOCH, LOG_TIMESTAMP_YMDHMSM, + LOG_TIMESTAMP_YMDHMSM_SEPARATED, }; /*! structure representing a logging target */ diff --git a/src/logging.c b/src/logging.c index 128f590..64ef5fb 100644 --- a/src/logging.c +++ b/src/logging.c @@ -367,10 +367,14 @@ } break; case LOG_TIMESTAMP_YMDHMSM: + case LOG_TIMESTAMP_YMDHMSM_SEPARATED: { struct tm tm; struct timeval tv; - const char *ts_fmt = "%04d%02d%02d%02d%02d%02d%03d "; + const char *ts_fmt = + (target->print_timestamp2 == LOG_TIMESTAMP_YMDHMSM_SEPARATED) + ? "%04d-%02d-%02d %02d:%02d:%02d.%03d " + : "%04d%02d%02d%02d%02d%02d%03d "; osmo_gettimeofday(&tv, NULL); localtime_r(&tv.tv_sec, &tm); ret = snprintf(buf + offset, rem, ts_fmt, @@ -658,6 +662,7 @@ * LOG_TIMESTAMP_NONE switches off the timestamp output. * LOG_TIMESTAMP_EPOCH prints the seconds since the epoch (1970-1-1). * LOG_TIMESTAMP_YMDHMSM prints YYYYMMDDhhmmssnnn. + * LOG_TIMESTAMP_YMDHMSM_SEPARATED prints YYYY-MM-DD hh:mm:ss.nnn. */ void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format fmt) { diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 819966e..a6943a1 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -171,11 +171,12 @@ DEFUN(logging_prnt_ext_timestamp, logging_prnt_ext_timestamp_cmd, - "logging print extended-timestamp (0|1)", + "logging print extended-timestamp (0|1|separated)", LOGGING_STR "Log output settings\n" "Configure log message timestamping\n" "Don't prefix each log message\n" - "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") + "Prefix each log message with current timestamp as YYYYMMDDhhmmssnnn\n" + "Prefix each log message with current timestamp as YYYY-MM-DD hh:mm:ss.nnn\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); enum log_timestamp_format fmt; @@ -183,7 +184,9 @@ if (!tgt) return CMD_WARNING; - if (atoi(argv[0])) + if (!strcmp(argv[0], "separated")) + fmt = LOG_TIMESTAMP_YMDHMSM_SEPARATED; + else if (atoi(argv[0])) fmt = LOG_TIMESTAMP_YMDHMSM; else fmt = LOG_TIMESTAMP_NONE; @@ -804,6 +807,9 @@ case LOG_TIMESTAMP_YMDHMSM: vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); break; + case LOG_TIMESTAMP_YMDHMSM_SEPARATED: + vty_out(vty, " logging print extended-timestamp separated%s", VTY_NEWLINE); + break; } if (tgt->print_level) -- To view, visit https://gerrit.osmocom.org/5815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 Gerrit-PatchSet: 2 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 Wed Jan 17 15:04:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 15:04:45 +0000 Subject: [PATCH] libosmocore[master]: logging: use enum to set timestamp format Message-ID: Review at https://gerrit.osmocom.org/5857 logging: use enum to set timestamp format In preparation of adding a new timestamp format, refactor to use an enum to pick the timestamp style. Introduce log_set_print_timestamp2() to be able to pass an enum value directly (for future additions). Make the old API of log_set_print_timestamp() and log_set_print_extended_timestamp() write an enum value instead. The struct log_target members print_timestamp and print_ext_timestamp now become unused, only the new enum member print_timestamp2 has an effect. The old API functions still work. This slightly changes the API behavior, in that enabling the extended timestamp now disables the epoch timestamp, even after switching the extended timestamp off again. Before, switching off the extended timestamp would bring back the epoch timestamp. The API arguably does behave as a reader would expect, in that it switches the timestamp format absolutely, without "invisible state" in the background. Note this in TODO-RELEASE. Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 --- M TODO-RELEASE M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 4 files changed, 91 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/5857/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 782ba19..8353be7 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,11 @@ core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) +core log_target.print_timestamp, These two flags are now replaced by + log_target.print_ext_timestamp print_timestamp2 enum -- callers should use + log_set_print*() functions anyway. +core log_set_print_timestamp() Calling any other log_set_print_timestamp*() + function now is like log_set_print_timestamp(0), + so the epoch timestamp does not come back after + log_set_print_extended_timestamp(0); callers + should use log_set_print_timestamp2() now. diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 68dac98..2014a1a 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -220,6 +220,13 @@ LOG_TGT_TYPE_GSMTAP, /*!< GSMTAP network logging */ }; +/*! Format of the timestamp printed */ +enum log_timestamp_format { + LOG_TIMESTAMP_NONE, + LOG_TIMESTAMP_EPOCH, + LOG_TIMESTAMP_YMDHMSM, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -236,13 +243,15 @@ uint8_t loglevel; /*! should color be used when printing log messages? */ unsigned int use_color:1; - /*! should log messages be prefixed with a timestamp? */ + /*! should log messages be prefixed with a timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_timestamp:1; /*! should log messages be prefixed with a filename? */ unsigned int print_filename:1; /*! should log messages be prefixed with a category name? */ unsigned int print_category:1; - /*! should log messages be prefixed with an extended timestamp? */ + /*! should log messages be prefixed with an extended timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_ext_timestamp:1; /*! the type of this log taget */ @@ -305,6 +314,8 @@ bool print_category_hex; /* With filename output, print just the basename? */ bool print_basename; + /* Timestamp format */ + enum log_timestamp_format print_timestamp2; }; /* use the above macros */ @@ -325,6 +336,7 @@ void log_set_use_color(struct log_target *target, int); void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format format); void log_set_print_filename(struct log_target *target, int); void log_set_print_basename(struct log_target *target, int); void log_set_print_category(struct log_target *target, int); diff --git a/src/logging.c b/src/logging.c index 0ec12ab..128f590 100644 --- a/src/logging.c +++ b/src/logging.c @@ -350,28 +350,38 @@ } } if (!cont) { - if (target->print_ext_timestamp) { - struct tm tm; - struct timeval tv; - osmo_gettimeofday(&tv, NULL); - localtime_r(&tv.tv_sec, &tm); - ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, - (int)(tv.tv_usec / 1000)); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); - } else if (target->print_timestamp) { - char *timestr; - time_t tm; - tm = time(NULL); - timestr = ctime(&tm); - timestr[strlen(timestr)-1] = '\0'; - ret = snprintf(buf + offset, rem, "%s ", timestr); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + switch (target->print_timestamp2) { + case LOG_TIMESTAMP_NONE: + break; + case LOG_TIMESTAMP_EPOCH: + { + time_t tm; + char *timestr; + tm = time(NULL); + timestr = ctime(&tm); + timestr[strlen(timestr)-1] = '\0'; + ret = snprintf(buf + offset, rem, "%s ", timestr); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; + case LOG_TIMESTAMP_YMDHMSM: + { + struct tm tm; + struct timeval tv; + const char *ts_fmt = "%04d%02d%02d%02d%02d%02d%03d "; + osmo_gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm); + ret = snprintf(buf + offset, rem, ts_fmt, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + (int)(tv.tv_usec / 1000)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; } if (target->print_category) { ret = snprintf(buf + offset, rem, "%s%s%s%s ", @@ -617,16 +627,18 @@ target->use_color = use_color; } -/*! Enable or disable printing of timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_EPOCH) instead. + * Enable or disable printing of timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps */ void log_set_print_timestamp(struct log_target *target, int print_timestamp) { - target->print_timestamp = print_timestamp; + target->print_timestamp2 = LOG_TIMESTAMP_EPOCH; } -/*! Enable or disable printing of extended timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_YMDHMSM) instead. + * Enable or disable printing of extended timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps * @@ -636,7 +648,20 @@ */ void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp) { - target->print_ext_timestamp = print_timestamp; + target->print_timestamp2 = LOG_TIMESTAMP_YMDHMSM; +} + +/*! Enable or disable printing of timestamps while logging. + * \param[in] target Log target to be affected + * \param[in] fmt LOG_TIMESTAMP_* value to indicate the format. + * + * LOG_TIMESTAMP_NONE switches off the timestamp output. + * LOG_TIMESTAMP_EPOCH prints the seconds since the epoch (1970-1-1). + * LOG_TIMESTAMP_YMDHMSM prints YYYYMMDDhhmmssnnn. + */ +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format fmt) +{ + target->print_timestamp2 = fmt; } /*! Enable or disable printing of the filename while logging diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 48f6871..819966e 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -165,7 +165,7 @@ if (!tgt) return CMD_WARNING; - log_set_print_timestamp(tgt, atoi(argv[0])); + log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); return CMD_SUCCESS; } @@ -178,11 +178,16 @@ "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_timestamp_format fmt; if (!tgt) return CMD_WARNING; - log_set_print_extended_timestamp(tgt, atoi(argv[0])); + if (atoi(argv[0])) + fmt = LOG_TIMESTAMP_YMDHMSM; + else + fmt = LOG_TIMESTAMP_NONE; + log_set_print_timestamp2(tgt, fmt); return CMD_SUCCESS; } @@ -789,11 +794,18 @@ VTY_NEWLINE); vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); - if (tgt->print_ext_timestamp) + + switch (tgt->print_timestamp2) { + case LOG_TIMESTAMP_NONE: + break; + case LOG_TIMESTAMP_EPOCH: + vty_out(vty, " logging timestamp 1%s", VTY_NEWLINE); + break; + case LOG_TIMESTAMP_YMDHMSM: vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); - else - vty_out(vty, " logging timestamp %u%s", - tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); + break; + } + if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); if (tgt->print_filename) -- To view, visit https://gerrit.osmocom.org/5857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:15:44 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 15:15:44 +0000 Subject: [PATCH] osmo-pcu[master]: jenkins.sh: Disable building doxygen for deps Message-ID: Review at https://gerrit.osmocom.org/5858 jenkins.sh: Disable building doxygen for deps Don't clutter build logs with irrelevant output. Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/58/5858/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index af25c69..2527127 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -61,7 +61,7 @@ verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") # Build deps -osmo-build-dep.sh libosmocore +osmo-build-dep.sh libosmocore "" --disable-doxygen export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/5858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 15:32:27 +0000 Subject: [PATCH] osmo-ci[master]: Don't run OsmoPCU tests in parallel Message-ID: Review at https://gerrit.osmocom.org/5859 Don't run OsmoPCU tests in parallel The vty and ctrl tests are enabled by default and are run on hard-coded ports. This causes some builds to fail when run in parallel. Change-Id: I23d5b75825a667e4f043d16a12b841cd8f01af5e --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/59/5859/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 4e553ea..70c21b5 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -152,6 +152,7 @@ a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] + sequential: true combination_filter: > (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 2275539..4400d8e 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -207,6 +207,7 @@ a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] + sequential: true combination_filter: > (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || -- To view, visit https://gerrit.osmocom.org/5859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I23d5b75825a667e4f043d16a12b841cd8f01af5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:49:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 17 Jan 2018 15:49:09 +0000 Subject: osmo-pcu[master]: jenkins.sh: Disable building doxygen for deps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jan 17 15:55:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:55:45 +0000 Subject: osmo-pcu[master]: TBF: log source of state transitions In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu 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 Jan 17 15:55:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:55:57 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: log source of state transitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: log source of state transitions ...................................................................... TBF: log source of state transitions We use the same approach for osmo_fsm: when state transition happens, it's not very useful to always log the transition function itself, it's much more useful to see where the actual transition comes from. Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Related: OS#1759 --- 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.cpp 6 files changed, 28 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 14c05f2..873af73 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -759,7 +759,7 @@ failure = true; } else { tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW); tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); @@ -1045,7 +1045,7 @@ "changed type from CCCH to PACCH\n"); new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); } - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ new_tbf->t_stop(T0, "control acked (DL-TBF)"); if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) @@ -1070,7 +1070,7 @@ tbf->direction == new_tbf->direction) tbf_free(tbf); - new_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); diff --git a/src/tbf.cpp b/src/tbf.cpp index 4878a07..a1e4392 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -402,7 +402,7 @@ return NULL; } tbf->m_contention_resolution_done = 1; - tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); + TBF_SET_ASS_ON(tbf, GPRS_RLCMAC_FLAG_PACCH, false); T_START(tbf, T3169, bts->t3169, 0, "allocation (UL-TBF)", true); tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); OSMO_ASSERT(tbf->ms()); @@ -730,7 +730,7 @@ m_n3101++; if (m_n3101 == bts->bts_data()->n3101) { LOGP(DRLCMAC, LOGL_NOTICE, " N3101 exceeded MAX (%u)\n", bts->bts_data()->n3101); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3169, bts->bts_data()->t3169, 0, "MAX N3101 reached", false); return; } @@ -748,7 +748,7 @@ LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); bts->pkt_ul_ack_nack_poll_failed(); - ul_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(ul_tbf, GPRS_RLCMAC_RELEASING); T_START(ul_tbf, T3169, ul_tbf->bts->bts_data()->t3169, 0, "MAX N3103 reached", false); return; } @@ -770,7 +770,7 @@ bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pua_poll_failed(); @@ -792,7 +792,7 @@ bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); T_START(this, T3195, bts_data()->t3195, 0, "MAX N3105 reached", true); bts->rlc_ass_failed(); bts->pda_poll_failed(); @@ -818,7 +818,7 @@ } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); - dl_tbf->set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_RELEASING); T_START(dl_tbf, T3195, dl_tbf->bts_data()->t3195, 0, "MAX N3105 reached", true); bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); @@ -1109,7 +1109,7 @@ if (!dl_tbf->upgrade_to_multislot) { /* change state to FLOW, so scheduler * will start transmission */ - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); return; } @@ -1245,7 +1245,7 @@ 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); + TBF_SET_STATE(new_dl_tbf, GPRS_RLCMAC_FLOW); tbf_assign_control_ts(new_dl_tbf); /* stop pending assignment timer */ new_dl_tbf->t_stop(T0, "assignment (DL-TBF)"); @@ -1523,7 +1523,7 @@ llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); ul_tbf->bts->tbf_ul_created(); - ul_tbf->set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, false); + TBF_SET_ASS_ON(ul_tbf, GPRS_RLCMAC_FLAG_PACCH, false); 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 6c9946e..bf6ce4c 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -180,6 +180,9 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) +#define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) + struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -188,9 +191,9 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; - void set_state(enum gprs_rlcmac_tbf_state new_state); + void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); bool check_n_clear(uint8_t state_flag); - void set_assigned_on(uint8_t state_flag, bool check_ccch); + void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; const char *name() const; @@ -378,9 +381,9 @@ } /* Set assignment state and corrsponding flags */ -inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch) +inline void gprs_rlcmac_tbf::set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line) { - set_state(GPRS_RLCMAC_ASSIGN); + set_state(GPRS_RLCMAC_ASSIGN, file, line); if (check_ccch) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) state_flags |= (1 << state_flag); @@ -388,9 +391,9 @@ state_flags |= (1 << state_flag); } -inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state) +inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line) { - LOGP(DRLCMAC, LOGL_DEBUG, "%s changes state from %s to %s\n", + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes state from %s to %s\n", tbf_name(this), tbf_state_name[state], tbf_state_name[new_state]); state = new_state; diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 6b8eda7..5a42aa0 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -493,7 +493,7 @@ old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_assigned_on(GPRS_RLCMAC_FLAG_PACCH, true); + TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_PACCH, true); /* start timer */ T_START(this, T0, T_ASS_PACCH_SEC, 0, "assignment (PACCH)", true); @@ -503,7 +503,7 @@ was_releasing = state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ - set_assigned_on(GPRS_RLCMAC_FLAG_CCCH, false); + TBF_SET_ASS_ON(this, GPRS_RLCMAC_FLAG_CCCH, false); /* send immediate assignment */ bts->snd_dl_ass(this, 0, imsi()); @@ -614,7 +614,7 @@ if (is_final) { request_dl_ack(); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); } /* dequeue next LLC frame, if any */ @@ -1109,7 +1109,7 @@ /* report all outstanding packets as received */ gprs_rlcmac_received_lost(this, received, 0); - set_state(GPRS_RLCMAC_WAIT_RELEASE); + TBF_SET_STATE(this, GPRS_RLCMAC_WAIT_RELEASE); /* start T3193 */ T_START(this, T3193, bts_data()->t3193_msec / 1000, (bts_data()->t3193_msec % 1000) * 1000, @@ -1143,7 +1143,7 @@ * (partly) encoded in chunk 1 of block V(A). (optional) */ } - set_state(GPRS_RLCMAC_RELEASING); + TBF_SET_STATE(this, GPRS_RLCMAC_RELEASING); /* reset rlc states */ m_window.reset(); diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 83ac08f..eaf9c93 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -330,7 +330,7 @@ if (rdbi->cv == 0) { LOGP(DRLCMACUL, LOGL_DEBUG, "- Finished with UL " "TBF\n"); - set_state(GPRS_RLCMAC_FINISHED); + TBF_SET_STATE(this, GPRS_RLCMAC_FINISHED); /* Reset N3103 counter. */ this->m_n3103 = 0; } diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ac15b2c..9e21c73 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -176,7 +176,7 @@ /* "Establish" the DL TBF */ dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; - dl_tbf->set_state(GPRS_RLCMAC_FLOW); + TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I348ba89bdda2b44c7019e9c893c764ee08c80bec Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu 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 Wed Jan 17 15:56:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:56:42 +0000 Subject: osmo-ci[master]: Don't run OsmoPCU tests in parallel In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I23d5b75825a667e4f043d16a12b841cd8f01af5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:56:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:56:54 +0000 Subject: osmo-pcu[master]: jenkins.sh: Disable building doxygen for deps In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Jan 17 15:56:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:56:57 +0000 Subject: [MERGED] osmo-pcu[master]: jenkins.sh: Disable building doxygen for deps In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Disable building doxygen for deps ...................................................................... jenkins.sh: Disable building doxygen for deps Don't clutter build logs with irrelevant output. Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6 --- M contrib/jenkins.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index af25c69..2527127 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -61,7 +61,7 @@ verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]") # Build deps -osmo-build-dep.sh libosmocore +osmo-build-dep.sh libosmocore "" --disable-doxygen export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" export LD_LIBRARY_PATH="$inst/lib" -- To view, visit https://gerrit.osmocom.org/5858 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1784baa519c10ab0ab3e600f373c27a6c8ae4c6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu 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 Jan 17 15:57:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:57:24 +0000 Subject: osmo-pcu[master]: Set V_N and V_B to known initial state In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 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 Jan 17 15:57:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:57:26 +0000 Subject: [MERGED] osmo-pcu[master]: Set V_N and V_B to known initial state In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Set V_N and V_B to known initial state ...................................................................... Set V_N and V_B to known initial state Reset V_N and V_B in UL/DL window class constructors to make sure we always start from known initial state. Related: OS#1759 Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Fixes: CID70468, CID70469. --- M src/rlc.h 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/rlc.h b/src/rlc.h index fcc3edb..aac6b13 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -506,6 +506,7 @@ : m_v_s(0) , m_v_a(0) { + reset(); } inline const uint16_t gprs_rlc_dl_window::v_s() const @@ -552,6 +553,7 @@ : m_v_r(0) , m_v_q(0) { + m_v_n.reset(); } inline bool gprs_rlc_ul_window::is_in_window(uint16_t bsn) const -- To view, visit https://gerrit.osmocom.org/5786 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e14ffa913b49c5394229220de9165cdfaabdf19 Gerrit-PatchSet: 5 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 Wed Jan 17 15:57:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 15:57:40 +0000 Subject: osmo-pcu[master]: EDGE: fix wrong encoding of LH bits In-Reply-To: References: Message-ID: Patch Set 3: I think recent changes to RO encoding in OsmoPCU made this obsolete. Could you try the latest master and check if there're still issues? -- To view, visit https://gerrit.osmocom.org/3991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I75dd5bebc74eea85edf9582607c774d0bba0d2a6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Minh-Quang Nguyen Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Minh-Quang Nguyen Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:57:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:57:46 +0000 Subject: gapk[master]: Merge branch 'fixeria/lib' into master In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 2 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:57:48 +0000 Subject: [MERGED] gapk[master]: Merge branch 'fixeria/lib' into master In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Merge branch 'fixeria/lib' into master ...................................................................... Merge branch 'fixeria/lib' into master The previous GAPK implementation was represented by a single executable. So, all audio transcoding operations were available only via calling the 'gapk' binary. This approach didn't allow external applications to benefit from using GAPK API directly. The following set of changes separates the common code into a shared library called 'libosmogapk', linking the 'gapk' binary against it: - 95e6664 Introduce a shared 'libosmogapk' library - 30209ce Install GAPK headers to '${includedir}/osmocom/gapk/' - a8d4657 Add an 'osmo_gapk' prefix to the exposed symbols - 40d59f1 Add a pkg-config manifest for libosmogapk - 4f0a47d Add the symbol export map for libosmogapk All memory management operations are now based on talloc library: - 3c20dac libosmogapk: use talloc for memory management - 5cabe1e osmo-gapk: use talloc for memory management Integrated Osmocom logging framework: - c35ba8a libosmogapk: use Osmocom logging framework - 4b7cd2c osmo-gapk: drop useless printf calls - 0fe18af osmo-gapk: use Osmocom logging framework - 11943bf osmo-gapk: adjust application verbosity Integrated GNU Autotest environment and basic test coverage: - f069eb3 Init automake test environment - 1fe6a9b tests: add procqueue test - 3e9e57f tests: add pq_file test - 9d2b15d tests: add pq_rtp test - f59f3f1 tests: add format / codec transcoding tests For more details, see commits history. Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da --- 0 files changed, 0 insertions(+), 0 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve; Verified Harald Welte: Looks good to me, approved -- To view, visit https://gerrit.osmocom.org/5778 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c6d4a9d326ee49153e4ad83823d094831c112da Gerrit-PatchSet: 2 Gerrit-Project: gapk Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Wed Jan 17 15:58:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 15:58:18 +0000 Subject: osmo-ci[master]: Install pip tool into containers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2702c71cd268ca688e9ecc264f8cd1257c27899 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 16:01:31 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 16:01:31 +0000 Subject: osmo-ci[master]: Install pip tool into containers In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If2702c71cd268ca688e9ecc264f8cd1257c27899 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 16:01:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 16:01:36 +0000 Subject: [MERGED] osmo-ci[master]: Install pip tool into containers In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Install pip tool into containers ...................................................................... Install pip tool into containers The pip(2|3) tool is the officially recommended tool to deal with Python packages [1] with much greater flexibility compared to invoking setup.py directly. As a preparation step for using it to install osmo-python-tests let's add it to container images. [1] https://packaging.python.org/guides/tool-recommendations/ Change-Id: If2702c71cd268ca688e9ecc264f8cd1257c27899 --- M docker/Dockerfile.deb8_amd64 M docker/Dockerfile.deb8_i386 M docker/Dockerfile_osmocom_jenkins.amd64 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/docker/Dockerfile.deb8_amd64 b/docker/Dockerfile.deb8_amd64 index 4d9966f..f32a3c3 100644 --- a/docker/Dockerfile.deb8_amd64 +++ b/docker/Dockerfile.deb8_amd64 @@ -32,7 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf stow # for osmo-python-tests -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools python3-pip python-pip # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile.deb8_i386 b/docker/Dockerfile.deb8_i386 index 4d8498c..c9b3aa9 100644 --- a/docker/Dockerfile.deb8_i386 +++ b/docker/Dockerfile.deb8_i386 @@ -32,7 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc-arm-none-eabi # for osmo-python-tests -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools python3-pip python-pip # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 b/docker/Dockerfile_osmocom_jenkins.amd64 index 547790c..12154b3 100644 --- a/docker/Dockerfile_osmocom_jenkins.amd64 +++ b/docker/Dockerfile_osmocom_jenkins.amd64 @@ -32,7 +32,7 @@ RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libtool pkg-config automake autoconf # for osmo-python-tests -RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools +RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends python3-setuptools python-setuptools python3-pip python-pip # Linux kernel RUN DEBIAN_FRONTEND=noninteractive apt-get install -y bc -- To view, visit https://gerrit.osmocom.org/5852 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If2702c71cd268ca688e9ecc264f8cd1257c27899 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 17 16:01:51 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 16:01:51 +0000 Subject: osmo-ci[master]: Don't run OsmoPCU tests in parallel In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I23d5b75825a667e4f043d16a12b841cd8f01af5e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 16:01:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 16:01:53 +0000 Subject: [MERGED] osmo-ci[master]: Don't run OsmoPCU tests in parallel In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Don't run OsmoPCU tests in parallel ...................................................................... Don't run OsmoPCU tests in parallel The vty and ctrl tests are enabled by default and are run on hard-coded ports. This causes some builds to fail when run in parallel. Change-Id: I23d5b75825a667e4f043d16a12b841cd8f01af5e --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 4e553ea..70c21b5 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -152,6 +152,7 @@ a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] + sequential: true combination_filter: > (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 2275539..4400d8e 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -207,6 +207,7 @@ a2: !!python/tuple [True, False] a3_name: with_dsp a3: !!python/tuple [sysmo, lc15, none] + sequential: true combination_filter: > (with_vty == "True" && with_dsp == "sysmo" && FIRMWARE_VERSION=="master") || (with_vty == "True" && with_dsp == "lc15" && FIRMWARE_VERSION=="master") || -- To view, visit https://gerrit.osmocom.org/5859 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I23d5b75825a667e4f043d16a12b841cd8f01af5e Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 16:30:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 17 Jan 2018 16:30:26 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: The semantics for "--enable-sysmocom-bts" remains exactly the same as before: look for includes in default directory. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 18:18:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 17 Jan 2018 18:18:58 +0000 Subject: [PATCH] libosmo-sccp[master]: sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER Message-ID: Review at https://gerrit.osmocom.org/5860 sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER It seems we have been sending the wrong numeric value in SCCP connection refusal due to an unqeuipped user. It turns out our list of refusal causes was missing one entry, causing an off-by-one for this refusal cause. While at it, add a comment which section of which spec is relevant for this enum. Change-Id: I113645bd6df1ec9ae5137977028df38560fc4789 --- M include/sccp/sccp_types.h 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/60/5860/1 diff --git a/include/sccp/sccp_types.h b/include/sccp/sccp_types.h index 962bde4..ab7f74f 100644 --- a/include/sccp/sccp_types.h +++ b/include/sccp/sccp_types.h @@ -245,6 +245,7 @@ SCCP_ERROR_UNQUALIFIED = 4, }; +/* ITU=T Q.713 Section 3.15 */ enum sccp_refusal_cause { SCCP_REFUSAL_END_USER_ORIGINATED = 0, SCCP_REFUSAL_END_USER_CONGESTION = 1, @@ -264,7 +265,8 @@ SCCP_REFUSAL_UNQUALIFIED = 15, SCCP_REFUSAL_HOP_COUNTER_VIOLATION = 16, SCCP_REFUSAL_SCCP_FAILURE = 17, - SCCP_REFUSAL_UNEQUIPPED_USER = 18, + SCCP_REFUSAL_NO_TRANS_FOR_ADDRESS_NATURE = 18, + SCCP_REFUSAL_UNEQUIPPED_USER = 19, }; /* -- To view, visit https://gerrit.osmocom.org/5860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I113645bd6df1ec9ae5137977028df38560fc4789 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 17 18:43:20 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 18:43:20 +0000 Subject: osmo-bts[master]: bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Wed Jan 17 18:51:01 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 17 Jan 2018 18:51:01 +0000 Subject: osmo-trx[master]: Remove unneeded libdl dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 17 23:16:16 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:16:16 +0000 Subject: [MERGED] libosmocore[master]: cosmetic: logging: if color is disabled, don't print "" In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: cosmetic: logging: if color is disabled, don't print "" ...................................................................... cosmetic: logging: if color is disabled, don't print "" If color output is disabled, skip the empty snprintf() to (not) clear the ANSI color. Also, no need to use a format string of "%s", just pass the string constant directly. That is a micro optimisation as well as clarification of the code. Change-Id: Ie7cb06de160830d2f8ee5718246c0fe311f68d49 --- M src/logging.c 1 file changed, 6 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/logging.c b/src/logging.c index 9b37bf5..e6e09e0 100644 --- a/src/logging.c +++ b/src/logging.c @@ -398,11 +398,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); - ret = snprintf(buf + offset, rem, "%s", - target->use_color ? "\033[0;m" : ""); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + if (target->use_color) { + ret = snprintf(buf + offset, rem, "\033[0;m"); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } err: buf[sizeof(buf)-1] = '\0'; target->output(target, level, buf); -- To view, visit https://gerrit.osmocom.org/5816 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7cb06de160830d2f8ee5718246c0fe311f68d49 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 Wed Jan 17 23:18:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:18:06 +0000 Subject: [PATCH] libosmocore[master]: logging: use enum to set timestamp format In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5857 to look at the new patch set (#2). logging: use enum to set timestamp format In preparation of adding a new timestamp format, refactor to use an enum to pick the timestamp style. Introduce log_set_print_timestamp2() to be able to pass an enum value directly (for future additions). Make the old API of log_set_print_timestamp() and log_set_print_extended_timestamp() write an enum value instead. The struct log_target members print_timestamp and print_ext_timestamp now become unused, only the new enum member print_timestamp2 has an effect. The old API functions still work. This slightly changes the API behavior, in that enabling the extended timestamp now disables the epoch timestamp, even after switching the extended timestamp off again. Before, switching off the extended timestamp would bring back the epoch timestamp. The API arguably does behave as a reader would expect, in that it switches the timestamp format absolutely, without "invisible state" in the background. Note this in TODO-RELEASE. Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 --- M TODO-RELEASE M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 4 files changed, 92 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/5857/2 diff --git a/TODO-RELEASE b/TODO-RELEASE index 782ba19..8353be7 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,11 @@ core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) +core log_target.print_timestamp, These two flags are now replaced by + log_target.print_ext_timestamp print_timestamp2 enum -- callers should use + log_set_print*() functions anyway. +core log_set_print_timestamp() Calling any other log_set_print_timestamp*() + function now is like log_set_print_timestamp(0), + so the epoch timestamp does not come back after + log_set_print_extended_timestamp(0); callers + should use log_set_print_timestamp2() now. diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 617d78e..34cf0cb 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -227,6 +227,13 @@ LOG_FILENAME_BASENAME, }; +/*! Format of the timestamp printed */ +enum log_timestamp_format { + LOG_TIMESTAMP_NONE, + LOG_TIMESTAMP_EPOCH, + LOG_TIMESTAMP_YMDHMSM, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -243,13 +250,15 @@ uint8_t loglevel; /*! should color be used when printing log messages? */ unsigned int use_color:1; - /*! should log messages be prefixed with a timestamp? */ + /*! should log messages be prefixed with a timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_timestamp:1; /*! DEPRECATED: use print_filename2 instead. */ unsigned int print_filename:1; /*! should log messages be prefixed with a category name? */ unsigned int print_category:1; - /*! should log messages be prefixed with an extended timestamp? */ + /*! should log messages be prefixed with an extended timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_ext_timestamp:1; /*! the type of this log taget */ @@ -312,6 +321,8 @@ bool print_category_hex; /* Should we print the source file and line, and in which way? */ enum log_filename_type print_filename2; + /* Timestamp format */ + enum log_timestamp_format print_timestamp2; }; /* use the above macros */ @@ -332,6 +343,7 @@ void log_set_use_color(struct log_target *target, int); void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format format); void log_set_print_filename(struct log_target *target, int); void log_set_print_filename2(struct log_target *target, enum log_filename_type lft); void log_set_print_category(struct log_target *target, int); diff --git a/src/logging.c b/src/logging.c index 66074ea..37404d7 100644 --- a/src/logging.c +++ b/src/logging.c @@ -350,28 +350,38 @@ } } if (!cont) { - if (target->print_ext_timestamp) { - struct tm tm; - struct timeval tv; - osmo_gettimeofday(&tv, NULL); - localtime_r(&tv.tv_sec, &tm); - ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, - (int)(tv.tv_usec / 1000)); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); - } else if (target->print_timestamp) { - char *timestr; - time_t tm; - tm = time(NULL); - timestr = ctime(&tm); - timestr[strlen(timestr)-1] = '\0'; - ret = snprintf(buf + offset, rem, "%s ", timestr); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + switch (target->print_timestamp2) { + case LOG_TIMESTAMP_NONE: + break; + case LOG_TIMESTAMP_EPOCH: + { + char *timestr; + time_t tm; + tm = time(NULL); + timestr = ctime(&tm); + timestr[strlen(timestr)-1] = '\0'; + ret = snprintf(buf + offset, rem, "%s ", timestr); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; + case LOG_TIMESTAMP_YMDHMSM: + { + struct tm tm; + struct timeval tv; + const char *ts_fmt = "%04d%02d%02d%02d%02d%02d%03d "; + osmo_gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm); + ret = snprintf(buf + offset, rem, ts_fmt, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + (int)(tv.tv_usec / 1000)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; } if (target->print_category) { ret = snprintf(buf + offset, rem, "%s%s%s%s ", @@ -622,16 +632,18 @@ target->use_color = use_color; } -/*! Enable or disable printing of timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_EPOCH) instead. + * Enable or disable printing of timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps */ void log_set_print_timestamp(struct log_target *target, int print_timestamp) { - target->print_timestamp = print_timestamp; + log_set_print_timestamp2(target, print_timestamp ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); } -/*! Enable or disable printing of extended timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_YMDHMSM) instead. + * Enable or disable printing of extended timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps * @@ -641,7 +653,20 @@ */ void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp) { - target->print_ext_timestamp = print_timestamp; + log_set_print_timestamp2(target, print_timestamp ? LOG_TIMESTAMP_YMDHMSM : LOG_TIMESTAMP_NONE); +} + +/*! Enable or disable printing of timestamps while logging. + * \param[in] target Log target to be affected + * \param[in] fmt LOG_TIMESTAMP_* value to indicate the format. + * + * LOG_TIMESTAMP_NONE switches off the timestamp output. + * LOG_TIMESTAMP_EPOCH prints the seconds since the epoch (1970-1-1). + * LOG_TIMESTAMP_YMDHMSM prints YYYYMMDDhhmmssnnn. + */ +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format fmt) +{ + target->print_timestamp2 = fmt; } /*! Use log_set_print_filename2() instead. @@ -771,7 +796,7 @@ /* global settings */ target->use_color = 1; - target->print_timestamp = 0; + target->print_timestamp2 = LOG_TIMESTAMP_NONE; target->print_filename2 = LOG_FILENAME_PATH; target->print_category_hex = true; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 0eaa7fd..490fb07 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -165,7 +165,7 @@ if (!tgt) return CMD_WARNING; - log_set_print_timestamp(tgt, atoi(argv[0])); + log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); return CMD_SUCCESS; } @@ -178,11 +178,16 @@ "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_timestamp_format fmt; if (!tgt) return CMD_WARNING; - log_set_print_extended_timestamp(tgt, atoi(argv[0])); + if (atoi(argv[0])) + fmt = LOG_TIMESTAMP_YMDHMSM; + else + fmt = LOG_TIMESTAMP_NONE; + log_set_print_timestamp2(tgt, fmt); return CMD_SUCCESS; } @@ -786,11 +791,18 @@ VTY_NEWLINE); vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); - if (tgt->print_ext_timestamp) + + switch (tgt->print_timestamp2) { + case LOG_TIMESTAMP_NONE: + break; + case LOG_TIMESTAMP_EPOCH: + vty_out(vty, " logging timestamp 1%s", VTY_NEWLINE); + break; + case LOG_TIMESTAMP_YMDHMSM: vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); - else - vty_out(vty, " logging timestamp %u%s", - tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); + break; + } + if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); if (tgt->print_filename) -- To view, visit https://gerrit.osmocom.org/5857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 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 Jan 17 23:18:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:18:06 +0000 Subject: [PATCH] libosmocore[master]: logging: separate the '<000b>' subsys from filename 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/5812 to look at the new patch set (#3). logging: separate the '<000b>' subsys from filename logging Add a separate flag and API to switch the category-in-hex output: log_set_print_category_hex(). Add log_set_print_filename2() to modify only the print_filename flag. The old log_set_print_filename() function still affects both flags. Explain the rationale in the comment for log_set_print_filename(). There is no need to deprecate log_set_print_filename(); it might cause compiler warnings and break strict builds unnecessarily. Add VTY command 'logging print category-hex (0|1)'. Since there is no VTY command to switch filename output, nothing needs to be adjusted there (a command will be added in a subsequent patch). Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 74 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/5812/3 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 1e809d0..1e79dab 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -220,6 +220,12 @@ LOG_TGT_TYPE_GSMTAP, /*!< GSMTAP network logging */ }; +/*! Whether/how to log the source filename (and line number). */ +enum log_filename_type { + LOG_FILENAME_NONE, + LOG_FILENAME_PATH, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -238,7 +244,7 @@ unsigned int use_color:1; /*! should log messages be prefixed with a timestamp? */ unsigned int print_timestamp:1; - /*! should log messages be prefixed with a filename? */ + /*! DEPRECATED: use print_filename2 instead. */ unsigned int print_filename:1; /*! should log messages be prefixed with a category name? */ unsigned int print_category:1; @@ -301,6 +307,10 @@ /* Should the log level be printed? */ bool print_level; + /* Should we print the subsys in hex like '<000b>'? */ + bool print_category_hex; + /* Should we print the source file and line, and in which way? */ + enum log_filename_type print_filename2; }; /* use the above macros */ @@ -322,7 +332,9 @@ void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); +void log_set_print_filename2(struct log_target *target, enum log_filename_type lft); void log_set_print_category(struct log_target *target, int); +void log_set_print_category_hex(struct log_target *target, int); void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); diff --git a/src/logging.c b/src/logging.c index e6e09e0..8cb3407 100644 --- a/src/logging.c +++ b/src/logging.c @@ -385,12 +385,21 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } - if (target->print_filename) { - ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", - subsys, file, line); + if (target->print_category_hex) { + ret = snprintf(buf + offset, rem, "<%4.4x> ", subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + switch (target->print_filename2) { + case LOG_FILENAME_NONE: + break; + case LOG_FILENAME_PATH: + ret = snprintf(buf + offset, rem, "%s:%d ", file, line); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + break; } } ret = vsnprintf(buf + offset, rem, format, ap); @@ -621,13 +630,30 @@ target->print_ext_timestamp = print_timestamp; } -/*! Enable or disable printing of the filename while logging +/*! Use log_set_print_filename2() instead. + * Call log_set_print_filename2() with LOG_FILENAME_PATH or LOG_FILENAME_NONE, *as well as* call + * log_set_print_category_hex() with the argument passed to this function. This is to mirror legacy + * behavior, which combined the category in hex with the filename. For example, if the category-hex + * output were no longer affected by log_set_print_filename(), many unit tests (in libosmocore as well as + * dependent projects) would fail since they expect the category to disappear along with the filename. * \param[in] target Log target to be affected * \param[in] print_filename Enable (1) or disable (0) filenames */ void log_set_print_filename(struct log_target *target, int print_filename) { - target->print_filename = print_filename; + log_set_print_filename2(target, print_filename ? LOG_FILENAME_PATH : LOG_FILENAME_NONE); + log_set_print_category_hex(target, print_filename); +} + +/*! Enable or disable printing of the filename while logging. + * \param[in] target Log target to be affected. + * \param[in] print_filename An LOG_FILENAME_* enum value. + * LOG_FILENAME_NONE omits the source file and line information from logs. + * LOG_FILENAME_PATH prints the entire source file path as passed to LOGP macros. + */ +void log_set_print_filename2(struct log_target *target, enum log_filename_type lft) +{ + target->print_filename2 = lft; } /*! Enable or disable printing of the category name @@ -639,6 +665,15 @@ void log_set_print_category(struct log_target *target, int print_category) { target->print_category = print_category; +} + +/*! Enable or disable printing of the category number in hex ('<000b>'). + * \param[in] target Log target to be affected. + * \param[in] print_category_hex Enable (1) or disable (0) hex category. + */ +void log_set_print_category_hex(struct log_target *target, int print_category_hex) +{ + target->print_category_hex = print_category_hex; } /*! Enable or disable printing of the log level name. @@ -723,7 +758,8 @@ /* global settings */ target->use_color = 1; target->print_timestamp = 0; - target->print_filename = 1; + target->print_filename2 = LOG_FILENAME_PATH; + target->print_category_hex = true; /* global log level */ target->loglevel = 0; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 5914822..fd76d04 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -203,6 +203,23 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_cat_hex, + logging_prnt_cat_hex_cmd, + "logging print category-hex (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with category/subsystem nr in hex ('<000b>')\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_category_hex(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_prnt_level, logging_prnt_level_cmd, "logging print level (0|1)", @@ -802,6 +819,7 @@ install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); + install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -819,6 +837,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 17 23:18:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:18:06 +0000 Subject: [PATCH] libosmocore[master]: logging: vty: add 'logging print file (0|1|basename)' cmd In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5813 to look at the new patch set (#3). logging: vty: add 'logging print file (0|1|basename)' cmd Add a VTY command that allows configuring the output of source filename. So far, this was not configurable by VTY at all. Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc --- M src/vty/logging_vty.c 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/5813/3 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index fd76d04..0eaa7fd 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -237,6 +237,29 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_file, + logging_prnt_file_cmd, + "logging print file (0|1|basename)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the source file and line\n" + "Prefix each log message with the source file's basename (strip leading paths) and line\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_filename_type lft; + + if (!tgt) + return CMD_WARNING; + + if (!strcmp(argv[0], "basename")) + lft = LOG_FILENAME_BASENAME; + else + lft = atoi(argv[0])? LOG_FILENAME_PATH : LOG_FILENAME_NONE; + log_set_print_filename2(tgt, lft); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -770,6 +793,8 @@ tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); + if (tgt->print_filename) + vty_out(vty, " logging print file 1%s", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -821,6 +846,7 @@ install_element_ve(&logging_prnt_cat_cmd); install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); + install_element_ve(&logging_prnt_file_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -839,6 +865,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_file_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc 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 Wed Jan 17 23:18:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:18:06 +0000 Subject: [PATCH] libosmocore[master]: logging: allow to log only the basename of each source 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/5814 to look at the new patch set (#3). logging: allow to log only the basename of each source In the C API, add another enum log_file_type value, and when set print only the basename of the source file path. Rationale: especially when not building directly in the source dir, the paths to the source files can become rather long. Usually, just the basename of the file is sufficient to identify the source line. Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e --- M include/osmocom/core/logging.h M src/logging.c 2 files changed, 15 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/14/5814/3 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 1e79dab..617d78e 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -224,6 +224,7 @@ enum log_filename_type { LOG_FILENAME_NONE, LOG_FILENAME_PATH, + LOG_FILENAME_BASENAME, }; /*! structure representing a logging target */ diff --git a/src/logging.c b/src/logging.c index 8cb3407..66074ea 100644 --- a/src/logging.c +++ b/src/logging.c @@ -323,6 +323,14 @@ return NULL; } +static const char *const_basename(const char *path) +{ + const char *bn = strrchr(path, '/'); + if (!bn || !bn[1]) + return path; + return bn + 1; +} + static void _output(struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap) @@ -400,6 +408,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); break; + case LOG_FILENAME_BASENAME: + ret = snprintf(buf + offset, rem, "%s:%d ", const_basename(file), line); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + break; } } ret = vsnprintf(buf + offset, rem, format, ap); -- To view, visit https://gerrit.osmocom.org/5814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e 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 Wed Jan 17 23:19:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:19:21 +0000 Subject: [MERGED] osmo-bts[master]: jenkins_common.sh: fix build_bts distcheck for more than one... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins_common.sh: fix build_bts distcheck for more than one conf_flag ...................................................................... jenkins_common.sh: fix build_bts distcheck for more than one conf_flag Passing configure flags in DISTCHECK_CONFIGURE_FLAGS requires enclosing all flags in quotes. Currently we seem to have no callers with more than one configure flag, so we were lucky not to break there. Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb --- M contrib/jenkins_common.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index cc1b5b3..bdb12d5 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -43,5 +43,5 @@ ./configure $conf_flags $MAKE $PARALLEL_MAKE $MAKE check || cat-testlogs.sh - DISTCHECK_CONFIGURE_FLAGS=$conf_flags $MAKE distcheck || cat-testlogs.sh + DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE distcheck || cat-testlogs.sh } -- To view, visit https://gerrit.osmocom.org/5822 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 17 23:35:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 17 Jan 2018 23:35:11 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/5844/1/tests/Makefile.am File tests/Makefile.am: Line 5: $(top_builddir)/src/vty/libosmovty.la \ > Seems like unrelated cosmetic change, but we shouldn't consider it merge bl This is the main change of this patch. It is not cosmetic. It adds the locally built libosmovty.la to all test programs' linkages. Or did I miss something? Line 151: vty_vty_test_LDADD = $(LDADD) > That's unnecessary: LDADD is used by default so you can just remove the lin This is following the pattern present in this file. e.g. see in line 146, same thing. Hold on, *you* are the author of using LDADD like a local var, only last october. http://git.osmocom.org/libosmocore/commit/?id=ba1059c173ac8f4845464c4f91d1890898f729a0 I'm not entirely sure whether a foo_LDADD then overrides or adds to the global LDADD... could you clarify? Would it be ok with you to fix LDADD in a separate patch? -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 01:28:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:28:44 +0000 Subject: [PATCH] libosmocore[master]: logging vty: add 'logging print file (0|1|basename)' cmd In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5813 to look at the new patch set (#4). logging vty: add 'logging print file (0|1|basename)' cmd Add a VTY command that allows configuring the output of source filename. So far, this was not configurable by VTY at all. Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc --- M src/vty/logging_vty.c 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/5813/4 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index fd76d04..0eaa7fd 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -237,6 +237,29 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_file, + logging_prnt_file_cmd, + "logging print file (0|1|basename)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the source file and line\n" + "Prefix each log message with the source file's basename (strip leading paths) and line\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_filename_type lft; + + if (!tgt) + return CMD_WARNING; + + if (!strcmp(argv[0], "basename")) + lft = LOG_FILENAME_BASENAME; + else + lft = atoi(argv[0])? LOG_FILENAME_PATH : LOG_FILENAME_NONE; + log_set_print_filename2(tgt, lft); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -770,6 +793,8 @@ tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); + if (tgt->print_filename) + vty_out(vty, " logging print file 1%s", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -821,6 +846,7 @@ install_element_ve(&logging_prnt_cat_cmd); install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); + install_element_ve(&logging_prnt_file_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -839,6 +865,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_file_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc Gerrit-PatchSet: 4 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 Jan 18 01:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:29:11 +0000 Subject: [PATCH] libosmocore[master]: logging: use enum to set timestamp format In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5857 to look at the new patch set (#3). logging: use enum to set timestamp format In preparation of adding a new timestamp format, refactor to use an enum to pick the timestamp style. Introduce log_set_print_timestamp2() to be able to pass an enum value directly (for future additions). Make the old API of log_set_print_timestamp() and log_set_print_extended_timestamp() write an enum value instead. The struct log_target members print_timestamp and print_ext_timestamp now become unused, only the new enum member print_timestamp2 has an effect. The old API functions still work. This slightly changes the API behavior, in that enabling the extended timestamp now disables the epoch timestamp, even after switching the extended timestamp off again. Before, switching off the extended timestamp would bring back the epoch timestamp. The API arguably does behave as a reader would expect, in that it switches the timestamp format absolutely, without "invisible state" in the background. Note this in TODO-RELEASE. Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 --- M TODO-RELEASE M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 4 files changed, 78 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/5857/3 diff --git a/TODO-RELEASE b/TODO-RELEASE index 782ba19..8353be7 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,11 @@ core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) +core log_target.print_timestamp, These two flags are now replaced by + log_target.print_ext_timestamp print_timestamp2 enum -- callers should use + log_set_print*() functions anyway. +core log_set_print_timestamp() Calling any other log_set_print_timestamp*() + function now is like log_set_print_timestamp(0), + so the epoch timestamp does not come back after + log_set_print_extended_timestamp(0); callers + should use log_set_print_timestamp2() now. diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 617d78e..f3f3f2b 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -227,6 +227,13 @@ LOG_FILENAME_BASENAME, }; +/*! Format of the timestamp printed */ +enum log_timestamp_format { + LOG_TIMESTAMP_NONE, + LOG_TIMESTAMP_EPOCH, + LOG_TIMESTAMP_DATE_PACKED, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -243,13 +250,15 @@ uint8_t loglevel; /*! should color be used when printing log messages? */ unsigned int use_color:1; - /*! should log messages be prefixed with a timestamp? */ + /*! should log messages be prefixed with a timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_timestamp:1; /*! DEPRECATED: use print_filename2 instead. */ unsigned int print_filename:1; /*! should log messages be prefixed with a category name? */ unsigned int print_category:1; - /*! should log messages be prefixed with an extended timestamp? */ + /*! should log messages be prefixed with an extended timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_ext_timestamp:1; /*! the type of this log taget */ @@ -312,6 +321,8 @@ bool print_category_hex; /* Should we print the source file and line, and in which way? */ enum log_filename_type print_filename2; + /* Timestamp format */ + enum log_timestamp_format print_timestamp2; }; /* use the above macros */ @@ -332,6 +343,7 @@ void log_set_use_color(struct log_target *target, int); void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format format); void log_set_print_filename(struct log_target *target, int); void log_set_print_filename2(struct log_target *target, enum log_filename_type lft); void log_set_print_category(struct log_target *target, int); diff --git a/src/logging.c b/src/logging.c index 66074ea..7b3a2fd 100644 --- a/src/logging.c +++ b/src/logging.c @@ -350,28 +350,38 @@ } } if (!cont) { - if (target->print_ext_timestamp) { - struct tm tm; - struct timeval tv; - osmo_gettimeofday(&tv, NULL); - localtime_r(&tv.tv_sec, &tm); - ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, - (int)(tv.tv_usec / 1000)); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); - } else if (target->print_timestamp) { - char *timestr; - time_t tm; - tm = time(NULL); - timestr = ctime(&tm); - timestr[strlen(timestr)-1] = '\0'; - ret = snprintf(buf + offset, rem, "%s ", timestr); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + switch (target->print_timestamp2) { + case LOG_TIMESTAMP_NONE: + break; + case LOG_TIMESTAMP_EPOCH: + { + char *timestr; + time_t tm; + tm = time(NULL); + timestr = ctime(&tm); + timestr[strlen(timestr)-1] = '\0'; + ret = snprintf(buf + offset, rem, "%s ", timestr); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; + case LOG_TIMESTAMP_DATE_PACKED: + { + struct tm tm; + struct timeval tv; + const char *ts_fmt = "%04d%02d%02d%02d%02d%02d%03d "; + osmo_gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm); + ret = snprintf(buf + offset, rem, ts_fmt, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + (int)(tv.tv_usec / 1000)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; } if (target->print_category) { ret = snprintf(buf + offset, rem, "%s%s%s%s ", @@ -622,16 +632,18 @@ target->use_color = use_color; } -/*! Enable or disable printing of timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_EPOCH) instead. + * Enable or disable printing of timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps */ void log_set_print_timestamp(struct log_target *target, int print_timestamp) { - target->print_timestamp = print_timestamp; + log_set_print_timestamp2(target, print_timestamp ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); } -/*! Enable or disable printing of extended timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_DATE_PACKED) instead. + * Enable or disable printing of extended timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps * @@ -641,7 +653,20 @@ */ void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp) { - target->print_ext_timestamp = print_timestamp; + log_set_print_timestamp2(target, print_timestamp ? LOG_TIMESTAMP_DATE_PACKED : LOG_TIMESTAMP_NONE); +} + +/*! Enable or disable printing of timestamps while logging. + * \param[in] target Log target to be affected + * \param[in] fmt LOG_TIMESTAMP_* value to indicate the format. + * + * LOG_TIMESTAMP_NONE switches off the timestamp output. + * LOG_TIMESTAMP_EPOCH prints the seconds since the epoch (1970-1-1). + * LOG_TIMESTAMP_DATE_PACKED prints YYYYMMDDhhmmssnnn. + */ +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format fmt) +{ + target->print_timestamp2 = fmt; } /*! Use log_set_print_filename2() instead. @@ -771,7 +796,7 @@ /* global settings */ target->use_color = 1; - target->print_timestamp = 0; + target->print_timestamp2 = LOG_TIMESTAMP_NONE; target->print_filename2 = LOG_FILENAME_PATH; target->print_category_hex = true; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 0eaa7fd..7251727 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -165,7 +165,7 @@ if (!tgt) return CMD_WARNING; - log_set_print_timestamp(tgt, atoi(argv[0])); + log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); return CMD_SUCCESS; } @@ -182,7 +182,7 @@ if (!tgt) return CMD_WARNING; - log_set_print_extended_timestamp(tgt, atoi(argv[0])); + log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_DATE_PACKED : LOG_TIMESTAMP_DATE); return CMD_SUCCESS; } @@ -786,11 +786,11 @@ VTY_NEWLINE); vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); - if (tgt->print_ext_timestamp) + if (tgt->print_timestamp2 == LOG_TIMESTAMP_DATE_PACKED) vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); else vty_out(vty, " logging timestamp %u%s", - tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); + tgt->print_timestamp2 ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); if (tgt->print_filename) -- To view, visit https://gerrit.osmocom.org/5857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 18 01:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:29:11 +0000 Subject: [PATCH] libosmocore[master]: logging: allow adding separators to the extended-timestamp In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5815 to look at the new patch set (#4). logging: allow adding separators to the extended-timestamp Add a log target config to allow separating the extended timestamp. Before: 20180116014434681 After: 2018-01-16 01:44:34.681 In the VTY, add a new argument 'date' to 'logging print timestamp'. Rationale: when reading log files, parsing the timestamp manually can be cumbersome. Human eyes aren't good at counting digits, I keep getting the minutes, seconds and millis wrong and waste my time on every glance. Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 10 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/5815/4 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index e86ff77..c37ce61 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -233,6 +233,7 @@ LOG_TIMESTAMP_NONE, LOG_TIMESTAMP_EPOCH, LOG_TIMESTAMP_DATE_PACKED, + LOG_TIMESTAMP_DATE, }; /*! Mapping between enum log_timestamp_format and strings. */ diff --git a/src/logging.c b/src/logging.c index c8c57d6..2b79be9 100644 --- a/src/logging.c +++ b/src/logging.c @@ -367,10 +367,14 @@ } break; case LOG_TIMESTAMP_DATE_PACKED: + case LOG_TIMESTAMP_DATE: { struct tm tm; struct timeval tv; - const char *ts_fmt = "%04d%02d%02d%02d%02d%02d%03d "; + const char *ts_fmt = + (target->print_timestamp2 == LOG_TIMESTAMP_DATE) + ? "%04d-%02d-%02d %02d:%02d:%02d.%03d " + : "%04d%02d%02d%02d%02d%02d%03d "; osmo_gettimeofday(&tv, NULL); localtime_r(&tv.tv_sec, &tm); ret = snprintf(buf + offset, rem, ts_fmt, @@ -663,6 +667,7 @@ * LOG_TIMESTAMP_NONE switches off the timestamp output. * LOG_TIMESTAMP_EPOCH prints the seconds since the epoch (1970-1-1). * LOG_TIMESTAMP_DATE_PACKED prints YYYYMMDDhhmmssnnn. + * LOG_TIMESTAMP_DATE prints YYYY-MM-DD hh:mm:ss.nnn. */ void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format fmt) { @@ -1177,6 +1182,7 @@ { LOG_TIMESTAMP_NONE, "none" }, { LOG_TIMESTAMP_EPOCH, "epoch" }, { LOG_TIMESTAMP_DATE_PACKED, "date-packed" }, + { LOG_TIMESTAMP_DATE, "date" }, { 0, NULL } }; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 23f1d35..267667f 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -190,11 +190,12 @@ DEFUN(logging_prnt_timestamp, logging_prnt_timestamp_cmd, - "logging print timestamp (none|epoch|date-packed)", + "logging print timestamp (none|epoch|date|date-packed)", LOGGING_STR "Log output settings\n" "Configure log message timestamping\n" "Don't prefix each log message\n" "Prefix with seconds since UNIX epoch\n" + "Prefix with YYYY-MM-DD HH:mm:ss.mmm\n" "Prefix with YYYYMMDDHHmmssmmm\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); -- To view, visit https://gerrit.osmocom.org/5815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 Gerrit-PatchSet: 4 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 Jan 18 01:29:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:29:11 +0000 Subject: [PATCH] libosmocore[master]: logging vty: add 'logging print timestamp', deprecate other ... Message-ID: Review at https://gerrit.osmocom.org/5861 logging vty: add 'logging print timestamp', deprecate other timestamp cmds Currently we have logging timestamp (0|1) logging print extended-timestamp (0|1) With the recently added timestamp style enum values, use the convenient gap of 'logging print timestamp' to provide a single vty command to configure all timestamp styles: logging timestamp (none|epoch|date-packed) (which will get another addition of 'date' in a subsequent patch. Rename logging_prnt_timestamp_cmd to logging_timestamp_cmd, which reflects the (deprecated) VTY command name of 'logging timestamp'. Add new logging_prnt_timestamp_cmd to provide the new 'logging print timestamp'. Change-Id: I58c792dda3cbcf8618648ba4429c27fa398a9e15 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 58 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/5861/1 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index f3f3f2b..e86ff77 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -10,6 +10,7 @@ #include #include #include +#include /*! Maximum number of logging contexts */ #define LOG_MAX_CTX 8 @@ -234,6 +235,15 @@ LOG_TIMESTAMP_DATE_PACKED, }; +/*! Mapping between enum log_timestamp_format and strings. */ +extern const struct value_string log_timestamp_format_names[]; +/*! Map enum log_timestamp_format values to string constants. */ +static inline const char *log_timestamp_format_name(enum log_timestamp_format ltf) +{ return get_value_string(log_timestamp_format_names, ltf); } +/*! Map string constants to enum log_timestamp_format values. */ +static inline enum log_timestamp_format log_timestamp_format_val(const char *str) +{ return (enum log_timestamp_format)get_string_value(log_timestamp_format_names, str); } + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ diff --git a/src/logging.c b/src/logging.c index 7b3a2fd..c8c57d6 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1172,4 +1172,12 @@ return 0; } +/*! Mapping between enum log_timestamp_format and strings. */ +const struct value_string log_timestamp_format_names[] = { + { LOG_TIMESTAMP_NONE, "none" }, + { LOG_TIMESTAMP_EPOCH, "epoch" }, + { LOG_TIMESTAMP_DATE_PACKED, "date-packed" }, + { 0, NULL } +}; + /*! @} */ diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 7251727..23f1d35 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -153,12 +153,13 @@ return CMD_SUCCESS; } -DEFUN(logging_prnt_timestamp, - logging_prnt_timestamp_cmd, +DEFUN_DEPRECATED(logging_timestamp, + logging_timestamp_cmd, "logging timestamp (0|1)", - LOGGING_STR "Configure log message timestamping\n" + LOGGING_STR "Use 'logging print timestamp' instead --" + " Configure log message epoch timestamping\n" "Don't prefix each log message\n" - "Prefix each log message with current timestamp\n") + "Prefix each log message with seconds since UNIX epoch\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); @@ -169,13 +170,14 @@ return CMD_SUCCESS; } -DEFUN(logging_prnt_ext_timestamp, +DEFUN_DEPRECATED(logging_prnt_ext_timestamp, logging_prnt_ext_timestamp_cmd, "logging print extended-timestamp (0|1)", LOGGING_STR "Log output settings\n" - "Configure log message timestamping\n" + "Use 'logging print timestamp' instead --" + " Configure log message date-packed timestamping\n" "Don't prefix each log message\n" - "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") + "Prefix each log message with current timestamp as YYYYMMDDhhmmssnnn\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); @@ -183,6 +185,31 @@ return CMD_WARNING; log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_DATE_PACKED : LOG_TIMESTAMP_DATE); + return CMD_SUCCESS; +} + +DEFUN(logging_prnt_timestamp, + logging_prnt_timestamp_cmd, + "logging print timestamp (none|epoch|date-packed)", + LOGGING_STR "Log output settings\n" + "Configure log message timestamping\n" + "Don't prefix each log message\n" + "Prefix with seconds since UNIX epoch\n" + "Prefix with YYYYMMDDHHmmssmmm\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_timestamp_format val; + + if (!tgt) + return CMD_WARNING; + + val = log_timestamp_format_val(argv[0]); + if (val < 0) { + vty_out(vty, "Could not parse argument: '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + log_set_print_timestamp2(tgt, val); return CMD_SUCCESS; } @@ -786,11 +813,10 @@ VTY_NEWLINE); vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); - if (tgt->print_timestamp2 == LOG_TIMESTAMP_DATE_PACKED) - vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); - else - vty_out(vty, " logging timestamp %u%s", - tgt->print_timestamp2 ? 1 : 0, VTY_NEWLINE); + if (tgt->print_timestamp2 != LOG_TIMESTAMP_NONE) { + vty_out(vty, " logging print timestamp %s%s", + log_timestamp_format_name(tgt->print_timestamp2), VTY_NEWLINE); + } if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); if (tgt->print_filename) @@ -841,6 +867,7 @@ install_element_ve(&disable_logging_cmd); install_element_ve(&logging_fltr_all_cmd); install_element_ve(&logging_use_clr_cmd); + install_element_ve(&logging_timestamp_cmd); install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); @@ -860,6 +887,7 @@ install_node(&cfg_log_node, config_write_log); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); + install_element(CFG_LOG_NODE, &logging_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); -- To view, visit https://gerrit.osmocom.org/5861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I58c792dda3cbcf8618648ba4429c27fa398a9e15 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jan 18 01:31:36 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:31:36 +0000 Subject: libosmocore[master]: logging: use enum to set timestamp format In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-2 meh, now I notice that I was wrong about 'logging timestamp' ... for some reason I thought it logs the seconds since epoch, while it prints a ctime() string like 'Thu Jan 18 02:27:19 2018' ... so I named the enum val wrongly and might not have started with separating the extended timestamp in the first place. My time to spend on this has long run out and I need to let this go for now. Might pick it up some other time. -- To view, visit https://gerrit.osmocom.org/5857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 01:32:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:32:11 +0000 Subject: libosmocore[master]: logging vty: add 'logging print timestamp', deprecate other ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 see comment on https://gerrit.osmocom.org/5857 -- To view, visit https://gerrit.osmocom.org/5861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I58c792dda3cbcf8618648ba4429c27fa398a9e15 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 Thu Jan 18 01:32:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:32:22 +0000 Subject: libosmocore[master]: logging: allow adding separators to the extended-timestamp In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-2 see comment on https://gerrit.osmocom.org/5857 -- To view, visit https://gerrit.osmocom.org/5815 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbd5192ea835e24b12fe057cc1ab56e9572d75c0 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 01:36:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:36:25 +0000 Subject: [PATCH] libosmocore[master]: logging: use enum to set timestamp format In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5857 to look at the new patch set (#4). logging: use enum to set timestamp format In preparation of adding a new timestamp format, refactor to use an enum to pick the timestamp style. Introduce log_set_print_timestamp2() to be able to pass an enum value directly (for future additions). Make the old API of log_set_print_timestamp() and log_set_print_extended_timestamp() write an enum value instead. The struct log_target members print_timestamp and print_ext_timestamp now become unused, only the new enum member print_timestamp2 has an effect. The old API functions still work. This slightly changes the API behavior, in that enabling the extended timestamp now disables the epoch timestamp, even after switching the extended timestamp off again. Before, switching off the extended timestamp would bring back the epoch timestamp. The API arguably does behave as a reader would expect, in that it switches the timestamp format absolutely, without "invisible state" in the background. Note this in TODO-RELEASE. Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 --- M TODO-RELEASE M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 4 files changed, 78 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/57/5857/4 diff --git a/TODO-RELEASE b/TODO-RELEASE index 782ba19..8353be7 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,11 @@ core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) +core log_target.print_timestamp, These two flags are now replaced by + log_target.print_ext_timestamp print_timestamp2 enum -- callers should use + log_set_print*() functions anyway. +core log_set_print_timestamp() Calling any other log_set_print_timestamp*() + function now is like log_set_print_timestamp(0), + so the epoch timestamp does not come back after + log_set_print_extended_timestamp(0); callers + should use log_set_print_timestamp2() now. diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index 617d78e..f3f3f2b 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -227,6 +227,13 @@ LOG_FILENAME_BASENAME, }; +/*! Format of the timestamp printed */ +enum log_timestamp_format { + LOG_TIMESTAMP_NONE, + LOG_TIMESTAMP_EPOCH, + LOG_TIMESTAMP_DATE_PACKED, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -243,13 +250,15 @@ uint8_t loglevel; /*! should color be used when printing log messages? */ unsigned int use_color:1; - /*! should log messages be prefixed with a timestamp? */ + /*! should log messages be prefixed with a timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_timestamp:1; /*! DEPRECATED: use print_filename2 instead. */ unsigned int print_filename:1; /*! should log messages be prefixed with a category name? */ unsigned int print_category:1; - /*! should log messages be prefixed with an extended timestamp? */ + /*! should log messages be prefixed with an extended timestamp? + * DEPRECATED: use print_timestamp2 instead. */ unsigned int print_ext_timestamp:1; /*! the type of this log taget */ @@ -312,6 +321,8 @@ bool print_category_hex; /* Should we print the source file and line, and in which way? */ enum log_filename_type print_filename2; + /* Timestamp format */ + enum log_timestamp_format print_timestamp2; }; /* use the above macros */ @@ -332,6 +343,7 @@ void log_set_use_color(struct log_target *target, int); void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format format); void log_set_print_filename(struct log_target *target, int); void log_set_print_filename2(struct log_target *target, enum log_filename_type lft); void log_set_print_category(struct log_target *target, int); diff --git a/src/logging.c b/src/logging.c index 66074ea..7b3a2fd 100644 --- a/src/logging.c +++ b/src/logging.c @@ -350,28 +350,38 @@ } } if (!cont) { - if (target->print_ext_timestamp) { - struct tm tm; - struct timeval tv; - osmo_gettimeofday(&tv, NULL); - localtime_r(&tv.tv_sec, &tm); - ret = snprintf(buf + offset, rem, "%04d%02d%02d%02d%02d%02d%03d ", - tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, - tm.tm_hour, tm.tm_min, tm.tm_sec, - (int)(tv.tv_usec / 1000)); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); - } else if (target->print_timestamp) { - char *timestr; - time_t tm; - tm = time(NULL); - timestr = ctime(&tm); - timestr[strlen(timestr)-1] = '\0'; - ret = snprintf(buf + offset, rem, "%s ", timestr); - if (ret < 0) - goto err; - OSMO_SNPRINTF_RET(ret, rem, offset, len); + switch (target->print_timestamp2) { + case LOG_TIMESTAMP_NONE: + break; + case LOG_TIMESTAMP_EPOCH: + { + char *timestr; + time_t tm; + tm = time(NULL); + timestr = ctime(&tm); + timestr[strlen(timestr)-1] = '\0'; + ret = snprintf(buf + offset, rem, "%s ", timestr); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; + case LOG_TIMESTAMP_DATE_PACKED: + { + struct tm tm; + struct timeval tv; + const char *ts_fmt = "%04d%02d%02d%02d%02d%02d%03d "; + osmo_gettimeofday(&tv, NULL); + localtime_r(&tv.tv_sec, &tm); + ret = snprintf(buf + offset, rem, ts_fmt, + tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday, + tm.tm_hour, tm.tm_min, tm.tm_sec, + (int)(tv.tv_usec / 1000)); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + break; } if (target->print_category) { ret = snprintf(buf + offset, rem, "%s%s%s%s ", @@ -622,16 +632,18 @@ target->use_color = use_color; } -/*! Enable or disable printing of timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_EPOCH) instead. + * Enable or disable printing of timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps */ void log_set_print_timestamp(struct log_target *target, int print_timestamp) { - target->print_timestamp = print_timestamp; + log_set_print_timestamp2(target, print_timestamp ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); } -/*! Enable or disable printing of extended timestamps while logging +/*! Use log_set_print_timestamp2(LOG_TIMESTAMP_DATE_PACKED) instead. + * Enable or disable printing of extended timestamps while logging. * \param[in] target Log target to be affected * \param[in] print_timestamp Enable (1) or disable (0) timestamps * @@ -641,7 +653,20 @@ */ void log_set_print_extended_timestamp(struct log_target *target, int print_timestamp) { - target->print_ext_timestamp = print_timestamp; + log_set_print_timestamp2(target, print_timestamp ? LOG_TIMESTAMP_DATE_PACKED : LOG_TIMESTAMP_NONE); +} + +/*! Enable or disable printing of timestamps while logging. + * \param[in] target Log target to be affected + * \param[in] fmt LOG_TIMESTAMP_* value to indicate the format. + * + * LOG_TIMESTAMP_NONE switches off the timestamp output. + * LOG_TIMESTAMP_EPOCH prints the seconds since the epoch (1970-1-1). + * LOG_TIMESTAMP_DATE_PACKED prints YYYYMMDDhhmmssnnn. + */ +void log_set_print_timestamp2(struct log_target *target, enum log_timestamp_format fmt) +{ + target->print_timestamp2 = fmt; } /*! Use log_set_print_filename2() instead. @@ -771,7 +796,7 @@ /* global settings */ target->use_color = 1; - target->print_timestamp = 0; + target->print_timestamp2 = LOG_TIMESTAMP_NONE; target->print_filename2 = LOG_FILENAME_PATH; target->print_category_hex = true; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 0eaa7fd..e4c4bb8 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -165,7 +165,7 @@ if (!tgt) return CMD_WARNING; - log_set_print_timestamp(tgt, atoi(argv[0])); + log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_EPOCH : LOG_TIMESTAMP_NONE); return CMD_SUCCESS; } @@ -182,7 +182,7 @@ if (!tgt) return CMD_WARNING; - log_set_print_extended_timestamp(tgt, atoi(argv[0])); + log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_DATE_PACKED : LOG_TIMESTAMP_NONE); return CMD_SUCCESS; } @@ -786,11 +786,11 @@ VTY_NEWLINE); vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); - if (tgt->print_ext_timestamp) + if (tgt->print_timestamp2 == LOG_TIMESTAMP_DATE_PACKED) vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); else vty_out(vty, " logging timestamp %u%s", - tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); + tgt->print_timestamp2 ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); if (tgt->print_filename) -- To view, visit https://gerrit.osmocom.org/5857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 Gerrit-PatchSet: 4 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 Jan 18 01:36:25 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 01:36:25 +0000 Subject: [PATCH] libosmocore[master]: logging vty: add 'logging print timestamp', deprecate other ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5861 to look at the new patch set (#2). logging vty: add 'logging print timestamp', deprecate other timestamp cmds Currently we have logging timestamp (0|1) logging print extended-timestamp (0|1) With the recently added timestamp style enum values, use the convenient gap of 'logging print timestamp' to provide a single vty command to configure all timestamp styles: logging timestamp (none|epoch|date-packed) (which will get another addition of 'date' in a subsequent patch. Rename logging_prnt_timestamp_cmd to logging_timestamp_cmd, which reflects the (deprecated) VTY command name of 'logging timestamp'. Add new logging_prnt_timestamp_cmd to provide the new 'logging print timestamp'. Change-Id: I58c792dda3cbcf8618648ba4429c27fa398a9e15 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 58 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/5861/2 diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h index f3f3f2b..e86ff77 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -10,6 +10,7 @@ #include #include #include +#include /*! Maximum number of logging contexts */ #define LOG_MAX_CTX 8 @@ -234,6 +235,15 @@ LOG_TIMESTAMP_DATE_PACKED, }; +/*! Mapping between enum log_timestamp_format and strings. */ +extern const struct value_string log_timestamp_format_names[]; +/*! Map enum log_timestamp_format values to string constants. */ +static inline const char *log_timestamp_format_name(enum log_timestamp_format ltf) +{ return get_value_string(log_timestamp_format_names, ltf); } +/*! Map string constants to enum log_timestamp_format values. */ +static inline enum log_timestamp_format log_timestamp_format_val(const char *str) +{ return (enum log_timestamp_format)get_string_value(log_timestamp_format_names, str); } + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ diff --git a/src/logging.c b/src/logging.c index 7b3a2fd..c8c57d6 100644 --- a/src/logging.c +++ b/src/logging.c @@ -1172,4 +1172,12 @@ return 0; } +/*! Mapping between enum log_timestamp_format and strings. */ +const struct value_string log_timestamp_format_names[] = { + { LOG_TIMESTAMP_NONE, "none" }, + { LOG_TIMESTAMP_EPOCH, "epoch" }, + { LOG_TIMESTAMP_DATE_PACKED, "date-packed" }, + { 0, NULL } +}; + /*! @} */ diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index e4c4bb8..b97da40 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -153,12 +153,13 @@ return CMD_SUCCESS; } -DEFUN(logging_prnt_timestamp, - logging_prnt_timestamp_cmd, +DEFUN_DEPRECATED(logging_timestamp, + logging_timestamp_cmd, "logging timestamp (0|1)", - LOGGING_STR "Configure log message timestamping\n" + LOGGING_STR "Use 'logging print timestamp' instead --" + " Configure log message epoch timestamping\n" "Don't prefix each log message\n" - "Prefix each log message with current timestamp\n") + "Prefix each log message with seconds since UNIX epoch\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); @@ -169,13 +170,14 @@ return CMD_SUCCESS; } -DEFUN(logging_prnt_ext_timestamp, +DEFUN_DEPRECATED(logging_prnt_ext_timestamp, logging_prnt_ext_timestamp_cmd, "logging print extended-timestamp (0|1)", LOGGING_STR "Log output settings\n" - "Configure log message timestamping\n" + "Use 'logging print timestamp' instead --" + " Configure log message date-packed timestamping\n" "Don't prefix each log message\n" - "Prefix each log message with current timestamp with YYYYMMDDhhmmssnnn\n") + "Prefix each log message with current timestamp as YYYYMMDDhhmmssnnn\n") { struct log_target *tgt = osmo_log_vty2tgt(vty); @@ -183,6 +185,31 @@ return CMD_WARNING; log_set_print_timestamp2(tgt, atoi(argv[0]) ? LOG_TIMESTAMP_DATE_PACKED : LOG_TIMESTAMP_NONE); + return CMD_SUCCESS; +} + +DEFUN(logging_prnt_timestamp, + logging_prnt_timestamp_cmd, + "logging print timestamp (none|epoch|date-packed)", + LOGGING_STR "Log output settings\n" + "Configure log message timestamping\n" + "Don't prefix each log message\n" + "Prefix with seconds since UNIX epoch\n" + "Prefix with YYYYMMDDHHmmssmmm\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_timestamp_format val; + + if (!tgt) + return CMD_WARNING; + + val = log_timestamp_format_val(argv[0]); + if (val < 0) { + vty_out(vty, "Could not parse argument: '%s'%s", argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + log_set_print_timestamp2(tgt, val); return CMD_SUCCESS; } @@ -786,11 +813,10 @@ VTY_NEWLINE); vty_out(vty, " logging print category %d%s", tgt->print_category ? 1 : 0, VTY_NEWLINE); - if (tgt->print_timestamp2 == LOG_TIMESTAMP_DATE_PACKED) - vty_out(vty, " logging print extended-timestamp 1%s", VTY_NEWLINE); - else - vty_out(vty, " logging timestamp %u%s", - tgt->print_timestamp2 ? 1 : 0, VTY_NEWLINE); + if (tgt->print_timestamp2 != LOG_TIMESTAMP_NONE) { + vty_out(vty, " logging print timestamp %s%s", + log_timestamp_format_name(tgt->print_timestamp2), VTY_NEWLINE); + } if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); if (tgt->print_filename) @@ -841,6 +867,7 @@ install_element_ve(&disable_logging_cmd); install_element_ve(&logging_fltr_all_cmd); install_element_ve(&logging_use_clr_cmd); + install_element_ve(&logging_timestamp_cmd); install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); @@ -860,6 +887,7 @@ install_node(&cfg_log_node, config_write_log); install_element(CFG_LOG_NODE, &logging_fltr_all_cmd); install_element(CFG_LOG_NODE, &logging_use_clr_cmd); + install_element(CFG_LOG_NODE, &logging_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); -- To view, visit https://gerrit.osmocom.org/5861 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I58c792dda3cbcf8618648ba4429c27fa398a9e15 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 Jan 18 01:44:37 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Thu, 18 Jan 2018 01:44:37 +0000 Subject: libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Patch Set 9: I don't remember off the top of my head. If it's not used in OpenBSC or in the SIP proxy, then I guess this is not required. -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 09:01:29 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Jan 2018 09:01:29 +0000 Subject: [ABANDON] libosmocore[master]: gsm0480: expose the gsm0480_parse_ss_facility_ie() In-Reply-To: References: Message-ID: Vadim Yanitskiy has abandoned this change. Change subject: gsm0480: expose the gsm0480_parse_ss_facility_ie() ...................................................................... Abandoned Change is not required anymore. -- To view, visit https://gerrit.osmocom.org/3381 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I35d3360f36c48eb1295610ab96ff264c45af77eb Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Ivan Kluchnikov Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 18 10:08:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 10:08:14 +0000 Subject: libosmo-sccp[master]: sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I113645bd6df1ec9ae5137977028df38560fc4789 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp 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 Thu Jan 18 10:21:56 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 10:21:56 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 2: -Code-Review > This is the main change of this patch. Adding yes, string splitting - no. But like I've said, I don't consider it to be blocker. > following the pattern present in this file So this slipped passed review sometime before. Should be fixed as well. > could you clarify? It's documented in https://www.gnu.org/software/automake/manual/html_node/Linking.html In a nutshell, LDADD applies to all the programs, prog_LDADD applies single program. So having only "prog_LDADD = $(LDADD)" is confusing and redundant. > to fix LDADD in a separate patch? Sure but please fix all such entries and submit it together with this one. -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 11:06:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 11:06:23 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make UL/DL state internal Message-ID: Review at https://gerrit.osmocom.org/5862 TBF: make UL/DL state internal * add functions/macros for setting TBF's UL/DL state * add functions for checking TBF's UL/DL state * move pre-free check into separate function * update TBF test output due to extended state transition logging N. B: this should not be confused with TBF-UL or TBF-DL state. Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 7 files changed, 175 insertions(+), 49 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/62/5862/1 diff --git a/src/bts.cpp b/src/bts.cpp index 873af73..f614c1a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1022,11 +1022,11 @@ tbf_free(tbf); return; } - if (tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) { + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; if (!new_tbf) { @@ -1054,11 +1054,11 @@ tbf_assign_control_ts(new_tbf); return; } - if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; if (!new_tbf) { @@ -1156,10 +1156,10 @@ /* schedule uplink assignment or reject */ if (ul_tbf) { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); } else { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); } } @@ -1403,7 +1403,7 @@ ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); /* get capabilities */ if (ul_tbf->ms()) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 8925032..a87217f 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -54,11 +54,10 @@ *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) *ul_ack_tbf = ul_tbf; - if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || ul_tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = ul_tbf; /* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states? */ @@ -73,10 +72,10 @@ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; - if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = dl_tbf; } @@ -139,13 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - if (tbf == ul_ass_tbf && tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf == ul_ass_tbf && tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - if (tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else msg = ul_ass_tbf->create_ul_ass(fn, ts); diff --git a/src/tbf.cpp b/src/tbf.cpp index a1e4392..6ebe77e 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -165,8 +165,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), - ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), @@ -185,6 +183,8 @@ m_ta(GSM48_TA_INVALID), m_ms_class(0), state(GPRS_RLCMAC_NULL), + dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), + ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) @@ -457,21 +457,7 @@ } LOGPTBF(tbf, LOGL_INFO, "free\n"); - if (tbf->ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending uplink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, - tbf->ul_ass_state)); - if (tbf->dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending downlink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, - tbf->dl_ass_state)); - + tbf->check_pending_ass(); tbf->stop_timers("freeing TBF"); /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); @@ -1527,7 +1513,7 @@ ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); ul_tbf->control_ts = ts; ul_tbf->trx = trx; ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0); diff --git a/src/tbf.h b/src/tbf.h index bf6ce4c..7cc0587 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -181,6 +181,8 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -191,7 +193,12 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; + bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; + bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); + void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); + void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; @@ -272,8 +279,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; - enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; enum gprs_rlcmac_tbf_poll_state poll_state; @@ -336,6 +341,8 @@ private: enum gprs_rlcmac_tbf_state state; + enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; + enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -368,6 +375,16 @@ return state == rhs; } +inline bool gprs_rlcmac_tbf::dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const +{ + return dl_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const +{ + return ul_ass_state == rhs; +} + inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const { return state != rhs; @@ -399,6 +416,39 @@ state = new_state; } +inline void gprs_rlcmac_tbf::set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes DL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, new_state)); + dl_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes UL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, new_state)); + ul_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::check_pending_ass() +{ + if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending uplink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state)); + + if (dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending downlink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state)); +} + inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) { if ((state_flags & (1 << state_flag))) { diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 5a42aa0..458d5fe 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -489,7 +489,7 @@ /* check for downlink tbf: */ if (old_tbf) { LOGPTBFDL(this, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", old_tbf->name()); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(old_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 9e21c73..968f9eb 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -175,7 +175,7 @@ check_tbf(dl_tbf); /* "Establish" the DL TBF */ - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); @@ -276,7 +276,7 @@ OSMO_ASSERT(new_tbf != dl_tbf); OSMO_ASSERT(new_tbf->tfi() == 1); check_tbf(dl_tbf); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); if (test_mode == TEST_MODE_REVERSE_FREE) { GprsMs::Guard guard(ms); tbf_free(new_tbf); @@ -365,7 +365,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); printf("=== end %s ===\n", __func__); @@ -2699,7 +2699,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); } @@ -2748,7 +2748,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index da2c2dd..00f50b8 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -55,6 +55,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) appending 200 bytes @@ -109,8 +110,10 @@ Allocated TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) Trigger downlink assignment on PACCH TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) exists +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) stopping timer T3193 [freeing TBF] @@ -144,6 +147,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) appending 200 bytes @@ -198,8 +202,10 @@ Allocated TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) Trigger downlink assignment on PACCH TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) exists +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) changes state from ASSIGN to RELEASING TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) free TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) stopping timer T0 [freeing TBF] @@ -233,6 +239,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) appending 200 bytes @@ -531,6 +538,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) changes state from FINISHED to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) stopping timer T3193 [freeing TBF] @@ -558,6 +566,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW Searching for first unallocated TFI: TRX=0 Found TFI=1. @@ -579,6 +588,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xf1000001, partly confirmed The MS object cannot fully confirm an unexpected TLLI: 0xf1000002, partly confirmed @@ -587,7 +597,7 @@ TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=FLOW) the IMSI '001001000000002' was already assigned to another MS object: TLLI = 0xf1000001, that IMSI will be removed TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=FLOW) changes state from FLOW to RELEASING TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=RELEASING) free -TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=RELEASING) Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! +TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=RELEASING) FIXME: Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=RELEASING), 1 TBFs, USFs = 00, TFIs = 00000002. Detaching TBF from MS object, TLLI = 0xf1000001, TBF = TBF(TFI=0 TLLI=0xf1000001 DIR=DL STATE=RELEASING) ********** DL-TBF ends here ********** @@ -596,7 +606,7 @@ Destroying MS object, TLLI = 0x00000000 TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=FLOW) changes state from FLOW to RELEASING TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=RELEASING) free -TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=RELEASING) Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! +TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=RELEASING) FIXME: Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! PDCH(TS 4, TRX 0): Detaching TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xf1000002, TBF = TBF(TFI=1 TLLI=0xf1000002 DIR=DL STATE=RELEASING) Destroying MS object, TLLI = 0xf1000002 @@ -1645,6 +1655,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- @@ -1656,6 +1667,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1691,6 +1703,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes @@ -1729,6 +1742,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- @@ -1740,6 +1754,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1774,6 +1789,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 10 bytes @@ -1790,6 +1806,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) [UPLINK] DOWNLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) stopping timer T0 [control acked (DL-TBF)] Received RTS on disabled PDCH: TRX=0 TS=0 @@ -1866,6 +1883,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf5667788, not yet confirmed Modifying MS object, TLLI = 0xf5667788, TA 220 -> 7 TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS Received RTS for PDCH: TRX=0 TS=7 FN=2654335 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ @@ -1878,6 +1896,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1937,6 +1956,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- @@ -1948,6 +1968,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1982,6 +2003,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 20 bytes @@ -1989,7 +2011,7 @@ Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 UL RSSI of TLLI=0xf1223344: 31 dBm TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) free -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) FIXME: Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) stopping timer T3169 [freeing TBF] PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) @@ -2032,6 +2054,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) starting timer T3169 [allocation (UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- @@ -2043,6 +2066,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 @@ -2061,6 +2085,7 @@ Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 80 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Trigger downlink assignment on PACCH TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. Got RLC block, coding scheme: CS-1, length: 23 (23)) @@ -2112,6 +2137,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- @@ -2123,6 +2149,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -2157,6 +2184,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 20 bytes @@ -2164,7 +2192,7 @@ Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 UL RSSI of TLLI=0xf1223344: 31 dBm TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) free -TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) FIXME: Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) stopping timer T3169 [freeing TBF] PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) @@ -2265,6 +2293,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ ------------------------- TX : Packet Uplink Assignment ------------------------- @@ -2276,6 +2305,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -2310,6 +2340,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 13 bytes @@ -2365,6 +2396,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) [UPLINK] DOWNLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) stopping timer T0 [control acked (DL-TBF)] Received RTS on disabled PDCH: TRX=0 TS=0 @@ -3064,6 +3096,7 @@ Allocated TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 80 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Trigger downlink assignment on PACCH TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. Received RTS for PDCH: TRX=0 TS=7 FN=2654400 block_nr=2 scheduling USF=0 for required uplink resource of UL TFI=0 @@ -3078,6 +3111,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) [UPLINK] DOWNLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) stopping timer T3193 [freeing TBF] @@ -3439,6 +3473,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ @@ -3451,6 +3486,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -3490,6 +3526,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -3533,6 +3570,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ @@ -3545,6 +3583,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -3747,6 +3786,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -3774,6 +3814,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -4102,6 +4143,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -4133,6 +4175,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -4401,6 +4444,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -4432,6 +4476,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -4655,6 +4700,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -4686,6 +4732,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -4870,6 +4917,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -4901,6 +4949,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -5061,6 +5110,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5092,6 +5142,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -5231,6 +5282,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5262,6 +5314,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -5395,6 +5448,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5426,6 +5480,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -5545,6 +5600,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5576,6 +5632,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 10 bytes @@ -5696,6 +5753,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5727,6 +5785,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -5750,6 +5809,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5781,6 +5841,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -5804,6 +5865,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5835,6 +5897,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -5858,6 +5921,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5889,6 +5953,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -5931,6 +5996,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -5962,6 +6028,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6004,6 +6071,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6035,6 +6103,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6077,6 +6146,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6108,6 +6178,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6150,6 +6221,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6181,6 +6253,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6211,6 +6284,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6242,6 +6316,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6272,6 +6347,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6303,6 +6379,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6333,6 +6410,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6364,6 +6442,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 100 bytes @@ -6401,6 +6480,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes state from WAIT RELEASE to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) stopping timer T3193 [freeing TBF] @@ -6448,6 +6528,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ @@ -6460,6 +6541,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -6529,6 +6611,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -6624,6 +6707,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ @@ -6636,6 +6720,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 1d 00 40 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -6693,6 +6778,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -6720,6 +6806,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): setting EGPRS DL window size to 64, base(0) slots(1) ws_pdch(0) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed ws(480) @@ -6842,7 +6929,7 @@ DL packet loss of IMSI= / TLLI=0xffeeddcc: 78% TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) FIXME: Software error: Pending downlink assignment in state GPRS_RLCMAC_DL_ASS_SEND_ASS. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -7084,6 +7171,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) change control TS 7 -> 7 until assinment is complete. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) start Packet Uplink Assignment (PACCH) +++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ @@ -7096,6 +7184,7 @@ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 00 00 80 00 00 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 2b 2b 2b 2b @@ -7947,6 +8036,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -9027,6 +9117,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) appending 100 bytes @@ -9231,6 +9322,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec. Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) @@ -9240,6 +9332,7 @@ Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec. Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -- To view, visit https://gerrit.osmocom.org/5862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 11:34:12 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 11:34:12 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make UL ack state internal Message-ID: Review at https://gerrit.osmocom.org/5863 TBF: make UL ack state internal * add functions/macros for setting TBF's UL ack state * add functions for checking TBF's UL ack state * update TBF test output due to extended state transition logging N. B: this should not be confused with TBF-UL state. Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Related: OS#1539 --- M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 6 files changed, 49 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/63/5863/1 diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a87217f..3f9fcb1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -52,7 +52,7 @@ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; - if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) + if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; diff --git a/src/tbf.cpp b/src/tbf.cpp index 6ebe77e..ef78820 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -60,6 +60,13 @@ { 0, NULL } }; +const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_SEND_ACK), /* send acknowledge on next RTS */ + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_WAIT_ACK), /* wait for PACKET CONTROL ACK */ + { 0, NULL } +}; + static const struct value_string tbf_timers_names[] = { OSMO_VALUE_STRING(T0), OSMO_VALUE_STRING(T3169), @@ -165,7 +172,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), @@ -185,6 +191,7 @@ state(GPRS_RLCMAC_NULL), dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), + ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 7cc0587..19aa41a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -87,6 +87,8 @@ GPRS_RLCMAC_UL_ACK_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; +extern const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[]; + enum gprs_rlcmac_tbf_direction { GPRS_RLCMAC_DL_TBF, GPRS_RLCMAC_UL_TBF @@ -183,6 +185,7 @@ #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -195,9 +198,11 @@ bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; + bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -279,8 +284,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -343,6 +346,7 @@ enum gprs_rlcmac_tbf_state state; enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; + enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -383,6 +387,11 @@ inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const { return ul_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const +{ + return ul_ack_state == rhs; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -434,6 +443,15 @@ ul_ass_state = new_state; } +inline void gprs_rlcmac_tbf::set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line) +{ + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes UL ACK state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, ul_ack_state), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, new_state)); + ul_ack_state = new_state; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index eaf9c93..de3d247 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -106,8 +106,8 @@ bool gprs_rlcmac_ul_tbf::handle_ctrl_ack() { /* check if this control ack belongs to packet uplink ack */ - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return true; } @@ -124,7 +124,7 @@ if (final) { if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; @@ -158,7 +158,7 @@ /* waiting for final acknowledge */ m_final_ack_sent = 1; } else - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return msg; } @@ -369,9 +369,9 @@ "because %d frames received.\n", SEND_ACK_AFTER_FRAMES); } - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE) { + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)) { /* trigger sending at next RTS */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_SEND_ACK; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_SEND_ACK); } else { /* already triggered */ LOGP(DRLCMACUL, LOGL_DEBUG, "- Sending Ack/Nack is " diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 968f9eb..0ac519c 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1350,7 +1350,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1434,7 +1434,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1522,7 +1522,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 00f50b8..687ec3b 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1594,6 +1594,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes state from FLOW to FINISHED - Scheduling Ack/Nack, because TLLI is included. - Scheduling Ack/Nack, because last block has CV==0. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** @@ -2257,6 +2258,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes state from FLOW to FINISHED - Scheduling Ack/Nack, because TLLI is included. - Scheduling Ack/Nack, because last block has CV==0. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: @@ -3627,6 +3629,7 @@ -- Frame 1 starts at offset 0, length=74, is_complete=0 - No gaps in received block, last block: BSN=1 CV=7 - Scheduling Ack/Nack, because MS is stalled. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-3, length: 42 (42)) UL data: 1f 10 40 cd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got MCS-3 RLC block: R=1, SI=1, TFI=0, CPS=5, RSB=0, rc=329 @@ -6574,6 +6577,7 @@ Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) EGPRS URBB, urbb len = 0, SSN = 3, ESN_CRBB = 2, len present = yes,desc len = 15, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 2, BOW, EOW Uplink Ack/Nack bit count 98, max 184, message = 40 24 01 3f 3e 24 46 68 90 87 b0 06 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-3, length: 42 (42)) UL data: 1d 20 40 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got MCS-3 RLC block: R=1, SI=0, TFI=0, CPS=5, RSB=0, rc=329 @@ -6587,6 +6591,7 @@ Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) EGPRS URBB, urbb len = 2, SSN = 3, ESN_CRBB = 2, len present = yes,desc len = 17, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 5, BOW, EOW Uplink Ack/Nack bit count 100, max 184, message = 40 24 01 3f 3e 24 46 68 90 88 b0 06 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_NONE Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** @@ -7391,6 +7396,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 - Raising V(R) to 39 - Scheduling Ack/Nack, because 20 frames received. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 40 01 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -8002,6 +8008,7 @@ the ucmp len=157 uclen_crbb=19 num_blocks=157 crbb length 78, and the CRBB bitmap = 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e EGPRS URBB, urbb len = 94, SSN = 2, ESN_CRBB = 1, len present = No,desc len = 109, SNS = 2048, WS = 192, V(Q) = 1, V(R) = 159, BOW Uplink Ack/Nack bit count 184, max 184, message = 40 24 01 3f 3e 24 46 68 90 20 04 55 55 55 55 55 55 55 55 55 55 55 54 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_SEND_ACK to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 00 00 02 80 00 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 2b 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -8235,6 +8242,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 - Raising V(R) to 37 - Scheduling Ack/Nack, because 20 frames received. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 30 01 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -8248,6 +8256,7 @@ Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) EGPRS URBB, urbb len = 37, SSN = 2, ESN_CRBB = 1, len present = yes,desc len = 52, SNS = 2048, WS = 192, V(Q) = 1, V(R) = 39, BOW, EOW Uplink Ack/Nack bit count 135, max 184, message = 40 24 01 3f 3e 24 46 68 90 9a 30 04 aa aa aa aa a9 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_SEND_ACK to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 00 00 02 80 00 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 2b 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -8449,6 +8458,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 - Raising V(R) to 98 - Scheduling Ack/Nack, because 20 frames received. +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 10 03 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -9082,6 +9092,7 @@ EGPRS CRBB, crbb_len = 30, crbb_start_clr_code = 0 EGPRS URBB, urbb len = 0, SSN = 1, ESN_CRBB = 159, len present = yes,desc len = 53, SNS = 2048, WS = 192, V(Q) = 0, V(R) = 160, BOW, EOW Uplink Ack/Nack bit count 136, max 184, message = 40 24 01 3f 3e 24 46 68 90 9a b0 03 3c 03 c3 1b a0 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_SEND_ACK to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 00 00 02 80 00 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 2b 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 -- To view, visit https://gerrit.osmocom.org/5863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 12:07:21 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 12:07:21 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make poll state internal Message-ID: Review at https://gerrit.osmocom.org/5864 TBF: make poll state internal * add functions/macros for setting TBF's poll state * add function for checking TBF's poll state * update TBF test output due to extended state transition logging Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/poll_controller.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 8 files changed, 59 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/64/5864/1 diff --git a/src/bts.cpp b/src/bts.cpp index f614c1a..94354f2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -399,7 +399,7 @@ static inline bool tbf_check(gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t trx_no, uint8_t ts) { - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_scheduled() && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) return true; @@ -1010,7 +1010,7 @@ tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(tbf); /* check if this control ack belongs to packet uplink ack */ ul_tbf = as_ul_tbf(tbf); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 3f9fcb1..ebf4714 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -49,8 +49,7 @@ if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && ul_tbf->poll_fn == poll_fn) + if (ul_tbf->poll_scheduled() && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; @@ -69,8 +68,7 @@ if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && dl_tbf->poll_fn == poll_fn) + if (dl_tbf->poll_scheduled() && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index f8ab6c9..5c5a717 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -47,14 +47,14 @@ llist_for_each(pos, &m_bts.ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (ul_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, ul_tbf->poll_fn)) ul_tbf->poll_timeout(); } } llist_for_each(pos, &m_bts.dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (dl_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, dl_tbf->poll_fn)) dl_tbf->poll_timeout(); } diff --git a/src/tbf.cpp b/src/tbf.cpp index ef78820..241c3eb 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -45,6 +45,12 @@ static void tbf_timer_cb(void *_tbf); +const struct value_string gprs_rlcmac_tbf_poll_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_SCHED), /* a polling was scheduled */ + { 0, NULL } +}; + const struct value_string gprs_rlcmac_tbf_dl_ass_state_names[] = { OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_NONE), OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_SEND_ASS), @@ -172,7 +178,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), n3105(0), @@ -192,6 +197,7 @@ dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), + poll_state(GPRS_RLCMAC_POLL_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 19aa41a..4fea9ff 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,8 @@ GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ }; +extern const struct value_string gprs_rlcmac_tbf_poll_state_names[]; + enum gprs_rlcmac_tbf_dl_ass_state { GPRS_RLCMAC_DL_ASS_NONE = 0, GPRS_RLCMAC_DL_ASS_SEND_ASS, /* send downlink assignment on next RTS */ @@ -186,6 +188,8 @@ #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_SET(t) do { t->poll_sched_set(__FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_UNSET(t) do { t->poll_sched_unset(__FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -199,10 +203,13 @@ bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; + bool poll_scheduled() const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); + void poll_sched_set(const char *file, int line); + void poll_sched_unset(const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -284,7 +291,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -347,6 +353,7 @@ enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; + enum gprs_rlcmac_tbf_poll_state poll_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -392,6 +399,11 @@ inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const { return ul_ack_state == rhs; +} + +inline bool gprs_rlcmac_tbf::poll_scheduled() const +{ + return poll_state == GPRS_RLCMAC_POLL_SCHED; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -452,6 +464,20 @@ ul_ack_state = new_state; } +inline void gprs_rlcmac_tbf::poll_sched_set(const char *file, int line) +{ + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_SCHED\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_SCHED; +} + +inline void gprs_rlcmac_tbf::poll_sched_unset(const char *file, int line) +{ + LOGPSRC(DRLCMAC, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_NONE\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_NONE; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 458d5fe..4f33e06 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -643,7 +643,7 @@ /* reset N3105 */ n3105 = 0; t_stop(T3191, "ACK/NACK received"); - poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(this); return ack_recovered; } @@ -1198,7 +1198,7 @@ bool gprs_rlcmac_dl_tbf::need_control_ts() const { - if (poll_state != GPRS_RLCMAC_POLL_NONE) + if (poll_scheduled()) return false; return state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK) || diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index de3d247..a58ebaa 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -123,8 +123,7 @@ uint32_t new_poll_fn = 0; if (final) { - if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + if (poll_scheduled() && ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 687ec3b..ff729c5 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1667,6 +1667,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -1754,6 +1755,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -1806,6 +1808,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) [UPLINK] DOWNLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -1896,6 +1899,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -1968,6 +1972,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -2066,6 +2071,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -2149,6 +2155,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -2306,6 +2313,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -2397,6 +2405,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) [UPLINK] DOWNLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) changes state from ASSIGN to FLOW @@ -3044,6 +3053,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) RX: [PCU <- BTS] Packet Downlink Ack/Nack Got GPRS DL ACK bitmap: SSN: 0, BSN 0 to 28 - 1 (28 blocks), "RRRRRRRRRRRRRRRRRRRRRRRRRRRR" TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) downlink acknowledge @@ -3112,6 +3122,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) [UPLINK] DOWNLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes state from WAIT RELEASE to RELEASING @@ -3487,6 +3498,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW @@ -3584,6 +3596,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW @@ -6543,6 +6556,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW @@ -6724,6 +6738,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW @@ -7188,6 +7203,7 @@ +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW -- To view, visit https://gerrit.osmocom.org/5864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 12:48:04 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 12:48:04 +0000 Subject: osmo-msc[master]: libmsc: a_iface_bssap.c: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 2: -Code-Review (1 comment) https://gerrit.osmocom.org/#/c/5424/2/src/libmsc/a_iface_bssap.c File src/libmsc/a_iface_bssap.c: Line 328: msg->l3h = msgb_put(msg, TLVP_LEN(&tp, GSM0808_IE_LAYER_3_INFORMATION)); > The point here is that the MSC side is the "trusted core network" and that This change should avoid the issue: https://gerrit.osmocom.org/#/c/5689/ -- To view, visit https://gerrit.osmocom.org/5424 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I28073efd5cff58cd212341bceee784caf08d5ad8 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:01:48 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 14:01:48 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: Code-Review-1 (6 comments) I think it's good having 2 separate options (enable-sysmobts, with-sysmobts), but it may be a good idea having a more explicit name like --with-sysmobts-headers or alike. Please fix the CPPFLAGS->CFLAGS stuff or explain why is it done like this. https://gerrit.osmocom.org/#/c/5818/9/configure.ac File configure.ac: Line 77: CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" Why CPPFLAGS and not CFLAGS? Line 82: CPPFLAGS=$oldCPPFLAGS same https://gerrit.osmocom.org/#/c/5818/9/contrib/jenkins_sysmobts.sh File contrib/jenkins_sysmobts.sh: Line 19: configure_flags="--with-sysmobts=$inst/include/ --enable-sysmocom-bts" Sound more natural for me first enabling it, then specifying the headers path, but it really doesn't matter :P https://gerrit.osmocom.org/#/c/5818/9/src/osmo-bts-sysmo/Makefile.am File src/osmo-bts-sysmo/Makefile.am: Line 1: AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) agaion why cppflags and not cflags? https://gerrit.osmocom.org/#/c/5818/9/tests/misc/Makefile.am File tests/misc/Makefile.am: Line 2: AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) In here CFLAGS are used and not CPPFLAGS. https://gerrit.osmocom.org/#/c/5818/9/tests/sysmobts/Makefile.am File tests/sysmobts/Makefile.am: Line 1: AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) again CPPFLAGS -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:08:44 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:08:44 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Document workaround for gsmtap logging Message-ID: Review at https://gerrit.osmocom.org/5865 Document workaround for gsmtap logging Document a way to minimize logging to stderr when gsmtap is used as a log target. Change-Id: I8e64a0075b5a4bad3f83660e0668e6de45b21008 --- M common/chapters/logging.adoc 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/65/5865/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index beb1341..f385204 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -167,7 +167,14 @@ .Wireshark with logs delivered over GSMTAP image::../common/images/wireshark-gsmtap-log.png[] -Note: the logs are also duplicated to stderr when GSMTAP logging is configured. +Note: the logs are also duplicated to stderr when GSMTAP logging is configured because stderr is the default log target which is +initialized automatically. To descrease stderr logging to absolute minimum, you can configure it as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log stderr +OsmoBSC(config-log)# logging level all fatal +---- ==== Logging to a file -- To view, visit https://gerrit.osmocom.org/5865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8e64a0075b5a4bad3f83660e0668e6de45b21008 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:21:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:21:25 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: Because of https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html In short CPPFLAGS are flags for preprocessor and is the right place to add things like include directories. See also implementation for other BTS models. The CFLAGS (and corresponding CXXFLAGS for c++) are for passing flags for compiler. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:22:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:22:35 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 9: I can split it further into 2 separate patches: one fixing cflags and another adding cppflags if it helps to clarify this confusion. What do you think? -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac 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-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:27:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:27:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Clarify app-specific log filters Message-ID: Review at https://gerrit.osmocom.org/5866 Clarify app-specific log filters Change-Id: I53e8aed658774781a70fea0b46cafc55496925eb --- M common/chapters/logging.adoc 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/66/5866/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index beb1341..652b6c2 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -81,7 +81,10 @@ To request no filtering, i.e. see all messages, you may use: `log filter all 1` -As another example, to only see messages relating to a particular +In addition to generic filtering, applications can implement special log filters using the same framework +to filter on particular context. + +For example in OsmoBSC, to only see messages relating to a particular subscriber identified by his IMSI, you may use: `log filter imsi 262020123456789` -- To view, visit https://gerrit.osmocom.org/5866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I53e8aed658774781a70fea0b46cafc55496925eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:27:54 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 14:27:54 +0000 Subject: [PATCH] osmo-mgw[master]: client: do not insist on \n\n when parsing MGCP messages Message-ID: Review at https://gerrit.osmocom.org/5867 client: do not insist on \n\n when parsing MGCP messages The current implementation of mgcp_client.c requires MGCP paragraphs to be separated wit a \n\n sequence. However, when the client is used with servers other than osmo-mgcp, the parapgraph may be formatted differently. Also allow \n\r\n\r and \r\n\r\n as separator Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 23 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/67/5867/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 9fc414d..f094a09 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -219,12 +219,33 @@ return -EINVAL; } +/* A new section is marked by a double line break, check a few more + * patterns as there may be variants */ +static char *mgcp_find_section_end(char *string) +{ + char *rc; + + rc = strstr(string, "\n\n"); + if (rc) + return rc; + + rc = strstr(string, "\n\r\n\r"); + if (rc) + return rc; + + rc = strstr(string, "\r\n\r\n"); + if (rc) + return rc; + + return NULL; +} + int mgcp_response_parse_params(struct mgcp_response *r) { char *line; int rc; OSMO_ASSERT(r->body); - char *data = strstr(r->body, "\n\n"); + char *data = mgcp_find_section_end(r->body); if (!data) { LOGP(DLMGCP, LOGL_ERROR, @@ -286,7 +307,7 @@ int rc = 0; OSMO_ASSERT(r->body); char *data = r->body; - char *data_end = strstr(r->body, "\n\n"); + char *data_end = mgcp_find_section_end(r->body); /* Protect SDP body, for_each_non_empty_line() will * only parse until it hits \0 mark. */ -- To view, visit https://gerrit.osmocom.org/5867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:31:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:31:02 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add note on vty logging Message-ID: Review at https://gerrit.osmocom.org/5868 Add note on vty logging Change-Id: I2bb52feb37622d0ef35f6be172759adc3813f008 --- M common/chapters/logging.adoc 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/68/5868/1 diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index beb1341..e79b3ec 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -127,6 +127,10 @@ one only for logging, while the other is used for interacting with the system. Another option would be to use different log target. +To review the current vty logging configuration, you +can use: + `show logging vty` + ==== Logging to the ring buffer To avoid having separate VTY session just for logging output while still having immediate access to them, -- To view, visit https://gerrit.osmocom.org/5868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2bb52feb37622d0ef35f6be172759adc3813f008 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:41:03 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 14:41:03 +0000 Subject: [PATCH] osmocom-bb[master]: mobile: Print an error message if the VTY cannot be initialized Message-ID: Review at https://gerrit.osmocom.org/5869 mobile: Print an error message if the VTY cannot be initialized If we fail to initialize the VTY, print an error mesage instead of failing silently. For example: "Cannot init VTY on 127.0.0.1 port 4247: Address already in use" Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e --- M src/host/layer23/src/mobile/app_mobile.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/69/5869/1 diff --git a/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 6e1fffb..b0e2a13 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -464,8 +464,11 @@ } vty_reading = 0; rc = telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port); - if (rc < 0) + if (rc < 0) { + fprintf(stderr, "Cannot init VTY on %s port %u: %s\n", + vty_ip, vty_port, strerror(errno)); return rc; + } printf("VTY available on %s %u\n", vty_ip, vty_port); osmo_signal_register_handler(SS_GLOBAL, &global_signal_cb, NULL); -- To view, visit https://gerrit.osmocom.org/5869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:46:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:46:33 +0000 Subject: [PATCH] osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Hello Pau Espin Pedrol, Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5818 to look at the new patch set (#10). Fix test dependencies The stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M tests/misc/Makefile.am M tests/sysmobts/Makefile.am 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/10 diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..2ddb649 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 10 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-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:46:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:46:36 +0000 Subject: [PATCH] osmo-bts[master]: Allow specifying sysmocom headers explicitly Message-ID: Review at https://gerrit.osmocom.org/5870 Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. This is prerequisite for fixing the build issue revealed by migrating to stow. Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am 3 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/5870/1 diff --git a/configure.ac b/configure.ac index 2181743..d2edc8e 100644 --- a/configure.ac +++ b/configure.ac @@ -67,10 +67,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 852542b..3e07050 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--enable-sysmocom-bts --with-sysmobts=$inst/include/" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 6e917e7..b837d3a 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:47:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:47:23 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 1: Split to simplify the review. It's expected to fail because the fix is incomplete without the follow-up patch. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:50:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 14:50:32 +0000 Subject: [PATCH] osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5870 to look at the new patch set (#2). Allow specifying sysmocom headers explicitly The headers for LC1.5 are specified explicitly. Add corresponding option to specify sysmoBTS headers location and use it in jenkins build. This is prerequisite for fixing the build issue revealed by migrating to stow. Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am 3 files changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/5870/2 diff --git a/configure.ac b/configure.ac index 2181743..983458a 100644 --- a/configure.ac +++ b/configure.ac @@ -67,10 +67,19 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 852542b..3e07050 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--enable-sysmocom-bts --with-sysmobts=$inst/include/" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 6e917e7..b837d3a 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 14:54:16 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5870/2/configure.ac File configure.ac: Line 77: CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" Is there a need to set CPPFLAGS here if you are passing SYSMOBTS_INCIDR to AM_CPPFLAGS in Makefile.am later? -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 14:55:30 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 14:55:30 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 11: (1 comment) https://gerrit.osmocom.org/#/c/5818/11/tests/sysmobts/Makefile.am File tests/sysmobts/Makefile.am: Line 1: AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) Relaed to previous patch: Why do we set CPPFLAGS to SYSMOBTS_INCDIR in configure.ac and then we set this here? -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 11 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-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:07:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 15:07:06 +0000 Subject: [PATCH] libosmocore[master]: Embedded: disable stats test Message-ID: Review at https://gerrit.osmocom.org/5871 Embedded: disable stats test As of 67bdd80a96bdfc49d1aadbd32cca2b53f123d180 the stats.c is effectively disable so we should disable the corresponding tests as well. Change-Id: I42ff7a6619c0a5926fdc2ec779cf04689c567e15 --- M configure.ac M tests/Makefile.am 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/71/5871/1 diff --git a/configure.ac b/configure.ac index f7acf05..3c15896 100644 --- a/configure.ac +++ b/configure.ac @@ -236,6 +236,9 @@ [Enable building for embedded use and disable unsupported features] )], [embedded=$enableval], [embedded="no"]) + +AM_CONDITIONAL(ENABLE_STATS_TEST, true) + if test x"$embedded" = x"yes" then AC_DEFINE([EMBEDDED],[1],[Select building for embedded use]) @@ -250,6 +253,7 @@ AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_PCSC, false) AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true) + AM_CONDITIONAL(ENABLE_STATS_TEST, false) AC_DEFINE([USE_GNUTLS], [0]) AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) fi diff --git a/tests/Makefile.am b/tests/Makefile.am index 877a302..e199ccc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -17,7 +17,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test gsm23003/gsm23003_test \ + prbs/prbs_test gsm23003/gsm23003_test \ codec/codec_ecu_fr_test if ENABLE_MSGFILE @@ -40,6 +40,10 @@ check_PROGRAMS += ctrl/ctrl_test fsm/fsm_test endif +if ENABLE_STATS_TEST +check_PROGRAMS += stats/stats_test +endif + if ENABLE_GB check_PROGRAMS += gb/bssgp_fc_test gb/gprs_bssgp_test gb/gprs_ns_test fr/fr_test endif -- To view, visit https://gerrit.osmocom.org/5871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42ff7a6619c0a5926fdc2ec779cf04689c567e15 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Jan 2018 15:08:05 +0000 Subject: osmocom-bb[master]: mobile: Print an error message if the VTY cannot be initialized In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:10:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 15:10:32 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: (2 comments) https://gerrit.osmocom.org/#/c/5870/2/configure.ac File configure.ac: Line 77: CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" > Is there a need to set CPPFLAGS here if you are passing SYSMOBTS_INCIDR to Those are only effective for the duration of header check below. Line 82: CPPFLAGS=$oldCPPFLAGS The flags are restored in here. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:11:28 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 15:11:28 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 11: (1 comment) https://gerrit.osmocom.org/#/c/5818/11/tests/sysmobts/Makefile.am File tests/sysmobts/Makefile.am: Line 1: AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) > Relaed to previous patch: Why do we set CPPFLAGS to SYSMOBTS_INCDIR in conf Because they are not actually set. See response in the other patch. -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 11 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-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:15:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 15:15:17 +0000 Subject: [PATCH] libosmocore[master]: Extend Kc buffer 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/1538 to look at the new patch set (#3). Extend Kc buffer Double the Kc buffer to match the requirements of A5/4 and GEA4. Related: OS#1910 Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 --- M TODO-RELEASE M include/osmocom/crypt/auth.h 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/1538/3 diff --git a/TODO-RELEASE b/TODO-RELEASE index fb0bfea..55ee40c 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,3 +7,4 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line +libosmogsm osmo_auth_vector expand kc[] field to accommodate for GEA4 and A5/4 key sizes diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index 4dbc6a4..1c9ba63 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -64,7 +64,7 @@ uint8_t ik[16]; /*!< integrity key */ uint8_t res[16]; /*!< authentication result */ uint8_t res_len; /*!< length (in bytes) of res */ - uint8_t kc[8]; /*!< Kc for GSM encryption (A5) */ + uint8_t kc[16]; /*!< Kc for GSM/GPRS encryption (A5 & GEA) */ uint8_t sres[4]; /*!< authentication result for GSM */ uint32_t auth_types; /*!< bitmask of OSMO_AUTH_TYPE_* */ }; -- To view, visit https://gerrit.osmocom.org/1538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 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 Thu Jan 18 15:18:24 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 15:18:24 +0000 Subject: osmo-bts[master]: Fix test dependencies In-Reply-To: References: Message-ID: Patch Set 11: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 11 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-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:18:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 15:18:28 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 15:28:09 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 15:28:09 +0000 Subject: [PATCH] osmo-mgw[master]: main: display mgcp ip/port Message-ID: Review at https://gerrit.osmocom.org/5872 main: display mgcp ip/port osmo-mgw does not display the IP/Port on which it is listening for MGCP commands. However, this information can be very helpful when working with multiple MGCP instances on one machine. - print IP/Port on which we listen for MGCP commands on startup Change-Id: Idf5e8b6a7344c4ebaf9b89940456a496b2c23334 --- M src/osmo-mgw/mgw_main.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/72/5872/1 diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c index ba8883b..a2714e0 100644 --- a/src/osmo-mgw/mgw_main.c +++ b/src/osmo-mgw/mgw_main.c @@ -309,7 +309,8 @@ return -1; } - LOGP(DLMGCP, LOGL_NOTICE, "Configured for MGCP.\n"); + LOGP(DLMGCP, LOGL_NOTICE, "Configured for MGCP, listen on %s:%u\n", + cfg->source_addr, cfg->source_port); /* initialisation */ srand(time(NULL)); -- To view, visit https://gerrit.osmocom.org/5872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf5e8b6a7344c4ebaf9b89940456a496b2c23334 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 16:16:58 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 16:16:58 +0000 Subject: [PATCH] libosmocore[master]: Embedded: add sercomm stubs Message-ID: Review at https://gerrit.osmocom.org/5873 Embedded: add sercomm stubs The sercomm functions are unavailable in case of embedded build. Add stub and link the tests against it. Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e --- M .gitignore M configure.ac M tests/Makefile.am A tests/libsercomstub.c M tests/sercomm/sercomm_test.c 5 files changed, 14 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/5873/1 diff --git a/.gitignore b/.gitignore index 657120d..db17535 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ # vi files *.sw? +/tests/libsercomstub.a diff --git a/configure.ac b/configure.ac index 3c15896..245a142 100644 --- a/configure.ac +++ b/configure.ac @@ -253,6 +253,7 @@ AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_PCSC, false) AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true) + AM_CONDITIONAL(ENABLE_SERCOM_STUB, true) AM_CONDITIONAL(ENABLE_STATS_TEST, false) AC_DEFINE([USE_GNUTLS], [0]) AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) diff --git a/tests/Makefile.am b/tests/Makefile.am index e199ccc..5dd8e22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,11 @@ AM_LDFLAGS = LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) +if ENABLE_SERCOM_STUB +noinst_LIBRARIES = libsercomstub.a +LDADD += $(top_builddir)/tests/libsercomstub.a +endif + check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ smscb/smscb_test bits/bitrev_test a5/a5_test \ conv/conv_test auth/milenage_test lapd/lapd_test \ @@ -55,10 +60,10 @@ stats_stats_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la a5_a5_test_SOURCES = a5/a5_test.c -a5_a5_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +a5_a5_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c -kasumi_kasumi_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +kasumi_kasumi_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la comp128_comp128_test_SOURCES = comp128/comp128_test.c comp128_comp128_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la @@ -84,10 +89,10 @@ bits_bitfield_test_SOURCES = bits/bitfield_test.c conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c -conv_conv_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +conv_conv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c -conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +conv_conv_gsm0503_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c diff --git a/tests/libsercomstub.c b/tests/libsercomstub.c new file mode 100644 index 0000000..99662d0 --- /dev/null +++ b/tests/libsercomstub.c @@ -0,0 +1,3 @@ +/* Stubs for embedded build */ +void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} +void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {} diff --git a/tests/sercomm/sercomm_test.c b/tests/sercomm/sercomm_test.c index 4a40f62..058c9eb 100644 --- a/tests/sercomm/sercomm_test.c +++ b/tests/sercomm/sercomm_test.c @@ -27,10 +27,6 @@ struct osmo_sercomm_inst g_osi; -/* Locking details are not checked by this test anyway */ -void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} -void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {} - static const uint8_t valid_dlci3[] = { 0x7E, 3, 0x03, 'f', 'o', 'o', 0x7E }; static const uint8_t valid_dlci23[] = { 0x7E, 23, 0x03, '2', '3', 0x7E }; static const uint8_t valid_dlci23esc[] = { 0x7E, 23, 0x03, 0x7D, '2' ^ (1 << 5), '3', 0x7E }; -- To view, visit https://gerrit.osmocom.org/5873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 16:18:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 16:18:40 +0000 Subject: osmo-mgw[master]: main: display mgcp ip/port In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf5e8b6a7344c4ebaf9b89940456a496b2c23334 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw 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 Jan 18 16:21:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 16:21:01 +0000 Subject: [PATCH] libosmocore[master]: Embedded: add sercomm stubs In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5873 to look at the new patch set (#2). Embedded: add sercomm stubs The sercomm functions are unavailable in case of embedded build. Add stub and link the tests against it. Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e --- M .gitignore M configure.ac M tests/Makefile.am A tests/libsercomstub.c M tests/sercomm/sercomm_test.c 5 files changed, 15 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/73/5873/2 diff --git a/.gitignore b/.gitignore index 657120d..db17535 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ # vi files *.sw? +/tests/libsercomstub.a diff --git a/configure.ac b/configure.ac index 3c15896..60c177f 100644 --- a/configure.ac +++ b/configure.ac @@ -238,6 +238,7 @@ [embedded=$enableval], [embedded="no"]) AM_CONDITIONAL(ENABLE_STATS_TEST, true) +AM_CONDITIONAL(ENABLE_SERCOM_STUB, false) if test x"$embedded" = x"yes" then @@ -253,6 +254,7 @@ AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_PCSC, false) AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true) + AM_CONDITIONAL(ENABLE_SERCOM_STUB, true) AM_CONDITIONAL(ENABLE_STATS_TEST, false) AC_DEFINE([USE_GNUTLS], [0]) AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) diff --git a/tests/Makefile.am b/tests/Makefile.am index e199ccc..5dd8e22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,11 @@ AM_LDFLAGS = LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) +if ENABLE_SERCOM_STUB +noinst_LIBRARIES = libsercomstub.a +LDADD += $(top_builddir)/tests/libsercomstub.a +endif + check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ smscb/smscb_test bits/bitrev_test a5/a5_test \ conv/conv_test auth/milenage_test lapd/lapd_test \ @@ -55,10 +60,10 @@ stats_stats_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la a5_a5_test_SOURCES = a5/a5_test.c -a5_a5_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +a5_a5_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c -kasumi_kasumi_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +kasumi_kasumi_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la comp128_comp128_test_SOURCES = comp128/comp128_test.c comp128_comp128_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la @@ -84,10 +89,10 @@ bits_bitfield_test_SOURCES = bits/bitfield_test.c conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c -conv_conv_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +conv_conv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c -conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +conv_conv_gsm0503_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c diff --git a/tests/libsercomstub.c b/tests/libsercomstub.c new file mode 100644 index 0000000..99662d0 --- /dev/null +++ b/tests/libsercomstub.c @@ -0,0 +1,3 @@ +/* Stubs for embedded build */ +void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} +void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {} diff --git a/tests/sercomm/sercomm_test.c b/tests/sercomm/sercomm_test.c index 4a40f62..058c9eb 100644 --- a/tests/sercomm/sercomm_test.c +++ b/tests/sercomm/sercomm_test.c @@ -27,10 +27,6 @@ struct osmo_sercomm_inst g_osi; -/* Locking details are not checked by this test anyway */ -void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} -void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {} - static const uint8_t valid_dlci3[] = { 0x7E, 3, 0x03, 'f', 'o', 'o', 0x7E }; static const uint8_t valid_dlci23[] = { 0x7E, 23, 0x03, '2', '3', 0x7E }; static const uint8_t valid_dlci23esc[] = { 0x7E, 23, 0x03, 0x7D, '2' ^ (1 << 5), '3', 0x7E }; -- To view, visit https://gerrit.osmocom.org/5873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 18 16:31:16 2018 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Thu, 18 Jan 2018 16:31:16 +0000 Subject: osmo-mgw[master]: client: do not insist on \n\n when parsing MGCP messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) I think there are still some issues in the code, but this does fix the issue I'm seeing. Thanks https://gerrit.osmocom.org/#/c/5867/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: PS1, Line 317: for_each_non_empty_line Unfortunately that fails as soon as we have more than one parameter -- To view, visit https://gerrit.osmocom.org/5867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 16:38:21 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 16:38:21 +0000 Subject: [PATCH] libosmocore[master]: jenkins: move make invocation into shared function Message-ID: Review at https://gerrit.osmocom.org/5874 jenkins: move make invocation into shared function Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 --- M contrib/jenkins-arm.sh M contrib/jenkins.sh M contrib/jenkins_common.sh 3 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/5874/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh index acdbe3c..4579596 100755 --- a/contrib/jenkins-arm.sh +++ b/contrib/jenkins-arm.sh @@ -16,8 +16,7 @@ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - $MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh + run_make } # verify build in dir other than source tree diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index c341d05..d2b0459 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -15,9 +15,9 @@ prep_build "$src_dir" "$build_dir" - "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" - $MAKE V=1 $PARALLEL_MAKE check \ - || cat-testlogs.sh + "$src_dir"/configure --disable-silent-rules --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + + run_make } # verify build in dir other than source tree diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index a6ffe7f..fa1d544 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -26,3 +26,7 @@ mkdir -p "$_build_dir" cd "$_build_dir" } + +run_make() { + $MAKE $PARALLEL_MAKE check || cat-testlogs.sh +} -- To view, visit https://gerrit.osmocom.org/5874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 16:39:25 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 16:39:25 +0000 Subject: [PATCH] osmo-msc[master]: Store/retrieve SMS validity time in the SMS datebase Message-ID: Review at https://gerrit.osmocom.org/5875 Store/retrieve SMS validity time in the SMS datebase Compute a validity timestamp based on SMS validity time. Store the computed value in the database and recompute the validity time when an SMS is read from the database. Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568 --- M src/libmsc/db.c 1 file changed, 11 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/75/5875/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 28004f7..5c9f724 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -689,9 +690,7 @@ dbi_result result; char *q_text, *q_daddr, *q_saddr; unsigned char *q_udata; - char *validity_timestamp = "2222-2-2"; - - /* FIXME: generate validity timestamp based on validity_minutes */ + time_t now, validity_timestamp; dbi_conn_quote_string_copy(conn, (char *)sms->text, &q_text); dbi_conn_quote_string_copy(conn, (char *)sms->dst.addr, &q_daddr); @@ -699,7 +698,9 @@ dbi_conn_quote_binary_copy(conn, sms->user_data, sms->user_data_len, &q_udata); - /* FIXME: correct validity period */ + now = time(NULL); + validity_timestamp = now + sms->validity_minutes * 60; + result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " @@ -709,14 +710,14 @@ "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " - "(datetime('now'), %u, " + "(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), " "%u, %u, %u, " "%u, %u, %u, " "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", - validity_timestamp, + (int64_t)now, (int64_t)validity_timestamp, sms->reply_path_req, sms->status_rep_req, sms->is_report, sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, sms->ud_hdr_ind, @@ -740,15 +741,17 @@ struct gsm_sms *sms = sms_alloc(); const char *text, *daddr, *saddr; const unsigned char *user_data; + time_t validity_timestamp; if (!sms) return NULL; sms->id = dbi_result_get_ulonglong(result, "id"); - /* FIXME: validity */ - /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + sms->validity_minutes = (validity_timestamp - sms->created) / 60; + /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); -- To view, visit https://gerrit.osmocom.org/5875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:32:26 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:32:26 +0000 Subject: [PATCH] osmo-mgw[master]: client/common: move constant MGCP_ENDPOINT_MAXLEN Message-ID: Review at https://gerrit.osmocom.org/5877 client/common: move constant MGCP_ENDPOINT_MAXLEN MGCP_ENDPOINT_MAXLEN is currently only defined for the mgcp client, since this is in general a common parameter it should be moved to mgcp_common.h so that both sides can use it. Change-Id: I9e1c52aa5ebd83b2d9e5178ea24cb27d96cb7ddd --- M include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp_client/mgcp_client.h 2 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/77/5877/1 diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 29dc458..7684936 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -72,4 +72,8 @@ * (see also RFC3435 2.1.3.2 Names of Connections) */ #define MGCP_CONN_ID_LENGTH 32+1 +/* String length of Endpoint Identifiers. +/ (see also RFC3435 section 3.2.1.3) */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + #endif diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 4caf656..882c908 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -55,9 +55,6 @@ #define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 #define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 -/* See also RFC3435 section 3.2.1.3 */ -#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) - struct mgcp_msg { enum mgcp_verb verb; /* See MGCP_MSG_PRESENCE_* constants */ -- To view, visit https://gerrit.osmocom.org/5877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e1c52aa5ebd83b2d9e5178ea24cb27d96cb7ddd Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:32:26 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:32:26 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: allow endpoints beginning from zero Message-ID: Review at https://gerrit.osmocom.org/5876 mgcp: allow endpoints beginning from zero there is a now obsolete constraint that endpoint numbers must start at 1. - remove the check to allow also endpoints starting at 0 Change-Id: Iec2f4e36e1ab01ff23875d99e4b0e04af7c1ad98 --- M src/libosmo-mgcp/mgcp_msg.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/76/5876/1 diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 7f05a44..45195de 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -193,7 +193,7 @@ return find_e1_endpoint(cfg, mgcp); gw = strtoul(mgcp, &endptr, 16); - if (gw > 0 && gw < cfg->trunk.number_endpoints && endptr[0] == '@') + if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; LOGP(DLMGCP, LOGL_ERROR, "Not able to find the endpoint: '%s'\n", mgcp); -- To view, visit https://gerrit.osmocom.org/5876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec2f4e36e1ab01ff23875d99e4b0e04af7c1ad98 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:32:27 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: make domain name configurable Message-ID: Review at https://gerrit.osmocom.org/5878 mgcp: make domain name configurable At the moment the MGW has a fixed domain name string that is not even checked properly. - Make domain name configurable, use the current "mgw" string as defualt to maintain compatibility - Check the domain name with each request. If the endpoint contains an unexpected domain name, the request must be rejected. Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 6 files changed, 50 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/78/5878/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index d6397d3..0d156c6 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -212,6 +212,8 @@ * message. */ uint16_t osmux_dummy; + /* domain name of the media gateway */ + char domain[255+1]; }; /* config management */ diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 45195de..74acffa 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,22 @@ return &tcfg->endpoints[endp]; } +/* Check if the domain name, which is supplied with the endpoint name + * matches the configuration. */ +static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) +{ + char *domain_to_check; + + domain_to_check = strstr(mgcp, "@"); + if (!domain_to_check) + return -EINVAL; + + if (strcmp(domain_to_check+1, cfg->domain) != 0) + return -EINVAL; + + return 0; +} + /* Search the endpoint pool for the endpoint that had been selected via the * MGCP message (helper function for mgcp_analyze_header()) */ static struct mgcp_endpoint *find_endpoint(struct mgcp_config *cfg, @@ -189,6 +205,11 @@ char *endptr = NULL; unsigned int gw = INT_MAX; + if (check_domain_name(cfg, mgcp)) { + LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp); + return NULL; + } + if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9d79343..9c21d38 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1072,6 +1072,8 @@ return NULL; } + osmo_strlcpy(cfg->domain, "mgw", sizeof(cfg->domain)); + cfg->net_ports.range_start = RTP_PORT_DEFAULT_RANGE_START; cfg->net_ports.range_end = RTP_PORT_DEFAULT_RANGE_END; cfg->net_ports.last_port = cfg->net_ports.range_start; @@ -1208,13 +1210,14 @@ * \returns 0 on success, -1 on error */ int mgcp_send_reset_all(struct mgcp_config *cfg) { + char buf[MGCP_ENDPOINT_MAXLEN + 128]; + int len; int rc; - static const char mgcp_reset[] = { - "RSIP 1 *@mgw MGCP 1.0\r\n" - }; + len = snprintf(buf, sizeof(buf), + "RSIP 1 *@%s MGCP 1.0\r\n", cfg->domain); - rc = send_agent(cfg, mgcp_reset, sizeof mgcp_reset - 1); + rc = send_agent(cfg, buf, len); if (rc <= 0) return -1; @@ -1228,12 +1231,12 @@ * \returns 0 on success, -1 on error */ int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint) { - char buf[128]; + char buf[MGCP_ENDPOINT_MAXLEN + 128]; int len; int rc; len = snprintf(buf, sizeof(buf), - "RSIP 39 %x at mgw MGCP 1.0\r\n", endpoint); + "RSIP 39 %x@%s MGCP 1.0\r\n", endpoint, endp->cfg->domain); if (len < 0) return -1; diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 7fa3949..7043527 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -63,6 +63,7 @@ static int config_write_mgcp(struct vty *vty) { vty_out(vty, "mgcp%s", VTY_NEWLINE); + vty_out(vty, " domain %s%s", g_cfg->domain, VTY_NEWLINE); if (g_cfg->local_ip) vty_out(vty, " local ip %s%s", g_cfg->local_ip, VTY_NEWLINE); vty_out(vty, " bind ip %s%s", g_cfg->source_addr, VTY_NEWLINE); @@ -1179,6 +1180,14 @@ return CMD_SUCCESS; } +DEFUN(cfg_mgcp_domain, + cfg_mgcp_domain_cmd, + "domain NAME", "domain\n" "qualified domain name\n") +{ + osmo_strlcpy(g_cfg->domain, argv[0], sizeof(g_cfg->domain)); + return CMD_SUCCESS; +} + int mgcp_vty_init(void) { install_element_ve(&show_mgcp_cmd); @@ -1240,6 +1249,7 @@ install_element(MGCP_NODE, &cfg_mgcp_osmux_dummy_cmd); install_element(MGCP_NODE, &cfg_mgcp_allow_transcoding_cmd); install_element(MGCP_NODE, &cfg_mgcp_no_allow_transcoding_cmd); + install_element(MGCP_NODE, &cfg_mgcp_domain_cmd); install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd); install_node(&trunk_node, config_write_trunk); diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 46fd69b..467cb6c 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -66,18 +66,18 @@ OSMO_ASSERT(counter == EXPECTED_NUMBER_OF_LINES); } -#define AUEP1 "AUEP 158663169 ds/e1-1/2 at 172.16.6.66 MGCP 1.0\r\n" +#define AUEP1 "AUEP 158663169 ds/e1-1/2 at mgw MGCP 1.0\r\n" #define AUEP1_RET "200 158663169 OK\r\n" -#define AUEP2 "AUEP 18983213 ds/e1-2/1 at 172.16.6.66 MGCP 1.0\r\n" +#define AUEP2 "AUEP 18983213 ds/e1-2/1 at mgw MGCP 1.0\r\n" #define AUEP2_RET "500 18983213 FAIL\r\n" #define EMPTY "\r\n" #define EMPTY_RET NULL #define SHORT "CRCX \r\n" #define SHORT_RET "510 000000 FAIL\r\n" -#define MDCX_WRONG_EP "MDCX 18983213 ds/e1-3/1 at 172.16.6.66 MGCP 1.0\r\n" +#define MDCX_WRONG_EP "MDCX 18983213 ds/e1-3/1 at mgw MGCP 1.0\r\n" #define MDCX_ERR_RET "500 18983213 FAIL\r\n" -#define MDCX_UNALLOCATED "MDCX 18983214 ds/e1-1/2 at 172.16.6.66 MGCP 1.0\r\n" +#define MDCX_UNALLOCATED "MDCX 18983214 ds/e1-1/2 at mgw MGCP 1.0\r\n" #define MDCX_RET "400 18983214 FAIL\r\n" #define MDCX3 \ diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok index 23f0658..09ad9e1 100644 --- a/tests/mgcp/mgcp_test.ok +++ b/tests/mgcp/mgcp_test.ok @@ -16,7 +16,7 @@ Testing AUEP1 creating message from statically defined input: ---------8<--------- -AUEP 158663169 ds/e1-1/2 at 172.16.6.66 MGCP 1.0 +AUEP 158663169 ds/e1-1/2 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -28,7 +28,7 @@ Testing AUEP2 creating message from statically defined input: ---------8<--------- -AUEP 18983213 ds/e1-2/1 at 172.16.6.66 MGCP 1.0 +AUEP 18983213 ds/e1-2/1 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -40,7 +40,7 @@ Testing MDCX1 creating message from statically defined input: ---------8<--------- -MDCX 18983213 ds/e1-3/1 at 172.16.6.66 MGCP 1.0 +MDCX 18983213 ds/e1-3/1 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -52,7 +52,7 @@ Testing MDCX2 creating message from statically defined input: ---------8<--------- -MDCX 18983214 ds/e1-1/2 at 172.16.6.66 MGCP 1.0 +MDCX 18983214 ds/e1-1/2 at mgw MGCP 1.0 ---------8<--------- checking response: -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:32:27 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) Message-ID: Review at https://gerrit.osmocom.org/5879 mgcp: permit wildcarded endpoint assignment (CRCX) The mgcp protocol in general allows wildcarded endpoints on CRCX. osmo-mgw does not support this feature yet. - when the endpoint name contains a wildcard character, search a free endpoint - return the resulting endpoint name in the parameter section of the mgcp response - add parsing support for the returned endpoint names Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 --- M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M tests/mgcp/mgcp_test.c 5 files changed, 126 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/79/5879/1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 882c908..3393bc4 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -31,6 +31,7 @@ mgcp_trans_id_t trans_id; const char *comment; char conn_id[MGCP_CONN_ID_LENGTH]; + char ep_id[MGCP_ENDPOINT_MAXLEN]; }; struct mgcp_response { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 9fc414d..e4ca96d 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -226,6 +226,10 @@ OSMO_ASSERT(r->body); char *data = strstr(r->body, "\n\n"); + /* Warning: This function performs a destructive parsing on r->body. + * Since this function is called at the very end of the persing + * process, destructive parsing is acceptable. */ + if (!data) { LOGP(DLMGCP, LOGL_ERROR, "MGCP response: cannot find start of parameters\n"); @@ -261,21 +265,29 @@ return 0; } -/* Parse a line like "I: 0cedfd5a19542d197af9afe5231f1d61" */ -static int mgcp_parse_conn_id(struct mgcp_response *r, const char *line) +/* Parse a line like "X: something" */ +static int mgcp_parse_head_param(char *result, unsigned int result_len, + char label, const char *line) { + char label_string[4]; + + /* Detect empty parameters */ if (strlen(line) < 4) goto response_parse_failure; - if (memcmp("I: ", line, 3) != 0) + /* Check if the label matches */ + snprintf(label_string, sizeof(label_string), "%c: ", label); + if (memcmp(label_string, line, 3) != 0) goto response_parse_failure; - osmo_strlcpy(r->head.conn_id, line + 3, sizeof(r->head.conn_id)); + /* Copy payload part of the string to destinations (the label string + * is always 3 chars long) */ + osmo_strlcpy(result, line + 3, result_len); return 0; response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response (connectionIdentifier)\n"); + "Failed to parse MGCP response (parameter label: %c)\n", label); return -EINVAL; } @@ -285,18 +297,37 @@ char *line; int rc = 0; OSMO_ASSERT(r->body); - char *data = r->body; - char *data_end = strstr(r->body, "\n\n"); + char *data; + char *data_ptr; + char *data_end; - /* Protect SDP body, for_each_non_empty_line() will - * only parse until it hits \0 mark. */ + /* Since this functions performs a destructive parsing, we create a + * local copy of the body data */ + data = talloc_zero_size(NULL, strlen(r->body)+1); + OSMO_ASSERT(data); + data_ptr = data; + osmo_strlcpy(data, r->body, strlen(r->body)); + + /* If there is an SDP body attached, prevent for_each_non_empty_line() + * into running in there, we are not yet interested in the parameters + * stored there. */ + data_end = strstr(data, "\n\n"); if (data_end) *data_end = '\0'; - for_each_non_empty_line(line, data) { + for_each_non_empty_line(line, data_ptr) { switch (line[0]) { + case 'Z': + rc = mgcp_parse_head_param(r->head.ep_id, + sizeof(r->head.ep_id), + 'Z', line); + if (rc) + goto exit; + break; case 'I': - rc = mgcp_parse_conn_id(r, line); + rc = mgcp_parse_head_param(r->head.conn_id, + sizeof(r->head.conn_id), + 'I', line); if (rc) goto exit; break; @@ -306,10 +337,7 @@ } } exit: - /* Restore original state */ - if (data_end) - *data_end = '\n'; - + talloc_free(data); return rc; } diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 74acffa..994b00a 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,29 @@ return &tcfg->endpoints[endp]; } +/* Find an endpoint that is not in use. Do this by going through the endpoint + * array, check the callid. A callid nullpointer indicates that the endpoint + * is free */ +static struct mgcp_endpoint *find_free_endpoint(struct mgcp_endpoint *endpoints, + unsigned int number_endpoints) +{ + struct mgcp_endpoint *endp; + unsigned int i; + + for (i = 0; i < number_endpoints; i++) { + if (endpoints[i].callid == NULL) { + endp = &endpoints[i]; + LOGP(DLMGCP, LOGL_DEBUG, + "endpoint:0x%x found free endpoint\n", + ENDPOINT_NUMBER(endp)); + return endp; + } + } + + LOGP(DLMGCP, LOGL_ERROR, "Not able to find a free endpoint"); + return NULL; +} + /* Check if the domain name, which is supplied with the endpoint name * matches the configuration. */ static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) @@ -213,6 +236,11 @@ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); + if (strncmp(mgcp, "*", 1) == 0) { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9c21d38..24d5bf1 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -221,6 +221,24 @@ osmux_extension[0] = '\0'; } + /* FIXME: create_response_with_sdp() is called in the most cases, it + * is certainly called on CRCX, which gives us Z and I on CRCX where + * we depend on it. In all other steps, we do not necessarly depend + * on Z and I. Also, the parameters Z and I are not SDP parameters, + * they are just normal MGCP parameters and should not be generated + * here since they are not in the scope of SDP. There could be a + * separate generator function that generates a string that then + * submits the parameter data to create_resp(). Unfortunately all + * this gets a mess. We sould get rid of all those + * create_response_with_something() functions and generalize this + * in some way. This is the reason why this is not fixed now and + * there is this FIXME note instead. Also the I parameter, which is + * misplaced as well has been introduced with an earlier patch. */ + + rc = msgb_printf(sdp, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), endp->cfg->domain); + if (rc < 0) + goto error; + rc = msgb_printf(sdp, "I: %s%s\n\n", conn->conn->id, osmux_extension); if (rc < 0) goto error; diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 467cb6c..58296f4 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -86,6 +86,7 @@ #define MDCX3_RET \ "200 18983215 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -99,6 +100,7 @@ #define MDCX3A_RET \ "200 18983215 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -112,6 +114,7 @@ #define MDCX3_FMTP_RET \ "200 18983215 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -141,6 +144,7 @@ #define MDCX4_RET(Ident) \ "200 " Ident " OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -154,6 +158,7 @@ #define MDCX4_RO_RET(Ident) \ "200 " Ident " OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -252,6 +257,7 @@ #define CRCX_RET \ "200 2 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -265,6 +271,7 @@ #define CRCX_RET_NO_RTPMAP \ "200 2 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -277,6 +284,7 @@ #define CRCX_FMTP_RET \ "200 2 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -301,6 +309,7 @@ #define CRCX_ZYN_RET \ "200 2 OK\r\n" \ + "Z: %s\n" \ "I: %s\n" \ "\n" \ "v=0\r\n" \ @@ -578,7 +587,29 @@ * not exceed a length of 32 digits */ OSMO_ASSERT(strlen(conn_id) <= 32); OSMO_ASSERT(strlen(conn_id) > 0); + return 0; +} +/* Extract a endpoint ID from a response (CRCX) */ +static int get_endpoint_id_from_response(uint8_t *resp, char *endpoint_id, + unsigned int endpoint_id_len) +{ + char *endpoint_id_ptr; + int i; + + endpoint_id_ptr = strstr((char *)resp, "Z: "); + if (!endpoint_id_ptr) + return -EINVAL; + + memset(endpoint_id, 0, endpoint_id_len); + memcpy(endpoint_id, endpoint_id_ptr + 3, 5); + + for (i = 0; i < endpoint_id_len; i++) { + if (endpoint_id[i] == '\n' || endpoint_id[i] == '\r') + endpoint_id[i] = '\0'; + } + + OSMO_ASSERT(strlen(endpoint_id) > 0); return 0; } @@ -588,6 +619,7 @@ char exp_resp_patched[4096]; const char *exp_resp_ptr; char conn_id[256]; + char endpoint_id[1024]; printf("checking response:\n"); @@ -598,15 +630,13 @@ * is generated by the mgcp code on CRCX and we can * not know it in advance */ if (strstr(exp_resp, "%s")) { - if (get_conn_id_from_response(resp, conn_id, sizeof(conn_id)) == - 0) { - sprintf(exp_resp_patched, exp_resp, conn_id, conn_id); + if (get_conn_id_from_response(resp, conn_id, sizeof(conn_id)) == 0 && get_endpoint_id_from_response(resp, endpoint_id, sizeof(endpoint_id)) == 0) { + sprintf(exp_resp_patched, exp_resp, endpoint_id, conn_id, conn_id); exp_resp_ptr = exp_resp_patched; - printf - ("using message with patched conn_id for comparison\n"); + printf("using message with patched conn_id for comparison\n"); } else { printf - ("patching conn_id failed, using message as statically defined for comparison\n"); + ("patching conn/endpoint_id failed, using message as statically defined for comparison\n"); exp_resp_ptr = exp_resp; } } else { -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:32:27 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: add prefix to virtual trunk Message-ID: Review at https://gerrit.osmocom.org/5880 mgcp: add prefix to virtual trunk the virtual trunk is addressed without a prefix (just *@domain). - reorganize find_endpoint() so that it accepts a prefix when addressing the virtual trunk. - do no longer accept wildcarded CRCX requests without prefix (will not break anything, the feature of wildcarded CRCX is not in use yet) - keep the old prefix-less method but print a warning that it is depreacted. Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 --- M include/osmocom/mgcp/mgcp_common.h M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c 3 files changed, 32 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/80/5880/1 diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 7684936..7aa5d3f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -76,4 +76,7 @@ / (see also RFC3435 section 3.2.1.3) */ #define MGCP_ENDPOINT_MAXLEN (255*2+1+1) +/* A prefix to denote the virtual trunk (RTP on both ends) */ +#define MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK "rtpbridge/" + #endif diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 994b00a..d4b04a7 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -227,20 +227,38 @@ { char *endptr = NULL; unsigned int gw = INT_MAX; + const char *endpoint_number_str; + /* Check if the domainname in the request is correct */ if (check_domain_name(cfg, mgcp)) { LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp); return NULL; } + /* Check if the E1 trunk is requested */ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); - if (strncmp(mgcp, "*", 1) == 0) { - return find_free_endpoint(cfg->trunk.endpoints, - cfg->trunk.number_endpoints); + /* Check if the virtual trunk is addressed (new, correct way with prefix) */ + if (strncmp + (mgcp, MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK)) == 0) { + endpoint_number_str = + mgcp + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK); + if (endpoint_number_str[0] == '*') { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + + gw = strtoul(endpoint_number_str, &endptr, 16); + if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') + return &cfg->trunk.endpoints[gw]; } + /* Deprecated method without prefix */ + LOGP(DLMGCP, LOGL_NOTICE, + "Addressing virtual trunk without prefix (deprecated), please use %s: '%s'\n", + MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, mgcp); gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 24d5bf1..ee744f9 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -235,9 +235,14 @@ * there is this FIXME note instead. Also the I parameter, which is * misplaced as well has been introduced with an earlier patch. */ - rc = msgb_printf(sdp, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), endp->cfg->domain); - if (rc < 0) - goto error; + /* NOTE: Only in the virtual trunk we allow dynamic endpoint names */ + if (endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) { + rc = msgb_printf(sdp, "Z: %s%u@%s\n", + MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, + ENDPOINT_NUMBER(endp), endp->cfg->domain); + if (rc < 0) + goto error; + } rc = msgb_printf(sdp, "I: %s%s\n\n", conn->conn->id, osmux_extension); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/5880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:32:27 +0000 Subject: [PATCH] osmo-mgw[master]: client: add an optional FSM interface Message-ID: Review at https://gerrit.osmocom.org/5881 client: add an optional FSM interface the client API is not very intuitive and requires a lot of extra care when it is used from an osmo-fsm. - Add an FSM that permits comfortable handling of an MGCP connection. Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 --- M include/Makefile.am M src/libosmo-mgcp-client/Makefile.am 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/5881/1 diff --git a/include/Makefile.am b/include/Makefile.am index b52e5ea..e8fc211 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,6 +7,7 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_client_fsm.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ osmocom/mgcp/mgcp_common.h \ diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 1e4e764..a3a920b 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -29,6 +29,7 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ + mgcp_client_fsm.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) -- To view, visit https://gerrit.osmocom.org/5881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:51:19 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 18 Jan 2018 17:51:19 +0000 Subject: osmo-mgw[master]: client: do not insist on \n\n when parsing MGCP messages In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) > (1 comment) > > I think there are still some issues in the code, but this does fix > the issue I'm seeing. Thanks https://gerrit.osmocom.org/#/c/5867/1/src/libosmo-mgcp-client/mgcp_client.c File src/libosmo-mgcp-client/mgcp_client.c: PS1, Line 317: for_each_non_empty_line > Unfortunately that fails as soon as we have more than one parameter I remember having a similar effect when doing https://gerrit.osmocom.org/#/c/5879/. Can you try what happens when you send I first and then the not implemented parameters? -- To view, visit https://gerrit.osmocom.org/5867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 17:58:57 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 17:58:57 +0000 Subject: [PATCH] osmo-msc[master]: Delete SMS from the database once they were sent successfully Message-ID: Review at https://gerrit.osmocom.org/5882 Delete SMS from the database once they were sent successfully Currently the SMS database keeps accumulating entries for each SMS. These entries are never deleted automatically. With this change, we start deleting SMS which have successfully been sent to subscriber B. Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78 --- M include/osmocom/msc/db.h M src/libmsc/db.c M src/libmsc/sms_queue.c 3 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/82/5882/1 diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 988c9bd..13c5ed3 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -49,6 +49,7 @@ int db_sms_mark_delivered(struct gsm_sms *sms); int db_sms_inc_deliver_attempts(struct gsm_sms *sms); int db_sms_delete_by_msisdn(const char *msisdn); +int db_sms_delete_sent_message_by_id(unsigned long long sms_id); /* Statistics counter storage */ struct osmo_counter; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 7007c7a..e80ef53 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -970,6 +970,22 @@ return 0; } +int db_sms_delete_sent_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE id = %llu AND sent is NOT NULL", + sms_id); + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to delete SMS %llu.\n", sms_id); + return 1; + } + + dbi_result_free(result); + return 0; +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 609a0db..1372a2c 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -483,6 +483,7 @@ network->sms_queue->pending -= 1; vsub = vlr_subscr_get(pending->vsub); sms_pending_free(pending); + db_sms_delete_sent_message_by_id(pending->sms_id); /* Attempt to send another SMS to this subscriber */ sms_send_next(vsub); vlr_subscr_put(vsub); -- To view, visit https://gerrit.osmocom.org/5882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:01:31 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 18 Jan 2018 18:01:31 +0000 Subject: [PATCH] osmo-iuh[master]: hnbap: log errors on decoding/encoding HNB-REGISTER msgs Message-ID: Review at https://gerrit.osmocom.org/5883 hnbap: log errors on decoding/encoding HNB-REGISTER msgs Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1 --- M src/hnbgw_hnbap.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/83/5883/1 diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 2746c21..8fba13c 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -63,6 +63,8 @@ memset(&accept_out, 0, sizeof(accept_out)); rc = hnbap_encode_hnbregisteraccepties(&accept_out, &accept); if (rc < 0) { + LOGP(DHNBAP, LOGL_ERROR, "Failure to encode HNB-REGISTER-ACCEPT to %s: rc=%d\n", + ctx->identity_info, rc); return rc; } @@ -370,8 +372,11 @@ int rc; rc = hnbap_decode_hnbregisterrequesties(&ies, in); - if (rc < 0) + if (rc < 0) { + LOGP(DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ from %s: rc=%d\n", + ctx->identity_info, rc); return rc; + } /* copy all identity parameters from the message to ctx */ asn1_strncpy(ctx->identity_info, &ies.hnB_Identity.hNB_Identity_Info, -- To view, visit https://gerrit.osmocom.org/5883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:13:08 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 18:13:08 +0000 Subject: [PATCH] libosmocore[master]: jenkins: add dispatcher script Message-ID: Review at https://gerrit.osmocom.org/5884 jenkins: add dispatcher script Similar to the way we test osmo-bts, add simple dispatcher script which calls appropriate test depending on a given parameter. This will allow to simplify the job description. While at it, also rename jenkins-arm.sh -> jenkins_arm.sh to match the OsmoBTS. Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 --- R contrib/jenkins_amd64.sh A contrib/jenkins_arch.sh R contrib/jenkins_arm.sh 3 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/5884/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins_amd64.sh similarity index 100% rename from contrib/jenkins.sh rename to contrib/jenkins_amd64.sh diff --git a/contrib/jenkins_arch.sh b/contrib/jenkins_arch.sh new file mode 100755 index 0000000..bac9278 --- /dev/null +++ b/contrib/jenkins_arch.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# this is a dispatcher script which will call the arch-specific +# script based on the arch specified as command line argument + +arch="$1" + +if [ "x$arch" == "x" ]; then + echo "Error: You have to specify the architecture as first argument, e.g. $0 amd64" + exit 2 +fi + +if [ ! -d "./contrib" ]; then + echo "Run ./contrib/jenkins_arch.sh from the root of the libosmocore tree" + exit 1 +fi + +set -x -e + +case "$arch" in + + amd64) + ./contrib/jenkins_amd64.sh + ;; + + arch) + ./contrib/jenkins_arch.sh + ;; + + *) + set +x + echo "Unexpected architecture '$arch'" + ;; +esac diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins_arm.sh similarity index 100% rename from contrib/jenkins-arm.sh rename to contrib/jenkins_arm.sh -- To view, visit https://gerrit.osmocom.org/5884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:18:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 18:18:00 +0000 Subject: [PATCH] libosmocore[master]: jenkins: add dispatcher script In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5884 to look at the new patch set (#2). jenkins: add dispatcher script Similar to the way we test osmo-bts, add simple dispatcher script which calls appropriate test depending on a given parameter. This will allow to simplify the job description. While at it, also rename jenkins-arm.sh -> jenkins_arm.sh to match the OsmoBTS. The older scripts are preserved for compatibility and shall be removed once we update job description in osmo-ci. Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 --- A contrib/jenkins_amd64.sh A contrib/jenkins_arch.sh A contrib/jenkins_arm.sh 3 files changed, 94 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/5884/2 diff --git a/contrib/jenkins_amd64.sh b/contrib/jenkins_amd64.sh new file mode 100755 index 0000000..d336f0a --- /dev/null +++ b/contrib/jenkins_amd64.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# jenkins build helper script for libosmocore. This is how we build on jenkins.osmocom.org + +. $(dirname "$0")/jenkins_common.sh + +ENABLE_SANITIZE="--enable-sanitize" + +if [ "x$label" = "xFreeBSD_amd64" ]; then + ENABLE_SANITIZE="" +fi + +src_dir="$PWD" +build() { + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE V=1 $PARALLEL_MAKE check \ + || cat-testlogs.sh +} + +# verify build in dir other than source tree +build builddir +# verify build in source tree +build . + +# do distcheck only once, which is fine from built source tree, since distcheck +# is well separated from the source tree state. +$MAKE distcheck \ + || cat-testlogs.sh + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_arch.sh b/contrib/jenkins_arch.sh new file mode 100755 index 0000000..bac9278 --- /dev/null +++ b/contrib/jenkins_arch.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# this is a dispatcher script which will call the arch-specific +# script based on the arch specified as command line argument + +arch="$1" + +if [ "x$arch" == "x" ]; then + echo "Error: You have to specify the architecture as first argument, e.g. $0 amd64" + exit 2 +fi + +if [ ! -d "./contrib" ]; then + echo "Run ./contrib/jenkins_arch.sh from the root of the libosmocore tree" + exit 1 +fi + +set -x -e + +case "$arch" in + + amd64) + ./contrib/jenkins_amd64.sh + ;; + + arch) + ./contrib/jenkins_arch.sh + ;; + + *) + set +x + echo "Unexpected architecture '$arch'" + ;; +esac diff --git a/contrib/jenkins_arm.sh b/contrib/jenkins_arm.sh new file mode 100755 index 0000000..acdbe3c --- /dev/null +++ b/contrib/jenkins_arm.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +. $(dirname "$0")/jenkins_common.sh + +src_dir="$PWD" +build() { + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static \ + --prefix=/usr/local/arm-none-eabi \ + --host=arm-none-eabi \ + --enable-embedded \ + --disable-doxygen \ + --disable-shared \ + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + + $MAKE $PARALLEL_MAKE \ + || cat-testlogs.sh +} + +# verify build in dir other than source tree +build builddir +# verify build in source tree +build . + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:23:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 18:23:06 +0000 Subject: [PATCH] osmo-ci[master]: libosmocore: use dispatcher script Message-ID: Review at https://gerrit.osmocom.org/5885 libosmocore: use dispatcher script Get rid of job name comparison because it depends and exact build server name and hence is highly fragile. Use dispatcher script the same way we do in osmo-bts. N. B: this requires I2955e866bce4f000a53369bd601a346c36c82468 in libosmocore. Change-Id: I76dfc11a05007ae5c6e0554fe8132695b67cccaa --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/85/5885/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 70c21b5..7a4ac20 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -46,13 +46,7 @@ a1_name: arch a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' - cmd: > - # keep first line with less indent to preserve newlines - if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then - ./contrib/jenkins-arm.sh - else - ./contrib/jenkins.sh - fi + cmd: './contrib/jenkins_arch.sh "$arch"' - libsmpp34 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 4400d8e..f63db87 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -56,13 +56,7 @@ a1_name: arch a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' - cmd: > - # keep first line with less indent to preserve newlines - if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then - ./contrib/jenkins-arm.sh - else - ./contrib/jenkins.sh - fi + cmd: './contrib/jenkins_arch.sh "$arch"' trigger: > master-libosmo-abis, master-libosmo-sccp, master-openbsc, master-osmo-pcap, master-osmo-tetra, master-osmo-pcu, master-osmo-gmr, master-osmo-bts, master-osmocom-bb, SIMtrace, xgoldmon, -- To view, visit https://gerrit.osmocom.org/5885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76dfc11a05007ae5c6e0554fe8132695b67cccaa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:24:44 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 18:24:44 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5870/2/configure.ac File configure.ac: Line 71: [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) If I run configure with this part of the patch applied, and pass --enable-sysmocom-bts but do not specify --with-sysmobts=PATH, then SYSMOBTS_INCDIR gets set to an empy string: $ grep -i sysmobts config.log configure:5435: checking whether to enable support for sysmoBTS L1/PHY support ENABLE_SYSMOBTS_FALSE='#' ENABLE_SYSMOBTS_TRUE='' SYSMOBTS_INCDIR='' Is this what you intended? -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:26:26 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 18:26:26 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/5870/2/configure.ac File configure.ac: Line 70: AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files])], I think something like '--with-sysmobts-includes=' or '--with-sysmobts-headers=' would be a better name for this option. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:27:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 18:27:33 +0000 Subject: [PATCH] libosmocore[master]: jenkins: remove obsolete scripts Message-ID: Review at https://gerrit.osmocom.org/5886 jenkins: remove obsolete scripts * jenkins.sh is superseded by jenkins_amd64.sh * jenkins-arm.sh is superseded by jenkins_arm.sh N. B: this requires I76dfc11a05007ae5c6e0554fe8132695b67cccaa in osmo-ci. Change-Id: Ifbd253cff88c3ac18e469c34e79f1501501e1657 --- D contrib/jenkins-arm.sh D contrib/jenkins.sh 2 files changed, 0 insertions(+), 61 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/86/5886/1 diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh deleted file mode 100755 index acdbe3c..0000000 --- a/contrib/jenkins-arm.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -. $(dirname "$0")/jenkins_common.sh - -src_dir="$PWD" -build() { - build_dir="$1" - - prep_build "$src_dir" "$build_dir" - - "$src_dir"/configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-doxygen \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - - $MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh -} - -# verify build in dir other than source tree -build builddir -# verify build in source tree -build . - -osmo-clean-workspace.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh deleted file mode 100755 index c341d05..0000000 --- a/contrib/jenkins.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org - -. $(dirname "$0")/jenkins_common.sh - -ENABLE_SANITIZE="--enable-sanitize" - -if [ "x$label" = "xFreeBSD_amd64" ]; then - ENABLE_SANITIZE="" -fi - -src_dir="$PWD" -build() { - build_dir="$1" - - prep_build "$src_dir" "$build_dir" - - "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" - $MAKE V=1 $PARALLEL_MAKE check \ - || cat-testlogs.sh -} - -# verify build in dir other than source tree -build builddir -# verify build in source tree -build . - -# do distcheck only once, which is fine from built source tree, since distcheck -# is well separated from the source tree state. -$MAKE distcheck \ - || cat-testlogs.sh - -osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifbd253cff88c3ac18e469c34e79f1501501e1657 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:28:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 18:28:23 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 Makes sense to leave it empty to get them from standard include directories. However, that makes me think we should move the -I inside the SYSMOBTS_INCDIR variable. Otherwise yoy may end up with "-I" only in Makefile.am -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:30:54 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 18:30:54 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: A common way to handle this type of situation is to add -I$(PATH) to CPPFLAGS if PATH is set, else don't add anything. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 18:36:07 +0000 Subject: osmo-iuh[master]: hnbap: log errors on decoding/encoding HNB-REGISTER msgs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/5883/1/src/hnbgw_hnbap.c File src/hnbgw_hnbap.c: Line 374: rc = hnbap_decode_hnbregisterrequesties(&ies, in); this_is_suchanawesomefunctioname :D -- To view, visit https://gerrit.osmocom.org/5883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:38:39 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 18:38:39 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: > Otherwise yoy may end up with "-I" only in Makefile.am No, we may not. The SYSMOBTS_INCDIR is only used in targets which are enabled iff sysmobts support is enabled. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:40:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 18 Jan 2018 18:40:49 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: > '--with-sysmobts-includes=' or '--with-sysmobts-headers=' would be a better name for this option Perhaps, but I'd rather keep it similar to the other such options for different BTS models. If we'd like to rename it, we should do it for all models at once and in a separate patch. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:44:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 18 Jan 2018 18:44:31 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: > > Otherwise yoy may end up with "-I" only in Makefile.am > > No, we may not. The SYSMOBTS_INCDIR is only used in targets which > are enabled iff sysmobts support is enabled. even if sysmobts support is enavbled, I may want to build with --enable-sysmobts and without --with-sysmobts, for instance OE recipe in meta-sysmocom-bsp does that. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 18 18:50:59 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 18 Jan 2018 18:50:59 +0000 Subject: osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (4 comments) https://gerrit.osmocom.org/#/c/5878/1/src/libosmo-mgcp/mgcp_protocol.c File src/libosmo-mgcp/mgcp_protocol.c: Line 1217: len = snprintf(buf, sizeof(buf), snprintf() could return -1 here if the expanded string does not fit into buf. Line 1220: rc = send_agent(cfg, buf, len); Which means we could end up passing -1 as length here... I suggest returning an error if snprintf() returns -1. Line 1240: if (len < 0) Here it is done correctly. Line 1243: buf[sizeof(buf) - 1] = '\0'; Unrelated to your change, but this line is not needed with snprintf() and could be removed. Adding a NUL manually is a common idiom after calling strncpy() because strncpy() does not always NUL-terminate the string. But snprintf() is fine. -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 18 21:06:03 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Jan 2018 21:06:03 +0000 Subject: [PATCH] libosmocore[master]: libosmocoding: use frame length definitions from codec.h Message-ID: Review at https://gerrit.osmocom.org/5887 libosmocoding: use frame length definitions from codec.h Since commit e094157e125a70b9a384ba3cec01261624f4eb59, TCH frame length definitions were added to libosmocodec. No need to define them again. Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90 --- M src/coding/gsm0503_coding.c 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/87/5887/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index f3b319a..dab6ca1 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -131,13 +131,6 @@ #define EGPRS_DATA_C1 612 #define EGPRS_DATA_C2 EGPRS_DATA_C1 -/* TS 101318 Chapter 5.1: 260 bits + 4bit sig */ -#define GSM_FR_BYTES 33 -/* TS 101318 Chapter 5.2: 112 bits, no sig */ -#define GSM_HR_BYTES 14 -/* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ -#define GSM_EFR_BYTES 31 - /*! union across the three different EGPRS Uplink header types */ union gprs_rlc_ul_hdr_egprs { struct gprs_rlc_ul_header_egprs_1 type1; -- To view, visit https://gerrit.osmocom.org/5887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Jan 18 21:06:10 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 18 Jan 2018 21:06:10 +0000 Subject: [PATCH] libosmocore[master]: libosmocoding: fix typo in library documentation Message-ID: Review at https://gerrit.osmocom.org/5888 libosmocoding: fix typo in library documentation Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef --- M src/coding/gsm0503_coding.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/5888/1 diff --git a/src/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index dab6ca1..c94bca7 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -55,7 +55,7 @@ * 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 + * libosmocoding 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 -- To view, visit https://gerrit.osmocom.org/5888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 00:16:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 00:16:00 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 2: > > could you clarify? > > It's documented in https://www.gnu.org/software/automake/manual/html_node/Linking.html > In a nutshell, LDADD applies to all the programs, prog_LDADD > applies single program. So having only "prog_LDADD = $(LDADD)" is > confusing and redundant. The question is whether prog_LDADD overrides or includes LDADD. If it overrides, we still need to add it explicitly *if* we have a prog_LDADD. "you can use the prog_LDADD variable [...] to override LDADD. If this variable exists for a given program, then that program is not linked using LDADD." so only a prog_LDADD = $(LDADD) is wrong, and a prog_LDADD = $(LDADD) other_things is still necessary. -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 00:17:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 00:17:13 +0000 Subject: [PATCH] libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5844 to look at the new patch set (#3). tests: fix LDADD: link libosmovty from current build Do not link against the system-wide installed libosmovty during build. Instead, use the locally built one: add libosmovty.la to LDADD explicitly. It might be more accurate to add this linking only to those tests that really require it, but on the one hand ctrl_test (which raises an error) doesn't even seem to use libosmovty, and on the other hand I don't want to spend time analysing each and every test for which libs it links now. I am being lazy and find it sufficient that the tests still work after linking libosmovty to all of them. I got: /usr/local/lib/libosmovty.so.4: undefined reference to `log_set_print_basename' collect2: error: ld returned 1 exit status Makefile:964: recipe for target 'ctrl/ctrl_test' failed because a system installation of libosmovty was from a branch with a new symbol expected present in libosmocore.la (log_set_print_basename), followed by a build of current master which lacks that symbol. Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 --- M tests/Makefile.am 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/5844/3 diff --git a/tests/Makefile.am b/tests/Makefile.am index 877a302..e6cbd4c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include AM_CFLAGS = -Wall $(TALLOC_CFLAGS) AM_LDFLAGS = -LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) +LDADD = $(top_builddir)/src/libosmocore.la \ + $(top_builddir)/src/vty/libosmovty.la \ + $(TALLOC_LIBS) check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ smscb/smscb_test bits/bitrev_test a5/a5_test \ @@ -146,7 +148,6 @@ strrb_strrb_test_SOURCES = strrb/strrb_test.c vty_vty_test_SOURCES = vty/vty_test.c -vty_vty_test_LDADD = $(LDADD) $(top_builddir)/src/vty/libosmovty.la sim_sim_test_SOURCES = sim/sim_test.c sim_sim_test_LDADD = $(LDADD) $(top_builddir)/src/sim/libosmosim.la \ -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:35 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:35 +0000 Subject: [PATCH] osmo-bsc[master]: osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm ... Message-ID: Review at https://gerrit.osmocom.org/5890 osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm init A subsequent patch will add registration of a signal; cosmetically prepare by creating a common mgcp_init() function. It makes sense for the FSM registration to move to it. Change-Id: I510e1081171706eb3d9fb2db50a9aa4f768929b5 --- M include/osmocom/bsc/osmo_bsc_mgcp.h M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_mgcp.c 3 files changed, 10 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/90/5890/1 diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h index 7452513..1e06331 100644 --- a/include/osmocom/bsc/osmo_bsc_mgcp.h +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -52,6 +52,8 @@ mgcp_trans_id_t mgw_pending_trans; }; +void mgcp_init(struct gsm_network *net); + struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, enum gsm48_chan_mode chan_mode, bool full_rate); void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index e4c8fc5..1555ac1 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -293,6 +294,8 @@ exit(1); } + mgcp_init(bsc_gsmnet); + signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 186c8c5..519eaf4 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -964,18 +964,11 @@ { struct mgcp_ctx *mgcp_ctx; char name[32]; - static bool fsm_registered = false; OSMO_ASSERT(mgcp); OSMO_ASSERT(conn); OSMO_ASSERT(snprintf(name, sizeof(name), "MGW_%i", conn->conn_id) < sizeof(name)); - - /* Register the fsm description (if not already done) */ - if (fsm_registered == false) { - osmo_fsm_register(&fsm_bsc_mgcp); - fsm_registered = true; - } /* Allocate and configure a new fsm instance */ mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); @@ -1093,3 +1086,8 @@ osmo_fsm_inst_free(mgcp_ctx->fsm); talloc_free(mgcp_ctx); } + +void mgcp_init(struct gsm_network *net) +{ + osmo_fsm_register(&fsm_bsc_mgcp); +} -- To view, visit https://gerrit.osmocom.org/5890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I510e1081171706eb3d9fb2db50a9aa4f768929b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:33 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:33 +0000 Subject: [PATCH] osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... Message-ID: Review at https://gerrit.osmocom.org/5889 vty: add various manual handover and assignment trigger commands Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 --- M src/libbsc/bsc_vty.c 1 file changed, 192 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/89/5889/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index e60bdaf..d582802 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1342,12 +1342,27 @@ return CMD_SUCCESS; } -DEFUN(handover_subscr_conn, - handover_subscr_conn_cmd, - "handover <0-255> <0-255> <0-7> LCHAN_NR <0-255>", - "Handover subscriber connection to other BTS\n" - "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR "BTS Number (new)\n") +static int trigger_ho_or_as(struct vty *vty, struct gsm_lchan *from_lchan, struct gsm_bts *to_bts) +{ + int rc; + + if (!to_bts || from_lchan->ts->trx->bts == to_bts) { + LOGP(DHO, LOGL_NOTICE, "%s Manually triggering Assignment from VTY\n", + gsm_lchan_name(from_lchan)); + to_bts = from_lchan->ts->trx->bts; + } else + LOGP(DHO, LOGL_NOTICE, "%s (ARFCN %u) --> BTS %u Manually triggering Handover from VTY\n", + gsm_lchan_name(from_lchan), from_lchan->ts->trx->arfcn, to_bts->nr); + rc = bsc_handover_start(from_lchan, to_bts); + if (rc) { + vty_out(vty, "bsc_handover_start() returned %d=%s%s", rc, + strerror(-rc), VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +static int ho_or_as(struct vty *vty, const char *argv[], int argc) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_subscriber_connection *conn; @@ -1357,41 +1372,190 @@ unsigned int trx_nr = atoi(argv[1]); unsigned int ts_nr = atoi(argv[2]); unsigned int ss_nr = atoi(argv[3]); - unsigned int bts_nr_new = atoi(argv[4]); + unsigned int bts_nr_new; + const char *action; - /* Lookup the BTS where we want to handover to */ - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == bts_nr_new) { - new_bts = bts; - break; + if (argc > 4) { + bts_nr_new = atoi(argv[4]); + + /* Lookup the BTS where we want to handover to */ + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == bts_nr_new) { + new_bts = bts; + break; + } + } + + if (!new_bts) { + vty_out(vty, "Unable to trigger handover, specified bts #%u does not exist %s", + bts_nr_new, VTY_NEWLINE); + return CMD_WARNING; } } - if (!new_bts) { - vty_out(vty, "Unable to trigger handover," - "specified bts #%u does not exist %s", bts_nr_new, - VTY_NEWLINE); - return CMD_WARNING; - } + action = new_bts ? "handover" : "assignment"; /* Find the connection/lchan that we want to handover */ llist_for_each_entry(conn, &net->subscr_conns, entry) { if (conn_get_bts(conn)->nr == bts_nr && conn->lchan->ts->trx->nr == trx_nr && conn->lchan->ts->nr == ts_nr && conn->lchan->nr == ss_nr) { - vty_out(vty, "starting handover for lchan %s...%s", - conn->lchan->name, VTY_NEWLINE); + vty_out(vty, "starting %s for lchan %s...%s", action, conn->lchan->name, VTY_NEWLINE); lchan_dump_full_vty(vty, conn->lchan); - bsc_handover_start(conn->lchan, new_bts); - return CMD_SUCCESS; + return trigger_ho_or_as(vty, conn->lchan, new_bts); } } - vty_out(vty, "Unable to trigger handover," - "specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", - bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); + vty_out(vty, "Unable to trigger %s, specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", + action, bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); return CMD_WARNING; +} + +#define MANUAL_HANDOVER_STR "Manually trigger handover (for debugging)\n" +#define MANUAL_ASSIGNMENT_STR "Manually trigger assignment (for debugging)\n" + +DEFUN(handover_subscr_conn, + handover_subscr_conn_cmd, + "handover <0-255> <0-255> <0-7> LCHAN_NR <0-255>", + MANUAL_HANDOVER_STR + "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" + LCHAN_NR_STR "BTS Number (new)\n") +{ + return ho_or_as(vty, argv, argc); +} + +DEFUN(assignment_subscr_conn, + assignment_subscr_conn_cmd, + "assignment <0-255> <0-255> <0-7> LCHAN_NR", + MANUAL_ASSIGNMENT_STR + "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" + LCHAN_NR_STR) +{ + return ho_or_as(vty, argv, argc); +} + +static struct gsm_lchan *find_used_voice_lchan(struct vty *vty) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_ACTIVE + && (lchan->type == GSM_LCHAN_TCH_F + || lchan->type == GSM_LCHAN_TCH_H)) { + + vty_out(vty, "Found voice call: %s%s", + gsm_lchan_name(lchan), VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return lchan; + } + } + } + } + } + + vty_out(vty, "Cannot find any ongoing voice calls%s", VTY_NEWLINE); + return NULL; +} + +static struct gsm_bts *find_other_bts_with_free_slots(struct vty *vty, struct gsm_bts *not_this_bts, + enum gsm_phys_chan_config free_type) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + if (bts == not_this_bts) + continue; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + if (ts->pchan != free_type) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_NONE) { + vty_out(vty, "Found unused %s slot: %s%s", + gsm_pchan_name(free_type), + gsm_lchan_name(lchan), + VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return bts; + } + } + } + } + } + vty_out(vty, "Cannot find any BTS (other than BTS %u) with free %s lchan%s", + not_this_bts? not_this_bts->nr : 255, gsm_lchant_name(free_type), VTY_NEWLINE); + return NULL; +} + +DEFUN(handover_any, handover_any_cmd, + "handover any", + MANUAL_HANDOVER_STR + "Pick any actively used lchan and handover to any other BTS." + " This is only useful if all BTS are guaranteed to be reachable by the MS\n") +{ + struct gsm_lchan *from_lchan; + struct gsm_bts *to_bts; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, + ts_pchan(from_lchan->ts)); + if (!to_bts) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, to_bts); +} + +DEFUN(assignment_any, assignment_any_cmd, + "assignment any", + MANUAL_ASSIGNMENT_STR + "Pick any actively used lchan and re-assign within the same BTS.\n") +{ + struct gsm_lchan *from_lchan; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, NULL); } static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag) @@ -4212,6 +4376,9 @@ install_element_ve(&show_subscr_conn_cmd); install_element_ve(&handover_subscr_conn_cmd); + install_element_ve(&handover_any_cmd); + install_element_ve(&assignment_subscr_conn_cmd); + install_element_ve(&assignment_any_cmd); install_element_ve(&show_paging_cmd); install_element_ve(&show_paging_group_cmd); -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: fix recovery from failed handover Message-ID: Review at https://gerrit.osmocom.org/5891 HO: fix recovery from failed handover Do not instruct the MGW to move the RTP to the new lchan before we have received a HANDOVER DETECT. Before: Chan Activ Chan Activ Ack IPACC-CRCX -ACK IPACC-MDCX -ACK MGCP MDCX --> MGW ... HANDOVER DETECT Call continues on new lchan In above sequence, if the HANDOVER DETECT times out, the MGW has moved to the new lchan which never becomes used and is released. Furthermore, from the IPACC MDCX until the HANDOVER DETECT, the RTP stream would break off momentarily. After: Chan Activ Chan Activ Ack IPACC-CRCX -ACK IPACC-MDCX -ACK ... HANDOVER DETECT MGCP MDCX --> MGW Call continues on new lchan If the HANDOVER DETECT times out, the call happily continues on the old lchan. This change is inspired by Ivan Kluchnikov's HO work, who implemented a similar fix in the openbsc.git codebase (branch fairwaves/master-rebase): his patch moves ipacc_mdcx() to connect RTP to the new lchan from switch_for_handover() (which triggered on S_ABISIP_CRCX_ACK, i.e. creation of the new lchan) to later on in ho_detect() a.k.a. the S_LCHAN_HANDOVER_DETECT signal handler: http://git.osmocom.org/openbsc/commit/?h=fairwaves/master-rebase&id=9507a7a1ea627e07370c9d264816bb190b3b91b8 This patch does essentially the same: remove the mgcp_handover() call from the MDCX-ACK handling (creation of the new lchan), and add a signal handler for S_LCHAN_HANDOVER_DETECT to osmo_bsc_mgcp.c to effect the MGW switchover. Note, it would have been possible to call mgcp_handover() directly from rx of the HANDOVER DETECT message, but that produces linking fallout in some utils/ projects, which then need to link the mgcp code as well. That is because those aren't properly separated from the more complex parts of libbsc. Using the signal is a bit bloaty, but saves the linking hell for now. I've faced a similar problem twice recently, it would pay off to separate out the simpler utils/ and ipaccess/ tools so that they don't need to link all of libbsc and osmo-bsc, at some point (TM). Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f --- M include/osmocom/bsc/osmo_bsc_mgcp.h M src/libbsc/handover_logic.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_mgcp.c 4 files changed, 66 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/5891/1 diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h index 1e06331..dc2ba34 100644 --- a/include/osmocom/bsc/osmo_bsc_mgcp.h +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -58,5 +58,4 @@ enum gsm48_chan_mode chan_mode, bool full_rate); void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); -void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan); void mgcp_free_ctx(struct mgcp_ctx *mgcp_ctx); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index a30cd09..cad0144 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -325,7 +325,11 @@ return -ENODEV; } - /* FIXME: do we actually want to do something here ? */ + LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + + /* This is just for logging on the DHO category. The actual MGCP switchover happens in + * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. + * (Calling mgcp_handover() directly currently breaks linking in utils/...) */ return 0; } diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 433dc6c..ceec469 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -50,11 +50,6 @@ switch (signal) { case S_ABISIP_CRCX_ACK: - /* - * TODO: handle handover here... then the audio should go to - * the old mgcp port.. - */ - /* we can ask it to connect now */ LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n", con->sccp_con->user_plane.rtp_port, lchan->abis_ip.conn_id); @@ -77,14 +72,11 @@ case S_ABISIP_MDCX_ACK: if (con->ho_lchan) { - /* NOTE: When an ho_lchan exists, the MDCX is part of an - * handover operation (intra-bsc). This means we will not - * inform the MSC about the event, which means that no - * assignment complete message is transmitted, we just - * inform the logic that controls the MGW about the new - * connection info */ - LOGP(DMSC, LOGL_INFO,"RTP connection handover initiated...\n"); - mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, con->ho_lchan); + LOGP(DHO, LOGL_DEBUG, "%s -> %s BTS sent MDCX ACK\n", gsm_lchan_name(lchan), + gsm_lchan_name(con->ho_lchan)); + /* No need to do anything for handover here. As soon as a HANDOVER DETECT + * happens, osmo_bsc_mgcp.c will trigger the MGCP MDCX towards MGW by + * receiving an S_LCHAN_HANDOVER_DETECT signal. */ } else if (is_ipaccess_bts(conn_get_bts(con)) && con->sccp_con->user_plane.rtp_ip) { /* NOTE: This is only relevant on AoIP networks with * IPA based base stations. See also osmo_bsc_api.c, diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 519eaf4..6f3480b 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1048,7 +1049,7 @@ * Parameter: * mgcp_ctx: context information (FSM, and pointer to external system data) * ho_lchan: the lchan on the new BTS */ -void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan) +static void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan) { OSMO_ASSERT(mgcp_ctx); OSMO_ASSERT(ho_lchan); @@ -1066,6 +1067,59 @@ osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_HANDOVER, mgcp_ctx); return; +} + +/* GSM 08.58 HANDOVER DETECT has been received */ +static int mgcp_sig_ho_detect(struct gsm_lchan *new_lchan) +{ + struct gsm_subscriber_connection *conn; + if (!new_lchan) { + LOGP(DHO, LOGL_ERROR, "HO Detect signal for NULL lchan\n"); + return -EINVAL; + } + + conn = new_lchan->conn; + + if (!conn) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for lchan without conn\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + if (!conn->sccp_con) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for conn without sccp_con\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + if (!conn->sccp_con->user_plane.mgcp_ctx) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for conn without MGCP ctx\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + mgcp_handover(conn->sccp_con->user_plane.mgcp_ctx, new_lchan); + return 0; +} + +static int mgcp_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data; + + switch (subsys) { + case SS_LCHAN: + lchan_data = signal_data; + switch (signal) { + case S_LCHAN_HANDOVER_DETECT: + return mgcp_sig_ho_detect(lchan_data->lchan); + } + break; + default: + break; + } + + return 0; } /* Free an existing mgcp context gracefully @@ -1090,4 +1144,5 @@ void mgcp_init(struct gsm_network *net) { osmo_fsm_register(&fsm_bsc_mgcp); + osmo_signal_register_handler(SS_LCHAN, mgcp_sig_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/5891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:43 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:43 +0000 Subject: [PATCH] osmo-bsc[master]: HO prep: introduce per-BTS handover config, with defaults on... Message-ID: Review at https://gerrit.osmocom.org/5892 HO prep: introduce per-BTS handover config, with defaults on net node It is desirable to allow configuring handover for each individual network cell. At the same time, it is desirable to set global defaults. Treat the 'network' node handover parameters as global defaults, add another set of parameters for each individual BTS. This raises questions on how the 'network' node should affect the individual BTS. The simplistic solution would have been: on creating a BTS in the config, just copy the current defaults; with serious drawbacks: - tweaking any parameter in the telnet VTY on network node will never affect any running BTS. - network node defaults *must* be issued before the bts sections in the config file. - when writing a config back to file, we would copy all net node defaults to each BTS node, making the network node configs pointless. Instead, add a handover_cfg API that tracks whether a given node has a value set or not. A bts node ho_cfg gets a pointer to the network node config and returns those values if locally unset. If no value is set on any node, use the "factory" defaults, which are hardcoded in the API. Only write back exactly those config items that were actually issued in a config file / on the telnet VTY. (ho_cfg API wise, we could trivially add another ho_cfg level per TRX if we so desire in the future.) Implement ho parameters as an opaque config struct with getters and setters to ensure the tracking is always heeded. Opaqueness dictates allocating instead of direct embedding in gsm_network and gsm_bts structs, ctx is gsm_net / bts. This is 100% backwards compatible to old configs. - No VTY command syntax changes (only the online help). - If a 'bts' sets nothing, it will use the 'network' defaults. - The 'show network' output only changes in presence of individual BTS configs. On 'show network', say "Handover: On|Off" as before, iff all BTS reflect identical behavior. Otherwise, output BTS counts of handover being enabled or not. Use the same set of VTY commands (same VTY cmd syntax as before) on network and BTS nodes, i.e. don't duplicate VTY code. From the current vty->node, figure out which ho_cfg to modify. For linking, add handover_cfg.c (the value API) in libcommon, while the handover_vty.c is in libbsc. This is mainly because some utility programs use gsm_network and hence suck in the ho stuff, but don't need the VTY commands. Review the VTY online help strings. Add VTY transcript test for handover options, testing config propagation from network to bts nodes, 'show network' output and VTY online help strings. (Needs recent addition of '... !' wildcard to osmo_interact_common.py.) I considered leaving parts of this more readable, but in the end decided for heavy use of macros to define and declare the API, because more values will be added in upcoming patches and I want to prevent myself from messing them up. Inspired-by: jolly/new_handover branch, which moves the config to 'bts' level Depends: I7c1ebb2e7f059047903a53de26a0ec1ce7fa9b98 (osmo-python-tests) Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h A include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_vty.h M src/libbsc/Makefile.am M src/libbsc/bsc_vty.c M src/libbsc/handover_decision.c A src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/Makefile.am M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c A src/libcommon/handover_cfg.c M tests/Makefile.am A tests/handover_cfg.vty 16 files changed, 653 insertions(+), 150 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/5892/1 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index b067fc2..699aeb3 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -25,7 +25,9 @@ gsm_data.h \ gsm_data_shared.h \ handover.h \ + handover_cfg.h \ handover_decision.h \ + handover_vty.h \ ipaccess.h \ meas_feed.h \ meas_rep.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ed2a95c..c09d546 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -227,22 +227,7 @@ uint16_t network_code; int a5_encryption; int neci; - struct { - int active; - /* Window RXLEV averaging */ - unsigned int win_rxlev_avg; /* number of SACCH frames */ - /* Window RXQUAL averaging */ - unsigned int win_rxqual_avg; /* number of SACCH frames */ - /* Window RXLEV neighbouring cells averaging */ - unsigned int win_rxlev_avg_neigh; /* number of SACCH frames */ - - /* how often should we check for power budget HO */ - unsigned int pwr_interval; /* SACCH frames */ - /* how much better does a neighbor cell have to be ? */ - unsigned int pwr_hysteresis; /* dBm */ - /* maximum distacne before we try a handover */ - unsigned int max_distance; /* TA values */ - } handover; + struct handover_cfg *ho; struct rate_ctr_group *bsc_ctrs; diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index db854fd..fd566d2 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -799,6 +799,8 @@ struct pcu_sock_state *pcu_state; struct rate_ctr_group *bts_ctrs; + + struct handover_cfg *ho; }; diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h new file mode 100644 index 0000000..264cb1b --- /dev/null +++ b/include/osmocom/bsc/handover_cfg.h @@ -0,0 +1,112 @@ +#pragma once + +#include + +struct vty; + +/* handover_cfg is an opaque struct to manage several levels of configuration. There is an overall handover + * config on 'network' level and a per-'bts' specific handover config. If the 'bts' level sets no values, + * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ +struct handover_cfg; + +struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); + +#define HO_CFG_STR_HANDOVER "Handover options\n" +#define HO_CFG_STR_WIN HO_CFG_STR_HANDOVER "Measurement averaging settings\n" +#define HO_CFG_STR_WIN_RXLEV HO_CFG_STR_WIN "Received-Level averaging\n" +#define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" +#define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" +#define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" + +#define as_is(x) (x) + +static inline bool a2bool(const char *arg) +{ + return (bool)(atoi(arg)); +} + +static inline int bool2i(bool arg) +{ + return arg? 1 : 0; +} + + +/* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, + * function declarations or definitions... It is of the format + * HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, + * VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, + * VTY_WRITE_FMT, VTY_WRITE_CONV, + * VTY_DOC) + * Then using HO_CFG_ALL_MEMBERS can save a lot of code dup in defining API declaration, API + * definitions, VTY commands and VTY write code. Of course this doesn't prevent us from adding manual + * members as well, in case future additions don't fit in this scheme. + * + * TYPE: a type name like int. + * NAME: a variable name suitable for a struct member. + * DEFAULT_VAL: default value, as passed to the VTY, e.g. '0' or 'foo', without quotes. + * VTY_CMD: a command string for VTY without any arguments. + * VTY_CMD_ARG: VTY value range like '<0-23>' or 'foo|bar', will become '(VTY_CMD_ARG|default)'. + * VTY_ARG_EVAL: function name for parsing the VTY arg[0], e.g. 'atoi'. + * VTY_WRITE_FMT: printf-like string format for vty_out(). + * VTY_WRITE_CONV: function name to convert struct value to VTY_WRITE_FMT, e.g. 'as_is'. + * VTY_DOC: VTY documentation strings to match VTY_CMD and VTY_CMD_ARGs. + */ +#define HO_CFG_ALL_MEMBERS \ + \ + HO_CFG_ONE_MEMBER(bool, ho_active, 0, \ + "handover", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Disable in-call handover\n" \ + "Enable in-call handover\n" \ + "Enable/disable handover: ") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ + "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXLEV \ + "How many RxLev measurements are used for averaging\n" \ + "RxLev averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxqual_avg_win, 1, \ + "handover window rxqual averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXQUAL \ + "How many RxQual measurements are used for averaging\n" \ + "RxQual averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxlev_neigh_avg_win, 10, \ + "handover window rxlev neighbor averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXLEV \ + "How many Neighbor RxLev measurements are used for averaging\n" \ + "How many Neighbor RxLev measurements are used for averaging\n" \ + "Neighbor RxLev averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, pwr_interval, 6, \ + "handover power budget interval", "<1-99>", atoi, "%u", as_is, \ + HO_CFG_STR_POWER_BUDGET \ + "How often to check for a better cell (SACCH frames)\n" \ + "Check for stronger neighbor every N number of SACCH frames\n") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, pwr_hysteresis, 3, \ + "handover power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ + HO_CFG_STR_POWER_BUDGET \ + "How many dBm stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dBm\n") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, max_distance, 9999, \ + "handover maximum distance" , "<0-9999>", atoi, "%u", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ + + +/* Declare public API for handover cfg parameters... */ + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + TYPE ho_get_##NAME(struct handover_cfg *ho); \ + void ho_set_##NAME(struct handover_cfg *ho, TYPE val); \ + bool ho_isset_##NAME(struct handover_cfg *ho); \ + void ho_clear_##NAME(struct handover_cfg *ho); \ + bool ho_isset_on_parent_##NAME(struct handover_cfg *ho); + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h new file mode 100644 index 0000000..48af136 --- /dev/null +++ b/include/osmocom/bsc/handover_vty.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include + +void ho_vty_init(); +void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index 3ac1c0b..d118f44 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -57,5 +57,6 @@ net_init.c \ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ + handover_vty.c \ $(NULL) diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index d582802..a304e86 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -174,8 +176,27 @@ VTY_NEWLINE); vty_out(vty, " Use TCH for Paging any: %d%s", net->pag_any_tch, VTY_NEWLINE); - vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", - VTY_NEWLINE); + + { + struct gsm_bts *bts; + unsigned int ho_active_count = 0; + unsigned int ho_inactive_count = 0; + + llist_for_each_entry(bts, &net->bts_list, list) { + if (ho_get_ho_active(bts->ho)) + ho_active_count ++; + else + ho_inactive_count ++; + } + + if (ho_active_count && ho_inactive_count) + vty_out(vty, " Handover: On at %u BTS, Off at %u BTS%s", + ho_active_count, ho_inactive_count, VTY_NEWLINE); + else + vty_out(vty, " Handover: %s%s", ho_active_count ? "On" : "Off", + VTY_NEWLINE); + } + network_chan_load(&pl, net); vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); dump_pchan_load_vty(vty, " ", &pl); @@ -774,6 +795,8 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); + ho_vty_write(vty, " ", bts->ho); + config_write_bts_model(vty, bts); } @@ -803,19 +826,9 @@ vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); - vty_out(vty, " handover window rxlev averaging %u%s", - gsmnet->handover.win_rxlev_avg, VTY_NEWLINE); - vty_out(vty, " handover window rxqual averaging %u%s", - gsmnet->handover.win_rxqual_avg, VTY_NEWLINE); - vty_out(vty, " handover window rxlev neighbor averaging %u%s", - gsmnet->handover.win_rxlev_avg_neigh, VTY_NEWLINE); - vty_out(vty, " handover power budget interval %u%s", - gsmnet->handover.pwr_interval, VTY_NEWLINE); - vty_out(vty, " handover power budget hysteresis %u%s", - gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); - vty_out(vty, " handover maximum distance %u%s", - gsmnet->handover.max_distance, VTY_NEWLINE); + + ho_vty_write(vty, " ", gsmnet->ho); + VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); VTY_OUT_TIMER(3105); @@ -1646,100 +1659,6 @@ gsmnet->neci = atoi(argv[0]); gsm_net_update_ctype(gsmnet); - return CMD_SUCCESS; -} - -#define HANDOVER_STR "Handover Options\n" - -DEFUN(cfg_net_handover, cfg_net_handover_cmd, - "handover (0|1)", - HANDOVER_STR - "Don't perform in-call handover\n" - "Perform in-call handover\n") -{ - int enable = atoi(argv[0]); - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - if (enable && ipacc_rtp_direct) { - vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode " - "is enabled by using the -P command line option%s", - VTY_NEWLINE); - return CMD_WARNING; - } - gsmnet->handover.active = enable; - - return CMD_SUCCESS; -} - -#define HO_WIN_STR HANDOVER_STR "Measurement Window\n" -#define HO_WIN_RXLEV_STR HO_WIN_STR "Received Level Averaging\n" -#define HO_WIN_RXQUAL_STR HO_WIN_STR "Received Quality Averaging\n" -#define HO_PBUDGET_STR HANDOVER_STR "Power Budget\n" -#define HO_AVG_COUNT_STR "Amount to use for Averaging\n" - -DEFUN(cfg_net_ho_win_rxlev_avg, cfg_net_ho_win_rxlev_avg_cmd, - "handover window rxlev averaging <1-10>", - HO_WIN_RXLEV_STR - "How many RxLev measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxlev_avg = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_win_rxqual_avg, cfg_net_ho_win_rxqual_avg_cmd, - "handover window rxqual averaging <1-10>", - HO_WIN_RXQUAL_STR - "How many RxQual measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxqual_avg = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_win_rxlev_neigh_avg, cfg_net_ho_win_rxlev_avg_neigh_cmd, - "handover window rxlev neighbor averaging <1-10>", - HO_WIN_RXLEV_STR "Neighbor\n" - "How many RxQual measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxlev_avg_neigh = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_pwr_interval, cfg_net_ho_pwr_interval_cmd, - "handover power budget interval <1-99>", - HO_PBUDGET_STR - "How often to check if we have a better cell (SACCH frames)\n" - "Interval\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.pwr_interval = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_pwr_hysteresis, cfg_net_ho_pwr_hysteresis_cmd, - "handover power budget hysteresis <0-999>", - HO_PBUDGET_STR - "How many dB does a neighbor to be stronger to become a HO candidate\n" - "Hysteresis\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.pwr_hysteresis = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_max_distance, cfg_net_ho_max_distance_cmd, - "handover maximum distance <0-9999>", - HANDOVER_STR - "How big is the maximum timing advance before HO is forced\n" - "Distance\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.max_distance = atoi(argv[0]); return CMD_SUCCESS; } @@ -4386,13 +4305,6 @@ logging_vty_add_cmds(NULL); install_element(GSMNET_NODE, &cfg_net_neci_cmd); - install_element(GSMNET_NODE, &cfg_net_handover_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_neigh_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_pwr_interval_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_pwr_hysteresis_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_max_distance_cmd); install_element(GSMNET_NODE, &cfg_net_T3101_cmd); install_element(GSMNET_NODE, &cfg_net_T3103_cmd); install_element(GSMNET_NODE, &cfg_net_T3105_cmd); @@ -4407,6 +4319,7 @@ install_element(GSMNET_NODE, &cfg_net_T3141_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); + /* See also handover commands added on net level from handover_vty.c */ install_element(GSMNET_NODE, &cfg_bts_cmd); install_node(&bts_node, config_write_bts); @@ -4512,6 +4425,7 @@ install_element(BTS_NODE, &cfg_bts_amr_hr_hyst3_cmd); install_element(BTS_NODE, &cfg_bts_amr_hr_start_mode_cmd); install_element(BTS_NODE, &cfg_bts_pcu_sock_cmd); + /* See also handover commands added on bts level from handover_vty.c */ install_element(BTS_NODE, &cfg_trx_cmd); install_node(&trx_node, dummy_config_write); @@ -4550,6 +4464,8 @@ e1inp_vty_init(); osmo_fsm_vty_add_cmds(); + ho_vty_init(); + bsc_vty_init_extra(); return 0; diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 3bca05f..a2abb39 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -30,8 +30,10 @@ #include #include #include -#include #include + +#include +#include /* Get reference to a neighbor cell on a given BCCH ARFCN */ static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, @@ -187,7 +189,7 @@ /* attempt to do a handover */ static int attempt_handover(struct gsm_meas_rep *mr) { - struct gsm_network *net = mr->lchan->ts->trx->bts->network; + struct gsm_bts *bts = mr->lchan->ts->trx->bts; struct neigh_meas_proc *best_cell = NULL; unsigned int best_better_db = 0; int i, rc; @@ -204,10 +206,10 @@ continue; /* caculate average rxlev for this cell over the window */ - avg = neigh_meas_avg(nmp, net->handover.win_rxlev_avg_neigh); + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); /* check if hysteresis is fulfilled */ - if (avg < mr->dl.full.rx_lev + net->handover.pwr_hysteresis) + if (avg < mr->dl.full.rx_lev + ho_get_pwr_hysteresis(bts->ho)) continue; better = avg - mr->dl.full.rx_lev; @@ -222,7 +224,7 @@ LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", gsm_ts_name(mr->lchan->ts), best_cell->arfcn); - if (!net->handover.active) { + if (!ho_get_ho_active(bts->ho)) { LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n"); return 0; } @@ -248,9 +250,10 @@ * attempt a handover */ static int process_meas_rep(struct gsm_meas_rep *mr) { - struct gsm_network *net = mr->lchan->ts->trx->bts->network; + struct gsm_bts *bts = mr->lchan->ts->trx->bts; enum meas_rep_field dlev, dqual; int av_rxlev; + unsigned int pwr_interval; /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { @@ -274,7 +277,7 @@ process_meas_neigh(mr); av_rxlev = get_meas_rep_avg(mr->lchan, dlev, - net->handover.win_rxlev_avg); + ho_get_rxlev_avg_win(bts->ho)); /* Interference HO */ if (rxlev2dbm(av_rxlev) > -85 && @@ -297,14 +300,15 @@ } /* Distance */ - if (mr->ms_l1.ta > net->handover.max_distance) { - LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%u\n", - rxlev2dbm(av_rxlev), mr->ms_l1.ta); + if (mr->ms_l1.ta > ho_get_max_distance(bts->ho)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%d \n", + rxlev2dbm(av_rxlev), mr->ms_l1.ta); return attempt_handover(mr); } /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) + pwr_interval = ho_get_pwr_interval(bts->ho); + if ((mr->nr % pwr_interval) == pwr_interval - 1) return attempt_handover(mr); return 0; diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c new file mode 100644 index 0000000..225e9a9 --- /dev/null +++ b/src/libbsc/handover_vty.c @@ -0,0 +1,101 @@ +/* OsmoBSC interface to quagga VTY for handover parameters */ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2009-2010 by Harald Welte + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) +{ + switch (vty->node) { + case GSMNET_NODE: + return gsmnet_from_vty(vty)->ho; + case BTS_NODE: + OSMO_ASSERT(vty->index); + return ((struct gsm_bts *)vty->index)->ho; + default: + OSMO_ASSERT(false); + } +} + + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ + VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ + VTY_WRITE_FMT, VTY_WRITE_CONV, \ + VTY_DOC) \ +DEFUN(cfg_ho_##NAME, cfg_ho_##NAME##_cmd, \ + VTY_CMD " (" VTY_CMD_ARG "|default)", \ + VTY_DOC \ + "Use default (" #DEFAULT_VAL "), remove explicit setting on this node\n") \ +{ \ + struct handover_cfg *ho = ho_cfg_from_vty(vty); \ + const char *val = argv[0]; \ + if (!strcmp(val, "default")) { \ + const char *msg; \ + if (ho_isset_##NAME(ho)) {\ + ho_clear_##NAME(ho); \ + msg = "setting removed, now is"; \ + } else \ + msg = "already was unset, still is"; \ + vty_out(vty, "%% '" VTY_CMD "' %s " VTY_WRITE_FMT "%s%s", \ + msg, VTY_WRITE_CONV( ho_get_##NAME(ho) ), \ + ho_isset_on_parent_##NAME(ho)? " (set on higher level node)" : "", \ + VTY_NEWLINE); \ + } \ + else \ + ho_set_##NAME(ho, VTY_ARG_EVAL(val)); \ + return CMD_SUCCESS; \ +} + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER + + +void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +{ +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ + VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ + VTY_WRITE_FMT, VTY_WRITE_CONV, \ + VTY_DOC) \ + if (ho_isset_##NAME(ho)) \ + vty_out(vty, "%s" VTY_CMD " " VTY_WRITE_FMT "%s", indent, \ + VTY_WRITE_CONV( ho_get_##NAME(ho) ), VTY_NEWLINE); + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +} + +static void ho_vty_init_cmds(int parent_node) +{ +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + install_element(parent_node, &cfg_ho_##NAME##_cmd); + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +} + +void ho_vty_init() +{ + ho_vty_init_cmds(GSMNET_NODE); + ho_vty_init_cmds(BTS_NODE); +} + diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 30de0cc..57d8241 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -21,6 +21,7 @@ #include #include #include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, @@ -55,13 +56,7 @@ net->T3122 = GSM_T3122_DEFAULT; net->T3141 = GSM_T3141_DEFAULT; - /* default set of handover parameters */ - net->handover.win_rxlev_avg = 10; - net->handover.win_rxqual_avg = 1; - net->handover.win_rxlev_avg_neigh = 10; - net->handover.pwr_interval = 6; - net->handover.pwr_hysteresis = 3; - net->handover.max_distance = 9999; + net->ho = ho_cfg_init(net, NULL); INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index c66cbcd..9f7e7b9 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -27,4 +27,5 @@ gsm_data_shared.c \ socket.c \ talloc_ctx.c \ + handover_cfg.c \ $(NULL) diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 87d954a..92ebbfe 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -37,6 +37,7 @@ #include #include #include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index c14047d..e4ec594 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -33,6 +33,7 @@ #include #include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { @@ -374,6 +375,8 @@ /* si handling */ bts->bcch_change_mark = 1; + bts->ho = ho_cfg_init(bts, net->ho); + return bts; } diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c new file mode 100644 index 0000000..8c208f6 --- /dev/null +++ b/src/libcommon/handover_cfg.c @@ -0,0 +1,83 @@ +/* OsmoBSC handover configuration implementation */ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2009-2010 by Harald Welte + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include + +struct handover_cfg { + struct handover_cfg *higher_level_cfg; + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + TYPE NAME; \ + bool has_##NAME; + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +}; + +struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg) +{ + struct handover_cfg *ho = talloc_zero(ctx, struct handover_cfg); + OSMO_ASSERT(ho); + ho->higher_level_cfg = higher_level_cfg; + return ho; +} + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY_ARG_EVAL, VTY4, VTY5, VTY6) \ +TYPE ho_get_##NAME(struct handover_cfg *ho) \ +{ \ + if (ho->has_##NAME) \ + return ho->NAME; \ + if (ho->higher_level_cfg) \ + return ho_get_##NAME(ho->higher_level_cfg); \ + return VTY_ARG_EVAL(#DEFAULT_VAL); \ +} \ +\ +void ho_set_##NAME(struct handover_cfg *ho, TYPE value) \ +{ \ + ho->NAME = value; \ + ho->has_##NAME = true; \ +} \ +\ +bool ho_isset_##NAME(struct handover_cfg *ho) \ +{ \ + return ho->has_##NAME; \ +} \ +\ +void ho_clear_##NAME(struct handover_cfg *ho) \ +{ \ + ho->has_##NAME = false; \ +} \ +\ +bool ho_isset_on_parent_##NAME(struct handover_cfg *ho) \ +{ \ + return ho->higher_level_cfg \ + && (ho_isset_##NAME(ho->higher_level_cfg) \ + || ho_isset_on_parent_##NAME(ho->higher_level_cfg)); \ +} + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER diff --git a/tests/Makefile.am b/tests/Makefile.am index 9207434..ba8a5e1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,6 +34,7 @@ $(TESTSUITE) \ vty_test_runner.py \ ctrl_test_runner.py \ + handover_cfg.vty \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -44,11 +45,21 @@ if ENABLE_EXT_TESTS python-tests: $(BUILT_SOURCES) + $(MAKE) vty-test osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + osmo_verify_transcript_vty.py -v \ + -n OsmoBSC -p 4242 \ + -r "$(top_builddir)/src/osmo-bsc/osmo-bsc -c $(top_srcdir)/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg" \ + $(U) $(srcdir)/*.vty else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty new file mode 100644 index 0000000..e181797 --- /dev/null +++ b/tests/handover_cfg.vty @@ -0,0 +1,279 @@ +OsmoBSC> show network +... + Handover: Off +... +OsmoBSC> enable + +OsmoBSC# ### No handover config present +OsmoBSC# show running-config +... !handover + +OsmoBSC# ### Toggling handover on network level affects 'show network': +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# handover 1 +OsmoBSC(config-net)# do show network +... + Handover: On +... + +OsmoBSC(config-net)# ### If network level default is 'on', bts level can still override to 'off': +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover 0 +OsmoBSC(config-net-bts)# do show network +... + Handover: Off +... +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# ### Create a *second* BTS that is not explicitly 'off': +OsmoBSC(config-net)# bts 1 +OsmoBSC(config-net-bts)# do show network +... + Handover: On at 1 BTS, Off at 1 BTS +... + +OsmoBSC(config-net-bts)# ### Add arbitrary handover config item for bts 1: +OsmoBSC(config-net-bts)# handover power budget interval 23 +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# ### HO is 'on' globally, bts 0 disables it, bts 1 tweaks a param: +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Set global default to 'off', now bts 1 also uses the global default of 'off': +OsmoBSC(config-net)# handover 0 +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 0 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Remove the global setting, i.e. use the factory default net level, with same effect: +OsmoBSC(config-net)# handover default +% 'handover' setting removed, now is 0 +OsmoBSC(config-net)# handover default +% 'handover' already was unset, still is 0 +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Re-enable net-level handover, but bts 0 remains disabled explicitly +OsmoBSC(config-net)# handover 1 +OsmoBSC(config-net)# do show network +... + Handover: On at 1 BTS, Off at 1 BTS +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Remove explicit setting of bts 0 to also use the global setting: +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover default +% 'handover' setting removed, now is 1 (set on higher level node) +OsmoBSC(config-net-bts)# handover default +% 'handover' already was unset, still is 1 (set on higher level node) +OsmoBSC(config-net-bts)# do show network +... + Handover: On +... +OsmoBSC(config-net-bts)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + + +OsmoBSC(config-net-bts)# ### Checking online help +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# list +... + handover (0|1|default) + handover window rxlev averaging (<1-10>|default) + handover window rxqual averaging (<1-10>|default) + handover window rxlev neighbor averaging (<1-10>|default) + handover power budget interval (<1-99>|default) + handover power budget hysteresis (<0-999>|default) + handover maximum distance (<0-9999>|default) +... + +OsmoBSC(config-net)# handover? + handover Handover options + +OsmoBSC(config-net)# handover ? + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net)# handover window ? + rxlev Received-Level averaging + rxqual Received-Quality averaging + +OsmoBSC(config-net)# handover window rxlev ? + averaging How many RxLev measurements are used for averaging + neighbor How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net)# handover window rxlev averaging ? + <1-10> RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover window rxlev neighbor ? + averaging How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net)# handover window rxlev neighbor averaging ? + <1-10> Neighbor RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover window rxqual ? + averaging How many RxQual measurements are used for averaging + +OsmoBSC(config-net)# handover window rxqual averaging ? + <1-10> RxQual averaging: Number of values to average over + default Use default (1), remove explicit setting on this node + +OsmoBSC(config-net)# handover power ? + budget Neighbor cell power triggering + +OsmoBSC(config-net)# handover power budget ? + interval How often to check for a better cell (SACCH frames) + hysteresis How many dBm stronger must a neighbor be to become a HO candidate + +OsmoBSC(config-net)# handover power budget interval ? + <1-99> Check for stronger neighbor every N number of SACCH frames + default Use default (6), remove explicit setting on this node + +OsmoBSC(config-net)# handover power budget hysteresis ? + <0-999> Neighbor's strength difference in dBm + default Use default (3), remove explicit setting on this node + +OsmoBSC(config-net)# handover maximum ? + distance Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net)# handover maximum distance ? + <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO + default Use default (9999), remove explicit setting on this node + + +OsmoBSC(config-net)# ### Same on BTS level +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover? + handover Handover options + +OsmoBSC(config-net-bts)# handover ? + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net-bts)# handover window ? + rxlev Received-Level averaging + rxqual Received-Quality averaging + +OsmoBSC(config-net-bts)# handover window rxlev ? + averaging How many RxLev measurements are used for averaging + neighbor How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxlev averaging ? + <1-10> RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover window rxlev neighbor ? + averaging How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxlev neighbor averaging ? + <1-10> Neighbor RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover window rxqual ? + averaging How many RxQual measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxqual averaging ? + <1-10> RxQual averaging: Number of values to average over + default Use default (1), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover power ? + budget Neighbor cell power triggering + +OsmoBSC(config-net-bts)# handover power budget ? + interval How often to check for a better cell (SACCH frames) + hysteresis How many dBm stronger must a neighbor be to become a HO candidate + +OsmoBSC(config-net-bts)# handover power budget interval ? + <1-99> Check for stronger neighbor every N number of SACCH frames + default Use default (6), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover power budget hysteresis ? + <0-999> Neighbor's strength difference in dBm + default Use default (3), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover maximum ? + distance Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net-bts)# handover maximum distance ? + <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO + default Use default (9999), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:44 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Send Channel Mode and Multirate IE along with handover c... Message-ID: Review at https://gerrit.osmocom.org/5893 HO: Send Channel Mode and Multirate IE along with handover command This is needed, if the channel mode should change when doing handover. A change in channel mode makes sense, if available resources at the new BTS are different. Change-Id: Ib6b17a9be252f1655006ab6773483868017d7926 --- M src/libbsc/gsm_04_08_utils.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/93/5893/1 diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 414fd6d..b17e58e 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -406,6 +406,13 @@ } /* FIXME: optional bits for type of synchronization? */ + msgb_tv_put(msg, GSM48_IE_CHANMODE_1, new_lchan->tch_mode); + + /* in case of multi rate we need to attach a config */ + if (new_lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + msgb_tlv_put(msg, GSM48_IE_MUL_RATE_CFG, new_lchan->mr_ms_lv[0], + new_lchan->mr_ms_lv + 1); + return gsm48_sendmsg(msg); } -- To view, visit https://gerrit.osmocom.org/5893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6b17a9be252f1655006ab6773483868017d7926 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:45 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add indicators for inter-cell and async ho, use for chan... Message-ID: Review at https://gerrit.osmocom.org/5894 HO: add indicators for inter-cell and async ho, use for chan act type Change-Id: I2d91765c1f9719c64fd99426a872cecc724215db --- M src/libbsc/handover_logic.c 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/94/5894/1 diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index cad0144..f525b21 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -48,6 +48,9 @@ struct osmo_timer_list T3103; uint8_t ho_ref; + + bool inter_cell; + bool async; }; static LLIST_HEAD(bsc_handovers); @@ -125,6 +128,10 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; + if (old_lchan->ts->trx->bts != bts) { + ho->inter_cell = true; + ho->async = true; + } /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); @@ -139,7 +146,11 @@ new_lchan->conn->ho_lchan = new_lchan; /* FIXME: do we have a better idea of the timing advance? */ - rc = rsl_chan_activate_lchan(new_lchan, RSL_ACT_INTER_ASYNC, ho->ho_ref); + rc = rsl_chan_activate_lchan(new_lchan, + ho->inter_cell + ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) + : RSL_ACT_INTRA_IMM_ASS, + ho->ho_ref); if (rc < 0) { LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); new_lchan->conn->ho_lchan = NULL; -- To view, visit https://gerrit.osmocom.org/5894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d91765c1f9719c64fd99426a872cecc724215db Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:46 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:46 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Add function to count currently ongoing handovers to a g... Message-ID: Review at https://gerrit.osmocom.org/5895 HO: Add function to count currently ongoing handovers to a given BTS In order to keep processing power at BTS at a defined level, the handover decision might want to limit maximum number of slots that require RACH detection. Change-Id: I8908e37fe0d8d2eda906cc6301ba0969b25a5575 --- M include/osmocom/bsc/handover.h M src/libbsc/handover_logic.c 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/95/5895/1 diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index 9e2ba1a..a9349ee 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -7,3 +7,5 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); + +int bsc_ho_count(struct gsm_bts *bts, bool inter_cell); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index f525b21..ee7b683 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -389,3 +389,21 @@ { osmo_signal_register_handler(SS_LCHAN, ho_logic_sig_cb, NULL); } + +/* Count number of currently ongoing handovers + * inter_cell: if true, count only handovers between two cells. If false, count only handovers within one + * cell. */ +int bsc_ho_count(struct gsm_bts *bts, bool inter_cell) +{ + struct bsc_handover *ho; + int count = 0; + + llist_for_each_entry(ho, &bsc_handovers, list) { + if (ho->inter_cell != inter_cell) + continue; + if (ho->new_lchan->ts->trx->bts == bts) + count++; + } + + return count; +} -- To view, visit https://gerrit.osmocom.org/5895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8908e37fe0d8d2eda906cc6301ba0969b25a5575 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:47 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:47 +0000 Subject: [PATCH] osmo-bsc[master]: cosmetic: explicitly init ho_ref start value Message-ID: Review at https://gerrit.osmocom.org/5896 cosmetic: explicitly init ho_ref start value The static ho_ref seems to be implicitly initialized to zero, but let's make it explicit for code readability. Change-Id: I00493bcb7ef3e38fb8e0077c60c5bac7199f1073 --- M src/libbsc/handover_logic.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/96/5896/1 diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index ee7b683..4b86de7 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -93,7 +93,7 @@ { struct gsm_lchan *new_lchan; struct bsc_handover *ho; - static uint8_t ho_ref; + static uint8_t ho_ref = 0; int rc; /* don't attempt multiple handovers for the same lchan at -- To view, visit https://gerrit.osmocom.org/5896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00493bcb7ef3e38fb8e0077c60c5bac7199f1073 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:48 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:48 +0000 Subject: [PATCH] osmo-bsc[master]: Fix: If paging for half rate was requested, use hr, if suppo... Message-ID: Review at https://gerrit.osmocom.org/5897 Fix: If paging for half rate was requested, use hr, if supported by MS Change-Id: I6d1c9701808ee542771fee145250927019a2f5f6 --- M src/libbsc/gsm_04_08_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/97/5897/1 diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index b17e58e..85eb7b5 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -116,7 +116,7 @@ [CHREQ_T_PAG_R_ANY_NECI1] = GSM_LCHAN_SDCCH, [CHREQ_T_PAG_R_ANY_NECI0] = GSM_LCHAN_SDCCH, [CHREQ_T_PAG_R_TCH_F] = GSM_LCHAN_TCH_F, - [CHREQ_T_PAG_R_TCH_FH] = GSM_LCHAN_TCH_F, + [CHREQ_T_PAG_R_TCH_FH] = GSM_LCHAN_TCH_H, [CHREQ_T_LMU] = GSM_LCHAN_SDCCH, [CHREQ_T_RESERVED_SDCCH] = GSM_LCHAN_SDCCH, [CHREQ_T_PDCH_ONE_PHASE] = GSM_LCHAN_PDTCH, -- To view, visit https://gerrit.osmocom.org/5897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d1c9701808ee542771fee145250927019a2f5f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:49 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:49 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Assign SDCCH on channel request Message-ID: Review at https://gerrit.osmocom.org/5898 HO: Assign SDCCH on channel request This is needed, so channel can be negotiated before the actual channel type is assigned. In case there is no SDCCH available, try to assign what ever the MS requested. If this is not possible try to assign TCH/F. If this is still not possible, reject channel request. Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 --- M src/libbsc/abis_rsl.c 1 file changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/98/5898/1 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 980b3e6..cb28287 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1890,8 +1890,26 @@ */ is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); - /* check availability / allocate channel */ - lchan = lchan_alloc(bts, lctype, is_lu); + /* check availability / allocate channel + * + * - First try to allocate SDCCH. + * - If SDCCH is not available, try whatever MS requested, if not SDCCH. + * - If there is still no channel available, reject channel request. + * + * lchan_alloc() possibly tries to allocate larger lchans. + * + * Note: If the MS requests not TCH/H, we don't know if the phone + * supports TCH/H, so we must assign TCH/F or SDCCH. + */ + lchan = lchan_alloc(bts, GSM_LCHAN_SDCCH, 0); + if (!lchan && lctype != GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(lctype)); + lchan = lchan_alloc(bts, lctype, 0); + } if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); -- To view, visit https://gerrit.osmocom.org/5898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:50 +0000 Subject: [PATCH] osmo-bsc[master]: Fix of checking TCH rate at chan_compat_with_mode Message-ID: Review at https://gerrit.osmocom.org/5899 Fix of checking TCH rate at chan_compat_with_mode In case of current channel equals TCH/F and we request half rate, we must return 0, so the calling function will trigger assignment. Change-Id: Ibb4cb9aef1a1146f984d7c969bfba53c647cae07 --- M src/libbsc/bsc_api.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/99/5899/1 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index bd55dfc..3592c00 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -357,7 +357,11 @@ * an explicit override by the 'full_rate' argument */ switch (lchan->type) { case GSM_LCHAN_TCH_F: - return 1; + if (full_rate) + return 1; + else + return 0; + break; case GSM_LCHAN_TCH_H: if (full_rate) return 0; -- To view, visit https://gerrit.osmocom.org/5899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb4cb9aef1a1146f984d7c969bfba53c647cae07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:51 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:51 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Count the actual meas.rep. get_meas_rep_avg fails if not... Message-ID: Review at https://gerrit.osmocom.org/5900 HO: Count the actual meas.rep. get_meas_rep_avg fails if not reached get_meas_rep_avg will return -EINVAL, if the required number of measurements are not reached. There will be no handover possible until the given number of measurements are available. Change-Id: Ibc4410b4e162cdb6c070128d2c63946bb79d6d65 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/abis_rsl.c M src/libbsc/chan_alloc.c M src/libbsc/meas_rep.c 4 files changed, 18 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/00/5900/1 diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index fd566d2..fed3494 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -268,6 +268,7 @@ /* cache of last measurement reports on this lchan */ struct gsm_meas_rep meas_rep[6]; int meas_rep_idx; + int meas_rep_count; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index cb28287..d535717 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1470,8 +1470,11 @@ if (!TLVP_PRESENT(&tp, RSL_IE_MEAS_RES_NR) || !TLVP_PRESENT(&tp, RSL_IE_UPLINK_MEAS) || - !TLVP_PRESENT(&tp, RSL_IE_BS_POWER)) + !TLVP_PRESENT(&tp, RSL_IE_BS_POWER)) { + LOGP(DRSL, LOGL_ERROR, "%s Measurement Report lacks mandatory IEs\n", + gsm_lchan_name(mr->lchan)); return -EIO; + } /* Mandatory Parts */ mr->nr = *TLVP_VAL(&tp, RSL_IE_MEAS_RES_NR); @@ -1517,6 +1520,10 @@ return rc; } + mr->lchan->meas_rep_count++; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + print_meas_rep(msg->lchan, mr); send_lchan_signal(S_LCHAN_MEAS_REP, msg->lchan, mr); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 07248fb..1caa13d 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -347,6 +347,10 @@ gsm_ts_and_pchan_name(lchan->ts), lchan->nr, gsm_lchant_name(lchan->type)); + /* reset measurement report counter and index */ + lchan->meas_rep_count = 0; + lchan->meas_rep_idx = 0; + /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index cb8379e..fbd1515 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -19,6 +19,7 @@ * */ +#include #include #include @@ -75,7 +76,10 @@ int avg = 0; if (num < 1) - return 0; + return -EINVAL; + + if (num > lchan->meas_rep_count) + return -EINVAL; idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), lchan->meas_rep_idx, num); -- To view, visit https://gerrit.osmocom.org/5900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibc4410b4e162cdb6c070128d2c63946bb79d6d65 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:52 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:52 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Count neighbor measurements and reduce window of neigh_m... Message-ID: Review at https://gerrit.osmocom.org/5901 HO: Count neighbor measurements and reduce window of neigh_meas_avg Always start with a counter of 0 for a new measurement report. If the neigh_meas_avg is caluclated over the given window, the window is reduced, if there are less measurement reports received so far. Change-Id: I1c74f27f9663a3083610c985a080fca331c19bd3 --- M src/libbsc/handover_decision.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/01/5901/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index a2abb39..04ca144 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -99,6 +99,13 @@ unsigned int i, idx; int avg = 0; + /* reduce window to the actual number of existing measurements */ + if (window < nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window == 0) + return 0; + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), window); @@ -177,6 +184,7 @@ nmp->arfcn = mrc->arfcn; nmp->bsic = mrc->bsic; + nmp->rxlev_cnt = 0; idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); nmp->rxlev[idx] = mrc->rxlev; nmp->rxlev_cnt++; -- To view, visit https://gerrit.osmocom.org/5901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c74f27f9663a3083610c985a080fca331c19bd3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:53 +0000 Subject: [PATCH] osmo-bsc[master]: fixup: neigh_meas_avg: detect invalid window size as <=0, lo... Message-ID: Review at https://gerrit.osmocom.org/5902 fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid Change-Id: I8c5d0642aeb4fbee73a035b9f73cf3a09b1bcf90 --- M src/libbsc/handover_decision.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/02/5902/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 04ca144..1ad4b36 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -103,8 +103,10 @@ if (window < nmp->rxlev_cnt) window = nmp->rxlev_cnt; /* this should never happen */ - if (window == 0) + if (window <= 0) { + LOGP(DHO, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); return 0; + } idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), -- To view, visit https://gerrit.osmocom.org/5902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c5d0642aeb4fbee73a035b9f73cf3a09b1bcf90 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:54 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:54 +0000 Subject: [PATCH] osmo-bsc[master]: fixup: neigh_meas_avg: fix condition to reduce window size Message-ID: Review at https://gerrit.osmocom.org/5903 fixup: neigh_meas_avg: fix condition to reduce window size Change-Id: Ia2269be448436d676289c84b9b05da7f51ee4a85 --- M src/libbsc/handover_decision.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/5903/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 1ad4b36..127b362 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -100,7 +100,7 @@ int avg = 0; /* reduce window to the actual number of existing measurements */ - if (window < nmp->rxlev_cnt) + if (window > nmp->rxlev_cnt) window = nmp->rxlev_cnt; /* this should never happen */ if (window <= 0) { -- To view, visit https://gerrit.osmocom.org/5903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2269be448436d676289c84b9b05da7f51ee4a85 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:55 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:55 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Changed availablilty of ts_is_usable() from static to ex... Message-ID: Review at https://gerrit.osmocom.org/5904 HO: Changed availablilty of ts_is_usable() from static to extern Change-Id: I3471e38327c4b98490faed9b604fb76438ba9954 --- M include/osmocom/bsc/chan_alloc.h M src/libbsc/chan_alloc.c 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/5904/1 diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index 62d0286..f2a75c5 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -47,5 +47,6 @@ void network_chan_load(struct pchan_load *pl, struct gsm_network *net); bool trx_is_usable(const struct gsm_bts_trx *trx); +bool ts_is_usable(const struct gsm_bts_trx_ts *ts); #endif /* _CHAN_ALLOC_H */ diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 1caa13d..9946628 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -34,7 +34,7 @@ #include -static bool ts_is_usable(const struct gsm_bts_trx_ts *ts) +bool ts_is_usable(const struct gsm_bts_trx_ts *ts) { if (!trx_is_usable(ts->trx)) return false; -- To view, visit https://gerrit.osmocom.org/5904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3471e38327c4b98490faed9b604fb76438ba9954 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:56 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:56 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Always update rqd_ta after receiving measurement report Message-ID: Review at https://gerrit.osmocom.org/5905 HO: Always update rqd_ta after receiving measurement report The up-to-date rqd_ta is required for assignment command. If the phone moves, the timing advance might change. The rqd_ta will be updated by each measurement report. Change-Id: If1a592e590cfed55ff3dca5be89e2946e8017a22 --- M src/libbsc/abis_rsl.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/05/5905/1 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index d535717..bdd86a9 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1512,6 +1512,8 @@ if (msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_BS11 || msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE) mr->ms_l1.ta >>= 2; + /* store TA for next assignment/handover */ + mr->lchan->rqd_ta = mr->ms_l1.ta; } if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { msg->l3h = (uint8_t *) TLVP_VAL(&tp, RSL_IE_L3_INFO); -- To view, visit https://gerrit.osmocom.org/5905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If1a592e590cfed55ff3dca5be89e2946e8017a22 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:58 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:58 +0000 Subject: [PATCH] osmo-bsc[master]: HO: If handover logic is used to do assignment, signal assig... Message-ID: Review at https://gerrit.osmocom.org/5906 HO: If handover logic is used to do assignment, signal assignment result Change-Id: I465caef03626e67d9b3a21bdf730589b9852c211 --- M include/osmocom/bsc/signal.h M src/libbsc/bsc_api.c 2 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/06/5906/1 diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 58d9acf..9c0d5a3 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -85,6 +85,8 @@ S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */ S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */ S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */ + S_LCHAN_ASSIGNMENT_COMPL, /* 04.08 Assignment Completed */ + S_LCHAN_ASSIGNMENT_FAIL, /* 04.08 Assignment Failed */ S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */ S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */ }; diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 3592c00..ec64bb8 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -436,6 +436,21 @@ struct gsm48_hdr *gh; struct bsc_api *api = conn->network->bsc_api; + if (conn->ho_lchan) { + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + DEBUGP(DRR, "ASSIGNMENT COMPLETE cause = %s\n", + rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); + /* FIXME: release old channel */ + + return; + } + if (conn->secondary_lchan != msg->lchan) { LOGP(DMSC, LOGL_ERROR, "Assignment Compl should occur on second lchan.\n"); return; @@ -471,6 +486,20 @@ uint8_t *rr_failure; struct gsm48_hdr *gh; + if (conn->ho_lchan) { + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + DEBUGP(DRR, "ASSIGNMENT FAILED cause = %s\n", + rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); + /* FIXME: release allocated new channel */ + + return; + } if (conn->lchan != msg->lchan) { LOGP(DMSC, LOGL_ERROR, "Assignment failure should occur on primary lchan.\n"); -- To view, visit https://gerrit.osmocom.org/5906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I465caef03626e67d9b3a21bdf730589b9852c211 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:03:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:03:59 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Add handover decision debugging category Message-ID: Review at https://gerrit.osmocom.org/5907 HO: Add handover decision debugging category Change-Id: Iaf99d4e9ae08c38bf364dbb37d42098f976f6b8c --- M include/osmocom/bsc/debug.h M src/libcommon/debug.c 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/07/5907/1 diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h index 65e197d..131ae8a 100644 --- a/include/osmocom/bsc/debug.h +++ b/include/osmocom/bsc/debug.h @@ -21,6 +21,7 @@ DMSC, DMGCP, DHO, + DHODEC, DDB, DREF, DGPRS, diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 68fc597..b5a490b 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -106,7 +106,14 @@ }, [DHO] = { .name = "DHO", - .description = "Hand-Over", + .description = "Hand-Over Process", + .color = "\033[1;38m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DHODEC] = { + .name = "DHODEC", + .description = "Hand-Over Decision", + .color = "\033[1;38m", .enabled = 1, .loglevel = LOGL_NOTICE, }, [DDB] = { -- To view, visit https://gerrit.osmocom.org/5907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf99d4e9ae08c38bf364dbb37d42098f976f6b8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:00 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:00 +0000 Subject: [PATCH] osmo-bsc[master]: Do not perform assignment, if the new channel equals the cur... Message-ID: Review at https://gerrit.osmocom.org/5908 Do not perform assignment, if the new channel equals the current one This can happen, if a TCH/H was requested, but because it is not available, a TCH/F is allocated. If the old channel was TCH/F already, it makes no sense to assign it. Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae --- M src/libbsc/bsc_api.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/5908/1 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index ec64bb8..53d0281 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -221,6 +221,13 @@ return -1; } + /* check if we are on TCH/F and requested TCH/H, but got TCH/F */ + if (conn->lchan->type == new_lchan->type) { + lchan_free(new_lchan); + LOGP(DMSC, LOGL_NOTICE, "Not assign to equal channel rate.\n"); + return -1; + } + /* copy old data to the new channel */ memcpy(&new_lchan->encr, &conn->lchan->encr, sizeof(new_lchan->encr)); new_lchan->ms_power = conn->lchan->ms_power; -- To view, visit https://gerrit.osmocom.org/5908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:01 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:01 +0000 Subject: [PATCH] osmo-bsc[master]: Allow assignment to TCH channel with signalling only mode Message-ID: Review at https://gerrit.osmocom.org/5909 Allow assignment to TCH channel with signalling only mode This makes sense, if silent call is used. Assignment allows to change from SDCCH (or whatever was available) to given TCH rate. Change-Id: I2efe9d7ab429e902581ebb9e0e006f2aec6d8972 --- M src/libbsc/bsc_api.c 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/09/5909/1 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 53d0281..545cf36 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -236,7 +236,8 @@ /* copy new data to it */ new_lchan->tch_mode = chan_mode; - new_lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH; + new_lchan->rsl_cmode = (chan_mode == GSM48_CMODE_SIGN) ? + RSL_CMOD_SPD_SIGN : RSL_CMOD_SPD_SPEECH; /* handle AMR correctly */ if (chan_mode == GSM48_CMODE_SPEECH_AMR) @@ -354,8 +355,6 @@ { switch (chan_mode) { case GSM48_CMODE_SIGN: - /* signalling is always possible */ - return 1; case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_AMR: case GSM48_CMODE_DATA_3k6: -- To view, visit https://gerrit.osmocom.org/5909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2efe9d7ab429e902581ebb9e0e006f2aec6d8972 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:02 +0000 Subject: [PATCH] osmo-bsc[master]: Correctly set T3105 for ipaccess BTS type Message-ID: Review at https://gerrit.osmocom.org/5910 Correctly set T3105 for ipaccess BTS type The given value is 10 * ms, so 13 is used instead of 128. If T3105 is set at config to something greater 0, it is used instead of the default value. Adjusst nanobts_omlattr_test.c accordingly. Change-Id: I3d9687619ba4de35f5d2eff3026d903534b2bbd4 --- M src/libbsc/bts_ipaccess_nanobts_omlattr.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.ok 3 files changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/10/5910/1 diff --git a/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 22ae484..926322c 100644 --- a/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -89,8 +89,8 @@ } msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); - /* miliseconds */ - msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, 128); + /* 10 milliseconds */ + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, bts->network->T3105 > 0? bts->network->T3105 : 13); /* 10 retransmissions of physical config */ msgb_tv_put(msgb, NM_ATT_NY1, 10); diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index cdb37a3..674148a 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -219,7 +219,7 @@ 0x02, 0x01, 0x20, 0x33, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21, 0xa8, 0x1f, 0x3f, 0x25, 0x00, 0x01, 0x0a, 0x0c, 0x0a, 0x0b, 0x01, 0x2a, 0x0a, 0x2b, - 0x03, 0xe8, 0x0a, 0x80, + 0x03, 0xe8, 0x0a, 0x0d, 0x23, 0x0a, 0x08, 0x03, 0x62, 0x09, 0x3f, 0x99, 0x00, 0x07, 0x00, 0xf1, 0x10, 0x00, 0x01, 0x05, 0x39 diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok index 91b655f..9504c09 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.ok +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.ok @@ -1,6 +1,6 @@ Testing nanobts_attr_bts_get()... -result= 19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a80230a080362093f99000700f11000010539 -expected=19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a80230a080362093f99000700f11000010539 +result= 19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a0d230a080362093f99000700f11000010539 +expected=19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a0d230a080362093f99000700f11000010539 ok. Testing nanobts_attr_nse_get()... -- To view, visit https://gerrit.osmocom.org/5910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d9687619ba4de35f5d2eff3026d903534b2bbd4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:03 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:03 +0000 Subject: [PATCH] osmo-bsc[master]: HO: fix: increase the number of measurement report history t... Message-ID: Review at https://gerrit.osmocom.org/5911 HO: fix: increase the number of measurement report history to 10 If we want to average over up to 10 measurement reports (as configurable at VTY), we need a history of at least 10 measurements. Change-Id: Ia7cfac073bdc464092ca3e51dec319ac30401dd1 --- M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h 2 files changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/5911/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index c09d546..6659b72 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -50,6 +50,8 @@ #define MAX_NEIGH_MEAS 10 /* Maximum size of the averaging window for neighbor cells */ #define MAX_WIN_NEIGH_AVG 10 +/* Maximum number of report history we store */ +#define MAX_MEAS_REP 10 /* processed neighbor measurements for one cell */ struct neigh_meas_proc { diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index fed3494..86c5ca9 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -266,7 +266,7 @@ struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; + struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; -- To view, visit https://gerrit.osmocom.org/5911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia7cfac073bdc464092ca3e51dec319ac30401dd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:04 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:04 +0000 Subject: [PATCH] osmo-bsc[master]: HO: enable handover by initializing at startup; rename init ... Message-ID: Review at https://gerrit.osmocom.org/5912 HO: enable handover by initializing at startup; rename init function Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779 --- M include/osmocom/bsc/handover_decision.h M src/libbsc/handover_decision.c M src/osmo-bsc/osmo_bsc_main.c 3 files changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/12/5912/1 diff --git a/include/osmocom/bsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h index 81078b0..fe551ca 100644 --- a/include/osmocom/bsc/handover_decision.h +++ b/include/osmocom/bsc/handover_decision.h @@ -1,7 +1,3 @@ -#ifndef _HANDOVER_DECISION_H -#define _HANDOVER_DECISION_H +#pragma once -void on_dso_load_ho_dec(void); - -#endif /* _HANDOVER_DECISION_H */ - +void handover_decision_1_init(void); diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 127b362..158fc1c 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -343,7 +343,7 @@ return 0; } -void on_dso_load_ho_dec(void) +void handover_decision_1_init(void) { osmo_signal_register_handler(SS_LCHAN, ho_dec_sig_cb, NULL); } diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1555ac1..1aff4c5 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -296,6 +297,8 @@ mgcp_init(bsc_gsmnet); + handover_decision_1_init(); + signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); -- To view, visit https://gerrit.osmocom.org/5912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:05 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add algorithm cfg; skip HO 1 if HO 2 is configured Message-ID: Review at https://gerrit.osmocom.org/5913 HO: add algorithm cfg; skip HO 1 if HO 2 is configured Change-Id: If07c0a7b84937ab92948e9b71b2496a765946020 --- M include/osmocom/bsc/handover_cfg.h M src/libbsc/handover_decision.c 2 files changed, 13 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/13/5913/1 diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 264cb1b..e281c3f 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -60,6 +60,15 @@ "Enable in-call handover\n" \ "Enable/disable handover: ") \ \ + HO_CFG_ONE_MEMBER(int, algorithm, 1, \ + "handover algorithm", "1|2", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Choose algorithm for handover decision\n" \ + "Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual," \ + " only.\n" \ + "Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several" \ + " cells. Consider available codecs. Prevent repeated handover by penalty timers.\n") \ + \ HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ HO_CFG_STR_WIN_RXLEV \ diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 158fc1c..1e2e0d9 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -265,6 +265,10 @@ int av_rxlev; unsigned int pwr_interval; + /* If this cell does not use handover algorithm 1, then we're not responsible. */ + if (ho_get_algorithm(bts->ho) != 1) + return 0; + /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { case GSM_LCHAN_TCH_F: -- To view, visit https://gerrit.osmocom.org/5913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If07c0a7b84937ab92948e9b71b2496a765946020 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:06 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:06 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add handover algo 2 configuration parameters Message-ID: Review at https://gerrit.osmocom.org/5914 HO: add handover algo 2 configuration parameters Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 --- M include/osmocom/bsc/handover_cfg.h M tests/handover_cfg.vty 2 files changed, 361 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/5914/1 diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index e281c3f..1b81235 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -1,6 +1,7 @@ #pragma once #include +#include struct vty; @@ -17,6 +18,11 @@ #define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" #define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" #define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" +#define HO_CFG_STR_2 " (HO algo 2 only)\n" +#define HO_CFG_STR_MIN "Minimum Level/Quality thresholds before triggering HO" HO_CFG_STR_2 +#define HO_CFG_STR_AFS_BIAS "Configure bias to prefer AFS (AMR on TCH/F) over other codecs" HO_CFG_STR_2 +#define HO_CFG_STR_MIN_TCH "Minimum free TCH timeslots before cell is considered congested" HO_CFG_STR_2 +#define HO_CFG_STR_PENALTY_TIME "Set penalty times to wait between repeated handovers" HO_CFG_STR_2 #define as_is(x) (x) @@ -30,6 +36,33 @@ return arg? 1 : 0; } +static inline bool a2tdma(const char *arg) +{ + if (!strcmp(arg, "full")) + return true; + return false; +} + +static inline const char *tdma2a(bool val) +{ + return val? "full" : "subset"; +} + +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, * function declarations or definitions... It is of the format @@ -106,7 +139,104 @@ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ - + \ + HO_CFG_ONE_MEMBER(bool, as_active, 0, \ + "handover assignment", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ + "Disable in-call assignment\n" \ + "Enable in-call assignment\n") \ + \ + HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ + "handover congestion-check", "disabled|<1-60>", \ + a2congestion_check_interval, "%s", congestion_check_interval2a, \ + HO_CFG_STR_HANDOVER \ + "Configure congestion check interval" HO_CFG_STR_2 \ + "Disable congestion checking, do not handover based on cell overload\n" \ + "Congestion check interval in seconds\n") \ + \ + HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ + "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ + HO_CFG_STR_HANDOVER \ + "Define measurement set of TDMA frames" HO_CFG_STR_2 \ + "Full set of 102/104 TDMA frames\n" \ + "Sub set of 4 TDMA frames (SACCH)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxlev, -100, \ + "handover min rxlev", "<-110--50>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How weak may RxLev of an MS become before triggering HO\n" \ + "minimum RxLev (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxqual, 5, \ + "handover min rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How bad may RxQual of an MS become before triggering HO\n" \ + "minimum RxQual (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxlev, 0, \ + "handover afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxLev improvement bias for AFS over other codecs\n" \ + "Virtual RxLev improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxqual, 0, \ + "handover afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxQual improvement bias for AFS over other codecs\n" \ + "Virtual RxQual improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchf_min_slots, 0, \ + "handover min-free-slots tch/f", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/F timeslots before cell is considered congested\n" \ + "Number of TCH/F slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchh_min_slots, 0, \ + "handover min-free-slots tch/h", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/H timeslots before cell is considered congested\n" \ + "Number of TCH/H slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, ho_max, 9999, \ + "handover max-handovers", "<1-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum number of concurrent handovers allowed per cell" HO_CFG_STR_2 \ + "Number\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_max_dist, 300, \ + "handover penalty-time max-distance", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after leaving this cell due to exceeding max distance\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_ho, 60, \ + "handover penalty-time failed-ho", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after handover failure to this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_as, 60, \ + "handover penalty-time failed-assignment", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after assignment failure in this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, retries, 0, \ + "handover retries", "<0-9>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Immediately retry on handover/assignment failure" HO_CFG_STR_2 \ + "Number of retries\n") \ + /* Declare public API for handover cfg parameters... */ diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index e181797..5d5db05 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -143,30 +143,75 @@ handover power budget interval 23 ... !handover +OsmoBSC(config-net-bts)# ### Verify that 'min rxlev' value range stops at -50 +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node +OsmoBSC(config-net-bts)# handover min rxlev -111 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev -110 +OsmoBSC(config-net-bts)# handover min rxlev -50 +OsmoBSC(config-net-bts)# handover min rxlev -49 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev 50 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev default +% 'handover min rxlev' setting removed, now is -100 + OsmoBSC(config-net-bts)# ### Checking online help OsmoBSC(config-net-bts)# exit OsmoBSC(config-net)# list ... handover (0|1|default) + handover algorithm (1|2|default) handover window rxlev averaging (<1-10>|default) handover window rxqual averaging (<1-10>|default) handover window rxlev neighbor averaging (<1-10>|default) handover power budget interval (<1-99>|default) handover power budget hysteresis (<0-999>|default) handover maximum distance (<0-9999>|default) + handover assignment (0|1|default) + handover congestion-check (disabled|<1-60>|default) + handover tdma-measurement (full|subset|default) + handover min rxlev (<-110--50>|default) + handover min rxqual (<0-7>|default) + handover afs-bias rxlev (<0-20>|default) + handover afs-bias rxqual (<0-7>|default) + handover min-free-slots tch/f (<0-9999>|default) + handover min-free-slots tch/h (<0-9999>|default) + handover max-handovers (<1-9999>|default) + handover penalty-time max-distance (<0-99999>|default) + handover penalty-time failed-ho (<0-99999>|default) + handover penalty-time failed-assignment (<0-99999>|default) + handover retries (<0-9>|default) ... OsmoBSC(config-net)# handover? handover Handover options OsmoBSC(config-net)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + congestion-check Configure congestion check interval (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net)# handover window ? rxlev Received-Level averaging @@ -216,6 +261,85 @@ <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node +OsmoBSC(config-net)# handover congestion-check ? + disabled Disable congestion checking, do not handover based on cell overload + <1-60> Congestion check interval in seconds + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node + OsmoBSC(config-net)# ### Same on BTS level OsmoBSC(config-net)# bts 0 @@ -223,12 +347,27 @@ handover Handover options OsmoBSC(config-net-bts)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + congestion-check Configure congestion check interval (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net-bts)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net-bts)# handover window ? rxlev Received-Level averaging @@ -277,3 +416,82 @@ OsmoBSC(config-net-bts)# handover maximum distance ? <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover congestion-check ? + disabled Disable congestion checking, do not handover based on cell overload + <1-60> Congestion check interval in seconds + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net-bts)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net-bts)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net-bts)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net-bts)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:08 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Change debug category at handover decision: DHO -> DHODEC Message-ID: Review at https://gerrit.osmocom.org/5915 HO: Change debug category at handover decision: DHO -> DHODEC Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 --- M src/libbsc/handover_decision.c 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/5915/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 1e2e0d9..0693613 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -65,7 +65,7 @@ /* resolve the gsm_bts structure for the best neighbor */ new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic); if (!new_bts) { - LOGP(DHO, LOGL_NOTICE, "unable to determine neighbor BTS " + LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS " "for ARFCN %u BSIC %u ?!?\n", arfcn, bsic); return -EINVAL; } @@ -104,7 +104,7 @@ window = nmp->rxlev_cnt; /* this should never happen */ if (window <= 0) { - LOGP(DHO, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); + LOGP(DHODEC, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); return 0; } @@ -232,26 +232,26 @@ if (!best_cell) return 0; - LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", + LOGP(DHODEC, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", gsm_ts_name(mr->lchan->ts), best_cell->arfcn); if (!ho_get_ho_active(bts->ho)) { - LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n"); + LOGPC(DHODEC, LOGL_INFO, "Skipping, Handover disabled\n"); return 0; } rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); switch (rc) { case 0: - LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); + LOGPC(DHODEC, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); break; case -ENOSPC: - LOGPC(DHO, LOGL_INFO, "No channel available\n"); + LOGPC(DHODEC, LOGL_INFO, "No channel available\n"); break; case -EBUSY: - LOGPC(DHO, LOGL_INFO, "Handover already active\n"); + LOGPC(DHODEC, LOGL_INFO, "Handover already active\n"); break; default: - LOGPC(DHO, LOGL_ERROR, "Unknown error\n"); + LOGPC(DHODEC, LOGL_ERROR, "Unknown error\n"); } return rc; } -- To view, visit https://gerrit.osmocom.org/5915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:08 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:08 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Count number of free timeslot on a given BTS Message-ID: Review at https://gerrit.osmocom.org/5916 HO: Count number of free timeslot on a given BTS This is needed for handover algorithm to balance free slots and to prevent congestion of one cell, while other cells still have free capacities. Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b --- M include/osmocom/bsc/chan_alloc.h M src/libbsc/chan_alloc.c 2 files changed, 67 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/5916/1 diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index f2a75c5..748e9cd 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -24,6 +24,9 @@ struct gsm_subscriber_connection; +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan); + /* Allocate a logical channel (SDCCH, TCH, ...) */ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 9946628..b3056da 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -68,6 +68,70 @@ return true; } +static int trx_count_free_ts(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx_ts *ts; + int j, ss; + int count = 0; + + if (!trx_is_usable(trx)) + return 0; + + for (j = 0; j < 8; j++) { + enum gsm_phys_chan_config ts_pchan_is; + ts = &trx->ts[j]; + if (!ts_is_usable(ts)) + continue; + + ts_pchan_is = ts_pchan(ts); + + if (ts_pchan_is == GSM_PCHAN_PDCH) { + /* Dynamic timeslots in PDCH mode will become TCH if needed. */ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + continue; + + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + else if (pchan == GSM_PCHAN_TCH_H) + count += 2; + continue; + + default: + /* Not dynamic, not applicable. */ + continue; + } + } + + if (ts_pchan_is != pchan) + continue; + /* check if all sub-slots are allocated yet */ + for (ss = 0; ss < ts_subslots(ts); ss++) { + struct gsm_lchan *lc = &ts->lchan[ss]; + if (lc->type == GSM_LCHAN_NONE && + lc->state == LCHAN_S_NONE) + count++; + } + } + + return count; +} + +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx *trx; + int count = 0; + + llist_for_each_entry(trx, &bts->trx_list, list) + count += trx_count_free_ts(trx, pchan); + + return count; +} + static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, enum gsm_phys_chan_config dyn_as_pchan) -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:09 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:09 +0000 Subject: [PATCH] osmo-bsc[master]: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() Message-ID: Review at https://gerrit.osmocom.org/5917 HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() The name sounds like it is looking up neighbors, instead it simply traverses the global list of BTSes. Rename to reflect what it does. Move FIXME comment to its logical place: at the invocation of bts_by_arfcn_bsic(). Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd --- M src/libbsc/handover_decision.c 1 file changed, 13 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/5917/1 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 0693613..93ca28b 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -35,21 +35,16 @@ #include #include -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic) +/* Find BTS by ARFCN and BSIC */ +static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, + uint16_t arfcn, uint8_t bsic) { - struct gsm_bts *neigh; - /* FIXME: use some better heuristics here to determine which cell - * using this ARFCN really is closest to the target cell. For - * now we simply assume that each ARFCN will only be used by one - * cell */ + struct gsm_bts *bts; - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - /* FIXME: this is probably returning the same bts again!? */ - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->c0->arfcn == arfcn && + bts->bsic == bsic) + return bts; } return NULL; @@ -63,7 +58,11 @@ struct gsm_bts *new_bts; /* resolve the gsm_bts structure for the best neighbor */ - new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic); + /* FIXME: use some better heuristics here to determine which cell + * using this ARFCN really is closest to the target cell. For + * now we simply assume that each ARFCN will only be used by one + * cell */ + new_bts = bts_by_arfcn_bsic(lchan->ts->trx->bts->network, arfcn, bsic); if (!new_bts) { LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS " "for ARFCN %u BSIC %u ?!?\n", arfcn, bsic); -- To view, visit https://gerrit.osmocom.org/5917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:11 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:11 +0000 Subject: [PATCH] osmo-bsc[master]: HO: make bts_by_arfcn_bsic() public Message-ID: Review at https://gerrit.osmocom.org/5918 HO: make bts_by_arfcn_bsic() public Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 --- M include/osmocom/bsc/handover_decision.h M src/libbsc/handover_decision.c 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/5918/1 diff --git a/include/osmocom/bsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h index fe551ca..09430d8 100644 --- a/include/osmocom/bsc/handover_decision.h +++ b/include/osmocom/bsc/handover_decision.h @@ -1,3 +1,5 @@ #pragma once +struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, uint16_t arfcn, uint8_t bsic); + void handover_decision_1_init(void); diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 93ca28b..19fb3ab 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -36,8 +36,8 @@ #include /* Find BTS by ARFCN and BSIC */ -static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, - uint16_t arfcn, uint8_t bsic) +struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, + uint16_t arfcn, uint8_t bsic) { struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/5918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:12 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:12 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add queue to cache DTAP messages during handover/assignment Message-ID: Review at https://gerrit.osmocom.org/5919 HO: add queue to cache DTAP messages during handover/assignment Add ho_dtap_cache to gsm_subscriber_connection, a stock msgb queue to be used with msgb_enqueue() and msgb_dequeue(). Keep a counter of queue length, to enforce a sane maximum counter for cached messages. So far a hardcoded maximum of 23 messages will be cached. Have balanced ho_dtap_cache_add() and ho_dtap_cache_flush() functions. The original patch was by jolly, but I have basically completely replaced it with the simpler msgb queue pattern. Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c 2 files changed, 77 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/5919/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6659b72..4e07f26 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -100,6 +100,10 @@ /* buffer/cache for classmark of the ME of the subscriber */ struct gsm_classmark classmark; + + /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ + struct llist_head ho_dtap_cache; + unsigned int ho_dtap_cache_len; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 545cf36..2a0bf8f 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -39,6 +39,8 @@ #define GSM0808_T10_VALUE 6, 0 +#define HO_DTAP_CACHE_MSGB_CB_LINK_ID 0 +#define HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1 static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind); static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id); @@ -270,8 +272,52 @@ conn->lchan = lchan; conn->bts = lchan->ts->trx->bts; lchan->conn = conn; + INIT_LLIST_HEAD(&conn->ho_dtap_cache); llist_add_tail(&conn->entry, &net->subscr_conns); return conn; +} + +static void ho_dtap_cache_add(struct gsm_subscriber_connection *conn, struct msgb *msg, + int link_id, bool allow_sacch) +{ + if (conn->ho_dtap_cache_len >= 23) { + LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages," + " already reached sane maximum of %u cached messages\n", + bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); + msgb_free(msg); + return; + } + conn->ho_dtap_cache_len ++; + LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n", + bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); + msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id; + msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0; + msgb_enqueue(&conn->ho_dtap_cache, msg); +} + +static void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send) +{ + struct msgb *msg; + unsigned int flushed_count = 0; + + if (conn->secondary_lchan || conn->ho_lchan) { + LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, handover/assignment is still ongoing\n", + bsc_subscr_name(conn->bsub)); + send = 0; + } + + while ((msg = msgb_dequeue(&conn->ho_dtap_cache))) { + conn->ho_dtap_cache_len --; + flushed_count ++; + if (send) { + int link_id = (int)msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID]; + bool allow_sacch = !!msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH]; + LOGP(DHO, LOGL_DEBUG, "%s: Sending cached DTAP message after handover/assignment (%u/%u)\n", + bsc_subscr_name(conn->bsub), flushed_count, conn->ho_dtap_cache_len); + gsm0808_submit_dtap(conn, msg, link_id, allow_sacch); + } else + msgb_free(msg); + } } void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) @@ -297,6 +343,9 @@ conn->secondary_lchan->conn = NULL; } + /* drop pending messages */ + ho_dtap_cache_flush(conn, 0); + llist_del(&conn->entry); talloc_free(conn); } @@ -319,6 +368,12 @@ "Called submit dtap without an lchan.\n"); msgb_free(msg); return -1; + } + + /* buffer message during assignment / handover */ + if (conn->secondary_lchan || conn->ho_lchan) { + ho_dtap_cache_add(conn, msg, link_id, !! allow_sacch); + return 0; } sapi = link_id & 0x7; @@ -454,6 +509,9 @@ osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); /* FIXME: release old channel */ + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); + return; } @@ -475,6 +533,9 @@ lchan_release(conn->lchan, 0, RSL_REL_LOCAL_END); conn->lchan = conn->secondary_lchan; conn->secondary_lchan = NULL; + + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN) rsl_ipacc_crcx(conn->lchan); @@ -504,6 +565,9 @@ osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); /* FIXME: release allocated new channel */ + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); + return; } @@ -518,6 +582,9 @@ lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); conn->secondary_lchan = NULL; } + + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { @@ -584,6 +651,9 @@ sig.mr = NULL; osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); /* FIXME: release old channel */ + + /* send pending messages, if any */ + ho_dtap_cache_flush(msg->lchan->conn, 1); } /* Chapter 9.1.17 Handover Failure */ @@ -599,6 +669,9 @@ sig.mr = NULL; osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); /* FIXME: release allocated new channel */ + + /* send pending messages, if any */ + ho_dtap_cache_flush(msg->lchan->conn, 1); } -- To view, visit https://gerrit.osmocom.org/5919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:13 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Add a penalty timer list to the subscriber connection en... Message-ID: Review at https://gerrit.osmocom.org/5920 HO: Add a penalty timer list to the subscriber connection entity This penalty timer is used to temporarily block cells where handover or assignment failed or where handover is not allowed. This is usefull to prevent repeated handover attempts to broken cells or cells that have limited allowed distance. Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/20/5920/1 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 4e07f26..d9dd2d4 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -71,6 +71,13 @@ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +/* penalty timers for handover */ +struct ho_penalty_timer { + struct llist_head entry; + uint8_t bts; + time_t timeout; +}; + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -104,6 +111,9 @@ /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; + + /* penalty timers for handover */ + struct llist_head ho_penalty_timers; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 2a0bf8f..a501db2 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -273,6 +273,7 @@ conn->bts = lchan->ts->trx->bts; lchan->conn = conn; INIT_LLIST_HEAD(&conn->ho_dtap_cache); + INIT_LLIST_HEAD(&conn->ho_penalty_timers); llist_add_tail(&conn->entry, &net->subscr_conns); return conn; } @@ -322,6 +323,8 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { + struct ho_penalty_timer *penalty; + if (!conn) return; @@ -346,6 +349,13 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); + /* flush handover penalty timers */ + while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, + struct ho_penalty_timer, entry))) { + llist_del(&penalty->entry); + talloc_free(penalty); + } + llist_del(&conn->entry); talloc_free(conn); } -- To view, visit https://gerrit.osmocom.org/5920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:15 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:15 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c Message-ID: Review at https://gerrit.osmocom.org/5921 HO: Implement load based handover, as handover_decision_2.c Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M include/osmocom/bsc/handover.h M include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_decision_2.h M include/osmocom/bsc/handover_vty.h M include/osmocom/bsc/signal.h M src/libbsc/Makefile.am M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c A src/libbsc/handover_decision_2.c M src/libbsc/handover_logic.c M src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/gsm_data.c M src/libcommon/handover_cfg.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M tests/Makefile.am A tests/handover/Makefile.am A tests/handover/handover_test.c A tests/handover/handover_test.ok M tests/testsuite.at 27 files changed, 3,861 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/5921/1 diff --git a/configure.ac b/configure.ac index d756970..fc4678f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,7 @@ tests/subscr/Makefile tests/nanobts_omlattr/Makefile tests/bssap/Makefile + tests/handover/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 699aeb3..a3d9adf 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -27,6 +27,7 @@ handover.h \ handover_cfg.h \ handover_decision.h \ + handover_decision_2.h \ handover_vty.h \ ipaccess.h \ meas_feed.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..c24e22a 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -74,8 +75,8 @@ /* penalty timers for handover */ struct ho_penalty_timer { struct llist_head entry; - uint8_t bts; - time_t timeout; + uint8_t bts_nr; + unsigned int timeout; }; /* active radio connection of a mobile subscriber */ @@ -112,8 +113,18 @@ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; - /* penalty timers for handover */ + /* failure count and penalty timers for handover */ + int ho_failure; struct llist_head ho_penalty_timers; + + /* "Codec List (MSC Preferred)" as received by the BSSAP Assignment Request. 3GPP 48.008 + * 3.2.2.103 says: + * The "Codec List (MSC Preferred)" shall not include codecs + * that are not supported by the MS. + * i.e. by heeding the "Codec list (MSC Preferred)", we inherently heed the MS bearer + * capabilities, which the MSC is required to translate into the codec list. */ + struct gsm0808_speech_codec_list codec_list; + bool codec_list_present; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { @@ -243,7 +254,12 @@ uint16_t network_code; int a5_encryption; int neci; + struct handover_cfg *ho; + struct { + unsigned int congestion_check_interval_s; + struct osmo_timer_list congestion_check_timer; + } ho2; struct rate_ctr_group *bsc_ctrs; @@ -443,4 +459,11 @@ bool classmark_is_r99(struct gsm_classmark *cm); +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout); +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 86c5ca9..776e047 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -269,6 +269,7 @@ struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; + uint8_t meas_rep_last_seen_nr; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index a9349ee..f764456 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -5,6 +5,8 @@ struct gsm_subscriber_connection; int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *bts, + enum gsm_chan_t new_lchan_type); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 1b81235..7ef27ee 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -10,6 +10,8 @@ * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ struct handover_cfg; +#define HO_CFG_CONGESTION_CHECK_DEFAULT 10 + struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); #define HO_CFG_STR_HANDOVER "Handover options\n" @@ -46,22 +48,6 @@ static inline const char *tdma2a(bool val) { return val? "full" : "subset"; -} - -static inline const int a2congestion_check_interval(const char *arg) -{ - if (!strcmp(arg, "disabled")) - return 0; - return atoi(arg); -} - -static inline const char *congestion_check_interval2a(int val) -{ - static char str[9]; - if (val < 1 - || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) - return "disabled"; - return str; } /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, @@ -146,14 +132,6 @@ "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ "Disable in-call assignment\n" \ "Enable in-call assignment\n") \ - \ - HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ - "handover congestion-check", "disabled|<1-60>", \ - a2congestion_check_interval, "%s", congestion_check_interval2a, \ - HO_CFG_STR_HANDOVER \ - "Configure congestion check interval" HO_CFG_STR_2 \ - "Disable congestion checking, do not handover based on cell overload\n" \ - "Congestion check interval in seconds\n") \ \ HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ diff --git a/include/osmocom/bsc/handover_decision_2.h b/include/osmocom/bsc/handover_decision_2.h new file mode 100644 index 0000000..f245b07 --- /dev/null +++ b/include/osmocom/bsc/handover_decision_2.h @@ -0,0 +1,9 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC */ + +#pragma once +struct gsm_bts; + +void hodec2_init(struct gsm_network *net); + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval); +void hodec2_congestion_check(struct gsm_network *net); diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h index 48af136..6ad5276 100644 --- a/include/osmocom/bsc/handover_vty.h +++ b/include/osmocom/bsc/handover_vty.h @@ -4,4 +4,5 @@ #include void ho_vty_init(); -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); +void ho_vty_write_net(struct vty *vty, struct gsm_network *net); +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts); diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 9c0d5a3..1c8b51e 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -104,6 +104,7 @@ enum signal_global { S_GLOBAL_BTS_CLOSE_OM, + S_GLOBAL_BTS_NEW, }; /* SS_RF signals */ diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index d118f44..7e088e5 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -58,5 +58,6 @@ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ handover_vty.c \ + handover_decision_2.c \ $(NULL) diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index bdd86a9..82b21b9 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1523,8 +1523,9 @@ } mr->lchan->meas_rep_count++; - LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", - gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + mr->lchan->meas_rep_last_seen_nr = mr->nr; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_count++=%d meas_rep_last_seen_nr=%u\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count, mr->lchan->meas_rep_last_seen_nr); print_meas_rep(msg->lchan, mr); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a501db2..73bdee5 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -323,8 +323,6 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { - struct ho_penalty_timer *penalty; - if (!conn) return; @@ -349,12 +347,7 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); - /* flush handover penalty timers */ - while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, - struct ho_penalty_timer, entry))) { - llist_del(&penalty->entry); - talloc_free(penalty); - } + conn_penalty_timer_clear(conn, NULL); llist_del(&conn->entry); talloc_free(conn); @@ -672,8 +665,8 @@ struct lchan_signal_data sig; struct gsm48_hdr *gh = msgb_l3(msg); - DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", - rr_cause_name(gh->data[0])); + DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + DEBUGP(DHO, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); sig.lchan = msg->lchan; sig.mr = NULL; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index a304e86..d4591b7 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -795,7 +795,7 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); - ho_vty_write(vty, " ", bts->ho); + ho_vty_write_bts(vty, bts); config_write_bts_model(vty, bts); } @@ -827,7 +827,7 @@ vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - ho_vty_write(vty, " ", gsmnet->ho); + ho_vty_write_net(vty, gsmnet); VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index b3056da..95a9fdd 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -132,6 +132,7 @@ return count; } + static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, enum gsm_phys_chan_config dyn_as_pchan) @@ -414,6 +415,7 @@ /* reset measurement report counter and index */ lchan->meas_rep_count = 0; lchan->meas_rep_idx = 0; + lchan->meas_rep_last_seen_nr = 255; /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/handover_decision_2.c b/src/libbsc/handover_decision_2.c new file mode 100644 index 0000000..2286147 --- /dev/null +++ b/src/libbsc/handover_decision_2.c @@ -0,0 +1,1761 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC. */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Andreas Eversberg + * Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOGPHOBTS(bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) + +#define LOGPHOLCHAN(lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_bts->nr, \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define REQUIREMENT_A_TCHF 0x01 +#define REQUIREMENT_B_TCHF 0x02 +#define REQUIREMENT_C_TCHF 0x04 +#define REQUIREMENT_A_TCHH 0x10 +#define REQUIREMENT_B_TCHH 0x20 +#define REQUIREMENT_C_TCHH 0x40 +#define REQUIREMENT_TCHF_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_B_TCHF | REQUIREMENT_C_TCHF) +#define REQUIREMENT_TCHH_MASK (REQUIREMENT_A_TCHH | REQUIREMENT_B_TCHH | REQUIREMENT_C_TCHH) +#define REQUIREMENT_A_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_A_TCHH) +#define REQUIREMENT_B_MASK (REQUIREMENT_B_TCHF | REQUIREMENT_B_TCHH) +#define REQUIREMENT_C_MASK (REQUIREMENT_C_TCHF | REQUIREMENT_C_TCHH) + +struct ho_candidate { + struct gsm_lchan *lchan; /* candidate for whom */ + struct gsm_bts *bts; /* target BTS */ + uint8_t requirements; /* what is fulfilled */ + int avg; /* average RX level */ +}; + +enum ho_reason { + HO_REASON_INTERFERENCE, + HO_REASON_BAD_QUALITY, + HO_REASON_LOW_RXLEVEL, + HO_REASON_MAX_DISTANCE, + HO_REASON_BETTER_CELL, + HO_REASON_CONGESTION, +}; + +static const struct value_string ho_reason_names[] = { + { HO_REASON_INTERFERENCE, "interference (bad quality)" }, + { HO_REASON_BAD_QUALITY, "bad quality" }, + { HO_REASON_LOW_RXLEVEL, "low rxlevel" }, + { HO_REASON_MAX_DISTANCE, "maximum allowed distance" }, + { HO_REASON_BETTER_CELL, "better cell" }, + { HO_REASON_CONGESTION, "congestion" }, + {0, NULL} +}; + +static const char *ho_reason_name(int value) +{ + return get_value_string(ho_reason_names, value); +} + + +static bool ho2_initialized = false; +static enum ho_reason global_ho_reason; + +static void congestion_check_cb(void *arg); + +/* This function gets called on ho2 init, whenever the congestion check interval is changed, and also + * when the timer has fired to trigger again after the next congestion check timeout. */ +static void reinit_congestion_timer(struct gsm_network *net) +{ + int congestion_check_interval_s; + bool was_active; + + /* Don't setup timers from VTY config parsing before the main program has actually initialized + * the data structures. */ + if (!ho2_initialized) + return; + + was_active = net->ho2.congestion_check_timer.active; + if (was_active) + osmo_timer_del(&net->ho2.congestion_check_timer); + + congestion_check_interval_s = net->ho2.congestion_check_interval_s; + if (congestion_check_interval_s < 1) { + if (was_active) + LOGP(DHODEC, LOGL_NOTICE, "HO algorithm 2: Disabling congestion check\n"); + return; + } + + LOGP(DHODEC, LOGL_DEBUG, "HO algorithm 2: next periodical congestion check in %u seconds\n", + congestion_check_interval_s); + + osmo_timer_setup(&net->ho2.congestion_check_timer, + congestion_check_cb, net); + osmo_timer_schedule(&net->ho2.congestion_check_timer, + congestion_check_interval_s, 0); +} + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval) +{ + net->ho2.congestion_check_interval_s = new_interval; + reinit_congestion_timer(net); +} + +/* did we get a RXLEV for a given cell in the given report? Mark matches as MRC_F_PROCESSED. */ +static struct gsm_meas_rep_cell *cell_in_rep(struct gsm_meas_rep *mr, uint16_t arfcn, uint8_t bsic) +{ + int i; + + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + + if (mrc->arfcn != arfcn) + continue; + if (mrc->bsic != bsic) + continue; + + return mrc; + } + return NULL; +} + +/* obtain averaged rxlev for given neighbor */ +static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window) +{ + unsigned int i, idx; + int avg = 0; + + /* reduce window to the actual number of existing measurements */ + if (window > nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window <= 0) + return 0; + + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), + nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), + window); + + for (i = 0; i < window; i++) { + int j = (idx+i) % ARRAY_SIZE(nmp->rxlev); + + avg += nmp->rxlev[j]; + } + + return avg / window; +} + +/* Find empty slot or the worst neighbor. */ +static struct neigh_meas_proc *find_unused_or_worst_neigh(struct gsm_lchan *lchan) +{ + struct neigh_meas_proc *nmp_worst = NULL; + int worst; + int j; + + /* First try to find an empty/unused slot. */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + if (!nmp->arfcn) + return nmp; + } + + /* No empty slot found. Return worst neighbor to be evicted. */ + worst = 0; /* (overwritten on first loop, but avoid compiler warning) */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + int avg = neigh_meas_avg(nmp, MAX_WIN_NEIGH_AVG); + if (nmp_worst && avg >= worst) + continue; + worst = avg; + nmp_worst = nmp; + } + + return nmp_worst; +} + +/* process neighbor cell measurement reports */ +static void process_meas_neigh(struct gsm_meas_rep *mr) +{ + int i, j, idx; + + /* for each reported cell, try to update global state */ + for (j = 0; j < ARRAY_SIZE(mr->lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &mr->lchan->neigh_meas[j]; + unsigned int idx; + struct gsm_meas_rep_cell *mrc; + + /* skip unused entries */ + if (!nmp->arfcn) + continue; + + mrc = cell_in_rep(mr, nmp->arfcn, nmp->bsic); + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + if (mrc) { + nmp->rxlev[idx] = mrc->rxlev; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + mrc->flags |= MRC_F_PROCESSED; + } else { + nmp->rxlev[idx] = 0; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr); + } + nmp->rxlev_cnt++; + } + + /* iterate over list of reported cells, check if we did not + * process all of them */ + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + struct neigh_meas_proc *nmp; + + if (mrc->flags & MRC_F_PROCESSED) + continue; + + nmp = find_unused_or_worst_neigh(mr->lchan); + + nmp->arfcn = mrc->arfcn; + nmp->bsic = mrc->bsic; + + nmp->rxlev_cnt = 0; + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + nmp->rxlev[idx] = mrc->rxlev; + nmp->rxlev_cnt++; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u new in report rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + + mrc->flags |= MRC_F_PROCESSED; + } +} + +static bool codec_type_is_supported(struct gsm_subscriber_connection *conn, + enum gsm0808_speech_codec_type type) +{ + int i; + struct gsm0808_speech_codec_list *clist = &conn->codec_list; + + if (!conn->codec_list_present) { + /* We don't have a list of supported codecs. This should never happen. */ + LOGPHOLCHAN(conn->lchan, LOGL_ERROR, + "No Speech Codec List present, accepting all codecs\n"); + return true; + } + + for (i = 0; i < clist->len; i++) { + if (clist->codec[i].type == type) { + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", + gsm0808_speech_codec_type_name(type)); + return true; + } + } + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", + gsm0808_speech_codec_type_name(type)); + return false; +} + +/* + * Check what requirements the given cell fulfills. + * A bit mask of fulfilled requirements is returned. + * + * Target cell requirement A -- ability to service the call + * + * In order to successfully handover/assign to a better cell, the target cell + * must be able to continue the current call. Therefore the cell must fulfill + * the following criteria: + * + * * The handover must be enabled for the target cell, if it differs from the + * originating cell. + * * The assignment must be enabled for the cell, if it equals the current + * cell. + * * The handover penalty timer must not run for the cell. + * * If FR, EFR or HR codec is used, the cell must support this codec. + * * If FR or EFR codec is used, the cell must have a TCH/F slot type + * available. + * * If HR codec is used, the cell must have a TCH/H slot type available. + * * If AMR codec is used, the cell must have a TCH/F slot available, if AFS + * is supported by mobile and BTS. + * * If AMR codec is used, the cell must have a TCH/H slot available, if AHS + * is supported by mobile and BTS. + * * osmo-nitb with built-in MNCC application: + * o If AMR codec is used, the cell must support AMR codec with equal codec + * rate or rates. (not meaning TCH types) + * * If defined, the number of maximum unsynchronized handovers to this cell + * may not be exceeded. (This limits processing load for random access + * bursts.) + * + * + * Target cell requirement B -- avoid congestion + * + * In order to prevent congestion of a target cell, the cell must fulfill the + * requirement A, but also: + * + * * The minimum free channels, that are defined for that cell must be + * maintained after handover/assignment. + * * The minimum free channels are defined for TCH/F and TCH/H slot types + * individually. + * + * + * Target cell requirement C -- balance congestion + * + * In order to balance congested cells, the target cell must fulfill the + * requirement A, but also: + * + * * The target cell (which is congested also) must have more or equal free + * slots after handover/assignment. + * * The number of free slots are checked for TCH/F and TCH/H slot types + * individually. + */ +static uint8_t check_requirements(struct gsm_lchan *lchan, struct gsm_bts *bts, int tchf_count, int tchh_count) +{ + int count; + uint8_t requirement = 0; + unsigned int penalty_time; + struct gsm_bts *current_bts = lchan->ts->trx->bts; + + /* Requirement A */ + + /* the handover/assignment must not be disabled */ + if (current_bts == bts) { + if (!ho_get_as_active(bts->ho)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Assignment disabled\n"); + return 0; + } + } else { + if (!ho_get_ho_active(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, handover is disabled in target BTS\n"); + return 0; + } + } + + /* the handover penalty timer must not run for this bts */ + penalty_time = conn_penalty_timer_remaining(lchan->conn, bts); + if (penalty_time) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, target BTS still in penalty time" + " (%u seconds left)\n", penalty_time); + return 0; + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + + /* compatibility check for codecs. + * if so, the candidates for full rate and half rate are selected */ + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_V1: + switch (lchan->type) { + case GSM_LCHAN_TCH_F: /* mandatory */ + requirement |= REQUIREMENT_A_TCHF; + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + case GSM_LCHAN_TCH_H: + if (!bts->codec.hr) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "tch_mode='%s' type='%s' not supported\n", + get_value_string(gsm48_chan_mode_names, + lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR1)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHAN(lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode)); + return 0; + } + break; + case GSM48_CMODE_SPEECH_EFR: + if (!bts->codec.efr) { + LOGPHOBTS(bts, LOGL_DEBUG, "EFR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR2)) + requirement |= REQUIREMENT_A_TCHF; + break; + case GSM48_CMODE_SPEECH_AMR: + if (!bts->codec.amr) { + LOGPHOBTS(bts, LOGL_DEBUG, "AMR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR3)) + requirement |= REQUIREMENT_A_TCHF; + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR3)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "Not even considering: src is not a SPEECH mode lchan\n"); + return 0; + } + + /* no candidate, because new cell is incompatible */ + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because codec of MS and BTS are incompatible\n"); + return 0; + } + + /* remove slot types that are not available */ + if (!tchf_count && requirement & REQUIREMENT_A_TCHF) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, since all TCH/F lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + } + if (!tchh_count && requirement & REQUIREMENT_A_TCHH) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, since all TCH/H lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because no suitable slots available\n"); + return 0; + } + + /* omit same channel type on same BTS (will not change anything) */ + if (bts == current_bts) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, already on TCH/F in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + break; + case GSM_LCHAN_TCH_H: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, already on TCH/H in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Reassignment within cell not an option, no differing channel types available\n"); + return 0; + } + } + +#ifdef LEGACY + // This was useful in osmo-nitb. We're in osmo-bsc now and have no idea whether the osmo-msc does + // internal or external call control. Maybe a future config switch wants to add this behavior? + /* Built-in call control requires equal codec rates. Remove rates that are not equal. */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && current_bts->network->mncc_recv != mncc_sock_from_cc) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_full, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_full, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + case GSM_LCHAN_TCH_H: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_half, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_half, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, cannot provide identical codec rate\n"); + return 0; + } + } +#endif + + /* the maximum number of unsynchonized handovers must no be exceeded */ + if (current_bts != bts + && bsc_ho_count(bts, true) >= ho_get_ho_max(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, number of allowed handovers (%d) would be exceeded\n", + ho_get_ho_max(bts->ho)); + return 0; + } + + /* Requirement B */ + + /* the minimum free timeslots that are defined for this cell must + * be maintained _after_ handover/assignment */ + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= ho_get_tchf_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be congested after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= ho_get_tchh_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be congested after HO\n"); + } + } + + /* Requirement C */ + + /* the nr of free timeslots of the target cell must be >= the + * free slots of the current cell _after_ handover/assignment */ + count = bts_count_free_ts(current_bts, + (lchan->type == GSM_LCHAN_TCH_H) ? + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be less congested in target than source cell after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be less congested in target than source cell after HO\n"); + } + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); + + /* return mask of fulfilled requirements */ + return requirement; +} + +/* Trigger handover or assignment depending on the target BTS */ +static int trigger_handover_or_assignment(struct gsm_lchan *lchan, struct gsm_bts *new_bts, uint8_t requirements) +{ + struct gsm_bts *current_bts = lchan->ts->trx->bts; + int afs_bias = 0; + bool full_rate = false; + + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); + + /* afs_bias becomes > 0, if AFS is used and is improved */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + afs_bias = ho_get_afs_bias_rxlev(new_bts->ho); + + /* select TCH rate, prefer TCH/F if AFS is improved */ + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + /* keep on full rate, if TCH/F is a candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK)) { + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + full_rate = true; + break; + } + /* change to half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + break; + case GSM_LCHAN_TCH_H: + /* change to full rate if AFS is improved and a candidate */ + if (afs_bias > 0 && (requirements & REQUIREMENT_TCHF_MASK)) { + full_rate = true; + LOGPHOLCHAN(lchan, LOGL_DEBUG, "[Improve AHS->AFS]\n"); + break; + } + /* change to full rate if the only candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK) + && !(requirements & REQUIREMENT_TCHH_MASK)) { + full_rate = true; + break; + } + /* keep on half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + break; + default: + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, "lchan is neither TCH/F nor TCH/H, aborting ho/as\n"); + return -EINVAL; + } + + /* trigger handover or assignment */ + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering assignment to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + "Triggering handover to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + + return bsc_handover_start_lchan_change(lchan, current_bts == new_bts? NULL : new_bts, + full_rate? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H); +} + +/* debug collected candidates */ +static inline void debug_candidate(struct ho_candidate *candidate, + int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +{ + if (neighbor) + LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " + "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), + rxlev2dbm(candidate->avg)); + else + LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", + candidate->bts->nr, rxlev2dbm(candidate->avg)); + + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " + "%d\n", tchf_count, ho_get_tchf_min_slots(candidate->bts->ho)); + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " + "%d\n", tchh_count, ho_get_tchh_min_slots(candidate->bts->ho)); + + if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); + if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) + == REQUIREMENT_A_TCHF) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); + + if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); + if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) + == REQUIREMENT_A_TCHH) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); +} + +/* add candidate for re-assignment within the current cell */ +static void collect_assignment_candidate(struct gsm_lchan *lchan, struct ho_candidate *clist, + unsigned int *candidates, int av_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct ho_candidate *c; + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = bts; + c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); + c->avg = av_rxlev; + debug_candidate(c, 0, 0, tchf_count, tchh_count); + (*candidates)++; +} + +/* add candidates for handover to all neighbor cells */ +static void collect_handover_candidate(struct gsm_lchan *lchan, struct neigh_meas_proc *nmp, + struct ho_candidate *clist, unsigned int *candidates, + bool include_weaker_rxlev, int av_rxlev, + int *neighbors_count) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct gsm_bts *neighbor_bts; + int avg; + struct ho_candidate *c; + int min_rxlev; + + /* skip empty slots */ + if (nmp->arfcn == 0) + return; + + if (neighbors_count) + (*neighbors_count)++; + + /* skip if measurement report is old */ + if (nmp->last_seen_nr != lchan->meas_rep_last_seen_nr) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "neighbor ARFCN %u measurement report is old" + " (nmp->last_seen_nr=%u lchan->meas_rep_last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr, lchan->meas_rep_last_seen_nr); + return; + } + + neighbor_bts = bts_by_arfcn_bsic(bts->network, nmp->arfcn, nmp->bsic); + if (!neighbor_bts) { + LOGPHOBTS(bts, LOGL_DEBUG, "neighbor ARFCN %u does not belong to this network\n", + nmp->arfcn); + return; + } + + /* in case we have measurements of our bts, due to misconfiguration */ + if (neighbor_bts == bts) { + LOGPHOBTS(bts, LOGL_ERROR, "Configuration error: this BTS appears as its own neighbor\n"); + return; + } + + /* caculate average rxlev for this cell over the window */ + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); + + /* Heed rxlev hysteresis only if the RXLEV/RXQUAL/TA levels of the MS aren't critically bad and + * we're just looking for an improvement. If levels are critical, we desperately need a handover + * and thus skip the hysteresis check. */ + if (!include_weaker_rxlev) { + unsigned int pwr_hyst = ho_get_pwr_hysteresis(bts->ho); + if (avg <= (av_rxlev + pwr_hyst)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " or equal than current RX level (%d) + hysteresis (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), rxlev2dbm(av_rxlev), pwr_hyst); + return; + } + } + + /* if the minimum level is not reached */ + min_rxlev = ho_get_min_rxlev(neighbor_bts->ho); + if (rxlev2dbm(avg) < min_rxlev) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " than its minimum required RX level (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), min_rxlev); + return; + } + + tchf_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_H); + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = neighbor_bts; + c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, + tchh_count); + c->avg = avg; + debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + (*candidates)++; +} + +static void collect_candidates_for_lchan(struct gsm_lchan *lchan, + struct ho_candidate *clist, unsigned int *candidates, + int *_av_rxlev, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev; + unsigned int candidates_was; + bool assignment; + bool handover; + int neighbors_count = 0; + unsigned int rxlev_avg_win = ho_get_rxlev_avg_win(bts->ho); + + OSMO_ASSERT(candidates); + candidates_was = *candidates; + + /* caculate average rxlev for this cell over the window */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + rxlev_avg_win); + if (_av_rxlev) + *_av_rxlev = av_rxlev; + + /* in case there is no measurment report (yet) */ + if (av_rxlev < 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Not collecting candidates, not enough measurements" + " (got %d, want %u)\n", + lchan->meas_rep_count, rxlev_avg_win); + return; + } + + assignment = ho_get_as_active(bts->ho); + handover = ho_get_ho_active(bts->ho); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", + assignment ? " Assignment" : "", + assignment && handover ? " and" : "", + handover ? " Handover" : ""); + + if (assignment) + collect_assignment_candidate(lchan, clist, candidates, av_rxlev); + + if (handover) { + int i; + for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++) { + collect_handover_candidate(lchan, &lchan->neigh_meas[i], + clist, candidates, + include_weaker_rxlev, av_rxlev, &neighbors_count); + } + } + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", + *candidates - candidates_was, neighbors_count, *candidates); +} + +/* + * Search for a alternative / better cell. + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * + * If one or more 'better cells' are available, check the current and neighbor + * cell measurements in descending order of their RX levels (down-link): + * + * * Select the best candidate that fulfills requirement B (no congestion + * after handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, do not perform handover nor + * assignment. + * + * If the RX level (down-link) or RX quality (down-link) of the current cell is + * below minimum acceptable level, or if the maximum allowed timing advance is + * reached or exceeded, check the RX levels (down-link) of the current and + * neighbor cells in descending order of their levels: (bad BTS case) + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, select the best candidate that + * fulfills requirement A (ignore congestion after handover or assignment) + * and trigger handover or assignment. + * * If no candidate fulfills requirement A, do not perform handover nor + * assignment. + * + * RX levels (down-link) of current and neighbor cells: + * + * * The RX levels of the current cell and neighbor cells are improved by a + * given offset, if AFS (AMR on TCH/F) is used or is a candidate for + * handover/assignment. + * * If AMR is used, the requirement for handover is checked for TCH/F and + * TCH/H. Both results (if any) are used as a candidate. + * * If AMR is used, the requirement for assignment to a different TCH slot + * rate is checked. The result (if available) is used as a candidate. + * + * If minimum RXLEV, minimum RXQUAL or maximum TA are exceeded, the caller should pass + * include_weaker_rxlev=true so that handover is performed despite congestion. + */ +static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int ahs = (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && lchan->type == GSM_LCHAN_TCH_H); + int av_rxlev; + struct ho_candidate clist[1 + ARRAY_SIZE(lchan->neigh_meas)]; + unsigned int candidates = 0; + int i; + struct ho_candidate *best_cand = NULL; + unsigned int best_better_db; + bool best_applied_afs_bias = false; + int better; + + /* check for disabled handover/assignment at the current cell */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGP(DHODEC, LOGL_INFO, "Skipping, Handover and Assignment both disabled in this cell\n"); + return 0; + } + + collect_candidates_for_lchan(lchan, clist, &candidates, &av_rxlev, include_weaker_rxlev); + + /* If assignment is disabled and no neighbor cell report exists, or no neighbor cell qualifies, + * we may not even have any candidates. */ + if (!candidates) + goto no_candidates; + + /* select best candidate that fulfills requirement B: no congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_B_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); + } + + /* select best candidate that fulfills requirement C: less or equal congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_C_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); + } + + /* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're avoiding congestion. */ + if (!include_weaker_rxlev) + goto no_candidates; + + /* Select best candidate that fulfills requirement A: can service the call. + * From above we know that there are no options that avoid congestion. Here we're trying to find + * *any* free lchan that has no critically low RXLEV and is able to handle the MS. */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_A_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_A_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d" + " with greater congestion found%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_A_MASK); + } + + /* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec + * restrictions or because all lchans are taken. */ + +no_candidates: + if (include_weaker_rxlev) + LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n"); + else + LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n"); + + return 0; +} + +/* + * Handover/assignment check, if measurement report is received + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. + * + * In case of handover triggered because maximum allowed timing advance is + * exceeded, the handover penalty timer is started for the originating cell. + * + */ +static int attempt_handover_after_mr(struct gsm_meas_rep *mr) +{ + struct gsm_lchan *lchan = mr->lchan; + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev = -EINVAL, av_rxqual = -EINVAL; + int rc; + + /* we currently only do handover for TCH channels */ + switch (mr->lchan->type) { + case GSM_LCHAN_TCH_F: + case GSM_LCHAN_TCH_H: + break; + default: + return 0; + } + + /* parse actual neighbor cell info */ + if (mr->num_cell > 0 && mr->num_cell < 7) + process_meas_neigh(mr); + + /* check for ongoing handover/assignment */ + if (!lchan->conn) { + LOGPHOLCHAN(lchan, LOGL_ERROR, "Skipping, No subscriber connection???\n"); + return 0; + } + if (lchan->conn->secondary_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Initial Assignment is still ongoing\n"); + return 0; + } + if (lchan->conn->ho_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Handover already triggered\n"); + return 0; + } + + /* get average levels. if not enought measurements yet, value is < 0 */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + ho_get_rxlev_avg_win(bts->ho)); + av_rxqual = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, + ho_get_rxqual_avg_win(bts->ho)); + if (av_rxlev < 0 && av_rxqual < 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measuements\n"); + return 0; + } + if (av_rxlev >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", + rxlev2dbm(av_rxlev)); + } + if (av_rxqual >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", + av_rxqual); + } + + /* improve levels in case of AFS, if defined */ + if (lchan->type == GSM_LCHAN_TCH_F + && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int rxlev_bias = ho_get_afs_bias_rxlev(bts->ho); + int rxqual_bias = ho_get_afs_bias_rxqual(bts->ho); + if (av_rxlev >= 0 && rxlev_bias) { + int imp = av_rxlev + rxlev_bias; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); + av_rxlev = imp; + } + if (av_rxqual >= 0 && rxqual_bias) { + int imp = av_rxqual - rxqual_bias; + if (imp < 0) + imp = 0; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); + av_rxqual = imp; + } + } + + /* Bad Quality */ + if (av_rxqual >= 0 && av_rxqual > ho_get_min_rxqual(bts->ho)) { + if (rxlev2dbm(av_rxlev) > -85) { + global_ho_reason = HO_REASON_INTERFERENCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment" + " due to interference (bad quality)\n"); + } else { + global_ho_reason = HO_REASON_BAD_QUALITY; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment due to bad quality\n"); + } + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Low Level */ + if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_min_rxlev(bts->ho)) { + global_ho_reason = HO_REASON_LOW_RXLEVEL; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Max Distance */ + if (lchan->meas_rep_count > 0 + && lchan->rqd_ta > ho_get_max_distance(bts->ho)) { + global_ho_reason = HO_REASON_MAX_DISTANCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + /* start penalty timer to prevent comming back too + * early. it must be started before selecting a better cell, + * so there is no assignment selected, due to running + * penalty timer. */ + conn_penalty_timer_add(lchan->conn, bts, ho_get_penalty_max_dist(bts->ho)); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* try handover to a better cell */ + if (av_rxlev >= 0 && (mr->nr % ho_get_pwr_interval(bts->ho)) == 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); + global_ho_reason = HO_REASON_BETTER_CELL; + rc = find_alternative_lchan(lchan, false); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + return 0; +} + +/* + * Handover/assignment check after timer timeout: + * + * Even if handover process tries to prevent a congestion, a cell might get + * congested due to new call setups or handovers to prevent loss of radio link. + * A cell is congested, if not the minimum number of free slots are available. + * The minimum number can be defined for TCH/F and TCH/H individually. + * + * Do not perform congestion check, if no minimum free slots are defined for + * a cell. + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * Only check candidates that will solve/reduce congestion. + * + * If a cell is congested, all slots are checked for all their RX levels + * (down-link) of the current and neighbor cell measurements in descending + * order of their RX levels: + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment), trigger handover or assignment. Candidates that will + * cause an assignment from AHS (AMR on TCH/H) to AFS (AMR on TCH/F) are + * omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement B, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the best candidates that fulfill requirement C (less or equally + * congested cells after handover/assignment), trigger handover or + * assignment. Candidates that will cause an assignment from AHS (AMR on + * TCH/H) to AFS (AMR on TCH/F) are omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement C, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. + */ +static int bts_resolve_congestion(struct gsm_bts *bts, int tchf_congestion, int tchh_congestion) +{ + struct gsm_lchan *lc; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + int i, j; + struct ho_candidate *clist; + unsigned int candidates; + struct ho_candidate *best_cand = NULL, *worst_cand = NULL; + struct gsm_lchan *delete_lchan = NULL; + unsigned int best_avg_db, worst_avg_db; + int avg; + int rc = 0; + int any_ho = 0; + int is_improved = 0; + + if (tchf_congestion < 0) + tchf_congestion = 0; + if (tchh_congestion < 0) + tchh_congestion = 0; + + LOGPHOBTS(bts, LOGL_INFO, "congested: %d TCH/F and %d TCH/H should be moved\n", + tchf_congestion, tchh_congestion); + + /* allocate array of all bts */ + clist = talloc_zero_array(tall_bsc_ctx, struct ho_candidate, + bts->num_trx * 8 * 2 * (1 + ARRAY_SIZE(lc->neigh_meas))); + if (!clist) + return 0; + + candidates = 0; + + /* loop through all active lchan and collect candidates */ + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx_is_usable(trx)) + continue; + + for (i = 0; i < 8; i++) { + ts = &trx->ts[i]; + if (!ts_is_usable(ts)) + continue; + + /* (Do not consider dynamic TS that are in PDCH mode) */ + switch (ts_pchan(ts)) { + case GSM_PCHAN_TCH_F: + lc = &ts->lchan[0]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_F + || lc->state != LCHAN_S_ACTIVE) + break; + /* omit if there is an ongoing ho/as */ + if (!lc->conn || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + break; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + break; + case GSM_PCHAN_TCH_H: + for (j = 0; j < 2; j++) { + lc = &ts->lchan[j]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_H + || lc->state != LCHAN_S_ACTIVE) + continue; + /* omit of there is an ongoing ho/as */ + if (!lc->conn + || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + continue; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + } + break; + default: + break; + } + } + } + + if (!candidates) { + LOGPHOBTS(bts, LOGL_DEBUG, "No neighbor cells qualify to solve congestion\n"); + goto exit; + } + LOGPHOBTS(bts, LOGL_DEBUG, "Considering %u candidates to solve congestion\n", candidates); + +#if 0 +next_b1: +#endif + /* select best candidate that fulfills requirement B, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, + "Best candidate BTS %u (RX level %d) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_b1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_b2: +#endif + /* select worst candidate that fulfills requirement B, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + best_cand = NULL; + goto next_b2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c1: +#endif + /* select best candidate that fulfills requirement C, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Best candidate BTS %d (RX level %d) " + "with less or equal congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_c1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c2: +#endif + /* select worst candidate that fulfills requirement C, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + worst_cand = NULL; + goto next_c2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +exit: + /* free array */ + talloc_free(clist); + + if (tchf_congestion <= 0 && tchh_congestion <= 0) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d solved!\n", + bts->nr); + else if (any_ho) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d reduced!\n", + bts->nr); + else + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d can't be reduced/solved!\n", bts->nr); + + return rc; +} + +static void bts_congestion_check(struct gsm_bts *bts) +{ + int min_free_tchf, min_free_tchh; + int tchf_count, tchh_count; + + global_ho_reason = HO_REASON_CONGESTION; + + /* only check BTS if TRX 0 is usable */ + if (!trx_is_usable(bts->c0)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: TRX 0 not usable\n"); + return; + } + + /* only check BTS if handover or assignment is enabled */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: Assignment and Handover both disabled\n"); + return; + } + + min_free_tchf = ho_get_tchf_min_slots(bts->ho); + min_free_tchh = ho_get_tchh_min_slots(bts->ho); + + /* only check BTS with congestion level set */ + if (!min_free_tchf && !min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: no minimum for free TCH/F nor TCH/H set\n"); + return; + } + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + LOGPHOBTS(bts, LOGL_INFO, "Congestion check: (free/want-free) TCH/F=%d/%d TCH/H=%d/%d\n", + tchf_count, min_free_tchf, tchh_count, min_free_tchh); + + /* only check BTS if congested */ + if (tchf_count >= min_free_tchf && tchh_count >= min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "Not congested\n"); + return; + } + + LOGPHOBTS(bts, LOGL_DEBUG, "Attempting to resolve congestion...\n"); + bts_resolve_congestion(bts, min_free_tchf - tchf_count, min_free_tchh - tchh_count); +} + +void hodec2_congestion_check(struct gsm_network *net) +{ + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_congestion_check(bts); +} + +static void congestion_check_cb(void *arg) +{ + struct gsm_network *net = arg; + hodec2_congestion_check(net); + reinit_congestion_timer(net); +} + +static int ho_dec_2_sig_lchan(unsigned int signal, void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data = signal_data; + + switch (signal) { + case S_LCHAN_MEAS_REP: + /* This is Handover Algorithm 2. If we're not responsible, drop it. */ + if (ho_get_algorithm(lchan_data->lchan->ts->trx->bts->ho) != 2) + return 0; + + attempt_handover_after_mr(lchan_data->mr); + break; + } + + return 0; +} + +static int ho_dec_2_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, + void *signal_data) +{ + switch (subsys) { + case SS_LCHAN: + return ho_dec_2_sig_lchan(signal, handler_data, signal_data); + default: + return 0; + } +} + + +void hodec2_init(struct gsm_network *net) +{ + osmo_signal_register_handler(SS_LCHAN, ho_dec_2_sig_cb, NULL); + ho2_initialized = true; + reinit_congestion_timer(net); +} diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..0b44b2e 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -38,6 +38,29 @@ #include #include #include +#include +#include + +#define LOGPHOLCHANTOLCHAN(lchan, new_lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->trx->arfcn, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_lchan->ts->trx->bts->nr, \ + new_lchan->ts->trx->nr, \ + new_lchan->ts->trx->arfcn, \ + new_lchan->ts->nr, \ + new_lchan->nr, \ + gsm_pchan_name(new_lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHO(struct_bsc_handover, level, fmt, args ...) \ + LOGPHOLCHANTOLCHAN(struct_bsc_handover->old_lchan, struct_bsc_handover->new_lchan, level, fmt, ## args) + struct bsc_handover { struct llist_head list; @@ -86,36 +109,56 @@ return NULL; } -/*! \brief Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, after the - * decision whether to initiate HO to a specific BTS. */ +/*! Hand over the specified logical channel to the specified new BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { + return bsc_handover_start_lchan_change(old_lchan, bts, old_lchan->type); +} + +/*! Hand over the specified logical channel to the specified new BTS and possibly change the lchan type. + * This is the main entry point for the actual handover algorithm, after the decision whether to initiate + * HO to a specific BTS. */ +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, + enum gsm_chan_t new_lchan_type) +{ + struct gsm_network *network; struct gsm_lchan *new_lchan; struct bsc_handover *ho; static uint8_t ho_ref = 0; int rc; + bool do_assignment = false; /* don't attempt multiple handovers for the same lchan at * the same time */ if (bsc_ho_by_old_lchan(old_lchan)) return -EBUSY; - DEBUGP(DHO, "Beginning with handover operation" - "(old_lchan on BTS %u, new BTS %u) ...\n", - old_lchan->ts->trx->bts->nr, bts->nr); + if (!new_bts) + new_bts = old_lchan->ts->trx->bts; + do_assignment = (new_bts == old_lchan->ts->trx->bts); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); + network = new_bts->network; + + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); return -ENOSPC; } - new_lchan = lchan_alloc(bts, old_lchan->type, 0); + DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Beginning with handover operation...\n", + old_lchan->ts->trx->bts->nr, + old_lchan->ts->trx->nr, + old_lchan->ts->nr, + old_lchan->nr, + gsm_pchan_name(old_lchan->ts->pchan), + new_bts->nr, + gsm_lchant_name(new_lchan_type)); + + new_lchan = lchan_alloc(new_bts, new_lchan_type, 0); if (!new_lchan) { - LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); + LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type)); + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); return -ENOSPC; } @@ -128,31 +171,41 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (old_lchan->ts->trx->bts != bts) { + if (!do_assignment) { ho->inter_cell = true; ho->async = true; } + LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); + /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); - new_lchan->ms_power = old_lchan->ms_power; + if (do_assignment) { + new_lchan->ms_power = old_lchan->ms_power; + new_lchan->rqd_ta = old_lchan->rqd_ta; + } else { + new_lchan->ms_power = + ms_pwr_ctl_lvl(new_bts->band, new_bts->ms_max_power); + /* FIXME: do we have a better idea of the timing advance? */ + //new_lchan->rqd_ta = old_lchan->rqd_ta; + } new_lchan->bs_power = old_lchan->bs_power; new_lchan->rsl_cmode = old_lchan->rsl_cmode; new_lchan->tch_mode = old_lchan->tch_mode; - memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, ARRAY_SIZE(new_lchan->mr_ms_lv)); - memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, ARRAY_SIZE(new_lchan->mr_bts_lv)); + memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, sizeof(new_lchan->mr_ms_lv)); + memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, sizeof(new_lchan->mr_bts_lv)); new_lchan->conn = old_lchan->conn; new_lchan->conn->ho_lchan = new_lchan; - /* FIXME: do we have a better idea of the timing advance? */ rc = rsl_chan_activate_lchan(new_lchan, ho->inter_cell ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) : RSL_ACT_INTRA_IMM_ASS, ho->ho_ref); if (rc < 0) { - LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); + LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", + do_assignment? "Assignment" : "Handover", rc); new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; talloc_free(ho); @@ -218,12 +271,16 @@ if (!ho) return -ENODEV; - DEBUGP(DHO, "handover activate ack, send HO Command\n"); + LOGPHO(ho, LOGL_INFO, "Channel Activate Ack, send %s COMMAND\n", ho->inter_cell? "HANDOVER" : "ASSIGNMENT"); /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, 0, ho->ho_ref); + if (ho->inter_cell) { + gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); + } else { + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); + } /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ @@ -241,12 +298,18 @@ static int ho_chan_activ_nack(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; + struct gsm_bts *new_bts = new_lchan->ts->trx->bts; ho = bsc_ho_by_new_lchan(new_lchan); if (!ho) { LOGP(DHO, LOGL_INFO, "ACT NACK: unable to find HO record\n"); return -ENODEV; } + + LOGPHO(ho, LOGL_ERROR, "Channel Activate Nack for %s, starting penalty timer\n", ho->inter_cell? "Handover" : "Assignment"); + + /* if channel failed, wait 10 seconds befor allowing to retry handover */ + conn_penalty_timer_add(ho->old_lchan->conn, new_bts, 10); /* FIXME configurable */ new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; @@ -269,22 +332,19 @@ return -ENODEV; } - net = new_lchan->ts->trx->bts->network; - LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN " - "%u->%u\n", bsc_subscr_name(ho->old_lchan->conn->bsub), - ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, - ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn); + LOGPHO(ho, LOGL_INFO, "%s Complete\n", ho->inter_cell ? "Handover" : "Assignment"); + net = new_lchan->ts->trx->bts->network; rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]); osmo_timer_del(&ho->T3103); /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) - LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Primary lchan changed during handover.\n"); if (new_lchan != new_lchan->conn->ho_lchan) - LOGP(DHO, LOGL_ERROR, "Handover channel changed during this handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Handover channel changed during this handover.\n"); new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; @@ -301,6 +361,8 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) { struct gsm_network *net = old_lchan->ts->trx->bts->network; + struct gsm_bts *old_bts; + struct gsm_bts *new_bts; struct bsc_handover *ho; struct gsm_lchan *new_lchan; @@ -308,6 +370,25 @@ if (!ho) { LOGP(DHO, LOGL_ERROR, "unable to find HO record\n"); return -ENODEV; + } + + old_bts = old_lchan->ts->trx->bts; + new_bts = ho->new_lchan->ts->trx->bts; + + if (old_lchan->conn->ho_failure >= ho_get_retries(old_bts->ho)) { + int penalty = ho->inter_cell + ? ho_get_penalty_failed_ho(old_bts->ho) + : ho_get_penalty_failed_as(old_bts->ho); + LOGPHO(ho, LOGL_NOTICE, "%s failed, starting penalty timer (%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + penalty); + old_lchan->conn->ho_failure = 0; + conn_penalty_timer_add(old_lchan->conn, new_bts, penalty); + } else { + old_lchan->conn->ho_failure++; + LOGPHO(ho, LOGL_NOTICE, "%s failed, trying again (%d/%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + old_lchan->conn->ho_failure, ho_get_retries(old_bts->ho)); } rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED]); @@ -320,7 +401,6 @@ handover_free(ho); lchan_release(new_lchan, 0, RSL_REL_LOCAL_END); - return 0; } @@ -336,7 +416,7 @@ return -ENODEV; } - LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + LOGPHO(ho, LOGL_DEBUG, "Handover RACH detected\n"); /* This is just for logging on the DHO category. The actual MGCP switchover happens in * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c index 225e9a9..5d66e4c 100644 --- a/src/libbsc/handover_vty.c +++ b/src/libbsc/handover_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) { @@ -70,7 +71,42 @@ #undef HO_CFG_ONE_MEMBER -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} + +DEFUN(cfg_net_ho_congestion_check_interval, cfg_net_ho_congestion_check_interval_cmd, + "handover congestion-check (disabled|<1-999>|now)", + HO_CFG_STR_HANDOVER + "Configure congestion check interval" HO_CFG_STR_2 + "Disable congestion checking, do not handover based on cell overload\n" + "Congestion check interval in seconds (default " + OSMO_STRINGIFY_VAL(HO_CFG_CONGESTION_CHECK_DEFAULT) ")\n" + "Manually trigger a congestion check to run right now\n") +{ + if (!strcmp(argv[0], "now")) { + hodec2_congestion_check(gsmnet_from_vty(vty)); + return CMD_SUCCESS; + } + + hodec2_on_change_congestion_check_interval(gsmnet_from_vty(vty), + a2congestion_check_interval(argv[0])); + return CMD_SUCCESS; +} + +static void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) { #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ @@ -82,6 +118,21 @@ HO_CFG_ALL_MEMBERS #undef HO_CFG_ONE_MEMBER +} + +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + ho_vty_write(vty, " ", bts->ho); +} + +void ho_vty_write_net(struct vty *vty, struct gsm_network *net) +{ + ho_vty_write(vty, " ", net->ho); + + if (net->ho2.congestion_check_interval_s != HO_CFG_CONGESTION_CHECK_DEFAULT) + vty_out(vty, " handover congestion-check %s%s", + congestion_check_interval2a(net->ho2.congestion_check_interval_s), + VTY_NEWLINE); } static void ho_vty_init_cmds(int parent_node) @@ -96,6 +147,8 @@ void ho_vty_init() { ho_vty_init_cmds(GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_ho_congestion_check_interval_cmd); + ho_vty_init_cmds(BTS_NODE); } diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 57d8241..4368598 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -57,6 +57,7 @@ net->T3141 = GSM_T3141_DEFAULT; net->ho = ho_cfg_init(net, NULL); + net->ho2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 92ebbfe..17858f6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -25,9 +25,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -38,6 +40,7 @@ #include #include #include +#include void *tall_bsc_ctx; @@ -266,6 +269,8 @@ INIT_LLIST_HEAD(&bts->loc_list); + osmo_signal_dispatch(SS_L_GLOBAL, S_GLOBAL_BTS_NEW, bts); + return bts; } @@ -416,3 +421,73 @@ rev_lev = (cm->classmark2[0] >> 5) & 0x3; return rev_lev >= 2; } + +static unsigned int time_now(void) +{ + time_t now; + time(&now); + return (unsigned int)now; +} + +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout) +{ + struct ho_penalty_timer *timer; + unsigned int now; + unsigned int then; + now = time_now(); + + /* no not add timer, if there is no timeout set */ + if (!timeout) + return; + + then = now + timeout; + + /* timer already running for that BTS? */ + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + /* raise, if running timer will timeout earlier or has timed + * out already, otherwise keep later timeout */ + if (timer->timeout < then) + timer->timeout = then; + return; + } + + /* add new timer */ + timer = talloc_zero(tall_bsc_ctx, struct ho_penalty_timer); + if (!timer) + return; + + timer->bts_nr = bts->nr; + timer->timeout = then; + + llist_add_tail(&timer->entry, &conn->ho_penalty_timers); +} + +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer; + unsigned int now = time_now(); + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + if (now > timer->timeout) + continue; + return timer->timeout - now; + } + return 0; +} + +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer, *timer2; + llist_for_each_entry_safe(timer, timer2, &conn->ho_penalty_timers, entry) { + if (bts && timer->bts_nr != bts->nr) + continue; + llist_del(&timer->entry); + talloc_free(timer); + } +} diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c index 8c208f6..204e5a2 100644 --- a/src/libcommon/handover_cfg.c +++ b/src/libcommon/handover_cfg.c @@ -23,7 +23,10 @@ #include #include +#include + #include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..ab796b2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -741,7 +741,6 @@ bool aoip = false; struct sockaddr_storage rtp_addr; struct gsm0808_channel_type ct; - struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; const uint8_t *data; @@ -787,6 +786,7 @@ } /* Decode speech codec list (AoIP) */ + conn->conn->codec_list_present = false; if (aoip) { /* Check for speech codec list element */ if (!TLVP_PRESENT(&tp, GSM0808_IE_SPEECH_CODEC_LIST)) { @@ -798,13 +798,14 @@ /* Decode Speech Codec list */ data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&conn->conn->codec_list, data, len); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); goto reject; } - scl_ptr = &scl; + conn->conn->codec_list_present = true; + scl_ptr = &conn->conn->codec_list; } /* Decode Channel Type element */ diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1aff4c5..bac3a5e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -298,6 +299,7 @@ mgcp_init(bsc_gsmnet); handover_decision_1_init(); + hodec2_init(bsc_gsmnet); signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); diff --git a/tests/Makefile.am b/tests/Makefile.am index ba8a5e1..652dfe1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ bsc-nat \ bsc-nat-trie \ bssap \ + handover \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am new file mode 100644 index 0000000..69fda8a --- /dev/null +++ b/tests/handover/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + handover_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + handover_test \ + $(NULL) + +handover_test_SOURCES = \ + handover_test.c \ + $(NULL) + +handover_test_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(NULL) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c new file mode 100644 index 0000000..b1ba01d --- /dev/null +++ b/tests/handover/handover_test.c @@ -0,0 +1,1585 @@ +/* + * (C) 2013 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct gsm_network *bsc_gsmnet; + +/* measurement report */ + +uint8_t meas_rep_ba = 0, meas_rep_valid = 1, meas_valid = 1, meas_multi_rep = 0; +uint8_t meas_dl_rxlev = 0, meas_dl_rxqual = 0; +uint8_t meas_ul_rxlev = 0, meas_ul_rxqual = 0; +uint8_t meas_tx_power_ms = 0, meas_tx_power_bs = 0, meas_ta_ms = 0; +uint8_t meas_dtx_ms = 0, meas_dtx_bs = 0, meas_nr = 0; +uint8_t meas_num_nc = 0, meas_rxlev_nc[6], meas_bsic_nc[6], meas_bcch_f_nc[6]; + +static void gen_meas_rep(struct gsm_lchan *lchan) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t ulm[3], l1i[2], *buf; + struct gsm48_hdr *gh; + struct gsm48_meas_res *mr; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = RSL_MT_MEAS_RES; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = chan_nr; + + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, meas_nr++); + + ulm[0] = meas_ul_rxlev | (meas_dtx_bs << 7); + ulm[1] = meas_ul_rxlev; + ulm[2] = (meas_ul_rxqual << 3) | meas_ul_rxqual; + msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, sizeof(ulm), ulm); + + msgb_tv_put(msg, RSL_IE_BS_POWER, meas_tx_power_bs); + + l1i[0] = 0; + l1i[1] = meas_ta_ms; + msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, sizeof(l1i), l1i); + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*mr)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*mr)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + mr = (struct gsm48_meas_res *) msgb_put(msg, sizeof(*mr)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = GSM48_MT_RR_MEAS_REP; + + /* measurement results */ + mr->rxlev_full = meas_dl_rxlev; + mr->rxlev_sub = meas_dl_rxlev; + mr->rxqual_full = meas_dl_rxqual; + mr->rxqual_sub = meas_dl_rxqual; + mr->dtx_used = meas_dtx_ms; + mr->ba_used = meas_rep_ba; + mr->meas_valid = !meas_valid; /* 0 = valid */ + if (meas_rep_valid) { + mr->no_nc_n_hi = meas_num_nc >> 2; + mr->no_nc_n_lo = meas_num_nc & 3; + } else { + /* no results for serving cells */ + mr->no_nc_n_hi = 1; + mr->no_nc_n_lo = 3; + } + mr->rxlev_nc1 = meas_rxlev_nc[0]; + mr->rxlev_nc2_hi = meas_rxlev_nc[1] >> 1; + mr->rxlev_nc2_lo = meas_rxlev_nc[1] & 1; + mr->rxlev_nc3_hi = meas_rxlev_nc[2] >> 2; + mr->rxlev_nc3_lo = meas_rxlev_nc[2] & 3; + mr->rxlev_nc4_hi = meas_rxlev_nc[3] >> 3; + mr->rxlev_nc4_lo = meas_rxlev_nc[3] & 7; + mr->rxlev_nc5_hi = meas_rxlev_nc[4] >> 4; + mr->rxlev_nc5_lo = meas_rxlev_nc[4] & 15; + mr->rxlev_nc6_hi = meas_rxlev_nc[5] >> 5; + mr->rxlev_nc6_lo = meas_rxlev_nc[5] & 31; + mr->bsic_nc1_hi = meas_bsic_nc[0] >> 3; + mr->bsic_nc1_lo = meas_bsic_nc[0] & 7; + mr->bsic_nc2_hi = meas_bsic_nc[1] >> 4; + mr->bsic_nc2_lo = meas_bsic_nc[1] & 15; + mr->bsic_nc3_hi = meas_bsic_nc[2] >> 5; + mr->bsic_nc3_lo = meas_bsic_nc[2] & 31; + mr->bsic_nc4 = meas_bsic_nc[3]; + mr->bsic_nc5 = meas_bsic_nc[4]; + mr->bsic_nc6 = meas_bsic_nc[5]; + mr->bcch_f_nc1 = meas_bcch_f_nc[0]; + mr->bcch_f_nc2 = meas_bcch_f_nc[1]; + mr->bcch_f_nc3 = meas_bcch_f_nc[2]; + mr->bcch_f_nc4 = meas_bcch_f_nc[3]; + mr->bcch_f_nc5_hi = meas_bcch_f_nc[4] >> 1; + mr->bcch_f_nc5_lo = meas_bcch_f_nc[4] & 1; + mr->bcch_f_nc6_hi = meas_bcch_f_nc[5] >> 2; + mr->bcch_f_nc6_lo = meas_bcch_f_nc[5] & 3; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +static struct gsm_bts *create_bts(int arfcn) +{ + struct gsm_bts *bts; + struct e1inp_sign_link *rsl_link; + int i; + + bts = gsm_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_OSMOBTS, 0x3f); + if (!bts) { + printf("No resource for bts1\n"); + return NULL; + } + + bts->location_area_code = 23; + bts->c0->arfcn = arfcn; + + bts->codec.efr = 1; + bts->codec.hr = 1; + bts->codec.amr = 1; + + rsl_link = talloc_zero(0, struct e1inp_sign_link); + rsl_link->trx = bts->c0; + bts->c0->rsl_link = rsl_link; + + bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK; + + /* 4 full rate and 4 half rate channels */ + for (i = 1; i <= 6; i++) { + bts->c0->ts[i].pchan = + (i < 5) ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H; + bts->c0->ts[i].mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->ts[i].mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->ts[i].lchan[0].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[0].state = LCHAN_S_NONE; + bts->c0->ts[i].lchan[1].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[1].state = LCHAN_S_NONE; + } + return bts; +} + +void create_conn(struct gsm_lchan *lchan) +{ + lchan->conn = bsc_subscr_con_allocate(lchan); +} + +/* create lchan */ +struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, char *codec) +{ + struct gsm_lchan *lchan; + + lchan = lchan_alloc(bts, + (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, 0); + if (!lchan) { + printf("No resource for lchan\n"); + exit(EXIT_FAILURE); + } + lchan->state = LCHAN_S_ACTIVE; + create_conn(lchan); + if (!strcasecmp(codec, "FR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "HR") && !full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "EFR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_EFR; + else if (!strcasecmp(codec, "AMR")) + lchan->tch_mode = GSM48_CMODE_SPEECH_AMR; + else { + printf("Given codec unknown\n"); + exit(EXIT_FAILURE); + } + + lchan->conn->codec_list = (struct gsm0808_speech_codec_list){ + .codec = { + { .fi=true, .type=GSM0808_SCT_FR1, }, + { .fi=true, .type=GSM0808_SCT_FR2, }, + { .fi=true, .type=GSM0808_SCT_FR3, }, + { .fi=true, .type=GSM0808_SCT_HR1, }, + { .fi=true, .type=GSM0808_SCT_HR3, }, + }, + .len = 5, + }; + lchan->conn->codec_list_present = true; + + return lchan; +} + +/* parse channel request */ + +static int got_chan_req = 0; +static struct gsm_lchan *chan_req_lchan = NULL; + +static int parse_chan_act(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +static int parse_chan_rel(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +/* parse handover request */ + +static int got_ho_req = 0; +static struct gsm_lchan *ho_req_lchan = NULL; + +static int parse_ho_command(struct gsm_lchan *lchan, uint8_t *data, int len) +{ + struct gsm48_hdr *gh = (struct gsm48_hdr *) data; + struct gsm48_ho_cmd *ho = (struct gsm48_ho_cmd *) gh->data; + int arfcn; + struct gsm_bts *neigh; + + switch (gh->msg_type) { + case GSM48_MT_RR_HANDO_CMD: + arfcn = (ho->cell_desc.arfcn_hi << 8) | ho->cell_desc.arfcn_lo; + + /* look up trx. since every dummy bts uses different arfcn and + * only one trx, it is simple */ + llist_for_each_entry(neigh, &bsc_gsmnet->bts_list, list) { + if (neigh->c0->arfcn != arfcn) + continue; + ho_req_lchan = lchan; + return 0; + } + break; + case GSM48_MT_RR_ASS_CMD: + ho_req_lchan = lchan; + return 0; + break; + default: + fprintf(stderr, "Error, expecting HO or AS command\n"); + return -EINVAL; + } + + return -1; +} + +/* send channel activation ack */ +static void send_chan_act_ack(struct gsm_lchan *lchan, int act) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = (act) ? RSL_MT_CHAN_ACTIV_ACK : RSL_MT_RF_CHAN_REL_ACK; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = gsm_lchan2chan_nr(lchan); + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + + abis_rsl_rcvmsg(msg); +} + +/* send handover complete */ +static void send_ho_complete(struct gsm_lchan *lchan, bool success) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_rll_hdr *rh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t *buf; + struct gsm48_hdr *gh; + struct gsm48_ho_cpl *hc; + + rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); + rh->c.msg_discr = ABIS_RSL_MDISC_RLL; + rh->c.msg_type = RSL_MT_DATA_IND; + rh->ie_chan = RSL_IE_CHAN_NR; + rh->chan_nr = chan_nr; + rh->ie_link_id = RSL_IE_LINK_IDENT; + rh->link_id = 0x00; + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*hc)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*hc)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + hc = (struct gsm48_ho_cpl *) msgb_put(msg, sizeof(*hc)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = + success ? GSM48_MT_RR_HANDO_COMPL : GSM48_MT_RR_HANDO_FAIL; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)rh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +/* RSL messages from BSC */ +int abis_rsl_sendmsg(struct msgb *msg) +{ + struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *) msg->data; + struct e1inp_sign_link *sign_link = msg->dst; + int rc; + struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr, &rc); + + if (rc) { + printf("rsl_lchan_lookup() failed\n"); + exit(1); + } + + switch (dh->c.msg_type) { + case RSL_MT_CHAN_ACTIV: + rc = parse_chan_act(lchan, dh->data); + if (rc == 0) + got_chan_req = 1; + break; + case RSL_MT_RF_CHAN_REL: + rc = parse_chan_rel(lchan, dh->data); + if (rc == 0) + send_chan_act_ack(chan_req_lchan, 0); + break; + case RSL_MT_DATA_REQ: + rc = parse_ho_command(lchan, msg->l3h, msgb_l3len(msg)); + if (rc == 0) + got_ho_req = 1; + break; + case RSL_MT_IPAC_CRCX: + break; + default: + printf("unknown rsl message=0x%x\n", dh->c.msg_type); + } + return 0; +} + +/* test cases */ + +static char *test_case_0[] = { + "2", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_1[] = { + "2", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_2[] = { + "2", + + "Handover and Assignment must be enabled\n\n" + "This test will start with disabled assignment and handover. A\n" + "better neighbor cell (assignment enabled) will not be selected and \n" + "also no assignment from TCH/H to TCH/F to improve quality. There\n" + "will be no handover nor assignment. After enabling assignment on the\n" + "current cell, the MS will assign to TCH/F. After enabling handover\n" + "in the current cell, but disabling in the neighbor cell, handover\n" + "will not be performed, until it is enabled in the neighbor cell too.\n", + + "create-bts", "2", + "afs-rxlev-improve", "0", "5", + "create-ms", "0", "TCH/H", "AMR", + "as-enable", "0", "0", + "ho-enable", "0", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "as-enable", "0", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "ho-enable", "0", "1", + "ho-enable", "1", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "ho-enable", "1", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_3[] = { + "2", + + "Penalty timer must not run\n\n" + "The MS will try to handover to a better cell, but this will fail.\n" + "Even though the cell is still better, handover will not be performed\n" + "due to penalty timer after handover failure\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-failed", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_4[] = { + "2", + + "TCH/H keeping with HR codec\n\n" + "The MS is using half rate V1 codec, but the better cell is congested\n" + "at TCH/H slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/H", "HR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + NULL +}; + +static char *test_case_5[] = { + "2", + + "TCH/F keeping with FR codec\n\n" + "The MS is using full rate V1 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_6[] = { + "2", + + "TCH/F keeping with EFR codec\n\n" + "The MS is using full rate V2 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "EFR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_7[] = { + "2", + + "TCH/F to TCH/H changing with AMR codec\n\n" + "The MS is using AMR V3 codec, the better cell is congested at TCH/F\n" + "slots. The handover is performed to non-congested TCH/H slots.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_8[] = { + "2", + + "No handover to a cell with no slots available\n\n" + "If no slot is available, no handover is performed\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_9[] = { + "2", + + "No more parallel handovers, if max_unsync_ho is defined\n\n" + "There are tree mobiles that want to handover, but only two can do\n" + "it at a time, because the maximum number is limited to two.\n", + + "create-bts", "2", + "set-max-ho", "1", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "meas-rep", "1", "0","0", "1","0","30", + "expect-chan", "1", "2", + "meas-rep", "2", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_10[] = { + "2", + + "Hysteresis\n\n" + "If neighbor cell is better, handover is only performed if the\n" + "ammount of improvement is greater or equal hyteresis\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "27","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "26","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_11[] = { + "2", + + "No Hysteresis and minimum RX level\n\n" + "If current cell's RX level is below mimium level, handover must be\n" + "performed, no matter of the hysteresis. First do not perform\n" + "handover to better neighbor cell, because the hysteresis is not\n" + "met. Second do not perform handover because better neighbor cell is\n" + "below minimum RX level. Third perform handover because current cell\n" + "is below minimum RX level, even if the better neighbor cell (minimum\n" + "RX level reached) does not meet the hysteresis.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", "1","0","11", + "expect-no-chan", + "meas-rep", "0", "8","0", "1","0","9", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","10", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_12[] = { + "2", + + "No handover to congested cell\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "After the congestion is over, handover will be performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_13[] = { + "2", + + "Handover to balance congestion\n\n" + "The current and the better cell are congested, so no handover is\n" + "performed. This is because handover would congest the neighbor cell\n" + "more. After congestion raises in the current cell, the handover is\n" + "performed to balance congestion\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_14[] = { + "2", + + "Handover to congested cell, if RX level is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX level of the current cell drops below minimum acceptable\n" + "level, the handover is performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "10","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_15[] = { + "2", + + "Handover to cell with worse RXLEV, if RXQUAL is below minimum\n\n" + "The neighbor cell has worse RXLEV, so no handover is performed.\n" + "If the RXQUAL of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "reports are received, before RXQUAL is checked.\n", + /* (See also test 28, which tests for RXQUAL triggering HO to congested cell.) */ + /* TODO: bad RXQUAL may want to prefer assignment within the same cell to avoid interference. + * See Performence Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter + * 2.1.1, "Interference" in the list of triggers on p.157. */ + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_16[] = { + "2", + + "Handover due to maximum TA exceeded\n\n" + "The MS in the current (best) cell has reached maximum allowed timing\n" + "advance. No handover is performed until the timing advance exceeds\n" + "it. The originating cell is still the best, but no handover is\n" + "performed back to that cell, because the penalty timer (due to\n" + "maximum allowed timing advance) is running.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-max-ta", "0", "5", /* of cell */ + "set-ta", "0", "5", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "set-ta", "0", "6", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_17[] = { + "2", + + "Congestion check: No congestion\n\n" + "Three cells have different number of used slots, but there is no\n" + "congestion in any of these cells. No handover is performed.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_18[] = { + "2", + + "Congestion check: One out of three cells is congested\n\n" + "Three cells have different number of used slots, but there is\n" + "congestion at TCH/F in the first cell. Handover is performed with\n" + "the best candidate.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","21","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "6", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "3", /* best candidate is MS 2 at BTS 1, TS 3 */ + "ho-complete", + NULL +}; + +static char *test_case_19[] = { + "2", + + "Congestion check: Balancing over congested cells\n\n" + "Two cells are congested, but the second cell is more congested.\n" + "Handover is performed to solve the congestion.\n", + + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "1", "TCH/F", "FR", + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "1","0","21", + "expect-no-chan", + "meas-rep", "2", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "2", /* best candidate is MS 1 at BTS 0, TS 2 */ + "ho-complete", + NULL +}; + +static char *test_case_20[] = { + "2", + + "Congestion check: Solving congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "non-congested TCH/H of second BTS, in order to solve congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_21[] = { + "2", + + "Congestion check: Balancing congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "less-congested TCH/H of second BTS, in order to balance congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_22[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + NULL +}; + +static char *test_case_23[] = { + "2", + + "Story: 'A neighbor is your friend'\n", + + "create-bts", "3", + + "print", + "Andreas is driving along the coast, on a sunny june afternoon.\n" + "Suddenly he is getting a call from his friend and neighbor Axel.\n" + "\n" + "What happens: Two MS are created, #0 for Axel, #1 for Andreas.", + /* Axel */ + "create-ms", "2", "TCH/F", "AMR", + /* andreas */ + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "1", "40","0", "1","0","30", + "expect-no-chan", + + "print", + "Axel asks Andreas if he would like to join them for a barbecue.\n" + "Axel's house is right in the neighborhood and the weather is fine.\n" + "Andreas agrees, so he drives to a close store to buy some barbecue\n" + "skewers.\n" + "\n" + "What happens: While driving, a different cell (mounted atop the\n" + "store) becomes better.", + /* drive to bts 1 */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + "While Andreas is walking into the store, Axel asks, if he could also\n" + "bring some beer. Andreas has problems understanding him: \"I have a\n" + "bad reception here. The cell tower is right atop the store, but poor\n" + "coverage inside. Can you repeat please?\"\n" + "\n" + "What happens: Inside the store the close cell is so bad, that\n" + "handover back to the previous cell is required.", + /* bts 1 becomes bad, so bts 0 helps out */ + "meas-rep", "1", "5","0", "1","0","20", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "After Andreas bought skewers and beer, he leaves the store.\n" + "\n" + "What happens: Outside the store the close cell is better again, so\n" + "handover back to the that cell is performed.", + /* bts 1 becomes better again */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + /* bts 2 becomes better */ + "Andreas drives down to the lake where Axel's house is.\n" + "\n" + "What happens: There is a small cell at Axel's house, which becomes\n" + "better, because the current cell has no good comverage at the lake.", + "meas-rep", "1", "14","0", "2","0","2","1","63", + "expect-chan", "2", "2", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "Andreas wonders why he still has good radio coverage: \"Last time it\n" + "was so bad\". Axel says: \"I installed a pico cell in my house,\n" + "now we can use our mobile phones down here at the lake.\"", + + NULL +}; + +static char *test_case_24[] = { + "2", + "No (or not enough) measurements for handover\n\n" + "Do not solve congestion in cell, because there is no measurement.\n" + "As soon as enough measurments available (1 in our case), perform\n" + "handover. Afterwards the old cell becomes congested and the new\n" + "cell is not. Do not perform handover until new measurements are\n" + "received.\n", + + /* two cells, first in congested, but no handover */ + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "congestion-check", + "expect-no-chan", + + /* send measurement and trigger congestion check */ + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + /* congest the first cell and remove congestion from second cell */ + "set-min-free", "0", "TCH/F", "0", + "set-min-free", "0", "TCH/H", "0", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + + /* no handover until measurements applied */ + "congestion-check", + "expect-no-chan", + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + NULL +}; + +static char *test_case_25[] = { + "1", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_26[] = { + "1", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_27[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen. (So far like test 22.)\n" + "After that, trigger more congestion checks to ensure stability.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + "congestion-check", + "expect-chan", "0", "2", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "congestion-check", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_28[] = { + "2", + + "Handover to congested cell, if RX quality is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX quality of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "resports are received, before RX quality is checked.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char **test_cases[] = { + test_case_0, + test_case_1, + test_case_2, + test_case_3, + test_case_4, + test_case_5, + test_case_6, + test_case_7, + test_case_8, + test_case_9, + test_case_10, + test_case_11, + test_case_12, + test_case_13, + test_case_14, + test_case_15, + test_case_16, + test_case_17, + test_case_18, + test_case_19, + test_case_20, + test_case_21, + test_case_22, + test_case_23, + test_case_24, + test_case_25, + test_case_26, + test_case_27, + test_case_28, + NULL +}; + +int main(int argc, char **argv) +{ + char **test_case; + struct gsm_bts *bts[256]; + int bts_num = 0; + struct gsm_lchan *lchan[256]; + int lchan_num = 0; + int test_count = 0; + int i; + int algorithm; + struct bsc_api bsc_api = {}; + + for (i = 0; test_cases[i]; i++) + test_count++; + + if (argc <= 1 || atoi(argv[1]) >= test_count) { + for (i = 0; test_cases[i]; i++) { + printf("Test #%d (algorithm %s):\n%s\n", i, + test_cases[i][0], test_cases[i][1]); + } + printf("\nPlease specify test case number 0..%d\n", + test_count - 1); + return EXIT_FAILURE; + } + + osmo_init_logging(&log_info); + + log_set_print_category(osmo_stderr_target, 1); + log_set_print_category_hex(osmo_stderr_target, 0); + log_set_print_filename2(osmo_stderr_target, LOG_FILENAME_BASENAME); + + log_set_category_filter(osmo_stderr_target, DHO, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DHODEC, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DMEAS, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DREF, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DRSL, 1, LOGL_DEBUG); + + /* Create a dummy network */ + bsc_gsmnet = bsc_network_init(NULL, 1, 1); + if (!bsc_gsmnet) + exit(1); + + bsc_api_init(bsc_gsmnet, &bsc_api); + + ho_set_algorithm(bsc_gsmnet->ho, 2); + ho_set_ho_active(bsc_gsmnet->ho, true); + ho_set_as_active(bsc_gsmnet->ho, true); + ho_set_min_rxlev(bsc_gsmnet->ho, -100); + ho_set_rxlev_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxlev_neigh_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxqual_avg_win(bsc_gsmnet->ho, 10); + ho_set_pwr_hysteresis(bsc_gsmnet->ho, 3); + ho_set_pwr_interval(bsc_gsmnet->ho, 1); + ho_set_afs_bias_rxlev(bsc_gsmnet->ho, 0); + ho_set_min_rxqual(bsc_gsmnet->ho, 5); + ho_set_afs_bias_rxqual(bsc_gsmnet->ho, 0); + ho_set_max_distance(bsc_gsmnet->ho, 9999); + ho_set_ho_max(bsc_gsmnet->ho, 9999); + ho_set_penalty_max_dist(bsc_gsmnet->ho, 300); + ho_set_penalty_failed_ho(bsc_gsmnet->ho, 60); + ho_set_penalty_failed_as(bsc_gsmnet->ho, 60); + + bts_model_sysmobts_init(); + + test_case = test_cases[atoi(argv[1])]; + + fprintf(stderr, "--------------------\n"); + fprintf(stderr, "Performing the following test %d (algorithm %s):\n%s", + atoi(argv[1]), test_case[0], test_case[1]); + algorithm = atoi(test_case[0]); + test_case += 2; + fprintf(stderr, "--------------------\n"); + + /* Disable the congestion check timer, we will trigger manually. */ + bsc_gsmnet->ho2.congestion_check_interval_s = 0; + + handover_decision_1_init(); + hodec2_init(bsc_gsmnet); + + while (*test_case) { + if (!strcmp(*test_case, "create-bts")) { + static int arfcn = 870; + int n = atoi(test_case[1]); + fprintf(stderr, "- Creating %d BTS (one TRX each, " + "TS(1-4) are TCH/F, TS(5-6) are TCH/H)\n", n); + for (i = 0; i < n; i++) + bts[bts_num + i] = create_bts(arfcn++); + for (i = 0; i < n; i++) + gsm_generate_si(bts[bts_num + i], + SYSINFO_TYPE_2); + bts_num += n; + test_case += 2; + } else + if (!strcmp(*test_case, "as-enable")) { + fprintf(stderr, "- Set assignment enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_as_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "ho-enable")) { + fprintf(stderr, "- Set handover enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_ho_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxlev-improve")) { + fprintf(stderr, "- Set afs RX level improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxlev(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxqual-improve")) { + fprintf(stderr, "- Set afs RX quality improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxqual(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-min-free")) { + fprintf(stderr, "- Setting minimum required free %s " + "slots at BTS %s to %s\n", test_case[2], + test_case[1], test_case[3]); + if (!strcmp(test_case[2], "TCH/F")) + ho_set_tchf_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + else + ho_set_tchh_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + test_case += 4; + } else + if (!strcmp(*test_case, "set-max-ho")) { + fprintf(stderr, "- Setting maximum parallel handovers " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_ho_max( bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-max-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_max_distance(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "create-ms")) { + fprintf(stderr, "- Creating mobile #%d at BTS %s on " + "%s with %s codec\n", lchan_num, test_case[1], + test_case[2], test_case[3]); + lchan[lchan_num] = create_lchan(bts[atoi(test_case[1])], + !strcmp(test_case[2], "TCH/F"), test_case[3]); + if (!lchan[lchan_num]) { + printf("Failed to create lchan!\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * New MS is at BTS %d TS %d\n", + lchan[lchan_num]->ts->trx->bts->nr, + lchan[lchan_num]->ts->nr); + lchan_num++; + test_case += 4; + } else + if (!strcmp(*test_case, "set-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at MS %s to %s\n", test_case[1], + test_case[2]); + meas_ta_ms = atoi(test_case[2]); + test_case += 3; + } else + if (!strcmp(*test_case, "meas-rep")) { + /* meas-rep [ [...]] */ + int n = atoi(test_case[4]); + struct gsm_lchan *lc = lchan[atoi(test_case[1])]; + fprintf(stderr, "- Sending measurement report from " + "mobile #%s (rxlev=%s, rxqual=%s)\n", + test_case[1], test_case[2], test_case[3]); + meas_dl_rxlev = atoi(test_case[2]); + meas_dl_rxqual = atoi(test_case[3]); + meas_num_nc = n; + test_case += 5; + for (i = 0; i < n; i++) { + int nr = atoi(test_case[0]); + /* since our bts is not in the list of neighbor + * cells, we need to shift */ + if (nr >= lc->ts->trx->bts->nr) + nr++; + fprintf(stderr, " * Neighbor cell #%s, actual " + "BTS %d (rxlev=%s)\n", test_case[0], nr, + test_case[1]); + meas_bcch_f_nc[i] = atoi(test_case[0]); + /* bts number, not counting our own */ + meas_rxlev_nc[i] = atoi(test_case[1]); + meas_bsic_nc[i] = 0x3f; + test_case += 2; + } + got_chan_req = 0; + gen_meas_rep(lc); + } else + if (!strcmp(*test_case, "congestion-check")) { + fprintf(stderr, "- Triggering congestion check\n"); + got_chan_req = 0; + if (algorithm == 2) + hodec2_congestion_check(bsc_gsmnet); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-chan")) { + fprintf(stderr, "- Expecting channel request at BTS %s " + "TS %s\n", test_case[1], test_case[2]); + if (!got_chan_req) { + printf("Test failed, because no channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got channel request at BTS %d " + "TS %d\n", chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + if (chan_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because channel was not " + "requested on expected BTS\n"); + return EXIT_FAILURE; + } + if (chan_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because channel was not " + "requested on expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "expect-no-chan")) { + fprintf(stderr, "- Expecting no channel request\n"); + if (got_chan_req) { + fprintf(stderr, " * Got channel request at " + "BTS %d TS %d\n", + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + printf("Test failed, because channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got no channel request\n"); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-ho")) { + fprintf(stderr, "- Expecting handover/assignment " + "request at BTS %s TS %s\n", test_case[1], + test_case[2]); + if (!got_ho_req) { + printf("Test failed, because no handover was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got handover/assignment request at " + "BTS %d TS %d\n", + ho_req_lchan->ts->trx->bts->nr, + ho_req_lchan->ts->nr); + if (ho_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected BTS\n"); + return EXIT_FAILURE; + } + if (ho_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "ack-chan")) { + fprintf(stderr, "- Acknowledging channel request\n"); + if (!got_chan_req) { + printf("Cannot ack channel, because no " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_ho_req = 0; + send_chan_act_ack(chan_req_lchan, 1); + } else + if (!strcmp(*test_case, "ho-complete")) { + fprintf(stderr, "- Acknowledging handover/assignment " + "request\n"); + if (!got_chan_req) { + printf("Cannot ack handover/assignment, " + "because no chan request\n"); + return EXIT_FAILURE; + } + if (!got_ho_req) { + printf("Cannot ack handover/assignment, " + "because no ho request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + /* switch lchan */ + for (i = 0; i < lchan_num; i++) { + if (lchan[i] == ho_req_lchan) { + fprintf(stderr, " * MS %d changes from " + "BTS=%d TS=%d to BTS=%d " + "TS=%d\n", i, + lchan[i]->ts->trx->bts->nr, + lchan[i]->ts->nr, + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + lchan[i] = chan_req_lchan; + } + } + send_ho_complete(chan_req_lchan, true); + } else + if (!strcmp(*test_case, "ho-failed")) { + fprintf(stderr, "- Making handover fail\n"); + if (!got_chan_req) { + printf("Cannot fail handover, because no chan " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + send_ho_complete(ho_req_lchan, false); + } else + if (!strcmp(*test_case, "print")) { + fprintf(stderr, "\n%s\n\n", test_case[1]); + test_case += 2; + } else { + printf("Unknown test command '%s', please fix!\n", + *test_case); + return EXIT_FAILURE; + } + } + + for (i = 0; i < lchan_num; i++) { + struct gsm_subscriber_connection *conn = lchan[i]->conn; + lchan[i]->conn = NULL; + conn->lchan = NULL; + bsc_subscr_con_free(conn); + lchan_free(lchan[i]); + } + + fprintf(stderr, "--------------------\n"); + + printf("Test OK\n"); + + fprintf(stderr, "--------------------\n"); + + return EXIT_SUCCESS; +} + +void rtp_socket_free() {} +void rtp_send_frame() {} +void rtp_socket_upstream() {} +void rtp_socket_create() {} +void rtp_socket_connect() {} +void rtp_socket_proxy() {} +void trau_mux_unmap() {} +void trau_mux_map_lchan() {} +void trau_recv_lchan() {} +void trau_send_frame() {} diff --git a/tests/handover/handover_test.ok b/tests/handover/handover_test.ok new file mode 100644 index 0000000..678f9a3 --- /dev/null +++ b/tests/handover/handover_test.ok @@ -0,0 +1 @@ +Test OK diff --git a/tests/testsuite.at b/tests/testsuite.at index 6ef3f29..f0f6fd1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -51,3 +51,177 @@ cat $abs_srcdir/bssap/bssap_test.err > experr AT_CHECK([$abs_top_builddir/tests/bssap/bssap_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([handover test 0]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 1]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 2]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 3]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 4]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 5]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 6]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 7]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 8]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 9]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 10]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 11]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 12]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 13]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 14]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 15]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 16]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 17]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 18]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 19]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 20]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 21]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 22]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 23]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 24]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 25]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 26]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 27]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 28]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:16 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:16 +0000 Subject: [PATCH] osmo-bsc[master]: HO: always use Handover Command, not Assignment Message-ID: Review at https://gerrit.osmocom.org/5922 HO: always use Handover Command, not Assignment Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e --- M src/libbsc/handover_logic.c 1 file changed, 4 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/22/5922/1 diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 0b44b2e..3523576 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -171,10 +171,8 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (!do_assignment) { - ho->inter_cell = true; - ho->async = true; - } + ho->inter_cell = !do_assignment; + ho->async = true; LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); @@ -199,9 +197,7 @@ new_lchan->conn->ho_lchan = new_lchan; rc = rsl_chan_activate_lchan(new_lchan, - ho->inter_cell - ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) - : RSL_ACT_INTRA_IMM_ASS, + ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC, ho->ho_ref); if (rc < 0) { LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", @@ -276,11 +272,7 @@ /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - if (ho->inter_cell) { - gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); - } else { - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); - } + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ -- To view, visit https://gerrit.osmocom.org/5922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:04:17 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:04:17 +0000 Subject: [PATCH] osmo-bsc[master]: Fix: meas_rep.c will only use valid DL measurement reports Message-ID: Review at https://gerrit.osmocom.org/5923 Fix: meas_rep.c will only use valid DL measurement reports When averaging measurements, only the valid reports are used. If there is no valid report in the averaging window at all, an error is returned. Change-Id: I33056225ead788340755e98113d72e1cbf3ebce6 --- M src/libbsc/meas_rep.c 1 file changed, 19 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/23/5923/1 diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index fbd1515..73d9a1f 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -29,12 +29,20 @@ { switch (field) { case MEAS_REP_DL_RXLEV_FULL: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.full.rx_lev; case MEAS_REP_DL_RXLEV_SUB: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.sub.rx_lev; case MEAS_REP_DL_RXQUAL_FULL: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.full.rx_qual; case MEAS_REP_DL_RXQUAL_SUB: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.sub.rx_qual; case MEAS_REP_UL_RXLEV_FULL: return rep->ul.full.rx_lev; @@ -73,7 +81,7 @@ enum meas_rep_field field, unsigned int num) { unsigned int i, idx; - int avg = 0; + int avg = 0, valid_num = 0; if (num < 1) return -EINVAL; @@ -86,11 +94,18 @@ for (i = 0; i < num; i++) { int j = (idx+i) % ARRAY_SIZE(lchan->meas_rep); + int val = get_field(&lchan->meas_rep[j], field); - avg += get_field(&lchan->meas_rep[j], field); + if (val >= 0) { + avg += val; + valid_num++; + } } - return avg / num; + if (valid_num == 0) + return -EINVAL; + + return avg / valid_num; } /* Check if N out of M last values for FIELD are >= bd */ @@ -108,7 +123,7 @@ int j = (idx + i) % ARRAY_SIZE(lchan->meas_rep); int val = get_field(&lchan->meas_rep[j], field); - if (val >= be) + if (val >= be) /* implies that val < 0 will not count */ count++; if (count >= n) -- To view, visit https://gerrit.osmocom.org/5923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I33056225ead788340755e98113d72e1cbf3ebce6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Add a penalty timer list to the subscriber connection en... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5920 to look at the new patch set (#2). HO: Add a penalty timer list to the subscriber connection entity This penalty timer is used to temporarily block cells where handover or assignment failed or where handover is not allowed. This is usefull to prevent repeated handover attempts to broken cells or cells that have limited allowed distance. Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c 2 files changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/20/5920/2 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 4e07f26..d9dd2d4 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -71,6 +71,13 @@ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +/* penalty timers for handover */ +struct ho_penalty_timer { + struct llist_head entry; + uint8_t bts; + time_t timeout; +}; + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -104,6 +111,9 @@ /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; + + /* penalty timers for handover */ + struct llist_head ho_penalty_timers; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 2a0bf8f..a501db2 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -273,6 +273,7 @@ conn->bts = lchan->ts->trx->bts; lchan->conn = conn; INIT_LLIST_HEAD(&conn->ho_dtap_cache); + INIT_LLIST_HEAD(&conn->ho_penalty_timers); llist_add_tail(&conn->entry, &net->subscr_conns); return conn; } @@ -322,6 +323,8 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { + struct ho_penalty_timer *penalty; + if (!conn) return; @@ -346,6 +349,13 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); + /* flush handover penalty timers */ + while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, + struct ho_penalty_timer, entry))) { + llist_del(&penalty->entry); + talloc_free(penalty); + } + llist_del(&conn->entry); talloc_free(conn); } -- To view, visit https://gerrit.osmocom.org/5920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add handover algo 2 parameters; skip HO 1 if HO 2 is con... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5914 to look at the new patch set (#2). HO: add handover algo 2 parameters; skip HO 1 if HO 2 is configured Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 --- M include/osmocom/bsc/handover_cfg.h M src/libbsc/handover_decision.c M tests/handover_cfg.vty 3 files changed, 374 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/5914/2 diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 264cb1b..1b81235 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -1,6 +1,7 @@ #pragma once #include +#include struct vty; @@ -17,6 +18,11 @@ #define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" #define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" #define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" +#define HO_CFG_STR_2 " (HO algo 2 only)\n" +#define HO_CFG_STR_MIN "Minimum Level/Quality thresholds before triggering HO" HO_CFG_STR_2 +#define HO_CFG_STR_AFS_BIAS "Configure bias to prefer AFS (AMR on TCH/F) over other codecs" HO_CFG_STR_2 +#define HO_CFG_STR_MIN_TCH "Minimum free TCH timeslots before cell is considered congested" HO_CFG_STR_2 +#define HO_CFG_STR_PENALTY_TIME "Set penalty times to wait between repeated handovers" HO_CFG_STR_2 #define as_is(x) (x) @@ -30,6 +36,33 @@ return arg? 1 : 0; } +static inline bool a2tdma(const char *arg) +{ + if (!strcmp(arg, "full")) + return true; + return false; +} + +static inline const char *tdma2a(bool val) +{ + return val? "full" : "subset"; +} + +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, * function declarations or definitions... It is of the format @@ -59,6 +92,15 @@ "Disable in-call handover\n" \ "Enable in-call handover\n" \ "Enable/disable handover: ") \ + \ + HO_CFG_ONE_MEMBER(int, algorithm, 1, \ + "handover algorithm", "1|2", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Choose algorithm for handover decision\n" \ + "Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual," \ + " only.\n" \ + "Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several" \ + " cells. Consider available codecs. Prevent repeated handover by penalty timers.\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ @@ -97,7 +139,104 @@ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ - + \ + HO_CFG_ONE_MEMBER(bool, as_active, 0, \ + "handover assignment", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ + "Disable in-call assignment\n" \ + "Enable in-call assignment\n") \ + \ + HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ + "handover congestion-check", "disabled|<1-60>", \ + a2congestion_check_interval, "%s", congestion_check_interval2a, \ + HO_CFG_STR_HANDOVER \ + "Configure congestion check interval" HO_CFG_STR_2 \ + "Disable congestion checking, do not handover based on cell overload\n" \ + "Congestion check interval in seconds\n") \ + \ + HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ + "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ + HO_CFG_STR_HANDOVER \ + "Define measurement set of TDMA frames" HO_CFG_STR_2 \ + "Full set of 102/104 TDMA frames\n" \ + "Sub set of 4 TDMA frames (SACCH)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxlev, -100, \ + "handover min rxlev", "<-110--50>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How weak may RxLev of an MS become before triggering HO\n" \ + "minimum RxLev (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxqual, 5, \ + "handover min rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How bad may RxQual of an MS become before triggering HO\n" \ + "minimum RxQual (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxlev, 0, \ + "handover afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxLev improvement bias for AFS over other codecs\n" \ + "Virtual RxLev improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxqual, 0, \ + "handover afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxQual improvement bias for AFS over other codecs\n" \ + "Virtual RxQual improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchf_min_slots, 0, \ + "handover min-free-slots tch/f", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/F timeslots before cell is considered congested\n" \ + "Number of TCH/F slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchh_min_slots, 0, \ + "handover min-free-slots tch/h", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/H timeslots before cell is considered congested\n" \ + "Number of TCH/H slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, ho_max, 9999, \ + "handover max-handovers", "<1-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum number of concurrent handovers allowed per cell" HO_CFG_STR_2 \ + "Number\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_max_dist, 300, \ + "handover penalty-time max-distance", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after leaving this cell due to exceeding max distance\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_ho, 60, \ + "handover penalty-time failed-ho", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after handover failure to this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_as, 60, \ + "handover penalty-time failed-assignment", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after assignment failure in this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, retries, 0, \ + "handover retries", "<0-9>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Immediately retry on handover/assignment failure" HO_CFG_STR_2 \ + "Number of retries\n") \ + /* Declare public API for handover cfg parameters... */ diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 158fc1c..1e2e0d9 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -265,6 +265,10 @@ int av_rxlev; unsigned int pwr_interval; + /* If this cell does not use handover algorithm 1, then we're not responsible. */ + if (ho_get_algorithm(bts->ho) != 1) + return 0; + /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { case GSM_LCHAN_TCH_F: diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index e181797..5d5db05 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -143,30 +143,75 @@ handover power budget interval 23 ... !handover +OsmoBSC(config-net-bts)# ### Verify that 'min rxlev' value range stops at -50 +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node +OsmoBSC(config-net-bts)# handover min rxlev -111 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev -110 +OsmoBSC(config-net-bts)# handover min rxlev -50 +OsmoBSC(config-net-bts)# handover min rxlev -49 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev 50 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev default +% 'handover min rxlev' setting removed, now is -100 + OsmoBSC(config-net-bts)# ### Checking online help OsmoBSC(config-net-bts)# exit OsmoBSC(config-net)# list ... handover (0|1|default) + handover algorithm (1|2|default) handover window rxlev averaging (<1-10>|default) handover window rxqual averaging (<1-10>|default) handover window rxlev neighbor averaging (<1-10>|default) handover power budget interval (<1-99>|default) handover power budget hysteresis (<0-999>|default) handover maximum distance (<0-9999>|default) + handover assignment (0|1|default) + handover congestion-check (disabled|<1-60>|default) + handover tdma-measurement (full|subset|default) + handover min rxlev (<-110--50>|default) + handover min rxqual (<0-7>|default) + handover afs-bias rxlev (<0-20>|default) + handover afs-bias rxqual (<0-7>|default) + handover min-free-slots tch/f (<0-9999>|default) + handover min-free-slots tch/h (<0-9999>|default) + handover max-handovers (<1-9999>|default) + handover penalty-time max-distance (<0-99999>|default) + handover penalty-time failed-ho (<0-99999>|default) + handover penalty-time failed-assignment (<0-99999>|default) + handover retries (<0-9>|default) ... OsmoBSC(config-net)# handover? handover Handover options OsmoBSC(config-net)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + congestion-check Configure congestion check interval (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net)# handover window ? rxlev Received-Level averaging @@ -216,6 +261,85 @@ <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node +OsmoBSC(config-net)# handover congestion-check ? + disabled Disable congestion checking, do not handover based on cell overload + <1-60> Congestion check interval in seconds + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node + OsmoBSC(config-net)# ### Same on BTS level OsmoBSC(config-net)# bts 0 @@ -223,12 +347,27 @@ handover Handover options OsmoBSC(config-net-bts)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + congestion-check Configure congestion check interval (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net-bts)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net-bts)# handover window ? rxlev Received-Level averaging @@ -277,3 +416,82 @@ OsmoBSC(config-net-bts)# handover maximum distance ? <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover congestion-check ? + disabled Disable congestion checking, do not handover based on cell overload + <1-60> Congestion check interval in seconds + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net-bts)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net-bts)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net-bts)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net-bts)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:46 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:46 +0000 Subject: [ABANDON] osmo-bsc[master]: HO: add algorithm cfg; skip HO 1 if HO 2 is configured In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: HO: add algorithm cfg; skip HO 1 if HO 2 is configured ...................................................................... Abandoned squashed into 'add handover algo 2 parameters...' -- To view, visit https://gerrit.osmocom.org/5913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: If07c0a7b84937ab92948e9b71b2496a765946020 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Change debug category at handover decision: DHO -> DHODEC In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5915 to look at the new patch set (#2). HO: Change debug category at handover decision: DHO -> DHODEC Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 --- M src/libbsc/handover_decision.c 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/15/5915/2 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 1e2e0d9..0693613 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -65,7 +65,7 @@ /* resolve the gsm_bts structure for the best neighbor */ new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic); if (!new_bts) { - LOGP(DHO, LOGL_NOTICE, "unable to determine neighbor BTS " + LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS " "for ARFCN %u BSIC %u ?!?\n", arfcn, bsic); return -EINVAL; } @@ -104,7 +104,7 @@ window = nmp->rxlev_cnt; /* this should never happen */ if (window <= 0) { - LOGP(DHO, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); + LOGP(DHODEC, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); return 0; } @@ -232,26 +232,26 @@ if (!best_cell) return 0; - LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", + LOGP(DHODEC, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", gsm_ts_name(mr->lchan->ts), best_cell->arfcn); if (!ho_get_ho_active(bts->ho)) { - LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n"); + LOGPC(DHODEC, LOGL_INFO, "Skipping, Handover disabled\n"); return 0; } rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); switch (rc) { case 0: - LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); + LOGPC(DHODEC, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); break; case -ENOSPC: - LOGPC(DHO, LOGL_INFO, "No channel available\n"); + LOGPC(DHODEC, LOGL_INFO, "No channel available\n"); break; case -EBUSY: - LOGPC(DHO, LOGL_INFO, "Handover already active\n"); + LOGPC(DHODEC, LOGL_INFO, "Handover already active\n"); break; default: - LOGPC(DHO, LOGL_ERROR, "Unknown error\n"); + LOGPC(DHODEC, LOGL_ERROR, "Unknown error\n"); } return rc; } -- To view, visit https://gerrit.osmocom.org/5915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Count number of free timeslot on a given BTS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5916 to look at the new patch set (#2). HO: Count number of free timeslot on a given BTS This is needed for handover algorithm to balance free slots and to prevent congestion of one cell, while other cells still have free capacities. Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b --- M include/osmocom/bsc/chan_alloc.h M src/libbsc/chan_alloc.c 2 files changed, 67 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/5916/2 diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index f2a75c5..748e9cd 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -24,6 +24,9 @@ struct gsm_subscriber_connection; +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan); + /* Allocate a logical channel (SDCCH, TCH, ...) */ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 9946628..b3056da 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -68,6 +68,70 @@ return true; } +static int trx_count_free_ts(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx_ts *ts; + int j, ss; + int count = 0; + + if (!trx_is_usable(trx)) + return 0; + + for (j = 0; j < 8; j++) { + enum gsm_phys_chan_config ts_pchan_is; + ts = &trx->ts[j]; + if (!ts_is_usable(ts)) + continue; + + ts_pchan_is = ts_pchan(ts); + + if (ts_pchan_is == GSM_PCHAN_PDCH) { + /* Dynamic timeslots in PDCH mode will become TCH if needed. */ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + continue; + + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + else if (pchan == GSM_PCHAN_TCH_H) + count += 2; + continue; + + default: + /* Not dynamic, not applicable. */ + continue; + } + } + + if (ts_pchan_is != pchan) + continue; + /* check if all sub-slots are allocated yet */ + for (ss = 0; ss < ts_subslots(ts); ss++) { + struct gsm_lchan *lc = &ts->lchan[ss]; + if (lc->type == GSM_LCHAN_NONE && + lc->state == LCHAN_S_NONE) + count++; + } + } + + return count; +} + +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx *trx; + int count = 0; + + llist_for_each_entry(trx, &bts->trx_list, list) + count += trx_count_free_ts(trx, pchan); + + return count; +} + static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, enum gsm_phys_chan_config dyn_as_pchan) -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5917 to look at the new patch set (#2). HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() The name sounds like it is looking up neighbors, instead it simply traverses the global list of BTSes. Rename to reflect what it does. Move FIXME comment to its logical place: at the invocation of bts_by_arfcn_bsic(). Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd --- M src/libbsc/handover_decision.c 1 file changed, 13 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/5917/2 diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 0693613..93ca28b 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -35,21 +35,16 @@ #include #include -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic) +/* Find BTS by ARFCN and BSIC */ +static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, + uint16_t arfcn, uint8_t bsic) { - struct gsm_bts *neigh; - /* FIXME: use some better heuristics here to determine which cell - * using this ARFCN really is closest to the target cell. For - * now we simply assume that each ARFCN will only be used by one - * cell */ + struct gsm_bts *bts; - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - /* FIXME: this is probably returning the same bts again!? */ - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->c0->arfcn == arfcn && + bts->bsic == bsic) + return bts; } return NULL; @@ -63,7 +58,11 @@ struct gsm_bts *new_bts; /* resolve the gsm_bts structure for the best neighbor */ - new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic); + /* FIXME: use some better heuristics here to determine which cell + * using this ARFCN really is closest to the target cell. For + * now we simply assume that each ARFCN will only be used by one + * cell */ + new_bts = bts_by_arfcn_bsic(lchan->ts->trx->bts->network, arfcn, bsic); if (!new_bts) { LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS " "for ARFCN %u BSIC %u ?!?\n", arfcn, bsic); -- To view, visit https://gerrit.osmocom.org/5917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: make bts_by_arfcn_bsic() public In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5918 to look at the new patch set (#2). HO: make bts_by_arfcn_bsic() public Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 --- M include/osmocom/bsc/handover_decision.h M src/libbsc/handover_decision.c 2 files changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/5918/2 diff --git a/include/osmocom/bsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h index fe551ca..09430d8 100644 --- a/include/osmocom/bsc/handover_decision.h +++ b/include/osmocom/bsc/handover_decision.h @@ -1,3 +1,5 @@ #pragma once +struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, uint16_t arfcn, uint8_t bsic); + void handover_decision_1_init(void); diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 93ca28b..19fb3ab 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -36,8 +36,8 @@ #include /* Find BTS by ARFCN and BSIC */ -static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, - uint16_t arfcn, uint8_t bsic) +struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, + uint16_t arfcn, uint8_t bsic) { struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/5918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 03:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 03:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add queue to cache DTAP messages during handover/assignment In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5919 to look at the new patch set (#2). HO: add queue to cache DTAP messages during handover/assignment Add ho_dtap_cache to gsm_subscriber_connection, a stock msgb queue to be used with msgb_enqueue() and msgb_dequeue(). Keep a counter of queue length, to enforce a sane maximum counter for cached messages. So far a hardcoded maximum of 23 messages will be cached. Have balanced ho_dtap_cache_add() and ho_dtap_cache_flush() functions. The original patch was by jolly, but I have basically completely replaced it with the simpler msgb queue pattern. Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c 2 files changed, 77 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/19/5919/2 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6659b72..4e07f26 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -100,6 +100,10 @@ /* buffer/cache for classmark of the ME of the subscriber */ struct gsm_classmark classmark; + + /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ + struct llist_head ho_dtap_cache; + unsigned int ho_dtap_cache_len; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 545cf36..2a0bf8f 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -39,6 +39,8 @@ #define GSM0808_T10_VALUE 6, 0 +#define HO_DTAP_CACHE_MSGB_CB_LINK_ID 0 +#define HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1 static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind); static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id); @@ -270,8 +272,52 @@ conn->lchan = lchan; conn->bts = lchan->ts->trx->bts; lchan->conn = conn; + INIT_LLIST_HEAD(&conn->ho_dtap_cache); llist_add_tail(&conn->entry, &net->subscr_conns); return conn; +} + +static void ho_dtap_cache_add(struct gsm_subscriber_connection *conn, struct msgb *msg, + int link_id, bool allow_sacch) +{ + if (conn->ho_dtap_cache_len >= 23) { + LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages," + " already reached sane maximum of %u cached messages\n", + bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); + msgb_free(msg); + return; + } + conn->ho_dtap_cache_len ++; + LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n", + bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); + msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id; + msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0; + msgb_enqueue(&conn->ho_dtap_cache, msg); +} + +static void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send) +{ + struct msgb *msg; + unsigned int flushed_count = 0; + + if (conn->secondary_lchan || conn->ho_lchan) { + LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, handover/assignment is still ongoing\n", + bsc_subscr_name(conn->bsub)); + send = 0; + } + + while ((msg = msgb_dequeue(&conn->ho_dtap_cache))) { + conn->ho_dtap_cache_len --; + flushed_count ++; + if (send) { + int link_id = (int)msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID]; + bool allow_sacch = !!msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH]; + LOGP(DHO, LOGL_DEBUG, "%s: Sending cached DTAP message after handover/assignment (%u/%u)\n", + bsc_subscr_name(conn->bsub), flushed_count, conn->ho_dtap_cache_len); + gsm0808_submit_dtap(conn, msg, link_id, allow_sacch); + } else + msgb_free(msg); + } } void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) @@ -297,6 +343,9 @@ conn->secondary_lchan->conn = NULL; } + /* drop pending messages */ + ho_dtap_cache_flush(conn, 0); + llist_del(&conn->entry); talloc_free(conn); } @@ -319,6 +368,12 @@ "Called submit dtap without an lchan.\n"); msgb_free(msg); return -1; + } + + /* buffer message during assignment / handover */ + if (conn->secondary_lchan || conn->ho_lchan) { + ho_dtap_cache_add(conn, msg, link_id, !! allow_sacch); + return 0; } sapi = link_id & 0x7; @@ -454,6 +509,9 @@ osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); /* FIXME: release old channel */ + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); + return; } @@ -475,6 +533,9 @@ lchan_release(conn->lchan, 0, RSL_REL_LOCAL_END); conn->lchan = conn->secondary_lchan; conn->secondary_lchan = NULL; + + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN) rsl_ipacc_crcx(conn->lchan); @@ -504,6 +565,9 @@ osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); /* FIXME: release allocated new channel */ + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); + return; } @@ -518,6 +582,9 @@ lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); conn->secondary_lchan = NULL; } + + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { @@ -584,6 +651,9 @@ sig.mr = NULL; osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); /* FIXME: release old channel */ + + /* send pending messages, if any */ + ho_dtap_cache_flush(msg->lchan->conn, 1); } /* Chapter 9.1.17 Handover Failure */ @@ -599,6 +669,9 @@ sig.mr = NULL; osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); /* FIXME: release allocated new channel */ + + /* send pending messages, if any */ + ho_dtap_cache_flush(msg->lchan->conn, 1); } -- To view, visit https://gerrit.osmocom.org/5919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 04:03:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 04:03:26 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5921 to look at the new patch set (#2). HO: Implement load based handover, as handover_decision_2.c Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M include/osmocom/bsc/handover.h M include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_decision_2.h M include/osmocom/bsc/handover_vty.h M include/osmocom/bsc/signal.h M src/libbsc/Makefile.am M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c A src/libbsc/handover_decision_2.c M src/libbsc/handover_logic.c M src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/gsm_data.c M src/libcommon/handover_cfg.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M tests/Makefile.am A tests/handover/Makefile.am A tests/handover/handover_test.c A tests/handover/handover_test.ok M tests/testsuite.at 27 files changed, 3,859 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/5921/2 diff --git a/configure.ac b/configure.ac index d756970..fc4678f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,7 @@ tests/subscr/Makefile tests/nanobts_omlattr/Makefile tests/bssap/Makefile + tests/handover/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 699aeb3..a3d9adf 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -27,6 +27,7 @@ handover.h \ handover_cfg.h \ handover_decision.h \ + handover_decision_2.h \ handover_vty.h \ ipaccess.h \ meas_feed.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..c24e22a 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -74,8 +75,8 @@ /* penalty timers for handover */ struct ho_penalty_timer { struct llist_head entry; - uint8_t bts; - time_t timeout; + uint8_t bts_nr; + unsigned int timeout; }; /* active radio connection of a mobile subscriber */ @@ -112,8 +113,18 @@ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; - /* penalty timers for handover */ + /* failure count and penalty timers for handover */ + int ho_failure; struct llist_head ho_penalty_timers; + + /* "Codec List (MSC Preferred)" as received by the BSSAP Assignment Request. 3GPP 48.008 + * 3.2.2.103 says: + * The "Codec List (MSC Preferred)" shall not include codecs + * that are not supported by the MS. + * i.e. by heeding the "Codec list (MSC Preferred)", we inherently heed the MS bearer + * capabilities, which the MSC is required to translate into the codec list. */ + struct gsm0808_speech_codec_list codec_list; + bool codec_list_present; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { @@ -243,7 +254,12 @@ uint16_t network_code; int a5_encryption; int neci; + struct handover_cfg *ho; + struct { + unsigned int congestion_check_interval_s; + struct osmo_timer_list congestion_check_timer; + } ho2; struct rate_ctr_group *bsc_ctrs; @@ -443,4 +459,11 @@ bool classmark_is_r99(struct gsm_classmark *cm); +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout); +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 86c5ca9..776e047 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -269,6 +269,7 @@ struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; + uint8_t meas_rep_last_seen_nr; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index a9349ee..f764456 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -5,6 +5,8 @@ struct gsm_subscriber_connection; int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *bts, + enum gsm_chan_t new_lchan_type); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 1b81235..7ef27ee 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -10,6 +10,8 @@ * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ struct handover_cfg; +#define HO_CFG_CONGESTION_CHECK_DEFAULT 10 + struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); #define HO_CFG_STR_HANDOVER "Handover options\n" @@ -46,22 +48,6 @@ static inline const char *tdma2a(bool val) { return val? "full" : "subset"; -} - -static inline const int a2congestion_check_interval(const char *arg) -{ - if (!strcmp(arg, "disabled")) - return 0; - return atoi(arg); -} - -static inline const char *congestion_check_interval2a(int val) -{ - static char str[9]; - if (val < 1 - || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) - return "disabled"; - return str; } /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, @@ -146,14 +132,6 @@ "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ "Disable in-call assignment\n" \ "Enable in-call assignment\n") \ - \ - HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ - "handover congestion-check", "disabled|<1-60>", \ - a2congestion_check_interval, "%s", congestion_check_interval2a, \ - HO_CFG_STR_HANDOVER \ - "Configure congestion check interval" HO_CFG_STR_2 \ - "Disable congestion checking, do not handover based on cell overload\n" \ - "Congestion check interval in seconds\n") \ \ HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ diff --git a/include/osmocom/bsc/handover_decision_2.h b/include/osmocom/bsc/handover_decision_2.h new file mode 100644 index 0000000..f245b07 --- /dev/null +++ b/include/osmocom/bsc/handover_decision_2.h @@ -0,0 +1,9 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC */ + +#pragma once +struct gsm_bts; + +void hodec2_init(struct gsm_network *net); + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval); +void hodec2_congestion_check(struct gsm_network *net); diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h index 48af136..6ad5276 100644 --- a/include/osmocom/bsc/handover_vty.h +++ b/include/osmocom/bsc/handover_vty.h @@ -4,4 +4,5 @@ #include void ho_vty_init(); -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); +void ho_vty_write_net(struct vty *vty, struct gsm_network *net); +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts); diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 9c0d5a3..1c8b51e 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -104,6 +104,7 @@ enum signal_global { S_GLOBAL_BTS_CLOSE_OM, + S_GLOBAL_BTS_NEW, }; /* SS_RF signals */ diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index d118f44..7e088e5 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -58,5 +58,6 @@ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ handover_vty.c \ + handover_decision_2.c \ $(NULL) diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index bdd86a9..82b21b9 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1523,8 +1523,9 @@ } mr->lchan->meas_rep_count++; - LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", - gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + mr->lchan->meas_rep_last_seen_nr = mr->nr; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_count++=%d meas_rep_last_seen_nr=%u\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count, mr->lchan->meas_rep_last_seen_nr); print_meas_rep(msg->lchan, mr); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a501db2..73bdee5 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -323,8 +323,6 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { - struct ho_penalty_timer *penalty; - if (!conn) return; @@ -349,12 +347,7 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); - /* flush handover penalty timers */ - while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, - struct ho_penalty_timer, entry))) { - llist_del(&penalty->entry); - talloc_free(penalty); - } + conn_penalty_timer_clear(conn, NULL); llist_del(&conn->entry); talloc_free(conn); @@ -672,8 +665,8 @@ struct lchan_signal_data sig; struct gsm48_hdr *gh = msgb_l3(msg); - DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", - rr_cause_name(gh->data[0])); + DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + DEBUGP(DHO, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); sig.lchan = msg->lchan; sig.mr = NULL; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index a304e86..d4591b7 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -795,7 +795,7 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); - ho_vty_write(vty, " ", bts->ho); + ho_vty_write_bts(vty, bts); config_write_bts_model(vty, bts); } @@ -827,7 +827,7 @@ vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - ho_vty_write(vty, " ", gsmnet->ho); + ho_vty_write_net(vty, gsmnet); VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index b3056da..95a9fdd 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -132,6 +132,7 @@ return count; } + static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, enum gsm_phys_chan_config dyn_as_pchan) @@ -414,6 +415,7 @@ /* reset measurement report counter and index */ lchan->meas_rep_count = 0; lchan->meas_rep_idx = 0; + lchan->meas_rep_last_seen_nr = 255; /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/handover_decision_2.c b/src/libbsc/handover_decision_2.c new file mode 100644 index 0000000..2286147 --- /dev/null +++ b/src/libbsc/handover_decision_2.c @@ -0,0 +1,1761 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC. */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Andreas Eversberg + * Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOGPHOBTS(bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) + +#define LOGPHOLCHAN(lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_bts->nr, \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define REQUIREMENT_A_TCHF 0x01 +#define REQUIREMENT_B_TCHF 0x02 +#define REQUIREMENT_C_TCHF 0x04 +#define REQUIREMENT_A_TCHH 0x10 +#define REQUIREMENT_B_TCHH 0x20 +#define REQUIREMENT_C_TCHH 0x40 +#define REQUIREMENT_TCHF_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_B_TCHF | REQUIREMENT_C_TCHF) +#define REQUIREMENT_TCHH_MASK (REQUIREMENT_A_TCHH | REQUIREMENT_B_TCHH | REQUIREMENT_C_TCHH) +#define REQUIREMENT_A_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_A_TCHH) +#define REQUIREMENT_B_MASK (REQUIREMENT_B_TCHF | REQUIREMENT_B_TCHH) +#define REQUIREMENT_C_MASK (REQUIREMENT_C_TCHF | REQUIREMENT_C_TCHH) + +struct ho_candidate { + struct gsm_lchan *lchan; /* candidate for whom */ + struct gsm_bts *bts; /* target BTS */ + uint8_t requirements; /* what is fulfilled */ + int avg; /* average RX level */ +}; + +enum ho_reason { + HO_REASON_INTERFERENCE, + HO_REASON_BAD_QUALITY, + HO_REASON_LOW_RXLEVEL, + HO_REASON_MAX_DISTANCE, + HO_REASON_BETTER_CELL, + HO_REASON_CONGESTION, +}; + +static const struct value_string ho_reason_names[] = { + { HO_REASON_INTERFERENCE, "interference (bad quality)" }, + { HO_REASON_BAD_QUALITY, "bad quality" }, + { HO_REASON_LOW_RXLEVEL, "low rxlevel" }, + { HO_REASON_MAX_DISTANCE, "maximum allowed distance" }, + { HO_REASON_BETTER_CELL, "better cell" }, + { HO_REASON_CONGESTION, "congestion" }, + {0, NULL} +}; + +static const char *ho_reason_name(int value) +{ + return get_value_string(ho_reason_names, value); +} + + +static bool ho2_initialized = false; +static enum ho_reason global_ho_reason; + +static void congestion_check_cb(void *arg); + +/* This function gets called on ho2 init, whenever the congestion check interval is changed, and also + * when the timer has fired to trigger again after the next congestion check timeout. */ +static void reinit_congestion_timer(struct gsm_network *net) +{ + int congestion_check_interval_s; + bool was_active; + + /* Don't setup timers from VTY config parsing before the main program has actually initialized + * the data structures. */ + if (!ho2_initialized) + return; + + was_active = net->ho2.congestion_check_timer.active; + if (was_active) + osmo_timer_del(&net->ho2.congestion_check_timer); + + congestion_check_interval_s = net->ho2.congestion_check_interval_s; + if (congestion_check_interval_s < 1) { + if (was_active) + LOGP(DHODEC, LOGL_NOTICE, "HO algorithm 2: Disabling congestion check\n"); + return; + } + + LOGP(DHODEC, LOGL_DEBUG, "HO algorithm 2: next periodical congestion check in %u seconds\n", + congestion_check_interval_s); + + osmo_timer_setup(&net->ho2.congestion_check_timer, + congestion_check_cb, net); + osmo_timer_schedule(&net->ho2.congestion_check_timer, + congestion_check_interval_s, 0); +} + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval) +{ + net->ho2.congestion_check_interval_s = new_interval; + reinit_congestion_timer(net); +} + +/* did we get a RXLEV for a given cell in the given report? Mark matches as MRC_F_PROCESSED. */ +static struct gsm_meas_rep_cell *cell_in_rep(struct gsm_meas_rep *mr, uint16_t arfcn, uint8_t bsic) +{ + int i; + + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + + if (mrc->arfcn != arfcn) + continue; + if (mrc->bsic != bsic) + continue; + + return mrc; + } + return NULL; +} + +/* obtain averaged rxlev for given neighbor */ +static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window) +{ + unsigned int i, idx; + int avg = 0; + + /* reduce window to the actual number of existing measurements */ + if (window > nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window <= 0) + return 0; + + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), + nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), + window); + + for (i = 0; i < window; i++) { + int j = (idx+i) % ARRAY_SIZE(nmp->rxlev); + + avg += nmp->rxlev[j]; + } + + return avg / window; +} + +/* Find empty slot or the worst neighbor. */ +static struct neigh_meas_proc *find_unused_or_worst_neigh(struct gsm_lchan *lchan) +{ + struct neigh_meas_proc *nmp_worst = NULL; + int worst; + int j; + + /* First try to find an empty/unused slot. */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + if (!nmp->arfcn) + return nmp; + } + + /* No empty slot found. Return worst neighbor to be evicted. */ + worst = 0; /* (overwritten on first loop, but avoid compiler warning) */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + int avg = neigh_meas_avg(nmp, MAX_WIN_NEIGH_AVG); + if (nmp_worst && avg >= worst) + continue; + worst = avg; + nmp_worst = nmp; + } + + return nmp_worst; +} + +/* process neighbor cell measurement reports */ +static void process_meas_neigh(struct gsm_meas_rep *mr) +{ + int i, j, idx; + + /* for each reported cell, try to update global state */ + for (j = 0; j < ARRAY_SIZE(mr->lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &mr->lchan->neigh_meas[j]; + unsigned int idx; + struct gsm_meas_rep_cell *mrc; + + /* skip unused entries */ + if (!nmp->arfcn) + continue; + + mrc = cell_in_rep(mr, nmp->arfcn, nmp->bsic); + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + if (mrc) { + nmp->rxlev[idx] = mrc->rxlev; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + mrc->flags |= MRC_F_PROCESSED; + } else { + nmp->rxlev[idx] = 0; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr); + } + nmp->rxlev_cnt++; + } + + /* iterate over list of reported cells, check if we did not + * process all of them */ + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + struct neigh_meas_proc *nmp; + + if (mrc->flags & MRC_F_PROCESSED) + continue; + + nmp = find_unused_or_worst_neigh(mr->lchan); + + nmp->arfcn = mrc->arfcn; + nmp->bsic = mrc->bsic; + + nmp->rxlev_cnt = 0; + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + nmp->rxlev[idx] = mrc->rxlev; + nmp->rxlev_cnt++; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u new in report rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + + mrc->flags |= MRC_F_PROCESSED; + } +} + +static bool codec_type_is_supported(struct gsm_subscriber_connection *conn, + enum gsm0808_speech_codec_type type) +{ + int i; + struct gsm0808_speech_codec_list *clist = &conn->codec_list; + + if (!conn->codec_list_present) { + /* We don't have a list of supported codecs. This should never happen. */ + LOGPHOLCHAN(conn->lchan, LOGL_ERROR, + "No Speech Codec List present, accepting all codecs\n"); + return true; + } + + for (i = 0; i < clist->len; i++) { + if (clist->codec[i].type == type) { + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", + gsm0808_speech_codec_type_name(type)); + return true; + } + } + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", + gsm0808_speech_codec_type_name(type)); + return false; +} + +/* + * Check what requirements the given cell fulfills. + * A bit mask of fulfilled requirements is returned. + * + * Target cell requirement A -- ability to service the call + * + * In order to successfully handover/assign to a better cell, the target cell + * must be able to continue the current call. Therefore the cell must fulfill + * the following criteria: + * + * * The handover must be enabled for the target cell, if it differs from the + * originating cell. + * * The assignment must be enabled for the cell, if it equals the current + * cell. + * * The handover penalty timer must not run for the cell. + * * If FR, EFR or HR codec is used, the cell must support this codec. + * * If FR or EFR codec is used, the cell must have a TCH/F slot type + * available. + * * If HR codec is used, the cell must have a TCH/H slot type available. + * * If AMR codec is used, the cell must have a TCH/F slot available, if AFS + * is supported by mobile and BTS. + * * If AMR codec is used, the cell must have a TCH/H slot available, if AHS + * is supported by mobile and BTS. + * * osmo-nitb with built-in MNCC application: + * o If AMR codec is used, the cell must support AMR codec with equal codec + * rate or rates. (not meaning TCH types) + * * If defined, the number of maximum unsynchronized handovers to this cell + * may not be exceeded. (This limits processing load for random access + * bursts.) + * + * + * Target cell requirement B -- avoid congestion + * + * In order to prevent congestion of a target cell, the cell must fulfill the + * requirement A, but also: + * + * * The minimum free channels, that are defined for that cell must be + * maintained after handover/assignment. + * * The minimum free channels are defined for TCH/F and TCH/H slot types + * individually. + * + * + * Target cell requirement C -- balance congestion + * + * In order to balance congested cells, the target cell must fulfill the + * requirement A, but also: + * + * * The target cell (which is congested also) must have more or equal free + * slots after handover/assignment. + * * The number of free slots are checked for TCH/F and TCH/H slot types + * individually. + */ +static uint8_t check_requirements(struct gsm_lchan *lchan, struct gsm_bts *bts, int tchf_count, int tchh_count) +{ + int count; + uint8_t requirement = 0; + unsigned int penalty_time; + struct gsm_bts *current_bts = lchan->ts->trx->bts; + + /* Requirement A */ + + /* the handover/assignment must not be disabled */ + if (current_bts == bts) { + if (!ho_get_as_active(bts->ho)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Assignment disabled\n"); + return 0; + } + } else { + if (!ho_get_ho_active(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, handover is disabled in target BTS\n"); + return 0; + } + } + + /* the handover penalty timer must not run for this bts */ + penalty_time = conn_penalty_timer_remaining(lchan->conn, bts); + if (penalty_time) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, target BTS still in penalty time" + " (%u seconds left)\n", penalty_time); + return 0; + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + + /* compatibility check for codecs. + * if so, the candidates for full rate and half rate are selected */ + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_V1: + switch (lchan->type) { + case GSM_LCHAN_TCH_F: /* mandatory */ + requirement |= REQUIREMENT_A_TCHF; + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + case GSM_LCHAN_TCH_H: + if (!bts->codec.hr) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "tch_mode='%s' type='%s' not supported\n", + get_value_string(gsm48_chan_mode_names, + lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR1)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHAN(lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode)); + return 0; + } + break; + case GSM48_CMODE_SPEECH_EFR: + if (!bts->codec.efr) { + LOGPHOBTS(bts, LOGL_DEBUG, "EFR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR2)) + requirement |= REQUIREMENT_A_TCHF; + break; + case GSM48_CMODE_SPEECH_AMR: + if (!bts->codec.amr) { + LOGPHOBTS(bts, LOGL_DEBUG, "AMR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR3)) + requirement |= REQUIREMENT_A_TCHF; + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR3)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "Not even considering: src is not a SPEECH mode lchan\n"); + return 0; + } + + /* no candidate, because new cell is incompatible */ + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because codec of MS and BTS are incompatible\n"); + return 0; + } + + /* remove slot types that are not available */ + if (!tchf_count && requirement & REQUIREMENT_A_TCHF) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, since all TCH/F lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + } + if (!tchh_count && requirement & REQUIREMENT_A_TCHH) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, since all TCH/H lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because no suitable slots available\n"); + return 0; + } + + /* omit same channel type on same BTS (will not change anything) */ + if (bts == current_bts) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, already on TCH/F in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + break; + case GSM_LCHAN_TCH_H: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, already on TCH/H in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Reassignment within cell not an option, no differing channel types available\n"); + return 0; + } + } + +#ifdef LEGACY + // This was useful in osmo-nitb. We're in osmo-bsc now and have no idea whether the osmo-msc does + // internal or external call control. Maybe a future config switch wants to add this behavior? + /* Built-in call control requires equal codec rates. Remove rates that are not equal. */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && current_bts->network->mncc_recv != mncc_sock_from_cc) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_full, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_full, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + case GSM_LCHAN_TCH_H: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_half, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_half, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, cannot provide identical codec rate\n"); + return 0; + } + } +#endif + + /* the maximum number of unsynchonized handovers must no be exceeded */ + if (current_bts != bts + && bsc_ho_count(bts, true) >= ho_get_ho_max(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, number of allowed handovers (%d) would be exceeded\n", + ho_get_ho_max(bts->ho)); + return 0; + } + + /* Requirement B */ + + /* the minimum free timeslots that are defined for this cell must + * be maintained _after_ handover/assignment */ + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= ho_get_tchf_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be congested after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= ho_get_tchh_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be congested after HO\n"); + } + } + + /* Requirement C */ + + /* the nr of free timeslots of the target cell must be >= the + * free slots of the current cell _after_ handover/assignment */ + count = bts_count_free_ts(current_bts, + (lchan->type == GSM_LCHAN_TCH_H) ? + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be less congested in target than source cell after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be less congested in target than source cell after HO\n"); + } + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); + + /* return mask of fulfilled requirements */ + return requirement; +} + +/* Trigger handover or assignment depending on the target BTS */ +static int trigger_handover_or_assignment(struct gsm_lchan *lchan, struct gsm_bts *new_bts, uint8_t requirements) +{ + struct gsm_bts *current_bts = lchan->ts->trx->bts; + int afs_bias = 0; + bool full_rate = false; + + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); + + /* afs_bias becomes > 0, if AFS is used and is improved */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + afs_bias = ho_get_afs_bias_rxlev(new_bts->ho); + + /* select TCH rate, prefer TCH/F if AFS is improved */ + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + /* keep on full rate, if TCH/F is a candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK)) { + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + full_rate = true; + break; + } + /* change to half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + break; + case GSM_LCHAN_TCH_H: + /* change to full rate if AFS is improved and a candidate */ + if (afs_bias > 0 && (requirements & REQUIREMENT_TCHF_MASK)) { + full_rate = true; + LOGPHOLCHAN(lchan, LOGL_DEBUG, "[Improve AHS->AFS]\n"); + break; + } + /* change to full rate if the only candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK) + && !(requirements & REQUIREMENT_TCHH_MASK)) { + full_rate = true; + break; + } + /* keep on half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + break; + default: + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, "lchan is neither TCH/F nor TCH/H, aborting ho/as\n"); + return -EINVAL; + } + + /* trigger handover or assignment */ + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering assignment to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + "Triggering handover to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + + return bsc_handover_start_lchan_change(lchan, current_bts == new_bts? NULL : new_bts, + full_rate? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H); +} + +/* debug collected candidates */ +static inline void debug_candidate(struct ho_candidate *candidate, + int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +{ + if (neighbor) + LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " + "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), + rxlev2dbm(candidate->avg)); + else + LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", + candidate->bts->nr, rxlev2dbm(candidate->avg)); + + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " + "%d\n", tchf_count, ho_get_tchf_min_slots(candidate->bts->ho)); + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " + "%d\n", tchh_count, ho_get_tchh_min_slots(candidate->bts->ho)); + + if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); + if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) + == REQUIREMENT_A_TCHF) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); + + if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); + if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) + == REQUIREMENT_A_TCHH) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); +} + +/* add candidate for re-assignment within the current cell */ +static void collect_assignment_candidate(struct gsm_lchan *lchan, struct ho_candidate *clist, + unsigned int *candidates, int av_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct ho_candidate *c; + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = bts; + c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); + c->avg = av_rxlev; + debug_candidate(c, 0, 0, tchf_count, tchh_count); + (*candidates)++; +} + +/* add candidates for handover to all neighbor cells */ +static void collect_handover_candidate(struct gsm_lchan *lchan, struct neigh_meas_proc *nmp, + struct ho_candidate *clist, unsigned int *candidates, + bool include_weaker_rxlev, int av_rxlev, + int *neighbors_count) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct gsm_bts *neighbor_bts; + int avg; + struct ho_candidate *c; + int min_rxlev; + + /* skip empty slots */ + if (nmp->arfcn == 0) + return; + + if (neighbors_count) + (*neighbors_count)++; + + /* skip if measurement report is old */ + if (nmp->last_seen_nr != lchan->meas_rep_last_seen_nr) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "neighbor ARFCN %u measurement report is old" + " (nmp->last_seen_nr=%u lchan->meas_rep_last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr, lchan->meas_rep_last_seen_nr); + return; + } + + neighbor_bts = bts_by_arfcn_bsic(bts->network, nmp->arfcn, nmp->bsic); + if (!neighbor_bts) { + LOGPHOBTS(bts, LOGL_DEBUG, "neighbor ARFCN %u does not belong to this network\n", + nmp->arfcn); + return; + } + + /* in case we have measurements of our bts, due to misconfiguration */ + if (neighbor_bts == bts) { + LOGPHOBTS(bts, LOGL_ERROR, "Configuration error: this BTS appears as its own neighbor\n"); + return; + } + + /* caculate average rxlev for this cell over the window */ + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); + + /* Heed rxlev hysteresis only if the RXLEV/RXQUAL/TA levels of the MS aren't critically bad and + * we're just looking for an improvement. If levels are critical, we desperately need a handover + * and thus skip the hysteresis check. */ + if (!include_weaker_rxlev) { + unsigned int pwr_hyst = ho_get_pwr_hysteresis(bts->ho); + if (avg <= (av_rxlev + pwr_hyst)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " or equal than current RX level (%d) + hysteresis (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), rxlev2dbm(av_rxlev), pwr_hyst); + return; + } + } + + /* if the minimum level is not reached */ + min_rxlev = ho_get_min_rxlev(neighbor_bts->ho); + if (rxlev2dbm(avg) < min_rxlev) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " than its minimum required RX level (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), min_rxlev); + return; + } + + tchf_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_H); + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = neighbor_bts; + c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, + tchh_count); + c->avg = avg; + debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + (*candidates)++; +} + +static void collect_candidates_for_lchan(struct gsm_lchan *lchan, + struct ho_candidate *clist, unsigned int *candidates, + int *_av_rxlev, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev; + unsigned int candidates_was; + bool assignment; + bool handover; + int neighbors_count = 0; + unsigned int rxlev_avg_win = ho_get_rxlev_avg_win(bts->ho); + + OSMO_ASSERT(candidates); + candidates_was = *candidates; + + /* caculate average rxlev for this cell over the window */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + rxlev_avg_win); + if (_av_rxlev) + *_av_rxlev = av_rxlev; + + /* in case there is no measurment report (yet) */ + if (av_rxlev < 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Not collecting candidates, not enough measurements" + " (got %d, want %u)\n", + lchan->meas_rep_count, rxlev_avg_win); + return; + } + + assignment = ho_get_as_active(bts->ho); + handover = ho_get_ho_active(bts->ho); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", + assignment ? " Assignment" : "", + assignment && handover ? " and" : "", + handover ? " Handover" : ""); + + if (assignment) + collect_assignment_candidate(lchan, clist, candidates, av_rxlev); + + if (handover) { + int i; + for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++) { + collect_handover_candidate(lchan, &lchan->neigh_meas[i], + clist, candidates, + include_weaker_rxlev, av_rxlev, &neighbors_count); + } + } + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", + *candidates - candidates_was, neighbors_count, *candidates); +} + +/* + * Search for a alternative / better cell. + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * + * If one or more 'better cells' are available, check the current and neighbor + * cell measurements in descending order of their RX levels (down-link): + * + * * Select the best candidate that fulfills requirement B (no congestion + * after handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, do not perform handover nor + * assignment. + * + * If the RX level (down-link) or RX quality (down-link) of the current cell is + * below minimum acceptable level, or if the maximum allowed timing advance is + * reached or exceeded, check the RX levels (down-link) of the current and + * neighbor cells in descending order of their levels: (bad BTS case) + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, select the best candidate that + * fulfills requirement A (ignore congestion after handover or assignment) + * and trigger handover or assignment. + * * If no candidate fulfills requirement A, do not perform handover nor + * assignment. + * + * RX levels (down-link) of current and neighbor cells: + * + * * The RX levels of the current cell and neighbor cells are improved by a + * given offset, if AFS (AMR on TCH/F) is used or is a candidate for + * handover/assignment. + * * If AMR is used, the requirement for handover is checked for TCH/F and + * TCH/H. Both results (if any) are used as a candidate. + * * If AMR is used, the requirement for assignment to a different TCH slot + * rate is checked. The result (if available) is used as a candidate. + * + * If minimum RXLEV, minimum RXQUAL or maximum TA are exceeded, the caller should pass + * include_weaker_rxlev=true so that handover is performed despite congestion. + */ +static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int ahs = (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && lchan->type == GSM_LCHAN_TCH_H); + int av_rxlev; + struct ho_candidate clist[1 + ARRAY_SIZE(lchan->neigh_meas)]; + unsigned int candidates = 0; + int i; + struct ho_candidate *best_cand = NULL; + unsigned int best_better_db; + bool best_applied_afs_bias = false; + int better; + + /* check for disabled handover/assignment at the current cell */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGP(DHODEC, LOGL_INFO, "Skipping, Handover and Assignment both disabled in this cell\n"); + return 0; + } + + collect_candidates_for_lchan(lchan, clist, &candidates, &av_rxlev, include_weaker_rxlev); + + /* If assignment is disabled and no neighbor cell report exists, or no neighbor cell qualifies, + * we may not even have any candidates. */ + if (!candidates) + goto no_candidates; + + /* select best candidate that fulfills requirement B: no congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_B_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); + } + + /* select best candidate that fulfills requirement C: less or equal congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_C_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); + } + + /* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're avoiding congestion. */ + if (!include_weaker_rxlev) + goto no_candidates; + + /* Select best candidate that fulfills requirement A: can service the call. + * From above we know that there are no options that avoid congestion. Here we're trying to find + * *any* free lchan that has no critically low RXLEV and is able to handle the MS. */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_A_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_A_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d" + " with greater congestion found%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_A_MASK); + } + + /* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec + * restrictions or because all lchans are taken. */ + +no_candidates: + if (include_weaker_rxlev) + LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n"); + else + LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n"); + + return 0; +} + +/* + * Handover/assignment check, if measurement report is received + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. + * + * In case of handover triggered because maximum allowed timing advance is + * exceeded, the handover penalty timer is started for the originating cell. + * + */ +static int attempt_handover_after_mr(struct gsm_meas_rep *mr) +{ + struct gsm_lchan *lchan = mr->lchan; + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev = -EINVAL, av_rxqual = -EINVAL; + int rc; + + /* we currently only do handover for TCH channels */ + switch (mr->lchan->type) { + case GSM_LCHAN_TCH_F: + case GSM_LCHAN_TCH_H: + break; + default: + return 0; + } + + /* parse actual neighbor cell info */ + if (mr->num_cell > 0 && mr->num_cell < 7) + process_meas_neigh(mr); + + /* check for ongoing handover/assignment */ + if (!lchan->conn) { + LOGPHOLCHAN(lchan, LOGL_ERROR, "Skipping, No subscriber connection???\n"); + return 0; + } + if (lchan->conn->secondary_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Initial Assignment is still ongoing\n"); + return 0; + } + if (lchan->conn->ho_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Handover already triggered\n"); + return 0; + } + + /* get average levels. if not enought measurements yet, value is < 0 */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + ho_get_rxlev_avg_win(bts->ho)); + av_rxqual = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, + ho_get_rxqual_avg_win(bts->ho)); + if (av_rxlev < 0 && av_rxqual < 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measuements\n"); + return 0; + } + if (av_rxlev >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", + rxlev2dbm(av_rxlev)); + } + if (av_rxqual >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", + av_rxqual); + } + + /* improve levels in case of AFS, if defined */ + if (lchan->type == GSM_LCHAN_TCH_F + && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int rxlev_bias = ho_get_afs_bias_rxlev(bts->ho); + int rxqual_bias = ho_get_afs_bias_rxqual(bts->ho); + if (av_rxlev >= 0 && rxlev_bias) { + int imp = av_rxlev + rxlev_bias; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); + av_rxlev = imp; + } + if (av_rxqual >= 0 && rxqual_bias) { + int imp = av_rxqual - rxqual_bias; + if (imp < 0) + imp = 0; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); + av_rxqual = imp; + } + } + + /* Bad Quality */ + if (av_rxqual >= 0 && av_rxqual > ho_get_min_rxqual(bts->ho)) { + if (rxlev2dbm(av_rxlev) > -85) { + global_ho_reason = HO_REASON_INTERFERENCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment" + " due to interference (bad quality)\n"); + } else { + global_ho_reason = HO_REASON_BAD_QUALITY; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment due to bad quality\n"); + } + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Low Level */ + if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_min_rxlev(bts->ho)) { + global_ho_reason = HO_REASON_LOW_RXLEVEL; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Max Distance */ + if (lchan->meas_rep_count > 0 + && lchan->rqd_ta > ho_get_max_distance(bts->ho)) { + global_ho_reason = HO_REASON_MAX_DISTANCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + /* start penalty timer to prevent comming back too + * early. it must be started before selecting a better cell, + * so there is no assignment selected, due to running + * penalty timer. */ + conn_penalty_timer_add(lchan->conn, bts, ho_get_penalty_max_dist(bts->ho)); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* try handover to a better cell */ + if (av_rxlev >= 0 && (mr->nr % ho_get_pwr_interval(bts->ho)) == 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); + global_ho_reason = HO_REASON_BETTER_CELL; + rc = find_alternative_lchan(lchan, false); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + return 0; +} + +/* + * Handover/assignment check after timer timeout: + * + * Even if handover process tries to prevent a congestion, a cell might get + * congested due to new call setups or handovers to prevent loss of radio link. + * A cell is congested, if not the minimum number of free slots are available. + * The minimum number can be defined for TCH/F and TCH/H individually. + * + * Do not perform congestion check, if no minimum free slots are defined for + * a cell. + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * Only check candidates that will solve/reduce congestion. + * + * If a cell is congested, all slots are checked for all their RX levels + * (down-link) of the current and neighbor cell measurements in descending + * order of their RX levels: + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment), trigger handover or assignment. Candidates that will + * cause an assignment from AHS (AMR on TCH/H) to AFS (AMR on TCH/F) are + * omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement B, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the best candidates that fulfill requirement C (less or equally + * congested cells after handover/assignment), trigger handover or + * assignment. Candidates that will cause an assignment from AHS (AMR on + * TCH/H) to AFS (AMR on TCH/F) are omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement C, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. + */ +static int bts_resolve_congestion(struct gsm_bts *bts, int tchf_congestion, int tchh_congestion) +{ + struct gsm_lchan *lc; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + int i, j; + struct ho_candidate *clist; + unsigned int candidates; + struct ho_candidate *best_cand = NULL, *worst_cand = NULL; + struct gsm_lchan *delete_lchan = NULL; + unsigned int best_avg_db, worst_avg_db; + int avg; + int rc = 0; + int any_ho = 0; + int is_improved = 0; + + if (tchf_congestion < 0) + tchf_congestion = 0; + if (tchh_congestion < 0) + tchh_congestion = 0; + + LOGPHOBTS(bts, LOGL_INFO, "congested: %d TCH/F and %d TCH/H should be moved\n", + tchf_congestion, tchh_congestion); + + /* allocate array of all bts */ + clist = talloc_zero_array(tall_bsc_ctx, struct ho_candidate, + bts->num_trx * 8 * 2 * (1 + ARRAY_SIZE(lc->neigh_meas))); + if (!clist) + return 0; + + candidates = 0; + + /* loop through all active lchan and collect candidates */ + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx_is_usable(trx)) + continue; + + for (i = 0; i < 8; i++) { + ts = &trx->ts[i]; + if (!ts_is_usable(ts)) + continue; + + /* (Do not consider dynamic TS that are in PDCH mode) */ + switch (ts_pchan(ts)) { + case GSM_PCHAN_TCH_F: + lc = &ts->lchan[0]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_F + || lc->state != LCHAN_S_ACTIVE) + break; + /* omit if there is an ongoing ho/as */ + if (!lc->conn || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + break; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + break; + case GSM_PCHAN_TCH_H: + for (j = 0; j < 2; j++) { + lc = &ts->lchan[j]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_H + || lc->state != LCHAN_S_ACTIVE) + continue; + /* omit of there is an ongoing ho/as */ + if (!lc->conn + || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + continue; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + } + break; + default: + break; + } + } + } + + if (!candidates) { + LOGPHOBTS(bts, LOGL_DEBUG, "No neighbor cells qualify to solve congestion\n"); + goto exit; + } + LOGPHOBTS(bts, LOGL_DEBUG, "Considering %u candidates to solve congestion\n", candidates); + +#if 0 +next_b1: +#endif + /* select best candidate that fulfills requirement B, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, + "Best candidate BTS %u (RX level %d) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_b1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_b2: +#endif + /* select worst candidate that fulfills requirement B, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + best_cand = NULL; + goto next_b2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c1: +#endif + /* select best candidate that fulfills requirement C, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Best candidate BTS %d (RX level %d) " + "with less or equal congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_c1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c2: +#endif + /* select worst candidate that fulfills requirement C, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + worst_cand = NULL; + goto next_c2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +exit: + /* free array */ + talloc_free(clist); + + if (tchf_congestion <= 0 && tchh_congestion <= 0) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d solved!\n", + bts->nr); + else if (any_ho) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d reduced!\n", + bts->nr); + else + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d can't be reduced/solved!\n", bts->nr); + + return rc; +} + +static void bts_congestion_check(struct gsm_bts *bts) +{ + int min_free_tchf, min_free_tchh; + int tchf_count, tchh_count; + + global_ho_reason = HO_REASON_CONGESTION; + + /* only check BTS if TRX 0 is usable */ + if (!trx_is_usable(bts->c0)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: TRX 0 not usable\n"); + return; + } + + /* only check BTS if handover or assignment is enabled */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: Assignment and Handover both disabled\n"); + return; + } + + min_free_tchf = ho_get_tchf_min_slots(bts->ho); + min_free_tchh = ho_get_tchh_min_slots(bts->ho); + + /* only check BTS with congestion level set */ + if (!min_free_tchf && !min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: no minimum for free TCH/F nor TCH/H set\n"); + return; + } + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + LOGPHOBTS(bts, LOGL_INFO, "Congestion check: (free/want-free) TCH/F=%d/%d TCH/H=%d/%d\n", + tchf_count, min_free_tchf, tchh_count, min_free_tchh); + + /* only check BTS if congested */ + if (tchf_count >= min_free_tchf && tchh_count >= min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "Not congested\n"); + return; + } + + LOGPHOBTS(bts, LOGL_DEBUG, "Attempting to resolve congestion...\n"); + bts_resolve_congestion(bts, min_free_tchf - tchf_count, min_free_tchh - tchh_count); +} + +void hodec2_congestion_check(struct gsm_network *net) +{ + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_congestion_check(bts); +} + +static void congestion_check_cb(void *arg) +{ + struct gsm_network *net = arg; + hodec2_congestion_check(net); + reinit_congestion_timer(net); +} + +static int ho_dec_2_sig_lchan(unsigned int signal, void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data = signal_data; + + switch (signal) { + case S_LCHAN_MEAS_REP: + /* This is Handover Algorithm 2. If we're not responsible, drop it. */ + if (ho_get_algorithm(lchan_data->lchan->ts->trx->bts->ho) != 2) + return 0; + + attempt_handover_after_mr(lchan_data->mr); + break; + } + + return 0; +} + +static int ho_dec_2_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, + void *signal_data) +{ + switch (subsys) { + case SS_LCHAN: + return ho_dec_2_sig_lchan(signal, handler_data, signal_data); + default: + return 0; + } +} + + +void hodec2_init(struct gsm_network *net) +{ + osmo_signal_register_handler(SS_LCHAN, ho_dec_2_sig_cb, NULL); + ho2_initialized = true; + reinit_congestion_timer(net); +} diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..0b44b2e 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -38,6 +38,29 @@ #include #include #include +#include +#include + +#define LOGPHOLCHANTOLCHAN(lchan, new_lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->trx->arfcn, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_lchan->ts->trx->bts->nr, \ + new_lchan->ts->trx->nr, \ + new_lchan->ts->trx->arfcn, \ + new_lchan->ts->nr, \ + new_lchan->nr, \ + gsm_pchan_name(new_lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHO(struct_bsc_handover, level, fmt, args ...) \ + LOGPHOLCHANTOLCHAN(struct_bsc_handover->old_lchan, struct_bsc_handover->new_lchan, level, fmt, ## args) + struct bsc_handover { struct llist_head list; @@ -86,36 +109,56 @@ return NULL; } -/*! \brief Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, after the - * decision whether to initiate HO to a specific BTS. */ +/*! Hand over the specified logical channel to the specified new BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { + return bsc_handover_start_lchan_change(old_lchan, bts, old_lchan->type); +} + +/*! Hand over the specified logical channel to the specified new BTS and possibly change the lchan type. + * This is the main entry point for the actual handover algorithm, after the decision whether to initiate + * HO to a specific BTS. */ +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, + enum gsm_chan_t new_lchan_type) +{ + struct gsm_network *network; struct gsm_lchan *new_lchan; struct bsc_handover *ho; static uint8_t ho_ref = 0; int rc; + bool do_assignment = false; /* don't attempt multiple handovers for the same lchan at * the same time */ if (bsc_ho_by_old_lchan(old_lchan)) return -EBUSY; - DEBUGP(DHO, "Beginning with handover operation" - "(old_lchan on BTS %u, new BTS %u) ...\n", - old_lchan->ts->trx->bts->nr, bts->nr); + if (!new_bts) + new_bts = old_lchan->ts->trx->bts; + do_assignment = (new_bts == old_lchan->ts->trx->bts); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); + network = new_bts->network; + + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); return -ENOSPC; } - new_lchan = lchan_alloc(bts, old_lchan->type, 0); + DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Beginning with handover operation...\n", + old_lchan->ts->trx->bts->nr, + old_lchan->ts->trx->nr, + old_lchan->ts->nr, + old_lchan->nr, + gsm_pchan_name(old_lchan->ts->pchan), + new_bts->nr, + gsm_lchant_name(new_lchan_type)); + + new_lchan = lchan_alloc(new_bts, new_lchan_type, 0); if (!new_lchan) { - LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); + LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type)); + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); return -ENOSPC; } @@ -128,31 +171,41 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (old_lchan->ts->trx->bts != bts) { + if (!do_assignment) { ho->inter_cell = true; ho->async = true; } + LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); + /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); - new_lchan->ms_power = old_lchan->ms_power; + if (do_assignment) { + new_lchan->ms_power = old_lchan->ms_power; + new_lchan->rqd_ta = old_lchan->rqd_ta; + } else { + new_lchan->ms_power = + ms_pwr_ctl_lvl(new_bts->band, new_bts->ms_max_power); + /* FIXME: do we have a better idea of the timing advance? */ + //new_lchan->rqd_ta = old_lchan->rqd_ta; + } new_lchan->bs_power = old_lchan->bs_power; new_lchan->rsl_cmode = old_lchan->rsl_cmode; new_lchan->tch_mode = old_lchan->tch_mode; - memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, ARRAY_SIZE(new_lchan->mr_ms_lv)); - memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, ARRAY_SIZE(new_lchan->mr_bts_lv)); + memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, sizeof(new_lchan->mr_ms_lv)); + memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, sizeof(new_lchan->mr_bts_lv)); new_lchan->conn = old_lchan->conn; new_lchan->conn->ho_lchan = new_lchan; - /* FIXME: do we have a better idea of the timing advance? */ rc = rsl_chan_activate_lchan(new_lchan, ho->inter_cell ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) : RSL_ACT_INTRA_IMM_ASS, ho->ho_ref); if (rc < 0) { - LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); + LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", + do_assignment? "Assignment" : "Handover", rc); new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; talloc_free(ho); @@ -218,12 +271,16 @@ if (!ho) return -ENODEV; - DEBUGP(DHO, "handover activate ack, send HO Command\n"); + LOGPHO(ho, LOGL_INFO, "Channel Activate Ack, send %s COMMAND\n", ho->inter_cell? "HANDOVER" : "ASSIGNMENT"); /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, 0, ho->ho_ref); + if (ho->inter_cell) { + gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); + } else { + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); + } /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ @@ -241,12 +298,18 @@ static int ho_chan_activ_nack(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; + struct gsm_bts *new_bts = new_lchan->ts->trx->bts; ho = bsc_ho_by_new_lchan(new_lchan); if (!ho) { LOGP(DHO, LOGL_INFO, "ACT NACK: unable to find HO record\n"); return -ENODEV; } + + LOGPHO(ho, LOGL_ERROR, "Channel Activate Nack for %s, starting penalty timer\n", ho->inter_cell? "Handover" : "Assignment"); + + /* if channel failed, wait 10 seconds befor allowing to retry handover */ + conn_penalty_timer_add(ho->old_lchan->conn, new_bts, 10); /* FIXME configurable */ new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; @@ -269,22 +332,19 @@ return -ENODEV; } - net = new_lchan->ts->trx->bts->network; - LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN " - "%u->%u\n", bsc_subscr_name(ho->old_lchan->conn->bsub), - ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, - ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn); + LOGPHO(ho, LOGL_INFO, "%s Complete\n", ho->inter_cell ? "Handover" : "Assignment"); + net = new_lchan->ts->trx->bts->network; rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]); osmo_timer_del(&ho->T3103); /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) - LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Primary lchan changed during handover.\n"); if (new_lchan != new_lchan->conn->ho_lchan) - LOGP(DHO, LOGL_ERROR, "Handover channel changed during this handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Handover channel changed during this handover.\n"); new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; @@ -301,6 +361,8 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) { struct gsm_network *net = old_lchan->ts->trx->bts->network; + struct gsm_bts *old_bts; + struct gsm_bts *new_bts; struct bsc_handover *ho; struct gsm_lchan *new_lchan; @@ -308,6 +370,25 @@ if (!ho) { LOGP(DHO, LOGL_ERROR, "unable to find HO record\n"); return -ENODEV; + } + + old_bts = old_lchan->ts->trx->bts; + new_bts = ho->new_lchan->ts->trx->bts; + + if (old_lchan->conn->ho_failure >= ho_get_retries(old_bts->ho)) { + int penalty = ho->inter_cell + ? ho_get_penalty_failed_ho(old_bts->ho) + : ho_get_penalty_failed_as(old_bts->ho); + LOGPHO(ho, LOGL_NOTICE, "%s failed, starting penalty timer (%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + penalty); + old_lchan->conn->ho_failure = 0; + conn_penalty_timer_add(old_lchan->conn, new_bts, penalty); + } else { + old_lchan->conn->ho_failure++; + LOGPHO(ho, LOGL_NOTICE, "%s failed, trying again (%d/%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + old_lchan->conn->ho_failure, ho_get_retries(old_bts->ho)); } rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED]); @@ -320,7 +401,6 @@ handover_free(ho); lchan_release(new_lchan, 0, RSL_REL_LOCAL_END); - return 0; } @@ -336,7 +416,7 @@ return -ENODEV; } - LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + LOGPHO(ho, LOGL_DEBUG, "Handover RACH detected\n"); /* This is just for logging on the DHO category. The actual MGCP switchover happens in * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c index 225e9a9..5d66e4c 100644 --- a/src/libbsc/handover_vty.c +++ b/src/libbsc/handover_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) { @@ -70,7 +71,42 @@ #undef HO_CFG_ONE_MEMBER -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} + +DEFUN(cfg_net_ho_congestion_check_interval, cfg_net_ho_congestion_check_interval_cmd, + "handover congestion-check (disabled|<1-999>|now)", + HO_CFG_STR_HANDOVER + "Configure congestion check interval" HO_CFG_STR_2 + "Disable congestion checking, do not handover based on cell overload\n" + "Congestion check interval in seconds (default " + OSMO_STRINGIFY_VAL(HO_CFG_CONGESTION_CHECK_DEFAULT) ")\n" + "Manually trigger a congestion check to run right now\n") +{ + if (!strcmp(argv[0], "now")) { + hodec2_congestion_check(gsmnet_from_vty(vty)); + return CMD_SUCCESS; + } + + hodec2_on_change_congestion_check_interval(gsmnet_from_vty(vty), + a2congestion_check_interval(argv[0])); + return CMD_SUCCESS; +} + +static void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) { #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ @@ -82,6 +118,21 @@ HO_CFG_ALL_MEMBERS #undef HO_CFG_ONE_MEMBER +} + +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + ho_vty_write(vty, " ", bts->ho); +} + +void ho_vty_write_net(struct vty *vty, struct gsm_network *net) +{ + ho_vty_write(vty, " ", net->ho); + + if (net->ho2.congestion_check_interval_s != HO_CFG_CONGESTION_CHECK_DEFAULT) + vty_out(vty, " handover congestion-check %s%s", + congestion_check_interval2a(net->ho2.congestion_check_interval_s), + VTY_NEWLINE); } static void ho_vty_init_cmds(int parent_node) @@ -96,6 +147,8 @@ void ho_vty_init() { ho_vty_init_cmds(GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_ho_congestion_check_interval_cmd); + ho_vty_init_cmds(BTS_NODE); } diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 57d8241..4368598 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -57,6 +57,7 @@ net->T3141 = GSM_T3141_DEFAULT; net->ho = ho_cfg_init(net, NULL); + net->ho2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 92ebbfe..17858f6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -25,9 +25,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -38,6 +40,7 @@ #include #include #include +#include void *tall_bsc_ctx; @@ -266,6 +269,8 @@ INIT_LLIST_HEAD(&bts->loc_list); + osmo_signal_dispatch(SS_L_GLOBAL, S_GLOBAL_BTS_NEW, bts); + return bts; } @@ -416,3 +421,73 @@ rev_lev = (cm->classmark2[0] >> 5) & 0x3; return rev_lev >= 2; } + +static unsigned int time_now(void) +{ + time_t now; + time(&now); + return (unsigned int)now; +} + +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout) +{ + struct ho_penalty_timer *timer; + unsigned int now; + unsigned int then; + now = time_now(); + + /* no not add timer, if there is no timeout set */ + if (!timeout) + return; + + then = now + timeout; + + /* timer already running for that BTS? */ + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + /* raise, if running timer will timeout earlier or has timed + * out already, otherwise keep later timeout */ + if (timer->timeout < then) + timer->timeout = then; + return; + } + + /* add new timer */ + timer = talloc_zero(tall_bsc_ctx, struct ho_penalty_timer); + if (!timer) + return; + + timer->bts_nr = bts->nr; + timer->timeout = then; + + llist_add_tail(&timer->entry, &conn->ho_penalty_timers); +} + +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer; + unsigned int now = time_now(); + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + if (now > timer->timeout) + continue; + return timer->timeout - now; + } + return 0; +} + +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer, *timer2; + llist_for_each_entry_safe(timer, timer2, &conn->ho_penalty_timers, entry) { + if (bts && timer->bts_nr != bts->nr) + continue; + llist_del(&timer->entry); + talloc_free(timer); + } +} diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c index 8c208f6..204e5a2 100644 --- a/src/libcommon/handover_cfg.c +++ b/src/libcommon/handover_cfg.c @@ -23,7 +23,10 @@ #include #include +#include + #include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..ab796b2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -741,7 +741,6 @@ bool aoip = false; struct sockaddr_storage rtp_addr; struct gsm0808_channel_type ct; - struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; const uint8_t *data; @@ -787,6 +786,7 @@ } /* Decode speech codec list (AoIP) */ + conn->conn->codec_list_present = false; if (aoip) { /* Check for speech codec list element */ if (!TLVP_PRESENT(&tp, GSM0808_IE_SPEECH_CODEC_LIST)) { @@ -798,13 +798,14 @@ /* Decode Speech Codec list */ data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&conn->conn->codec_list, data, len); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); goto reject; } - scl_ptr = &scl; + conn->conn->codec_list_present = true; + scl_ptr = &conn->conn->codec_list; } /* Decode Channel Type element */ diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1aff4c5..bac3a5e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -298,6 +299,7 @@ mgcp_init(bsc_gsmnet); handover_decision_1_init(); + hodec2_init(bsc_gsmnet); signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); diff --git a/tests/Makefile.am b/tests/Makefile.am index ba8a5e1..652dfe1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ bsc-nat \ bsc-nat-trie \ bssap \ + handover \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am new file mode 100644 index 0000000..69fda8a --- /dev/null +++ b/tests/handover/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + handover_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + handover_test \ + $(NULL) + +handover_test_SOURCES = \ + handover_test.c \ + $(NULL) + +handover_test_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(NULL) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c new file mode 100644 index 0000000..039a52f --- /dev/null +++ b/tests/handover/handover_test.c @@ -0,0 +1,1583 @@ +/* + * (C) 2013 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct gsm_network *bsc_gsmnet; + +/* measurement report */ + +uint8_t meas_rep_ba = 0, meas_rep_valid = 1, meas_valid = 1, meas_multi_rep = 0; +uint8_t meas_dl_rxlev = 0, meas_dl_rxqual = 0; +uint8_t meas_ul_rxlev = 0, meas_ul_rxqual = 0; +uint8_t meas_tx_power_ms = 0, meas_tx_power_bs = 0, meas_ta_ms = 0; +uint8_t meas_dtx_ms = 0, meas_dtx_bs = 0, meas_nr = 0; +uint8_t meas_num_nc = 0, meas_rxlev_nc[6], meas_bsic_nc[6], meas_bcch_f_nc[6]; + +static void gen_meas_rep(struct gsm_lchan *lchan) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t ulm[3], l1i[2], *buf; + struct gsm48_hdr *gh; + struct gsm48_meas_res *mr; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = RSL_MT_MEAS_RES; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = chan_nr; + + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, meas_nr++); + + ulm[0] = meas_ul_rxlev | (meas_dtx_bs << 7); + ulm[1] = meas_ul_rxlev; + ulm[2] = (meas_ul_rxqual << 3) | meas_ul_rxqual; + msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, sizeof(ulm), ulm); + + msgb_tv_put(msg, RSL_IE_BS_POWER, meas_tx_power_bs); + + l1i[0] = 0; + l1i[1] = meas_ta_ms; + msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, sizeof(l1i), l1i); + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*mr)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*mr)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + mr = (struct gsm48_meas_res *) msgb_put(msg, sizeof(*mr)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = GSM48_MT_RR_MEAS_REP; + + /* measurement results */ + mr->rxlev_full = meas_dl_rxlev; + mr->rxlev_sub = meas_dl_rxlev; + mr->rxqual_full = meas_dl_rxqual; + mr->rxqual_sub = meas_dl_rxqual; + mr->dtx_used = meas_dtx_ms; + mr->ba_used = meas_rep_ba; + mr->meas_valid = !meas_valid; /* 0 = valid */ + if (meas_rep_valid) { + mr->no_nc_n_hi = meas_num_nc >> 2; + mr->no_nc_n_lo = meas_num_nc & 3; + } else { + /* no results for serving cells */ + mr->no_nc_n_hi = 1; + mr->no_nc_n_lo = 3; + } + mr->rxlev_nc1 = meas_rxlev_nc[0]; + mr->rxlev_nc2_hi = meas_rxlev_nc[1] >> 1; + mr->rxlev_nc2_lo = meas_rxlev_nc[1] & 1; + mr->rxlev_nc3_hi = meas_rxlev_nc[2] >> 2; + mr->rxlev_nc3_lo = meas_rxlev_nc[2] & 3; + mr->rxlev_nc4_hi = meas_rxlev_nc[3] >> 3; + mr->rxlev_nc4_lo = meas_rxlev_nc[3] & 7; + mr->rxlev_nc5_hi = meas_rxlev_nc[4] >> 4; + mr->rxlev_nc5_lo = meas_rxlev_nc[4] & 15; + mr->rxlev_nc6_hi = meas_rxlev_nc[5] >> 5; + mr->rxlev_nc6_lo = meas_rxlev_nc[5] & 31; + mr->bsic_nc1_hi = meas_bsic_nc[0] >> 3; + mr->bsic_nc1_lo = meas_bsic_nc[0] & 7; + mr->bsic_nc2_hi = meas_bsic_nc[1] >> 4; + mr->bsic_nc2_lo = meas_bsic_nc[1] & 15; + mr->bsic_nc3_hi = meas_bsic_nc[2] >> 5; + mr->bsic_nc3_lo = meas_bsic_nc[2] & 31; + mr->bsic_nc4 = meas_bsic_nc[3]; + mr->bsic_nc5 = meas_bsic_nc[4]; + mr->bsic_nc6 = meas_bsic_nc[5]; + mr->bcch_f_nc1 = meas_bcch_f_nc[0]; + mr->bcch_f_nc2 = meas_bcch_f_nc[1]; + mr->bcch_f_nc3 = meas_bcch_f_nc[2]; + mr->bcch_f_nc4 = meas_bcch_f_nc[3]; + mr->bcch_f_nc5_hi = meas_bcch_f_nc[4] >> 1; + mr->bcch_f_nc5_lo = meas_bcch_f_nc[4] & 1; + mr->bcch_f_nc6_hi = meas_bcch_f_nc[5] >> 2; + mr->bcch_f_nc6_lo = meas_bcch_f_nc[5] & 3; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +static struct gsm_bts *create_bts(int arfcn) +{ + struct gsm_bts *bts; + struct e1inp_sign_link *rsl_link; + int i; + + bts = gsm_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_OSMOBTS, 0x3f); + if (!bts) { + printf("No resource for bts1\n"); + return NULL; + } + + bts->location_area_code = 23; + bts->c0->arfcn = arfcn; + + bts->codec.efr = 1; + bts->codec.hr = 1; + bts->codec.amr = 1; + + rsl_link = talloc_zero(0, struct e1inp_sign_link); + rsl_link->trx = bts->c0; + bts->c0->rsl_link = rsl_link; + + bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK; + + /* 4 full rate and 4 half rate channels */ + for (i = 1; i <= 6; i++) { + bts->c0->ts[i].pchan = + (i < 5) ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H; + bts->c0->ts[i].mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->ts[i].mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->ts[i].lchan[0].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[0].state = LCHAN_S_NONE; + bts->c0->ts[i].lchan[1].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[1].state = LCHAN_S_NONE; + } + return bts; +} + +void create_conn(struct gsm_lchan *lchan) +{ + lchan->conn = bsc_subscr_con_allocate(lchan); +} + +/* create lchan */ +struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, char *codec) +{ + struct gsm_lchan *lchan; + + lchan = lchan_alloc(bts, + (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, 0); + if (!lchan) { + printf("No resource for lchan\n"); + exit(EXIT_FAILURE); + } + lchan->state = LCHAN_S_ACTIVE; + create_conn(lchan); + if (!strcasecmp(codec, "FR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "HR") && !full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "EFR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_EFR; + else if (!strcasecmp(codec, "AMR")) + lchan->tch_mode = GSM48_CMODE_SPEECH_AMR; + else { + printf("Given codec unknown\n"); + exit(EXIT_FAILURE); + } + + lchan->conn->codec_list = (struct gsm0808_speech_codec_list){ + .codec = { + { .fi=true, .type=GSM0808_SCT_FR1, }, + { .fi=true, .type=GSM0808_SCT_FR2, }, + { .fi=true, .type=GSM0808_SCT_FR3, }, + { .fi=true, .type=GSM0808_SCT_HR1, }, + { .fi=true, .type=GSM0808_SCT_HR3, }, + }, + .len = 5, + }; + lchan->conn->codec_list_present = true; + + return lchan; +} + +/* parse channel request */ + +static int got_chan_req = 0; +static struct gsm_lchan *chan_req_lchan = NULL; + +static int parse_chan_act(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +static int parse_chan_rel(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +/* parse handover request */ + +static int got_ho_req = 0; +static struct gsm_lchan *ho_req_lchan = NULL; + +static int parse_ho_command(struct gsm_lchan *lchan, uint8_t *data, int len) +{ + struct gsm48_hdr *gh = (struct gsm48_hdr *) data; + struct gsm48_ho_cmd *ho = (struct gsm48_ho_cmd *) gh->data; + int arfcn; + struct gsm_bts *neigh; + + switch (gh->msg_type) { + case GSM48_MT_RR_HANDO_CMD: + arfcn = (ho->cell_desc.arfcn_hi << 8) | ho->cell_desc.arfcn_lo; + + /* look up trx. since every dummy bts uses different arfcn and + * only one trx, it is simple */ + llist_for_each_entry(neigh, &bsc_gsmnet->bts_list, list) { + if (neigh->c0->arfcn != arfcn) + continue; + ho_req_lchan = lchan; + return 0; + } + break; + case GSM48_MT_RR_ASS_CMD: + ho_req_lchan = lchan; + return 0; + break; + default: + fprintf(stderr, "Error, expecting HO or AS command\n"); + return -EINVAL; + } + + return -1; +} + +/* send channel activation ack */ +static void send_chan_act_ack(struct gsm_lchan *lchan, int act) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = (act) ? RSL_MT_CHAN_ACTIV_ACK : RSL_MT_RF_CHAN_REL_ACK; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = gsm_lchan2chan_nr(lchan); + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + + abis_rsl_rcvmsg(msg); +} + +/* send handover complete */ +static void send_ho_complete(struct gsm_lchan *lchan, bool success) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_rll_hdr *rh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t *buf; + struct gsm48_hdr *gh; + struct gsm48_ho_cpl *hc; + + rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); + rh->c.msg_discr = ABIS_RSL_MDISC_RLL; + rh->c.msg_type = RSL_MT_DATA_IND; + rh->ie_chan = RSL_IE_CHAN_NR; + rh->chan_nr = chan_nr; + rh->ie_link_id = RSL_IE_LINK_IDENT; + rh->link_id = 0x00; + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*hc)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*hc)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + hc = (struct gsm48_ho_cpl *) msgb_put(msg, sizeof(*hc)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = + success ? GSM48_MT_RR_HANDO_COMPL : GSM48_MT_RR_HANDO_FAIL; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)rh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +/* RSL messages from BSC */ +int abis_rsl_sendmsg(struct msgb *msg) +{ + struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *) msg->data; + struct e1inp_sign_link *sign_link = msg->dst; + int rc; + struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr, &rc); + + if (rc) { + printf("rsl_lchan_lookup() failed\n"); + exit(1); + } + + switch (dh->c.msg_type) { + case RSL_MT_CHAN_ACTIV: + rc = parse_chan_act(lchan, dh->data); + if (rc == 0) + got_chan_req = 1; + break; + case RSL_MT_RF_CHAN_REL: + rc = parse_chan_rel(lchan, dh->data); + if (rc == 0) + send_chan_act_ack(chan_req_lchan, 0); + break; + case RSL_MT_DATA_REQ: + rc = parse_ho_command(lchan, msg->l3h, msgb_l3len(msg)); + if (rc == 0) + got_ho_req = 1; + break; + case RSL_MT_IPAC_CRCX: + break; + default: + printf("unknown rsl message=0x%x\n", dh->c.msg_type); + } + return 0; +} + +/* test cases */ + +static char *test_case_0[] = { + "2", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_1[] = { + "2", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_2[] = { + "2", + + "Handover and Assignment must be enabled\n\n" + "This test will start with disabled assignment and handover. A\n" + "better neighbor cell (assignment enabled) will not be selected and \n" + "also no assignment from TCH/H to TCH/F to improve quality. There\n" + "will be no handover nor assignment. After enabling assignment on the\n" + "current cell, the MS will assign to TCH/F. After enabling handover\n" + "in the current cell, but disabling in the neighbor cell, handover\n" + "will not be performed, until it is enabled in the neighbor cell too.\n", + + "create-bts", "2", + "afs-rxlev-improve", "0", "5", + "create-ms", "0", "TCH/H", "AMR", + "as-enable", "0", "0", + "ho-enable", "0", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "as-enable", "0", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "ho-enable", "0", "1", + "ho-enable", "1", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "ho-enable", "1", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_3[] = { + "2", + + "Penalty timer must not run\n\n" + "The MS will try to handover to a better cell, but this will fail.\n" + "Even though the cell is still better, handover will not be performed\n" + "due to penalty timer after handover failure\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-failed", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_4[] = { + "2", + + "TCH/H keeping with HR codec\n\n" + "The MS is using half rate V1 codec, but the better cell is congested\n" + "at TCH/H slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/H", "HR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + NULL +}; + +static char *test_case_5[] = { + "2", + + "TCH/F keeping with FR codec\n\n" + "The MS is using full rate V1 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_6[] = { + "2", + + "TCH/F keeping with EFR codec\n\n" + "The MS is using full rate V2 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "EFR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_7[] = { + "2", + + "TCH/F to TCH/H changing with AMR codec\n\n" + "The MS is using AMR V3 codec, the better cell is congested at TCH/F\n" + "slots. The handover is performed to non-congested TCH/H slots.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_8[] = { + "2", + + "No handover to a cell with no slots available\n\n" + "If no slot is available, no handover is performed\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_9[] = { + "2", + + "No more parallel handovers, if max_unsync_ho is defined\n\n" + "There are tree mobiles that want to handover, but only two can do\n" + "it at a time, because the maximum number is limited to two.\n", + + "create-bts", "2", + "set-max-ho", "1", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "meas-rep", "1", "0","0", "1","0","30", + "expect-chan", "1", "2", + "meas-rep", "2", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_10[] = { + "2", + + "Hysteresis\n\n" + "If neighbor cell is better, handover is only performed if the\n" + "ammount of improvement is greater or equal hyteresis\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "27","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "26","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_11[] = { + "2", + + "No Hysteresis and minimum RX level\n\n" + "If current cell's RX level is below mimium level, handover must be\n" + "performed, no matter of the hysteresis. First do not perform\n" + "handover to better neighbor cell, because the hysteresis is not\n" + "met. Second do not perform handover because better neighbor cell is\n" + "below minimum RX level. Third perform handover because current cell\n" + "is below minimum RX level, even if the better neighbor cell (minimum\n" + "RX level reached) does not meet the hysteresis.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", "1","0","11", + "expect-no-chan", + "meas-rep", "0", "8","0", "1","0","9", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","10", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_12[] = { + "2", + + "No handover to congested cell\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "After the congestion is over, handover will be performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_13[] = { + "2", + + "Handover to balance congestion\n\n" + "The current and the better cell are congested, so no handover is\n" + "performed. This is because handover would congest the neighbor cell\n" + "more. After congestion raises in the current cell, the handover is\n" + "performed to balance congestion\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_14[] = { + "2", + + "Handover to congested cell, if RX level is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX level of the current cell drops below minimum acceptable\n" + "level, the handover is performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "10","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_15[] = { + "2", + + "Handover to cell with worse RXLEV, if RXQUAL is below minimum\n\n" + "The neighbor cell has worse RXLEV, so no handover is performed.\n" + "If the RXQUAL of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "reports are received, before RXQUAL is checked.\n", + /* (See also test 28, which tests for RXQUAL triggering HO to congested cell.) */ + /* TODO: bad RXQUAL may want to prefer assignment within the same cell to avoid interference. + * See Performence Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter + * 2.1.1, "Interference" in the list of triggers on p.157. */ + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_16[] = { + "2", + + "Handover due to maximum TA exceeded\n\n" + "The MS in the current (best) cell has reached maximum allowed timing\n" + "advance. No handover is performed until the timing advance exceeds\n" + "it. The originating cell is still the best, but no handover is\n" + "performed back to that cell, because the penalty timer (due to\n" + "maximum allowed timing advance) is running.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-max-ta", "0", "5", /* of cell */ + "set-ta", "0", "5", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "set-ta", "0", "6", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_17[] = { + "2", + + "Congestion check: No congestion\n\n" + "Three cells have different number of used slots, but there is no\n" + "congestion in any of these cells. No handover is performed.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_18[] = { + "2", + + "Congestion check: One out of three cells is congested\n\n" + "Three cells have different number of used slots, but there is\n" + "congestion at TCH/F in the first cell. Handover is performed with\n" + "the best candidate.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","21","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "6", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "3", /* best candidate is MS 2 at BTS 1, TS 3 */ + "ho-complete", + NULL +}; + +static char *test_case_19[] = { + "2", + + "Congestion check: Balancing over congested cells\n\n" + "Two cells are congested, but the second cell is more congested.\n" + "Handover is performed to solve the congestion.\n", + + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "1", "TCH/F", "FR", + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "1","0","21", + "expect-no-chan", + "meas-rep", "2", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "2", /* best candidate is MS 1 at BTS 0, TS 2 */ + "ho-complete", + NULL +}; + +static char *test_case_20[] = { + "2", + + "Congestion check: Solving congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "non-congested TCH/H of second BTS, in order to solve congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_21[] = { + "2", + + "Congestion check: Balancing congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "less-congested TCH/H of second BTS, in order to balance congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_22[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + NULL +}; + +static char *test_case_23[] = { + "2", + + "Story: 'A neighbor is your friend'\n", + + "create-bts", "3", + + "print", + "Andreas is driving along the coast, on a sunny june afternoon.\n" + "Suddenly he is getting a call from his friend and neighbor Axel.\n" + "\n" + "What happens: Two MS are created, #0 for Axel, #1 for Andreas.", + /* Axel */ + "create-ms", "2", "TCH/F", "AMR", + /* andreas */ + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "1", "40","0", "1","0","30", + "expect-no-chan", + + "print", + "Axel asks Andreas if he would like to join them for a barbecue.\n" + "Axel's house is right in the neighborhood and the weather is fine.\n" + "Andreas agrees, so he drives to a close store to buy some barbecue\n" + "skewers.\n" + "\n" + "What happens: While driving, a different cell (mounted atop the\n" + "store) becomes better.", + /* drive to bts 1 */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + "While Andreas is walking into the store, Axel asks, if he could also\n" + "bring some beer. Andreas has problems understanding him: \"I have a\n" + "bad reception here. The cell tower is right atop the store, but poor\n" + "coverage inside. Can you repeat please?\"\n" + "\n" + "What happens: Inside the store the close cell is so bad, that\n" + "handover back to the previous cell is required.", + /* bts 1 becomes bad, so bts 0 helps out */ + "meas-rep", "1", "5","0", "1","0","20", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "After Andreas bought skewers and beer, he leaves the store.\n" + "\n" + "What happens: Outside the store the close cell is better again, so\n" + "handover back to the that cell is performed.", + /* bts 1 becomes better again */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + /* bts 2 becomes better */ + "Andreas drives down to the lake where Axel's house is.\n" + "\n" + "What happens: There is a small cell at Axel's house, which becomes\n" + "better, because the current cell has no good comverage at the lake.", + "meas-rep", "1", "14","0", "2","0","2","1","63", + "expect-chan", "2", "2", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "Andreas wonders why he still has good radio coverage: \"Last time it\n" + "was so bad\". Axel says: \"I installed a pico cell in my house,\n" + "now we can use our mobile phones down here at the lake.\"", + + NULL +}; + +static char *test_case_24[] = { + "2", + "No (or not enough) measurements for handover\n\n" + "Do not solve congestion in cell, because there is no measurement.\n" + "As soon as enough measurments available (1 in our case), perform\n" + "handover. Afterwards the old cell becomes congested and the new\n" + "cell is not. Do not perform handover until new measurements are\n" + "received.\n", + + /* two cells, first in congested, but no handover */ + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "congestion-check", + "expect-no-chan", + + /* send measurement and trigger congestion check */ + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + /* congest the first cell and remove congestion from second cell */ + "set-min-free", "0", "TCH/F", "0", + "set-min-free", "0", "TCH/H", "0", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + + /* no handover until measurements applied */ + "congestion-check", + "expect-no-chan", + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + NULL +}; + +static char *test_case_25[] = { + "1", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_26[] = { + "1", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_27[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen. (So far like test 22.)\n" + "After that, trigger more congestion checks to ensure stability.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + "congestion-check", + "expect-chan", "0", "2", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "congestion-check", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_28[] = { + "2", + + "Handover to congested cell, if RX quality is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX quality of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "resports are received, before RX quality is checked.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char **test_cases[] = { + test_case_0, + test_case_1, + test_case_2, + test_case_3, + test_case_4, + test_case_5, + test_case_6, + test_case_7, + test_case_8, + test_case_9, + test_case_10, + test_case_11, + test_case_12, + test_case_13, + test_case_14, + test_case_15, + test_case_16, + test_case_17, + test_case_18, + test_case_19, + test_case_20, + test_case_21, + test_case_22, + test_case_23, + test_case_24, + test_case_25, + test_case_26, + test_case_27, + test_case_28, + NULL +}; + +int main(int argc, char **argv) +{ + char **test_case; + struct gsm_bts *bts[256]; + int bts_num = 0; + struct gsm_lchan *lchan[256]; + int lchan_num = 0; + int test_count = 0; + int i; + int algorithm; + struct bsc_api bsc_api = {}; + + for (i = 0; test_cases[i]; i++) + test_count++; + + if (argc <= 1 || atoi(argv[1]) >= test_count) { + for (i = 0; test_cases[i]; i++) { + printf("Test #%d (algorithm %s):\n%s\n", i, + test_cases[i][0], test_cases[i][1]); + } + printf("\nPlease specify test case number 0..%d\n", + test_count - 1); + return EXIT_FAILURE; + } + + osmo_init_logging(&log_info); + + log_set_print_category(osmo_stderr_target, 1); + + log_set_category_filter(osmo_stderr_target, DHO, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DHODEC, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DMEAS, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DREF, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DRSL, 1, LOGL_DEBUG); + + /* Create a dummy network */ + bsc_gsmnet = bsc_network_init(NULL, 1, 1); + if (!bsc_gsmnet) + exit(1); + + bsc_api_init(bsc_gsmnet, &bsc_api); + + ho_set_algorithm(bsc_gsmnet->ho, 2); + ho_set_ho_active(bsc_gsmnet->ho, true); + ho_set_as_active(bsc_gsmnet->ho, true); + ho_set_min_rxlev(bsc_gsmnet->ho, -100); + ho_set_rxlev_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxlev_neigh_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxqual_avg_win(bsc_gsmnet->ho, 10); + ho_set_pwr_hysteresis(bsc_gsmnet->ho, 3); + ho_set_pwr_interval(bsc_gsmnet->ho, 1); + ho_set_afs_bias_rxlev(bsc_gsmnet->ho, 0); + ho_set_min_rxqual(bsc_gsmnet->ho, 5); + ho_set_afs_bias_rxqual(bsc_gsmnet->ho, 0); + ho_set_max_distance(bsc_gsmnet->ho, 9999); + ho_set_ho_max(bsc_gsmnet->ho, 9999); + ho_set_penalty_max_dist(bsc_gsmnet->ho, 300); + ho_set_penalty_failed_ho(bsc_gsmnet->ho, 60); + ho_set_penalty_failed_as(bsc_gsmnet->ho, 60); + + bts_model_sysmobts_init(); + + test_case = test_cases[atoi(argv[1])]; + + fprintf(stderr, "--------------------\n"); + fprintf(stderr, "Performing the following test %d (algorithm %s):\n%s", + atoi(argv[1]), test_case[0], test_case[1]); + algorithm = atoi(test_case[0]); + test_case += 2; + fprintf(stderr, "--------------------\n"); + + /* Disable the congestion check timer, we will trigger manually. */ + bsc_gsmnet->ho2.congestion_check_interval_s = 0; + + handover_decision_1_init(); + hodec2_init(bsc_gsmnet); + + while (*test_case) { + if (!strcmp(*test_case, "create-bts")) { + static int arfcn = 870; + int n = atoi(test_case[1]); + fprintf(stderr, "- Creating %d BTS (one TRX each, " + "TS(1-4) are TCH/F, TS(5-6) are TCH/H)\n", n); + for (i = 0; i < n; i++) + bts[bts_num + i] = create_bts(arfcn++); + for (i = 0; i < n; i++) + gsm_generate_si(bts[bts_num + i], + SYSINFO_TYPE_2); + bts_num += n; + test_case += 2; + } else + if (!strcmp(*test_case, "as-enable")) { + fprintf(stderr, "- Set assignment enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_as_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "ho-enable")) { + fprintf(stderr, "- Set handover enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_ho_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxlev-improve")) { + fprintf(stderr, "- Set afs RX level improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxlev(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxqual-improve")) { + fprintf(stderr, "- Set afs RX quality improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxqual(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-min-free")) { + fprintf(stderr, "- Setting minimum required free %s " + "slots at BTS %s to %s\n", test_case[2], + test_case[1], test_case[3]); + if (!strcmp(test_case[2], "TCH/F")) + ho_set_tchf_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + else + ho_set_tchh_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + test_case += 4; + } else + if (!strcmp(*test_case, "set-max-ho")) { + fprintf(stderr, "- Setting maximum parallel handovers " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_ho_max( bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-max-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_max_distance(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "create-ms")) { + fprintf(stderr, "- Creating mobile #%d at BTS %s on " + "%s with %s codec\n", lchan_num, test_case[1], + test_case[2], test_case[3]); + lchan[lchan_num] = create_lchan(bts[atoi(test_case[1])], + !strcmp(test_case[2], "TCH/F"), test_case[3]); + if (!lchan[lchan_num]) { + printf("Failed to create lchan!\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * New MS is at BTS %d TS %d\n", + lchan[lchan_num]->ts->trx->bts->nr, + lchan[lchan_num]->ts->nr); + lchan_num++; + test_case += 4; + } else + if (!strcmp(*test_case, "set-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at MS %s to %s\n", test_case[1], + test_case[2]); + meas_ta_ms = atoi(test_case[2]); + test_case += 3; + } else + if (!strcmp(*test_case, "meas-rep")) { + /* meas-rep [ [...]] */ + int n = atoi(test_case[4]); + struct gsm_lchan *lc = lchan[atoi(test_case[1])]; + fprintf(stderr, "- Sending measurement report from " + "mobile #%s (rxlev=%s, rxqual=%s)\n", + test_case[1], test_case[2], test_case[3]); + meas_dl_rxlev = atoi(test_case[2]); + meas_dl_rxqual = atoi(test_case[3]); + meas_num_nc = n; + test_case += 5; + for (i = 0; i < n; i++) { + int nr = atoi(test_case[0]); + /* since our bts is not in the list of neighbor + * cells, we need to shift */ + if (nr >= lc->ts->trx->bts->nr) + nr++; + fprintf(stderr, " * Neighbor cell #%s, actual " + "BTS %d (rxlev=%s)\n", test_case[0], nr, + test_case[1]); + meas_bcch_f_nc[i] = atoi(test_case[0]); + /* bts number, not counting our own */ + meas_rxlev_nc[i] = atoi(test_case[1]); + meas_bsic_nc[i] = 0x3f; + test_case += 2; + } + got_chan_req = 0; + gen_meas_rep(lc); + } else + if (!strcmp(*test_case, "congestion-check")) { + fprintf(stderr, "- Triggering congestion check\n"); + got_chan_req = 0; + if (algorithm == 2) + hodec2_congestion_check(bsc_gsmnet); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-chan")) { + fprintf(stderr, "- Expecting channel request at BTS %s " + "TS %s\n", test_case[1], test_case[2]); + if (!got_chan_req) { + printf("Test failed, because no channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got channel request at BTS %d " + "TS %d\n", chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + if (chan_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because channel was not " + "requested on expected BTS\n"); + return EXIT_FAILURE; + } + if (chan_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because channel was not " + "requested on expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "expect-no-chan")) { + fprintf(stderr, "- Expecting no channel request\n"); + if (got_chan_req) { + fprintf(stderr, " * Got channel request at " + "BTS %d TS %d\n", + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + printf("Test failed, because channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got no channel request\n"); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-ho")) { + fprintf(stderr, "- Expecting handover/assignment " + "request at BTS %s TS %s\n", test_case[1], + test_case[2]); + if (!got_ho_req) { + printf("Test failed, because no handover was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got handover/assignment request at " + "BTS %d TS %d\n", + ho_req_lchan->ts->trx->bts->nr, + ho_req_lchan->ts->nr); + if (ho_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected BTS\n"); + return EXIT_FAILURE; + } + if (ho_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "ack-chan")) { + fprintf(stderr, "- Acknowledging channel request\n"); + if (!got_chan_req) { + printf("Cannot ack channel, because no " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_ho_req = 0; + send_chan_act_ack(chan_req_lchan, 1); + } else + if (!strcmp(*test_case, "ho-complete")) { + fprintf(stderr, "- Acknowledging handover/assignment " + "request\n"); + if (!got_chan_req) { + printf("Cannot ack handover/assignment, " + "because no chan request\n"); + return EXIT_FAILURE; + } + if (!got_ho_req) { + printf("Cannot ack handover/assignment, " + "because no ho request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + /* switch lchan */ + for (i = 0; i < lchan_num; i++) { + if (lchan[i] == ho_req_lchan) { + fprintf(stderr, " * MS %d changes from " + "BTS=%d TS=%d to BTS=%d " + "TS=%d\n", i, + lchan[i]->ts->trx->bts->nr, + lchan[i]->ts->nr, + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + lchan[i] = chan_req_lchan; + } + } + send_ho_complete(chan_req_lchan, true); + } else + if (!strcmp(*test_case, "ho-failed")) { + fprintf(stderr, "- Making handover fail\n"); + if (!got_chan_req) { + printf("Cannot fail handover, because no chan " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + send_ho_complete(ho_req_lchan, false); + } else + if (!strcmp(*test_case, "print")) { + fprintf(stderr, "\n%s\n\n", test_case[1]); + test_case += 2; + } else { + printf("Unknown test command '%s', please fix!\n", + *test_case); + return EXIT_FAILURE; + } + } + + for (i = 0; i < lchan_num; i++) { + struct gsm_subscriber_connection *conn = lchan[i]->conn; + lchan[i]->conn = NULL; + conn->lchan = NULL; + bsc_subscr_con_free(conn); + lchan_free(lchan[i]); + } + + fprintf(stderr, "--------------------\n"); + + printf("Test OK\n"); + + fprintf(stderr, "--------------------\n"); + + return EXIT_SUCCESS; +} + +void rtp_socket_free() {} +void rtp_send_frame() {} +void rtp_socket_upstream() {} +void rtp_socket_create() {} +void rtp_socket_connect() {} +void rtp_socket_proxy() {} +void trau_mux_unmap() {} +void trau_mux_map_lchan() {} +void trau_recv_lchan() {} +void trau_send_frame() {} diff --git a/tests/handover/handover_test.ok b/tests/handover/handover_test.ok new file mode 100644 index 0000000..678f9a3 --- /dev/null +++ b/tests/handover/handover_test.ok @@ -0,0 +1 @@ +Test OK diff --git a/tests/testsuite.at b/tests/testsuite.at index 6ef3f29..f0f6fd1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -51,3 +51,177 @@ cat $abs_srcdir/bssap/bssap_test.err > experr AT_CHECK([$abs_top_builddir/tests/bssap/bssap_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([handover test 0]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 1]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 2]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 3]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 4]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 5]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 6]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 7]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 8]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 9]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 10]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 11]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 12]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 13]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 14]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 15]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 16]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 17]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 18]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 19]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 20]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 21]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 22]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 23]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 24]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 25]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 26]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 27]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 28]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 04:09:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 04:09:45 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5921 to look at the new patch set (#3). HO: Implement load based handover, as handover_decision_2.c Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M include/osmocom/bsc/handover.h M include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_decision_2.h M include/osmocom/bsc/handover_vty.h M include/osmocom/bsc/signal.h M src/libbsc/Makefile.am M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c A src/libbsc/handover_decision_2.c M src/libbsc/handover_logic.c M src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/gsm_data.c M src/libcommon/handover_cfg.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M tests/Makefile.am A tests/handover/Makefile.am A tests/handover/handover_test.c A tests/handover/handover_test.ok M tests/testsuite.at 27 files changed, 3,858 insertions(+), 73 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/5921/3 diff --git a/configure.ac b/configure.ac index d756970..fc4678f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,7 @@ tests/subscr/Makefile tests/nanobts_omlattr/Makefile tests/bssap/Makefile + tests/handover/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 699aeb3..a3d9adf 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -27,6 +27,7 @@ handover.h \ handover_cfg.h \ handover_decision.h \ + handover_decision_2.h \ handover_vty.h \ ipaccess.h \ meas_feed.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..c24e22a 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -74,8 +75,8 @@ /* penalty timers for handover */ struct ho_penalty_timer { struct llist_head entry; - uint8_t bts; - time_t timeout; + uint8_t bts_nr; + unsigned int timeout; }; /* active radio connection of a mobile subscriber */ @@ -112,8 +113,18 @@ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; - /* penalty timers for handover */ + /* failure count and penalty timers for handover */ + int ho_failure; struct llist_head ho_penalty_timers; + + /* "Codec List (MSC Preferred)" as received by the BSSAP Assignment Request. 3GPP 48.008 + * 3.2.2.103 says: + * The "Codec List (MSC Preferred)" shall not include codecs + * that are not supported by the MS. + * i.e. by heeding the "Codec list (MSC Preferred)", we inherently heed the MS bearer + * capabilities, which the MSC is required to translate into the codec list. */ + struct gsm0808_speech_codec_list codec_list; + bool codec_list_present; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { @@ -243,7 +254,12 @@ uint16_t network_code; int a5_encryption; int neci; + struct handover_cfg *ho; + struct { + unsigned int congestion_check_interval_s; + struct osmo_timer_list congestion_check_timer; + } ho2; struct rate_ctr_group *bsc_ctrs; @@ -443,4 +459,11 @@ bool classmark_is_r99(struct gsm_classmark *cm); +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout); +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 86c5ca9..776e047 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -269,6 +269,7 @@ struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; + uint8_t meas_rep_last_seen_nr; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index a9349ee..f764456 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -5,6 +5,8 @@ struct gsm_subscriber_connection; int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *bts, + enum gsm_chan_t new_lchan_type); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 1b81235..7ef27ee 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -10,6 +10,8 @@ * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ struct handover_cfg; +#define HO_CFG_CONGESTION_CHECK_DEFAULT 10 + struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); #define HO_CFG_STR_HANDOVER "Handover options\n" @@ -46,22 +48,6 @@ static inline const char *tdma2a(bool val) { return val? "full" : "subset"; -} - -static inline const int a2congestion_check_interval(const char *arg) -{ - if (!strcmp(arg, "disabled")) - return 0; - return atoi(arg); -} - -static inline const char *congestion_check_interval2a(int val) -{ - static char str[9]; - if (val < 1 - || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) - return "disabled"; - return str; } /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, @@ -146,14 +132,6 @@ "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ "Disable in-call assignment\n" \ "Enable in-call assignment\n") \ - \ - HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ - "handover congestion-check", "disabled|<1-60>", \ - a2congestion_check_interval, "%s", congestion_check_interval2a, \ - HO_CFG_STR_HANDOVER \ - "Configure congestion check interval" HO_CFG_STR_2 \ - "Disable congestion checking, do not handover based on cell overload\n" \ - "Congestion check interval in seconds\n") \ \ HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ diff --git a/include/osmocom/bsc/handover_decision_2.h b/include/osmocom/bsc/handover_decision_2.h new file mode 100644 index 0000000..f245b07 --- /dev/null +++ b/include/osmocom/bsc/handover_decision_2.h @@ -0,0 +1,9 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC */ + +#pragma once +struct gsm_bts; + +void hodec2_init(struct gsm_network *net); + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval); +void hodec2_congestion_check(struct gsm_network *net); diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h index 48af136..6ad5276 100644 --- a/include/osmocom/bsc/handover_vty.h +++ b/include/osmocom/bsc/handover_vty.h @@ -4,4 +4,5 @@ #include void ho_vty_init(); -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); +void ho_vty_write_net(struct vty *vty, struct gsm_network *net); +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts); diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 9c0d5a3..1c8b51e 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -104,6 +104,7 @@ enum signal_global { S_GLOBAL_BTS_CLOSE_OM, + S_GLOBAL_BTS_NEW, }; /* SS_RF signals */ diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index d118f44..7e088e5 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -58,5 +58,6 @@ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ handover_vty.c \ + handover_decision_2.c \ $(NULL) diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index bdd86a9..82b21b9 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1523,8 +1523,9 @@ } mr->lchan->meas_rep_count++; - LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", - gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + mr->lchan->meas_rep_last_seen_nr = mr->nr; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_count++=%d meas_rep_last_seen_nr=%u\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count, mr->lchan->meas_rep_last_seen_nr); print_meas_rep(msg->lchan, mr); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a501db2..73bdee5 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -323,8 +323,6 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { - struct ho_penalty_timer *penalty; - if (!conn) return; @@ -349,12 +347,7 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); - /* flush handover penalty timers */ - while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, - struct ho_penalty_timer, entry))) { - llist_del(&penalty->entry); - talloc_free(penalty); - } + conn_penalty_timer_clear(conn, NULL); llist_del(&conn->entry); talloc_free(conn); @@ -672,8 +665,8 @@ struct lchan_signal_data sig; struct gsm48_hdr *gh = msgb_l3(msg); - DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", - rr_cause_name(gh->data[0])); + DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + DEBUGP(DHO, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); sig.lchan = msg->lchan; sig.mr = NULL; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index a304e86..d4591b7 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -795,7 +795,7 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); - ho_vty_write(vty, " ", bts->ho); + ho_vty_write_bts(vty, bts); config_write_bts_model(vty, bts); } @@ -827,7 +827,7 @@ vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - ho_vty_write(vty, " ", gsmnet->ho); + ho_vty_write_net(vty, gsmnet); VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index b3056da..9e83f27 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -414,6 +414,7 @@ /* reset measurement report counter and index */ lchan->meas_rep_count = 0; lchan->meas_rep_idx = 0; + lchan->meas_rep_last_seen_nr = 255; /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/handover_decision_2.c b/src/libbsc/handover_decision_2.c new file mode 100644 index 0000000..2286147 --- /dev/null +++ b/src/libbsc/handover_decision_2.c @@ -0,0 +1,1761 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC. */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Andreas Eversberg + * Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOGPHOBTS(bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) + +#define LOGPHOLCHAN(lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_bts->nr, \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define REQUIREMENT_A_TCHF 0x01 +#define REQUIREMENT_B_TCHF 0x02 +#define REQUIREMENT_C_TCHF 0x04 +#define REQUIREMENT_A_TCHH 0x10 +#define REQUIREMENT_B_TCHH 0x20 +#define REQUIREMENT_C_TCHH 0x40 +#define REQUIREMENT_TCHF_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_B_TCHF | REQUIREMENT_C_TCHF) +#define REQUIREMENT_TCHH_MASK (REQUIREMENT_A_TCHH | REQUIREMENT_B_TCHH | REQUIREMENT_C_TCHH) +#define REQUIREMENT_A_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_A_TCHH) +#define REQUIREMENT_B_MASK (REQUIREMENT_B_TCHF | REQUIREMENT_B_TCHH) +#define REQUIREMENT_C_MASK (REQUIREMENT_C_TCHF | REQUIREMENT_C_TCHH) + +struct ho_candidate { + struct gsm_lchan *lchan; /* candidate for whom */ + struct gsm_bts *bts; /* target BTS */ + uint8_t requirements; /* what is fulfilled */ + int avg; /* average RX level */ +}; + +enum ho_reason { + HO_REASON_INTERFERENCE, + HO_REASON_BAD_QUALITY, + HO_REASON_LOW_RXLEVEL, + HO_REASON_MAX_DISTANCE, + HO_REASON_BETTER_CELL, + HO_REASON_CONGESTION, +}; + +static const struct value_string ho_reason_names[] = { + { HO_REASON_INTERFERENCE, "interference (bad quality)" }, + { HO_REASON_BAD_QUALITY, "bad quality" }, + { HO_REASON_LOW_RXLEVEL, "low rxlevel" }, + { HO_REASON_MAX_DISTANCE, "maximum allowed distance" }, + { HO_REASON_BETTER_CELL, "better cell" }, + { HO_REASON_CONGESTION, "congestion" }, + {0, NULL} +}; + +static const char *ho_reason_name(int value) +{ + return get_value_string(ho_reason_names, value); +} + + +static bool ho2_initialized = false; +static enum ho_reason global_ho_reason; + +static void congestion_check_cb(void *arg); + +/* This function gets called on ho2 init, whenever the congestion check interval is changed, and also + * when the timer has fired to trigger again after the next congestion check timeout. */ +static void reinit_congestion_timer(struct gsm_network *net) +{ + int congestion_check_interval_s; + bool was_active; + + /* Don't setup timers from VTY config parsing before the main program has actually initialized + * the data structures. */ + if (!ho2_initialized) + return; + + was_active = net->ho2.congestion_check_timer.active; + if (was_active) + osmo_timer_del(&net->ho2.congestion_check_timer); + + congestion_check_interval_s = net->ho2.congestion_check_interval_s; + if (congestion_check_interval_s < 1) { + if (was_active) + LOGP(DHODEC, LOGL_NOTICE, "HO algorithm 2: Disabling congestion check\n"); + return; + } + + LOGP(DHODEC, LOGL_DEBUG, "HO algorithm 2: next periodical congestion check in %u seconds\n", + congestion_check_interval_s); + + osmo_timer_setup(&net->ho2.congestion_check_timer, + congestion_check_cb, net); + osmo_timer_schedule(&net->ho2.congestion_check_timer, + congestion_check_interval_s, 0); +} + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval) +{ + net->ho2.congestion_check_interval_s = new_interval; + reinit_congestion_timer(net); +} + +/* did we get a RXLEV for a given cell in the given report? Mark matches as MRC_F_PROCESSED. */ +static struct gsm_meas_rep_cell *cell_in_rep(struct gsm_meas_rep *mr, uint16_t arfcn, uint8_t bsic) +{ + int i; + + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + + if (mrc->arfcn != arfcn) + continue; + if (mrc->bsic != bsic) + continue; + + return mrc; + } + return NULL; +} + +/* obtain averaged rxlev for given neighbor */ +static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window) +{ + unsigned int i, idx; + int avg = 0; + + /* reduce window to the actual number of existing measurements */ + if (window > nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window <= 0) + return 0; + + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), + nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), + window); + + for (i = 0; i < window; i++) { + int j = (idx+i) % ARRAY_SIZE(nmp->rxlev); + + avg += nmp->rxlev[j]; + } + + return avg / window; +} + +/* Find empty slot or the worst neighbor. */ +static struct neigh_meas_proc *find_unused_or_worst_neigh(struct gsm_lchan *lchan) +{ + struct neigh_meas_proc *nmp_worst = NULL; + int worst; + int j; + + /* First try to find an empty/unused slot. */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + if (!nmp->arfcn) + return nmp; + } + + /* No empty slot found. Return worst neighbor to be evicted. */ + worst = 0; /* (overwritten on first loop, but avoid compiler warning) */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + int avg = neigh_meas_avg(nmp, MAX_WIN_NEIGH_AVG); + if (nmp_worst && avg >= worst) + continue; + worst = avg; + nmp_worst = nmp; + } + + return nmp_worst; +} + +/* process neighbor cell measurement reports */ +static void process_meas_neigh(struct gsm_meas_rep *mr) +{ + int i, j, idx; + + /* for each reported cell, try to update global state */ + for (j = 0; j < ARRAY_SIZE(mr->lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &mr->lchan->neigh_meas[j]; + unsigned int idx; + struct gsm_meas_rep_cell *mrc; + + /* skip unused entries */ + if (!nmp->arfcn) + continue; + + mrc = cell_in_rep(mr, nmp->arfcn, nmp->bsic); + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + if (mrc) { + nmp->rxlev[idx] = mrc->rxlev; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + mrc->flags |= MRC_F_PROCESSED; + } else { + nmp->rxlev[idx] = 0; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr); + } + nmp->rxlev_cnt++; + } + + /* iterate over list of reported cells, check if we did not + * process all of them */ + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + struct neigh_meas_proc *nmp; + + if (mrc->flags & MRC_F_PROCESSED) + continue; + + nmp = find_unused_or_worst_neigh(mr->lchan); + + nmp->arfcn = mrc->arfcn; + nmp->bsic = mrc->bsic; + + nmp->rxlev_cnt = 0; + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + nmp->rxlev[idx] = mrc->rxlev; + nmp->rxlev_cnt++; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u new in report rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + + mrc->flags |= MRC_F_PROCESSED; + } +} + +static bool codec_type_is_supported(struct gsm_subscriber_connection *conn, + enum gsm0808_speech_codec_type type) +{ + int i; + struct gsm0808_speech_codec_list *clist = &conn->codec_list; + + if (!conn->codec_list_present) { + /* We don't have a list of supported codecs. This should never happen. */ + LOGPHOLCHAN(conn->lchan, LOGL_ERROR, + "No Speech Codec List present, accepting all codecs\n"); + return true; + } + + for (i = 0; i < clist->len; i++) { + if (clist->codec[i].type == type) { + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", + gsm0808_speech_codec_type_name(type)); + return true; + } + } + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", + gsm0808_speech_codec_type_name(type)); + return false; +} + +/* + * Check what requirements the given cell fulfills. + * A bit mask of fulfilled requirements is returned. + * + * Target cell requirement A -- ability to service the call + * + * In order to successfully handover/assign to a better cell, the target cell + * must be able to continue the current call. Therefore the cell must fulfill + * the following criteria: + * + * * The handover must be enabled for the target cell, if it differs from the + * originating cell. + * * The assignment must be enabled for the cell, if it equals the current + * cell. + * * The handover penalty timer must not run for the cell. + * * If FR, EFR or HR codec is used, the cell must support this codec. + * * If FR or EFR codec is used, the cell must have a TCH/F slot type + * available. + * * If HR codec is used, the cell must have a TCH/H slot type available. + * * If AMR codec is used, the cell must have a TCH/F slot available, if AFS + * is supported by mobile and BTS. + * * If AMR codec is used, the cell must have a TCH/H slot available, if AHS + * is supported by mobile and BTS. + * * osmo-nitb with built-in MNCC application: + * o If AMR codec is used, the cell must support AMR codec with equal codec + * rate or rates. (not meaning TCH types) + * * If defined, the number of maximum unsynchronized handovers to this cell + * may not be exceeded. (This limits processing load for random access + * bursts.) + * + * + * Target cell requirement B -- avoid congestion + * + * In order to prevent congestion of a target cell, the cell must fulfill the + * requirement A, but also: + * + * * The minimum free channels, that are defined for that cell must be + * maintained after handover/assignment. + * * The minimum free channels are defined for TCH/F and TCH/H slot types + * individually. + * + * + * Target cell requirement C -- balance congestion + * + * In order to balance congested cells, the target cell must fulfill the + * requirement A, but also: + * + * * The target cell (which is congested also) must have more or equal free + * slots after handover/assignment. + * * The number of free slots are checked for TCH/F and TCH/H slot types + * individually. + */ +static uint8_t check_requirements(struct gsm_lchan *lchan, struct gsm_bts *bts, int tchf_count, int tchh_count) +{ + int count; + uint8_t requirement = 0; + unsigned int penalty_time; + struct gsm_bts *current_bts = lchan->ts->trx->bts; + + /* Requirement A */ + + /* the handover/assignment must not be disabled */ + if (current_bts == bts) { + if (!ho_get_as_active(bts->ho)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Assignment disabled\n"); + return 0; + } + } else { + if (!ho_get_ho_active(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, handover is disabled in target BTS\n"); + return 0; + } + } + + /* the handover penalty timer must not run for this bts */ + penalty_time = conn_penalty_timer_remaining(lchan->conn, bts); + if (penalty_time) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, target BTS still in penalty time" + " (%u seconds left)\n", penalty_time); + return 0; + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + + /* compatibility check for codecs. + * if so, the candidates for full rate and half rate are selected */ + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_V1: + switch (lchan->type) { + case GSM_LCHAN_TCH_F: /* mandatory */ + requirement |= REQUIREMENT_A_TCHF; + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + case GSM_LCHAN_TCH_H: + if (!bts->codec.hr) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "tch_mode='%s' type='%s' not supported\n", + get_value_string(gsm48_chan_mode_names, + lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR1)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHAN(lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode)); + return 0; + } + break; + case GSM48_CMODE_SPEECH_EFR: + if (!bts->codec.efr) { + LOGPHOBTS(bts, LOGL_DEBUG, "EFR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR2)) + requirement |= REQUIREMENT_A_TCHF; + break; + case GSM48_CMODE_SPEECH_AMR: + if (!bts->codec.amr) { + LOGPHOBTS(bts, LOGL_DEBUG, "AMR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR3)) + requirement |= REQUIREMENT_A_TCHF; + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR3)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "Not even considering: src is not a SPEECH mode lchan\n"); + return 0; + } + + /* no candidate, because new cell is incompatible */ + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because codec of MS and BTS are incompatible\n"); + return 0; + } + + /* remove slot types that are not available */ + if (!tchf_count && requirement & REQUIREMENT_A_TCHF) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, since all TCH/F lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + } + if (!tchh_count && requirement & REQUIREMENT_A_TCHH) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, since all TCH/H lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because no suitable slots available\n"); + return 0; + } + + /* omit same channel type on same BTS (will not change anything) */ + if (bts == current_bts) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, already on TCH/F in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + break; + case GSM_LCHAN_TCH_H: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, already on TCH/H in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Reassignment within cell not an option, no differing channel types available\n"); + return 0; + } + } + +#ifdef LEGACY + // This was useful in osmo-nitb. We're in osmo-bsc now and have no idea whether the osmo-msc does + // internal or external call control. Maybe a future config switch wants to add this behavior? + /* Built-in call control requires equal codec rates. Remove rates that are not equal. */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && current_bts->network->mncc_recv != mncc_sock_from_cc) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_full, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_full, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + case GSM_LCHAN_TCH_H: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_half, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_half, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, cannot provide identical codec rate\n"); + return 0; + } + } +#endif + + /* the maximum number of unsynchonized handovers must no be exceeded */ + if (current_bts != bts + && bsc_ho_count(bts, true) >= ho_get_ho_max(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, number of allowed handovers (%d) would be exceeded\n", + ho_get_ho_max(bts->ho)); + return 0; + } + + /* Requirement B */ + + /* the minimum free timeslots that are defined for this cell must + * be maintained _after_ handover/assignment */ + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= ho_get_tchf_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be congested after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= ho_get_tchh_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be congested after HO\n"); + } + } + + /* Requirement C */ + + /* the nr of free timeslots of the target cell must be >= the + * free slots of the current cell _after_ handover/assignment */ + count = bts_count_free_ts(current_bts, + (lchan->type == GSM_LCHAN_TCH_H) ? + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be less congested in target than source cell after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be less congested in target than source cell after HO\n"); + } + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); + + /* return mask of fulfilled requirements */ + return requirement; +} + +/* Trigger handover or assignment depending on the target BTS */ +static int trigger_handover_or_assignment(struct gsm_lchan *lchan, struct gsm_bts *new_bts, uint8_t requirements) +{ + struct gsm_bts *current_bts = lchan->ts->trx->bts; + int afs_bias = 0; + bool full_rate = false; + + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); + + /* afs_bias becomes > 0, if AFS is used and is improved */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + afs_bias = ho_get_afs_bias_rxlev(new_bts->ho); + + /* select TCH rate, prefer TCH/F if AFS is improved */ + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + /* keep on full rate, if TCH/F is a candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK)) { + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + full_rate = true; + break; + } + /* change to half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + break; + case GSM_LCHAN_TCH_H: + /* change to full rate if AFS is improved and a candidate */ + if (afs_bias > 0 && (requirements & REQUIREMENT_TCHF_MASK)) { + full_rate = true; + LOGPHOLCHAN(lchan, LOGL_DEBUG, "[Improve AHS->AFS]\n"); + break; + } + /* change to full rate if the only candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK) + && !(requirements & REQUIREMENT_TCHH_MASK)) { + full_rate = true; + break; + } + /* keep on half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + break; + default: + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, "lchan is neither TCH/F nor TCH/H, aborting ho/as\n"); + return -EINVAL; + } + + /* trigger handover or assignment */ + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering assignment to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + "Triggering handover to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + + return bsc_handover_start_lchan_change(lchan, current_bts == new_bts? NULL : new_bts, + full_rate? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H); +} + +/* debug collected candidates */ +static inline void debug_candidate(struct ho_candidate *candidate, + int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +{ + if (neighbor) + LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " + "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), + rxlev2dbm(candidate->avg)); + else + LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", + candidate->bts->nr, rxlev2dbm(candidate->avg)); + + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " + "%d\n", tchf_count, ho_get_tchf_min_slots(candidate->bts->ho)); + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " + "%d\n", tchh_count, ho_get_tchh_min_slots(candidate->bts->ho)); + + if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); + if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) + == REQUIREMENT_A_TCHF) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); + + if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); + if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) + == REQUIREMENT_A_TCHH) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); +} + +/* add candidate for re-assignment within the current cell */ +static void collect_assignment_candidate(struct gsm_lchan *lchan, struct ho_candidate *clist, + unsigned int *candidates, int av_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct ho_candidate *c; + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = bts; + c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); + c->avg = av_rxlev; + debug_candidate(c, 0, 0, tchf_count, tchh_count); + (*candidates)++; +} + +/* add candidates for handover to all neighbor cells */ +static void collect_handover_candidate(struct gsm_lchan *lchan, struct neigh_meas_proc *nmp, + struct ho_candidate *clist, unsigned int *candidates, + bool include_weaker_rxlev, int av_rxlev, + int *neighbors_count) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct gsm_bts *neighbor_bts; + int avg; + struct ho_candidate *c; + int min_rxlev; + + /* skip empty slots */ + if (nmp->arfcn == 0) + return; + + if (neighbors_count) + (*neighbors_count)++; + + /* skip if measurement report is old */ + if (nmp->last_seen_nr != lchan->meas_rep_last_seen_nr) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "neighbor ARFCN %u measurement report is old" + " (nmp->last_seen_nr=%u lchan->meas_rep_last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr, lchan->meas_rep_last_seen_nr); + return; + } + + neighbor_bts = bts_by_arfcn_bsic(bts->network, nmp->arfcn, nmp->bsic); + if (!neighbor_bts) { + LOGPHOBTS(bts, LOGL_DEBUG, "neighbor ARFCN %u does not belong to this network\n", + nmp->arfcn); + return; + } + + /* in case we have measurements of our bts, due to misconfiguration */ + if (neighbor_bts == bts) { + LOGPHOBTS(bts, LOGL_ERROR, "Configuration error: this BTS appears as its own neighbor\n"); + return; + } + + /* caculate average rxlev for this cell over the window */ + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); + + /* Heed rxlev hysteresis only if the RXLEV/RXQUAL/TA levels of the MS aren't critically bad and + * we're just looking for an improvement. If levels are critical, we desperately need a handover + * and thus skip the hysteresis check. */ + if (!include_weaker_rxlev) { + unsigned int pwr_hyst = ho_get_pwr_hysteresis(bts->ho); + if (avg <= (av_rxlev + pwr_hyst)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " or equal than current RX level (%d) + hysteresis (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), rxlev2dbm(av_rxlev), pwr_hyst); + return; + } + } + + /* if the minimum level is not reached */ + min_rxlev = ho_get_min_rxlev(neighbor_bts->ho); + if (rxlev2dbm(avg) < min_rxlev) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " than its minimum required RX level (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), min_rxlev); + return; + } + + tchf_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_H); + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = neighbor_bts; + c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, + tchh_count); + c->avg = avg; + debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + (*candidates)++; +} + +static void collect_candidates_for_lchan(struct gsm_lchan *lchan, + struct ho_candidate *clist, unsigned int *candidates, + int *_av_rxlev, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev; + unsigned int candidates_was; + bool assignment; + bool handover; + int neighbors_count = 0; + unsigned int rxlev_avg_win = ho_get_rxlev_avg_win(bts->ho); + + OSMO_ASSERT(candidates); + candidates_was = *candidates; + + /* caculate average rxlev for this cell over the window */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + rxlev_avg_win); + if (_av_rxlev) + *_av_rxlev = av_rxlev; + + /* in case there is no measurment report (yet) */ + if (av_rxlev < 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Not collecting candidates, not enough measurements" + " (got %d, want %u)\n", + lchan->meas_rep_count, rxlev_avg_win); + return; + } + + assignment = ho_get_as_active(bts->ho); + handover = ho_get_ho_active(bts->ho); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", + assignment ? " Assignment" : "", + assignment && handover ? " and" : "", + handover ? " Handover" : ""); + + if (assignment) + collect_assignment_candidate(lchan, clist, candidates, av_rxlev); + + if (handover) { + int i; + for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++) { + collect_handover_candidate(lchan, &lchan->neigh_meas[i], + clist, candidates, + include_weaker_rxlev, av_rxlev, &neighbors_count); + } + } + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", + *candidates - candidates_was, neighbors_count, *candidates); +} + +/* + * Search for a alternative / better cell. + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * + * If one or more 'better cells' are available, check the current and neighbor + * cell measurements in descending order of their RX levels (down-link): + * + * * Select the best candidate that fulfills requirement B (no congestion + * after handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, do not perform handover nor + * assignment. + * + * If the RX level (down-link) or RX quality (down-link) of the current cell is + * below minimum acceptable level, or if the maximum allowed timing advance is + * reached or exceeded, check the RX levels (down-link) of the current and + * neighbor cells in descending order of their levels: (bad BTS case) + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, select the best candidate that + * fulfills requirement A (ignore congestion after handover or assignment) + * and trigger handover or assignment. + * * If no candidate fulfills requirement A, do not perform handover nor + * assignment. + * + * RX levels (down-link) of current and neighbor cells: + * + * * The RX levels of the current cell and neighbor cells are improved by a + * given offset, if AFS (AMR on TCH/F) is used or is a candidate for + * handover/assignment. + * * If AMR is used, the requirement for handover is checked for TCH/F and + * TCH/H. Both results (if any) are used as a candidate. + * * If AMR is used, the requirement for assignment to a different TCH slot + * rate is checked. The result (if available) is used as a candidate. + * + * If minimum RXLEV, minimum RXQUAL or maximum TA are exceeded, the caller should pass + * include_weaker_rxlev=true so that handover is performed despite congestion. + */ +static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int ahs = (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && lchan->type == GSM_LCHAN_TCH_H); + int av_rxlev; + struct ho_candidate clist[1 + ARRAY_SIZE(lchan->neigh_meas)]; + unsigned int candidates = 0; + int i; + struct ho_candidate *best_cand = NULL; + unsigned int best_better_db; + bool best_applied_afs_bias = false; + int better; + + /* check for disabled handover/assignment at the current cell */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGP(DHODEC, LOGL_INFO, "Skipping, Handover and Assignment both disabled in this cell\n"); + return 0; + } + + collect_candidates_for_lchan(lchan, clist, &candidates, &av_rxlev, include_weaker_rxlev); + + /* If assignment is disabled and no neighbor cell report exists, or no neighbor cell qualifies, + * we may not even have any candidates. */ + if (!candidates) + goto no_candidates; + + /* select best candidate that fulfills requirement B: no congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_B_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); + } + + /* select best candidate that fulfills requirement C: less or equal congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_C_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); + } + + /* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're avoiding congestion. */ + if (!include_weaker_rxlev) + goto no_candidates; + + /* Select best candidate that fulfills requirement A: can service the call. + * From above we know that there are no options that avoid congestion. Here we're trying to find + * *any* free lchan that has no critically low RXLEV and is able to handle the MS. */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_A_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_A_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d" + " with greater congestion found%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_A_MASK); + } + + /* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec + * restrictions or because all lchans are taken. */ + +no_candidates: + if (include_weaker_rxlev) + LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n"); + else + LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n"); + + return 0; +} + +/* + * Handover/assignment check, if measurement report is received + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. + * + * In case of handover triggered because maximum allowed timing advance is + * exceeded, the handover penalty timer is started for the originating cell. + * + */ +static int attempt_handover_after_mr(struct gsm_meas_rep *mr) +{ + struct gsm_lchan *lchan = mr->lchan; + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev = -EINVAL, av_rxqual = -EINVAL; + int rc; + + /* we currently only do handover for TCH channels */ + switch (mr->lchan->type) { + case GSM_LCHAN_TCH_F: + case GSM_LCHAN_TCH_H: + break; + default: + return 0; + } + + /* parse actual neighbor cell info */ + if (mr->num_cell > 0 && mr->num_cell < 7) + process_meas_neigh(mr); + + /* check for ongoing handover/assignment */ + if (!lchan->conn) { + LOGPHOLCHAN(lchan, LOGL_ERROR, "Skipping, No subscriber connection???\n"); + return 0; + } + if (lchan->conn->secondary_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Initial Assignment is still ongoing\n"); + return 0; + } + if (lchan->conn->ho_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Handover already triggered\n"); + return 0; + } + + /* get average levels. if not enought measurements yet, value is < 0 */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + ho_get_rxlev_avg_win(bts->ho)); + av_rxqual = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, + ho_get_rxqual_avg_win(bts->ho)); + if (av_rxlev < 0 && av_rxqual < 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measuements\n"); + return 0; + } + if (av_rxlev >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", + rxlev2dbm(av_rxlev)); + } + if (av_rxqual >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", + av_rxqual); + } + + /* improve levels in case of AFS, if defined */ + if (lchan->type == GSM_LCHAN_TCH_F + && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int rxlev_bias = ho_get_afs_bias_rxlev(bts->ho); + int rxqual_bias = ho_get_afs_bias_rxqual(bts->ho); + if (av_rxlev >= 0 && rxlev_bias) { + int imp = av_rxlev + rxlev_bias; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); + av_rxlev = imp; + } + if (av_rxqual >= 0 && rxqual_bias) { + int imp = av_rxqual - rxqual_bias; + if (imp < 0) + imp = 0; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); + av_rxqual = imp; + } + } + + /* Bad Quality */ + if (av_rxqual >= 0 && av_rxqual > ho_get_min_rxqual(bts->ho)) { + if (rxlev2dbm(av_rxlev) > -85) { + global_ho_reason = HO_REASON_INTERFERENCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment" + " due to interference (bad quality)\n"); + } else { + global_ho_reason = HO_REASON_BAD_QUALITY; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment due to bad quality\n"); + } + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Low Level */ + if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_min_rxlev(bts->ho)) { + global_ho_reason = HO_REASON_LOW_RXLEVEL; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Max Distance */ + if (lchan->meas_rep_count > 0 + && lchan->rqd_ta > ho_get_max_distance(bts->ho)) { + global_ho_reason = HO_REASON_MAX_DISTANCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + /* start penalty timer to prevent comming back too + * early. it must be started before selecting a better cell, + * so there is no assignment selected, due to running + * penalty timer. */ + conn_penalty_timer_add(lchan->conn, bts, ho_get_penalty_max_dist(bts->ho)); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* try handover to a better cell */ + if (av_rxlev >= 0 && (mr->nr % ho_get_pwr_interval(bts->ho)) == 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); + global_ho_reason = HO_REASON_BETTER_CELL; + rc = find_alternative_lchan(lchan, false); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + return 0; +} + +/* + * Handover/assignment check after timer timeout: + * + * Even if handover process tries to prevent a congestion, a cell might get + * congested due to new call setups or handovers to prevent loss of radio link. + * A cell is congested, if not the minimum number of free slots are available. + * The minimum number can be defined for TCH/F and TCH/H individually. + * + * Do not perform congestion check, if no minimum free slots are defined for + * a cell. + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * Only check candidates that will solve/reduce congestion. + * + * If a cell is congested, all slots are checked for all their RX levels + * (down-link) of the current and neighbor cell measurements in descending + * order of their RX levels: + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment), trigger handover or assignment. Candidates that will + * cause an assignment from AHS (AMR on TCH/H) to AFS (AMR on TCH/F) are + * omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement B, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the best candidates that fulfill requirement C (less or equally + * congested cells after handover/assignment), trigger handover or + * assignment. Candidates that will cause an assignment from AHS (AMR on + * TCH/H) to AFS (AMR on TCH/F) are omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement C, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. + */ +static int bts_resolve_congestion(struct gsm_bts *bts, int tchf_congestion, int tchh_congestion) +{ + struct gsm_lchan *lc; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + int i, j; + struct ho_candidate *clist; + unsigned int candidates; + struct ho_candidate *best_cand = NULL, *worst_cand = NULL; + struct gsm_lchan *delete_lchan = NULL; + unsigned int best_avg_db, worst_avg_db; + int avg; + int rc = 0; + int any_ho = 0; + int is_improved = 0; + + if (tchf_congestion < 0) + tchf_congestion = 0; + if (tchh_congestion < 0) + tchh_congestion = 0; + + LOGPHOBTS(bts, LOGL_INFO, "congested: %d TCH/F and %d TCH/H should be moved\n", + tchf_congestion, tchh_congestion); + + /* allocate array of all bts */ + clist = talloc_zero_array(tall_bsc_ctx, struct ho_candidate, + bts->num_trx * 8 * 2 * (1 + ARRAY_SIZE(lc->neigh_meas))); + if (!clist) + return 0; + + candidates = 0; + + /* loop through all active lchan and collect candidates */ + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx_is_usable(trx)) + continue; + + for (i = 0; i < 8; i++) { + ts = &trx->ts[i]; + if (!ts_is_usable(ts)) + continue; + + /* (Do not consider dynamic TS that are in PDCH mode) */ + switch (ts_pchan(ts)) { + case GSM_PCHAN_TCH_F: + lc = &ts->lchan[0]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_F + || lc->state != LCHAN_S_ACTIVE) + break; + /* omit if there is an ongoing ho/as */ + if (!lc->conn || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + break; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + break; + case GSM_PCHAN_TCH_H: + for (j = 0; j < 2; j++) { + lc = &ts->lchan[j]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_H + || lc->state != LCHAN_S_ACTIVE) + continue; + /* omit of there is an ongoing ho/as */ + if (!lc->conn + || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + continue; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + } + break; + default: + break; + } + } + } + + if (!candidates) { + LOGPHOBTS(bts, LOGL_DEBUG, "No neighbor cells qualify to solve congestion\n"); + goto exit; + } + LOGPHOBTS(bts, LOGL_DEBUG, "Considering %u candidates to solve congestion\n", candidates); + +#if 0 +next_b1: +#endif + /* select best candidate that fulfills requirement B, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, + "Best candidate BTS %u (RX level %d) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_b1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_b2: +#endif + /* select worst candidate that fulfills requirement B, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + best_cand = NULL; + goto next_b2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c1: +#endif + /* select best candidate that fulfills requirement C, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Best candidate BTS %d (RX level %d) " + "with less or equal congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_c1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c2: +#endif + /* select worst candidate that fulfills requirement C, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + worst_cand = NULL; + goto next_c2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +exit: + /* free array */ + talloc_free(clist); + + if (tchf_congestion <= 0 && tchh_congestion <= 0) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d solved!\n", + bts->nr); + else if (any_ho) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d reduced!\n", + bts->nr); + else + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d can't be reduced/solved!\n", bts->nr); + + return rc; +} + +static void bts_congestion_check(struct gsm_bts *bts) +{ + int min_free_tchf, min_free_tchh; + int tchf_count, tchh_count; + + global_ho_reason = HO_REASON_CONGESTION; + + /* only check BTS if TRX 0 is usable */ + if (!trx_is_usable(bts->c0)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: TRX 0 not usable\n"); + return; + } + + /* only check BTS if handover or assignment is enabled */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: Assignment and Handover both disabled\n"); + return; + } + + min_free_tchf = ho_get_tchf_min_slots(bts->ho); + min_free_tchh = ho_get_tchh_min_slots(bts->ho); + + /* only check BTS with congestion level set */ + if (!min_free_tchf && !min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: no minimum for free TCH/F nor TCH/H set\n"); + return; + } + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + LOGPHOBTS(bts, LOGL_INFO, "Congestion check: (free/want-free) TCH/F=%d/%d TCH/H=%d/%d\n", + tchf_count, min_free_tchf, tchh_count, min_free_tchh); + + /* only check BTS if congested */ + if (tchf_count >= min_free_tchf && tchh_count >= min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "Not congested\n"); + return; + } + + LOGPHOBTS(bts, LOGL_DEBUG, "Attempting to resolve congestion...\n"); + bts_resolve_congestion(bts, min_free_tchf - tchf_count, min_free_tchh - tchh_count); +} + +void hodec2_congestion_check(struct gsm_network *net) +{ + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_congestion_check(bts); +} + +static void congestion_check_cb(void *arg) +{ + struct gsm_network *net = arg; + hodec2_congestion_check(net); + reinit_congestion_timer(net); +} + +static int ho_dec_2_sig_lchan(unsigned int signal, void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data = signal_data; + + switch (signal) { + case S_LCHAN_MEAS_REP: + /* This is Handover Algorithm 2. If we're not responsible, drop it. */ + if (ho_get_algorithm(lchan_data->lchan->ts->trx->bts->ho) != 2) + return 0; + + attempt_handover_after_mr(lchan_data->mr); + break; + } + + return 0; +} + +static int ho_dec_2_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, + void *signal_data) +{ + switch (subsys) { + case SS_LCHAN: + return ho_dec_2_sig_lchan(signal, handler_data, signal_data); + default: + return 0; + } +} + + +void hodec2_init(struct gsm_network *net) +{ + osmo_signal_register_handler(SS_LCHAN, ho_dec_2_sig_cb, NULL); + ho2_initialized = true; + reinit_congestion_timer(net); +} diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..0cce1d9 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -38,6 +38,29 @@ #include #include #include +#include +#include + +#define LOGPHOLCHANTOLCHAN(lchan, new_lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->trx->arfcn, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_lchan->ts->trx->bts->nr, \ + new_lchan->ts->trx->nr, \ + new_lchan->ts->trx->arfcn, \ + new_lchan->ts->nr, \ + new_lchan->nr, \ + gsm_pchan_name(new_lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHO(struct_bsc_handover, level, fmt, args ...) \ + LOGPHOLCHANTOLCHAN(struct_bsc_handover->old_lchan, struct_bsc_handover->new_lchan, level, fmt, ## args) + struct bsc_handover { struct llist_head list; @@ -86,36 +109,56 @@ return NULL; } -/*! \brief Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, after the - * decision whether to initiate HO to a specific BTS. */ +/*! Hand over the specified logical channel to the specified new BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { + return bsc_handover_start_lchan_change(old_lchan, bts, old_lchan->type); +} + +/*! Hand over the specified logical channel to the specified new BTS and possibly change the lchan type. + * This is the main entry point for the actual handover algorithm, after the decision whether to initiate + * HO to a specific BTS. */ +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, + enum gsm_chan_t new_lchan_type) +{ + struct gsm_network *network; struct gsm_lchan *new_lchan; struct bsc_handover *ho; static uint8_t ho_ref = 0; int rc; + bool do_assignment = false; /* don't attempt multiple handovers for the same lchan at * the same time */ if (bsc_ho_by_old_lchan(old_lchan)) return -EBUSY; - DEBUGP(DHO, "Beginning with handover operation" - "(old_lchan on BTS %u, new BTS %u) ...\n", - old_lchan->ts->trx->bts->nr, bts->nr); + if (!new_bts) + new_bts = old_lchan->ts->trx->bts; + do_assignment = (new_bts == old_lchan->ts->trx->bts); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); + network = new_bts->network; + + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); return -ENOSPC; } - new_lchan = lchan_alloc(bts, old_lchan->type, 0); + DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Beginning with handover operation...\n", + old_lchan->ts->trx->bts->nr, + old_lchan->ts->trx->nr, + old_lchan->ts->nr, + old_lchan->nr, + gsm_pchan_name(old_lchan->ts->pchan), + new_bts->nr, + gsm_lchant_name(new_lchan_type)); + + new_lchan = lchan_alloc(new_bts, new_lchan_type, 0); if (!new_lchan) { - LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); + LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type)); + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); return -ENOSPC; } @@ -128,31 +171,41 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (old_lchan->ts->trx->bts != bts) { + if (!do_assignment) { ho->inter_cell = true; ho->async = true; } + LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); + /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); - new_lchan->ms_power = old_lchan->ms_power; + if (do_assignment) { + new_lchan->ms_power = old_lchan->ms_power; + new_lchan->rqd_ta = old_lchan->rqd_ta; + } else { + new_lchan->ms_power = + ms_pwr_ctl_lvl(new_bts->band, new_bts->ms_max_power); + /* FIXME: do we have a better idea of the timing advance? */ + //new_lchan->rqd_ta = old_lchan->rqd_ta; + } new_lchan->bs_power = old_lchan->bs_power; new_lchan->rsl_cmode = old_lchan->rsl_cmode; new_lchan->tch_mode = old_lchan->tch_mode; - memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, ARRAY_SIZE(new_lchan->mr_ms_lv)); - memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, ARRAY_SIZE(new_lchan->mr_bts_lv)); + memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, sizeof(new_lchan->mr_ms_lv)); + memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, sizeof(new_lchan->mr_bts_lv)); new_lchan->conn = old_lchan->conn; new_lchan->conn->ho_lchan = new_lchan; - /* FIXME: do we have a better idea of the timing advance? */ rc = rsl_chan_activate_lchan(new_lchan, ho->inter_cell ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) : RSL_ACT_INTRA_IMM_ASS, ho->ho_ref); if (rc < 0) { - LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); + LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", + do_assignment? "Assignment" : "Handover", rc); new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; talloc_free(ho); @@ -218,12 +271,16 @@ if (!ho) return -ENODEV; - DEBUGP(DHO, "handover activate ack, send HO Command\n"); + LOGPHO(ho, LOGL_INFO, "Channel Activate Ack, send %s COMMAND\n", ho->inter_cell? "HANDOVER" : "ASSIGNMENT"); /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, 0, ho->ho_ref); + if (ho->inter_cell) { + gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); + } else { + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); + } /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ @@ -241,12 +298,18 @@ static int ho_chan_activ_nack(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; + struct gsm_bts *new_bts = new_lchan->ts->trx->bts; ho = bsc_ho_by_new_lchan(new_lchan); if (!ho) { LOGP(DHO, LOGL_INFO, "ACT NACK: unable to find HO record\n"); return -ENODEV; } + + LOGPHO(ho, LOGL_ERROR, "Channel Activate Nack for %s, starting penalty timer\n", ho->inter_cell? "Handover" : "Assignment"); + + /* if channel failed, wait 10 seconds befor allowing to retry handover */ + conn_penalty_timer_add(ho->old_lchan->conn, new_bts, 10); /* FIXME configurable */ new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; @@ -269,22 +332,19 @@ return -ENODEV; } - net = new_lchan->ts->trx->bts->network; - LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN " - "%u->%u\n", bsc_subscr_name(ho->old_lchan->conn->bsub), - ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, - ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn); + LOGPHO(ho, LOGL_INFO, "%s Complete\n", ho->inter_cell ? "Handover" : "Assignment"); + net = new_lchan->ts->trx->bts->network; rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]); osmo_timer_del(&ho->T3103); /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) - LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Primary lchan changed during handover.\n"); if (new_lchan != new_lchan->conn->ho_lchan) - LOGP(DHO, LOGL_ERROR, "Handover channel changed during this handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Handover channel changed during this handover.\n"); new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; @@ -301,6 +361,8 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) { struct gsm_network *net = old_lchan->ts->trx->bts->network; + struct gsm_bts *old_bts; + struct gsm_bts *new_bts; struct bsc_handover *ho; struct gsm_lchan *new_lchan; @@ -308,6 +370,25 @@ if (!ho) { LOGP(DHO, LOGL_ERROR, "unable to find HO record\n"); return -ENODEV; + } + + old_bts = old_lchan->ts->trx->bts; + new_bts = ho->new_lchan->ts->trx->bts; + + if (old_lchan->conn->ho_failure >= ho_get_retries(old_bts->ho)) { + int penalty = ho->inter_cell + ? ho_get_penalty_failed_ho(old_bts->ho) + : ho_get_penalty_failed_as(old_bts->ho); + LOGPHO(ho, LOGL_NOTICE, "%s failed, starting penalty timer (%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + penalty); + old_lchan->conn->ho_failure = 0; + conn_penalty_timer_add(old_lchan->conn, new_bts, penalty); + } else { + old_lchan->conn->ho_failure++; + LOGPHO(ho, LOGL_NOTICE, "%s failed, trying again (%d/%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + old_lchan->conn->ho_failure, ho_get_retries(old_bts->ho)); } rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED]); @@ -320,7 +401,6 @@ handover_free(ho); lchan_release(new_lchan, 0, RSL_REL_LOCAL_END); - return 0; } @@ -336,7 +416,7 @@ return -ENODEV; } - LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + LOGPHO(ho, LOGL_DEBUG, "Handover RACH detected\n"); /* This is just for logging on the DHO category. The actual MGCP switchover happens in * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c index 225e9a9..5d66e4c 100644 --- a/src/libbsc/handover_vty.c +++ b/src/libbsc/handover_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) { @@ -70,7 +71,42 @@ #undef HO_CFG_ONE_MEMBER -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} + +DEFUN(cfg_net_ho_congestion_check_interval, cfg_net_ho_congestion_check_interval_cmd, + "handover congestion-check (disabled|<1-999>|now)", + HO_CFG_STR_HANDOVER + "Configure congestion check interval" HO_CFG_STR_2 + "Disable congestion checking, do not handover based on cell overload\n" + "Congestion check interval in seconds (default " + OSMO_STRINGIFY_VAL(HO_CFG_CONGESTION_CHECK_DEFAULT) ")\n" + "Manually trigger a congestion check to run right now\n") +{ + if (!strcmp(argv[0], "now")) { + hodec2_congestion_check(gsmnet_from_vty(vty)); + return CMD_SUCCESS; + } + + hodec2_on_change_congestion_check_interval(gsmnet_from_vty(vty), + a2congestion_check_interval(argv[0])); + return CMD_SUCCESS; +} + +static void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) { #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ @@ -82,6 +118,21 @@ HO_CFG_ALL_MEMBERS #undef HO_CFG_ONE_MEMBER +} + +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + ho_vty_write(vty, " ", bts->ho); +} + +void ho_vty_write_net(struct vty *vty, struct gsm_network *net) +{ + ho_vty_write(vty, " ", net->ho); + + if (net->ho2.congestion_check_interval_s != HO_CFG_CONGESTION_CHECK_DEFAULT) + vty_out(vty, " handover congestion-check %s%s", + congestion_check_interval2a(net->ho2.congestion_check_interval_s), + VTY_NEWLINE); } static void ho_vty_init_cmds(int parent_node) @@ -96,6 +147,8 @@ void ho_vty_init() { ho_vty_init_cmds(GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_ho_congestion_check_interval_cmd); + ho_vty_init_cmds(BTS_NODE); } diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 57d8241..4368598 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -57,6 +57,7 @@ net->T3141 = GSM_T3141_DEFAULT; net->ho = ho_cfg_init(net, NULL); + net->ho2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 92ebbfe..17858f6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -25,9 +25,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -38,6 +40,7 @@ #include #include #include +#include void *tall_bsc_ctx; @@ -266,6 +269,8 @@ INIT_LLIST_HEAD(&bts->loc_list); + osmo_signal_dispatch(SS_L_GLOBAL, S_GLOBAL_BTS_NEW, bts); + return bts; } @@ -416,3 +421,73 @@ rev_lev = (cm->classmark2[0] >> 5) & 0x3; return rev_lev >= 2; } + +static unsigned int time_now(void) +{ + time_t now; + time(&now); + return (unsigned int)now; +} + +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout) +{ + struct ho_penalty_timer *timer; + unsigned int now; + unsigned int then; + now = time_now(); + + /* no not add timer, if there is no timeout set */ + if (!timeout) + return; + + then = now + timeout; + + /* timer already running for that BTS? */ + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + /* raise, if running timer will timeout earlier or has timed + * out already, otherwise keep later timeout */ + if (timer->timeout < then) + timer->timeout = then; + return; + } + + /* add new timer */ + timer = talloc_zero(tall_bsc_ctx, struct ho_penalty_timer); + if (!timer) + return; + + timer->bts_nr = bts->nr; + timer->timeout = then; + + llist_add_tail(&timer->entry, &conn->ho_penalty_timers); +} + +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer; + unsigned int now = time_now(); + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + if (now > timer->timeout) + continue; + return timer->timeout - now; + } + return 0; +} + +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer, *timer2; + llist_for_each_entry_safe(timer, timer2, &conn->ho_penalty_timers, entry) { + if (bts && timer->bts_nr != bts->nr) + continue; + llist_del(&timer->entry); + talloc_free(timer); + } +} diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c index 8c208f6..204e5a2 100644 --- a/src/libcommon/handover_cfg.c +++ b/src/libcommon/handover_cfg.c @@ -23,7 +23,10 @@ #include #include +#include + #include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..ab796b2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -741,7 +741,6 @@ bool aoip = false; struct sockaddr_storage rtp_addr; struct gsm0808_channel_type ct; - struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; const uint8_t *data; @@ -787,6 +786,7 @@ } /* Decode speech codec list (AoIP) */ + conn->conn->codec_list_present = false; if (aoip) { /* Check for speech codec list element */ if (!TLVP_PRESENT(&tp, GSM0808_IE_SPEECH_CODEC_LIST)) { @@ -798,13 +798,14 @@ /* Decode Speech Codec list */ data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&conn->conn->codec_list, data, len); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); goto reject; } - scl_ptr = &scl; + conn->conn->codec_list_present = true; + scl_ptr = &conn->conn->codec_list; } /* Decode Channel Type element */ diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1aff4c5..bac3a5e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -298,6 +299,7 @@ mgcp_init(bsc_gsmnet); handover_decision_1_init(); + hodec2_init(bsc_gsmnet); signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); diff --git a/tests/Makefile.am b/tests/Makefile.am index ba8a5e1..652dfe1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ bsc-nat \ bsc-nat-trie \ bssap \ + handover \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am new file mode 100644 index 0000000..69fda8a --- /dev/null +++ b/tests/handover/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + handover_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + handover_test \ + $(NULL) + +handover_test_SOURCES = \ + handover_test.c \ + $(NULL) + +handover_test_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(NULL) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c new file mode 100644 index 0000000..039a52f --- /dev/null +++ b/tests/handover/handover_test.c @@ -0,0 +1,1583 @@ +/* + * (C) 2013 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct gsm_network *bsc_gsmnet; + +/* measurement report */ + +uint8_t meas_rep_ba = 0, meas_rep_valid = 1, meas_valid = 1, meas_multi_rep = 0; +uint8_t meas_dl_rxlev = 0, meas_dl_rxqual = 0; +uint8_t meas_ul_rxlev = 0, meas_ul_rxqual = 0; +uint8_t meas_tx_power_ms = 0, meas_tx_power_bs = 0, meas_ta_ms = 0; +uint8_t meas_dtx_ms = 0, meas_dtx_bs = 0, meas_nr = 0; +uint8_t meas_num_nc = 0, meas_rxlev_nc[6], meas_bsic_nc[6], meas_bcch_f_nc[6]; + +static void gen_meas_rep(struct gsm_lchan *lchan) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t ulm[3], l1i[2], *buf; + struct gsm48_hdr *gh; + struct gsm48_meas_res *mr; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = RSL_MT_MEAS_RES; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = chan_nr; + + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, meas_nr++); + + ulm[0] = meas_ul_rxlev | (meas_dtx_bs << 7); + ulm[1] = meas_ul_rxlev; + ulm[2] = (meas_ul_rxqual << 3) | meas_ul_rxqual; + msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, sizeof(ulm), ulm); + + msgb_tv_put(msg, RSL_IE_BS_POWER, meas_tx_power_bs); + + l1i[0] = 0; + l1i[1] = meas_ta_ms; + msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, sizeof(l1i), l1i); + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*mr)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*mr)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + mr = (struct gsm48_meas_res *) msgb_put(msg, sizeof(*mr)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = GSM48_MT_RR_MEAS_REP; + + /* measurement results */ + mr->rxlev_full = meas_dl_rxlev; + mr->rxlev_sub = meas_dl_rxlev; + mr->rxqual_full = meas_dl_rxqual; + mr->rxqual_sub = meas_dl_rxqual; + mr->dtx_used = meas_dtx_ms; + mr->ba_used = meas_rep_ba; + mr->meas_valid = !meas_valid; /* 0 = valid */ + if (meas_rep_valid) { + mr->no_nc_n_hi = meas_num_nc >> 2; + mr->no_nc_n_lo = meas_num_nc & 3; + } else { + /* no results for serving cells */ + mr->no_nc_n_hi = 1; + mr->no_nc_n_lo = 3; + } + mr->rxlev_nc1 = meas_rxlev_nc[0]; + mr->rxlev_nc2_hi = meas_rxlev_nc[1] >> 1; + mr->rxlev_nc2_lo = meas_rxlev_nc[1] & 1; + mr->rxlev_nc3_hi = meas_rxlev_nc[2] >> 2; + mr->rxlev_nc3_lo = meas_rxlev_nc[2] & 3; + mr->rxlev_nc4_hi = meas_rxlev_nc[3] >> 3; + mr->rxlev_nc4_lo = meas_rxlev_nc[3] & 7; + mr->rxlev_nc5_hi = meas_rxlev_nc[4] >> 4; + mr->rxlev_nc5_lo = meas_rxlev_nc[4] & 15; + mr->rxlev_nc6_hi = meas_rxlev_nc[5] >> 5; + mr->rxlev_nc6_lo = meas_rxlev_nc[5] & 31; + mr->bsic_nc1_hi = meas_bsic_nc[0] >> 3; + mr->bsic_nc1_lo = meas_bsic_nc[0] & 7; + mr->bsic_nc2_hi = meas_bsic_nc[1] >> 4; + mr->bsic_nc2_lo = meas_bsic_nc[1] & 15; + mr->bsic_nc3_hi = meas_bsic_nc[2] >> 5; + mr->bsic_nc3_lo = meas_bsic_nc[2] & 31; + mr->bsic_nc4 = meas_bsic_nc[3]; + mr->bsic_nc5 = meas_bsic_nc[4]; + mr->bsic_nc6 = meas_bsic_nc[5]; + mr->bcch_f_nc1 = meas_bcch_f_nc[0]; + mr->bcch_f_nc2 = meas_bcch_f_nc[1]; + mr->bcch_f_nc3 = meas_bcch_f_nc[2]; + mr->bcch_f_nc4 = meas_bcch_f_nc[3]; + mr->bcch_f_nc5_hi = meas_bcch_f_nc[4] >> 1; + mr->bcch_f_nc5_lo = meas_bcch_f_nc[4] & 1; + mr->bcch_f_nc6_hi = meas_bcch_f_nc[5] >> 2; + mr->bcch_f_nc6_lo = meas_bcch_f_nc[5] & 3; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +static struct gsm_bts *create_bts(int arfcn) +{ + struct gsm_bts *bts; + struct e1inp_sign_link *rsl_link; + int i; + + bts = gsm_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_OSMOBTS, 0x3f); + if (!bts) { + printf("No resource for bts1\n"); + return NULL; + } + + bts->location_area_code = 23; + bts->c0->arfcn = arfcn; + + bts->codec.efr = 1; + bts->codec.hr = 1; + bts->codec.amr = 1; + + rsl_link = talloc_zero(0, struct e1inp_sign_link); + rsl_link->trx = bts->c0; + bts->c0->rsl_link = rsl_link; + + bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK; + + /* 4 full rate and 4 half rate channels */ + for (i = 1; i <= 6; i++) { + bts->c0->ts[i].pchan = + (i < 5) ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H; + bts->c0->ts[i].mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->ts[i].mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->ts[i].lchan[0].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[0].state = LCHAN_S_NONE; + bts->c0->ts[i].lchan[1].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[1].state = LCHAN_S_NONE; + } + return bts; +} + +void create_conn(struct gsm_lchan *lchan) +{ + lchan->conn = bsc_subscr_con_allocate(lchan); +} + +/* create lchan */ +struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, char *codec) +{ + struct gsm_lchan *lchan; + + lchan = lchan_alloc(bts, + (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, 0); + if (!lchan) { + printf("No resource for lchan\n"); + exit(EXIT_FAILURE); + } + lchan->state = LCHAN_S_ACTIVE; + create_conn(lchan); + if (!strcasecmp(codec, "FR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "HR") && !full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "EFR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_EFR; + else if (!strcasecmp(codec, "AMR")) + lchan->tch_mode = GSM48_CMODE_SPEECH_AMR; + else { + printf("Given codec unknown\n"); + exit(EXIT_FAILURE); + } + + lchan->conn->codec_list = (struct gsm0808_speech_codec_list){ + .codec = { + { .fi=true, .type=GSM0808_SCT_FR1, }, + { .fi=true, .type=GSM0808_SCT_FR2, }, + { .fi=true, .type=GSM0808_SCT_FR3, }, + { .fi=true, .type=GSM0808_SCT_HR1, }, + { .fi=true, .type=GSM0808_SCT_HR3, }, + }, + .len = 5, + }; + lchan->conn->codec_list_present = true; + + return lchan; +} + +/* parse channel request */ + +static int got_chan_req = 0; +static struct gsm_lchan *chan_req_lchan = NULL; + +static int parse_chan_act(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +static int parse_chan_rel(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +/* parse handover request */ + +static int got_ho_req = 0; +static struct gsm_lchan *ho_req_lchan = NULL; + +static int parse_ho_command(struct gsm_lchan *lchan, uint8_t *data, int len) +{ + struct gsm48_hdr *gh = (struct gsm48_hdr *) data; + struct gsm48_ho_cmd *ho = (struct gsm48_ho_cmd *) gh->data; + int arfcn; + struct gsm_bts *neigh; + + switch (gh->msg_type) { + case GSM48_MT_RR_HANDO_CMD: + arfcn = (ho->cell_desc.arfcn_hi << 8) | ho->cell_desc.arfcn_lo; + + /* look up trx. since every dummy bts uses different arfcn and + * only one trx, it is simple */ + llist_for_each_entry(neigh, &bsc_gsmnet->bts_list, list) { + if (neigh->c0->arfcn != arfcn) + continue; + ho_req_lchan = lchan; + return 0; + } + break; + case GSM48_MT_RR_ASS_CMD: + ho_req_lchan = lchan; + return 0; + break; + default: + fprintf(stderr, "Error, expecting HO or AS command\n"); + return -EINVAL; + } + + return -1; +} + +/* send channel activation ack */ +static void send_chan_act_ack(struct gsm_lchan *lchan, int act) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = (act) ? RSL_MT_CHAN_ACTIV_ACK : RSL_MT_RF_CHAN_REL_ACK; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = gsm_lchan2chan_nr(lchan); + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + + abis_rsl_rcvmsg(msg); +} + +/* send handover complete */ +static void send_ho_complete(struct gsm_lchan *lchan, bool success) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_rll_hdr *rh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t *buf; + struct gsm48_hdr *gh; + struct gsm48_ho_cpl *hc; + + rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); + rh->c.msg_discr = ABIS_RSL_MDISC_RLL; + rh->c.msg_type = RSL_MT_DATA_IND; + rh->ie_chan = RSL_IE_CHAN_NR; + rh->chan_nr = chan_nr; + rh->ie_link_id = RSL_IE_LINK_IDENT; + rh->link_id = 0x00; + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*hc)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*hc)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + hc = (struct gsm48_ho_cpl *) msgb_put(msg, sizeof(*hc)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = + success ? GSM48_MT_RR_HANDO_COMPL : GSM48_MT_RR_HANDO_FAIL; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)rh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +/* RSL messages from BSC */ +int abis_rsl_sendmsg(struct msgb *msg) +{ + struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *) msg->data; + struct e1inp_sign_link *sign_link = msg->dst; + int rc; + struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr, &rc); + + if (rc) { + printf("rsl_lchan_lookup() failed\n"); + exit(1); + } + + switch (dh->c.msg_type) { + case RSL_MT_CHAN_ACTIV: + rc = parse_chan_act(lchan, dh->data); + if (rc == 0) + got_chan_req = 1; + break; + case RSL_MT_RF_CHAN_REL: + rc = parse_chan_rel(lchan, dh->data); + if (rc == 0) + send_chan_act_ack(chan_req_lchan, 0); + break; + case RSL_MT_DATA_REQ: + rc = parse_ho_command(lchan, msg->l3h, msgb_l3len(msg)); + if (rc == 0) + got_ho_req = 1; + break; + case RSL_MT_IPAC_CRCX: + break; + default: + printf("unknown rsl message=0x%x\n", dh->c.msg_type); + } + return 0; +} + +/* test cases */ + +static char *test_case_0[] = { + "2", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_1[] = { + "2", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_2[] = { + "2", + + "Handover and Assignment must be enabled\n\n" + "This test will start with disabled assignment and handover. A\n" + "better neighbor cell (assignment enabled) will not be selected and \n" + "also no assignment from TCH/H to TCH/F to improve quality. There\n" + "will be no handover nor assignment. After enabling assignment on the\n" + "current cell, the MS will assign to TCH/F. After enabling handover\n" + "in the current cell, but disabling in the neighbor cell, handover\n" + "will not be performed, until it is enabled in the neighbor cell too.\n", + + "create-bts", "2", + "afs-rxlev-improve", "0", "5", + "create-ms", "0", "TCH/H", "AMR", + "as-enable", "0", "0", + "ho-enable", "0", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "as-enable", "0", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "ho-enable", "0", "1", + "ho-enable", "1", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "ho-enable", "1", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_3[] = { + "2", + + "Penalty timer must not run\n\n" + "The MS will try to handover to a better cell, but this will fail.\n" + "Even though the cell is still better, handover will not be performed\n" + "due to penalty timer after handover failure\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-failed", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_4[] = { + "2", + + "TCH/H keeping with HR codec\n\n" + "The MS is using half rate V1 codec, but the better cell is congested\n" + "at TCH/H slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/H", "HR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + NULL +}; + +static char *test_case_5[] = { + "2", + + "TCH/F keeping with FR codec\n\n" + "The MS is using full rate V1 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_6[] = { + "2", + + "TCH/F keeping with EFR codec\n\n" + "The MS is using full rate V2 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "EFR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_7[] = { + "2", + + "TCH/F to TCH/H changing with AMR codec\n\n" + "The MS is using AMR V3 codec, the better cell is congested at TCH/F\n" + "slots. The handover is performed to non-congested TCH/H slots.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_8[] = { + "2", + + "No handover to a cell with no slots available\n\n" + "If no slot is available, no handover is performed\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_9[] = { + "2", + + "No more parallel handovers, if max_unsync_ho is defined\n\n" + "There are tree mobiles that want to handover, but only two can do\n" + "it at a time, because the maximum number is limited to two.\n", + + "create-bts", "2", + "set-max-ho", "1", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "meas-rep", "1", "0","0", "1","0","30", + "expect-chan", "1", "2", + "meas-rep", "2", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_10[] = { + "2", + + "Hysteresis\n\n" + "If neighbor cell is better, handover is only performed if the\n" + "ammount of improvement is greater or equal hyteresis\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "27","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "26","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_11[] = { + "2", + + "No Hysteresis and minimum RX level\n\n" + "If current cell's RX level is below mimium level, handover must be\n" + "performed, no matter of the hysteresis. First do not perform\n" + "handover to better neighbor cell, because the hysteresis is not\n" + "met. Second do not perform handover because better neighbor cell is\n" + "below minimum RX level. Third perform handover because current cell\n" + "is below minimum RX level, even if the better neighbor cell (minimum\n" + "RX level reached) does not meet the hysteresis.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", "1","0","11", + "expect-no-chan", + "meas-rep", "0", "8","0", "1","0","9", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","10", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_12[] = { + "2", + + "No handover to congested cell\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "After the congestion is over, handover will be performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_13[] = { + "2", + + "Handover to balance congestion\n\n" + "The current and the better cell are congested, so no handover is\n" + "performed. This is because handover would congest the neighbor cell\n" + "more. After congestion raises in the current cell, the handover is\n" + "performed to balance congestion\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_14[] = { + "2", + + "Handover to congested cell, if RX level is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX level of the current cell drops below minimum acceptable\n" + "level, the handover is performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "10","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_15[] = { + "2", + + "Handover to cell with worse RXLEV, if RXQUAL is below minimum\n\n" + "The neighbor cell has worse RXLEV, so no handover is performed.\n" + "If the RXQUAL of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "reports are received, before RXQUAL is checked.\n", + /* (See also test 28, which tests for RXQUAL triggering HO to congested cell.) */ + /* TODO: bad RXQUAL may want to prefer assignment within the same cell to avoid interference. + * See Performence Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter + * 2.1.1, "Interference" in the list of triggers on p.157. */ + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_16[] = { + "2", + + "Handover due to maximum TA exceeded\n\n" + "The MS in the current (best) cell has reached maximum allowed timing\n" + "advance. No handover is performed until the timing advance exceeds\n" + "it. The originating cell is still the best, but no handover is\n" + "performed back to that cell, because the penalty timer (due to\n" + "maximum allowed timing advance) is running.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-max-ta", "0", "5", /* of cell */ + "set-ta", "0", "5", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "set-ta", "0", "6", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_17[] = { + "2", + + "Congestion check: No congestion\n\n" + "Three cells have different number of used slots, but there is no\n" + "congestion in any of these cells. No handover is performed.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_18[] = { + "2", + + "Congestion check: One out of three cells is congested\n\n" + "Three cells have different number of used slots, but there is\n" + "congestion at TCH/F in the first cell. Handover is performed with\n" + "the best candidate.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","21","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "6", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "3", /* best candidate is MS 2 at BTS 1, TS 3 */ + "ho-complete", + NULL +}; + +static char *test_case_19[] = { + "2", + + "Congestion check: Balancing over congested cells\n\n" + "Two cells are congested, but the second cell is more congested.\n" + "Handover is performed to solve the congestion.\n", + + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "1", "TCH/F", "FR", + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "1","0","21", + "expect-no-chan", + "meas-rep", "2", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "2", /* best candidate is MS 1 at BTS 0, TS 2 */ + "ho-complete", + NULL +}; + +static char *test_case_20[] = { + "2", + + "Congestion check: Solving congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "non-congested TCH/H of second BTS, in order to solve congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_21[] = { + "2", + + "Congestion check: Balancing congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "less-congested TCH/H of second BTS, in order to balance congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_22[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + NULL +}; + +static char *test_case_23[] = { + "2", + + "Story: 'A neighbor is your friend'\n", + + "create-bts", "3", + + "print", + "Andreas is driving along the coast, on a sunny june afternoon.\n" + "Suddenly he is getting a call from his friend and neighbor Axel.\n" + "\n" + "What happens: Two MS are created, #0 for Axel, #1 for Andreas.", + /* Axel */ + "create-ms", "2", "TCH/F", "AMR", + /* andreas */ + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "1", "40","0", "1","0","30", + "expect-no-chan", + + "print", + "Axel asks Andreas if he would like to join them for a barbecue.\n" + "Axel's house is right in the neighborhood and the weather is fine.\n" + "Andreas agrees, so he drives to a close store to buy some barbecue\n" + "skewers.\n" + "\n" + "What happens: While driving, a different cell (mounted atop the\n" + "store) becomes better.", + /* drive to bts 1 */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + "While Andreas is walking into the store, Axel asks, if he could also\n" + "bring some beer. Andreas has problems understanding him: \"I have a\n" + "bad reception here. The cell tower is right atop the store, but poor\n" + "coverage inside. Can you repeat please?\"\n" + "\n" + "What happens: Inside the store the close cell is so bad, that\n" + "handover back to the previous cell is required.", + /* bts 1 becomes bad, so bts 0 helps out */ + "meas-rep", "1", "5","0", "1","0","20", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "After Andreas bought skewers and beer, he leaves the store.\n" + "\n" + "What happens: Outside the store the close cell is better again, so\n" + "handover back to the that cell is performed.", + /* bts 1 becomes better again */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + /* bts 2 becomes better */ + "Andreas drives down to the lake where Axel's house is.\n" + "\n" + "What happens: There is a small cell at Axel's house, which becomes\n" + "better, because the current cell has no good comverage at the lake.", + "meas-rep", "1", "14","0", "2","0","2","1","63", + "expect-chan", "2", "2", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "Andreas wonders why he still has good radio coverage: \"Last time it\n" + "was so bad\". Axel says: \"I installed a pico cell in my house,\n" + "now we can use our mobile phones down here at the lake.\"", + + NULL +}; + +static char *test_case_24[] = { + "2", + "No (or not enough) measurements for handover\n\n" + "Do not solve congestion in cell, because there is no measurement.\n" + "As soon as enough measurments available (1 in our case), perform\n" + "handover. Afterwards the old cell becomes congested and the new\n" + "cell is not. Do not perform handover until new measurements are\n" + "received.\n", + + /* two cells, first in congested, but no handover */ + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "congestion-check", + "expect-no-chan", + + /* send measurement and trigger congestion check */ + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + /* congest the first cell and remove congestion from second cell */ + "set-min-free", "0", "TCH/F", "0", + "set-min-free", "0", "TCH/H", "0", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + + /* no handover until measurements applied */ + "congestion-check", + "expect-no-chan", + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + NULL +}; + +static char *test_case_25[] = { + "1", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_26[] = { + "1", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_27[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen. (So far like test 22.)\n" + "After that, trigger more congestion checks to ensure stability.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + "congestion-check", + "expect-chan", "0", "2", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "congestion-check", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_28[] = { + "2", + + "Handover to congested cell, if RX quality is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX quality of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "resports are received, before RX quality is checked.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char **test_cases[] = { + test_case_0, + test_case_1, + test_case_2, + test_case_3, + test_case_4, + test_case_5, + test_case_6, + test_case_7, + test_case_8, + test_case_9, + test_case_10, + test_case_11, + test_case_12, + test_case_13, + test_case_14, + test_case_15, + test_case_16, + test_case_17, + test_case_18, + test_case_19, + test_case_20, + test_case_21, + test_case_22, + test_case_23, + test_case_24, + test_case_25, + test_case_26, + test_case_27, + test_case_28, + NULL +}; + +int main(int argc, char **argv) +{ + char **test_case; + struct gsm_bts *bts[256]; + int bts_num = 0; + struct gsm_lchan *lchan[256]; + int lchan_num = 0; + int test_count = 0; + int i; + int algorithm; + struct bsc_api bsc_api = {}; + + for (i = 0; test_cases[i]; i++) + test_count++; + + if (argc <= 1 || atoi(argv[1]) >= test_count) { + for (i = 0; test_cases[i]; i++) { + printf("Test #%d (algorithm %s):\n%s\n", i, + test_cases[i][0], test_cases[i][1]); + } + printf("\nPlease specify test case number 0..%d\n", + test_count - 1); + return EXIT_FAILURE; + } + + osmo_init_logging(&log_info); + + log_set_print_category(osmo_stderr_target, 1); + + log_set_category_filter(osmo_stderr_target, DHO, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DHODEC, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DMEAS, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DREF, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DRSL, 1, LOGL_DEBUG); + + /* Create a dummy network */ + bsc_gsmnet = bsc_network_init(NULL, 1, 1); + if (!bsc_gsmnet) + exit(1); + + bsc_api_init(bsc_gsmnet, &bsc_api); + + ho_set_algorithm(bsc_gsmnet->ho, 2); + ho_set_ho_active(bsc_gsmnet->ho, true); + ho_set_as_active(bsc_gsmnet->ho, true); + ho_set_min_rxlev(bsc_gsmnet->ho, -100); + ho_set_rxlev_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxlev_neigh_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxqual_avg_win(bsc_gsmnet->ho, 10); + ho_set_pwr_hysteresis(bsc_gsmnet->ho, 3); + ho_set_pwr_interval(bsc_gsmnet->ho, 1); + ho_set_afs_bias_rxlev(bsc_gsmnet->ho, 0); + ho_set_min_rxqual(bsc_gsmnet->ho, 5); + ho_set_afs_bias_rxqual(bsc_gsmnet->ho, 0); + ho_set_max_distance(bsc_gsmnet->ho, 9999); + ho_set_ho_max(bsc_gsmnet->ho, 9999); + ho_set_penalty_max_dist(bsc_gsmnet->ho, 300); + ho_set_penalty_failed_ho(bsc_gsmnet->ho, 60); + ho_set_penalty_failed_as(bsc_gsmnet->ho, 60); + + bts_model_sysmobts_init(); + + test_case = test_cases[atoi(argv[1])]; + + fprintf(stderr, "--------------------\n"); + fprintf(stderr, "Performing the following test %d (algorithm %s):\n%s", + atoi(argv[1]), test_case[0], test_case[1]); + algorithm = atoi(test_case[0]); + test_case += 2; + fprintf(stderr, "--------------------\n"); + + /* Disable the congestion check timer, we will trigger manually. */ + bsc_gsmnet->ho2.congestion_check_interval_s = 0; + + handover_decision_1_init(); + hodec2_init(bsc_gsmnet); + + while (*test_case) { + if (!strcmp(*test_case, "create-bts")) { + static int arfcn = 870; + int n = atoi(test_case[1]); + fprintf(stderr, "- Creating %d BTS (one TRX each, " + "TS(1-4) are TCH/F, TS(5-6) are TCH/H)\n", n); + for (i = 0; i < n; i++) + bts[bts_num + i] = create_bts(arfcn++); + for (i = 0; i < n; i++) + gsm_generate_si(bts[bts_num + i], + SYSINFO_TYPE_2); + bts_num += n; + test_case += 2; + } else + if (!strcmp(*test_case, "as-enable")) { + fprintf(stderr, "- Set assignment enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_as_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "ho-enable")) { + fprintf(stderr, "- Set handover enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_ho_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxlev-improve")) { + fprintf(stderr, "- Set afs RX level improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxlev(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxqual-improve")) { + fprintf(stderr, "- Set afs RX quality improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxqual(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-min-free")) { + fprintf(stderr, "- Setting minimum required free %s " + "slots at BTS %s to %s\n", test_case[2], + test_case[1], test_case[3]); + if (!strcmp(test_case[2], "TCH/F")) + ho_set_tchf_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + else + ho_set_tchh_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + test_case += 4; + } else + if (!strcmp(*test_case, "set-max-ho")) { + fprintf(stderr, "- Setting maximum parallel handovers " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_ho_max( bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-max-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_max_distance(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "create-ms")) { + fprintf(stderr, "- Creating mobile #%d at BTS %s on " + "%s with %s codec\n", lchan_num, test_case[1], + test_case[2], test_case[3]); + lchan[lchan_num] = create_lchan(bts[atoi(test_case[1])], + !strcmp(test_case[2], "TCH/F"), test_case[3]); + if (!lchan[lchan_num]) { + printf("Failed to create lchan!\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * New MS is at BTS %d TS %d\n", + lchan[lchan_num]->ts->trx->bts->nr, + lchan[lchan_num]->ts->nr); + lchan_num++; + test_case += 4; + } else + if (!strcmp(*test_case, "set-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at MS %s to %s\n", test_case[1], + test_case[2]); + meas_ta_ms = atoi(test_case[2]); + test_case += 3; + } else + if (!strcmp(*test_case, "meas-rep")) { + /* meas-rep [ [...]] */ + int n = atoi(test_case[4]); + struct gsm_lchan *lc = lchan[atoi(test_case[1])]; + fprintf(stderr, "- Sending measurement report from " + "mobile #%s (rxlev=%s, rxqual=%s)\n", + test_case[1], test_case[2], test_case[3]); + meas_dl_rxlev = atoi(test_case[2]); + meas_dl_rxqual = atoi(test_case[3]); + meas_num_nc = n; + test_case += 5; + for (i = 0; i < n; i++) { + int nr = atoi(test_case[0]); + /* since our bts is not in the list of neighbor + * cells, we need to shift */ + if (nr >= lc->ts->trx->bts->nr) + nr++; + fprintf(stderr, " * Neighbor cell #%s, actual " + "BTS %d (rxlev=%s)\n", test_case[0], nr, + test_case[1]); + meas_bcch_f_nc[i] = atoi(test_case[0]); + /* bts number, not counting our own */ + meas_rxlev_nc[i] = atoi(test_case[1]); + meas_bsic_nc[i] = 0x3f; + test_case += 2; + } + got_chan_req = 0; + gen_meas_rep(lc); + } else + if (!strcmp(*test_case, "congestion-check")) { + fprintf(stderr, "- Triggering congestion check\n"); + got_chan_req = 0; + if (algorithm == 2) + hodec2_congestion_check(bsc_gsmnet); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-chan")) { + fprintf(stderr, "- Expecting channel request at BTS %s " + "TS %s\n", test_case[1], test_case[2]); + if (!got_chan_req) { + printf("Test failed, because no channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got channel request at BTS %d " + "TS %d\n", chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + if (chan_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because channel was not " + "requested on expected BTS\n"); + return EXIT_FAILURE; + } + if (chan_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because channel was not " + "requested on expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "expect-no-chan")) { + fprintf(stderr, "- Expecting no channel request\n"); + if (got_chan_req) { + fprintf(stderr, " * Got channel request at " + "BTS %d TS %d\n", + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + printf("Test failed, because channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got no channel request\n"); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-ho")) { + fprintf(stderr, "- Expecting handover/assignment " + "request at BTS %s TS %s\n", test_case[1], + test_case[2]); + if (!got_ho_req) { + printf("Test failed, because no handover was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got handover/assignment request at " + "BTS %d TS %d\n", + ho_req_lchan->ts->trx->bts->nr, + ho_req_lchan->ts->nr); + if (ho_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected BTS\n"); + return EXIT_FAILURE; + } + if (ho_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "ack-chan")) { + fprintf(stderr, "- Acknowledging channel request\n"); + if (!got_chan_req) { + printf("Cannot ack channel, because no " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_ho_req = 0; + send_chan_act_ack(chan_req_lchan, 1); + } else + if (!strcmp(*test_case, "ho-complete")) { + fprintf(stderr, "- Acknowledging handover/assignment " + "request\n"); + if (!got_chan_req) { + printf("Cannot ack handover/assignment, " + "because no chan request\n"); + return EXIT_FAILURE; + } + if (!got_ho_req) { + printf("Cannot ack handover/assignment, " + "because no ho request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + /* switch lchan */ + for (i = 0; i < lchan_num; i++) { + if (lchan[i] == ho_req_lchan) { + fprintf(stderr, " * MS %d changes from " + "BTS=%d TS=%d to BTS=%d " + "TS=%d\n", i, + lchan[i]->ts->trx->bts->nr, + lchan[i]->ts->nr, + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + lchan[i] = chan_req_lchan; + } + } + send_ho_complete(chan_req_lchan, true); + } else + if (!strcmp(*test_case, "ho-failed")) { + fprintf(stderr, "- Making handover fail\n"); + if (!got_chan_req) { + printf("Cannot fail handover, because no chan " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + send_ho_complete(ho_req_lchan, false); + } else + if (!strcmp(*test_case, "print")) { + fprintf(stderr, "\n%s\n\n", test_case[1]); + test_case += 2; + } else { + printf("Unknown test command '%s', please fix!\n", + *test_case); + return EXIT_FAILURE; + } + } + + for (i = 0; i < lchan_num; i++) { + struct gsm_subscriber_connection *conn = lchan[i]->conn; + lchan[i]->conn = NULL; + conn->lchan = NULL; + bsc_subscr_con_free(conn); + lchan_free(lchan[i]); + } + + fprintf(stderr, "--------------------\n"); + + printf("Test OK\n"); + + fprintf(stderr, "--------------------\n"); + + return EXIT_SUCCESS; +} + +void rtp_socket_free() {} +void rtp_send_frame() {} +void rtp_socket_upstream() {} +void rtp_socket_create() {} +void rtp_socket_connect() {} +void rtp_socket_proxy() {} +void trau_mux_unmap() {} +void trau_mux_map_lchan() {} +void trau_recv_lchan() {} +void trau_send_frame() {} diff --git a/tests/handover/handover_test.ok b/tests/handover/handover_test.ok new file mode 100644 index 0000000..678f9a3 --- /dev/null +++ b/tests/handover/handover_test.ok @@ -0,0 +1 @@ +Test OK diff --git a/tests/testsuite.at b/tests/testsuite.at index 6ef3f29..f0f6fd1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -51,3 +51,177 @@ cat $abs_srcdir/bssap/bssap_test.err > experr AT_CHECK([$abs_top_builddir/tests/bssap/bssap_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([handover test 0]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 1]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 2]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 3]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 4]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 5]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 6]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 7]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 8]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 9]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 10]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 11]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 12]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 13]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 14]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 15]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 16]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 17]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 18]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 19]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 20]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 21]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 22]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 23]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 24]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 25]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 26]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 27]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 28]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 04:25:26 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 04:25:26 +0000 Subject: [PATCH] osmo-ci[master]: jobs: master: also trigger once per day Message-ID: Review at https://gerrit.osmocom.org/5924 jobs: master: also trigger once per day Recently we had changes to osmo-ci, and I noticed that although some master builds were broken by that, the builds were still showing success -- of twenty days ago. Run each master build at least once a day to indicate odd side effect failure sooner. Change-Id: I126de2bab3db22cb693b0fa665f6579de9238fdf --- M jobs/master-builds.yml 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/24/5924/1 diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 84a97a9..c05ba4a 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -299,6 +299,7 @@ - pollscm: cron: "H/5 * * * *" ignore-post-commit-hooks: false + - timed: "H H * * *" builders: - shell: '{obj:cmd}' -- To view, visit https://gerrit.osmocom.org/5924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I126de2bab3db22cb693b0fa665f6579de9238fdf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 04:32:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 04:32:32 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5921 to look at the new patch set (#4). HO: Implement load based handover, as handover_decision_2.c Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M include/osmocom/bsc/handover.h M include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_decision_2.h M include/osmocom/bsc/handover_vty.h M include/osmocom/bsc/signal.h M src/libbsc/Makefile.am M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c A src/libbsc/handover_decision_2.c M src/libbsc/handover_logic.c M src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/gsm_data.c M src/libcommon/handover_cfg.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M tests/Makefile.am A tests/handover/Makefile.am A tests/handover/handover_test.c A tests/handover/handover_test.ok M tests/handover_cfg.vty M tests/testsuite.at 28 files changed, 3,866 insertions(+), 87 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/5921/4 diff --git a/configure.ac b/configure.ac index d756970..fc4678f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,7 @@ tests/subscr/Makefile tests/nanobts_omlattr/Makefile tests/bssap/Makefile + tests/handover/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 699aeb3..a3d9adf 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -27,6 +27,7 @@ handover.h \ handover_cfg.h \ handover_decision.h \ + handover_decision_2.h \ handover_vty.h \ ipaccess.h \ meas_feed.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..c24e22a 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -74,8 +75,8 @@ /* penalty timers for handover */ struct ho_penalty_timer { struct llist_head entry; - uint8_t bts; - time_t timeout; + uint8_t bts_nr; + unsigned int timeout; }; /* active radio connection of a mobile subscriber */ @@ -112,8 +113,18 @@ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; - /* penalty timers for handover */ + /* failure count and penalty timers for handover */ + int ho_failure; struct llist_head ho_penalty_timers; + + /* "Codec List (MSC Preferred)" as received by the BSSAP Assignment Request. 3GPP 48.008 + * 3.2.2.103 says: + * The "Codec List (MSC Preferred)" shall not include codecs + * that are not supported by the MS. + * i.e. by heeding the "Codec list (MSC Preferred)", we inherently heed the MS bearer + * capabilities, which the MSC is required to translate into the codec list. */ + struct gsm0808_speech_codec_list codec_list; + bool codec_list_present; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { @@ -243,7 +254,12 @@ uint16_t network_code; int a5_encryption; int neci; + struct handover_cfg *ho; + struct { + unsigned int congestion_check_interval_s; + struct osmo_timer_list congestion_check_timer; + } ho2; struct rate_ctr_group *bsc_ctrs; @@ -443,4 +459,11 @@ bool classmark_is_r99(struct gsm_classmark *cm); +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout); +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 86c5ca9..776e047 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -269,6 +269,7 @@ struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; + uint8_t meas_rep_last_seen_nr; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index a9349ee..f764456 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -5,6 +5,8 @@ struct gsm_subscriber_connection; int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *bts, + enum gsm_chan_t new_lchan_type); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 1b81235..7ef27ee 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -10,6 +10,8 @@ * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ struct handover_cfg; +#define HO_CFG_CONGESTION_CHECK_DEFAULT 10 + struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); #define HO_CFG_STR_HANDOVER "Handover options\n" @@ -46,22 +48,6 @@ static inline const char *tdma2a(bool val) { return val? "full" : "subset"; -} - -static inline const int a2congestion_check_interval(const char *arg) -{ - if (!strcmp(arg, "disabled")) - return 0; - return atoi(arg); -} - -static inline const char *congestion_check_interval2a(int val) -{ - static char str[9]; - if (val < 1 - || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) - return "disabled"; - return str; } /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, @@ -146,14 +132,6 @@ "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ "Disable in-call assignment\n" \ "Enable in-call assignment\n") \ - \ - HO_CFG_ONE_MEMBER(int, congestion_check_interval, 10, \ - "handover congestion-check", "disabled|<1-60>", \ - a2congestion_check_interval, "%s", congestion_check_interval2a, \ - HO_CFG_STR_HANDOVER \ - "Configure congestion check interval" HO_CFG_STR_2 \ - "Disable congestion checking, do not handover based on cell overload\n" \ - "Congestion check interval in seconds\n") \ \ HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ diff --git a/include/osmocom/bsc/handover_decision_2.h b/include/osmocom/bsc/handover_decision_2.h new file mode 100644 index 0000000..f245b07 --- /dev/null +++ b/include/osmocom/bsc/handover_decision_2.h @@ -0,0 +1,9 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC */ + +#pragma once +struct gsm_bts; + +void hodec2_init(struct gsm_network *net); + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval); +void hodec2_congestion_check(struct gsm_network *net); diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h index 48af136..6ad5276 100644 --- a/include/osmocom/bsc/handover_vty.h +++ b/include/osmocom/bsc/handover_vty.h @@ -4,4 +4,5 @@ #include void ho_vty_init(); -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); +void ho_vty_write_net(struct vty *vty, struct gsm_network *net); +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts); diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 9c0d5a3..1c8b51e 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -104,6 +104,7 @@ enum signal_global { S_GLOBAL_BTS_CLOSE_OM, + S_GLOBAL_BTS_NEW, }; /* SS_RF signals */ diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index d118f44..7e088e5 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -58,5 +58,6 @@ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ handover_vty.c \ + handover_decision_2.c \ $(NULL) diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index bdd86a9..82b21b9 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1523,8 +1523,9 @@ } mr->lchan->meas_rep_count++; - LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", - gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + mr->lchan->meas_rep_last_seen_nr = mr->nr; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_count++=%d meas_rep_last_seen_nr=%u\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count, mr->lchan->meas_rep_last_seen_nr); print_meas_rep(msg->lchan, mr); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index a501db2..73bdee5 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -323,8 +323,6 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { - struct ho_penalty_timer *penalty; - if (!conn) return; @@ -349,12 +347,7 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); - /* flush handover penalty timers */ - while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, - struct ho_penalty_timer, entry))) { - llist_del(&penalty->entry); - talloc_free(penalty); - } + conn_penalty_timer_clear(conn, NULL); llist_del(&conn->entry); talloc_free(conn); @@ -672,8 +665,8 @@ struct lchan_signal_data sig; struct gsm48_hdr *gh = msgb_l3(msg); - DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", - rr_cause_name(gh->data[0])); + DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + DEBUGP(DHO, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); sig.lchan = msg->lchan; sig.mr = NULL; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index a304e86..d4591b7 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -795,7 +795,7 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); - ho_vty_write(vty, " ", bts->ho); + ho_vty_write_bts(vty, bts); config_write_bts_model(vty, bts); } @@ -827,7 +827,7 @@ vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - ho_vty_write(vty, " ", gsmnet->ho); + ho_vty_write_net(vty, gsmnet); VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index b3056da..9e83f27 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -414,6 +414,7 @@ /* reset measurement report counter and index */ lchan->meas_rep_count = 0; lchan->meas_rep_idx = 0; + lchan->meas_rep_last_seen_nr = 255; /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/handover_decision_2.c b/src/libbsc/handover_decision_2.c new file mode 100644 index 0000000..2286147 --- /dev/null +++ b/src/libbsc/handover_decision_2.c @@ -0,0 +1,1761 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC. */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Andreas Eversberg + * Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOGPHOBTS(bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) + +#define LOGPHOLCHAN(lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_bts->nr, \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define REQUIREMENT_A_TCHF 0x01 +#define REQUIREMENT_B_TCHF 0x02 +#define REQUIREMENT_C_TCHF 0x04 +#define REQUIREMENT_A_TCHH 0x10 +#define REQUIREMENT_B_TCHH 0x20 +#define REQUIREMENT_C_TCHH 0x40 +#define REQUIREMENT_TCHF_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_B_TCHF | REQUIREMENT_C_TCHF) +#define REQUIREMENT_TCHH_MASK (REQUIREMENT_A_TCHH | REQUIREMENT_B_TCHH | REQUIREMENT_C_TCHH) +#define REQUIREMENT_A_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_A_TCHH) +#define REQUIREMENT_B_MASK (REQUIREMENT_B_TCHF | REQUIREMENT_B_TCHH) +#define REQUIREMENT_C_MASK (REQUIREMENT_C_TCHF | REQUIREMENT_C_TCHH) + +struct ho_candidate { + struct gsm_lchan *lchan; /* candidate for whom */ + struct gsm_bts *bts; /* target BTS */ + uint8_t requirements; /* what is fulfilled */ + int avg; /* average RX level */ +}; + +enum ho_reason { + HO_REASON_INTERFERENCE, + HO_REASON_BAD_QUALITY, + HO_REASON_LOW_RXLEVEL, + HO_REASON_MAX_DISTANCE, + HO_REASON_BETTER_CELL, + HO_REASON_CONGESTION, +}; + +static const struct value_string ho_reason_names[] = { + { HO_REASON_INTERFERENCE, "interference (bad quality)" }, + { HO_REASON_BAD_QUALITY, "bad quality" }, + { HO_REASON_LOW_RXLEVEL, "low rxlevel" }, + { HO_REASON_MAX_DISTANCE, "maximum allowed distance" }, + { HO_REASON_BETTER_CELL, "better cell" }, + { HO_REASON_CONGESTION, "congestion" }, + {0, NULL} +}; + +static const char *ho_reason_name(int value) +{ + return get_value_string(ho_reason_names, value); +} + + +static bool ho2_initialized = false; +static enum ho_reason global_ho_reason; + +static void congestion_check_cb(void *arg); + +/* This function gets called on ho2 init, whenever the congestion check interval is changed, and also + * when the timer has fired to trigger again after the next congestion check timeout. */ +static void reinit_congestion_timer(struct gsm_network *net) +{ + int congestion_check_interval_s; + bool was_active; + + /* Don't setup timers from VTY config parsing before the main program has actually initialized + * the data structures. */ + if (!ho2_initialized) + return; + + was_active = net->ho2.congestion_check_timer.active; + if (was_active) + osmo_timer_del(&net->ho2.congestion_check_timer); + + congestion_check_interval_s = net->ho2.congestion_check_interval_s; + if (congestion_check_interval_s < 1) { + if (was_active) + LOGP(DHODEC, LOGL_NOTICE, "HO algorithm 2: Disabling congestion check\n"); + return; + } + + LOGP(DHODEC, LOGL_DEBUG, "HO algorithm 2: next periodical congestion check in %u seconds\n", + congestion_check_interval_s); + + osmo_timer_setup(&net->ho2.congestion_check_timer, + congestion_check_cb, net); + osmo_timer_schedule(&net->ho2.congestion_check_timer, + congestion_check_interval_s, 0); +} + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval) +{ + net->ho2.congestion_check_interval_s = new_interval; + reinit_congestion_timer(net); +} + +/* did we get a RXLEV for a given cell in the given report? Mark matches as MRC_F_PROCESSED. */ +static struct gsm_meas_rep_cell *cell_in_rep(struct gsm_meas_rep *mr, uint16_t arfcn, uint8_t bsic) +{ + int i; + + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + + if (mrc->arfcn != arfcn) + continue; + if (mrc->bsic != bsic) + continue; + + return mrc; + } + return NULL; +} + +/* obtain averaged rxlev for given neighbor */ +static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window) +{ + unsigned int i, idx; + int avg = 0; + + /* reduce window to the actual number of existing measurements */ + if (window > nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window <= 0) + return 0; + + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), + nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), + window); + + for (i = 0; i < window; i++) { + int j = (idx+i) % ARRAY_SIZE(nmp->rxlev); + + avg += nmp->rxlev[j]; + } + + return avg / window; +} + +/* Find empty slot or the worst neighbor. */ +static struct neigh_meas_proc *find_unused_or_worst_neigh(struct gsm_lchan *lchan) +{ + struct neigh_meas_proc *nmp_worst = NULL; + int worst; + int j; + + /* First try to find an empty/unused slot. */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + if (!nmp->arfcn) + return nmp; + } + + /* No empty slot found. Return worst neighbor to be evicted. */ + worst = 0; /* (overwritten on first loop, but avoid compiler warning) */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + int avg = neigh_meas_avg(nmp, MAX_WIN_NEIGH_AVG); + if (nmp_worst && avg >= worst) + continue; + worst = avg; + nmp_worst = nmp; + } + + return nmp_worst; +} + +/* process neighbor cell measurement reports */ +static void process_meas_neigh(struct gsm_meas_rep *mr) +{ + int i, j, idx; + + /* for each reported cell, try to update global state */ + for (j = 0; j < ARRAY_SIZE(mr->lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &mr->lchan->neigh_meas[j]; + unsigned int idx; + struct gsm_meas_rep_cell *mrc; + + /* skip unused entries */ + if (!nmp->arfcn) + continue; + + mrc = cell_in_rep(mr, nmp->arfcn, nmp->bsic); + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + if (mrc) { + nmp->rxlev[idx] = mrc->rxlev; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + mrc->flags |= MRC_F_PROCESSED; + } else { + nmp->rxlev[idx] = 0; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr); + } + nmp->rxlev_cnt++; + } + + /* iterate over list of reported cells, check if we did not + * process all of them */ + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + struct neigh_meas_proc *nmp; + + if (mrc->flags & MRC_F_PROCESSED) + continue; + + nmp = find_unused_or_worst_neigh(mr->lchan); + + nmp->arfcn = mrc->arfcn; + nmp->bsic = mrc->bsic; + + nmp->rxlev_cnt = 0; + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + nmp->rxlev[idx] = mrc->rxlev; + nmp->rxlev_cnt++; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u new in report rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + + mrc->flags |= MRC_F_PROCESSED; + } +} + +static bool codec_type_is_supported(struct gsm_subscriber_connection *conn, + enum gsm0808_speech_codec_type type) +{ + int i; + struct gsm0808_speech_codec_list *clist = &conn->codec_list; + + if (!conn->codec_list_present) { + /* We don't have a list of supported codecs. This should never happen. */ + LOGPHOLCHAN(conn->lchan, LOGL_ERROR, + "No Speech Codec List present, accepting all codecs\n"); + return true; + } + + for (i = 0; i < clist->len; i++) { + if (clist->codec[i].type == type) { + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", + gsm0808_speech_codec_type_name(type)); + return true; + } + } + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", + gsm0808_speech_codec_type_name(type)); + return false; +} + +/* + * Check what requirements the given cell fulfills. + * A bit mask of fulfilled requirements is returned. + * + * Target cell requirement A -- ability to service the call + * + * In order to successfully handover/assign to a better cell, the target cell + * must be able to continue the current call. Therefore the cell must fulfill + * the following criteria: + * + * * The handover must be enabled for the target cell, if it differs from the + * originating cell. + * * The assignment must be enabled for the cell, if it equals the current + * cell. + * * The handover penalty timer must not run for the cell. + * * If FR, EFR or HR codec is used, the cell must support this codec. + * * If FR or EFR codec is used, the cell must have a TCH/F slot type + * available. + * * If HR codec is used, the cell must have a TCH/H slot type available. + * * If AMR codec is used, the cell must have a TCH/F slot available, if AFS + * is supported by mobile and BTS. + * * If AMR codec is used, the cell must have a TCH/H slot available, if AHS + * is supported by mobile and BTS. + * * osmo-nitb with built-in MNCC application: + * o If AMR codec is used, the cell must support AMR codec with equal codec + * rate or rates. (not meaning TCH types) + * * If defined, the number of maximum unsynchronized handovers to this cell + * may not be exceeded. (This limits processing load for random access + * bursts.) + * + * + * Target cell requirement B -- avoid congestion + * + * In order to prevent congestion of a target cell, the cell must fulfill the + * requirement A, but also: + * + * * The minimum free channels, that are defined for that cell must be + * maintained after handover/assignment. + * * The minimum free channels are defined for TCH/F and TCH/H slot types + * individually. + * + * + * Target cell requirement C -- balance congestion + * + * In order to balance congested cells, the target cell must fulfill the + * requirement A, but also: + * + * * The target cell (which is congested also) must have more or equal free + * slots after handover/assignment. + * * The number of free slots are checked for TCH/F and TCH/H slot types + * individually. + */ +static uint8_t check_requirements(struct gsm_lchan *lchan, struct gsm_bts *bts, int tchf_count, int tchh_count) +{ + int count; + uint8_t requirement = 0; + unsigned int penalty_time; + struct gsm_bts *current_bts = lchan->ts->trx->bts; + + /* Requirement A */ + + /* the handover/assignment must not be disabled */ + if (current_bts == bts) { + if (!ho_get_as_active(bts->ho)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Assignment disabled\n"); + return 0; + } + } else { + if (!ho_get_ho_active(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, handover is disabled in target BTS\n"); + return 0; + } + } + + /* the handover penalty timer must not run for this bts */ + penalty_time = conn_penalty_timer_remaining(lchan->conn, bts); + if (penalty_time) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, target BTS still in penalty time" + " (%u seconds left)\n", penalty_time); + return 0; + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + + /* compatibility check for codecs. + * if so, the candidates for full rate and half rate are selected */ + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_V1: + switch (lchan->type) { + case GSM_LCHAN_TCH_F: /* mandatory */ + requirement |= REQUIREMENT_A_TCHF; + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + case GSM_LCHAN_TCH_H: + if (!bts->codec.hr) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "tch_mode='%s' type='%s' not supported\n", + get_value_string(gsm48_chan_mode_names, + lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR1)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHAN(lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode)); + return 0; + } + break; + case GSM48_CMODE_SPEECH_EFR: + if (!bts->codec.efr) { + LOGPHOBTS(bts, LOGL_DEBUG, "EFR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR2)) + requirement |= REQUIREMENT_A_TCHF; + break; + case GSM48_CMODE_SPEECH_AMR: + if (!bts->codec.amr) { + LOGPHOBTS(bts, LOGL_DEBUG, "AMR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR3)) + requirement |= REQUIREMENT_A_TCHF; + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR3)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "Not even considering: src is not a SPEECH mode lchan\n"); + return 0; + } + + /* no candidate, because new cell is incompatible */ + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because codec of MS and BTS are incompatible\n"); + return 0; + } + + /* remove slot types that are not available */ + if (!tchf_count && requirement & REQUIREMENT_A_TCHF) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, since all TCH/F lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + } + if (!tchh_count && requirement & REQUIREMENT_A_TCHH) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, since all TCH/H lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because no suitable slots available\n"); + return 0; + } + + /* omit same channel type on same BTS (will not change anything) */ + if (bts == current_bts) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, already on TCH/F in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + break; + case GSM_LCHAN_TCH_H: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, already on TCH/H in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Reassignment within cell not an option, no differing channel types available\n"); + return 0; + } + } + +#ifdef LEGACY + // This was useful in osmo-nitb. We're in osmo-bsc now and have no idea whether the osmo-msc does + // internal or external call control. Maybe a future config switch wants to add this behavior? + /* Built-in call control requires equal codec rates. Remove rates that are not equal. */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && current_bts->network->mncc_recv != mncc_sock_from_cc) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_full, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_full, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + case GSM_LCHAN_TCH_H: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_half, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_half, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, cannot provide identical codec rate\n"); + return 0; + } + } +#endif + + /* the maximum number of unsynchonized handovers must no be exceeded */ + if (current_bts != bts + && bsc_ho_count(bts, true) >= ho_get_ho_max(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, number of allowed handovers (%d) would be exceeded\n", + ho_get_ho_max(bts->ho)); + return 0; + } + + /* Requirement B */ + + /* the minimum free timeslots that are defined for this cell must + * be maintained _after_ handover/assignment */ + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= ho_get_tchf_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be congested after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= ho_get_tchh_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be congested after HO\n"); + } + } + + /* Requirement C */ + + /* the nr of free timeslots of the target cell must be >= the + * free slots of the current cell _after_ handover/assignment */ + count = bts_count_free_ts(current_bts, + (lchan->type == GSM_LCHAN_TCH_H) ? + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be less congested in target than source cell after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be less congested in target than source cell after HO\n"); + } + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); + + /* return mask of fulfilled requirements */ + return requirement; +} + +/* Trigger handover or assignment depending on the target BTS */ +static int trigger_handover_or_assignment(struct gsm_lchan *lchan, struct gsm_bts *new_bts, uint8_t requirements) +{ + struct gsm_bts *current_bts = lchan->ts->trx->bts; + int afs_bias = 0; + bool full_rate = false; + + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); + + /* afs_bias becomes > 0, if AFS is used and is improved */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + afs_bias = ho_get_afs_bias_rxlev(new_bts->ho); + + /* select TCH rate, prefer TCH/F if AFS is improved */ + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + /* keep on full rate, if TCH/F is a candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK)) { + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + full_rate = true; + break; + } + /* change to half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + break; + case GSM_LCHAN_TCH_H: + /* change to full rate if AFS is improved and a candidate */ + if (afs_bias > 0 && (requirements & REQUIREMENT_TCHF_MASK)) { + full_rate = true; + LOGPHOLCHAN(lchan, LOGL_DEBUG, "[Improve AHS->AFS]\n"); + break; + } + /* change to full rate if the only candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK) + && !(requirements & REQUIREMENT_TCHH_MASK)) { + full_rate = true; + break; + } + /* keep on half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + break; + default: + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, "lchan is neither TCH/F nor TCH/H, aborting ho/as\n"); + return -EINVAL; + } + + /* trigger handover or assignment */ + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering assignment to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + "Triggering handover to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + + return bsc_handover_start_lchan_change(lchan, current_bts == new_bts? NULL : new_bts, + full_rate? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H); +} + +/* debug collected candidates */ +static inline void debug_candidate(struct ho_candidate *candidate, + int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +{ + if (neighbor) + LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " + "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), + rxlev2dbm(candidate->avg)); + else + LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", + candidate->bts->nr, rxlev2dbm(candidate->avg)); + + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " + "%d\n", tchf_count, ho_get_tchf_min_slots(candidate->bts->ho)); + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " + "%d\n", tchh_count, ho_get_tchh_min_slots(candidate->bts->ho)); + + if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); + if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) + == REQUIREMENT_A_TCHF) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); + + if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); + if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) + == REQUIREMENT_A_TCHH) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); +} + +/* add candidate for re-assignment within the current cell */ +static void collect_assignment_candidate(struct gsm_lchan *lchan, struct ho_candidate *clist, + unsigned int *candidates, int av_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct ho_candidate *c; + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = bts; + c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); + c->avg = av_rxlev; + debug_candidate(c, 0, 0, tchf_count, tchh_count); + (*candidates)++; +} + +/* add candidates for handover to all neighbor cells */ +static void collect_handover_candidate(struct gsm_lchan *lchan, struct neigh_meas_proc *nmp, + struct ho_candidate *clist, unsigned int *candidates, + bool include_weaker_rxlev, int av_rxlev, + int *neighbors_count) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct gsm_bts *neighbor_bts; + int avg; + struct ho_candidate *c; + int min_rxlev; + + /* skip empty slots */ + if (nmp->arfcn == 0) + return; + + if (neighbors_count) + (*neighbors_count)++; + + /* skip if measurement report is old */ + if (nmp->last_seen_nr != lchan->meas_rep_last_seen_nr) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "neighbor ARFCN %u measurement report is old" + " (nmp->last_seen_nr=%u lchan->meas_rep_last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr, lchan->meas_rep_last_seen_nr); + return; + } + + neighbor_bts = bts_by_arfcn_bsic(bts->network, nmp->arfcn, nmp->bsic); + if (!neighbor_bts) { + LOGPHOBTS(bts, LOGL_DEBUG, "neighbor ARFCN %u does not belong to this network\n", + nmp->arfcn); + return; + } + + /* in case we have measurements of our bts, due to misconfiguration */ + if (neighbor_bts == bts) { + LOGPHOBTS(bts, LOGL_ERROR, "Configuration error: this BTS appears as its own neighbor\n"); + return; + } + + /* caculate average rxlev for this cell over the window */ + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); + + /* Heed rxlev hysteresis only if the RXLEV/RXQUAL/TA levels of the MS aren't critically bad and + * we're just looking for an improvement. If levels are critical, we desperately need a handover + * and thus skip the hysteresis check. */ + if (!include_weaker_rxlev) { + unsigned int pwr_hyst = ho_get_pwr_hysteresis(bts->ho); + if (avg <= (av_rxlev + pwr_hyst)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " or equal than current RX level (%d) + hysteresis (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), rxlev2dbm(av_rxlev), pwr_hyst); + return; + } + } + + /* if the minimum level is not reached */ + min_rxlev = ho_get_min_rxlev(neighbor_bts->ho); + if (rxlev2dbm(avg) < min_rxlev) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " than its minimum required RX level (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), min_rxlev); + return; + } + + tchf_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_H); + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = neighbor_bts; + c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, + tchh_count); + c->avg = avg; + debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + (*candidates)++; +} + +static void collect_candidates_for_lchan(struct gsm_lchan *lchan, + struct ho_candidate *clist, unsigned int *candidates, + int *_av_rxlev, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev; + unsigned int candidates_was; + bool assignment; + bool handover; + int neighbors_count = 0; + unsigned int rxlev_avg_win = ho_get_rxlev_avg_win(bts->ho); + + OSMO_ASSERT(candidates); + candidates_was = *candidates; + + /* caculate average rxlev for this cell over the window */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + rxlev_avg_win); + if (_av_rxlev) + *_av_rxlev = av_rxlev; + + /* in case there is no measurment report (yet) */ + if (av_rxlev < 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Not collecting candidates, not enough measurements" + " (got %d, want %u)\n", + lchan->meas_rep_count, rxlev_avg_win); + return; + } + + assignment = ho_get_as_active(bts->ho); + handover = ho_get_ho_active(bts->ho); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", + assignment ? " Assignment" : "", + assignment && handover ? " and" : "", + handover ? " Handover" : ""); + + if (assignment) + collect_assignment_candidate(lchan, clist, candidates, av_rxlev); + + if (handover) { + int i; + for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++) { + collect_handover_candidate(lchan, &lchan->neigh_meas[i], + clist, candidates, + include_weaker_rxlev, av_rxlev, &neighbors_count); + } + } + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", + *candidates - candidates_was, neighbors_count, *candidates); +} + +/* + * Search for a alternative / better cell. + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * + * If one or more 'better cells' are available, check the current and neighbor + * cell measurements in descending order of their RX levels (down-link): + * + * * Select the best candidate that fulfills requirement B (no congestion + * after handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, do not perform handover nor + * assignment. + * + * If the RX level (down-link) or RX quality (down-link) of the current cell is + * below minimum acceptable level, or if the maximum allowed timing advance is + * reached or exceeded, check the RX levels (down-link) of the current and + * neighbor cells in descending order of their levels: (bad BTS case) + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, select the best candidate that + * fulfills requirement A (ignore congestion after handover or assignment) + * and trigger handover or assignment. + * * If no candidate fulfills requirement A, do not perform handover nor + * assignment. + * + * RX levels (down-link) of current and neighbor cells: + * + * * The RX levels of the current cell and neighbor cells are improved by a + * given offset, if AFS (AMR on TCH/F) is used or is a candidate for + * handover/assignment. + * * If AMR is used, the requirement for handover is checked for TCH/F and + * TCH/H. Both results (if any) are used as a candidate. + * * If AMR is used, the requirement for assignment to a different TCH slot + * rate is checked. The result (if available) is used as a candidate. + * + * If minimum RXLEV, minimum RXQUAL or maximum TA are exceeded, the caller should pass + * include_weaker_rxlev=true so that handover is performed despite congestion. + */ +static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int ahs = (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && lchan->type == GSM_LCHAN_TCH_H); + int av_rxlev; + struct ho_candidate clist[1 + ARRAY_SIZE(lchan->neigh_meas)]; + unsigned int candidates = 0; + int i; + struct ho_candidate *best_cand = NULL; + unsigned int best_better_db; + bool best_applied_afs_bias = false; + int better; + + /* check for disabled handover/assignment at the current cell */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGP(DHODEC, LOGL_INFO, "Skipping, Handover and Assignment both disabled in this cell\n"); + return 0; + } + + collect_candidates_for_lchan(lchan, clist, &candidates, &av_rxlev, include_weaker_rxlev); + + /* If assignment is disabled and no neighbor cell report exists, or no neighbor cell qualifies, + * we may not even have any candidates. */ + if (!candidates) + goto no_candidates; + + /* select best candidate that fulfills requirement B: no congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_B_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); + } + + /* select best candidate that fulfills requirement C: less or equal congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_C_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); + } + + /* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're avoiding congestion. */ + if (!include_weaker_rxlev) + goto no_candidates; + + /* Select best candidate that fulfills requirement A: can service the call. + * From above we know that there are no options that avoid congestion. Here we're trying to find + * *any* free lchan that has no critically low RXLEV and is able to handle the MS. */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_A_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_A_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d" + " with greater congestion found%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_A_MASK); + } + + /* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec + * restrictions or because all lchans are taken. */ + +no_candidates: + if (include_weaker_rxlev) + LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n"); + else + LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n"); + + return 0; +} + +/* + * Handover/assignment check, if measurement report is received + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. + * + * In case of handover triggered because maximum allowed timing advance is + * exceeded, the handover penalty timer is started for the originating cell. + * + */ +static int attempt_handover_after_mr(struct gsm_meas_rep *mr) +{ + struct gsm_lchan *lchan = mr->lchan; + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev = -EINVAL, av_rxqual = -EINVAL; + int rc; + + /* we currently only do handover for TCH channels */ + switch (mr->lchan->type) { + case GSM_LCHAN_TCH_F: + case GSM_LCHAN_TCH_H: + break; + default: + return 0; + } + + /* parse actual neighbor cell info */ + if (mr->num_cell > 0 && mr->num_cell < 7) + process_meas_neigh(mr); + + /* check for ongoing handover/assignment */ + if (!lchan->conn) { + LOGPHOLCHAN(lchan, LOGL_ERROR, "Skipping, No subscriber connection???\n"); + return 0; + } + if (lchan->conn->secondary_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Initial Assignment is still ongoing\n"); + return 0; + } + if (lchan->conn->ho_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Handover already triggered\n"); + return 0; + } + + /* get average levels. if not enought measurements yet, value is < 0 */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + ho_get_rxlev_avg_win(bts->ho)); + av_rxqual = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, + ho_get_rxqual_avg_win(bts->ho)); + if (av_rxlev < 0 && av_rxqual < 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measuements\n"); + return 0; + } + if (av_rxlev >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", + rxlev2dbm(av_rxlev)); + } + if (av_rxqual >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", + av_rxqual); + } + + /* improve levels in case of AFS, if defined */ + if (lchan->type == GSM_LCHAN_TCH_F + && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int rxlev_bias = ho_get_afs_bias_rxlev(bts->ho); + int rxqual_bias = ho_get_afs_bias_rxqual(bts->ho); + if (av_rxlev >= 0 && rxlev_bias) { + int imp = av_rxlev + rxlev_bias; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); + av_rxlev = imp; + } + if (av_rxqual >= 0 && rxqual_bias) { + int imp = av_rxqual - rxqual_bias; + if (imp < 0) + imp = 0; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); + av_rxqual = imp; + } + } + + /* Bad Quality */ + if (av_rxqual >= 0 && av_rxqual > ho_get_min_rxqual(bts->ho)) { + if (rxlev2dbm(av_rxlev) > -85) { + global_ho_reason = HO_REASON_INTERFERENCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment" + " due to interference (bad quality)\n"); + } else { + global_ho_reason = HO_REASON_BAD_QUALITY; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment due to bad quality\n"); + } + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Low Level */ + if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_min_rxlev(bts->ho)) { + global_ho_reason = HO_REASON_LOW_RXLEVEL; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Max Distance */ + if (lchan->meas_rep_count > 0 + && lchan->rqd_ta > ho_get_max_distance(bts->ho)) { + global_ho_reason = HO_REASON_MAX_DISTANCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + /* start penalty timer to prevent comming back too + * early. it must be started before selecting a better cell, + * so there is no assignment selected, due to running + * penalty timer. */ + conn_penalty_timer_add(lchan->conn, bts, ho_get_penalty_max_dist(bts->ho)); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* try handover to a better cell */ + if (av_rxlev >= 0 && (mr->nr % ho_get_pwr_interval(bts->ho)) == 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); + global_ho_reason = HO_REASON_BETTER_CELL; + rc = find_alternative_lchan(lchan, false); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + return 0; +} + +/* + * Handover/assignment check after timer timeout: + * + * Even if handover process tries to prevent a congestion, a cell might get + * congested due to new call setups or handovers to prevent loss of radio link. + * A cell is congested, if not the minimum number of free slots are available. + * The minimum number can be defined for TCH/F and TCH/H individually. + * + * Do not perform congestion check, if no minimum free slots are defined for + * a cell. + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * Only check candidates that will solve/reduce congestion. + * + * If a cell is congested, all slots are checked for all their RX levels + * (down-link) of the current and neighbor cell measurements in descending + * order of their RX levels: + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment), trigger handover or assignment. Candidates that will + * cause an assignment from AHS (AMR on TCH/H) to AFS (AMR on TCH/F) are + * omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement B, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the best candidates that fulfill requirement C (less or equally + * congested cells after handover/assignment), trigger handover or + * assignment. Candidates that will cause an assignment from AHS (AMR on + * TCH/H) to AFS (AMR on TCH/F) are omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement C, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. + */ +static int bts_resolve_congestion(struct gsm_bts *bts, int tchf_congestion, int tchh_congestion) +{ + struct gsm_lchan *lc; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + int i, j; + struct ho_candidate *clist; + unsigned int candidates; + struct ho_candidate *best_cand = NULL, *worst_cand = NULL; + struct gsm_lchan *delete_lchan = NULL; + unsigned int best_avg_db, worst_avg_db; + int avg; + int rc = 0; + int any_ho = 0; + int is_improved = 0; + + if (tchf_congestion < 0) + tchf_congestion = 0; + if (tchh_congestion < 0) + tchh_congestion = 0; + + LOGPHOBTS(bts, LOGL_INFO, "congested: %d TCH/F and %d TCH/H should be moved\n", + tchf_congestion, tchh_congestion); + + /* allocate array of all bts */ + clist = talloc_zero_array(tall_bsc_ctx, struct ho_candidate, + bts->num_trx * 8 * 2 * (1 + ARRAY_SIZE(lc->neigh_meas))); + if (!clist) + return 0; + + candidates = 0; + + /* loop through all active lchan and collect candidates */ + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx_is_usable(trx)) + continue; + + for (i = 0; i < 8; i++) { + ts = &trx->ts[i]; + if (!ts_is_usable(ts)) + continue; + + /* (Do not consider dynamic TS that are in PDCH mode) */ + switch (ts_pchan(ts)) { + case GSM_PCHAN_TCH_F: + lc = &ts->lchan[0]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_F + || lc->state != LCHAN_S_ACTIVE) + break; + /* omit if there is an ongoing ho/as */ + if (!lc->conn || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + break; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + break; + case GSM_PCHAN_TCH_H: + for (j = 0; j < 2; j++) { + lc = &ts->lchan[j]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_H + || lc->state != LCHAN_S_ACTIVE) + continue; + /* omit of there is an ongoing ho/as */ + if (!lc->conn + || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + continue; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + } + break; + default: + break; + } + } + } + + if (!candidates) { + LOGPHOBTS(bts, LOGL_DEBUG, "No neighbor cells qualify to solve congestion\n"); + goto exit; + } + LOGPHOBTS(bts, LOGL_DEBUG, "Considering %u candidates to solve congestion\n", candidates); + +#if 0 +next_b1: +#endif + /* select best candidate that fulfills requirement B, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, + "Best candidate BTS %u (RX level %d) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_b1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_b2: +#endif + /* select worst candidate that fulfills requirement B, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + best_cand = NULL; + goto next_b2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c1: +#endif + /* select best candidate that fulfills requirement C, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Best candidate BTS %d (RX level %d) " + "with less or equal congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_c1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c2: +#endif + /* select worst candidate that fulfills requirement C, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + worst_cand = NULL; + goto next_c2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +exit: + /* free array */ + talloc_free(clist); + + if (tchf_congestion <= 0 && tchh_congestion <= 0) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d solved!\n", + bts->nr); + else if (any_ho) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d reduced!\n", + bts->nr); + else + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d can't be reduced/solved!\n", bts->nr); + + return rc; +} + +static void bts_congestion_check(struct gsm_bts *bts) +{ + int min_free_tchf, min_free_tchh; + int tchf_count, tchh_count; + + global_ho_reason = HO_REASON_CONGESTION; + + /* only check BTS if TRX 0 is usable */ + if (!trx_is_usable(bts->c0)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: TRX 0 not usable\n"); + return; + } + + /* only check BTS if handover or assignment is enabled */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: Assignment and Handover both disabled\n"); + return; + } + + min_free_tchf = ho_get_tchf_min_slots(bts->ho); + min_free_tchh = ho_get_tchh_min_slots(bts->ho); + + /* only check BTS with congestion level set */ + if (!min_free_tchf && !min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: no minimum for free TCH/F nor TCH/H set\n"); + return; + } + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + LOGPHOBTS(bts, LOGL_INFO, "Congestion check: (free/want-free) TCH/F=%d/%d TCH/H=%d/%d\n", + tchf_count, min_free_tchf, tchh_count, min_free_tchh); + + /* only check BTS if congested */ + if (tchf_count >= min_free_tchf && tchh_count >= min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "Not congested\n"); + return; + } + + LOGPHOBTS(bts, LOGL_DEBUG, "Attempting to resolve congestion...\n"); + bts_resolve_congestion(bts, min_free_tchf - tchf_count, min_free_tchh - tchh_count); +} + +void hodec2_congestion_check(struct gsm_network *net) +{ + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_congestion_check(bts); +} + +static void congestion_check_cb(void *arg) +{ + struct gsm_network *net = arg; + hodec2_congestion_check(net); + reinit_congestion_timer(net); +} + +static int ho_dec_2_sig_lchan(unsigned int signal, void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data = signal_data; + + switch (signal) { + case S_LCHAN_MEAS_REP: + /* This is Handover Algorithm 2. If we're not responsible, drop it. */ + if (ho_get_algorithm(lchan_data->lchan->ts->trx->bts->ho) != 2) + return 0; + + attempt_handover_after_mr(lchan_data->mr); + break; + } + + return 0; +} + +static int ho_dec_2_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, + void *signal_data) +{ + switch (subsys) { + case SS_LCHAN: + return ho_dec_2_sig_lchan(signal, handler_data, signal_data); + default: + return 0; + } +} + + +void hodec2_init(struct gsm_network *net) +{ + osmo_signal_register_handler(SS_LCHAN, ho_dec_2_sig_cb, NULL); + ho2_initialized = true; + reinit_congestion_timer(net); +} diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..0cce1d9 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -38,6 +38,29 @@ #include #include #include +#include +#include + +#define LOGPHOLCHANTOLCHAN(lchan, new_lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->trx->arfcn, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_lchan->ts->trx->bts->nr, \ + new_lchan->ts->trx->nr, \ + new_lchan->ts->trx->arfcn, \ + new_lchan->ts->nr, \ + new_lchan->nr, \ + gsm_pchan_name(new_lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHO(struct_bsc_handover, level, fmt, args ...) \ + LOGPHOLCHANTOLCHAN(struct_bsc_handover->old_lchan, struct_bsc_handover->new_lchan, level, fmt, ## args) + struct bsc_handover { struct llist_head list; @@ -86,36 +109,56 @@ return NULL; } -/*! \brief Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, after the - * decision whether to initiate HO to a specific BTS. */ +/*! Hand over the specified logical channel to the specified new BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { + return bsc_handover_start_lchan_change(old_lchan, bts, old_lchan->type); +} + +/*! Hand over the specified logical channel to the specified new BTS and possibly change the lchan type. + * This is the main entry point for the actual handover algorithm, after the decision whether to initiate + * HO to a specific BTS. */ +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, + enum gsm_chan_t new_lchan_type) +{ + struct gsm_network *network; struct gsm_lchan *new_lchan; struct bsc_handover *ho; static uint8_t ho_ref = 0; int rc; + bool do_assignment = false; /* don't attempt multiple handovers for the same lchan at * the same time */ if (bsc_ho_by_old_lchan(old_lchan)) return -EBUSY; - DEBUGP(DHO, "Beginning with handover operation" - "(old_lchan on BTS %u, new BTS %u) ...\n", - old_lchan->ts->trx->bts->nr, bts->nr); + if (!new_bts) + new_bts = old_lchan->ts->trx->bts; + do_assignment = (new_bts == old_lchan->ts->trx->bts); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); + network = new_bts->network; + + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); return -ENOSPC; } - new_lchan = lchan_alloc(bts, old_lchan->type, 0); + DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Beginning with handover operation...\n", + old_lchan->ts->trx->bts->nr, + old_lchan->ts->trx->nr, + old_lchan->ts->nr, + old_lchan->nr, + gsm_pchan_name(old_lchan->ts->pchan), + new_bts->nr, + gsm_lchant_name(new_lchan_type)); + + new_lchan = lchan_alloc(new_bts, new_lchan_type, 0); if (!new_lchan) { - LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); + LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type)); + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); return -ENOSPC; } @@ -128,31 +171,41 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (old_lchan->ts->trx->bts != bts) { + if (!do_assignment) { ho->inter_cell = true; ho->async = true; } + LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); + /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); - new_lchan->ms_power = old_lchan->ms_power; + if (do_assignment) { + new_lchan->ms_power = old_lchan->ms_power; + new_lchan->rqd_ta = old_lchan->rqd_ta; + } else { + new_lchan->ms_power = + ms_pwr_ctl_lvl(new_bts->band, new_bts->ms_max_power); + /* FIXME: do we have a better idea of the timing advance? */ + //new_lchan->rqd_ta = old_lchan->rqd_ta; + } new_lchan->bs_power = old_lchan->bs_power; new_lchan->rsl_cmode = old_lchan->rsl_cmode; new_lchan->tch_mode = old_lchan->tch_mode; - memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, ARRAY_SIZE(new_lchan->mr_ms_lv)); - memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, ARRAY_SIZE(new_lchan->mr_bts_lv)); + memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, sizeof(new_lchan->mr_ms_lv)); + memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, sizeof(new_lchan->mr_bts_lv)); new_lchan->conn = old_lchan->conn; new_lchan->conn->ho_lchan = new_lchan; - /* FIXME: do we have a better idea of the timing advance? */ rc = rsl_chan_activate_lchan(new_lchan, ho->inter_cell ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) : RSL_ACT_INTRA_IMM_ASS, ho->ho_ref); if (rc < 0) { - LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); + LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", + do_assignment? "Assignment" : "Handover", rc); new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; talloc_free(ho); @@ -218,12 +271,16 @@ if (!ho) return -ENODEV; - DEBUGP(DHO, "handover activate ack, send HO Command\n"); + LOGPHO(ho, LOGL_INFO, "Channel Activate Ack, send %s COMMAND\n", ho->inter_cell? "HANDOVER" : "ASSIGNMENT"); /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, 0, ho->ho_ref); + if (ho->inter_cell) { + gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); + } else { + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); + } /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ @@ -241,12 +298,18 @@ static int ho_chan_activ_nack(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; + struct gsm_bts *new_bts = new_lchan->ts->trx->bts; ho = bsc_ho_by_new_lchan(new_lchan); if (!ho) { LOGP(DHO, LOGL_INFO, "ACT NACK: unable to find HO record\n"); return -ENODEV; } + + LOGPHO(ho, LOGL_ERROR, "Channel Activate Nack for %s, starting penalty timer\n", ho->inter_cell? "Handover" : "Assignment"); + + /* if channel failed, wait 10 seconds befor allowing to retry handover */ + conn_penalty_timer_add(ho->old_lchan->conn, new_bts, 10); /* FIXME configurable */ new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; @@ -269,22 +332,19 @@ return -ENODEV; } - net = new_lchan->ts->trx->bts->network; - LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN " - "%u->%u\n", bsc_subscr_name(ho->old_lchan->conn->bsub), - ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, - ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn); + LOGPHO(ho, LOGL_INFO, "%s Complete\n", ho->inter_cell ? "Handover" : "Assignment"); + net = new_lchan->ts->trx->bts->network; rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]); osmo_timer_del(&ho->T3103); /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) - LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Primary lchan changed during handover.\n"); if (new_lchan != new_lchan->conn->ho_lchan) - LOGP(DHO, LOGL_ERROR, "Handover channel changed during this handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Handover channel changed during this handover.\n"); new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; @@ -301,6 +361,8 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) { struct gsm_network *net = old_lchan->ts->trx->bts->network; + struct gsm_bts *old_bts; + struct gsm_bts *new_bts; struct bsc_handover *ho; struct gsm_lchan *new_lchan; @@ -308,6 +370,25 @@ if (!ho) { LOGP(DHO, LOGL_ERROR, "unable to find HO record\n"); return -ENODEV; + } + + old_bts = old_lchan->ts->trx->bts; + new_bts = ho->new_lchan->ts->trx->bts; + + if (old_lchan->conn->ho_failure >= ho_get_retries(old_bts->ho)) { + int penalty = ho->inter_cell + ? ho_get_penalty_failed_ho(old_bts->ho) + : ho_get_penalty_failed_as(old_bts->ho); + LOGPHO(ho, LOGL_NOTICE, "%s failed, starting penalty timer (%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + penalty); + old_lchan->conn->ho_failure = 0; + conn_penalty_timer_add(old_lchan->conn, new_bts, penalty); + } else { + old_lchan->conn->ho_failure++; + LOGPHO(ho, LOGL_NOTICE, "%s failed, trying again (%d/%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + old_lchan->conn->ho_failure, ho_get_retries(old_bts->ho)); } rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED]); @@ -320,7 +401,6 @@ handover_free(ho); lchan_release(new_lchan, 0, RSL_REL_LOCAL_END); - return 0; } @@ -336,7 +416,7 @@ return -ENODEV; } - LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + LOGPHO(ho, LOGL_DEBUG, "Handover RACH detected\n"); /* This is just for logging on the DHO category. The actual MGCP switchover happens in * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c index 225e9a9..5d66e4c 100644 --- a/src/libbsc/handover_vty.c +++ b/src/libbsc/handover_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) { @@ -70,7 +71,42 @@ #undef HO_CFG_ONE_MEMBER -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} + +DEFUN(cfg_net_ho_congestion_check_interval, cfg_net_ho_congestion_check_interval_cmd, + "handover congestion-check (disabled|<1-999>|now)", + HO_CFG_STR_HANDOVER + "Configure congestion check interval" HO_CFG_STR_2 + "Disable congestion checking, do not handover based on cell overload\n" + "Congestion check interval in seconds (default " + OSMO_STRINGIFY_VAL(HO_CFG_CONGESTION_CHECK_DEFAULT) ")\n" + "Manually trigger a congestion check to run right now\n") +{ + if (!strcmp(argv[0], "now")) { + hodec2_congestion_check(gsmnet_from_vty(vty)); + return CMD_SUCCESS; + } + + hodec2_on_change_congestion_check_interval(gsmnet_from_vty(vty), + a2congestion_check_interval(argv[0])); + return CMD_SUCCESS; +} + +static void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) { #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ @@ -82,6 +118,21 @@ HO_CFG_ALL_MEMBERS #undef HO_CFG_ONE_MEMBER +} + +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + ho_vty_write(vty, " ", bts->ho); +} + +void ho_vty_write_net(struct vty *vty, struct gsm_network *net) +{ + ho_vty_write(vty, " ", net->ho); + + if (net->ho2.congestion_check_interval_s != HO_CFG_CONGESTION_CHECK_DEFAULT) + vty_out(vty, " handover congestion-check %s%s", + congestion_check_interval2a(net->ho2.congestion_check_interval_s), + VTY_NEWLINE); } static void ho_vty_init_cmds(int parent_node) @@ -96,6 +147,8 @@ void ho_vty_init() { ho_vty_init_cmds(GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_ho_congestion_check_interval_cmd); + ho_vty_init_cmds(BTS_NODE); } diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 57d8241..4368598 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -57,6 +57,7 @@ net->T3141 = GSM_T3141_DEFAULT; net->ho = ho_cfg_init(net, NULL); + net->ho2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 92ebbfe..17858f6 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -25,9 +25,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -38,6 +40,7 @@ #include #include #include +#include void *tall_bsc_ctx; @@ -266,6 +269,8 @@ INIT_LLIST_HEAD(&bts->loc_list); + osmo_signal_dispatch(SS_L_GLOBAL, S_GLOBAL_BTS_NEW, bts); + return bts; } @@ -416,3 +421,73 @@ rev_lev = (cm->classmark2[0] >> 5) & 0x3; return rev_lev >= 2; } + +static unsigned int time_now(void) +{ + time_t now; + time(&now); + return (unsigned int)now; +} + +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout) +{ + struct ho_penalty_timer *timer; + unsigned int now; + unsigned int then; + now = time_now(); + + /* no not add timer, if there is no timeout set */ + if (!timeout) + return; + + then = now + timeout; + + /* timer already running for that BTS? */ + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + /* raise, if running timer will timeout earlier or has timed + * out already, otherwise keep later timeout */ + if (timer->timeout < then) + timer->timeout = then; + return; + } + + /* add new timer */ + timer = talloc_zero(tall_bsc_ctx, struct ho_penalty_timer); + if (!timer) + return; + + timer->bts_nr = bts->nr; + timer->timeout = then; + + llist_add_tail(&timer->entry, &conn->ho_penalty_timers); +} + +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer; + unsigned int now = time_now(); + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + if (now > timer->timeout) + continue; + return timer->timeout - now; + } + return 0; +} + +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer, *timer2; + llist_for_each_entry_safe(timer, timer2, &conn->ho_penalty_timers, entry) { + if (bts && timer->bts_nr != bts->nr) + continue; + llist_del(&timer->entry); + talloc_free(timer); + } +} diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c index 8c208f6..204e5a2 100644 --- a/src/libcommon/handover_cfg.c +++ b/src/libcommon/handover_cfg.c @@ -23,7 +23,10 @@ #include #include +#include + #include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..ab796b2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -741,7 +741,6 @@ bool aoip = false; struct sockaddr_storage rtp_addr; struct gsm0808_channel_type ct; - struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; const uint8_t *data; @@ -787,6 +786,7 @@ } /* Decode speech codec list (AoIP) */ + conn->conn->codec_list_present = false; if (aoip) { /* Check for speech codec list element */ if (!TLVP_PRESENT(&tp, GSM0808_IE_SPEECH_CODEC_LIST)) { @@ -798,13 +798,14 @@ /* Decode Speech Codec list */ data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&conn->conn->codec_list, data, len); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); goto reject; } - scl_ptr = &scl; + conn->conn->codec_list_present = true; + scl_ptr = &conn->conn->codec_list; } /* Decode Channel Type element */ diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1aff4c5..bac3a5e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -298,6 +299,7 @@ mgcp_init(bsc_gsmnet); handover_decision_1_init(); + hodec2_init(bsc_gsmnet); signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); diff --git a/tests/Makefile.am b/tests/Makefile.am index ba8a5e1..652dfe1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ bsc-nat \ bsc-nat-trie \ bssap \ + handover \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am new file mode 100644 index 0000000..69fda8a --- /dev/null +++ b/tests/handover/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + handover_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + handover_test \ + $(NULL) + +handover_test_SOURCES = \ + handover_test.c \ + $(NULL) + +handover_test_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(NULL) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c new file mode 100644 index 0000000..039a52f --- /dev/null +++ b/tests/handover/handover_test.c @@ -0,0 +1,1583 @@ +/* + * (C) 2013 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct gsm_network *bsc_gsmnet; + +/* measurement report */ + +uint8_t meas_rep_ba = 0, meas_rep_valid = 1, meas_valid = 1, meas_multi_rep = 0; +uint8_t meas_dl_rxlev = 0, meas_dl_rxqual = 0; +uint8_t meas_ul_rxlev = 0, meas_ul_rxqual = 0; +uint8_t meas_tx_power_ms = 0, meas_tx_power_bs = 0, meas_ta_ms = 0; +uint8_t meas_dtx_ms = 0, meas_dtx_bs = 0, meas_nr = 0; +uint8_t meas_num_nc = 0, meas_rxlev_nc[6], meas_bsic_nc[6], meas_bcch_f_nc[6]; + +static void gen_meas_rep(struct gsm_lchan *lchan) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t ulm[3], l1i[2], *buf; + struct gsm48_hdr *gh; + struct gsm48_meas_res *mr; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = RSL_MT_MEAS_RES; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = chan_nr; + + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, meas_nr++); + + ulm[0] = meas_ul_rxlev | (meas_dtx_bs << 7); + ulm[1] = meas_ul_rxlev; + ulm[2] = (meas_ul_rxqual << 3) | meas_ul_rxqual; + msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, sizeof(ulm), ulm); + + msgb_tv_put(msg, RSL_IE_BS_POWER, meas_tx_power_bs); + + l1i[0] = 0; + l1i[1] = meas_ta_ms; + msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, sizeof(l1i), l1i); + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*mr)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*mr)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + mr = (struct gsm48_meas_res *) msgb_put(msg, sizeof(*mr)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = GSM48_MT_RR_MEAS_REP; + + /* measurement results */ + mr->rxlev_full = meas_dl_rxlev; + mr->rxlev_sub = meas_dl_rxlev; + mr->rxqual_full = meas_dl_rxqual; + mr->rxqual_sub = meas_dl_rxqual; + mr->dtx_used = meas_dtx_ms; + mr->ba_used = meas_rep_ba; + mr->meas_valid = !meas_valid; /* 0 = valid */ + if (meas_rep_valid) { + mr->no_nc_n_hi = meas_num_nc >> 2; + mr->no_nc_n_lo = meas_num_nc & 3; + } else { + /* no results for serving cells */ + mr->no_nc_n_hi = 1; + mr->no_nc_n_lo = 3; + } + mr->rxlev_nc1 = meas_rxlev_nc[0]; + mr->rxlev_nc2_hi = meas_rxlev_nc[1] >> 1; + mr->rxlev_nc2_lo = meas_rxlev_nc[1] & 1; + mr->rxlev_nc3_hi = meas_rxlev_nc[2] >> 2; + mr->rxlev_nc3_lo = meas_rxlev_nc[2] & 3; + mr->rxlev_nc4_hi = meas_rxlev_nc[3] >> 3; + mr->rxlev_nc4_lo = meas_rxlev_nc[3] & 7; + mr->rxlev_nc5_hi = meas_rxlev_nc[4] >> 4; + mr->rxlev_nc5_lo = meas_rxlev_nc[4] & 15; + mr->rxlev_nc6_hi = meas_rxlev_nc[5] >> 5; + mr->rxlev_nc6_lo = meas_rxlev_nc[5] & 31; + mr->bsic_nc1_hi = meas_bsic_nc[0] >> 3; + mr->bsic_nc1_lo = meas_bsic_nc[0] & 7; + mr->bsic_nc2_hi = meas_bsic_nc[1] >> 4; + mr->bsic_nc2_lo = meas_bsic_nc[1] & 15; + mr->bsic_nc3_hi = meas_bsic_nc[2] >> 5; + mr->bsic_nc3_lo = meas_bsic_nc[2] & 31; + mr->bsic_nc4 = meas_bsic_nc[3]; + mr->bsic_nc5 = meas_bsic_nc[4]; + mr->bsic_nc6 = meas_bsic_nc[5]; + mr->bcch_f_nc1 = meas_bcch_f_nc[0]; + mr->bcch_f_nc2 = meas_bcch_f_nc[1]; + mr->bcch_f_nc3 = meas_bcch_f_nc[2]; + mr->bcch_f_nc4 = meas_bcch_f_nc[3]; + mr->bcch_f_nc5_hi = meas_bcch_f_nc[4] >> 1; + mr->bcch_f_nc5_lo = meas_bcch_f_nc[4] & 1; + mr->bcch_f_nc6_hi = meas_bcch_f_nc[5] >> 2; + mr->bcch_f_nc6_lo = meas_bcch_f_nc[5] & 3; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +static struct gsm_bts *create_bts(int arfcn) +{ + struct gsm_bts *bts; + struct e1inp_sign_link *rsl_link; + int i; + + bts = gsm_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_OSMOBTS, 0x3f); + if (!bts) { + printf("No resource for bts1\n"); + return NULL; + } + + bts->location_area_code = 23; + bts->c0->arfcn = arfcn; + + bts->codec.efr = 1; + bts->codec.hr = 1; + bts->codec.amr = 1; + + rsl_link = talloc_zero(0, struct e1inp_sign_link); + rsl_link->trx = bts->c0; + bts->c0->rsl_link = rsl_link; + + bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK; + + /* 4 full rate and 4 half rate channels */ + for (i = 1; i <= 6; i++) { + bts->c0->ts[i].pchan = + (i < 5) ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H; + bts->c0->ts[i].mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->ts[i].mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->ts[i].lchan[0].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[0].state = LCHAN_S_NONE; + bts->c0->ts[i].lchan[1].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[1].state = LCHAN_S_NONE; + } + return bts; +} + +void create_conn(struct gsm_lchan *lchan) +{ + lchan->conn = bsc_subscr_con_allocate(lchan); +} + +/* create lchan */ +struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, char *codec) +{ + struct gsm_lchan *lchan; + + lchan = lchan_alloc(bts, + (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, 0); + if (!lchan) { + printf("No resource for lchan\n"); + exit(EXIT_FAILURE); + } + lchan->state = LCHAN_S_ACTIVE; + create_conn(lchan); + if (!strcasecmp(codec, "FR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "HR") && !full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "EFR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_EFR; + else if (!strcasecmp(codec, "AMR")) + lchan->tch_mode = GSM48_CMODE_SPEECH_AMR; + else { + printf("Given codec unknown\n"); + exit(EXIT_FAILURE); + } + + lchan->conn->codec_list = (struct gsm0808_speech_codec_list){ + .codec = { + { .fi=true, .type=GSM0808_SCT_FR1, }, + { .fi=true, .type=GSM0808_SCT_FR2, }, + { .fi=true, .type=GSM0808_SCT_FR3, }, + { .fi=true, .type=GSM0808_SCT_HR1, }, + { .fi=true, .type=GSM0808_SCT_HR3, }, + }, + .len = 5, + }; + lchan->conn->codec_list_present = true; + + return lchan; +} + +/* parse channel request */ + +static int got_chan_req = 0; +static struct gsm_lchan *chan_req_lchan = NULL; + +static int parse_chan_act(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +static int parse_chan_rel(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +/* parse handover request */ + +static int got_ho_req = 0; +static struct gsm_lchan *ho_req_lchan = NULL; + +static int parse_ho_command(struct gsm_lchan *lchan, uint8_t *data, int len) +{ + struct gsm48_hdr *gh = (struct gsm48_hdr *) data; + struct gsm48_ho_cmd *ho = (struct gsm48_ho_cmd *) gh->data; + int arfcn; + struct gsm_bts *neigh; + + switch (gh->msg_type) { + case GSM48_MT_RR_HANDO_CMD: + arfcn = (ho->cell_desc.arfcn_hi << 8) | ho->cell_desc.arfcn_lo; + + /* look up trx. since every dummy bts uses different arfcn and + * only one trx, it is simple */ + llist_for_each_entry(neigh, &bsc_gsmnet->bts_list, list) { + if (neigh->c0->arfcn != arfcn) + continue; + ho_req_lchan = lchan; + return 0; + } + break; + case GSM48_MT_RR_ASS_CMD: + ho_req_lchan = lchan; + return 0; + break; + default: + fprintf(stderr, "Error, expecting HO or AS command\n"); + return -EINVAL; + } + + return -1; +} + +/* send channel activation ack */ +static void send_chan_act_ack(struct gsm_lchan *lchan, int act) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = (act) ? RSL_MT_CHAN_ACTIV_ACK : RSL_MT_RF_CHAN_REL_ACK; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = gsm_lchan2chan_nr(lchan); + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + + abis_rsl_rcvmsg(msg); +} + +/* send handover complete */ +static void send_ho_complete(struct gsm_lchan *lchan, bool success) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_rll_hdr *rh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t *buf; + struct gsm48_hdr *gh; + struct gsm48_ho_cpl *hc; + + rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); + rh->c.msg_discr = ABIS_RSL_MDISC_RLL; + rh->c.msg_type = RSL_MT_DATA_IND; + rh->ie_chan = RSL_IE_CHAN_NR; + rh->chan_nr = chan_nr; + rh->ie_link_id = RSL_IE_LINK_IDENT; + rh->link_id = 0x00; + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*hc)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*hc)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + hc = (struct gsm48_ho_cpl *) msgb_put(msg, sizeof(*hc)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = + success ? GSM48_MT_RR_HANDO_COMPL : GSM48_MT_RR_HANDO_FAIL; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)rh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +/* RSL messages from BSC */ +int abis_rsl_sendmsg(struct msgb *msg) +{ + struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *) msg->data; + struct e1inp_sign_link *sign_link = msg->dst; + int rc; + struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr, &rc); + + if (rc) { + printf("rsl_lchan_lookup() failed\n"); + exit(1); + } + + switch (dh->c.msg_type) { + case RSL_MT_CHAN_ACTIV: + rc = parse_chan_act(lchan, dh->data); + if (rc == 0) + got_chan_req = 1; + break; + case RSL_MT_RF_CHAN_REL: + rc = parse_chan_rel(lchan, dh->data); + if (rc == 0) + send_chan_act_ack(chan_req_lchan, 0); + break; + case RSL_MT_DATA_REQ: + rc = parse_ho_command(lchan, msg->l3h, msgb_l3len(msg)); + if (rc == 0) + got_ho_req = 1; + break; + case RSL_MT_IPAC_CRCX: + break; + default: + printf("unknown rsl message=0x%x\n", dh->c.msg_type); + } + return 0; +} + +/* test cases */ + +static char *test_case_0[] = { + "2", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_1[] = { + "2", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_2[] = { + "2", + + "Handover and Assignment must be enabled\n\n" + "This test will start with disabled assignment and handover. A\n" + "better neighbor cell (assignment enabled) will not be selected and \n" + "also no assignment from TCH/H to TCH/F to improve quality. There\n" + "will be no handover nor assignment. After enabling assignment on the\n" + "current cell, the MS will assign to TCH/F. After enabling handover\n" + "in the current cell, but disabling in the neighbor cell, handover\n" + "will not be performed, until it is enabled in the neighbor cell too.\n", + + "create-bts", "2", + "afs-rxlev-improve", "0", "5", + "create-ms", "0", "TCH/H", "AMR", + "as-enable", "0", "0", + "ho-enable", "0", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "as-enable", "0", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "ho-enable", "0", "1", + "ho-enable", "1", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "ho-enable", "1", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_3[] = { + "2", + + "Penalty timer must not run\n\n" + "The MS will try to handover to a better cell, but this will fail.\n" + "Even though the cell is still better, handover will not be performed\n" + "due to penalty timer after handover failure\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-failed", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_4[] = { + "2", + + "TCH/H keeping with HR codec\n\n" + "The MS is using half rate V1 codec, but the better cell is congested\n" + "at TCH/H slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/H", "HR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + NULL +}; + +static char *test_case_5[] = { + "2", + + "TCH/F keeping with FR codec\n\n" + "The MS is using full rate V1 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_6[] = { + "2", + + "TCH/F keeping with EFR codec\n\n" + "The MS is using full rate V2 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "EFR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_7[] = { + "2", + + "TCH/F to TCH/H changing with AMR codec\n\n" + "The MS is using AMR V3 codec, the better cell is congested at TCH/F\n" + "slots. The handover is performed to non-congested TCH/H slots.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_8[] = { + "2", + + "No handover to a cell with no slots available\n\n" + "If no slot is available, no handover is performed\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_9[] = { + "2", + + "No more parallel handovers, if max_unsync_ho is defined\n\n" + "There are tree mobiles that want to handover, but only two can do\n" + "it at a time, because the maximum number is limited to two.\n", + + "create-bts", "2", + "set-max-ho", "1", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "meas-rep", "1", "0","0", "1","0","30", + "expect-chan", "1", "2", + "meas-rep", "2", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_10[] = { + "2", + + "Hysteresis\n\n" + "If neighbor cell is better, handover is only performed if the\n" + "ammount of improvement is greater or equal hyteresis\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "27","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "26","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_11[] = { + "2", + + "No Hysteresis and minimum RX level\n\n" + "If current cell's RX level is below mimium level, handover must be\n" + "performed, no matter of the hysteresis. First do not perform\n" + "handover to better neighbor cell, because the hysteresis is not\n" + "met. Second do not perform handover because better neighbor cell is\n" + "below minimum RX level. Third perform handover because current cell\n" + "is below minimum RX level, even if the better neighbor cell (minimum\n" + "RX level reached) does not meet the hysteresis.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", "1","0","11", + "expect-no-chan", + "meas-rep", "0", "8","0", "1","0","9", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","10", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_12[] = { + "2", + + "No handover to congested cell\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "After the congestion is over, handover will be performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_13[] = { + "2", + + "Handover to balance congestion\n\n" + "The current and the better cell are congested, so no handover is\n" + "performed. This is because handover would congest the neighbor cell\n" + "more. After congestion raises in the current cell, the handover is\n" + "performed to balance congestion\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_14[] = { + "2", + + "Handover to congested cell, if RX level is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX level of the current cell drops below minimum acceptable\n" + "level, the handover is performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "10","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_15[] = { + "2", + + "Handover to cell with worse RXLEV, if RXQUAL is below minimum\n\n" + "The neighbor cell has worse RXLEV, so no handover is performed.\n" + "If the RXQUAL of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "reports are received, before RXQUAL is checked.\n", + /* (See also test 28, which tests for RXQUAL triggering HO to congested cell.) */ + /* TODO: bad RXQUAL may want to prefer assignment within the same cell to avoid interference. + * See Performence Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter + * 2.1.1, "Interference" in the list of triggers on p.157. */ + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_16[] = { + "2", + + "Handover due to maximum TA exceeded\n\n" + "The MS in the current (best) cell has reached maximum allowed timing\n" + "advance. No handover is performed until the timing advance exceeds\n" + "it. The originating cell is still the best, but no handover is\n" + "performed back to that cell, because the penalty timer (due to\n" + "maximum allowed timing advance) is running.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-max-ta", "0", "5", /* of cell */ + "set-ta", "0", "5", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "set-ta", "0", "6", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_17[] = { + "2", + + "Congestion check: No congestion\n\n" + "Three cells have different number of used slots, but there is no\n" + "congestion in any of these cells. No handover is performed.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_18[] = { + "2", + + "Congestion check: One out of three cells is congested\n\n" + "Three cells have different number of used slots, but there is\n" + "congestion at TCH/F in the first cell. Handover is performed with\n" + "the best candidate.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","21","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "6", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "3", /* best candidate is MS 2 at BTS 1, TS 3 */ + "ho-complete", + NULL +}; + +static char *test_case_19[] = { + "2", + + "Congestion check: Balancing over congested cells\n\n" + "Two cells are congested, but the second cell is more congested.\n" + "Handover is performed to solve the congestion.\n", + + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "1", "TCH/F", "FR", + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "1","0","21", + "expect-no-chan", + "meas-rep", "2", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "2", /* best candidate is MS 1 at BTS 0, TS 2 */ + "ho-complete", + NULL +}; + +static char *test_case_20[] = { + "2", + + "Congestion check: Solving congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "non-congested TCH/H of second BTS, in order to solve congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_21[] = { + "2", + + "Congestion check: Balancing congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "less-congested TCH/H of second BTS, in order to balance congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_22[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + NULL +}; + +static char *test_case_23[] = { + "2", + + "Story: 'A neighbor is your friend'\n", + + "create-bts", "3", + + "print", + "Andreas is driving along the coast, on a sunny june afternoon.\n" + "Suddenly he is getting a call from his friend and neighbor Axel.\n" + "\n" + "What happens: Two MS are created, #0 for Axel, #1 for Andreas.", + /* Axel */ + "create-ms", "2", "TCH/F", "AMR", + /* andreas */ + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "1", "40","0", "1","0","30", + "expect-no-chan", + + "print", + "Axel asks Andreas if he would like to join them for a barbecue.\n" + "Axel's house is right in the neighborhood and the weather is fine.\n" + "Andreas agrees, so he drives to a close store to buy some barbecue\n" + "skewers.\n" + "\n" + "What happens: While driving, a different cell (mounted atop the\n" + "store) becomes better.", + /* drive to bts 1 */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + "While Andreas is walking into the store, Axel asks, if he could also\n" + "bring some beer. Andreas has problems understanding him: \"I have a\n" + "bad reception here. The cell tower is right atop the store, but poor\n" + "coverage inside. Can you repeat please?\"\n" + "\n" + "What happens: Inside the store the close cell is so bad, that\n" + "handover back to the previous cell is required.", + /* bts 1 becomes bad, so bts 0 helps out */ + "meas-rep", "1", "5","0", "1","0","20", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "After Andreas bought skewers and beer, he leaves the store.\n" + "\n" + "What happens: Outside the store the close cell is better again, so\n" + "handover back to the that cell is performed.", + /* bts 1 becomes better again */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + /* bts 2 becomes better */ + "Andreas drives down to the lake where Axel's house is.\n" + "\n" + "What happens: There is a small cell at Axel's house, which becomes\n" + "better, because the current cell has no good comverage at the lake.", + "meas-rep", "1", "14","0", "2","0","2","1","63", + "expect-chan", "2", "2", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "Andreas wonders why he still has good radio coverage: \"Last time it\n" + "was so bad\". Axel says: \"I installed a pico cell in my house,\n" + "now we can use our mobile phones down here at the lake.\"", + + NULL +}; + +static char *test_case_24[] = { + "2", + "No (or not enough) measurements for handover\n\n" + "Do not solve congestion in cell, because there is no measurement.\n" + "As soon as enough measurments available (1 in our case), perform\n" + "handover. Afterwards the old cell becomes congested and the new\n" + "cell is not. Do not perform handover until new measurements are\n" + "received.\n", + + /* two cells, first in congested, but no handover */ + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "congestion-check", + "expect-no-chan", + + /* send measurement and trigger congestion check */ + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + /* congest the first cell and remove congestion from second cell */ + "set-min-free", "0", "TCH/F", "0", + "set-min-free", "0", "TCH/H", "0", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + + /* no handover until measurements applied */ + "congestion-check", + "expect-no-chan", + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + NULL +}; + +static char *test_case_25[] = { + "1", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_26[] = { + "1", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_27[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen. (So far like test 22.)\n" + "After that, trigger more congestion checks to ensure stability.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + "congestion-check", + "expect-chan", "0", "2", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "congestion-check", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_28[] = { + "2", + + "Handover to congested cell, if RX quality is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX quality of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "resports are received, before RX quality is checked.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char **test_cases[] = { + test_case_0, + test_case_1, + test_case_2, + test_case_3, + test_case_4, + test_case_5, + test_case_6, + test_case_7, + test_case_8, + test_case_9, + test_case_10, + test_case_11, + test_case_12, + test_case_13, + test_case_14, + test_case_15, + test_case_16, + test_case_17, + test_case_18, + test_case_19, + test_case_20, + test_case_21, + test_case_22, + test_case_23, + test_case_24, + test_case_25, + test_case_26, + test_case_27, + test_case_28, + NULL +}; + +int main(int argc, char **argv) +{ + char **test_case; + struct gsm_bts *bts[256]; + int bts_num = 0; + struct gsm_lchan *lchan[256]; + int lchan_num = 0; + int test_count = 0; + int i; + int algorithm; + struct bsc_api bsc_api = {}; + + for (i = 0; test_cases[i]; i++) + test_count++; + + if (argc <= 1 || atoi(argv[1]) >= test_count) { + for (i = 0; test_cases[i]; i++) { + printf("Test #%d (algorithm %s):\n%s\n", i, + test_cases[i][0], test_cases[i][1]); + } + printf("\nPlease specify test case number 0..%d\n", + test_count - 1); + return EXIT_FAILURE; + } + + osmo_init_logging(&log_info); + + log_set_print_category(osmo_stderr_target, 1); + + log_set_category_filter(osmo_stderr_target, DHO, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DHODEC, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DMEAS, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DREF, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DRSL, 1, LOGL_DEBUG); + + /* Create a dummy network */ + bsc_gsmnet = bsc_network_init(NULL, 1, 1); + if (!bsc_gsmnet) + exit(1); + + bsc_api_init(bsc_gsmnet, &bsc_api); + + ho_set_algorithm(bsc_gsmnet->ho, 2); + ho_set_ho_active(bsc_gsmnet->ho, true); + ho_set_as_active(bsc_gsmnet->ho, true); + ho_set_min_rxlev(bsc_gsmnet->ho, -100); + ho_set_rxlev_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxlev_neigh_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxqual_avg_win(bsc_gsmnet->ho, 10); + ho_set_pwr_hysteresis(bsc_gsmnet->ho, 3); + ho_set_pwr_interval(bsc_gsmnet->ho, 1); + ho_set_afs_bias_rxlev(bsc_gsmnet->ho, 0); + ho_set_min_rxqual(bsc_gsmnet->ho, 5); + ho_set_afs_bias_rxqual(bsc_gsmnet->ho, 0); + ho_set_max_distance(bsc_gsmnet->ho, 9999); + ho_set_ho_max(bsc_gsmnet->ho, 9999); + ho_set_penalty_max_dist(bsc_gsmnet->ho, 300); + ho_set_penalty_failed_ho(bsc_gsmnet->ho, 60); + ho_set_penalty_failed_as(bsc_gsmnet->ho, 60); + + bts_model_sysmobts_init(); + + test_case = test_cases[atoi(argv[1])]; + + fprintf(stderr, "--------------------\n"); + fprintf(stderr, "Performing the following test %d (algorithm %s):\n%s", + atoi(argv[1]), test_case[0], test_case[1]); + algorithm = atoi(test_case[0]); + test_case += 2; + fprintf(stderr, "--------------------\n"); + + /* Disable the congestion check timer, we will trigger manually. */ + bsc_gsmnet->ho2.congestion_check_interval_s = 0; + + handover_decision_1_init(); + hodec2_init(bsc_gsmnet); + + while (*test_case) { + if (!strcmp(*test_case, "create-bts")) { + static int arfcn = 870; + int n = atoi(test_case[1]); + fprintf(stderr, "- Creating %d BTS (one TRX each, " + "TS(1-4) are TCH/F, TS(5-6) are TCH/H)\n", n); + for (i = 0; i < n; i++) + bts[bts_num + i] = create_bts(arfcn++); + for (i = 0; i < n; i++) + gsm_generate_si(bts[bts_num + i], + SYSINFO_TYPE_2); + bts_num += n; + test_case += 2; + } else + if (!strcmp(*test_case, "as-enable")) { + fprintf(stderr, "- Set assignment enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_as_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "ho-enable")) { + fprintf(stderr, "- Set handover enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_ho_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxlev-improve")) { + fprintf(stderr, "- Set afs RX level improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxlev(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxqual-improve")) { + fprintf(stderr, "- Set afs RX quality improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxqual(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-min-free")) { + fprintf(stderr, "- Setting minimum required free %s " + "slots at BTS %s to %s\n", test_case[2], + test_case[1], test_case[3]); + if (!strcmp(test_case[2], "TCH/F")) + ho_set_tchf_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + else + ho_set_tchh_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + test_case += 4; + } else + if (!strcmp(*test_case, "set-max-ho")) { + fprintf(stderr, "- Setting maximum parallel handovers " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_ho_max( bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-max-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_max_distance(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "create-ms")) { + fprintf(stderr, "- Creating mobile #%d at BTS %s on " + "%s with %s codec\n", lchan_num, test_case[1], + test_case[2], test_case[3]); + lchan[lchan_num] = create_lchan(bts[atoi(test_case[1])], + !strcmp(test_case[2], "TCH/F"), test_case[3]); + if (!lchan[lchan_num]) { + printf("Failed to create lchan!\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * New MS is at BTS %d TS %d\n", + lchan[lchan_num]->ts->trx->bts->nr, + lchan[lchan_num]->ts->nr); + lchan_num++; + test_case += 4; + } else + if (!strcmp(*test_case, "set-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at MS %s to %s\n", test_case[1], + test_case[2]); + meas_ta_ms = atoi(test_case[2]); + test_case += 3; + } else + if (!strcmp(*test_case, "meas-rep")) { + /* meas-rep [ [...]] */ + int n = atoi(test_case[4]); + struct gsm_lchan *lc = lchan[atoi(test_case[1])]; + fprintf(stderr, "- Sending measurement report from " + "mobile #%s (rxlev=%s, rxqual=%s)\n", + test_case[1], test_case[2], test_case[3]); + meas_dl_rxlev = atoi(test_case[2]); + meas_dl_rxqual = atoi(test_case[3]); + meas_num_nc = n; + test_case += 5; + for (i = 0; i < n; i++) { + int nr = atoi(test_case[0]); + /* since our bts is not in the list of neighbor + * cells, we need to shift */ + if (nr >= lc->ts->trx->bts->nr) + nr++; + fprintf(stderr, " * Neighbor cell #%s, actual " + "BTS %d (rxlev=%s)\n", test_case[0], nr, + test_case[1]); + meas_bcch_f_nc[i] = atoi(test_case[0]); + /* bts number, not counting our own */ + meas_rxlev_nc[i] = atoi(test_case[1]); + meas_bsic_nc[i] = 0x3f; + test_case += 2; + } + got_chan_req = 0; + gen_meas_rep(lc); + } else + if (!strcmp(*test_case, "congestion-check")) { + fprintf(stderr, "- Triggering congestion check\n"); + got_chan_req = 0; + if (algorithm == 2) + hodec2_congestion_check(bsc_gsmnet); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-chan")) { + fprintf(stderr, "- Expecting channel request at BTS %s " + "TS %s\n", test_case[1], test_case[2]); + if (!got_chan_req) { + printf("Test failed, because no channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got channel request at BTS %d " + "TS %d\n", chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + if (chan_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because channel was not " + "requested on expected BTS\n"); + return EXIT_FAILURE; + } + if (chan_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because channel was not " + "requested on expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "expect-no-chan")) { + fprintf(stderr, "- Expecting no channel request\n"); + if (got_chan_req) { + fprintf(stderr, " * Got channel request at " + "BTS %d TS %d\n", + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + printf("Test failed, because channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got no channel request\n"); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-ho")) { + fprintf(stderr, "- Expecting handover/assignment " + "request at BTS %s TS %s\n", test_case[1], + test_case[2]); + if (!got_ho_req) { + printf("Test failed, because no handover was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got handover/assignment request at " + "BTS %d TS %d\n", + ho_req_lchan->ts->trx->bts->nr, + ho_req_lchan->ts->nr); + if (ho_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected BTS\n"); + return EXIT_FAILURE; + } + if (ho_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "ack-chan")) { + fprintf(stderr, "- Acknowledging channel request\n"); + if (!got_chan_req) { + printf("Cannot ack channel, because no " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_ho_req = 0; + send_chan_act_ack(chan_req_lchan, 1); + } else + if (!strcmp(*test_case, "ho-complete")) { + fprintf(stderr, "- Acknowledging handover/assignment " + "request\n"); + if (!got_chan_req) { + printf("Cannot ack handover/assignment, " + "because no chan request\n"); + return EXIT_FAILURE; + } + if (!got_ho_req) { + printf("Cannot ack handover/assignment, " + "because no ho request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + /* switch lchan */ + for (i = 0; i < lchan_num; i++) { + if (lchan[i] == ho_req_lchan) { + fprintf(stderr, " * MS %d changes from " + "BTS=%d TS=%d to BTS=%d " + "TS=%d\n", i, + lchan[i]->ts->trx->bts->nr, + lchan[i]->ts->nr, + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + lchan[i] = chan_req_lchan; + } + } + send_ho_complete(chan_req_lchan, true); + } else + if (!strcmp(*test_case, "ho-failed")) { + fprintf(stderr, "- Making handover fail\n"); + if (!got_chan_req) { + printf("Cannot fail handover, because no chan " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + send_ho_complete(ho_req_lchan, false); + } else + if (!strcmp(*test_case, "print")) { + fprintf(stderr, "\n%s\n\n", test_case[1]); + test_case += 2; + } else { + printf("Unknown test command '%s', please fix!\n", + *test_case); + return EXIT_FAILURE; + } + } + + for (i = 0; i < lchan_num; i++) { + struct gsm_subscriber_connection *conn = lchan[i]->conn; + lchan[i]->conn = NULL; + conn->lchan = NULL; + bsc_subscr_con_free(conn); + lchan_free(lchan[i]); + } + + fprintf(stderr, "--------------------\n"); + + printf("Test OK\n"); + + fprintf(stderr, "--------------------\n"); + + return EXIT_SUCCESS; +} + +void rtp_socket_free() {} +void rtp_send_frame() {} +void rtp_socket_upstream() {} +void rtp_socket_create() {} +void rtp_socket_connect() {} +void rtp_socket_proxy() {} +void trau_mux_unmap() {} +void trau_mux_map_lchan() {} +void trau_recv_lchan() {} +void trau_send_frame() {} diff --git a/tests/handover/handover_test.ok b/tests/handover/handover_test.ok new file mode 100644 index 0000000..678f9a3 --- /dev/null +++ b/tests/handover/handover_test.ok @@ -0,0 +1 @@ +Test OK diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index 5d5db05..4f13686 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -172,7 +172,6 @@ handover power budget hysteresis (<0-999>|default) handover maximum distance (<0-9999>|default) handover assignment (0|1|default) - handover congestion-check (disabled|<1-60>|default) handover tdma-measurement (full|subset|default) handover min rxlev (<-110--50>|default) handover min rxqual (<0-7>|default) @@ -185,6 +184,7 @@ handover penalty-time failed-ho (<0-99999>|default) handover penalty-time failed-assignment (<0-99999>|default) handover retries (<0-9>|default) + handover congestion-check (disabled|<1-999>|now) ... OsmoBSC(config-net)# handover? @@ -199,7 +199,6 @@ power Neighbor cell power triggering maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO assignment Enable or disable in-call channel re-assignment (HO algo 2 only) - congestion-check Configure congestion check interval (HO algo 2 only) tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) @@ -207,6 +206,7 @@ max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) retries Immediately retry on handover/assignment failure (HO algo 2 only) + congestion-check Configure congestion check interval (HO algo 2 only) OsmoBSC(config-net)# handover algorithm ? 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. @@ -260,11 +260,6 @@ OsmoBSC(config-net)# handover maximum distance ? <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node - -OsmoBSC(config-net)# handover congestion-check ? - disabled Disable congestion checking, do not handover based on cell overload - <1-60> Congestion check interval in seconds - default Use default (10), remove explicit setting on this node OsmoBSC(config-net)# handover assignment ? 0 Disable in-call assignment @@ -340,8 +335,13 @@ <0-9> Number of retries default Use default (0), remove explicit setting on this node +OsmoBSC(config-net)# handover congestion-check ? + disabled Disable congestion checking, do not handover based on cell overload + <1-999> Congestion check interval in seconds (default 10) + now Manually trigger a congestion check to run right now -OsmoBSC(config-net)# ### Same on BTS level + +OsmoBSC(config-net)# ### Same on BTS level, except for the congestion-check OsmoBSC(config-net)# bts 0 OsmoBSC(config-net-bts)# handover? handover Handover options @@ -355,7 +355,6 @@ power Neighbor cell power triggering maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO assignment Enable or disable in-call channel re-assignment (HO algo 2 only) - congestion-check Configure congestion check interval (HO algo 2 only) tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) @@ -416,11 +415,6 @@ OsmoBSC(config-net-bts)# handover maximum distance ? <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node - -OsmoBSC(config-net-bts)# handover congestion-check ? - disabled Disable congestion checking, do not handover based on cell overload - <1-60> Congestion check interval in seconds - default Use default (10), remove explicit setting on this node OsmoBSC(config-net-bts)# handover assignment ? 0 Disable in-call assignment diff --git a/tests/testsuite.at b/tests/testsuite.at index 6ef3f29..f0f6fd1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -51,3 +51,177 @@ cat $abs_srcdir/bssap/bssap_test.err > experr AT_CHECK([$abs_top_builddir/tests/bssap/bssap_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([handover test 0]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 1]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 2]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 3]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 4]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 5]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 6]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 7]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 8]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 9]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 10]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 11]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 12]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 13]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 14]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 15]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 16]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 17]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 18]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 19]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 20]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 21]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 22]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 23]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 24]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 25]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 26]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 27]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 28]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 09:37:22 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 09:37:22 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Hello Stefan Sperling, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5878 to look at the new patch set (#2). mgcp: make domain name configurable At the moment the MGW has a fixed domain name string that is not even checked properly. - Make domain name configurable, use the current "mgw" string as defualt to maintain compatibility - Check the domain name with each request. If the endpoint contains an unexpected domain name, the request must be rejected. Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 6 files changed, 52 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/78/5878/2 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index d6397d3..0d156c6 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -212,6 +212,8 @@ * message. */ uint16_t osmux_dummy; + /* domain name of the media gateway */ + char domain[255+1]; }; /* config management */ diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 45195de..74acffa 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,22 @@ return &tcfg->endpoints[endp]; } +/* Check if the domain name, which is supplied with the endpoint name + * matches the configuration. */ +static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) +{ + char *domain_to_check; + + domain_to_check = strstr(mgcp, "@"); + if (!domain_to_check) + return -EINVAL; + + if (strcmp(domain_to_check+1, cfg->domain) != 0) + return -EINVAL; + + return 0; +} + /* Search the endpoint pool for the endpoint that had been selected via the * MGCP message (helper function for mgcp_analyze_header()) */ static struct mgcp_endpoint *find_endpoint(struct mgcp_config *cfg, @@ -189,6 +205,11 @@ char *endptr = NULL; unsigned int gw = INT_MAX; + if (check_domain_name(cfg, mgcp)) { + LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp); + return NULL; + } + if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9d79343..5f1a734 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1072,6 +1072,8 @@ return NULL; } + osmo_strlcpy(cfg->domain, "mgw", sizeof(cfg->domain)); + cfg->net_ports.range_start = RTP_PORT_DEFAULT_RANGE_START; cfg->net_ports.range_end = RTP_PORT_DEFAULT_RANGE_END; cfg->net_ports.last_port = cfg->net_ports.range_start; @@ -1208,13 +1210,16 @@ * \returns 0 on success, -1 on error */ int mgcp_send_reset_all(struct mgcp_config *cfg) { + char buf[MGCP_ENDPOINT_MAXLEN + 128]; + int len; int rc; - static const char mgcp_reset[] = { - "RSIP 1 *@mgw MGCP 1.0\r\n" - }; + len = snprintf(buf, sizeof(buf), + "RSIP 1 *@%s MGCP 1.0\r\n", cfg->domain); + if (len < 0) + return -1; - rc = send_agent(cfg, mgcp_reset, sizeof mgcp_reset - 1); + rc = send_agent(cfg, buf, len); if (rc <= 0) return -1; @@ -1228,12 +1233,12 @@ * \returns 0 on success, -1 on error */ int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint) { - char buf[128]; + char buf[MGCP_ENDPOINT_MAXLEN + 128]; int len; int rc; len = snprintf(buf, sizeof(buf), - "RSIP 39 %x at mgw MGCP 1.0\r\n", endpoint); + "RSIP 39 %x@%s MGCP 1.0\r\n", endpoint, endp->cfg->domain); if (len < 0) return -1; diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 7fa3949..7043527 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -63,6 +63,7 @@ static int config_write_mgcp(struct vty *vty) { vty_out(vty, "mgcp%s", VTY_NEWLINE); + vty_out(vty, " domain %s%s", g_cfg->domain, VTY_NEWLINE); if (g_cfg->local_ip) vty_out(vty, " local ip %s%s", g_cfg->local_ip, VTY_NEWLINE); vty_out(vty, " bind ip %s%s", g_cfg->source_addr, VTY_NEWLINE); @@ -1179,6 +1180,14 @@ return CMD_SUCCESS; } +DEFUN(cfg_mgcp_domain, + cfg_mgcp_domain_cmd, + "domain NAME", "domain\n" "qualified domain name\n") +{ + osmo_strlcpy(g_cfg->domain, argv[0], sizeof(g_cfg->domain)); + return CMD_SUCCESS; +} + int mgcp_vty_init(void) { install_element_ve(&show_mgcp_cmd); @@ -1240,6 +1249,7 @@ install_element(MGCP_NODE, &cfg_mgcp_osmux_dummy_cmd); install_element(MGCP_NODE, &cfg_mgcp_allow_transcoding_cmd); install_element(MGCP_NODE, &cfg_mgcp_no_allow_transcoding_cmd); + install_element(MGCP_NODE, &cfg_mgcp_domain_cmd); install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd); install_node(&trunk_node, config_write_trunk); diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 46fd69b..467cb6c 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -66,18 +66,18 @@ OSMO_ASSERT(counter == EXPECTED_NUMBER_OF_LINES); } -#define AUEP1 "AUEP 158663169 ds/e1-1/2 at 172.16.6.66 MGCP 1.0\r\n" +#define AUEP1 "AUEP 158663169 ds/e1-1/2 at mgw MGCP 1.0\r\n" #define AUEP1_RET "200 158663169 OK\r\n" -#define AUEP2 "AUEP 18983213 ds/e1-2/1 at 172.16.6.66 MGCP 1.0\r\n" +#define AUEP2 "AUEP 18983213 ds/e1-2/1 at mgw MGCP 1.0\r\n" #define AUEP2_RET "500 18983213 FAIL\r\n" #define EMPTY "\r\n" #define EMPTY_RET NULL #define SHORT "CRCX \r\n" #define SHORT_RET "510 000000 FAIL\r\n" -#define MDCX_WRONG_EP "MDCX 18983213 ds/e1-3/1 at 172.16.6.66 MGCP 1.0\r\n" +#define MDCX_WRONG_EP "MDCX 18983213 ds/e1-3/1 at mgw MGCP 1.0\r\n" #define MDCX_ERR_RET "500 18983213 FAIL\r\n" -#define MDCX_UNALLOCATED "MDCX 18983214 ds/e1-1/2 at 172.16.6.66 MGCP 1.0\r\n" +#define MDCX_UNALLOCATED "MDCX 18983214 ds/e1-1/2 at mgw MGCP 1.0\r\n" #define MDCX_RET "400 18983214 FAIL\r\n" #define MDCX3 \ diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok index 23f0658..09ad9e1 100644 --- a/tests/mgcp/mgcp_test.ok +++ b/tests/mgcp/mgcp_test.ok @@ -16,7 +16,7 @@ Testing AUEP1 creating message from statically defined input: ---------8<--------- -AUEP 158663169 ds/e1-1/2 at 172.16.6.66 MGCP 1.0 +AUEP 158663169 ds/e1-1/2 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -28,7 +28,7 @@ Testing AUEP2 creating message from statically defined input: ---------8<--------- -AUEP 18983213 ds/e1-2/1 at 172.16.6.66 MGCP 1.0 +AUEP 18983213 ds/e1-2/1 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -40,7 +40,7 @@ Testing MDCX1 creating message from statically defined input: ---------8<--------- -MDCX 18983213 ds/e1-3/1 at 172.16.6.66 MGCP 1.0 +MDCX 18983213 ds/e1-3/1 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -52,7 +52,7 @@ Testing MDCX2 creating message from statically defined input: ---------8<--------- -MDCX 18983214 ds/e1-1/2 at 172.16.6.66 MGCP 1.0 +MDCX 18983214 ds/e1-1/2 at mgw MGCP 1.0 ---------8<--------- checking response: -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Fri Jan 19 09:37:22 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 09:37:22 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: protocol: remove unnecessary nul termination Message-ID: Review at https://gerrit.osmocom.org/5925 cosmetic: protocol: remove unnecessary nul termination Adding a NUL manually is a common idiom after calling strncpy() because strncpy() does not always NUL-terminate the string. But snprintf() is fine. - remove NUL termination after snprintf in mgcp_send_reset_ep() Change-Id: I5a1187b13b21b11674f13d3449c730616b0a4ddf --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/25/5925/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 5f1a734..4c04712 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1242,8 +1242,6 @@ if (len < 0) return -1; - buf[sizeof(buf) - 1] = '\0'; - rc = send_agent(endp->cfg, buf, len); if (rc <= 0) return -1; -- To view, visit https://gerrit.osmocom.org/5925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5a1187b13b21b11674f13d3449c730616b0a4ddf Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 19 09:38:12 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 09:38:12 +0000 Subject: osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Patch Set 1: (4 comments) > Build Started http://jenkins.osmocom.org/jenkins/job/gerrit-osmo-mgw/190/ https://gerrit.osmocom.org/#/c/5878/1/src/libosmo-mgcp/mgcp_protocol.c File src/libosmo-mgcp/mgcp_protocol.c: Line 1217: len = snprintf(buf, sizeof(buf), > snprintf() could return -1 here if the expanded string does not fit into bu Done Line 1220: rc = send_agent(cfg, buf, len); > Which means we could end up passing -1 as length here... Done Line 1240: if (len < 0) > Here it is done correctly. Done Line 1243: buf[sizeof(buf) - 1] = '\0'; > Unrelated to your change, but this line is not needed with snprintf() and c See #5925 -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 10:34:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 10:34:35 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 Sorry, but I am not sure this change really makes sense... While building the latest master: $ autoreconf -i $ ./configure $ make -j5 $ make check V=s 2>&1 | grep libosmovty I see the following lines only: /bin/bash ../libtool --tag=CC --mode=link gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -o vty/vty_test vty/vty_test.o ../src/libosmocore.la -ltalloc ../src/vty/libosmovty.la libtool: link: gcc -Wall -g -O2 -DBUILDING_LIBOSMOCORE -Wall -o vty/.libs/vty_test vty/vty_test.o ../src/.libs/libosmocore.so -ltalloc ../src/vty/.libs/libosmovty.so As I understand, during the linking process exactly the ../src/vty/.libs/libosmovty.so from current build is used. Other tests aren't being linked against libosmovty, according to the output. Am I wrong? -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr 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 Fri Jan 19 10:44:59 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 10:44:59 +0000 Subject: osmo-bsc[master]: osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I510e1081171706eb3d9fb2db50a9aa4f768929b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 10:49:14 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 10:49:14 +0000 Subject: osmo-bsc[master]: HO: fix recovery from failed handover In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5891/1/src/osmo-bsc/osmo_bsc_mgcp.c File src/osmo-bsc/osmo_bsc_mgcp.c: Line 1080: whitespace... -- To view, visit https://gerrit.osmocom.org/5891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 11:03:15 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 11:03:15 +0000 Subject: osmo-bsc[master]: HO prep: introduce per-BTS handover config, with defaults on... In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/5892/1/include/osmocom/bsc/handover_cfg.h File include/osmocom/bsc/handover_cfg.h: Line 103: whitespace https://gerrit.osmocom.org/#/c/5892/1/src/libcommon/handover_cfg.c File src/libcommon/handover_cfg.c: Line 30: struct handover_cfg { Why not to define this structure in header? -- To view, visit https://gerrit.osmocom.org/5892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 11:15:35 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 11:15:35 +0000 Subject: osmo-bsc[master]: HO: Assign SDCCH on channel request In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) Better commit name would be: 'prefer late channel assignment' or: 'attempt to assign SDCCH first' https://gerrit.osmocom.org/#/c/5898/1/src/libbsc/abis_rsl.c File src/libbsc/abis_rsl.c: Line 1895: * - First try to allocate SDCCH. ws -- To view, visit https://gerrit.osmocom.org/5898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 11:18:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 11:18:02 +0000 Subject: osmo-bsc[master]: Fix of checking TCH rate at chan_compat_with_mode In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb4cb9aef1a1146f984d7c969bfba53c647cae07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 11:49:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 19 Jan 2018 11:49:03 +0000 Subject: [PATCH] osmo-ci[master]: gerrit-verifications.yml: osmo-sgsn: Remove duplicated concu... Message-ID: Review at https://gerrit.osmocom.org/5926 gerrit-verifications.yml: osmo-sgsn: Remove duplicated concurrent attribute Change-Id: I808c46c2f4488fd577bb1c23cd13c5b73519265b --- M jobs/gerrit-verifications.yml 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/26/5926/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 70c21b5..b402ce7 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -165,7 +165,6 @@ gerrit_project: 'python/{repos}' - osmo-sgsn: - concurrent: true a1_name: IU a1: !!python/tuple [--enable-iu, --disable-iu] concurrent: true -- To view, visit https://gerrit.osmocom.org/5926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I808c46c2f4488fd577bb1c23cd13c5b73519265b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 19 12:52:21 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 12:52:21 +0000 Subject: osmo-ci[master]: jobs: master: also trigger once per day In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I126de2bab3db22cb693b0fa665f6579de9238fdf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 12:52:22 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 12:52:22 +0000 Subject: [MERGED] osmo-ci[master]: jobs: master: also trigger once per day In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jobs: master: also trigger once per day ...................................................................... jobs: master: also trigger once per day Recently we had changes to osmo-ci, and I noticed that although some master builds were broken by that, the builds were still showing success -- of twenty days ago. Run each master build at least once a day to indicate odd side effect failure sooner. Change-Id: I126de2bab3db22cb693b0fa665f6579de9238fdf --- M jobs/master-builds.yml 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 4400d8e..6b34693 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -300,6 +300,7 @@ - pollscm: cron: "H/5 * * * *" ignore-post-commit-hooks: false + - timed: "H H * * *" builders: - shell: '{obj:cmd}' -- To view, visit https://gerrit.osmocom.org/5924 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I126de2bab3db22cb693b0fa665f6579de9238fdf Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:00:23 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:00:23 +0000 Subject: osmo-bsc[master]: HO prep: introduce per-BTS handover config, with defaults on... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5892/1/src/libcommon/handover_cfg.c File src/libcommon/handover_cfg.c: Line 30: struct handover_cfg { > Why not to define this structure in header? the parameters should be accessed by the ho_get_* and ho_set_* API, hence I want this struct to remain opaque. The main reason is: I'm adding a network-wide config as well as a per-bts config that defaults to the network-wide one if unset; hence the has_xxx members and looking for set values at higher_level_cfg. Allowing direct access to the members would be opening doors for erratic use. -- To view, visit https://gerrit.osmocom.org/5892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:24:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:24:39 +0000 Subject: [PATCH] osmo-bsc[master]: HO: fix recovery from failed handover In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5891 to look at the new patch set (#2). HO: fix recovery from failed handover Do not instruct the MGW to move the RTP to the new lchan before we have received a HANDOVER DETECT. Before: Chan Activ Chan Activ Ack IPACC-CRCX -ACK IPACC-MDCX -ACK MGCP MDCX --> MGW ... HANDOVER DETECT Call continues on new lchan In above sequence, if the HANDOVER DETECT times out, the MGW has moved to the new lchan which never becomes used and is released. Furthermore, from the IPACC MDCX until the HANDOVER DETECT, the RTP stream would break off momentarily. After: Chan Activ Chan Activ Ack IPACC-CRCX -ACK IPACC-MDCX -ACK ... HANDOVER DETECT MGCP MDCX --> MGW Call continues on new lchan If the HANDOVER DETECT times out, the call happily continues on the old lchan. This change is inspired by Ivan Kluchnikov's HO work, who implemented a similar fix in the openbsc.git codebase (branch fairwaves/master-rebase): his patch moves ipacc_mdcx() to connect RTP to the new lchan from switch_for_handover() (which triggered on S_ABISIP_CRCX_ACK, i.e. creation of the new lchan) to later on in ho_detect() a.k.a. the S_LCHAN_HANDOVER_DETECT signal handler: http://git.osmocom.org/openbsc/commit/?h=fairwaves/master-rebase&id=9507a7a1ea627e07370c9d264816bb190b3b91b8 This patch does essentially the same: remove the mgcp_handover() call from the MDCX-ACK handling (creation of the new lchan), and add a signal handler for S_LCHAN_HANDOVER_DETECT to osmo_bsc_mgcp.c to effect the MGW switchover. Note, it would have been possible to call mgcp_handover() directly from rx of the HANDOVER DETECT message, but that produces linking fallout in some utils/ projects, which then need to link the mgcp code as well. That is because those aren't properly separated from the more complex parts of libbsc. Using the signal is a bit bloaty, but saves the linking hell for now. I've faced a similar problem twice recently, it would pay off to separate out the simpler utils/ and ipaccess/ tools so that they don't need to link all of libbsc and osmo-bsc, at some point (TM). Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f --- M include/osmocom/bsc/osmo_bsc_mgcp.h M src/libbsc/handover_logic.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_mgcp.c 4 files changed, 66 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/91/5891/2 diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h index 1e06331..dc2ba34 100644 --- a/include/osmocom/bsc/osmo_bsc_mgcp.h +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -58,5 +58,4 @@ enum gsm48_chan_mode chan_mode, bool full_rate); void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); -void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan); void mgcp_free_ctx(struct mgcp_ctx *mgcp_ctx); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index a30cd09..cad0144 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -325,7 +325,11 @@ return -ENODEV; } - /* FIXME: do we actually want to do something here ? */ + LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + + /* This is just for logging on the DHO category. The actual MGCP switchover happens in + * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. + * (Calling mgcp_handover() directly currently breaks linking in utils/...) */ return 0; } diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 433dc6c..ceec469 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -50,11 +50,6 @@ switch (signal) { case S_ABISIP_CRCX_ACK: - /* - * TODO: handle handover here... then the audio should go to - * the old mgcp port.. - */ - /* we can ask it to connect now */ LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n", con->sccp_con->user_plane.rtp_port, lchan->abis_ip.conn_id); @@ -77,14 +72,11 @@ case S_ABISIP_MDCX_ACK: if (con->ho_lchan) { - /* NOTE: When an ho_lchan exists, the MDCX is part of an - * handover operation (intra-bsc). This means we will not - * inform the MSC about the event, which means that no - * assignment complete message is transmitted, we just - * inform the logic that controls the MGW about the new - * connection info */ - LOGP(DMSC, LOGL_INFO,"RTP connection handover initiated...\n"); - mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, con->ho_lchan); + LOGP(DHO, LOGL_DEBUG, "%s -> %s BTS sent MDCX ACK\n", gsm_lchan_name(lchan), + gsm_lchan_name(con->ho_lchan)); + /* No need to do anything for handover here. As soon as a HANDOVER DETECT + * happens, osmo_bsc_mgcp.c will trigger the MGCP MDCX towards MGW by + * receiving an S_LCHAN_HANDOVER_DETECT signal. */ } else if (is_ipaccess_bts(conn_get_bts(con)) && con->sccp_con->user_plane.rtp_ip) { /* NOTE: This is only relevant on AoIP networks with * IPA based base stations. See also osmo_bsc_api.c, diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 519eaf4..bdf2dd2 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1048,7 +1049,7 @@ * Parameter: * mgcp_ctx: context information (FSM, and pointer to external system data) * ho_lchan: the lchan on the new BTS */ -void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan) +static void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan) { OSMO_ASSERT(mgcp_ctx); OSMO_ASSERT(ho_lchan); @@ -1066,6 +1067,59 @@ osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_HANDOVER, mgcp_ctx); return; +} + +/* GSM 08.58 HANDOVER DETECT has been received */ +static int mgcp_sig_ho_detect(struct gsm_lchan *new_lchan) +{ + struct gsm_subscriber_connection *conn; + if (!new_lchan) { + LOGP(DHO, LOGL_ERROR, "HO Detect signal for NULL lchan\n"); + return -EINVAL; + } + + conn = new_lchan->conn; + + if (!conn) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for lchan without conn\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + if (!conn->sccp_con) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for conn without sccp_con\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + if (!conn->sccp_con->user_plane.mgcp_ctx) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for conn without MGCP ctx\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + mgcp_handover(conn->sccp_con->user_plane.mgcp_ctx, new_lchan); + return 0; +} + +static int mgcp_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data; + + switch (subsys) { + case SS_LCHAN: + lchan_data = signal_data; + switch (signal) { + case S_LCHAN_HANDOVER_DETECT: + return mgcp_sig_ho_detect(lchan_data->lchan); + } + break; + default: + break; + } + + return 0; } /* Free an existing mgcp context gracefully @@ -1090,4 +1144,5 @@ void mgcp_init(struct gsm_network *net) { osmo_fsm_register(&fsm_bsc_mgcp); + osmo_signal_register_handler(SS_LCHAN, mgcp_sig_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/5891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:24:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:24:39 +0000 Subject: [PATCH] osmo-bsc[master]: HO prep: introduce per-BTS handover config, with defaults on... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5892 to look at the new patch set (#2). HO prep: introduce per-BTS handover config, with defaults on net node It is desirable to allow configuring handover for each individual network cell. At the same time, it is desirable to set global defaults. Treat the 'network' node handover parameters as global defaults, add another set of parameters for each individual BTS. This raises questions on how the 'network' node should affect the individual BTS. The simplistic solution would have been: on creating a BTS in the config, just copy the current defaults; with serious drawbacks: - tweaking any parameter in the telnet VTY on network node will never affect any running BTS. - network node defaults *must* be issued before the bts sections in the config file. - when writing a config back to file, we would copy all net node defaults to each BTS node, making the network node configs pointless. Instead, add a handover_cfg API that tracks whether a given node has a value set or not. A bts node ho_cfg gets a pointer to the network node config and returns those values if locally unset. If no value is set on any node, use the "factory" defaults, which are hardcoded in the API. Only write back exactly those config items that were actually issued in a config file / on the telnet VTY. (ho_cfg API wise, we could trivially add another ho_cfg level per TRX if we so desire in the future.) Implement ho parameters as an opaque config struct with getters and setters to ensure the tracking is always heeded. Opaqueness dictates allocating instead of direct embedding in gsm_network and gsm_bts structs, ctx is gsm_net / bts. This is 100% backwards compatible to old configs. - No VTY command syntax changes (only the online help). - If a 'bts' sets nothing, it will use the 'network' defaults. - The 'show network' output only changes in presence of individual BTS configs. On 'show network', say "Handover: On|Off" as before, iff all BTS reflect identical behavior. Otherwise, output BTS counts of handover being enabled or not. Use the same set of VTY commands (same VTY cmd syntax as before) on network and BTS nodes, i.e. don't duplicate VTY code. From the current vty->node, figure out which ho_cfg to modify. For linking, add handover_cfg.c (the value API) in libcommon, while the handover_vty.c is in libbsc. This is mainly because some utility programs use gsm_network and hence suck in the ho stuff, but don't need the VTY commands. Review the VTY online help strings. Add VTY transcript test for handover options, testing config propagation from network to bts nodes, 'show network' output and VTY online help strings. (Needs recent addition of '... !' wildcard to osmo_interact_common.py.) I considered leaving parts of this more readable, but in the end decided for heavy use of macros to define and declare the API, because more values will be added in upcoming patches and I want to prevent myself from messing them up. Inspired-by: jolly/new_handover branch, which moves the config to 'bts' level Depends: I7c1ebb2e7f059047903a53de26a0ec1ce7fa9b98 (osmo-python-tests) Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h A include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_vty.h M src/libbsc/Makefile.am M src/libbsc/bsc_vty.c M src/libbsc/handover_decision.c A src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/Makefile.am M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c A src/libcommon/handover_cfg.c M tests/Makefile.am A tests/handover_cfg.vty 16 files changed, 653 insertions(+), 150 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/92/5892/2 diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index b067fc2..699aeb3 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -25,7 +25,9 @@ gsm_data.h \ gsm_data_shared.h \ handover.h \ + handover_cfg.h \ handover_decision.h \ + handover_vty.h \ ipaccess.h \ meas_feed.h \ meas_rep.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ed2a95c..c09d546 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -227,22 +227,7 @@ uint16_t network_code; int a5_encryption; int neci; - struct { - int active; - /* Window RXLEV averaging */ - unsigned int win_rxlev_avg; /* number of SACCH frames */ - /* Window RXQUAL averaging */ - unsigned int win_rxqual_avg; /* number of SACCH frames */ - /* Window RXLEV neighbouring cells averaging */ - unsigned int win_rxlev_avg_neigh; /* number of SACCH frames */ - - /* how often should we check for power budget HO */ - unsigned int pwr_interval; /* SACCH frames */ - /* how much better does a neighbor cell have to be ? */ - unsigned int pwr_hysteresis; /* dBm */ - /* maximum distacne before we try a handover */ - unsigned int max_distance; /* TA values */ - } handover; + struct handover_cfg *ho; struct rate_ctr_group *bsc_ctrs; diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index db854fd..fd566d2 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -799,6 +799,8 @@ struct pcu_sock_state *pcu_state; struct rate_ctr_group *bts_ctrs; + + struct handover_cfg *ho; }; diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h new file mode 100644 index 0000000..95c0e50 --- /dev/null +++ b/include/osmocom/bsc/handover_cfg.h @@ -0,0 +1,112 @@ +#pragma once + +#include + +struct vty; + +/* handover_cfg is an opaque struct to manage several levels of configuration. There is an overall handover + * config on 'network' level and a per-'bts' specific handover config. If the 'bts' level sets no values, + * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ +struct handover_cfg; + +struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); + +#define HO_CFG_STR_HANDOVER "Handover options\n" +#define HO_CFG_STR_WIN HO_CFG_STR_HANDOVER "Measurement averaging settings\n" +#define HO_CFG_STR_WIN_RXLEV HO_CFG_STR_WIN "Received-Level averaging\n" +#define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" +#define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" +#define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" + +#define as_is(x) (x) + +static inline bool a2bool(const char *arg) +{ + return (bool)(atoi(arg)); +} + +static inline int bool2i(bool arg) +{ + return arg? 1 : 0; +} + + +/* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, + * function declarations or definitions... It is of the format + * HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, + * VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, + * VTY_WRITE_FMT, VTY_WRITE_CONV, + * VTY_DOC) + * Then using HO_CFG_ALL_MEMBERS can save a lot of code dup in defining API declaration, API + * definitions, VTY commands and VTY write code. Of course this doesn't prevent us from adding manual + * members as well, in case future additions don't fit in this scheme. + * + * TYPE: a type name like int. + * NAME: a variable name suitable for a struct member. + * DEFAULT_VAL: default value, as passed to the VTY, e.g. '0' or 'foo', without quotes. + * VTY_CMD: a command string for VTY without any arguments. + * VTY_CMD_ARG: VTY value range like '<0-23>' or 'foo|bar', will become '(VTY_CMD_ARG|default)'. + * VTY_ARG_EVAL: function name for parsing the VTY arg[0], e.g. 'atoi'. + * VTY_WRITE_FMT: printf-like string format for vty_out(). + * VTY_WRITE_CONV: function name to convert struct value to VTY_WRITE_FMT, e.g. 'as_is'. + * VTY_DOC: VTY documentation strings to match VTY_CMD and VTY_CMD_ARGs. + */ +#define HO_CFG_ALL_MEMBERS \ + \ + HO_CFG_ONE_MEMBER(bool, ho_active, 0, \ + "handover", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Disable in-call handover\n" \ + "Enable in-call handover\n" \ + "Enable/disable handover: ") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ + "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXLEV \ + "How many RxLev measurements are used for averaging\n" \ + "RxLev averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxqual_avg_win, 1, \ + "handover window rxqual averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXQUAL \ + "How many RxQual measurements are used for averaging\n" \ + "RxQual averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxlev_neigh_avg_win, 10, \ + "handover window rxlev neighbor averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXLEV \ + "How many Neighbor RxLev measurements are used for averaging\n" \ + "How many Neighbor RxLev measurements are used for averaging\n" \ + "Neighbor RxLev averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, pwr_interval, 6, \ + "handover power budget interval", "<1-99>", atoi, "%u", as_is, \ + HO_CFG_STR_POWER_BUDGET \ + "How often to check for a better cell (SACCH frames)\n" \ + "Check for stronger neighbor every N number of SACCH frames\n") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, pwr_hysteresis, 3, \ + "handover power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ + HO_CFG_STR_POWER_BUDGET \ + "How many dBm stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dBm\n") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, max_distance, 9999, \ + "handover maximum distance" , "<0-9999>", atoi, "%u", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ + + +/* Declare public API for handover cfg parameters... */ + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + TYPE ho_get_##NAME(struct handover_cfg *ho); \ + void ho_set_##NAME(struct handover_cfg *ho, TYPE val); \ + bool ho_isset_##NAME(struct handover_cfg *ho); \ + void ho_clear_##NAME(struct handover_cfg *ho); \ + bool ho_isset_on_parent_##NAME(struct handover_cfg *ho); + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h new file mode 100644 index 0000000..48af136 --- /dev/null +++ b/include/osmocom/bsc/handover_vty.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include + +void ho_vty_init(); +void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index 3ac1c0b..d118f44 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -57,5 +57,6 @@ net_init.c \ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ + handover_vty.c \ $(NULL) diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index d582802..a304e86 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -174,8 +176,27 @@ VTY_NEWLINE); vty_out(vty, " Use TCH for Paging any: %d%s", net->pag_any_tch, VTY_NEWLINE); - vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", - VTY_NEWLINE); + + { + struct gsm_bts *bts; + unsigned int ho_active_count = 0; + unsigned int ho_inactive_count = 0; + + llist_for_each_entry(bts, &net->bts_list, list) { + if (ho_get_ho_active(bts->ho)) + ho_active_count ++; + else + ho_inactive_count ++; + } + + if (ho_active_count && ho_inactive_count) + vty_out(vty, " Handover: On at %u BTS, Off at %u BTS%s", + ho_active_count, ho_inactive_count, VTY_NEWLINE); + else + vty_out(vty, " Handover: %s%s", ho_active_count ? "On" : "Off", + VTY_NEWLINE); + } + network_chan_load(&pl, net); vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); dump_pchan_load_vty(vty, " ", &pl); @@ -774,6 +795,8 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); + ho_vty_write(vty, " ", bts->ho); + config_write_bts_model(vty, bts); } @@ -803,19 +826,9 @@ vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); - vty_out(vty, " handover window rxlev averaging %u%s", - gsmnet->handover.win_rxlev_avg, VTY_NEWLINE); - vty_out(vty, " handover window rxqual averaging %u%s", - gsmnet->handover.win_rxqual_avg, VTY_NEWLINE); - vty_out(vty, " handover window rxlev neighbor averaging %u%s", - gsmnet->handover.win_rxlev_avg_neigh, VTY_NEWLINE); - vty_out(vty, " handover power budget interval %u%s", - gsmnet->handover.pwr_interval, VTY_NEWLINE); - vty_out(vty, " handover power budget hysteresis %u%s", - gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); - vty_out(vty, " handover maximum distance %u%s", - gsmnet->handover.max_distance, VTY_NEWLINE); + + ho_vty_write(vty, " ", gsmnet->ho); + VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); VTY_OUT_TIMER(3105); @@ -1646,100 +1659,6 @@ gsmnet->neci = atoi(argv[0]); gsm_net_update_ctype(gsmnet); - return CMD_SUCCESS; -} - -#define HANDOVER_STR "Handover Options\n" - -DEFUN(cfg_net_handover, cfg_net_handover_cmd, - "handover (0|1)", - HANDOVER_STR - "Don't perform in-call handover\n" - "Perform in-call handover\n") -{ - int enable = atoi(argv[0]); - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - if (enable && ipacc_rtp_direct) { - vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode " - "is enabled by using the -P command line option%s", - VTY_NEWLINE); - return CMD_WARNING; - } - gsmnet->handover.active = enable; - - return CMD_SUCCESS; -} - -#define HO_WIN_STR HANDOVER_STR "Measurement Window\n" -#define HO_WIN_RXLEV_STR HO_WIN_STR "Received Level Averaging\n" -#define HO_WIN_RXQUAL_STR HO_WIN_STR "Received Quality Averaging\n" -#define HO_PBUDGET_STR HANDOVER_STR "Power Budget\n" -#define HO_AVG_COUNT_STR "Amount to use for Averaging\n" - -DEFUN(cfg_net_ho_win_rxlev_avg, cfg_net_ho_win_rxlev_avg_cmd, - "handover window rxlev averaging <1-10>", - HO_WIN_RXLEV_STR - "How many RxLev measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxlev_avg = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_win_rxqual_avg, cfg_net_ho_win_rxqual_avg_cmd, - "handover window rxqual averaging <1-10>", - HO_WIN_RXQUAL_STR - "How many RxQual measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxqual_avg = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_win_rxlev_neigh_avg, cfg_net_ho_win_rxlev_avg_neigh_cmd, - "handover window rxlev neighbor averaging <1-10>", - HO_WIN_RXLEV_STR "Neighbor\n" - "How many RxQual measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxlev_avg_neigh = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_pwr_interval, cfg_net_ho_pwr_interval_cmd, - "handover power budget interval <1-99>", - HO_PBUDGET_STR - "How often to check if we have a better cell (SACCH frames)\n" - "Interval\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.pwr_interval = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_pwr_hysteresis, cfg_net_ho_pwr_hysteresis_cmd, - "handover power budget hysteresis <0-999>", - HO_PBUDGET_STR - "How many dB does a neighbor to be stronger to become a HO candidate\n" - "Hysteresis\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.pwr_hysteresis = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_max_distance, cfg_net_ho_max_distance_cmd, - "handover maximum distance <0-9999>", - HANDOVER_STR - "How big is the maximum timing advance before HO is forced\n" - "Distance\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.max_distance = atoi(argv[0]); return CMD_SUCCESS; } @@ -4386,13 +4305,6 @@ logging_vty_add_cmds(NULL); install_element(GSMNET_NODE, &cfg_net_neci_cmd); - install_element(GSMNET_NODE, &cfg_net_handover_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_neigh_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_pwr_interval_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_pwr_hysteresis_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_max_distance_cmd); install_element(GSMNET_NODE, &cfg_net_T3101_cmd); install_element(GSMNET_NODE, &cfg_net_T3103_cmd); install_element(GSMNET_NODE, &cfg_net_T3105_cmd); @@ -4407,6 +4319,7 @@ install_element(GSMNET_NODE, &cfg_net_T3141_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); + /* See also handover commands added on net level from handover_vty.c */ install_element(GSMNET_NODE, &cfg_bts_cmd); install_node(&bts_node, config_write_bts); @@ -4512,6 +4425,7 @@ install_element(BTS_NODE, &cfg_bts_amr_hr_hyst3_cmd); install_element(BTS_NODE, &cfg_bts_amr_hr_start_mode_cmd); install_element(BTS_NODE, &cfg_bts_pcu_sock_cmd); + /* See also handover commands added on bts level from handover_vty.c */ install_element(BTS_NODE, &cfg_trx_cmd); install_node(&trx_node, dummy_config_write); @@ -4550,6 +4464,8 @@ e1inp_vty_init(); osmo_fsm_vty_add_cmds(); + ho_vty_init(); + bsc_vty_init_extra(); return 0; diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 3bca05f..a2abb39 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -30,8 +30,10 @@ #include #include #include -#include #include + +#include +#include /* Get reference to a neighbor cell on a given BCCH ARFCN */ static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, @@ -187,7 +189,7 @@ /* attempt to do a handover */ static int attempt_handover(struct gsm_meas_rep *mr) { - struct gsm_network *net = mr->lchan->ts->trx->bts->network; + struct gsm_bts *bts = mr->lchan->ts->trx->bts; struct neigh_meas_proc *best_cell = NULL; unsigned int best_better_db = 0; int i, rc; @@ -204,10 +206,10 @@ continue; /* caculate average rxlev for this cell over the window */ - avg = neigh_meas_avg(nmp, net->handover.win_rxlev_avg_neigh); + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); /* check if hysteresis is fulfilled */ - if (avg < mr->dl.full.rx_lev + net->handover.pwr_hysteresis) + if (avg < mr->dl.full.rx_lev + ho_get_pwr_hysteresis(bts->ho)) continue; better = avg - mr->dl.full.rx_lev; @@ -222,7 +224,7 @@ LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", gsm_ts_name(mr->lchan->ts), best_cell->arfcn); - if (!net->handover.active) { + if (!ho_get_ho_active(bts->ho)) { LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n"); return 0; } @@ -248,9 +250,10 @@ * attempt a handover */ static int process_meas_rep(struct gsm_meas_rep *mr) { - struct gsm_network *net = mr->lchan->ts->trx->bts->network; + struct gsm_bts *bts = mr->lchan->ts->trx->bts; enum meas_rep_field dlev, dqual; int av_rxlev; + unsigned int pwr_interval; /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { @@ -274,7 +277,7 @@ process_meas_neigh(mr); av_rxlev = get_meas_rep_avg(mr->lchan, dlev, - net->handover.win_rxlev_avg); + ho_get_rxlev_avg_win(bts->ho)); /* Interference HO */ if (rxlev2dbm(av_rxlev) > -85 && @@ -297,14 +300,15 @@ } /* Distance */ - if (mr->ms_l1.ta > net->handover.max_distance) { - LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%u\n", - rxlev2dbm(av_rxlev), mr->ms_l1.ta); + if (mr->ms_l1.ta > ho_get_max_distance(bts->ho)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%d \n", + rxlev2dbm(av_rxlev), mr->ms_l1.ta); return attempt_handover(mr); } /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) + pwr_interval = ho_get_pwr_interval(bts->ho); + if ((mr->nr % pwr_interval) == pwr_interval - 1) return attempt_handover(mr); return 0; diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c new file mode 100644 index 0000000..225e9a9 --- /dev/null +++ b/src/libbsc/handover_vty.c @@ -0,0 +1,101 @@ +/* OsmoBSC interface to quagga VTY for handover parameters */ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2009-2010 by Harald Welte + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) +{ + switch (vty->node) { + case GSMNET_NODE: + return gsmnet_from_vty(vty)->ho; + case BTS_NODE: + OSMO_ASSERT(vty->index); + return ((struct gsm_bts *)vty->index)->ho; + default: + OSMO_ASSERT(false); + } +} + + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ + VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ + VTY_WRITE_FMT, VTY_WRITE_CONV, \ + VTY_DOC) \ +DEFUN(cfg_ho_##NAME, cfg_ho_##NAME##_cmd, \ + VTY_CMD " (" VTY_CMD_ARG "|default)", \ + VTY_DOC \ + "Use default (" #DEFAULT_VAL "), remove explicit setting on this node\n") \ +{ \ + struct handover_cfg *ho = ho_cfg_from_vty(vty); \ + const char *val = argv[0]; \ + if (!strcmp(val, "default")) { \ + const char *msg; \ + if (ho_isset_##NAME(ho)) {\ + ho_clear_##NAME(ho); \ + msg = "setting removed, now is"; \ + } else \ + msg = "already was unset, still is"; \ + vty_out(vty, "%% '" VTY_CMD "' %s " VTY_WRITE_FMT "%s%s", \ + msg, VTY_WRITE_CONV( ho_get_##NAME(ho) ), \ + ho_isset_on_parent_##NAME(ho)? " (set on higher level node)" : "", \ + VTY_NEWLINE); \ + } \ + else \ + ho_set_##NAME(ho, VTY_ARG_EVAL(val)); \ + return CMD_SUCCESS; \ +} + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER + + +void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +{ +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ + VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ + VTY_WRITE_FMT, VTY_WRITE_CONV, \ + VTY_DOC) \ + if (ho_isset_##NAME(ho)) \ + vty_out(vty, "%s" VTY_CMD " " VTY_WRITE_FMT "%s", indent, \ + VTY_WRITE_CONV( ho_get_##NAME(ho) ), VTY_NEWLINE); + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +} + +static void ho_vty_init_cmds(int parent_node) +{ +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + install_element(parent_node, &cfg_ho_##NAME##_cmd); + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +} + +void ho_vty_init() +{ + ho_vty_init_cmds(GSMNET_NODE); + ho_vty_init_cmds(BTS_NODE); +} + diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 30de0cc..57d8241 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -21,6 +21,7 @@ #include #include #include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, @@ -55,13 +56,7 @@ net->T3122 = GSM_T3122_DEFAULT; net->T3141 = GSM_T3141_DEFAULT; - /* default set of handover parameters */ - net->handover.win_rxlev_avg = 10; - net->handover.win_rxqual_avg = 1; - net->handover.win_rxlev_avg_neigh = 10; - net->handover.pwr_interval = 6; - net->handover.pwr_hysteresis = 3; - net->handover.max_distance = 9999; + net->ho = ho_cfg_init(net, NULL); INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index c66cbcd..9f7e7b9 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -27,4 +27,5 @@ gsm_data_shared.c \ socket.c \ talloc_ctx.c \ + handover_cfg.c \ $(NULL) diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 87d954a..92ebbfe 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -37,6 +37,7 @@ #include #include #include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index c14047d..e4ec594 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -33,6 +33,7 @@ #include #include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { @@ -374,6 +375,8 @@ /* si handling */ bts->bcch_change_mark = 1; + bts->ho = ho_cfg_init(bts, net->ho); + return bts; } diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c new file mode 100644 index 0000000..8c208f6 --- /dev/null +++ b/src/libcommon/handover_cfg.c @@ -0,0 +1,83 @@ +/* OsmoBSC handover configuration implementation */ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2009-2010 by Harald Welte + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include + +struct handover_cfg { + struct handover_cfg *higher_level_cfg; + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + TYPE NAME; \ + bool has_##NAME; + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +}; + +struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg) +{ + struct handover_cfg *ho = talloc_zero(ctx, struct handover_cfg); + OSMO_ASSERT(ho); + ho->higher_level_cfg = higher_level_cfg; + return ho; +} + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY_ARG_EVAL, VTY4, VTY5, VTY6) \ +TYPE ho_get_##NAME(struct handover_cfg *ho) \ +{ \ + if (ho->has_##NAME) \ + return ho->NAME; \ + if (ho->higher_level_cfg) \ + return ho_get_##NAME(ho->higher_level_cfg); \ + return VTY_ARG_EVAL(#DEFAULT_VAL); \ +} \ +\ +void ho_set_##NAME(struct handover_cfg *ho, TYPE value) \ +{ \ + ho->NAME = value; \ + ho->has_##NAME = true; \ +} \ +\ +bool ho_isset_##NAME(struct handover_cfg *ho) \ +{ \ + return ho->has_##NAME; \ +} \ +\ +void ho_clear_##NAME(struct handover_cfg *ho) \ +{ \ + ho->has_##NAME = false; \ +} \ +\ +bool ho_isset_on_parent_##NAME(struct handover_cfg *ho) \ +{ \ + return ho->higher_level_cfg \ + && (ho_isset_##NAME(ho->higher_level_cfg) \ + || ho_isset_on_parent_##NAME(ho->higher_level_cfg)); \ +} + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER diff --git a/tests/Makefile.am b/tests/Makefile.am index 9207434..ba8a5e1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,6 +34,7 @@ $(TESTSUITE) \ vty_test_runner.py \ ctrl_test_runner.py \ + handover_cfg.vty \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -44,11 +45,21 @@ if ENABLE_EXT_TESTS python-tests: $(BUILT_SOURCES) + $(MAKE) vty-test osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + osmo_verify_transcript_vty.py -v \ + -n OsmoBSC -p 4242 \ + -r "$(top_builddir)/src/osmo-bsc/osmo-bsc -c $(top_srcdir)/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg" \ + $(U) $(srcdir)/*.vty else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty new file mode 100644 index 0000000..e181797 --- /dev/null +++ b/tests/handover_cfg.vty @@ -0,0 +1,279 @@ +OsmoBSC> show network +... + Handover: Off +... +OsmoBSC> enable + +OsmoBSC# ### No handover config present +OsmoBSC# show running-config +... !handover + +OsmoBSC# ### Toggling handover on network level affects 'show network': +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# handover 1 +OsmoBSC(config-net)# do show network +... + Handover: On +... + +OsmoBSC(config-net)# ### If network level default is 'on', bts level can still override to 'off': +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover 0 +OsmoBSC(config-net-bts)# do show network +... + Handover: Off +... +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# ### Create a *second* BTS that is not explicitly 'off': +OsmoBSC(config-net)# bts 1 +OsmoBSC(config-net-bts)# do show network +... + Handover: On at 1 BTS, Off at 1 BTS +... + +OsmoBSC(config-net-bts)# ### Add arbitrary handover config item for bts 1: +OsmoBSC(config-net-bts)# handover power budget interval 23 +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# ### HO is 'on' globally, bts 0 disables it, bts 1 tweaks a param: +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Set global default to 'off', now bts 1 also uses the global default of 'off': +OsmoBSC(config-net)# handover 0 +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 0 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Remove the global setting, i.e. use the factory default net level, with same effect: +OsmoBSC(config-net)# handover default +% 'handover' setting removed, now is 0 +OsmoBSC(config-net)# handover default +% 'handover' already was unset, still is 0 +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Re-enable net-level handover, but bts 0 remains disabled explicitly +OsmoBSC(config-net)# handover 1 +OsmoBSC(config-net)# do show network +... + Handover: On at 1 BTS, Off at 1 BTS +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Remove explicit setting of bts 0 to also use the global setting: +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover default +% 'handover' setting removed, now is 1 (set on higher level node) +OsmoBSC(config-net-bts)# handover default +% 'handover' already was unset, still is 1 (set on higher level node) +OsmoBSC(config-net-bts)# do show network +... + Handover: On +... +OsmoBSC(config-net-bts)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + + +OsmoBSC(config-net-bts)# ### Checking online help +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# list +... + handover (0|1|default) + handover window rxlev averaging (<1-10>|default) + handover window rxqual averaging (<1-10>|default) + handover window rxlev neighbor averaging (<1-10>|default) + handover power budget interval (<1-99>|default) + handover power budget hysteresis (<0-999>|default) + handover maximum distance (<0-9999>|default) +... + +OsmoBSC(config-net)# handover? + handover Handover options + +OsmoBSC(config-net)# handover ? + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net)# handover window ? + rxlev Received-Level averaging + rxqual Received-Quality averaging + +OsmoBSC(config-net)# handover window rxlev ? + averaging How many RxLev measurements are used for averaging + neighbor How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net)# handover window rxlev averaging ? + <1-10> RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover window rxlev neighbor ? + averaging How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net)# handover window rxlev neighbor averaging ? + <1-10> Neighbor RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover window rxqual ? + averaging How many RxQual measurements are used for averaging + +OsmoBSC(config-net)# handover window rxqual averaging ? + <1-10> RxQual averaging: Number of values to average over + default Use default (1), remove explicit setting on this node + +OsmoBSC(config-net)# handover power ? + budget Neighbor cell power triggering + +OsmoBSC(config-net)# handover power budget ? + interval How often to check for a better cell (SACCH frames) + hysteresis How many dBm stronger must a neighbor be to become a HO candidate + +OsmoBSC(config-net)# handover power budget interval ? + <1-99> Check for stronger neighbor every N number of SACCH frames + default Use default (6), remove explicit setting on this node + +OsmoBSC(config-net)# handover power budget hysteresis ? + <0-999> Neighbor's strength difference in dBm + default Use default (3), remove explicit setting on this node + +OsmoBSC(config-net)# handover maximum ? + distance Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net)# handover maximum distance ? + <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO + default Use default (9999), remove explicit setting on this node + + +OsmoBSC(config-net)# ### Same on BTS level +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover? + handover Handover options + +OsmoBSC(config-net-bts)# handover ? + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net-bts)# handover window ? + rxlev Received-Level averaging + rxqual Received-Quality averaging + +OsmoBSC(config-net-bts)# handover window rxlev ? + averaging How many RxLev measurements are used for averaging + neighbor How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxlev averaging ? + <1-10> RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover window rxlev neighbor ? + averaging How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxlev neighbor averaging ? + <1-10> Neighbor RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover window rxqual ? + averaging How many RxQual measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxqual averaging ? + <1-10> RxQual averaging: Number of values to average over + default Use default (1), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover power ? + budget Neighbor cell power triggering + +OsmoBSC(config-net-bts)# handover power budget ? + interval How often to check for a better cell (SACCH frames) + hysteresis How many dBm stronger must a neighbor be to become a HO candidate + +OsmoBSC(config-net-bts)# handover power budget interval ? + <1-99> Check for stronger neighbor every N number of SACCH frames + default Use default (6), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover power budget hysteresis ? + <0-999> Neighbor's strength difference in dBm + default Use default (3), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover maximum ? + distance Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net-bts)# handover maximum distance ? + <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO + default Use default (9999), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc 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 Fri Jan 19 13:24:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:24:39 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Assign SDCCH on channel request In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5898 to look at the new patch set (#2). HO: Assign SDCCH on channel request This is needed, so channel can be negotiated before the actual channel type is assigned. In case there is no SDCCH available, try to assign what ever the MS requested. If this is not possible try to assign TCH/F. If this is still not possible, reject channel request. Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 --- M src/libbsc/abis_rsl.c 1 file changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/98/5898/2 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 980b3e6..64e5c92 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1890,8 +1890,26 @@ */ is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); - /* check availability / allocate channel */ - lchan = lchan_alloc(bts, lctype, is_lu); + /* check availability / allocate channel + * + * - First try to allocate SDCCH. + * - If SDCCH is not available, try whatever MS requested, if not SDCCH. + * - If there is still no channel available, reject channel request. + * + * lchan_alloc() possibly tries to allocate larger lchans. + * + * Note: If the MS requests not TCH/H, we don't know if the phone + * supports TCH/H, so we must assign TCH/F or SDCCH. + */ + lchan = lchan_alloc(bts, GSM_LCHAN_SDCCH, 0); + if (!lchan && lctype != GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(lctype)); + lchan = lchan_alloc(bts, lctype, 0); + } if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); -- To view, visit https://gerrit.osmocom.org/5898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:24:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:24:39 +0000 Subject: [PATCH] osmo-bsc[master]: Do not perform assignment, if the new channel equals the cur... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5908 to look at the new patch set (#2). Do not perform assignment, if the new channel equals the current one This can happen, if a TCH/H was requested, but because it is not available, a TCH/F is allocated. If the old channel was TCH/F already, it makes no sense to assign it. Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae --- M src/libbsc/bsc_api.c 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/08/5908/2 diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index ec64bb8..714fc11 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -210,7 +210,7 @@ static int handle_new_assignment(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate) { struct gsm_lchan *new_lchan; - int chan_type; + enum gsm_chan_t chan_type; chan_type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H; @@ -221,6 +221,17 @@ return -1; } + /* check if we are on TCH/F and requested TCH/H, but got TCH/F */ + if (conn->lchan->type == new_lchan->type + && chan_type != new_lchan->type) { + LOGP(DHO, LOGL_NOTICE, "%s -> %s Will not re-assign to identical channel type," + " %s was requested\n", + gsm_lchan_name(conn->lchan), gsm_lchan_name(new_lchan), + gsm_lchant_name(chan_type)); + lchan_free(new_lchan); + return -1; + } + /* copy old data to the new channel */ memcpy(&new_lchan->encr, &conn->lchan->encr, sizeof(new_lchan->encr)); new_lchan->ms_power = conn->lchan->ms_power; -- To view, visit https://gerrit.osmocom.org/5908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:24:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:24:39 +0000 Subject: [PATCH] osmo-bsc[master]: HO: add handover algo 2 parameters; skip HO 1 if HO 2 is con... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5914 to look at the new patch set (#3). HO: add handover algo 2 parameters; skip HO 1 if HO 2 is configured Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 --- M include/osmocom/bsc/handover_cfg.h M src/libbsc/handover_decision.c M tests/handover_cfg.vty 3 files changed, 336 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/14/5914/3 diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 95c0e50..63a393e 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -1,6 +1,7 @@ #pragma once #include +#include struct vty; @@ -17,6 +18,11 @@ #define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" #define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" #define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" +#define HO_CFG_STR_2 " (HO algo 2 only)\n" +#define HO_CFG_STR_MIN "Minimum Level/Quality thresholds before triggering HO" HO_CFG_STR_2 +#define HO_CFG_STR_AFS_BIAS "Configure bias to prefer AFS (AMR on TCH/F) over other codecs" HO_CFG_STR_2 +#define HO_CFG_STR_MIN_TCH "Minimum free TCH timeslots before cell is considered congested" HO_CFG_STR_2 +#define HO_CFG_STR_PENALTY_TIME "Set penalty times to wait between repeated handovers" HO_CFG_STR_2 #define as_is(x) (x) @@ -30,6 +36,17 @@ return arg? 1 : 0; } +static inline bool a2tdma(const char *arg) +{ + if (!strcmp(arg, "full")) + return true; + return false; +} + +static inline const char *tdma2a(bool val) +{ + return val? "full" : "subset"; +} /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, * function declarations or definitions... It is of the format @@ -59,6 +76,15 @@ "Disable in-call handover\n" \ "Enable in-call handover\n" \ "Enable/disable handover: ") \ + \ + HO_CFG_ONE_MEMBER(int, algorithm, 1, \ + "handover algorithm", "1|2", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Choose algorithm for handover decision\n" \ + "Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual," \ + " only.\n" \ + "Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several" \ + " cells. Consider available codecs. Prevent repeated handover by penalty timers.\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ @@ -97,6 +123,95 @@ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ + \ + HO_CFG_ONE_MEMBER(bool, as_active, 0, \ + "handover assignment", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ + "Disable in-call assignment\n" \ + "Enable in-call assignment\n") \ + \ + HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ + "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ + HO_CFG_STR_HANDOVER \ + "Define measurement set of TDMA frames" HO_CFG_STR_2 \ + "Full set of 102/104 TDMA frames\n" \ + "Sub set of 4 TDMA frames (SACCH)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxlev, -100, \ + "handover min rxlev", "<-110--50>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How weak may RxLev of an MS become before triggering HO\n" \ + "minimum RxLev (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxqual, 5, \ + "handover min rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How bad may RxQual of an MS become before triggering HO\n" \ + "minimum RxQual (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxlev, 0, \ + "handover afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxLev improvement bias for AFS over other codecs\n" \ + "Virtual RxLev improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxqual, 0, \ + "handover afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxQual improvement bias for AFS over other codecs\n" \ + "Virtual RxQual improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchf_min_slots, 0, \ + "handover min-free-slots tch/f", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/F timeslots before cell is considered congested\n" \ + "Number of TCH/F slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchh_min_slots, 0, \ + "handover min-free-slots tch/h", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/H timeslots before cell is considered congested\n" \ + "Number of TCH/H slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, ho_max, 9999, \ + "handover max-handovers", "<1-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum number of concurrent handovers allowed per cell" HO_CFG_STR_2 \ + "Number\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_max_dist, 300, \ + "handover penalty-time max-distance", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after leaving this cell due to exceeding max distance\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_ho, 60, \ + "handover penalty-time failed-ho", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after handover failure to this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_as, 60, \ + "handover penalty-time failed-assignment", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after assignment failure in this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, retries, 0, \ + "handover retries", "<0-9>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Immediately retry on handover/assignment failure" HO_CFG_STR_2 \ + "Number of retries\n") \ /* Declare public API for handover cfg parameters... */ diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 158fc1c..1e2e0d9 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -265,6 +265,10 @@ int av_rxlev; unsigned int pwr_interval; + /* If this cell does not use handover algorithm 1, then we're not responsible. */ + if (ho_get_algorithm(bts->ho) != 1) + return 0; + /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { case GSM_LCHAN_TCH_F: diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index e181797..ff67c8f 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -143,30 +143,73 @@ handover power budget interval 23 ... !handover +OsmoBSC(config-net-bts)# ### Verify that 'min rxlev' value range stops at -50 +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node +OsmoBSC(config-net-bts)# handover min rxlev -111 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev -110 +OsmoBSC(config-net-bts)# handover min rxlev -50 +OsmoBSC(config-net-bts)# handover min rxlev -49 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev 50 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev default +% 'handover min rxlev' setting removed, now is -100 + OsmoBSC(config-net-bts)# ### Checking online help OsmoBSC(config-net-bts)# exit OsmoBSC(config-net)# list ... handover (0|1|default) + handover algorithm (1|2|default) handover window rxlev averaging (<1-10>|default) handover window rxqual averaging (<1-10>|default) handover window rxlev neighbor averaging (<1-10>|default) handover power budget interval (<1-99>|default) handover power budget hysteresis (<0-999>|default) handover maximum distance (<0-9999>|default) + handover assignment (0|1|default) + handover tdma-measurement (full|subset|default) + handover min rxlev (<-110--50>|default) + handover min rxqual (<0-7>|default) + handover afs-bias rxlev (<0-20>|default) + handover afs-bias rxqual (<0-7>|default) + handover min-free-slots tch/f (<0-9999>|default) + handover min-free-slots tch/h (<0-9999>|default) + handover max-handovers (<1-9999>|default) + handover penalty-time max-distance (<0-99999>|default) + handover penalty-time failed-ho (<0-99999>|default) + handover penalty-time failed-assignment (<0-99999>|default) + handover retries (<0-9>|default) ... OsmoBSC(config-net)# handover? handover Handover options OsmoBSC(config-net)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net)# handover window ? rxlev Received-Level averaging @@ -216,6 +259,80 @@ <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node +OsmoBSC(config-net)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node + OsmoBSC(config-net)# ### Same on BTS level OsmoBSC(config-net)# bts 0 @@ -223,12 +340,26 @@ handover Handover options OsmoBSC(config-net-bts)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net-bts)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net-bts)# handover window ? rxlev Received-Level averaging @@ -277,3 +408,77 @@ OsmoBSC(config-net-bts)# handover maximum distance ? <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net-bts)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net-bts)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net-bts)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net-bts)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:24:39 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:24:39 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5921 to look at the new patch set (#5). HO: Implement load based handover, as handover_decision_2.c Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 --- M configure.ac M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M include/osmocom/bsc/handover.h M include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_decision_2.h M include/osmocom/bsc/handover_vty.h M include/osmocom/bsc/signal.h M src/libbsc/Makefile.am M src/libbsc/abis_rsl.c M src/libbsc/bsc_api.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c A src/libbsc/handover_decision_2.c M src/libbsc/handover_logic.c M src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/gsm_data.c M src/libcommon/handover_cfg.c M src/osmo-bsc/osmo_bsc_bssap.c M src/osmo-bsc/osmo_bsc_main.c M tests/Makefile.am A tests/handover/Makefile.am A tests/handover/handover_test.c A tests/handover/handover_test.ok M tests/handover_cfg.vty M tests/testsuite.at 28 files changed, 3,867 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/21/5921/5 diff --git a/configure.ac b/configure.ac index d756970..fc4678f 100644 --- a/configure.ac +++ b/configure.ac @@ -166,6 +166,7 @@ tests/subscr/Makefile tests/nanobts_omlattr/Makefile tests/bssap/Makefile + tests/handover/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index 699aeb3..a3d9adf 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -27,6 +27,7 @@ handover.h \ handover_cfg.h \ handover_decision.h \ + handover_decision_2.h \ handover_vty.h \ ipaccess.h \ meas_feed.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..c24e22a 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -10,6 +10,7 @@ #include #include #include +#include #include @@ -74,8 +75,8 @@ /* penalty timers for handover */ struct ho_penalty_timer { struct llist_head entry; - uint8_t bts; - time_t timeout; + uint8_t bts_nr; + unsigned int timeout; }; /* active radio connection of a mobile subscriber */ @@ -112,8 +113,18 @@ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; - /* penalty timers for handover */ + /* failure count and penalty timers for handover */ + int ho_failure; struct llist_head ho_penalty_timers; + + /* "Codec List (MSC Preferred)" as received by the BSSAP Assignment Request. 3GPP 48.008 + * 3.2.2.103 says: + * The "Codec List (MSC Preferred)" shall not include codecs + * that are not supported by the MS. + * i.e. by heeding the "Codec list (MSC Preferred)", we inherently heed the MS bearer + * capabilities, which the MSC is required to translate into the codec list. */ + struct gsm0808_speech_codec_list codec_list; + bool codec_list_present; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { @@ -243,7 +254,12 @@ uint16_t network_code; int a5_encryption; int neci; + struct handover_cfg *ho; + struct { + unsigned int congestion_check_interval_s; + struct osmo_timer_list congestion_check_timer; + } ho2; struct rate_ctr_group *bsc_ctrs; @@ -443,4 +459,11 @@ bool classmark_is_r99(struct gsm_classmark *cm); +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout); +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts); + #endif /* _GSM_DATA_H */ diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 86c5ca9..776e047 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -269,6 +269,7 @@ struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; + uint8_t meas_rep_last_seen_nr; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index a9349ee..f764456 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -5,6 +5,8 @@ struct gsm_subscriber_connection; int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *bts, + enum gsm_chan_t new_lchan_type); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 63a393e..8868d09 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -10,6 +10,8 @@ * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ struct handover_cfg; +#define HO_CFG_CONGESTION_CHECK_DEFAULT 10 + struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); #define HO_CFG_STR_HANDOVER "Handover options\n" diff --git a/include/osmocom/bsc/handover_decision_2.h b/include/osmocom/bsc/handover_decision_2.h new file mode 100644 index 0000000..f245b07 --- /dev/null +++ b/include/osmocom/bsc/handover_decision_2.h @@ -0,0 +1,9 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC */ + +#pragma once +struct gsm_bts; + +void hodec2_init(struct gsm_network *net); + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval); +void hodec2_congestion_check(struct gsm_network *net); diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h index 48af136..6ad5276 100644 --- a/include/osmocom/bsc/handover_vty.h +++ b/include/osmocom/bsc/handover_vty.h @@ -4,4 +4,5 @@ #include void ho_vty_init(); -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); +void ho_vty_write_net(struct vty *vty, struct gsm_network *net); +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts); diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 9c0d5a3..1c8b51e 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -104,6 +104,7 @@ enum signal_global { S_GLOBAL_BTS_CLOSE_OM, + S_GLOBAL_BTS_NEW, }; /* SS_RF signals */ diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index d118f44..7e088e5 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -58,5 +58,6 @@ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ handover_vty.c \ + handover_decision_2.c \ $(NULL) diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index b54fab8..998f3a6 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1523,8 +1523,9 @@ } mr->lchan->meas_rep_count++; - LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", - gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + mr->lchan->meas_rep_last_seen_nr = mr->nr; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_count++=%d meas_rep_last_seen_nr=%u\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count, mr->lchan->meas_rep_last_seen_nr); print_meas_rep(msg->lchan, mr); diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 27bf739..33aef3f 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -327,8 +327,6 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { - struct ho_penalty_timer *penalty; - if (!conn) return; @@ -353,12 +351,7 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); - /* flush handover penalty timers */ - while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, - struct ho_penalty_timer, entry))) { - llist_del(&penalty->entry); - talloc_free(penalty); - } + conn_penalty_timer_clear(conn, NULL); llist_del(&conn->entry); talloc_free(conn); @@ -676,8 +669,8 @@ struct lchan_signal_data sig; struct gsm48_hdr *gh = msgb_l3(msg); - DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", - rr_cause_name(gh->data[0])); + DEBUGP(DRR, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); + DEBUGP(DHO, "HANDOVER FAILED cause = %s\n", rr_cause_name(gh->data[0])); sig.lchan = msg->lchan; sig.mr = NULL; diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index a304e86..d4591b7 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -795,7 +795,7 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); - ho_vty_write(vty, " ", bts->ho); + ho_vty_write_bts(vty, bts); config_write_bts_model(vty, bts); } @@ -827,7 +827,7 @@ vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - ho_vty_write(vty, " ", gsmnet->ho); + ho_vty_write_net(vty, gsmnet); VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index b3056da..9e83f27 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -414,6 +414,7 @@ /* reset measurement report counter and index */ lchan->meas_rep_count = 0; lchan->meas_rep_idx = 0; + lchan->meas_rep_last_seen_nr = 255; /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/handover_decision_2.c b/src/libbsc/handover_decision_2.c new file mode 100644 index 0000000..2286147 --- /dev/null +++ b/src/libbsc/handover_decision_2.c @@ -0,0 +1,1761 @@ +/* Handover Decision Algorithm 2 for intra-BSC (inter-BTS) handover, public API for OsmoBSC. */ + +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * Author: Andreas Eversberg + * Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define LOGPHOBTS(bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u) " fmt, bts->nr, ## args) + +#define LOGPHOLCHAN(lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHOLCHANTOBTS(lchan, new_bts, level, fmt, args...) \ + LOGP(DHODEC, level, "(lchan %u.%u%u%u %s)->(BTS %u) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_bts->nr, \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define REQUIREMENT_A_TCHF 0x01 +#define REQUIREMENT_B_TCHF 0x02 +#define REQUIREMENT_C_TCHF 0x04 +#define REQUIREMENT_A_TCHH 0x10 +#define REQUIREMENT_B_TCHH 0x20 +#define REQUIREMENT_C_TCHH 0x40 +#define REQUIREMENT_TCHF_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_B_TCHF | REQUIREMENT_C_TCHF) +#define REQUIREMENT_TCHH_MASK (REQUIREMENT_A_TCHH | REQUIREMENT_B_TCHH | REQUIREMENT_C_TCHH) +#define REQUIREMENT_A_MASK (REQUIREMENT_A_TCHF | REQUIREMENT_A_TCHH) +#define REQUIREMENT_B_MASK (REQUIREMENT_B_TCHF | REQUIREMENT_B_TCHH) +#define REQUIREMENT_C_MASK (REQUIREMENT_C_TCHF | REQUIREMENT_C_TCHH) + +struct ho_candidate { + struct gsm_lchan *lchan; /* candidate for whom */ + struct gsm_bts *bts; /* target BTS */ + uint8_t requirements; /* what is fulfilled */ + int avg; /* average RX level */ +}; + +enum ho_reason { + HO_REASON_INTERFERENCE, + HO_REASON_BAD_QUALITY, + HO_REASON_LOW_RXLEVEL, + HO_REASON_MAX_DISTANCE, + HO_REASON_BETTER_CELL, + HO_REASON_CONGESTION, +}; + +static const struct value_string ho_reason_names[] = { + { HO_REASON_INTERFERENCE, "interference (bad quality)" }, + { HO_REASON_BAD_QUALITY, "bad quality" }, + { HO_REASON_LOW_RXLEVEL, "low rxlevel" }, + { HO_REASON_MAX_DISTANCE, "maximum allowed distance" }, + { HO_REASON_BETTER_CELL, "better cell" }, + { HO_REASON_CONGESTION, "congestion" }, + {0, NULL} +}; + +static const char *ho_reason_name(int value) +{ + return get_value_string(ho_reason_names, value); +} + + +static bool ho2_initialized = false; +static enum ho_reason global_ho_reason; + +static void congestion_check_cb(void *arg); + +/* This function gets called on ho2 init, whenever the congestion check interval is changed, and also + * when the timer has fired to trigger again after the next congestion check timeout. */ +static void reinit_congestion_timer(struct gsm_network *net) +{ + int congestion_check_interval_s; + bool was_active; + + /* Don't setup timers from VTY config parsing before the main program has actually initialized + * the data structures. */ + if (!ho2_initialized) + return; + + was_active = net->ho2.congestion_check_timer.active; + if (was_active) + osmo_timer_del(&net->ho2.congestion_check_timer); + + congestion_check_interval_s = net->ho2.congestion_check_interval_s; + if (congestion_check_interval_s < 1) { + if (was_active) + LOGP(DHODEC, LOGL_NOTICE, "HO algorithm 2: Disabling congestion check\n"); + return; + } + + LOGP(DHODEC, LOGL_DEBUG, "HO algorithm 2: next periodical congestion check in %u seconds\n", + congestion_check_interval_s); + + osmo_timer_setup(&net->ho2.congestion_check_timer, + congestion_check_cb, net); + osmo_timer_schedule(&net->ho2.congestion_check_timer, + congestion_check_interval_s, 0); +} + +void hodec2_on_change_congestion_check_interval(struct gsm_network *net, unsigned int new_interval) +{ + net->ho2.congestion_check_interval_s = new_interval; + reinit_congestion_timer(net); +} + +/* did we get a RXLEV for a given cell in the given report? Mark matches as MRC_F_PROCESSED. */ +static struct gsm_meas_rep_cell *cell_in_rep(struct gsm_meas_rep *mr, uint16_t arfcn, uint8_t bsic) +{ + int i; + + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + + if (mrc->arfcn != arfcn) + continue; + if (mrc->bsic != bsic) + continue; + + return mrc; + } + return NULL; +} + +/* obtain averaged rxlev for given neighbor */ +static int neigh_meas_avg(struct neigh_meas_proc *nmp, int window) +{ + unsigned int i, idx; + int avg = 0; + + /* reduce window to the actual number of existing measurements */ + if (window > nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window <= 0) + return 0; + + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), + nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), + window); + + for (i = 0; i < window; i++) { + int j = (idx+i) % ARRAY_SIZE(nmp->rxlev); + + avg += nmp->rxlev[j]; + } + + return avg / window; +} + +/* Find empty slot or the worst neighbor. */ +static struct neigh_meas_proc *find_unused_or_worst_neigh(struct gsm_lchan *lchan) +{ + struct neigh_meas_proc *nmp_worst = NULL; + int worst; + int j; + + /* First try to find an empty/unused slot. */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + if (!nmp->arfcn) + return nmp; + } + + /* No empty slot found. Return worst neighbor to be evicted. */ + worst = 0; /* (overwritten on first loop, but avoid compiler warning) */ + for (j = 0; j < ARRAY_SIZE(lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &lchan->neigh_meas[j]; + int avg = neigh_meas_avg(nmp, MAX_WIN_NEIGH_AVG); + if (nmp_worst && avg >= worst) + continue; + worst = avg; + nmp_worst = nmp; + } + + return nmp_worst; +} + +/* process neighbor cell measurement reports */ +static void process_meas_neigh(struct gsm_meas_rep *mr) +{ + int i, j, idx; + + /* for each reported cell, try to update global state */ + for (j = 0; j < ARRAY_SIZE(mr->lchan->neigh_meas); j++) { + struct neigh_meas_proc *nmp = &mr->lchan->neigh_meas[j]; + unsigned int idx; + struct gsm_meas_rep_cell *mrc; + + /* skip unused entries */ + if (!nmp->arfcn) + continue; + + mrc = cell_in_rep(mr, nmp->arfcn, nmp->bsic); + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + if (mrc) { + nmp->rxlev[idx] = mrc->rxlev; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + mrc->flags |= MRC_F_PROCESSED; + } else { + nmp->rxlev[idx] = 0; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u not in report (last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr); + } + nmp->rxlev_cnt++; + } + + /* iterate over list of reported cells, check if we did not + * process all of them */ + for (i = 0; i < mr->num_cell; i++) { + struct gsm_meas_rep_cell *mrc = &mr->cell[i]; + struct neigh_meas_proc *nmp; + + if (mrc->flags & MRC_F_PROCESSED) + continue; + + nmp = find_unused_or_worst_neigh(mr->lchan); + + nmp->arfcn = mrc->arfcn; + nmp->bsic = mrc->bsic; + + nmp->rxlev_cnt = 0; + idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); + nmp->rxlev[idx] = mrc->rxlev; + nmp->rxlev_cnt++; + nmp->last_seen_nr = mr->nr; + LOGPHOLCHAN(mr->lchan, LOGL_DEBUG, "neigh %u new in report rxlev=%d last_seen_nr=%u\n", + nmp->arfcn, mrc->rxlev, nmp->last_seen_nr); + + mrc->flags |= MRC_F_PROCESSED; + } +} + +static bool codec_type_is_supported(struct gsm_subscriber_connection *conn, + enum gsm0808_speech_codec_type type) +{ + int i; + struct gsm0808_speech_codec_list *clist = &conn->codec_list; + + if (!conn->codec_list_present) { + /* We don't have a list of supported codecs. This should never happen. */ + LOGPHOLCHAN(conn->lchan, LOGL_ERROR, + "No Speech Codec List present, accepting all codecs\n"); + return true; + } + + for (i = 0; i < clist->len; i++) { + if (clist->codec[i].type == type) { + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "%s supported\n", + gsm0808_speech_codec_type_name(type)); + return true; + } + } + LOGPHOLCHAN(conn->lchan, LOGL_DEBUG, "Codec not supported by MS or not allowed by MSC: %s\n", + gsm0808_speech_codec_type_name(type)); + return false; +} + +/* + * Check what requirements the given cell fulfills. + * A bit mask of fulfilled requirements is returned. + * + * Target cell requirement A -- ability to service the call + * + * In order to successfully handover/assign to a better cell, the target cell + * must be able to continue the current call. Therefore the cell must fulfill + * the following criteria: + * + * * The handover must be enabled for the target cell, if it differs from the + * originating cell. + * * The assignment must be enabled for the cell, if it equals the current + * cell. + * * The handover penalty timer must not run for the cell. + * * If FR, EFR or HR codec is used, the cell must support this codec. + * * If FR or EFR codec is used, the cell must have a TCH/F slot type + * available. + * * If HR codec is used, the cell must have a TCH/H slot type available. + * * If AMR codec is used, the cell must have a TCH/F slot available, if AFS + * is supported by mobile and BTS. + * * If AMR codec is used, the cell must have a TCH/H slot available, if AHS + * is supported by mobile and BTS. + * * osmo-nitb with built-in MNCC application: + * o If AMR codec is used, the cell must support AMR codec with equal codec + * rate or rates. (not meaning TCH types) + * * If defined, the number of maximum unsynchronized handovers to this cell + * may not be exceeded. (This limits processing load for random access + * bursts.) + * + * + * Target cell requirement B -- avoid congestion + * + * In order to prevent congestion of a target cell, the cell must fulfill the + * requirement A, but also: + * + * * The minimum free channels, that are defined for that cell must be + * maintained after handover/assignment. + * * The minimum free channels are defined for TCH/F and TCH/H slot types + * individually. + * + * + * Target cell requirement C -- balance congestion + * + * In order to balance congested cells, the target cell must fulfill the + * requirement A, but also: + * + * * The target cell (which is congested also) must have more or equal free + * slots after handover/assignment. + * * The number of free slots are checked for TCH/F and TCH/H slot types + * individually. + */ +static uint8_t check_requirements(struct gsm_lchan *lchan, struct gsm_bts *bts, int tchf_count, int tchh_count) +{ + int count; + uint8_t requirement = 0; + unsigned int penalty_time; + struct gsm_bts *current_bts = lchan->ts->trx->bts; + + /* Requirement A */ + + /* the handover/assignment must not be disabled */ + if (current_bts == bts) { + if (!ho_get_as_active(bts->ho)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Assignment disabled\n"); + return 0; + } + } else { + if (!ho_get_ho_active(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, handover is disabled in target BTS\n"); + return 0; + } + } + + /* the handover penalty timer must not run for this bts */ + penalty_time = conn_penalty_timer_remaining(lchan->conn, bts); + if (penalty_time) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, target BTS still in penalty time" + " (%u seconds left)\n", penalty_time); + return 0; + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s'\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + + /* compatibility check for codecs. + * if so, the candidates for full rate and half rate are selected */ + switch (lchan->tch_mode) { + case GSM48_CMODE_SPEECH_V1: + switch (lchan->type) { + case GSM_LCHAN_TCH_F: /* mandatory */ + requirement |= REQUIREMENT_A_TCHF; + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "tch_mode='%s' type='%s' supported\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + case GSM_LCHAN_TCH_H: + if (!bts->codec.hr) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "tch_mode='%s' type='%s' not supported\n", + get_value_string(gsm48_chan_mode_names, + lchan->tch_mode), + gsm_lchant_name(lchan->type)); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR1)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHAN(lchan, LOGL_ERROR, "Unexpected channel type: neither TCH/F nor TCH/H for %s\n", + get_value_string(gsm48_chan_mode_names, lchan->tch_mode)); + return 0; + } + break; + case GSM48_CMODE_SPEECH_EFR: + if (!bts->codec.efr) { + LOGPHOBTS(bts, LOGL_DEBUG, "EFR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR2)) + requirement |= REQUIREMENT_A_TCHF; + break; + case GSM48_CMODE_SPEECH_AMR: + if (!bts->codec.amr) { + LOGPHOBTS(bts, LOGL_DEBUG, "AMR not supported\n"); + break; + } + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_FR3)) + requirement |= REQUIREMENT_A_TCHF; + if (codec_type_is_supported(lchan->conn, GSM0808_SCT_HR3)) + requirement |= REQUIREMENT_A_TCHH; + break; + default: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "Not even considering: src is not a SPEECH mode lchan\n"); + return 0; + } + + /* no candidate, because new cell is incompatible */ + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because codec of MS and BTS are incompatible\n"); + return 0; + } + + /* remove slot types that are not available */ + if (!tchf_count && requirement & REQUIREMENT_A_TCHF) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, since all TCH/F lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + } + if (!tchh_count && requirement & REQUIREMENT_A_TCHH) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, since all TCH/H lchans are in use\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "not a candidate, because no suitable slots available\n"); + return 0; + } + + /* omit same channel type on same BTS (will not change anything) */ + if (bts == current_bts) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/F, already on TCH/F in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHF); + break; + case GSM_LCHAN_TCH_H: + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "removing TCH/H, already on TCH/H in this cell\n"); + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "Reassignment within cell not an option, no differing channel types available\n"); + return 0; + } + } + +#ifdef LEGACY + // This was useful in osmo-nitb. We're in osmo-bsc now and have no idea whether the osmo-msc does + // internal or external call control. Maybe a future config switch wants to add this behavior? + /* Built-in call control requires equal codec rates. Remove rates that are not equal. */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && current_bts->network->mncc_recv != mncc_sock_from_cc) { + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_full, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_full, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + case GSM_LCHAN_TCH_H: + if ((requirement & REQUIREMENT_A_TCHF) + && !!memcmp(¤t_bts->mr_half, &bts->mr_full, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHF); + if ((requirement & REQUIREMENT_A_TCHH) + && !!memcmp(¤t_bts->mr_half, &bts->mr_half, + sizeof(struct amr_multirate_conf))) + requirement &= ~(REQUIREMENT_A_TCHH); + break; + default: + break; + } + + if (!requirement) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, cannot provide identical codec rate\n"); + return 0; + } + } +#endif + + /* the maximum number of unsynchonized handovers must no be exceeded */ + if (current_bts != bts + && bsc_ho_count(bts, true) >= ho_get_ho_max(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "not a candidate, number of allowed handovers (%d) would be exceeded\n", + ho_get_ho_max(bts->ho)); + return 0; + } + + /* Requirement B */ + + /* the minimum free timeslots that are defined for this cell must + * be maintained _after_ handover/assignment */ + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= ho_get_tchf_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be congested after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= ho_get_tchh_min_slots(bts->ho)) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be congested after HO\n"); + requirement |= REQUIREMENT_B_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be congested after HO\n"); + } + } + + /* Requirement C */ + + /* the nr of free timeslots of the target cell must be >= the + * free slots of the current cell _after_ handover/assignment */ + count = bts_count_free_ts(current_bts, + (lchan->type == GSM_LCHAN_TCH_H) ? + GSM_PCHAN_TCH_H : GSM_PCHAN_TCH_F); + if (requirement & REQUIREMENT_A_TCHF) { + if (tchf_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHF; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/F would not be less congested in target than source cell after HO\n"); + } + } + if (requirement & REQUIREMENT_A_TCHH) { + if (tchh_count - 1 >= count + 1) { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would be less congested in target than source cell after HO\n"); + requirement |= REQUIREMENT_C_TCHH; + } else { + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, + "TCH/H would not be less congested in target than source cell after HO\n"); + } + } + + LOGPHOLCHANTOBTS(lchan, bts, LOGL_DEBUG, "requirements=0x%x\n", requirement); + + /* return mask of fulfilled requirements */ + return requirement; +} + +/* Trigger handover or assignment depending on the target BTS */ +static int trigger_handover_or_assignment(struct gsm_lchan *lchan, struct gsm_bts *new_bts, uint8_t requirements) +{ + struct gsm_bts *current_bts = lchan->ts->trx->bts; + int afs_bias = 0; + bool full_rate = false; + + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering Assignment\n"); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, "Triggering Handover\n"); + + /* afs_bias becomes > 0, if AFS is used and is improved */ + if (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + afs_bias = ho_get_afs_bias_rxlev(new_bts->ho); + + /* select TCH rate, prefer TCH/F if AFS is improved */ + switch (lchan->type) { + case GSM_LCHAN_TCH_F: + /* keep on full rate, if TCH/F is a candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK)) { + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + full_rate = true; + break; + } + /* change to half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + break; + case GSM_LCHAN_TCH_H: + /* change to full rate if AFS is improved and a candidate */ + if (afs_bias > 0 && (requirements & REQUIREMENT_TCHF_MASK)) { + full_rate = true; + LOGPHOLCHAN(lchan, LOGL_DEBUG, "[Improve AHS->AFS]\n"); + break; + } + /* change to full rate if the only candidate */ + if ((requirements & REQUIREMENT_TCHF_MASK) + && !(requirements & REQUIREMENT_TCHH_MASK)) { + full_rate = true; + break; + } + /* keep on half rate */ + if (!(requirements & REQUIREMENT_TCHH_MASK)) { + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, + "neither TCH/F nor TCH/H requested, aborting ho/as\n"); + return -EINVAL; + } + if (current_bts == new_bts) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Not performing assignment: Already on target type\n"); + return 0; + } + break; + default: + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_ERROR, "lchan is neither TCH/F nor TCH/H, aborting ho/as\n"); + return -EINVAL; + } + + /* trigger handover or assignment */ + if (current_bts == new_bts) + LOGPHOLCHAN(lchan, LOGL_NOTICE, "Triggering assignment to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + else + LOGPHOLCHANTOBTS(lchan, new_bts, LOGL_NOTICE, + "Triggering handover to %s, due to %s\n", + full_rate ? "TCH/F" : "TCH/H", + ho_reason_name(global_ho_reason)); + + return bsc_handover_start_lchan_change(lchan, current_bts == new_bts? NULL : new_bts, + full_rate? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H); +} + +/* debug collected candidates */ +static inline void debug_candidate(struct ho_candidate *candidate, + int neighbor, int8_t rxlev, int tchf_count, int tchh_count) +{ + if (neighbor) + LOGP(DHODEC, LOGL_DEBUG, " - neighbor BTS %d, RX level " + "%d -> %d\n", candidate->bts->nr, rxlev2dbm(rxlev), + rxlev2dbm(candidate->avg)); + else + LOGP(DHODEC, LOGL_DEBUG, " - current BTS %d, RX level %d\n", + candidate->bts->nr, rxlev2dbm(candidate->avg)); + + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/F slots %d, minimum required " + "%d\n", tchf_count, ho_get_tchf_min_slots(candidate->bts->ho)); + LOGP(DHODEC, LOGL_DEBUG, " o free TCH/H slots %d, minimum required " + "%d\n", tchh_count, ho_get_tchh_min_slots(candidate->bts->ho)); + + if ((candidate->requirements & REQUIREMENT_TCHF_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHF)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHF"); + if (!(candidate->requirements & REQUIREMENT_TCHF_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHF_MASK) + == REQUIREMENT_A_TCHF) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHF)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); + + if ((candidate->requirements & REQUIREMENT_TCHH_MASK)) + LOGP(DHODEC, LOGL_DEBUG, " o requirement "); + else + LOGP(DHODEC, LOGL_DEBUG, " o no requirement "); + if ((candidate->requirements & REQUIREMENT_A_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "A "); + if ((candidate->requirements & REQUIREMENT_B_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "B "); + if ((candidate->requirements & REQUIREMENT_C_TCHH)) + LOGPC(DHODEC, LOGL_DEBUG, "C "); + LOGPC(DHODEC, LOGL_DEBUG, "fulfilled for TCHH"); + if (!(candidate->requirements & REQUIREMENT_TCHH_MASK)) /* nothing */ + LOGPC(DHODEC, LOGL_DEBUG, " (no %s possible)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_TCHH_MASK) + == REQUIREMENT_A_TCHH) /* only A */ + LOGPC(DHODEC, LOGL_DEBUG, " (more congestion after %s)\n", + (neighbor) ? "handover" : "assignment"); + else if ((candidate->requirements & REQUIREMENT_B_TCHH)) /* B incl. */ + LOGPC(DHODEC, LOGL_DEBUG, " (not congested after %s)\n", + (neighbor) ? "handover" : "assignment"); + else /* so it must include C */ + LOGPC(DHODEC, LOGL_DEBUG, " (less or equally congested after " + "%s)\n", (neighbor) ? "handover" : "assignment"); +} + +/* add candidate for re-assignment within the current cell */ +static void collect_assignment_candidate(struct gsm_lchan *lchan, struct ho_candidate *clist, + unsigned int *candidates, int av_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct ho_candidate *c; + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = bts; + c->requirements = check_requirements(lchan, bts, tchf_count, tchh_count); + c->avg = av_rxlev; + debug_candidate(c, 0, 0, tchf_count, tchh_count); + (*candidates)++; +} + +/* add candidates for handover to all neighbor cells */ +static void collect_handover_candidate(struct gsm_lchan *lchan, struct neigh_meas_proc *nmp, + struct ho_candidate *clist, unsigned int *candidates, + bool include_weaker_rxlev, int av_rxlev, + int *neighbors_count) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int tchf_count, tchh_count; + struct gsm_bts *neighbor_bts; + int avg; + struct ho_candidate *c; + int min_rxlev; + + /* skip empty slots */ + if (nmp->arfcn == 0) + return; + + if (neighbors_count) + (*neighbors_count)++; + + /* skip if measurement report is old */ + if (nmp->last_seen_nr != lchan->meas_rep_last_seen_nr) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "neighbor ARFCN %u measurement report is old" + " (nmp->last_seen_nr=%u lchan->meas_rep_last_seen_nr=%u)\n", + nmp->arfcn, nmp->last_seen_nr, lchan->meas_rep_last_seen_nr); + return; + } + + neighbor_bts = bts_by_arfcn_bsic(bts->network, nmp->arfcn, nmp->bsic); + if (!neighbor_bts) { + LOGPHOBTS(bts, LOGL_DEBUG, "neighbor ARFCN %u does not belong to this network\n", + nmp->arfcn); + return; + } + + /* in case we have measurements of our bts, due to misconfiguration */ + if (neighbor_bts == bts) { + LOGPHOBTS(bts, LOGL_ERROR, "Configuration error: this BTS appears as its own neighbor\n"); + return; + } + + /* caculate average rxlev for this cell over the window */ + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); + + /* Heed rxlev hysteresis only if the RXLEV/RXQUAL/TA levels of the MS aren't critically bad and + * we're just looking for an improvement. If levels are critical, we desperately need a handover + * and thus skip the hysteresis check. */ + if (!include_weaker_rxlev) { + unsigned int pwr_hyst = ho_get_pwr_hysteresis(bts->ho); + if (avg <= (av_rxlev + pwr_hyst)) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " or equal than current RX level (%d) + hysteresis (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), rxlev2dbm(av_rxlev), pwr_hyst); + return; + } + } + + /* if the minimum level is not reached */ + min_rxlev = ho_get_min_rxlev(neighbor_bts->ho); + if (rxlev2dbm(avg) < min_rxlev) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, + "BTS %d is not a candidate, because RX level (%d) is lower" + " than its minimum required RX level (%d)\n", + neighbor_bts->nr, rxlev2dbm(avg), min_rxlev); + return; + } + + tchf_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(neighbor_bts, GSM_PCHAN_TCH_H); + c = &clist[*candidates]; + c->lchan = lchan; + c->bts = neighbor_bts; + c->requirements = check_requirements(lchan, neighbor_bts, tchf_count, + tchh_count); + c->avg = avg; + debug_candidate(c, 1, av_rxlev, tchf_count, tchh_count); + (*candidates)++; +} + +static void collect_candidates_for_lchan(struct gsm_lchan *lchan, + struct ho_candidate *clist, unsigned int *candidates, + int *_av_rxlev, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev; + unsigned int candidates_was; + bool assignment; + bool handover; + int neighbors_count = 0; + unsigned int rxlev_avg_win = ho_get_rxlev_avg_win(bts->ho); + + OSMO_ASSERT(candidates); + candidates_was = *candidates; + + /* caculate average rxlev for this cell over the window */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + rxlev_avg_win); + if (_av_rxlev) + *_av_rxlev = av_rxlev; + + /* in case there is no measurment report (yet) */ + if (av_rxlev < 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Not collecting candidates, not enough measurements" + " (got %d, want %u)\n", + lchan->meas_rep_count, rxlev_avg_win); + return; + } + + assignment = ho_get_as_active(bts->ho); + handover = ho_get_ho_active(bts->ho); + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Collecting candidates for%s%s%s\n", + assignment ? " Assignment" : "", + assignment && handover ? " and" : "", + handover ? " Handover" : ""); + + if (assignment) + collect_assignment_candidate(lchan, clist, candidates, av_rxlev); + + if (handover) { + int i; + for (i = 0; i < ARRAY_SIZE(lchan->neigh_meas); i++) { + collect_handover_candidate(lchan, &lchan->neigh_meas[i], + clist, candidates, + include_weaker_rxlev, av_rxlev, &neighbors_count); + } + } + + LOGPHOLCHAN(lchan, LOGL_DEBUG, "adding %u candidates from %u neighbors, total %u\n", + *candidates - candidates_was, neighbors_count, *candidates); +} + +/* + * Search for a alternative / better cell. + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * + * If one or more 'better cells' are available, check the current and neighbor + * cell measurements in descending order of their RX levels (down-link): + * + * * Select the best candidate that fulfills requirement B (no congestion + * after handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, do not perform handover nor + * assignment. + * + * If the RX level (down-link) or RX quality (down-link) of the current cell is + * below minimum acceptable level, or if the maximum allowed timing advance is + * reached or exceeded, check the RX levels (down-link) of the current and + * neighbor cells in descending order of their levels: (bad BTS case) + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment) and trigger handover or assignment. + * * If no candidate fulfills requirement B, select the best candidate that + * fulfills requirement C (less or equally congested cells after handover) + * and trigger handover or assignment. + * * If no candidate fulfills requirement C, select the best candidate that + * fulfills requirement A (ignore congestion after handover or assignment) + * and trigger handover or assignment. + * * If no candidate fulfills requirement A, do not perform handover nor + * assignment. + * + * RX levels (down-link) of current and neighbor cells: + * + * * The RX levels of the current cell and neighbor cells are improved by a + * given offset, if AFS (AMR on TCH/F) is used or is a candidate for + * handover/assignment. + * * If AMR is used, the requirement for handover is checked for TCH/F and + * TCH/H. Both results (if any) are used as a candidate. + * * If AMR is used, the requirement for assignment to a different TCH slot + * rate is checked. The result (if available) is used as a candidate. + * + * If minimum RXLEV, minimum RXQUAL or maximum TA are exceeded, the caller should pass + * include_weaker_rxlev=true so that handover is performed despite congestion. + */ +static int find_alternative_lchan(struct gsm_lchan *lchan, bool include_weaker_rxlev) +{ + struct gsm_bts *bts = lchan->ts->trx->bts; + int ahs = (lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && lchan->type == GSM_LCHAN_TCH_H); + int av_rxlev; + struct ho_candidate clist[1 + ARRAY_SIZE(lchan->neigh_meas)]; + unsigned int candidates = 0; + int i; + struct ho_candidate *best_cand = NULL; + unsigned int best_better_db; + bool best_applied_afs_bias = false; + int better; + + /* check for disabled handover/assignment at the current cell */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGP(DHODEC, LOGL_INFO, "Skipping, Handover and Assignment both disabled in this cell\n"); + return 0; + } + + collect_candidates_for_lchan(lchan, clist, &candidates, &av_rxlev, include_weaker_rxlev); + + /* If assignment is disabled and no neighbor cell report exists, or no neighbor cell qualifies, + * we may not even have any candidates. */ + if (!candidates) + goto no_candidates; + + /* select best candidate that fulfills requirement B: no congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_B_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); + } + + /* select best candidate that fulfills requirement C: less or equal congestion after HO */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_C_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); + } + + /* we are done in case the MS RXLEV/RXQUAL/TA aren't critical and we're avoiding congestion. */ + if (!include_weaker_rxlev) + goto no_candidates; + + /* Select best candidate that fulfills requirement A: can service the call. + * From above we know that there are no options that avoid congestion. Here we're trying to find + * *any* free lchan that has no critically low RXLEV and is able to handle the MS. */ + best_better_db = 0; + for (i = 0; i < candidates; i++) { + int afs_bias; + if (!(clist[i].requirements & REQUIREMENT_A_MASK)) + continue; + + better = clist[i].avg - av_rxlev; + /* Apply AFS bias? */ + afs_bias = 0; + if (ahs && (clist[i].requirements & REQUIREMENT_A_TCHF)) + afs_bias = ho_get_afs_bias_rxlev(clist[i].bts->ho); + better += afs_bias; + if (better > best_better_db) { + best_cand = &clist[i]; + best_better_db = better; + best_applied_afs_bias = afs_bias? true : false; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + LOGPHOLCHANTOBTS(lchan, best_cand->bts, LOGL_INFO, "Best candidate, RX level %d" + " with greater congestion found%s\n", + rxlev2dbm(best_cand->avg), + best_applied_afs_bias ? " (applied AHS -> AFS rxlev bias)" : ""); + return trigger_handover_or_assignment(lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_A_MASK); + } + + /* Damn, all is congested, has too low RXLEV or cannot service the voice call due to codec + * restrictions or because all lchans are taken. */ + +no_candidates: + if (include_weaker_rxlev) + LOGPHOLCHAN(lchan, LOGL_INFO, "No alternative lchan found\n"); + else + LOGPHOLCHAN(lchan, LOGL_INFO, "No better/less congested neighbor cell found\n"); + + return 0; +} + +/* + * Handover/assignment check, if measurement report is received + * + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. + * + * In case of handover triggered because maximum allowed timing advance is + * exceeded, the handover penalty timer is started for the originating cell. + * + */ +static int attempt_handover_after_mr(struct gsm_meas_rep *mr) +{ + struct gsm_lchan *lchan = mr->lchan; + struct gsm_bts *bts = lchan->ts->trx->bts; + int av_rxlev = -EINVAL, av_rxqual = -EINVAL; + int rc; + + /* we currently only do handover for TCH channels */ + switch (mr->lchan->type) { + case GSM_LCHAN_TCH_F: + case GSM_LCHAN_TCH_H: + break; + default: + return 0; + } + + /* parse actual neighbor cell info */ + if (mr->num_cell > 0 && mr->num_cell < 7) + process_meas_neigh(mr); + + /* check for ongoing handover/assignment */ + if (!lchan->conn) { + LOGPHOLCHAN(lchan, LOGL_ERROR, "Skipping, No subscriber connection???\n"); + return 0; + } + if (lchan->conn->secondary_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Initial Assignment is still ongoing\n"); + return 0; + } + if (lchan->conn->ho_lchan) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Handover already triggered\n"); + return 0; + } + + /* get average levels. if not enought measurements yet, value is < 0 */ + av_rxlev = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXLEV_FULL : MEAS_REP_DL_RXLEV_SUB, + ho_get_rxlev_avg_win(bts->ho)); + av_rxqual = get_meas_rep_avg(lchan, + ho_get_full_tdma(bts->ho) ? + MEAS_REP_DL_RXQUAL_FULL : MEAS_REP_DL_RXQUAL_SUB, + ho_get_rxqual_avg_win(bts->ho)); + if (av_rxlev < 0 && av_rxqual < 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Skipping, Not enough recent measuements\n"); + return 0; + } + if (av_rxlev >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX level = %d\n", + rxlev2dbm(av_rxlev)); + } + if (av_rxqual >= 0) { + LOGPHOLCHAN(lchan, LOGL_DEBUG, "Measurement report: average RX quality = %d\n", + av_rxqual); + } + + /* improve levels in case of AFS, if defined */ + if (lchan->type == GSM_LCHAN_TCH_F + && lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) { + int rxlev_bias = ho_get_afs_bias_rxlev(bts->ho); + int rxqual_bias = ho_get_afs_bias_rxqual(bts->ho); + if (av_rxlev >= 0 && rxlev_bias) { + int imp = av_rxlev + rxlev_bias; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX level from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxlev), rxlev2dbm(imp)); + av_rxlev = imp; + } + if (av_rxqual >= 0 && rxqual_bias) { + int imp = av_rxqual - rxqual_bias; + if (imp < 0) + imp = 0; + LOGPHOLCHAN(lchan, LOGL_INFO, "Virtually improving RX quality from %d to %d," + " due to AFS bias\n", rxlev2dbm(av_rxqual), rxlev2dbm(imp)); + av_rxqual = imp; + } + } + + /* Bad Quality */ + if (av_rxqual >= 0 && av_rxqual > ho_get_min_rxqual(bts->ho)) { + if (rxlev2dbm(av_rxlev) > -85) { + global_ho_reason = HO_REASON_INTERFERENCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment" + " due to interference (bad quality)\n"); + } else { + global_ho_reason = HO_REASON_BAD_QUALITY; + LOGPHOLCHAN(lchan, LOGL_INFO, "Trying handover/assignment due to bad quality\n"); + } + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Low Level */ + if (av_rxlev >= 0 && rxlev2dbm(av_rxlev) < ho_get_min_rxlev(bts->ho)) { + global_ho_reason = HO_REASON_LOW_RXLEVEL; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover/assignment due to low rxlev\n"); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* Max Distance */ + if (lchan->meas_rep_count > 0 + && lchan->rqd_ta > ho_get_max_distance(bts->ho)) { + global_ho_reason = HO_REASON_MAX_DISTANCE; + LOGPHOLCHAN(lchan, LOGL_INFO, "Attempting handover due to high TA\n"); + /* start penalty timer to prevent comming back too + * early. it must be started before selecting a better cell, + * so there is no assignment selected, due to running + * penalty timer. */ + conn_penalty_timer_add(lchan->conn, bts, ho_get_penalty_max_dist(bts->ho)); + rc = find_alternative_lchan(lchan, true); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + /* try handover to a better cell */ + if (av_rxlev >= 0 && (mr->nr % ho_get_pwr_interval(bts->ho)) == 0) { + LOGPHOLCHAN(lchan, LOGL_INFO, "Looking whether a cell has better RXLEV\n"); + global_ho_reason = HO_REASON_BETTER_CELL; + rc = find_alternative_lchan(lchan, false); + if (lchan->conn->ho_lchan || lchan->conn->secondary_lchan) + return rc; + return 0; + } + + return 0; +} + +/* + * Handover/assignment check after timer timeout: + * + * Even if handover process tries to prevent a congestion, a cell might get + * congested due to new call setups or handovers to prevent loss of radio link. + * A cell is congested, if not the minimum number of free slots are available. + * The minimum number can be defined for TCH/F and TCH/H individually. + * + * Do not perform congestion check, if no minimum free slots are defined for + * a cell. + * Do not trigger handover/assignment on slots which have already ongoing + * handover/assignment processes. If no AFS improvement offset is given, try to + * maintain the same TCH rate, if available. + * Do not perform this process, if handover and assignment are disabled for + * the current cell. + * Do not perform handover, if the minimum acceptable RX level + * is not reched for this cell. + * Only check candidates that will solve/reduce congestion. + * + * If a cell is congested, all slots are checked for all their RX levels + * (down-link) of the current and neighbor cell measurements in descending + * order of their RX levels: + * + * * Select the best candidate that fulfills requirement B (no congestion after + * handover/assignment), trigger handover or assignment. Candidates that will + * cause an assignment from AHS (AMR on TCH/H) to AFS (AMR on TCH/F) are + * omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement B, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the best candidates that fulfill requirement C (less or equally + * congested cells after handover/assignment), trigger handover or + * assignment. Candidates that will cause an assignment from AHS (AMR on + * TCH/H) to AFS (AMR on TCH/F) are omitted. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. The process ends + * then, otherwise: + * * Select the worst candidate that fulfills requirement C, trigger + * assignment. Note that only assignment candidates for changing from AHS to + * AFS are left. + * o This process repeated until the minimum required number of free slots + * are restored or if all cell measurements are checked. + */ +static int bts_resolve_congestion(struct gsm_bts *bts, int tchf_congestion, int tchh_congestion) +{ + struct gsm_lchan *lc; + struct gsm_bts_trx *trx; + struct gsm_bts_trx_ts *ts; + int i, j; + struct ho_candidate *clist; + unsigned int candidates; + struct ho_candidate *best_cand = NULL, *worst_cand = NULL; + struct gsm_lchan *delete_lchan = NULL; + unsigned int best_avg_db, worst_avg_db; + int avg; + int rc = 0; + int any_ho = 0; + int is_improved = 0; + + if (tchf_congestion < 0) + tchf_congestion = 0; + if (tchh_congestion < 0) + tchh_congestion = 0; + + LOGPHOBTS(bts, LOGL_INFO, "congested: %d TCH/F and %d TCH/H should be moved\n", + tchf_congestion, tchh_congestion); + + /* allocate array of all bts */ + clist = talloc_zero_array(tall_bsc_ctx, struct ho_candidate, + bts->num_trx * 8 * 2 * (1 + ARRAY_SIZE(lc->neigh_meas))); + if (!clist) + return 0; + + candidates = 0; + + /* loop through all active lchan and collect candidates */ + llist_for_each_entry(trx, &bts->trx_list, list) { + if (!trx_is_usable(trx)) + continue; + + for (i = 0; i < 8; i++) { + ts = &trx->ts[i]; + if (!ts_is_usable(ts)) + continue; + + /* (Do not consider dynamic TS that are in PDCH mode) */ + switch (ts_pchan(ts)) { + case GSM_PCHAN_TCH_F: + lc = &ts->lchan[0]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_F + || lc->state != LCHAN_S_ACTIVE) + break; + /* omit if there is an ongoing ho/as */ + if (!lc->conn || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + break; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + break; + case GSM_PCHAN_TCH_H: + for (j = 0; j < 2; j++) { + lc = &ts->lchan[j]; + /* omit if channel not active */ + if (lc->type != GSM_LCHAN_TCH_H + || lc->state != LCHAN_S_ACTIVE) + continue; + /* omit of there is an ongoing ho/as */ + if (!lc->conn + || lc->conn->secondary_lchan + || lc->conn->ho_lchan) + continue; + /* We desperately want to resolve congestion, ignore rxlev when + * collecting candidates by passing include_weaker_rxlev=true. */ + collect_candidates_for_lchan(lc, clist, &candidates, NULL, true); + } + break; + default: + break; + } + } + } + + if (!candidates) { + LOGPHOBTS(bts, LOGL_DEBUG, "No neighbor cells qualify to solve congestion\n"); + goto exit; + } + LOGPHOBTS(bts, LOGL_DEBUG, "Considering %u candidates to solve congestion\n", candidates); + +#if 0 +next_b1: +#endif + /* select best candidate that fulfills requirement B, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_B_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGPHOLCHAN(best_cand->lchan, LOGL_INFO, + "Best candidate BTS %u (RX level %d) without congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_b1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_b2: +#endif + /* select worst candidate that fulfills requirement B, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_B_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_B_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F without congestion " + "found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_B_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + best_cand = NULL; + goto next_b2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c1: +#endif + /* select best candidate that fulfills requirement C, + * omit change from AHS to AFS */ + best_avg_db = 0; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts == clist[i].bts + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + /* omit candidates that will not solve/reduce congestion */ + if (clist[i].lchan->type == GSM_LCHAN_TCH_F + && tchf_congestion <= 0) + continue; + if (clist[i].lchan->type == GSM_LCHAN_TCH_H + && tchh_congestion <= 0) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H + && (clist[i].requirements & REQUIREMENT_C_TCHF)) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg > best_avg_db) { + best_cand = &clist[i]; + best_avg_db = avg; + } + } + + /* perform handover, if there is a candidate */ + if (best_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Best candidate BTS %d (RX level %d) " + "with less or equal congestion found\n", + best_cand->bts->nr, rxlev2dbm(best_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(best_cand->lchan, best_cand->bts, + best_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + if (best_cand->lchan->type == GSM_LCHAN_TCH_H) + tchh_congestion--; + else + tchf_congestion--; + if (tchf_congestion > 0 || tchh_congestion > 0) { + delete_lchan = best_cand->lchan; + best_cand = NULL; + goto next_c1; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +#if 0 +next_c2: +#endif + /* select worst candidate that fulfills requirement C, + * select candidates that change from AHS to AFS only */ + if (tchh_congestion > 0) { + /* since this will only check half rate channels, it will + * only need to be checked, if tchh is congested */ + worst_avg_db = 999; + for (i = 0; i < candidates; i++) { + /* delete subscriber that just have handovered */ + if (clist[i].lchan == delete_lchan) + clist[i].lchan = NULL; + /* omit all subscribers that are handovered */ + if (!clist[i].lchan) + continue; + + if (!(clist[i].requirements & REQUIREMENT_C_MASK)) + continue; + /* omit all but assignment from AHS to AFS */ + if (clist[i].lchan->ts->trx->bts != clist[i].bts + || clist[i].lchan->type != GSM_LCHAN_TCH_H + || !(clist[i].requirements & REQUIREMENT_C_TCHF)) + continue; + + avg = clist[i].avg; + /* improve AHS */ + if (clist[i].lchan->tch_mode == GSM48_CMODE_SPEECH_AMR + && clist[i].lchan->type == GSM_LCHAN_TCH_H) { + avg += ho_get_afs_bias_rxlev(clist[i].bts->ho); + is_improved = 1; + } else + is_improved = 0; + if (avg < worst_avg_db) { + worst_cand = &clist[i]; + worst_avg_db = avg; + } + } + } + + /* perform handover, if there is a candidate */ + if (worst_cand) { + any_ho = 1; + LOGP(DHODEC, LOGL_INFO, "Worst candidate for assignment " + "(RX level %d) from TCH/H -> TCH/F with less or equal " + "congestion found\n", rxlev2dbm(worst_cand->avg)); + if (is_improved) + LOGP(DHODEC, LOGL_INFO, "(is improved due to " + "AHS -> AFS)\n"); + trigger_handover_or_assignment(worst_cand->lchan, + worst_cand->bts, + worst_cand->requirements & REQUIREMENT_C_MASK); +#if 0 + /* if there is still congestion, mark lchan as deleted + * and redo this process */ + tchh_congestion--; + if (tchh_congestion > 0) { + delete_lchan = worst_cand->lchan; + worst_cand = NULL; + goto next_c2; + } +#else + /* must exit here, because triggering handover/assignment + * will cause change in requirements. more check for this + * bts is performed in the next iteration. + */ +#endif + goto exit; + } + +exit: + /* free array */ + talloc_free(clist); + + if (tchf_congestion <= 0 && tchh_congestion <= 0) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d solved!\n", + bts->nr); + else if (any_ho) + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d reduced!\n", + bts->nr); + else + LOGP(DHODEC, LOGL_INFO, "Congestion at BTS %d can't be reduced/solved!\n", bts->nr); + + return rc; +} + +static void bts_congestion_check(struct gsm_bts *bts) +{ + int min_free_tchf, min_free_tchh; + int tchf_count, tchh_count; + + global_ho_reason = HO_REASON_CONGESTION; + + /* only check BTS if TRX 0 is usable */ + if (!trx_is_usable(bts->c0)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: TRX 0 not usable\n"); + return; + } + + /* only check BTS if handover or assignment is enabled */ + if (!ho_get_as_active(bts->ho) + && !ho_get_ho_active(bts->ho)) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: Assignment and Handover both disabled\n"); + return; + } + + min_free_tchf = ho_get_tchf_min_slots(bts->ho); + min_free_tchh = ho_get_tchh_min_slots(bts->ho); + + /* only check BTS with congestion level set */ + if (!min_free_tchf && !min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "No congestion check: no minimum for free TCH/F nor TCH/H set\n"); + return; + } + + tchf_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_F); + tchh_count = bts_count_free_ts(bts, GSM_PCHAN_TCH_H); + LOGPHOBTS(bts, LOGL_INFO, "Congestion check: (free/want-free) TCH/F=%d/%d TCH/H=%d/%d\n", + tchf_count, min_free_tchf, tchh_count, min_free_tchh); + + /* only check BTS if congested */ + if (tchf_count >= min_free_tchf && tchh_count >= min_free_tchh) { + LOGPHOBTS(bts, LOGL_DEBUG, "Not congested\n"); + return; + } + + LOGPHOBTS(bts, LOGL_DEBUG, "Attempting to resolve congestion...\n"); + bts_resolve_congestion(bts, min_free_tchf - tchf_count, min_free_tchh - tchh_count); +} + +void hodec2_congestion_check(struct gsm_network *net) +{ + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_congestion_check(bts); +} + +static void congestion_check_cb(void *arg) +{ + struct gsm_network *net = arg; + hodec2_congestion_check(net); + reinit_congestion_timer(net); +} + +static int ho_dec_2_sig_lchan(unsigned int signal, void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data = signal_data; + + switch (signal) { + case S_LCHAN_MEAS_REP: + /* This is Handover Algorithm 2. If we're not responsible, drop it. */ + if (ho_get_algorithm(lchan_data->lchan->ts->trx->bts->ho) != 2) + return 0; + + attempt_handover_after_mr(lchan_data->mr); + break; + } + + return 0; +} + +static int ho_dec_2_sig_cb(unsigned int subsys, unsigned int signal, void *handler_data, + void *signal_data) +{ + switch (subsys) { + case SS_LCHAN: + return ho_dec_2_sig_lchan(signal, handler_data, signal_data); + default: + return 0; + } +} + + +void hodec2_init(struct gsm_network *net) +{ + osmo_signal_register_handler(SS_LCHAN, ho_dec_2_sig_cb, NULL); + ho2_initialized = true; + reinit_congestion_timer(net); +} diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..0cce1d9 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -38,6 +38,29 @@ #include #include #include +#include +#include + +#define LOGPHOLCHANTOLCHAN(lchan, new_lchan, level, fmt, args...) \ + LOGP(DHODEC, level, "(BTS %u trx %u arfcn %u ts %u lchan %u %s)->(BTS %u trx %u arfcn %u ts %u lchan %u %s) (subscr %s) " fmt, \ + lchan->ts->trx->bts->nr, \ + lchan->ts->trx->nr, \ + lchan->ts->trx->arfcn, \ + lchan->ts->nr, \ + lchan->nr, \ + gsm_pchan_name(lchan->ts->pchan), \ + new_lchan->ts->trx->bts->nr, \ + new_lchan->ts->trx->nr, \ + new_lchan->ts->trx->arfcn, \ + new_lchan->ts->nr, \ + new_lchan->nr, \ + gsm_pchan_name(new_lchan->ts->pchan), \ + bsc_subscr_name(lchan->conn->bsub), \ + ## args) + +#define LOGPHO(struct_bsc_handover, level, fmt, args ...) \ + LOGPHOLCHANTOLCHAN(struct_bsc_handover->old_lchan, struct_bsc_handover->new_lchan, level, fmt, ## args) + struct bsc_handover { struct llist_head list; @@ -86,36 +109,56 @@ return NULL; } -/*! \brief Hand over the specified logical channel to the specified new BTS. - * This is the main entry point for the actual handover algorithm, after the - * decision whether to initiate HO to a specific BTS. */ +/*! Hand over the specified logical channel to the specified new BTS. */ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts) { + return bsc_handover_start_lchan_change(old_lchan, bts, old_lchan->type); +} + +/*! Hand over the specified logical channel to the specified new BTS and possibly change the lchan type. + * This is the main entry point for the actual handover algorithm, after the decision whether to initiate + * HO to a specific BTS. */ +int bsc_handover_start_lchan_change(struct gsm_lchan *old_lchan, struct gsm_bts *new_bts, + enum gsm_chan_t new_lchan_type) +{ + struct gsm_network *network; struct gsm_lchan *new_lchan; struct bsc_handover *ho; static uint8_t ho_ref = 0; int rc; + bool do_assignment = false; /* don't attempt multiple handovers for the same lchan at * the same time */ if (bsc_ho_by_old_lchan(old_lchan)) return -EBUSY; - DEBUGP(DHO, "Beginning with handover operation" - "(old_lchan on BTS %u, new BTS %u) ...\n", - old_lchan->ts->trx->bts->nr, bts->nr); + if (!new_bts) + new_bts = old_lchan->ts->trx->bts; + do_assignment = (new_bts == old_lchan->ts->trx->bts); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); + network = new_bts->network; + + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_ATTEMPTED]); if (!old_lchan->conn) { LOGP(DHO, LOGL_ERROR, "Old lchan lacks connection data.\n"); return -ENOSPC; } - new_lchan = lchan_alloc(bts, old_lchan->type, 0); + DEBUGP(DHO, "(BTS %u trx %u ts %u lchan %u %s)->(BTS %u lchan %s) Beginning with handover operation...\n", + old_lchan->ts->trx->bts->nr, + old_lchan->ts->trx->nr, + old_lchan->ts->nr, + old_lchan->nr, + gsm_pchan_name(old_lchan->ts->pchan), + new_bts->nr, + gsm_lchant_name(new_lchan_type)); + + new_lchan = lchan_alloc(new_bts, new_lchan_type, 0); if (!new_lchan) { - LOGP(DHO, LOGL_NOTICE, "No free channel\n"); - rate_ctr_inc(&bts->network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); + LOGP(DHO, LOGL_NOTICE, "No free channel for %s\n", gsm_lchant_name(new_lchan_type)); + rate_ctr_inc(&network->bsc_ctrs->ctr[BSC_CTR_HANDOVER_NO_CHANNEL]); return -ENOSPC; } @@ -128,31 +171,41 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (old_lchan->ts->trx->bts != bts) { + if (!do_assignment) { ho->inter_cell = true; ho->async = true; } + LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); + /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); - new_lchan->ms_power = old_lchan->ms_power; + if (do_assignment) { + new_lchan->ms_power = old_lchan->ms_power; + new_lchan->rqd_ta = old_lchan->rqd_ta; + } else { + new_lchan->ms_power = + ms_pwr_ctl_lvl(new_bts->band, new_bts->ms_max_power); + /* FIXME: do we have a better idea of the timing advance? */ + //new_lchan->rqd_ta = old_lchan->rqd_ta; + } new_lchan->bs_power = old_lchan->bs_power; new_lchan->rsl_cmode = old_lchan->rsl_cmode; new_lchan->tch_mode = old_lchan->tch_mode; - memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, ARRAY_SIZE(new_lchan->mr_ms_lv)); - memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, ARRAY_SIZE(new_lchan->mr_bts_lv)); + memcpy(&new_lchan->mr_ms_lv, &old_lchan->mr_ms_lv, sizeof(new_lchan->mr_ms_lv)); + memcpy(&new_lchan->mr_bts_lv, &old_lchan->mr_bts_lv, sizeof(new_lchan->mr_bts_lv)); new_lchan->conn = old_lchan->conn; new_lchan->conn->ho_lchan = new_lchan; - /* FIXME: do we have a better idea of the timing advance? */ rc = rsl_chan_activate_lchan(new_lchan, ho->inter_cell ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) : RSL_ACT_INTRA_IMM_ASS, ho->ho_ref); if (rc < 0) { - LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); + LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", + do_assignment? "Assignment" : "Handover", rc); new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; talloc_free(ho); @@ -218,12 +271,16 @@ if (!ho) return -ENODEV; - DEBUGP(DHO, "handover activate ack, send HO Command\n"); + LOGPHO(ho, LOGL_INFO, "Channel Activate Ack, send %s COMMAND\n", ho->inter_cell? "HANDOVER" : "ASSIGNMENT"); /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, 0, ho->ho_ref); + if (ho->inter_cell) { + gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); + } else { + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); + } /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ @@ -241,12 +298,18 @@ static int ho_chan_activ_nack(struct gsm_lchan *new_lchan) { struct bsc_handover *ho; + struct gsm_bts *new_bts = new_lchan->ts->trx->bts; ho = bsc_ho_by_new_lchan(new_lchan); if (!ho) { LOGP(DHO, LOGL_INFO, "ACT NACK: unable to find HO record\n"); return -ENODEV; } + + LOGPHO(ho, LOGL_ERROR, "Channel Activate Nack for %s, starting penalty timer\n", ho->inter_cell? "Handover" : "Assignment"); + + /* if channel failed, wait 10 seconds befor allowing to retry handover */ + conn_penalty_timer_add(ho->old_lchan->conn, new_bts, 10); /* FIXME configurable */ new_lchan->conn->ho_lchan = NULL; new_lchan->conn = NULL; @@ -269,22 +332,19 @@ return -ENODEV; } - net = new_lchan->ts->trx->bts->network; - LOGP(DHO, LOGL_INFO, "Subscriber %s HO from BTS %u->%u on ARFCN " - "%u->%u\n", bsc_subscr_name(ho->old_lchan->conn->bsub), - ho->old_lchan->ts->trx->bts->nr, new_lchan->ts->trx->bts->nr, - ho->old_lchan->ts->trx->arfcn, new_lchan->ts->trx->arfcn); + LOGPHO(ho, LOGL_INFO, "%s Complete\n", ho->inter_cell ? "Handover" : "Assignment"); + net = new_lchan->ts->trx->bts->network; rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_COMPLETED]); osmo_timer_del(&ho->T3103); /* Replace the ho lchan with the primary one */ if (ho->old_lchan != new_lchan->conn->lchan) - LOGP(DHO, LOGL_ERROR, "Primary lchan changed during handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Primary lchan changed during handover.\n"); if (new_lchan != new_lchan->conn->ho_lchan) - LOGP(DHO, LOGL_ERROR, "Handover channel changed during this handover.\n"); + LOGPHO(ho, LOGL_ERROR, "Handover channel changed during this handover.\n"); new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; @@ -301,6 +361,8 @@ static int ho_gsm48_ho_fail(struct gsm_lchan *old_lchan) { struct gsm_network *net = old_lchan->ts->trx->bts->network; + struct gsm_bts *old_bts; + struct gsm_bts *new_bts; struct bsc_handover *ho; struct gsm_lchan *new_lchan; @@ -308,6 +370,25 @@ if (!ho) { LOGP(DHO, LOGL_ERROR, "unable to find HO record\n"); return -ENODEV; + } + + old_bts = old_lchan->ts->trx->bts; + new_bts = ho->new_lchan->ts->trx->bts; + + if (old_lchan->conn->ho_failure >= ho_get_retries(old_bts->ho)) { + int penalty = ho->inter_cell + ? ho_get_penalty_failed_ho(old_bts->ho) + : ho_get_penalty_failed_as(old_bts->ho); + LOGPHO(ho, LOGL_NOTICE, "%s failed, starting penalty timer (%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + penalty); + old_lchan->conn->ho_failure = 0; + conn_penalty_timer_add(old_lchan->conn, new_bts, penalty); + } else { + old_lchan->conn->ho_failure++; + LOGPHO(ho, LOGL_NOTICE, "%s failed, trying again (%d/%d)\n", + ho->inter_cell ? "Handover" : "Assignment", + old_lchan->conn->ho_failure, ho_get_retries(old_bts->ho)); } rate_ctr_inc(&net->bsc_ctrs->ctr[BSC_CTR_HANDOVER_FAILED]); @@ -320,7 +401,6 @@ handover_free(ho); lchan_release(new_lchan, 0, RSL_REL_LOCAL_END); - return 0; } @@ -336,7 +416,7 @@ return -ENODEV; } - LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + LOGPHO(ho, LOGL_DEBUG, "Handover RACH detected\n"); /* This is just for logging on the DHO category. The actual MGCP switchover happens in * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c index 225e9a9..5d66e4c 100644 --- a/src/libbsc/handover_vty.c +++ b/src/libbsc/handover_vty.c @@ -23,6 +23,7 @@ #include #include #include +#include static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) { @@ -70,7 +71,42 @@ #undef HO_CFG_ONE_MEMBER -void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +static inline const int a2congestion_check_interval(const char *arg) +{ + if (!strcmp(arg, "disabled")) + return 0; + return atoi(arg); +} + +static inline const char *congestion_check_interval2a(int val) +{ + static char str[9]; + if (val < 1 + || snprintf(str, sizeof(str), "%d", val) >= sizeof(str)) + return "disabled"; + return str; +} + +DEFUN(cfg_net_ho_congestion_check_interval, cfg_net_ho_congestion_check_interval_cmd, + "handover congestion-check (disabled|<1-999>|now)", + HO_CFG_STR_HANDOVER + "Configure congestion check interval" HO_CFG_STR_2 + "Disable congestion checking, do not handover based on cell overload\n" + "Congestion check interval in seconds (default " + OSMO_STRINGIFY_VAL(HO_CFG_CONGESTION_CHECK_DEFAULT) ")\n" + "Manually trigger a congestion check to run right now\n") +{ + if (!strcmp(argv[0], "now")) { + hodec2_congestion_check(gsmnet_from_vty(vty)); + return CMD_SUCCESS; + } + + hodec2_on_change_congestion_check_interval(gsmnet_from_vty(vty), + a2congestion_check_interval(argv[0])); + return CMD_SUCCESS; +} + +static void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) { #define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ @@ -82,6 +118,21 @@ HO_CFG_ALL_MEMBERS #undef HO_CFG_ONE_MEMBER +} + +void ho_vty_write_bts(struct vty *vty, struct gsm_bts *bts) +{ + ho_vty_write(vty, " ", bts->ho); +} + +void ho_vty_write_net(struct vty *vty, struct gsm_network *net) +{ + ho_vty_write(vty, " ", net->ho); + + if (net->ho2.congestion_check_interval_s != HO_CFG_CONGESTION_CHECK_DEFAULT) + vty_out(vty, " handover congestion-check %s%s", + congestion_check_interval2a(net->ho2.congestion_check_interval_s), + VTY_NEWLINE); } static void ho_vty_init_cmds(int parent_node) @@ -96,6 +147,8 @@ void ho_vty_init() { ho_vty_init_cmds(GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_ho_congestion_check_interval_cmd); + ho_vty_init_cmds(BTS_NODE); } diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 57d8241..4368598 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -57,6 +57,7 @@ net->T3141 = GSM_T3141_DEFAULT; net->ho = ho_cfg_init(net, NULL); + net->ho2.congestion_check_interval_s = HO_CFG_CONGESTION_CHECK_DEFAULT; INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 92ebbfe..8320d4f 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -25,9 +25,11 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -38,6 +40,7 @@ #include #include #include +#include void *tall_bsc_ctx; @@ -266,6 +269,8 @@ INIT_LLIST_HEAD(&bts->loc_list); + osmo_signal_dispatch(SS_L_GLOBAL, S_GLOBAL_BTS_NEW, bts); + return bts; } @@ -416,3 +421,74 @@ rev_lev = (cm->classmark2[0] >> 5) & 0x3; return rev_lev >= 2; } + +static unsigned int time_now(void) +{ + time_t now; + time(&now); + /* FIXME: use monotonic clock */ + return (unsigned int)now; +} + +void conn_penalty_timer_add(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts, int timeout) +{ + struct ho_penalty_timer *timer; + unsigned int now; + unsigned int then; + now = time_now(); + + /* no not add timer, if there is no timeout set */ + if (!timeout) + return; + + then = now + timeout; + + /* timer already running for that BTS? */ + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + /* raise, if running timer will timeout earlier or has timed + * out already, otherwise keep later timeout */ + if (timer->timeout < then) + timer->timeout = then; + return; + } + + /* add new timer */ + timer = talloc_zero(tall_bsc_ctx, struct ho_penalty_timer); + if (!timer) + return; + + timer->bts_nr = bts->nr; + timer->timeout = then; + + llist_add_tail(&timer->entry, &conn->ho_penalty_timers); +} + +unsigned int conn_penalty_timer_remaining(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer; + unsigned int now = time_now(); + llist_for_each_entry(timer, &conn->ho_penalty_timers, entry) { + if (timer->bts_nr != bts->nr) + continue; + if (now > timer->timeout) + continue; + return timer->timeout - now; + } + return 0; +} + +void conn_penalty_timer_clear(struct gsm_subscriber_connection *conn, + struct gsm_bts *bts) +{ + struct ho_penalty_timer *timer, *timer2; + llist_for_each_entry_safe(timer, timer2, &conn->ho_penalty_timers, entry) { + if (bts && timer->bts_nr != bts->nr) + continue; + llist_del(&timer->entry); + talloc_free(timer); + } +} diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c index 8c208f6..204e5a2 100644 --- a/src/libcommon/handover_cfg.c +++ b/src/libcommon/handover_cfg.c @@ -23,7 +23,10 @@ #include #include +#include + #include +#include #include #include diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..ab796b2 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -741,7 +741,6 @@ bool aoip = false; struct sockaddr_storage rtp_addr; struct gsm0808_channel_type ct; - struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; const uint8_t *data; @@ -787,6 +786,7 @@ } /* Decode speech codec list (AoIP) */ + conn->conn->codec_list_present = false; if (aoip) { /* Check for speech codec list element */ if (!TLVP_PRESENT(&tp, GSM0808_IE_SPEECH_CODEC_LIST)) { @@ -798,13 +798,14 @@ /* Decode Speech Codec list */ data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&conn->conn->codec_list, data, len); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); goto reject; } - scl_ptr = &scl; + conn->conn->codec_list_present = true; + scl_ptr = &conn->conn->codec_list; } /* Decode Channel Type element */ diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1aff4c5..bac3a5e 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include @@ -298,6 +299,7 @@ mgcp_init(bsc_gsmnet); handover_decision_1_init(); + hodec2_init(bsc_gsmnet); signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); diff --git a/tests/Makefile.am b/tests/Makefile.am index ba8a5e1..652dfe1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -8,6 +8,7 @@ bsc-nat \ bsc-nat-trie \ bssap \ + handover \ $(NULL) # The `:;' works around a Bash 3.2 bug when the output is not writeable. diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am new file mode 100644 index 0000000..69fda8a --- /dev/null +++ b/tests/handover/Makefile.am @@ -0,0 +1,37 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + -ggdb3 \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) + +AM_LDFLAGS = \ + $(COVERAGE_LDFLAGS) \ + $(NULL) + +EXTRA_DIST = \ + handover_test.ok \ + $(NULL) + +noinst_PROGRAMS = \ + handover_test \ + $(NULL) + +handover_test_SOURCES = \ + handover_test.c \ + $(NULL) + +handover_test_LDADD = \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ + $(NULL) diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c new file mode 100644 index 0000000..4c4e95c --- /dev/null +++ b/tests/handover/handover_test.c @@ -0,0 +1,1583 @@ +/* + * (C) 2013 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct gsm_network *bsc_gsmnet; + +/* measurement report */ + +uint8_t meas_rep_ba = 0, meas_rep_valid = 1, meas_valid = 1, meas_multi_rep = 0; +uint8_t meas_dl_rxlev = 0, meas_dl_rxqual = 0; +uint8_t meas_ul_rxlev = 0, meas_ul_rxqual = 0; +uint8_t meas_tx_power_ms = 0, meas_tx_power_bs = 0, meas_ta_ms = 0; +uint8_t meas_dtx_ms = 0, meas_dtx_bs = 0, meas_nr = 0; +uint8_t meas_num_nc = 0, meas_rxlev_nc[6], meas_bsic_nc[6], meas_bcch_f_nc[6]; + +static void gen_meas_rep(struct gsm_lchan *lchan) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t ulm[3], l1i[2], *buf; + struct gsm48_hdr *gh; + struct gsm48_meas_res *mr; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = RSL_MT_MEAS_RES; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = chan_nr; + + msgb_tv_put(msg, RSL_IE_MEAS_RES_NR, meas_nr++); + + ulm[0] = meas_ul_rxlev | (meas_dtx_bs << 7); + ulm[1] = meas_ul_rxlev; + ulm[2] = (meas_ul_rxqual << 3) | meas_ul_rxqual; + msgb_tlv_put(msg, RSL_IE_UPLINK_MEAS, sizeof(ulm), ulm); + + msgb_tv_put(msg, RSL_IE_BS_POWER, meas_tx_power_bs); + + l1i[0] = 0; + l1i[1] = meas_ta_ms; + msgb_tv_fixed_put(msg, RSL_IE_L1_INFO, sizeof(l1i), l1i); + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*mr)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*mr)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + mr = (struct gsm48_meas_res *) msgb_put(msg, sizeof(*mr)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = GSM48_MT_RR_MEAS_REP; + + /* measurement results */ + mr->rxlev_full = meas_dl_rxlev; + mr->rxlev_sub = meas_dl_rxlev; + mr->rxqual_full = meas_dl_rxqual; + mr->rxqual_sub = meas_dl_rxqual; + mr->dtx_used = meas_dtx_ms; + mr->ba_used = meas_rep_ba; + mr->meas_valid = !meas_valid; /* 0 = valid */ + if (meas_rep_valid) { + mr->no_nc_n_hi = meas_num_nc >> 2; + mr->no_nc_n_lo = meas_num_nc & 3; + } else { + /* no results for serving cells */ + mr->no_nc_n_hi = 1; + mr->no_nc_n_lo = 3; + } + mr->rxlev_nc1 = meas_rxlev_nc[0]; + mr->rxlev_nc2_hi = meas_rxlev_nc[1] >> 1; + mr->rxlev_nc2_lo = meas_rxlev_nc[1] & 1; + mr->rxlev_nc3_hi = meas_rxlev_nc[2] >> 2; + mr->rxlev_nc3_lo = meas_rxlev_nc[2] & 3; + mr->rxlev_nc4_hi = meas_rxlev_nc[3] >> 3; + mr->rxlev_nc4_lo = meas_rxlev_nc[3] & 7; + mr->rxlev_nc5_hi = meas_rxlev_nc[4] >> 4; + mr->rxlev_nc5_lo = meas_rxlev_nc[4] & 15; + mr->rxlev_nc6_hi = meas_rxlev_nc[5] >> 5; + mr->rxlev_nc6_lo = meas_rxlev_nc[5] & 31; + mr->bsic_nc1_hi = meas_bsic_nc[0] >> 3; + mr->bsic_nc1_lo = meas_bsic_nc[0] & 7; + mr->bsic_nc2_hi = meas_bsic_nc[1] >> 4; + mr->bsic_nc2_lo = meas_bsic_nc[1] & 15; + mr->bsic_nc3_hi = meas_bsic_nc[2] >> 5; + mr->bsic_nc3_lo = meas_bsic_nc[2] & 31; + mr->bsic_nc4 = meas_bsic_nc[3]; + mr->bsic_nc5 = meas_bsic_nc[4]; + mr->bsic_nc6 = meas_bsic_nc[5]; + mr->bcch_f_nc1 = meas_bcch_f_nc[0]; + mr->bcch_f_nc2 = meas_bcch_f_nc[1]; + mr->bcch_f_nc3 = meas_bcch_f_nc[2]; + mr->bcch_f_nc4 = meas_bcch_f_nc[3]; + mr->bcch_f_nc5_hi = meas_bcch_f_nc[4] >> 1; + mr->bcch_f_nc5_lo = meas_bcch_f_nc[4] & 1; + mr->bcch_f_nc6_hi = meas_bcch_f_nc[5] >> 2; + mr->bcch_f_nc6_lo = meas_bcch_f_nc[5] & 3; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +static struct gsm_bts *create_bts(int arfcn) +{ + struct gsm_bts *bts; + struct e1inp_sign_link *rsl_link; + int i; + + bts = gsm_bts_alloc_register(bsc_gsmnet, GSM_BTS_TYPE_OSMOBTS, 0x3f); + if (!bts) { + printf("No resource for bts1\n"); + return NULL; + } + + bts->location_area_code = 23; + bts->c0->arfcn = arfcn; + + bts->codec.efr = 1; + bts->codec.hr = 1; + bts->codec.amr = 1; + + rsl_link = talloc_zero(0, struct e1inp_sign_link); + rsl_link->trx = bts->c0; + bts->c0->rsl_link = rsl_link; + + bts->c0->mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->bb_transc.mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->bb_transc.mo.nm_state.availability = NM_AVSTATE_OK; + + /* 4 full rate and 4 half rate channels */ + for (i = 1; i <= 6; i++) { + bts->c0->ts[i].pchan = + (i < 5) ? GSM_PCHAN_TCH_F : GSM_PCHAN_TCH_H; + bts->c0->ts[i].mo.nm_state.operational = NM_OPSTATE_ENABLED; + bts->c0->ts[i].mo.nm_state.availability = NM_AVSTATE_OK; + bts->c0->ts[i].lchan[0].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[0].state = LCHAN_S_NONE; + bts->c0->ts[i].lchan[1].type = GSM_LCHAN_NONE; + bts->c0->ts[i].lchan[1].state = LCHAN_S_NONE; + } + return bts; +} + +void create_conn(struct gsm_lchan *lchan) +{ + lchan->conn = bsc_subscr_con_allocate(lchan); +} + +/* create lchan */ +struct gsm_lchan *create_lchan(struct gsm_bts *bts, int full_rate, char *codec) +{ + struct gsm_lchan *lchan; + + lchan = lchan_alloc(bts, + (full_rate) ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H, 0); + if (!lchan) { + printf("No resource for lchan\n"); + exit(EXIT_FAILURE); + } + lchan->state = LCHAN_S_ACTIVE; + create_conn(lchan); + if (!strcasecmp(codec, "FR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "HR") && !full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + else if (!strcasecmp(codec, "EFR") && full_rate) + lchan->tch_mode = GSM48_CMODE_SPEECH_EFR; + else if (!strcasecmp(codec, "AMR")) + lchan->tch_mode = GSM48_CMODE_SPEECH_AMR; + else { + printf("Given codec unknown\n"); + exit(EXIT_FAILURE); + } + + lchan->conn->codec_list = (struct gsm0808_speech_codec_list){ + .codec = { + { .fi=true, .type=GSM0808_SCT_FR1, }, + { .fi=true, .type=GSM0808_SCT_FR2, }, + { .fi=true, .type=GSM0808_SCT_FR3, }, + { .fi=true, .type=GSM0808_SCT_HR1, }, + { .fi=true, .type=GSM0808_SCT_HR3, }, + }, + .len = 5, + }; + lchan->conn->codec_list_present = true; + + return lchan; +} + +/* parse channel request */ + +static int got_chan_req = 0; +static struct gsm_lchan *chan_req_lchan = NULL; + +static int parse_chan_act(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +static int parse_chan_rel(struct gsm_lchan *lchan, uint8_t *data) +{ + chan_req_lchan = lchan; + return 0; +} + +/* parse handover request */ + +static int got_ho_req = 0; +static struct gsm_lchan *ho_req_lchan = NULL; + +static int parse_ho_command(struct gsm_lchan *lchan, uint8_t *data, int len) +{ + struct gsm48_hdr *gh = (struct gsm48_hdr *) data; + struct gsm48_ho_cmd *ho = (struct gsm48_ho_cmd *) gh->data; + int arfcn; + struct gsm_bts *neigh; + + switch (gh->msg_type) { + case GSM48_MT_RR_HANDO_CMD: + arfcn = (ho->cell_desc.arfcn_hi << 8) | ho->cell_desc.arfcn_lo; + + /* look up trx. since every dummy bts uses different arfcn and + * only one trx, it is simple */ + llist_for_each_entry(neigh, &bsc_gsmnet->bts_list, list) { + if (neigh->c0->arfcn != arfcn) + continue; + ho_req_lchan = lchan; + return 0; + } + break; + case GSM48_MT_RR_ASS_CMD: + ho_req_lchan = lchan; + return 0; + break; + default: + fprintf(stderr, "Error, expecting HO or AS command\n"); + return -EINVAL; + } + + return -1; +} + +/* send channel activation ack */ +static void send_chan_act_ack(struct gsm_lchan *lchan, int act) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_dchan_hdr *dh; + + dh = (struct abis_rsl_dchan_hdr *) msgb_put(msg, sizeof(*dh)); + dh->c.msg_discr = ABIS_RSL_MDISC_DED_CHAN; + dh->c.msg_type = (act) ? RSL_MT_CHAN_ACTIV_ACK : RSL_MT_RF_CHAN_REL_ACK; + dh->ie_chan = RSL_IE_CHAN_NR; + dh->chan_nr = gsm_lchan2chan_nr(lchan); + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)dh; + + abis_rsl_rcvmsg(msg); +} + +/* send handover complete */ +static void send_ho_complete(struct gsm_lchan *lchan, bool success) +{ + struct msgb *msg = msgb_alloc_headroom(256, 64, "RSL"); + struct abis_rsl_rll_hdr *rh; + uint8_t chan_nr = gsm_lchan2chan_nr(lchan); + uint8_t *buf; + struct gsm48_hdr *gh; + struct gsm48_ho_cpl *hc; + + rh = (struct abis_rsl_rll_hdr *) msgb_put(msg, sizeof(*rh)); + rh->c.msg_discr = ABIS_RSL_MDISC_RLL; + rh->c.msg_type = RSL_MT_DATA_IND; + rh->ie_chan = RSL_IE_CHAN_NR; + rh->chan_nr = chan_nr; + rh->ie_link_id = RSL_IE_LINK_IDENT; + rh->link_id = 0x00; + + buf = msgb_put(msg, 3); + buf[0] = RSL_IE_L3_INFO; + buf[1] = (sizeof(*gh) + sizeof(*hc)) >> 8; + buf[2] = (sizeof(*gh) + sizeof(*hc)) & 0xff; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh)); + hc = (struct gsm48_ho_cpl *) msgb_put(msg, sizeof(*hc)); + + gh->proto_discr = GSM48_PDISC_RR; + gh->msg_type = + success ? GSM48_MT_RR_HANDO_COMPL : GSM48_MT_RR_HANDO_FAIL; + + msg->dst = lchan->ts->trx->bts->c0->rsl_link; + msg->l2h = (unsigned char *)rh; + msg->l3h = (unsigned char *)gh; + + abis_rsl_rcvmsg(msg); +} + +/* RSL messages from BSC */ +int abis_rsl_sendmsg(struct msgb *msg) +{ + struct abis_rsl_dchan_hdr *dh = (struct abis_rsl_dchan_hdr *) msg->data; + struct e1inp_sign_link *sign_link = msg->dst; + int rc; + struct gsm_lchan *lchan = rsl_lchan_lookup(sign_link->trx, dh->chan_nr, &rc); + + if (rc) { + printf("rsl_lchan_lookup() failed\n"); + exit(1); + } + + switch (dh->c.msg_type) { + case RSL_MT_CHAN_ACTIV: + rc = parse_chan_act(lchan, dh->data); + if (rc == 0) + got_chan_req = 1; + break; + case RSL_MT_RF_CHAN_REL: + rc = parse_chan_rel(lchan, dh->data); + if (rc == 0) + send_chan_act_ack(chan_req_lchan, 0); + break; + case RSL_MT_DATA_REQ: + rc = parse_ho_command(lchan, msg->l3h, msgb_l3len(msg)); + if (rc == 0) + got_ho_req = 1; + break; + case RSL_MT_IPAC_CRCX: + break; + default: + printf("unknown rsl message=0x%x\n", dh->c.msg_type); + } + return 0; +} + +/* test cases */ + +static char *test_case_0[] = { + "2", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_1[] = { + "2", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_2[] = { + "2", + + "Handover and Assignment must be enabled\n\n" + "This test will start with disabled assignment and handover. A\n" + "better neighbor cell (assignment enabled) will not be selected and \n" + "also no assignment from TCH/H to TCH/F to improve quality. There\n" + "will be no handover nor assignment. After enabling assignment on the\n" + "current cell, the MS will assign to TCH/F. After enabling handover\n" + "in the current cell, but disabling in the neighbor cell, handover\n" + "will not be performed, until it is enabled in the neighbor cell too.\n", + + "create-bts", "2", + "afs-rxlev-improve", "0", "5", + "create-ms", "0", "TCH/H", "AMR", + "as-enable", "0", "0", + "ho-enable", "0", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "as-enable", "0", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "ho-enable", "0", "1", + "ho-enable", "1", "0", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + "ho-enable", "1", "1", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_3[] = { + "2", + + "Penalty timer must not run\n\n" + "The MS will try to handover to a better cell, but this will fail.\n" + "Even though the cell is still better, handover will not be performed\n" + "due to penalty timer after handover failure\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-failed", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_4[] = { + "2", + + "TCH/H keeping with HR codec\n\n" + "The MS is using half rate V1 codec, but the better cell is congested\n" + "at TCH/H slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/H", "HR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + NULL +}; + +static char *test_case_5[] = { + "2", + + "TCH/F keeping with FR codec\n\n" + "The MS is using full rate V1 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_6[] = { + "2", + + "TCH/F keeping with EFR codec\n\n" + "The MS is using full rate V2 codec, but the better cell is congested\n" + "at TCH/F slots. As the congestion is removed, the handover takes\n" + "place.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "EFR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_7[] = { + "2", + + "TCH/F to TCH/H changing with AMR codec\n\n" + "The MS is using AMR V3 codec, the better cell is congested at TCH/F\n" + "slots. The handover is performed to non-congested TCH/H slots.\n", + + "create-bts", "2", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_8[] = { + "2", + + "No handover to a cell with no slots available\n\n" + "If no slot is available, no handover is performed\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_9[] = { + "2", + + "No more parallel handovers, if max_unsync_ho is defined\n\n" + "There are tree mobiles that want to handover, but only two can do\n" + "it at a time, because the maximum number is limited to two.\n", + + "create-bts", "2", + "set-max-ho", "1", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "0","0", "1","0","30", + "expect-chan", "1", "1", + "meas-rep", "1", "0","0", "1","0","30", + "expect-chan", "1", "2", + "meas-rep", "2", "0","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_10[] = { + "2", + + "Hysteresis\n\n" + "If neighbor cell is better, handover is only performed if the\n" + "ammount of improvement is greater or equal hyteresis\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "27","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "26","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_11[] = { + "2", + + "No Hysteresis and minimum RX level\n\n" + "If current cell's RX level is below mimium level, handover must be\n" + "performed, no matter of the hysteresis. First do not perform\n" + "handover to better neighbor cell, because the hysteresis is not\n" + "met. Second do not perform handover because better neighbor cell is\n" + "below minimum RX level. Third perform handover because current cell\n" + "is below minimum RX level, even if the better neighbor cell (minimum\n" + "RX level reached) does not meet the hysteresis.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", "1","0","11", + "expect-no-chan", + "meas-rep", "0", "8","0", "1","0","9", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","10", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_12[] = { + "2", + + "No handover to congested cell\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "After the congestion is over, handover will be performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "set-min-free", "1", "TCH/F", "3", + "set-min-free", "1", "TCH/H", "3", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_13[] = { + "2", + + "Handover to balance congestion\n\n" + "The current and the better cell are congested, so no handover is\n" + "performed. This is because handover would congest the neighbor cell\n" + "more. After congestion raises in the current cell, the handover is\n" + "performed to balance congestion\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "20","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_14[] = { + "2", + + "Handover to congested cell, if RX level is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX level of the current cell drops below minimum acceptable\n" + "level, the handover is performed.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "10","0", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "9","0", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_15[] = { + "2", + + "Handover to cell with worse RXLEV, if RXQUAL is below minimum\n\n" + "The neighbor cell has worse RXLEV, so no handover is performed.\n" + "If the RXQUAL of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "reports are received, before RXQUAL is checked.\n", + /* (See also test 28, which tests for RXQUAL triggering HO to congested cell.) */ + /* TODO: bad RXQUAL may want to prefer assignment within the same cell to avoid interference. + * See Performence Enhancements in a Frequency Hopping GSM Network (Nielsen Wigard 2002), Chapter + * 2.1.1, "Interference" in the list of triggers on p.157. */ + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-no-chan", + "meas-rep", "0", "40","6", "1","0","30", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_16[] = { + "2", + + "Handover due to maximum TA exceeded\n\n" + "The MS in the current (best) cell has reached maximum allowed timing\n" + "advance. No handover is performed until the timing advance exceeds\n" + "it. The originating cell is still the best, but no handover is\n" + "performed back to that cell, because the penalty timer (due to\n" + "maximum allowed timing advance) is running.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-max-ta", "0", "5", /* of cell */ + "set-ta", "0", "5", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "set-ta", "0", "6", /* of ms */ + "meas-rep", "0", "30","0", "1","0","20", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + "meas-rep", "0", "20","0", "1","0","30", + "expect-no-chan", + NULL +}; + +static char *test_case_17[] = { + "2", + + "Congestion check: No congestion\n\n" + "Three cells have different number of used slots, but there is no\n" + "congestion in any of these cells. No handover is performed.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_18[] = { + "2", + + "Congestion check: One out of three cells is congested\n\n" + "Three cells have different number of used slots, but there is\n" + "congestion at TCH/F in the first cell. Handover is performed with\n" + "the best candidate.\n", + + "create-bts", "3", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "2", + "set-min-free", "1", "TCH/F", "2", + "set-min-free", "1", "TCH/H", "2", + "set-min-free", "2", "TCH/F", "2", + "set-min-free", "2", "TCH/H", "2", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "1", "TCH/F", "AMR", + "create-ms", "1", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "2", "30","0", "2","0","21","1","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "4", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "5", "30","0", "2","0","20","1","20", + "expect-no-chan", + "meas-rep", "6", "30","0", "2","0","20","1","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "3", /* best candidate is MS 2 at BTS 1, TS 3 */ + "ho-complete", + NULL +}; + +static char *test_case_19[] = { + "2", + + "Congestion check: Balancing over congested cells\n\n" + "Two cells are congested, but the second cell is more congested.\n" + "Handover is performed to solve the congestion.\n", + + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "0", "TCH/F", "FR", + "create-ms", "1", "TCH/F", "FR", + "meas-rep", "0", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "1", "30","0", "1","0","21", + "expect-no-chan", + "meas-rep", "2", "30","0", "1","0","20", + "expect-no-chan", + "meas-rep", "3", "30","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "2", + "ack-chan", + "expect-ho", "0", "2", /* best candidate is MS 1 at BTS 0, TS 2 */ + "ho-complete", + NULL +}; + +static char *test_case_20[] = { + "2", + + "Congestion check: Solving congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "non-congested TCH/H of second BTS, in order to solve congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "5", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_21[] = { + "2", + + "Congestion check: Balancing congestion by handover TCH/F -> TCH/H\n\n" + "Two BTS, one MS in the first congested BTS must handover to\n" + "less-congested TCH/H of second BTS, in order to balance congestion\n", + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/F", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "1","0","30", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_22[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + NULL +}; + +static char *test_case_23[] = { + "2", + + "Story: 'A neighbor is your friend'\n", + + "create-bts", "3", + + "print", + "Andreas is driving along the coast, on a sunny june afternoon.\n" + "Suddenly he is getting a call from his friend and neighbor Axel.\n" + "\n" + "What happens: Two MS are created, #0 for Axel, #1 for Andreas.", + /* Axel */ + "create-ms", "2", "TCH/F", "AMR", + /* andreas */ + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "1", "40","0", "1","0","30", + "expect-no-chan", + + "print", + "Axel asks Andreas if he would like to join them for a barbecue.\n" + "Axel's house is right in the neighborhood and the weather is fine.\n" + "Andreas agrees, so he drives to a close store to buy some barbecue\n" + "skewers.\n" + "\n" + "What happens: While driving, a different cell (mounted atop the\n" + "store) becomes better.", + /* drive to bts 1 */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + "While Andreas is walking into the store, Axel asks, if he could also\n" + "bring some beer. Andreas has problems understanding him: \"I have a\n" + "bad reception here. The cell tower is right atop the store, but poor\n" + "coverage inside. Can you repeat please?\"\n" + "\n" + "What happens: Inside the store the close cell is so bad, that\n" + "handover back to the previous cell is required.", + /* bts 1 becomes bad, so bts 0 helps out */ + "meas-rep", "1", "5","0", "1","0","20", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "After Andreas bought skewers and beer, he leaves the store.\n" + "\n" + "What happens: Outside the store the close cell is better again, so\n" + "handover back to the that cell is performed.", + /* bts 1 becomes better again */ + "meas-rep", "1", "20","0", "1","0","35", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + "print", + /* bts 2 becomes better */ + "Andreas drives down to the lake where Axel's house is.\n" + "\n" + "What happens: There is a small cell at Axel's house, which becomes\n" + "better, because the current cell has no good comverage at the lake.", + "meas-rep", "1", "14","0", "2","0","2","1","63", + "expect-chan", "2", "2", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + + "print", + "Andreas wonders why he still has good radio coverage: \"Last time it\n" + "was so bad\". Axel says: \"I installed a pico cell in my house,\n" + "now we can use our mobile phones down here at the lake.\"", + + NULL +}; + +static char *test_case_24[] = { + "2", + "No (or not enough) measurements for handover\n\n" + "Do not solve congestion in cell, because there is no measurement.\n" + "As soon as enough measurments available (1 in our case), perform\n" + "handover. Afterwards the old cell becomes congested and the new\n" + "cell is not. Do not perform handover until new measurements are\n" + "received.\n", + + /* two cells, first in congested, but no handover */ + "create-bts", "2", + "set-min-free", "0", "TCH/F", "4", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/F", "AMR", + "congestion-check", + "expect-no-chan", + + /* send measurement and trigger congestion check */ + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + + /* congest the first cell and remove congestion from second cell */ + "set-min-free", "0", "TCH/F", "0", + "set-min-free", "0", "TCH/H", "0", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + + /* no handover until measurements applied */ + "congestion-check", + "expect-no-chan", + "meas-rep", "0", "20","0", "1","0","20", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "1", "1", + "ho-complete", + NULL +}; + +static char *test_case_25[] = { + "1", + + "Stay in better cell\n\n" + "There are many neighbor cells, but only the current cell is the best\n" + "cell, so no handover is performed\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "30","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-no-chan", + NULL +}; + +static char *test_case_26[] = { + "1", + + "Handover to best better cell\n\n" + "The best neighbor cell is selected\n", + + "create-bts", "7", + "create-ms", "0", "TCH/F", "AMR", + "meas-rep", "0", "10","0", + "6","0","20","1","21","2","18","3","20","4","23","5","19", + "expect-chan", "5", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char *test_case_27[] = { + "2", + + "Congestion check: Upgrading worst candidate from TCH/H -> TCH/F\n\n" + "There is only one BTS. The TCH/H slots are congested. Since\n" + "assignment is performed to less-congested TCH/F, the candidate with\n" + "the worst RX level is chosen. (So far like test 22.)\n" + "After that, trigger more congestion checks to ensure stability.\n", + + "create-bts", "1", + "set-min-free", "0", "TCH/F", "2", + "set-min-free", "0", "TCH/H", "4", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "create-ms", "0", "TCH/H", "AMR", + "meas-rep", "0", "30","0", "0", + "meas-rep", "1", "34","0", "0", + "meas-rep", "2", "20","0", "0", + "expect-no-chan", + "congestion-check", + "expect-chan", "0", "1", + "ack-chan", + "expect-ho", "0", "6", + "ho-complete", + "congestion-check", + "expect-chan", "0", "2", + "ack-chan", + "expect-ho", "0", "5", + "ho-complete", + "congestion-check", + "expect-no-chan", + "congestion-check", + "expect-no-chan", + NULL +}; + +static char *test_case_28[] = { + "2", + + "Handover to congested cell, if RX quality is below minimum\n\n" + "The better neighbor cell is congested, so no handover is performed.\n" + "If the RX quality of the current cell drops below minimum acceptable\n" + "level, the handover is performed. It is also required that 10\n" + "resports are received, before RX quality is checked.\n", + + "create-bts", "2", + "create-ms", "0", "TCH/F", "AMR", + "set-min-free", "1", "TCH/F", "4", + "set-min-free", "1", "TCH/H", "4", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-no-chan", + "meas-rep", "0", "30","6", "1","0","40", + "expect-chan", "1", "1", + "ack-chan", + "expect-ho", "0", "1", + "ho-complete", + NULL +}; + +static char **test_cases[] = { + test_case_0, + test_case_1, + test_case_2, + test_case_3, + test_case_4, + test_case_5, + test_case_6, + test_case_7, + test_case_8, + test_case_9, + test_case_10, + test_case_11, + test_case_12, + test_case_13, + test_case_14, + test_case_15, + test_case_16, + test_case_17, + test_case_18, + test_case_19, + test_case_20, + test_case_21, + test_case_22, + test_case_23, + test_case_24, + test_case_25, + test_case_26, + test_case_27, + test_case_28, + NULL +}; + +int main(int argc, char **argv) +{ + char **test_case; + struct gsm_bts *bts[256]; + int bts_num = 0; + struct gsm_lchan *lchan[256]; + int lchan_num = 0; + int test_count = 0; + int i; + int algorithm; + struct bsc_api bsc_api = {}; + + for (i = 0; test_cases[i]; i++) + test_count++; + + if (argc <= 1 || atoi(argv[1]) >= test_count) { + for (i = 0; test_cases[i]; i++) { + printf("Test #%d (algorithm %s):\n%s\n", i, + test_cases[i][0], test_cases[i][1]); + } + printf("\nPlease specify test case number 0..%d\n", + test_count - 1); + return EXIT_FAILURE; + } + + osmo_init_logging(&log_info); + + log_set_print_category(osmo_stderr_target, 1); + + log_set_category_filter(osmo_stderr_target, DHO, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DHODEC, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DMEAS, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DREF, 1, LOGL_DEBUG); + log_set_category_filter(osmo_stderr_target, DRSL, 1, LOGL_DEBUG); + + /* Create a dummy network */ + bsc_gsmnet = bsc_network_init(NULL, 1, 1); + if (!bsc_gsmnet) + exit(1); + + bsc_api_init(bsc_gsmnet, &bsc_api); + + ho_set_algorithm(bsc_gsmnet->ho, 2); + ho_set_ho_active(bsc_gsmnet->ho, true); + ho_set_as_active(bsc_gsmnet->ho, true); + ho_set_min_rxlev(bsc_gsmnet->ho, -100); + ho_set_rxlev_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxlev_neigh_avg_win(bsc_gsmnet->ho, 1); + ho_set_rxqual_avg_win(bsc_gsmnet->ho, 10); + ho_set_pwr_hysteresis(bsc_gsmnet->ho, 3); + ho_set_pwr_interval(bsc_gsmnet->ho, 1); + ho_set_afs_bias_rxlev(bsc_gsmnet->ho, 0); + ho_set_min_rxqual(bsc_gsmnet->ho, 5); + ho_set_afs_bias_rxqual(bsc_gsmnet->ho, 0); + ho_set_max_distance(bsc_gsmnet->ho, 9999); + ho_set_ho_max(bsc_gsmnet->ho, 9999); + ho_set_penalty_max_dist(bsc_gsmnet->ho, 300); + ho_set_penalty_failed_ho(bsc_gsmnet->ho, 60); + ho_set_penalty_failed_as(bsc_gsmnet->ho, 60); + + bts_model_sysmobts_init(); + + test_case = test_cases[atoi(argv[1])]; + + fprintf(stderr, "--------------------\n"); + fprintf(stderr, "Performing the following test %d (algorithm %s):\n%s", + atoi(argv[1]), test_case[0], test_case[1]); + algorithm = atoi(test_case[0]); + test_case += 2; + fprintf(stderr, "--------------------\n"); + + /* Disable the congestion check timer, we will trigger manually. */ + bsc_gsmnet->ho2.congestion_check_interval_s = 0; + + handover_decision_1_init(); + hodec2_init(bsc_gsmnet); + + while (*test_case) { + if (!strcmp(*test_case, "create-bts")) { + static int arfcn = 870; + int n = atoi(test_case[1]); + fprintf(stderr, "- Creating %d BTS (one TRX each, " + "TS(1-4) are TCH/F, TS(5-6) are TCH/H)\n", n); + for (i = 0; i < n; i++) + bts[bts_num + i] = create_bts(arfcn++); + for (i = 0; i < n; i++) + gsm_generate_si(bts[bts_num + i], + SYSINFO_TYPE_2); + bts_num += n; + test_case += 2; + } else + if (!strcmp(*test_case, "as-enable")) { + fprintf(stderr, "- Set assignment enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_as_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "ho-enable")) { + fprintf(stderr, "- Set handover enable state at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_ho_active(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxlev-improve")) { + fprintf(stderr, "- Set afs RX level improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxlev(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "afs-rxqual-improve")) { + fprintf(stderr, "- Set afs RX quality improvement at " + "BTS %s to %s\n", test_case[1], test_case[2]); + ho_set_afs_bias_rxqual(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-min-free")) { + fprintf(stderr, "- Setting minimum required free %s " + "slots at BTS %s to %s\n", test_case[2], + test_case[1], test_case[3]); + if (!strcmp(test_case[2], "TCH/F")) + ho_set_tchf_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + else + ho_set_tchh_min_slots(bts[atoi(test_case[1])]->ho, atoi(test_case[3])); + test_case += 4; + } else + if (!strcmp(*test_case, "set-max-ho")) { + fprintf(stderr, "- Setting maximum parallel handovers " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_ho_max( bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "set-max-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at BTS %s to %s\n", test_case[1], + test_case[2]); + ho_set_max_distance(bts[atoi(test_case[1])]->ho, atoi(test_case[2])); + test_case += 3; + } else + if (!strcmp(*test_case, "create-ms")) { + fprintf(stderr, "- Creating mobile #%d at BTS %s on " + "%s with %s codec\n", lchan_num, test_case[1], + test_case[2], test_case[3]); + lchan[lchan_num] = create_lchan(bts[atoi(test_case[1])], + !strcmp(test_case[2], "TCH/F"), test_case[3]); + if (!lchan[lchan_num]) { + printf("Failed to create lchan!\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * New MS is at BTS %d TS %d\n", + lchan[lchan_num]->ts->trx->bts->nr, + lchan[lchan_num]->ts->nr); + lchan_num++; + test_case += 4; + } else + if (!strcmp(*test_case, "set-ta")) { + fprintf(stderr, "- Setting maximum timing advance " + "at MS %s to %s\n", test_case[1], + test_case[2]); + meas_ta_ms = atoi(test_case[2]); + test_case += 3; + } else + if (!strcmp(*test_case, "meas-rep")) { + /* meas-rep [ [...]] */ + int n = atoi(test_case[4]); + struct gsm_lchan *lc = lchan[atoi(test_case[1])]; + fprintf(stderr, "- Sending measurement report from " + "mobile #%s (rxlev=%s, rxqual=%s)\n", + test_case[1], test_case[2], test_case[3]); + meas_dl_rxlev = atoi(test_case[2]); + meas_dl_rxqual = atoi(test_case[3]); + meas_num_nc = n; + test_case += 5; + for (i = 0; i < n; i++) { + int nr = atoi(test_case[0]); + /* since our bts is not in the list of neighbor + * cells, we need to shift */ + if (nr >= lc->ts->trx->bts->nr) + nr++; + fprintf(stderr, " * Neighbor cell #%s, actual " + "BTS %d (rxlev=%s)\n", test_case[0], nr, + test_case[1]); + meas_bcch_f_nc[i] = atoi(test_case[0]); + /* bts number, not counting our own */ + meas_rxlev_nc[i] = atoi(test_case[1]); + meas_bsic_nc[i] = 0x3f; + test_case += 2; + } + got_chan_req = 0; + gen_meas_rep(lc); + } else + if (!strcmp(*test_case, "congestion-check")) { + fprintf(stderr, "- Triggering congestion check\n"); + got_chan_req = 0; + if (algorithm == 2) + hodec2_congestion_check(bsc_gsmnet); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-chan")) { + fprintf(stderr, "- Expecting channel request at BTS %s " + "TS %s\n", test_case[1], test_case[2]); + if (!got_chan_req) { + printf("Test failed, because no channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got channel request at BTS %d " + "TS %d\n", chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + if (chan_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because channel was not " + "requested on expected BTS\n"); + return EXIT_FAILURE; + } + if (chan_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because channel was not " + "requested on expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "expect-no-chan")) { + fprintf(stderr, "- Expecting no channel request\n"); + if (got_chan_req) { + fprintf(stderr, " * Got channel request at " + "BTS %d TS %d\n", + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + printf("Test failed, because channel was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got no channel request\n"); + test_case += 1; + } else + if (!strcmp(*test_case, "expect-ho")) { + fprintf(stderr, "- Expecting handover/assignment " + "request at BTS %s TS %s\n", test_case[1], + test_case[2]); + if (!got_ho_req) { + printf("Test failed, because no handover was " + "requested\n"); + return EXIT_FAILURE; + } + fprintf(stderr, " * Got handover/assignment request at " + "BTS %d TS %d\n", + ho_req_lchan->ts->trx->bts->nr, + ho_req_lchan->ts->nr); + if (ho_req_lchan->ts->trx->bts->nr + != atoi(test_case[1])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected BTS\n"); + return EXIT_FAILURE; + } + if (ho_req_lchan->ts->nr != atoi(test_case[2])) { + printf("Test failed, because " + "handover/assignment was not commanded " + "at the expected TS\n"); + return EXIT_FAILURE; + } + test_case += 3; + } else + if (!strcmp(*test_case, "ack-chan")) { + fprintf(stderr, "- Acknowledging channel request\n"); + if (!got_chan_req) { + printf("Cannot ack channel, because no " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_ho_req = 0; + send_chan_act_ack(chan_req_lchan, 1); + } else + if (!strcmp(*test_case, "ho-complete")) { + fprintf(stderr, "- Acknowledging handover/assignment " + "request\n"); + if (!got_chan_req) { + printf("Cannot ack handover/assignment, " + "because no chan request\n"); + return EXIT_FAILURE; + } + if (!got_ho_req) { + printf("Cannot ack handover/assignment, " + "because no ho request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + /* switch lchan */ + for (i = 0; i < lchan_num; i++) { + if (lchan[i] == ho_req_lchan) { + fprintf(stderr, " * MS %d changes from " + "BTS=%d TS=%d to BTS=%d " + "TS=%d\n", i, + lchan[i]->ts->trx->bts->nr, + lchan[i]->ts->nr, + chan_req_lchan->ts->trx->bts->nr, + chan_req_lchan->ts->nr); + lchan[i] = chan_req_lchan; + } + } + send_ho_complete(chan_req_lchan, true); + } else + if (!strcmp(*test_case, "ho-failed")) { + fprintf(stderr, "- Making handover fail\n"); + if (!got_chan_req) { + printf("Cannot fail handover, because no chan " + "request\n"); + return EXIT_FAILURE; + } + test_case += 1; + got_chan_req = 0; + got_ho_req = 0; + send_ho_complete(ho_req_lchan, false); + } else + if (!strcmp(*test_case, "print")) { + fprintf(stderr, "\n%s\n\n", test_case[1]); + test_case += 2; + } else { + printf("Unknown test command '%s', please fix!\n", + *test_case); + return EXIT_FAILURE; + } + } + + for (i = 0; i < lchan_num; i++) { + struct gsm_subscriber_connection *conn = lchan[i]->conn; + lchan[i]->conn = NULL; + conn->lchan = NULL; + bsc_subscr_con_free(conn); + lchan_free(lchan[i]); + } + + fprintf(stderr, "--------------------\n"); + + printf("Test OK\n"); + + fprintf(stderr, "--------------------\n"); + + return EXIT_SUCCESS; +} + +void rtp_socket_free() {} +void rtp_send_frame() {} +void rtp_socket_upstream() {} +void rtp_socket_create() {} +void rtp_socket_connect() {} +void rtp_socket_proxy() {} +void trau_mux_unmap() {} +void trau_mux_map_lchan() {} +void trau_recv_lchan() {} +void trau_send_frame() {} diff --git a/tests/handover/handover_test.ok b/tests/handover/handover_test.ok new file mode 100644 index 0000000..678f9a3 --- /dev/null +++ b/tests/handover/handover_test.ok @@ -0,0 +1 @@ +Test OK diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index ff67c8f..4f13686 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -184,6 +184,7 @@ handover penalty-time failed-ho (<0-99999>|default) handover penalty-time failed-assignment (<0-99999>|default) handover retries (<0-9>|default) + handover congestion-check (disabled|<1-999>|now) ... OsmoBSC(config-net)# handover? @@ -205,6 +206,7 @@ max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) retries Immediately retry on handover/assignment failure (HO algo 2 only) + congestion-check Configure congestion check interval (HO algo 2 only) OsmoBSC(config-net)# handover algorithm ? 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. @@ -333,8 +335,13 @@ <0-9> Number of retries default Use default (0), remove explicit setting on this node +OsmoBSC(config-net)# handover congestion-check ? + disabled Disable congestion checking, do not handover based on cell overload + <1-999> Congestion check interval in seconds (default 10) + now Manually trigger a congestion check to run right now -OsmoBSC(config-net)# ### Same on BTS level + +OsmoBSC(config-net)# ### Same on BTS level, except for the congestion-check OsmoBSC(config-net)# bts 0 OsmoBSC(config-net-bts)# handover? handover Handover options diff --git a/tests/testsuite.at b/tests/testsuite.at index 6ef3f29..f0f6fd1 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -51,3 +51,177 @@ cat $abs_srcdir/bssap/bssap_test.err > experr AT_CHECK([$abs_top_builddir/tests/bssap/bssap_test], [], [expout], [experr]) AT_CLEANUP + +AT_SETUP([handover test 0]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 0], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 1]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 1], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 2]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 2], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 3]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 3], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 4]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 4], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 5]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 5], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 6]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 6], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 7]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 7], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 8]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 8], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 9]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 9], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 10]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 10], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 11]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 11], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 12]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 12], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 13]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 13], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 14]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 14], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 15]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 15], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 16]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 16], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 17]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 17], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 18]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 18], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 19]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 19], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 20]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 20], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 21]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 21], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 22]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 22], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 23]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 23], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 24]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 24], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 25]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 25], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 26]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 26], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 27]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 27], [], [expout], [ignore]) +AT_CLEANUP + +AT_SETUP([handover test 28]) +AT_KEYWORDS([handover]) +cat $abs_srcdir/handover/handover_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/handover/handover_test 28], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/5921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:37:59 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:37:59 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 I agree with Max that the --with-sysmobts= arg matches the --with-litecell15= and --with-octsdr options. We won't add '-headers' to the others because that would only create build fallout. And we should keep the pattern similar, so let's keep it as --with-sysmobts for hysterical raisins. Still important to me is: using --with-sysmobts makes sense only when it implies --enable-sysmocom-bts (If I pass --with-sysmobts alone and it has no effect, I would consider it a bug). And --enable-sysmocom-bts only makes sense when it uses a sane default for --with-sysmobts (what stsp said). If the empty value works, then that would be fine. Maybe an explicit './' would be ... more explicit. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 13:46:45 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 13:46:45 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 right, on the other hand, the osmo-bts build is broken until we commit this. Maybe we should merge this first and fix the problems later? -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:09:07 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:09:07 +0000 Subject: [PATCH] osmo-bts[master]: Allow specifying sysmocom headers explicitly 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/5870 to look at the new patch set (#3). Allow specifying sysmocom headers explicitly Add configure option --with-sysmobts=$INCDIR (like for LC1.5). Use to fix the jenkins build to fix the build after migration to stow, where we can no longer use a commin -I to include the sysmobts headers as well. Tweaked-by: neels Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am 3 files changed, 19 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/70/5870/3 diff --git a/configure.ac b/configure.ac index 2181743..55e3a34 100644 --- a/configure.ac +++ b/configure.ac @@ -67,10 +67,27 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files, implies --enable-sysmocom-bts])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +if test "x$sysmobts_incdir" != "x"; then + # --with-sysmobts was passed, imply enable_sysmocom_bts + enable_sysmocom_bts="yes" +fi +if test "x$enable_sysmocom_bts" = "xyes" -a "x$sysmobts_incdir" = "x"; then + # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. + sysmobts_incdir="." +fi +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 852542b..3e07050 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--enable-sysmocom-bts --with-sysmobts=$inst/include/" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 6e917e7..b837d3a 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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 Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:09:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:09:21 +0000 Subject: [PATCH] osmo-ggsn[master]: README.md: Remove misleading sentence on sgsnemu Message-ID: Review at https://gerrit.osmocom.org/5927 README.md: Remove misleading sentence on sgsnemu As reported by Viktor Tsymbalyuk, "Use the same LAN switch as the one your SGSN is connected to." is of course completely bogus. As long as you have IP routing in place, it doesn't matter at all which switch you are using. Change-Id: I748752337b863b317d2899017b1dc255ced2515d --- M README.md 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/27/5927/1 diff --git a/README.md b/README.md index 80126e0..583ad3a 100644 --- a/README.md +++ b/README.md @@ -263,8 +263,7 @@ 1. Install sgsnemu on a Linux Box. See under installation above. 2. Connect your Linux box with sgsnemu installed to the GPRS core -network. Use the same LAN switch as the one your SGSN is connected -to. You also need a free IP address that can be used by sgsnemu. +network. You also need a free IP address that can be used by sgsnemu. 3. You need to configure networking in terms of interface address, subnet mask and default route. See the Linux Networking HOWTO for details. -- To view, visit https://gerrit.osmocom.org/5927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I748752337b863b317d2899017b1dc255ced2515d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:11:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:11:22 +0000 Subject: osmo-ci[master]: gerrit-verifications.yml: osmo-sgsn: Remove duplicated concu... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I808c46c2f4488fd577bb1c23cd13c5b73519265b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:11:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:11:46 +0000 Subject: osmo-bsc[master]: osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I510e1081171706eb3d9fb2db50a9aa4f768929b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:15:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:15:04 +0000 Subject: osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... In-Reply-To: References: Message-ID: Patch Set 1: (4 comments) https://gerrit.osmocom.org/#/c/5889/1/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 1420: "handover <0-255> <0-255> <0-7> LCHAN_NR <0-255>", lchan numbers are 0..8 as the lchan[] array is 8 in size. Rationale: SDCCH/8 is the channel with most logical channels in a timeslot. so it should be <0-7> instead of LCHAN_NR, IMHO Line 1430: "assignment <0-255> <0-255> <0-7> LCHAN_NR", same here of course Line 1529: "Pick any actively used lchan and handover to any other BTS." might be worth that it only will select any *voice* lchan, not "any actively used lchan" such as SDCCN. Line 1550: "Pick any actively used lchan and re-assign within the same BTS.\n") same here again. -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:15:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:15:55 +0000 Subject: libosmocore[master]: logging: separate the '<000b>' subsys from filename logging In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 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 Jan 19 14:16:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:16:10 +0000 Subject: libosmocore[master]: logging: allow to log only the basename of each source In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:16:20 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:16:20 +0000 Subject: [PATCH] osmo-bts[master]: fix build: tests/misc: missing libosmo-abis and -trau flags Message-ID: Review at https://gerrit.osmocom.org/5928 fix build: tests/misc: missing libosmo-abis and -trau flags Add missing LIBOSMOABIS_CFLAGS and LIBOSMOTRAU_CFLAGS. Pair the _LIBS below the _CFLAGS in LDADD above (cosmetic). Change-Id: Id542fd26fa1a519e68df215c7d45bc5c40ad9bb5 --- M tests/misc/Makefile.am 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/28/5928/1 diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..f232c49 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,9 +1,11 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) \ + $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok misc_test_SOURCES = misc_test.c $(srcdir)/../stubs.c misc_test_LDADD = $(top_builddir)/src/common/libbts.a \ - $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS) $(LDADD) + $(LDADD) -- To view, visit https://gerrit.osmocom.org/5928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id542fd26fa1a519e68df215c7d45bc5c40ad9bb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:16:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:16:26 +0000 Subject: libosmocore[master]: logging vty: add 'logging print file (0|1|basename)' cmd In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:19:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:19:25 +0000 Subject: libosmocore[master]: logging: use enum to set timestamp format In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/5857/4/include/osmocom/core/logging.h File include/osmocom/core/logging.h: Line 255: unsigned int print_timestamp:1; the question here is whether we can avoid those deprecated /new members and simply change the existing one. Chances are probably extremely low that anyone has implemented a log target outside of libosmocore itself, so an application would not have had any direct reference to the struct or its layout - only referring to pointers as those are returned if log targets are created. Might be worth investigating if this is true for the osmocom codebase and then simply change in-place? -- To view, visit https://gerrit.osmocom.org/5857 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I70ecee543c266df54191d3e86401466cd1a5c0a6 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 Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:20:05 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:20:05 +0000 Subject: [PATCH] osmo-bts[master]: fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) Message-ID: Review at https://gerrit.osmocom.org/5929 fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 --- M tests/sysmobts/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/5929/1 diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:25:02 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:25:02 +0000 Subject: [ABANDON] osmo-bts[master]: fix build: tests/misc: missing libosmo-abis and -trau flags In-Reply-To: References: Message-ID: Neels Hofmeyr has abandoned this change. Change subject: fix build: tests/misc: missing libosmo-abis and -trau flags ...................................................................... Abandoned It's in 5818 -- To view, visit https://gerrit.osmocom.org/5928 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id542fd26fa1a519e68df215c7d45bc5c40ad9bb5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:25:14 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:25:14 +0000 Subject: [PATCH] osmo-bts[master]: fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5929 to look at the new patch set (#2). fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 --- M tests/sysmobts/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/29/5929/2 diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:25:14 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:25:14 +0000 Subject: [PATCH] osmo-bts[master]: fix build: tests/misc: missing libosmo-abis and -trau flags 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/5818 to look at the new patch set (#12). fix build: tests/misc: missing libosmo-abis and -trau flags Add missing LIBOSMOABIS_CFLAGS and LIBOSMOTRAU_CFLAGS. Pair the _LIBS below the _CFLAGS in LDADD above (cosmetic). Fixes the stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M tests/misc/Makefile.am 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/18/5818/12 diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..f232c49 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,9 +1,11 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) \ + $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok misc_test_SOURCES = misc_test.c $(srcdir)/../stubs.c misc_test_LDADD = $(top_builddir)/src/common/libbts.a \ - $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS) $(LDADD) + $(LDADD) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 12 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-Reviewer: Stefan Sperling Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:26:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:26:36 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a 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 Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:26:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:26:43 +0000 Subject: [MERGED] osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow specifying sysmocom headers explicitly ...................................................................... Allow specifying sysmocom headers explicitly Add configure option --with-sysmobts=$INCDIR (like for LC1.5). Use to fix the jenkins build to fix the build after migration to stow, where we can no longer use a commin -I to include the sysmobts headers as well. Tweaked-by: neels Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a --- M configure.ac M contrib/jenkins_sysmobts.sh M src/osmo-bts-sysmo/Makefile.am 3 files changed, 19 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/configure.ac b/configure.ac index 2181743..55e3a34 100644 --- a/configure.ac +++ b/configure.ac @@ -67,10 +67,27 @@ AC_HELP_STRING([--enable-sysmocom-bts], [enable code for sysmoBTS L1/PHY [default=no]]), [enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"]) +AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files, implies --enable-sysmocom-bts])], + [sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"]) +if test "x$sysmobts_incdir" != "x"; then + # --with-sysmobts was passed, imply enable_sysmocom_bts + enable_sysmocom_bts="yes" +fi +if test "x$enable_sysmocom_bts" = "xyes" -a "x$sysmobts_incdir" = "x"; then + # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. + sysmobts_incdir="." +fi +AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], + [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], + [#include ]) PKG_CHECK_MODULES(LIBGPS, libgps) + CPPFLAGS=$oldCPPFLAGS fi AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 852542b..3e07050 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts" +configure_flags="--enable-sysmocom-bts --with-sysmobts=$inst/include/" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index 6e917e7..b837d3a 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:26:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:26:50 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 3: tweaked the patch and merging to fix the master build. Feel free to re-tweak in further patches. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:26:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:26:55 +0000 Subject: osmo-bts[master]: fix build: tests/misc: missing libosmo-abis and -trau flags In-Reply-To: References: Message-ID: Patch Set 12: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 12 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-Reviewer: Stefan Sperling Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:26:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:26:58 +0000 Subject: osmo-bts[master]: fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:27:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:27:01 +0000 Subject: [MERGED] osmo-bts[master]: fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) ...................................................................... fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR) Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 --- M tests/sysmobts/Makefile.am 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 654ab5d..2a57b2b 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:27:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:27:01 +0000 Subject: [MERGED] osmo-bts[master]: fix build: tests/misc: missing libosmo-abis and -trau flags In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix build: tests/misc: missing libosmo-abis and -trau flags ...................................................................... fix build: tests/misc: missing libosmo-abis and -trau flags Add missing LIBOSMOABIS_CFLAGS and LIBOSMOTRAU_CFLAGS. Pair the _LIBS below the _CFLAGS in LDADD above (cosmetic). Fixes the stow-enabled jenkins builds are currently failing like below: In file included from ../../include/osmo-bts/gsm_data.h:136:0, from ../../include/osmo-bts/bts.h:4, from misc_test.c:23: ../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory #include Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac --- M tests/misc/Makefile.am 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/tests/misc/Makefile.am b/tests/misc/Makefile.am index 6575fe8..f232c49 100644 --- a/tests/misc/Makefile.am +++ b/tests/misc/Makefile.am @@ -1,9 +1,11 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) \ + $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS) noinst_PROGRAMS = misc_test EXTRA_DIST = misc_test.ok misc_test_SOURCES = misc_test.c $(srcdir)/../stubs.c misc_test_LDADD = $(top_builddir)/src/common/libbts.a \ - $(LIBOSMOABIS_LIBS) $(LIBOSMOTRAU_LIBS) $(LDADD) + $(LDADD) -- To view, visit https://gerrit.osmocom.org/5818 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac Gerrit-PatchSet: 12 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-Reviewer: Stefan Sperling Gerrit-Reviewer: lynxis lazus Gerrit-Reviewer: neels From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:27:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:27:17 +0000 Subject: osmo-ggsn[master]: README.md: Remove misleading sentence on sgsnemu In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I748752337b863b317d2899017b1dc255ced2515d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:27:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:27:21 +0000 Subject: [MERGED] osmo-ggsn[master]: README.md: Remove misleading sentence on sgsnemu In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: README.md: Remove misleading sentence on sgsnemu ...................................................................... README.md: Remove misleading sentence on sgsnemu As reported by Viktor Tsymbalyuk, "Use the same LAN switch as the one your SGSN is connected to." is of course completely bogus. As long as you have IP routing in place, it doesn't matter at all which switch you are using. Change-Id: I748752337b863b317d2899017b1dc255ced2515d --- M README.md 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README.md b/README.md index 80126e0..583ad3a 100644 --- a/README.md +++ b/README.md @@ -263,8 +263,7 @@ 1. Install sgsnemu on a Linux Box. See under installation above. 2. Connect your Linux box with sgsnemu installed to the GPRS core -network. Use the same LAN switch as the one your SGSN is connected -to. You also need a free IP address that can be used by sgsnemu. +network. You also need a free IP address that can be used by sgsnemu. 3. You need to configure networking in terms of interface address, subnet mask and default route. See the Linux Networking HOWTO for details. -- To view, visit https://gerrit.osmocom.org/5927 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I748752337b863b317d2899017b1dc255ced2515d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:28:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:28:00 +0000 Subject: osmo-mgw[master]: mgcp: allow endpoints beginning from zero In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iec2f4e36e1ab01ff23875d99e4b0e04af7c1ad98 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:28:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:28:22 +0000 Subject: osmo-mgw[master]: client/common: move constant MGCP_ENDPOINT_MAXLEN In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e1c52aa5ebd83b2d9e5178ea24cb27d96cb7ddd Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:28:42 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 19 Jan 2018 14:28:42 +0000 Subject: osmo-bts[master]: Allow specifying sysmocom headers explicitly In-Reply-To: References: Message-ID: Patch Set 3: Here's my opinion: - I don't think it's necessary to automatically enable other flags when using --with-sysmobts. Both configure flags do different things. I'd at most print a warning if --with is detected and --enable is not enabled. In any case, after your change you make it automatically enabled for sysmobts but not for lc15. - Keeping --with-symobts instead of --with-sysmobts-header is fine to maintain similar structure as for lc15. - Passing -I. when --with-sysmobts is not set is really ugly. Best would be having a variable SYSMOBTS_L1H_CPPFLAGS = "-I${INCL_HEADERS" or = "" if not set, then using that one. -- To view, visit https://gerrit.osmocom.org/5870 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: neels Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:29:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:29:36 +0000 Subject: osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Patch Set 2: actually, it is the host name and domain name that you make configurable in this patch. Not entirely sure what's the best naming here. FQDN? how does the spec call it? -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:29:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:29:58 +0000 Subject: osmo-mgw[master]: cosmetic: protocol: remove unnecessary nul termination In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5a1187b13b21b11674f13d3449c730616b0a4ddf Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:34:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:34:56 +0000 Subject: osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/5879/2//COMMIT_MSG Commit Message: Line 20: Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 related: OS#2631 https://gerrit.osmocom.org/#/c/5879/2/src/libosmo-mgcp/mgcp_msg.c File src/libosmo-mgcp/mgcp_msg.c: Line 240: return find_free_endpoint(cfg->trunk.endpoints, the "find_endpoint" function should do prefix-matching on the endpoint class, and then call a class specific function pointer for further parsing. So here it would basically simply iterate over the list of registered endpoint classes and do a prefix match, and then dispatch into the respective function. Could be another patch, but it's starting to bother me that the basic architecture is still so wrong. -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:35:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 14:35:40 +0000 Subject: osmo-mgw[master]: client: add an optional FSM interface In-Reply-To: References: Message-ID: Patch Set 2: I think you fogot some 'git add' commands... -- To view, visit https://gerrit.osmocom.org/5881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:36:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 19 Jan 2018 14:36:55 +0000 Subject: [MERGED] osmo-bts[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 The default (for both manual and .deb builds) is to use shared build (as before) - the static build is entirely optional. Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda --- 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 55e3a34..88751f4 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,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) -- To view, visit https://gerrit.osmocom.org/5830 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda 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 Fri Jan 19 14:59:34 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:59:34 +0000 Subject: [PATCH] osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5889 to look at the new patch set (#2). vty: add various manual handover and assignment trigger commands Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 --- M src/libbsc/bsc_vty.c 1 file changed, 191 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/89/5889/2 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index aafdd2d..b6e5b8a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1342,12 +1342,27 @@ return CMD_SUCCESS; } -DEFUN(handover_subscr_conn, - handover_subscr_conn_cmd, - "handover <0-255> <0-255> <0-7> <0-7> <0-255>", - "Handover subscriber connection to other BTS\n" - "Current " BTS_TRX_TS_LCHAN_STR - "New " BTS_NR_STR) +static int trigger_ho_or_as(struct vty *vty, struct gsm_lchan *from_lchan, struct gsm_bts *to_bts) +{ + int rc; + + if (!to_bts || from_lchan->ts->trx->bts == to_bts) { + LOGP(DHO, LOGL_NOTICE, "%s Manually triggering Assignment from VTY\n", + gsm_lchan_name(from_lchan)); + to_bts = from_lchan->ts->trx->bts; + } else + LOGP(DHO, LOGL_NOTICE, "%s (ARFCN %u) --> BTS %u Manually triggering Handover from VTY\n", + gsm_lchan_name(from_lchan), from_lchan->ts->trx->arfcn, to_bts->nr); + rc = bsc_handover_start(from_lchan, to_bts); + if (rc) { + vty_out(vty, "bsc_handover_start() returned %d=%s%s", rc, + strerror(-rc), VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +static int ho_or_as(struct vty *vty, const char *argv[], int argc) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_subscriber_connection *conn; @@ -1357,41 +1372,189 @@ unsigned int trx_nr = atoi(argv[1]); unsigned int ts_nr = atoi(argv[2]); unsigned int ss_nr = atoi(argv[3]); - unsigned int bts_nr_new = atoi(argv[4]); + unsigned int bts_nr_new; + const char *action; - /* Lookup the BTS where we want to handover to */ - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == bts_nr_new) { - new_bts = bts; - break; + if (argc > 4) { + bts_nr_new = atoi(argv[4]); + + /* Lookup the BTS where we want to handover to */ + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == bts_nr_new) { + new_bts = bts; + break; + } + } + + if (!new_bts) { + vty_out(vty, "Unable to trigger handover, specified bts #%u does not exist %s", + bts_nr_new, VTY_NEWLINE); + return CMD_WARNING; } } - if (!new_bts) { - vty_out(vty, "Unable to trigger handover," - "specified bts #%u does not exist %s", bts_nr_new, - VTY_NEWLINE); - return CMD_WARNING; - } + action = new_bts ? "handover" : "assignment"; /* Find the connection/lchan that we want to handover */ llist_for_each_entry(conn, &net->subscr_conns, entry) { if (conn_get_bts(conn)->nr == bts_nr && conn->lchan->ts->trx->nr == trx_nr && conn->lchan->ts->nr == ts_nr && conn->lchan->nr == ss_nr) { - vty_out(vty, "starting handover for lchan %s...%s", - conn->lchan->name, VTY_NEWLINE); + vty_out(vty, "starting %s for lchan %s...%s", action, conn->lchan->name, VTY_NEWLINE); lchan_dump_full_vty(vty, conn->lchan); - bsc_handover_start(conn->lchan, new_bts); - return CMD_SUCCESS; + return trigger_ho_or_as(vty, conn->lchan, new_bts); } } - vty_out(vty, "Unable to trigger handover," - "specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", - bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); + vty_out(vty, "Unable to trigger %s, specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", + action, bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); return CMD_WARNING; +} + +#define MANUAL_HANDOVER_STR "Manually trigger handover (for debugging)\n" +#define MANUAL_ASSIGNMENT_STR "Manually trigger assignment (for debugging)\n" + +DEFUN(handover_subscr_conn, + handover_subscr_conn_cmd, + "handover <0-255> <0-255> <0-7> <0-7> <0-255>", + MANUAL_HANDOVER_STR + "Current " BTS_TRX_TS_LCHAN_STR + "New " BTS_NR_STR) +{ + return ho_or_as(vty, argv, argc); +} + +DEFUN(assignment_subscr_conn, + assignment_subscr_conn_cmd, + "assignment <0-255> <0-255> <0-7> <0-7>", + MANUAL_ASSIGNMENT_STR + "Current " BTS_TRX_TS_LCHAN_STR) +{ + return ho_or_as(vty, argv, argc); +} + +static struct gsm_lchan *find_used_voice_lchan(struct vty *vty) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_ACTIVE + && (lchan->type == GSM_LCHAN_TCH_F + || lchan->type == GSM_LCHAN_TCH_H)) { + + vty_out(vty, "Found voice call: %s%s", + gsm_lchan_name(lchan), VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return lchan; + } + } + } + } + } + + vty_out(vty, "Cannot find any ongoing voice calls%s", VTY_NEWLINE); + return NULL; +} + +static struct gsm_bts *find_other_bts_with_free_slots(struct vty *vty, struct gsm_bts *not_this_bts, + enum gsm_phys_chan_config free_type) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + if (bts == not_this_bts) + continue; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + if (ts->pchan != free_type) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_NONE) { + vty_out(vty, "Found unused %s slot: %s%s", + gsm_pchan_name(free_type), + gsm_lchan_name(lchan), + VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return bts; + } + } + } + } + } + vty_out(vty, "Cannot find any BTS (other than BTS %u) with free %s lchan%s", + not_this_bts? not_this_bts->nr : 255, gsm_lchant_name(free_type), VTY_NEWLINE); + return NULL; +} + +DEFUN(handover_any, handover_any_cmd, + "handover any", + MANUAL_HANDOVER_STR + "Pick any actively used TCH/F or TCH/H lchan and handover to any other BTS." + " This is likely to fail if not all BTS are guaranteed to be reachable by the MS.\n") +{ + struct gsm_lchan *from_lchan; + struct gsm_bts *to_bts; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, + ts_pchan(from_lchan->ts)); + if (!to_bts) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, to_bts); +} + +DEFUN(assignment_any, assignment_any_cmd, + "assignment any", + MANUAL_ASSIGNMENT_STR + "Pick any actively used lchan and re-assign within the same BTS.\n") +{ + struct gsm_lchan *from_lchan; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, NULL); } static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag) @@ -4213,6 +4376,9 @@ install_element_ve(&show_subscr_conn_cmd); install_element_ve(&handover_subscr_conn_cmd); + install_element_ve(&handover_any_cmd); + install_element_ve(&assignment_subscr_conn_cmd); + install_element_ve(&assignment_any_cmd); install_element_ve(&show_paging_cmd); install_element_ve(&show_paging_group_cmd); -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: vty: fix 'show lchan ...' arg [lchan_nr] to [<0-7>] Message-ID: Review at https://gerrit.osmocom.org/5930 vty: fix 'show lchan ...' arg [lchan_nr] to [<0-7>] A lower-case argument is a keyword, not a variable placeholder. Hence the user would not be able to pass a number, just the "lchan_nr" string itself, hence this would never work. Depending on pchan, lchans can range 0..7, so use that instead. Change-Id: Ib9a0b43b68c4682cd6de24d01c0de421c9ce957a --- M src/libbsc/bsc_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/30/5930/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index e60bdaf..dcdd28a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1297,7 +1297,7 @@ DEFUN(show_lchan, show_lchan_cmd, - "show lchan [<0-255>] [<0-255>] [<0-7>] [lchan_nr]", + "show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "BTS Number\n" "TRX Number\n" "Timeslot Number\n" LCHAN_NR_STR) @@ -1308,7 +1308,7 @@ DEFUN(show_lchan_summary, show_lchan_summary_cmd, - "show lchan summary [<0-255>] [<0-255>] [<0-7>] [lchan_nr]", + "show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "Short summary\n" "BTS Number\n" "TRX Number\n" "Timeslot Number\n" -- To view, visit https://gerrit.osmocom.org/5930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9a0b43b68c4682cd6de24d01c0de421c9ce957a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:59:37 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:59:37 +0000 Subject: [PATCH] osmo-bsc[master]: vty: change handover command's arg LCHAN_NR to <0-7> Message-ID: Review at https://gerrit.osmocom.org/5931 vty: change handover command's arg LCHAN_NR to <0-7> Even thought the lchan number range depends on the pchan, using LCHAN_NR allows passing arbitrary arguments. Limit it to 0-7. Change-Id: I2c078b420b6183862acb5c18d1230cf8f6c9f0ce --- M src/libbsc/bsc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/31/5931/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index dcdd28a..983ce20 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1344,7 +1344,7 @@ DEFUN(handover_subscr_conn, handover_subscr_conn_cmd, - "handover <0-255> <0-255> <0-7> LCHAN_NR <0-255>", + "handover <0-255> <0-255> <0-7> <0-7> <0-255>", "Handover subscriber connection to other BTS\n" "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" LCHAN_NR_STR "BTS Number (new)\n") -- To view, visit https://gerrit.osmocom.org/5931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2c078b420b6183862acb5c18d1230cf8f6c9f0ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:59:38 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:59:38 +0000 Subject: [PATCH] osmo-bsc[master]: vty: cosmetic: use common BTS, TRX, TS, LCHAN strings Message-ID: Review at https://gerrit.osmocom.org/5932 vty: cosmetic: use common BTS, TRX, TS, LCHAN strings Change-Id: Ic015ebd3a330769638dddeab2f52321b0302a5a1 --- M src/libbsc/bsc_vty.c 1 file changed, 27 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/32/5932/1 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 983ce20..aafdd2d 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -64,9 +64,13 @@ #include "../../bscconfig.h" - +#define BTS_NR_STR "BTS Number\n" +#define TRX_NR_STR "TRX Number\n" +#define TS_NR_STR "Timeslot Number\n" #define LCHAN_NR_STR "Logical Channel Number\n" - +#define BTS_TRX_STR BTS_NR_STR TRX_NR_STR +#define BTS_TRX_TS_STR BTS_TRX_STR TS_NR_STR +#define BTS_TRX_TS_LCHAN_STR BTS_TRX_TS_STR LCHAN_NR_STR /* FIXME: this should go to some common file */ static const struct value_string gprs_ns_timer_strs[] = { @@ -883,8 +887,7 @@ show_trx_cmd, "show trx [<0-255>] [<0-255>]", SHOW_STR "Display information about a TRX\n" - "BTS Number\n" - "TRX Number\n") + BTS_TRX_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts = NULL; @@ -944,7 +947,7 @@ show_ts_cmd, "show timeslot [<0-255>] [<0-255>] [<0-7>]", SHOW_STR "Display information about a TS\n" - "BTS Number\n" "TRX Number\n" "Timeslot Number\n") + BTS_TRX_TS_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts = NULL; @@ -1299,9 +1302,7 @@ show_lchan_cmd, "show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" - "BTS Number\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR) - + BTS_TRX_TS_LCHAN_STR) { return lchan_summary(vty, argc, argv, lchan_dump_full_vty); } @@ -1311,8 +1312,7 @@ "show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "Short summary\n" - "BTS Number\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR) + BTS_TRX_TS_LCHAN_STR) { return lchan_summary(vty, argc, argv, lchan_dump_short_vty); } @@ -1346,8 +1346,8 @@ handover_subscr_conn_cmd, "handover <0-255> <0-255> <0-7> <0-7> <0-255>", "Handover subscriber connection to other BTS\n" - "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR "BTS Number (new)\n") + "Current " BTS_TRX_TS_LCHAN_STR + "New " BTS_NR_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_subscriber_connection *conn; @@ -1415,7 +1415,7 @@ show_paging_cmd, "show paging [<0-255>]", SHOW_STR "Display information about paging reuqests of a BTS\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts; @@ -1446,7 +1446,7 @@ show_paging_group_cmd, "show paging-group <0-255> IMSI", SHOW_STR "Display the paging group\n" - "BTS Number\n" "IMSI\n") + BTS_NR_STR "IMSI\n") { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts; @@ -1646,7 +1646,7 @@ cfg_bts_cmd, "bts <0-255>", "Select a BTS to configure\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); int bts_nr = atoi(argv[0]); @@ -3125,7 +3125,8 @@ DEFUN(cfg_bts_depends_on, cfg_bts_depends_on_cmd, "depends-on-bts <0-255>", - "This BTS can only be started if another one is up\n" "BTS Number\n") + "This BTS can only be started if another one is up\n" + BTS_NR_STR) { struct gsm_bts *bts = vty->index; struct gsm_bts *other_bts; @@ -3158,7 +3159,7 @@ DEFUN(cfg_bts_no_depends_on, cfg_bts_no_depends_on_cmd, "depeneds-on-bts <0-255>", NO_STR "This BTS can only be started if another one is up\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_bts *bts = vty->index; int dep = atoi(argv[0]); @@ -3834,7 +3835,7 @@ DEFUN(restart_bts, restart_bts_cmd, "restart-bts <0-65535>", "Restart ip.access nanoBTS through OML\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_network *gsmnet; struct gsm_bts_trx *trx; @@ -3871,7 +3872,7 @@ DEFUN(bts_resend, bts_resend_cmd, "bts <0-255> resend-system-information", - "BTS Specific Commands\n" "BTS Number\n" + "BTS Specific Commands\n" BTS_NR_STR "Re-generate + re-send BCCH SYSTEM INFORMATION\n") { struct gsm_network *gsmnet; @@ -3903,7 +3904,7 @@ DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", - "BTS related commands\n" "BTS Number\n" + "BTS related commands\n" BTS_NR_STR "SMS Cell Broadcast\n" "Last Valid Block\n" "Hex Encoded SMSCB message (up to 88 octets)\n") { @@ -3979,8 +3980,8 @@ DEFUN(pdch_act, pdch_act_cmd, "bts <0-255> trx <0-255> timeslot <0-7> pdch (activate|deactivate)", - "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" - "TRX Timeslot\n" "Timeslot Number\n" "Packet Data Channel\n" + "BTS related commands\n" BTS_NR_STR "Transceiver\n" TRX_NR_STR + "TRX Timeslot\n" TS_NR_STR "Packet Data Channel\n" "Activate Dynamic PDCH/TCH (-> PDCH mode)\n" "Deactivate Dynamic PDCH/TCH (-> TCH mode)\n") { @@ -4065,8 +4066,8 @@ * performance testing (FER/RBER/...) */ DEFUN(lchan_act, lchan_act_cmd, "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> (activate|deactivate) (hr|fr|efr|amr) [<0-7>]", - "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" - "TRX Timeslot\n" "Timeslot Number\n" "Sub-Slot Number\n" "Sub-Slot Number\n" + "BTS related commands\n" BTS_NR_STR "Transceiver\n" TRX_NR_STR + "TRX Timeslot\n" TS_NR_STR "Sub-Slot Number\n" LCHAN_NR_STR "Manual Channel Activation (e.g. for BER test)\n" "Manual Channel Deactivation (e.g. for BER test)\n" "Half-Rate v1\n" "Full-Rate\n" "Enhanced Full Rate\n" "Adaptive Multi-Rate\n" "AMR Mode\n") @@ -4133,8 +4134,8 @@ DEFUN(lchan_mdcx, lchan_mdcx_cmd, "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> mdcx A.B.C.D <0-65535>", - "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" - "TRX Timeslot\n" "Timeslot Number\n" "Sub-Slot\n" "Sub-Slot Number\n" + "BTS related commands\n" BTS_NR_STR "Transceiver\n" TRX_NR_STR + "TRX Timeslot\n" TS_NR_STR "Sub-Slot\n" LCHAN_NR_STR "Modify RTP Connection\n" "MGW IP Address\n" "MGW UDP Port\n") { struct gsm_bts_trx_ts *ts; -- To view, visit https://gerrit.osmocom.org/5932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic015ebd3a330769638dddeab2f52321b0302a5a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 14:59:38 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 14:59:38 +0000 Subject: osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5889/1/src/libbsc/bsc_vty.c File src/libbsc/bsc_vty.c: Line 1420: "handover <0-255> <0-255> <0-7> LCHAN_NR <0-255>", > lchan numbers are 0..8 as the lchan[] array is 8 in size. Rationale: SDCCH/ This is actually not an addition, just looks like one from the way the patch is interpreted. The LCHAN_NR argument exists in HEAD. It was probably chosen such because the maximum lchan nr depends on the pchan type; not that that makes a lot of sense. I'll change that separately. Even more interesting is: show lchan [<0-255>] [<0-255>] [<0-7>] [lchan_nr] "lchan_nr" appears to be an optional *string constant*? -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:03:13 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 15:03:13 +0000 Subject: [PATCH] osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5889 to look at the new patch set (#3). vty: add various manual handover and assignment trigger commands Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 --- M src/libbsc/bsc_vty.c 1 file changed, 192 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/89/5889/3 diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index aafdd2d..75b0b9a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1342,12 +1342,27 @@ return CMD_SUCCESS; } -DEFUN(handover_subscr_conn, - handover_subscr_conn_cmd, - "handover <0-255> <0-255> <0-7> <0-7> <0-255>", - "Handover subscriber connection to other BTS\n" - "Current " BTS_TRX_TS_LCHAN_STR - "New " BTS_NR_STR) +static int trigger_ho_or_as(struct vty *vty, struct gsm_lchan *from_lchan, struct gsm_bts *to_bts) +{ + int rc; + + if (!to_bts || from_lchan->ts->trx->bts == to_bts) { + LOGP(DHO, LOGL_NOTICE, "%s Manually triggering Assignment from VTY\n", + gsm_lchan_name(from_lchan)); + to_bts = from_lchan->ts->trx->bts; + } else + LOGP(DHO, LOGL_NOTICE, "%s (ARFCN %u) --> BTS %u Manually triggering Handover from VTY\n", + gsm_lchan_name(from_lchan), from_lchan->ts->trx->arfcn, to_bts->nr); + rc = bsc_handover_start(from_lchan, to_bts); + if (rc) { + vty_out(vty, "bsc_handover_start() returned %d=%s%s", rc, + strerror(-rc), VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +static int ho_or_as(struct vty *vty, const char *argv[], int argc) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_subscriber_connection *conn; @@ -1357,41 +1372,190 @@ unsigned int trx_nr = atoi(argv[1]); unsigned int ts_nr = atoi(argv[2]); unsigned int ss_nr = atoi(argv[3]); - unsigned int bts_nr_new = atoi(argv[4]); + unsigned int bts_nr_new; + const char *action; - /* Lookup the BTS where we want to handover to */ - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == bts_nr_new) { - new_bts = bts; - break; + if (argc > 4) { + bts_nr_new = atoi(argv[4]); + + /* Lookup the BTS where we want to handover to */ + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == bts_nr_new) { + new_bts = bts; + break; + } + } + + if (!new_bts) { + vty_out(vty, "Unable to trigger handover, specified bts #%u does not exist %s", + bts_nr_new, VTY_NEWLINE); + return CMD_WARNING; } } - if (!new_bts) { - vty_out(vty, "Unable to trigger handover," - "specified bts #%u does not exist %s", bts_nr_new, - VTY_NEWLINE); - return CMD_WARNING; - } + action = new_bts ? "handover" : "assignment"; /* Find the connection/lchan that we want to handover */ llist_for_each_entry(conn, &net->subscr_conns, entry) { if (conn_get_bts(conn)->nr == bts_nr && conn->lchan->ts->trx->nr == trx_nr && conn->lchan->ts->nr == ts_nr && conn->lchan->nr == ss_nr) { - vty_out(vty, "starting handover for lchan %s...%s", - conn->lchan->name, VTY_NEWLINE); + vty_out(vty, "starting %s for lchan %s...%s", action, conn->lchan->name, VTY_NEWLINE); lchan_dump_full_vty(vty, conn->lchan); - bsc_handover_start(conn->lchan, new_bts); - return CMD_SUCCESS; + return trigger_ho_or_as(vty, conn->lchan, new_bts); } } - vty_out(vty, "Unable to trigger handover," - "specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", - bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); + vty_out(vty, "Unable to trigger %s, specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", + action, bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); return CMD_WARNING; +} + +#define MANUAL_HANDOVER_STR "Manually trigger handover (for debugging)\n" +#define MANUAL_ASSIGNMENT_STR "Manually trigger assignment (for debugging)\n" + +DEFUN(handover_subscr_conn, + handover_subscr_conn_cmd, + "handover <0-255> <0-255> <0-7> <0-7> <0-255>", + MANUAL_HANDOVER_STR + "Current " BTS_TRX_TS_LCHAN_STR + "New " BTS_NR_STR) +{ + return ho_or_as(vty, argv, argc); +} + +DEFUN(assignment_subscr_conn, + assignment_subscr_conn_cmd, + "assignment <0-255> <0-255> <0-7> <0-7>", + MANUAL_ASSIGNMENT_STR + "Current " BTS_TRX_TS_LCHAN_STR) +{ + return ho_or_as(vty, argv, argc); +} + +static struct gsm_lchan *find_used_voice_lchan(struct vty *vty) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_ACTIVE + && (lchan->type == GSM_LCHAN_TCH_F + || lchan->type == GSM_LCHAN_TCH_H)) { + + vty_out(vty, "Found voice call: %s%s", + gsm_lchan_name(lchan), VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return lchan; + } + } + } + } + } + + vty_out(vty, "Cannot find any ongoing voice calls%s", VTY_NEWLINE); + return NULL; +} + +static struct gsm_bts *find_other_bts_with_free_slots(struct vty *vty, struct gsm_bts *not_this_bts, + enum gsm_phys_chan_config free_type) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + if (bts == not_this_bts) + continue; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + if (ts->pchan != free_type) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_NONE) { + vty_out(vty, "Found unused %s slot: %s%s", + gsm_pchan_name(free_type), + gsm_lchan_name(lchan), + VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return bts; + } + } + } + } + } + vty_out(vty, "Cannot find any BTS (other than BTS %u) with free %s lchan%s", + not_this_bts? not_this_bts->nr : 255, gsm_lchant_name(free_type), VTY_NEWLINE); + return NULL; +} + +DEFUN(handover_any, handover_any_cmd, + "handover any", + MANUAL_HANDOVER_STR + "Pick any actively used TCH/F or TCH/H lchan and handover to any other BTS." + " This is likely to fail if not all BTS are guaranteed to be reachable by the MS.\n") +{ + struct gsm_lchan *from_lchan; + struct gsm_bts *to_bts; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, + ts_pchan(from_lchan->ts)); + if (!to_bts) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, to_bts); +} + +DEFUN(assignment_any, assignment_any_cmd, + "assignment any", + MANUAL_ASSIGNMENT_STR + "Pick any actively used TCH/F or TCH/H lchan and re-assign within the same BTS." + " This will fail if no lchans of the same type are available besides the used one.\n") +{ + struct gsm_lchan *from_lchan; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, NULL); } static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag) @@ -4213,6 +4377,9 @@ install_element_ve(&show_subscr_conn_cmd); install_element_ve(&handover_subscr_conn_cmd); + install_element_ve(&handover_any_cmd); + install_element_ve(&assignment_subscr_conn_cmd); + install_element_ve(&assignment_any_cmd); install_element_ve(&show_paging_cmd); install_element_ve(&show_paging_group_cmd); -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:03:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:03:48 +0000 Subject: osmo-bts[master]: bts-trx: trx_if.c: Log timedout+retransmitted CMD In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a Gerrit-PatchSet: 2 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 Jan 19 15:04:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:04:29 +0000 Subject: osmo-bts[master]: bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e 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: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:06:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:06:21 +0000 Subject: osmo-bts[master]: bts-trx: trx_if.c: Improve parsing of received RSP messages ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034 Gerrit-PatchSet: 2 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 Jan 19 15:07:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:07:18 +0000 Subject: osmo-bts[master]: bts-trx: Detect duplicated responses for retransmitted commands In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a Gerrit-PatchSet: 2 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 Jan 19 15:07:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:07:20 +0000 Subject: [MERGED] osmo-bts[master]: bts-trx: Detect duplicated responses for retransmitted commands In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bts-trx: Detect duplicated responses for retransmitted commands ...................................................................... bts-trx: Detect duplicated responses for retransmitted commands It was detected that under some conditions, osmo-trx (with limesdr) may take a long time to answer to CMDs, which means trx_ctrl_timer will trigger re-transmitting the last sent but yet unacked CMD. Due to the high latency in osmo-trx, the original AND the rentrasnmited CMD are handled after a while and RSP messages are sent for both. When osmo-bts-trx receives the first RSP, it was marking the CMD as acked and carried on with next one. Then, when the RSP from the retransmited CMD arrives, it already lost state and doesn't know where does that come from. As a result, osmo-bts-trx shutdowns. The issue can be seen in the following truncated log from osmo-bts-trx with TRX category enabled: 20180117135228175 Enqueuing TRX control command 'CMD RXTUNE 1782000' 20180117135228175 Enqueuing TRX control command 'CMD TXTUNE 1877000' 20180117135228175 Enqueuing TRX control command 'CMD SETTSC 7' 20180117135228175 Enqueuing TRX control command 'CMD POWERON' 20180117135228175 Enqueuing TRX control command 'CMD SETRXGAIN 1' 20180117135228175 Enqueuing TRX control command 'CMD SETPOWER 20' 20180117135228175 Enqueuing TRX control command 'CMD SETSLOT 0 5' ... 20180117135249829 Response message: 'RSP POWEROFF 0' 20180117135249855 Response message: 'RSP RXTUNE 0 1782000' 20180117135249876 Response message: 'RSP TXTUNE 0 1877000' 20180117135249876 Response message: 'RSP SETTSC 0 7' 20180117135250648 Response message: 'RSP POWERON 0' 20180117135251150 Response message: 'RSP SETRXGAIN 0 0' 20180117135253151 No response from transceiver for phy0.0 (CMD SETPOWER 20) 20180117135253777 Response message: 'RSP SETPOWER 0 20' 20180117135254535 Clock indication: fn=2018878 20180117135255777 No response from transceiver for phy0.0 (CMD SETSLOT 0 5) ... 20180117135256858 Response message: 'RSP SETPOWER 0 20' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETPOWER 0 20' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Response message: 'RSP SETSLOT 0 0 5' 20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETSLOT 0 0 5' Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a --- M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c 2 files changed, 19 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index d978c44..e7b5386 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -3,6 +3,7 @@ #include #include +#include "trx_if.h" struct trx_config { uint8_t poweron; /* poweron(1) or poweroff(0) */ @@ -46,6 +47,8 @@ struct trx_l1h { struct llist_head trx_ctrl_list; + /* Latest RSPed cmd, used to catch duplicate RSPs from sent retransmissions */ + struct trx_ctrl_msg *last_acked; //struct gsm_bts_trx *trx; struct phy_instance *phy_inst; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index a8026d4..35698ef 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -455,6 +455,12 @@ /* get command for response message */ if (llist_empty(&l1h->trx_ctrl_list)) { + /* RSP from a retransmission, skip it */ + if (l1h->last_acked && cmd_matches_rsp(l1h->last_acked, cmdname, params)) { + LOGP(DTRX, LOGL_NOTICE, "Discarding duplicated RSP " + "from old CMD '%s'\n", buf); + return 0; + } LOGP(DTRX, LOGL_NOTICE, "Response message without " "command\n"); return -EINVAL; @@ -464,6 +470,12 @@ /* check if response matches command */ if (!cmd_matches_rsp(tcm, cmdname, params)) { + /* RSP from a retransmission, skip it */ + if (l1h->last_acked && cmd_matches_rsp(l1h->last_acked, cmdname, params)) { + LOGP(DTRX, LOGL_NOTICE, "Discarding duplicated RSP " + "from old CMD '%s'\n", buf); + return 0; + } LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, "Response message '%s' does not match command " "message 'CMD %s%s%s'\n", @@ -481,9 +493,10 @@ goto rsp_error; } - /* remove command from list */ + /* remove command from list, save it to last_acked and removed previous last_acked */ llist_del(&tcm->list); - talloc_free(tcm); + talloc_free(l1h->last_acked); + l1h->last_acked = tcm; trx_ctrl_send(l1h); @@ -621,6 +634,7 @@ llist_del(&tcm->list); talloc_free(tcm); } + talloc_free(l1h->last_acked); } /*! close the TRX for given handle (data + control socket) */ -- To view, visit https://gerrit.osmocom.org/5856 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a 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 Fri Jan 19 15:07:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:07:21 +0000 Subject: [MERGED] osmo-bts[master]: bts-trx: trx_if.c: Improve parsing of received RSP messages ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bts-trx: trx_if.c: Improve parsing of received RSP messages from TRX ...................................................................... bts-trx: trx_if.c: Improve parsing of received RSP messages from TRX First the cached CMD sent (struct trx_ctrl_msg) is reworked to have the cmdname and the params in different buffers for easier comparison with RSP later. For the receive path (trx_ctrl_read_cb), new function helpers are added to parse the buffer into cmdname+params+code (parse_rsp) and to compare if a given RSP matches the current CMD we sent (cmd_matches_rsp). The reasoning behind this patch is that a way to check for parameters when receiving a RSP will be needed in future work, as before this patch checking of parameters is ignored. This commit is a preparation for commit to check for duplicated responses. Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034 --- M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h 2 files changed, 131 insertions(+), 71 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 74a2257..a8026d4 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -146,16 +146,20 @@ static void trx_ctrl_send(struct trx_l1h *l1h) { struct trx_ctrl_msg *tcm; + char buf[1500]; + int len; /* get first command */ if (llist_empty(&l1h->trx_ctrl_list)) return; tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - LOGP(DTRX, LOGL_DEBUG, "Sending control '%s' to %s\n", tcm->cmd, - phy_instance_name(l1h->phy_inst)); + len = snprintf(buf, sizeof(buf), "CMD %s%s%s", tcm->cmd, tcm->params_len ? " ":"", tcm->params); + OSMO_ASSERT(len < sizeof(buf)); + + LOGP(DTRX, LOGL_DEBUG, "Sending control '%s' to %s\n", buf, phy_instance_name(l1h->phy_inst)); /* send command */ - send(l1h->trx_ofd_ctrl.fd, tcm->cmd, strlen(tcm->cmd)+1, 0); + send(l1h->trx_ofd_ctrl.fd, buf, len+1, 0); /* start timer */ l1h->trx_ctrl_timer.cb = trx_ctrl_timer_cb; @@ -173,8 +177,9 @@ OSMO_ASSERT(!llist_empty(&l1h->trx_ctrl_list)); tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s (%s)\n", - phy_instance_name(l1h->phy_inst), tcm->cmd); + LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s (CMD %s%s%s)\n", + phy_instance_name(l1h->phy_inst), + tcm->cmd, tcm->params_len ? " ":"", tcm->params); trx_ctrl_send(l1h); } @@ -193,8 +198,9 @@ const char *fmt, ...) { struct trx_ctrl_msg *tcm; + struct trx_ctrl_msg *prev = NULL; va_list ap; - int l, pending; + int pending; if (!transceiver_available && !(!strcmp(cmd, "POWEROFF") || !strcmp(cmd, "POWERON"))) { @@ -209,21 +215,29 @@ tcm = talloc_zero(tall_bts_ctx, struct trx_ctrl_msg); if (!tcm) return -ENOMEM; - if (fmt && fmt[0]) { - l = snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "CMD %s ", cmd); - va_start(ap, fmt); - vsnprintf(tcm->cmd + l, sizeof(tcm->cmd) - l - 1, fmt, ap); - va_end(ap); - } else - snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "CMD %s", cmd); + snprintf(tcm->cmd, sizeof(tcm->cmd)-1, "%s", cmd); tcm->cmd[sizeof(tcm->cmd)-1] = '\0'; - tcm->cmd_len = strlen(cmd); + tcm->cmd_len = strlen(tcm->cmd); + if (fmt && fmt[0]) { + va_start(ap, fmt); + vsnprintf(tcm->params, sizeof(tcm->params) - 1, fmt, ap); + va_end(ap); + tcm->params[sizeof(tcm->params)-1] = '\0'; + tcm->params_len = strlen(tcm->params); + } else { + tcm->params[0] ='\0'; + tcm->params_len = 0; + } tcm->critical = critical; /* Avoid adding consecutive duplicate messages, eg: two consecutive POWEROFF */ + if(pending) + prev = llist_entry(l1h->trx_ctrl_list.prev, struct trx_ctrl_msg, list); + if (!pending || - strcmp(tcm->cmd, llist_entry(l1h->trx_ctrl_list.prev, struct trx_ctrl_msg, list)->cmd)) { - LOGP(DTRX, LOGL_INFO, "Enqueuing TRX control command '%s'\n", tcm->cmd); + !(strcmp(tcm->cmd, prev->cmd) == 0 && strcmp(tcm->params, prev->params) == 0)) { + LOGP(DTRX, LOGL_INFO, "Enqueuing TRX control command 'CMD %s%s%s'\n", + tcm->cmd, tcm->params_len ? " ":"", tcm->params); llist_add_tail(&tcm->list, &l1h->trx_ctrl_list); } @@ -354,80 +368,124 @@ return trx_ctrl_cmd(l1h, 1, "NOHANDOVER", "%d %d", tn, ss); } +static int parse_rsp(const char *buf_in, size_t len_in, char *cmdname_out, size_t cmdname_len, + char *params_out, size_t params_len, int *status) +{ + char *p, *k; + + if (strncmp(buf_in, "RSP ", 4)) + goto parse_err; + + /* Get the RSP cmd name */ + if (!(p = strchr(buf_in + 4, ' '))) + goto parse_err; + + if (p - buf_in >= cmdname_len) { + LOGP(DTRX, LOGL_ERROR, "cmdname buffer too small %lu >= %lu\n", + p - buf_in, cmdname_len); + goto parse_err; + } + + cmdname_out[0] = '\0'; + strncat(cmdname_out, buf_in + 4, p - buf_in - 4); + + /* Now comes the status code of the response */ + p++; + if (sscanf(p, "%d", status) != 1) + goto parse_err; + + /* Now copy back the parameters */ + k = strchr(p, ' '); + if (k) + k++; + else + k = p + strlen(p); + + if (strlen(k) >= params_len) { + LOGP(DTRX, LOGL_ERROR, "params buffer too small %lu >= %lu\n", + strlen(k), params_len); + goto parse_err; + } + params_out[0] = '\0'; + strcat(params_out, k); + return 0; + +parse_err: + LOGP(DTRX, LOGL_NOTICE, "Unknown message on ctrl port: %s\n", + buf_in); + return -1; +} + +static bool cmd_matches_rsp(struct trx_ctrl_msg *tcm, char *rspname, char* params) +{ + if (strcmp(tcm->cmd, rspname)) + return false; + + /* For SETSLOT we also need to check if it's the response for the + specific timeslot. For other commands such as SETRXGAIN, it is + expected that they can return different values */ + if (strcmp(tcm->cmd, "SETSLOT") == 0 && strcmp(tcm->params, params)) + return false; + + return true; +} + /*! 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; struct phy_instance *pinst = l1h->phy_inst; - char buf[1500]; + char buf[1500], cmdname[50], params[100]; int len, resp; + struct trx_ctrl_msg *tcm; len = recv(ofd->fd, buf, sizeof(buf) - 1, 0); if (len <= 0) return len; buf[len] = '\0'; - if (!strncmp(buf, "RSP ", 4)) { - struct trx_ctrl_msg *tcm; - char *p; - int rsp_len = 0; + if (parse_rsp(buf, len, cmdname, sizeof(cmdname), params, sizeof(params), &resp) < 0) + return 0; - /* calculate the length of response item */ - p = strchr(buf + 4, ' '); - if (p) - rsp_len = p - buf - 4; - else - rsp_len = strlen(buf) - 4; + LOGP(DTRX, LOGL_INFO, "Response message: '%s'\n", buf); - LOGP(DTRX, LOGL_INFO, "Response message: '%s'\n", buf); + /* abort timer and send next message, if any */ + if (osmo_timer_pending(&l1h->trx_ctrl_timer)) + osmo_timer_del(&l1h->trx_ctrl_timer); - /* abort timer and send next message, if any */ - if (osmo_timer_pending(&l1h->trx_ctrl_timer)) - osmo_timer_del(&l1h->trx_ctrl_timer); + /* get command for response message */ + if (llist_empty(&l1h->trx_ctrl_list)) { + LOGP(DTRX, LOGL_NOTICE, "Response message without " + "command\n"); + return -EINVAL; + } + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, + list); - /* get command for response message */ - if (llist_empty(&l1h->trx_ctrl_list)) { - LOGP(DTRX, LOGL_NOTICE, "Response message without " - "command\n"); - return -EINVAL; - } - tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, - list); + /* check if response matches command */ + if (!cmd_matches_rsp(tcm, cmdname, params)) { + LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, + "Response message '%s' does not match command " + "message 'CMD %s%s%s'\n", + buf, tcm->cmd, tcm->params_len ? " ":"", tcm->params); + goto rsp_error; + } - /* check if response matches command */ - if (rsp_len != tcm->cmd_len) { - notmatch: - LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, - "Response message '%s' does not match command " - "message '%s'\n", buf, tcm->cmd); + /* check for response code */ + if (resp) { + LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, + "transceiver (%s) rejected TRX command " + "with response: '%s'\n", + phy_instance_name(pinst), buf); + if (tcm->critical) goto rsp_error; - } - OSMO_ASSERT(strlen(buf+4) >= rsp_len); - OSMO_ASSERT(strlen(tcm->cmd+4) >= rsp_len); - if (!!strncmp(buf + 4, tcm->cmd + 4, rsp_len)) - goto notmatch; + } - /* check for response code */ - resp = 0; - if (p) - sscanf(p + 1, "%d", &resp); - if (resp) { - LOGP(DTRX, (tcm->critical) ? LOGL_FATAL : LOGL_NOTICE, - "transceiver (%s) rejected TRX command " - "with response: '%s'\n", - phy_instance_name(pinst), buf); - if (tcm->critical) - goto rsp_error; - } + /* remove command from list */ + llist_del(&tcm->list); + talloc_free(tcm); - /* remove command from list */ - llist_del(&tcm->list); - talloc_free(tcm); - - trx_ctrl_send(l1h); - } else - LOGP(DTRX, LOGL_NOTICE, "Unknown message on ctrl port: %s\n", - buf); + trx_ctrl_send(l1h); return 0; diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 076e35e..b161044 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -7,8 +7,10 @@ struct trx_ctrl_msg { struct llist_head list; - char cmd[128]; + char cmd[28]; + char params[100]; int cmd_len; + int params_len; int critical; }; -- To view, visit https://gerrit.osmocom.org/5855 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034 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 Fri Jan 19 15:07:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:07:21 +0000 Subject: [MERGED] osmo-bts[master]: bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func ...................................................................... bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func The move includes a small logic change: If there's a mismatch between the rsp and the cmd, now we bts_shutdown instead of blindly skipping expected RSP and continuing with sending the next CMD in the queue. The change is specially not a problem since next patches are improving the logic furthermore to account for duplicates, different parameters, etc. Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e --- M src/osmo-bts-trx/trx_if.c 1 file changed, 7 insertions(+), 6 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/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 8123de0..74a2257 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -416,12 +416,8 @@ "transceiver (%s) rejected TRX command " "with response: '%s'\n", phy_instance_name(pinst), buf); -rsp_error: - if (tcm->critical) { - bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); - /* keep tcm list, so process is stopped */ - return -EIO; - } + if (tcm->critical) + goto rsp_error; } /* remove command from list */ @@ -434,6 +430,11 @@ buf); return 0; + +rsp_error: + bts_shutdown(pinst->trx->bts, "TRX-CTRL-MSG: CRITICAL"); + /* keep tcm list, so process is stopped */ + return -EIO; } -- To view, visit https://gerrit.osmocom.org/5854 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e 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: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:07:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:07:21 +0000 Subject: [MERGED] osmo-bts[master]: bts-trx: trx_if.c: Log timedout+retransmitted CMD In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bts-trx: trx_if.c: Log timedout+retransmitted CMD ...................................................................... bts-trx: trx_if.c: Log timedout+retransmitted CMD Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a --- M src/osmo-bts-trx/trx_if.c 1 file changed, 7 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 57fd953..8123de0 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -167,9 +167,14 @@ static void trx_ctrl_timer_cb(void *data) { struct trx_l1h *l1h = data; + struct trx_ctrl_msg *tcm = NULL; - LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s\n", - phy_instance_name(l1h->phy_inst)); + /* get first command */ + OSMO_ASSERT(!llist_empty(&l1h->trx_ctrl_list)); + tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); + + LOGP(DTRX, LOGL_NOTICE, "No response from transceiver for %s (%s)\n", + phy_instance_name(l1h->phy_inst), tcm->cmd); trx_ctrl_send(l1h); } -- To view, visit https://gerrit.osmocom.org/5853 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a 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 Fri Jan 19 15:10:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:10:38 +0000 Subject: osmo-msc[master]: Delete SMS from the database once they were sent successfully In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:10:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:10:44 +0000 Subject: [MERGED] osmo-msc[master]: Delete SMS from the database once they were sent successfully In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Delete SMS from the database once they were sent successfully ...................................................................... Delete SMS from the database once they were sent successfully Currently the SMS database keeps accumulating entries for each SMS. These entries are never deleted automatically. With this change, we start deleting SMS which have successfully been sent to subscriber B. Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78 --- M include/osmocom/msc/db.h M src/libmsc/db.c M src/libmsc/sms_queue.c 3 files changed, 18 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 988c9bd..13c5ed3 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -49,6 +49,7 @@ int db_sms_mark_delivered(struct gsm_sms *sms); int db_sms_inc_deliver_attempts(struct gsm_sms *sms); int db_sms_delete_by_msisdn(const char *msisdn); +int db_sms_delete_sent_message_by_id(unsigned long long sms_id); /* Statistics counter storage */ struct osmo_counter; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 7007c7a..e80ef53 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -970,6 +970,22 @@ return 0; } +int db_sms_delete_sent_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + + result = dbi_conn_queryf(conn, + "DELETE FROM SMS WHERE id = %llu AND sent is NOT NULL", + sms_id); + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to delete SMS %llu.\n", sms_id); + return 1; + } + + dbi_result_free(result); + return 0; +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 609a0db..1372a2c 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -483,6 +483,7 @@ network->sms_queue->pending -= 1; vsub = vlr_subscr_get(pending->vsub); sms_pending_free(pending); + db_sms_delete_sent_message_by_id(pending->sms_id); /* Attempt to send another SMS to this subscriber */ sms_send_next(vsub); vlr_subscr_put(vsub); -- To view, visit https://gerrit.osmocom.org/5882 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3749855fe25d9d4e37ec96b0c2bffbc692b66a78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:10:57 +0000 Subject: osmo-sgsn[master]: Use gsm48_encode_ra() for RAI encoding In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:11:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:11:02 +0000 Subject: [MERGED] osmo-sgsn[master]: Use gsm48_encode_ra() for RAI encoding In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use gsm48_encode_ra() for RAI encoding ...................................................................... Use gsm48_encode_ra() for RAI encoding It has stricter type signature which increase the chance of spotting misuse either via compiler warning or with automated scan. This also paves the way for gsm48_construct_ra() deprecation in libosmocore. Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Related: OS#1640 --- M src/gprs/gb_proxy_patch.c M src/gprs/gprs_gmm.c M src/gprs/sgsn_libgtp.c M src/libcommon/gsm_data.c M tests/gbproxy/gbproxy_test.c 5 files changed, 16 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gb_proxy_patch.c b/src/gprs/gb_proxy_patch.c index 4862755..1be9c24 100644 --- a/src/gprs/gb_proxy_patch.c +++ b/src/gprs/gb_proxy_patch.c @@ -32,7 +32,7 @@ extern void *tall_bsc_ctx; /* patch RA identifier in place */ -static void gbproxy_patch_raid(uint8_t *raid_enc, struct gbproxy_peer *peer, +static void gbproxy_patch_raid(struct gsm48_ra_id *raid_enc, struct gbproxy_peer *peer, int to_bss, const char *log_text) { struct gbproxy_patch_state *state = &peer->patch_state; @@ -47,7 +47,7 @@ if (!state->local_mcc || !state->local_mnc) return; - gsm48_parse_ra(&raid, raid_enc); + gsm48_parse_ra(&raid, (uint8_t *)raid_enc); old_mcc = raid.mcc; old_mnc = raid.mnc; @@ -76,7 +76,7 @@ old_mcc, old_mnc, raid.lac, raid.rac, raid.mcc, raid.mnc, raid.lac, raid.rac); - gsm48_construct_ra(raid_enc, &raid); + gsm48_encode_ra(raid_enc, &raid); rate_ctr_inc(&peer->ctrg->ctr[counter]); } @@ -233,14 +233,14 @@ } if (parse_ctx->raid_enc) { - gbproxy_patch_raid(parse_ctx->raid_enc, peer, parse_ctx->to_bss, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->raid_enc, peer, parse_ctx->to_bss, parse_ctx->llc_msg_name); have_patched = 1; } if (parse_ctx->old_raid_enc && !parse_ctx->old_raid_is_foreign) { /* TODO: Patch to invalid if P-TMSI unknown. */ - gbproxy_patch_raid(parse_ctx->old_raid_enc, peer, parse_ctx->to_bss, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->old_raid_enc, peer, parse_ctx->to_bss, parse_ctx->llc_msg_name); have_patched = 1; } @@ -286,7 +286,7 @@ int err_ctr = -1; if (parse_ctx->bssgp_raid_enc) - gbproxy_patch_raid(parse_ctx->bssgp_raid_enc, peer, + gbproxy_patch_raid((struct gsm48_ra_id *)parse_ctx->bssgp_raid_enc, peer, parse_ctx->to_bss, "BSSGP"); if (parse_ctx->need_decryption && diff --git a/src/gprs/gprs_gmm.c b/src/gprs/gprs_gmm.c index 77a5537..9313e98 100644 --- a/src/gprs/gprs_gmm.c +++ b/src/gprs/gprs_gmm.c @@ -448,7 +448,7 @@ aa->att_result = 1; /* GPRS only */ aa->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); aa->radio_prio = 4; /* lowest */ - gsm48_construct_ra((uint8_t *)&aa->ra_id, &mm->ra); + gsm48_encode_ra(&aa->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1505,7 +1505,7 @@ rua->upd_result = 0; /* RA updated */ rua->ra_upd_timer = gprs_secs_to_tmr_floor(sgsn->cfg.timers.T3312); - gsm48_construct_ra((uint8_t *)&rua->ra_id, &mm->ra); + gsm48_encode_ra(&rua->ra_id, &mm->ra); #if 0 /* Optional: P-TMSI signature */ diff --git a/src/gprs/sgsn_libgtp.c b/src/gprs/sgsn_libgtp.c index 1032230..ae293f1 100644 --- a/src/gprs/sgsn_libgtp.c +++ b/src/gprs/sgsn_libgtp.c @@ -268,7 +268,7 @@ raid = mmctx->ra; raid.lac = 0xFFFE; raid.rac = 0xFF; - gsm48_construct_ra(pdp->rai.v, &raid); + gsm48_encode_ra((struct gsm48_ra_id *)pdp->rai.v, &raid); /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index a2837f3..6400963 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -311,15 +311,6 @@ raid->rac = bts->gprs.rac; } -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; diff --git a/tests/gbproxy/gbproxy_test.c b/tests/gbproxy/gbproxy_test.c index 3ebdccb..080c96b 100644 --- a/tests/gbproxy/gbproxy_test.c +++ b/tests/gbproxy/gbproxy_test.c @@ -222,9 +222,9 @@ const uint8_t *convert_ra(struct gprs_ra_id *raid) { - static uint8_t buf[6]; - gsm48_construct_ra(buf, raid); - return buf; + static struct gsm48_ra_id r; + gsm48_encode_ra(&r, raid); + return (const uint8_t *)&r; } /* DTAP - Attach Request */ @@ -582,7 +582,7 @@ OSMO_ASSERT(bssgp_msg_size <= sizeof(msg)); - gsm48_construct_ra(msg + 10, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 10), raid); msg[1] = (uint8_t)(tlli >> 24); msg[2] = (uint8_t)(tlli >> 16); msg[3] = (uint8_t)(tlli >> 8); @@ -713,7 +713,7 @@ msg[5] = (uint8_t)(tlli >> 8); msg[6] = (uint8_t)(tlli >> 0); - gsm48_construct_ra(msg + 9, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid); send_ns_unitdata(nsi, "BVC_SUSPEND", src_addr, 0, msg, sizeof(msg)); } @@ -735,7 +735,7 @@ msg[5] = (uint8_t)(tlli >> 8); msg[6] = (uint8_t)(tlli >> 0); - gsm48_construct_ra(msg + 9, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + 9), raid); send_ns_unitdata(nsi, "BVC_SUSPEND_ACK", src_addr, 0, msg, sizeof(msg)); } @@ -795,7 +795,7 @@ if (raid) { msg[bssgp_msg_size] = BSSGP_IE_ROUTEING_AREA; msg[bssgp_msg_size+1] = 0x86; - gsm48_construct_ra(msg + bssgp_msg_size + 2, raid); + gsm48_encode_ra((struct gsm48_ra_id *)(msg + bssgp_msg_size + 2), raid); bssgp_msg_size += 8; } -- To view, visit https://gerrit.osmocom.org/5680 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2c0f082dc7214ed57a40dad0788e34b838dfac97 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:11:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:11:18 +0000 Subject: [MERGED] osmo-ci[master]: gerrit-verifications.yml: osmo-sgsn: Remove duplicated concu... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gerrit-verifications.yml: osmo-sgsn: Remove duplicated concurrent attribute ...................................................................... gerrit-verifications.yml: osmo-sgsn: Remove duplicated concurrent attribute Change-Id: I808c46c2f4488fd577bb1c23cd13c5b73519265b --- M jobs/gerrit-verifications.yml 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 70c21b5..b402ce7 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -165,7 +165,6 @@ gerrit_project: 'python/{repos}' - osmo-sgsn: - concurrent: true a1_name: IU a1: !!python/tuple [--enable-iu, --disable-iu] concurrent: true -- To view, visit https://gerrit.osmocom.org/5926 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I808c46c2f4488fd577bb1c23cd13c5b73519265b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:13:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:13:15 +0000 Subject: osmo-bsc[master]: vty: fix 'show lchan ...' arg [lchan_nr] to [<0-7>] In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9a0b43b68c4682cd6de24d01c0de421c9ce957a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:13:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:13:39 +0000 Subject: osmo-bsc[master]: vty: change handover command's arg LCHAN_NR to <0-7> In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2c078b420b6183862acb5c18d1230cf8f6c9f0ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:14:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:14:14 +0000 Subject: osmo-bsc[master]: vty: cosmetic: use common BTS, TRX, TS, LCHAN strings In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic015ebd3a330769638dddeab2f52321b0302a5a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:15:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:15:20 +0000 Subject: osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:19:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:19:02 +0000 Subject: osmo-bsc[master]: HO: fix recovery from failed handover In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:19:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 19 Jan 2018 15:19:57 +0000 Subject: libosmocore[master]: libosmocoding: fix typo in library documentation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef 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 Fri Jan 19 15:20:26 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 19 Jan 2018 15:20:26 +0000 Subject: libosmocore[master]: libosmocoding: use frame length definitions from codec.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90 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 Fri Jan 19 15:21:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:21:43 +0000 Subject: osmo-bsc[master]: HO prep: introduce per-BTS handover config, with defaults on... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:22:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:22:23 +0000 Subject: osmo-bsc[master]: HO: Send Channel Mode and Multirate IE along with handover c... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6b17a9be252f1655006ab6773483868017d7926 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:22:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:22:55 +0000 Subject: osmo-bsc[master]: HO: add indicators for inter-cell and async ho, use for chan... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d91765c1f9719c64fd99426a872cecc724215db Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:23:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:23:16 +0000 Subject: osmo-bsc[master]: HO: Add function to count currently ongoing handovers to a g... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8908e37fe0d8d2eda906cc6301ba0969b25a5575 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:23:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:23:37 +0000 Subject: osmo-bsc[master]: cosmetic: explicitly init ho_ref start value In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00493bcb7ef3e38fb8e0077c60c5bac7199f1073 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:24:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:24:01 +0000 Subject: osmo-bsc[master]: Fix: If paging for half rate was requested, use hr, if suppo... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6d1c9701808ee542771fee145250927019a2f5f6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:24:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:24:40 +0000 Subject: osmo-bsc[master]: HO: Assign SDCCH on channel request In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:25:05 +0000 Subject: osmo-bsc[master]: Fix of checking TCH rate at chan_compat_with_mode In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb4cb9aef1a1146f984d7c969bfba53c647cae07 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:26:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:26:26 +0000 Subject: osmo-bsc[master]: HO: Count the actual meas.rep. get_meas_rep_avg fails if not... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibc4410b4e162cdb6c070128d2c63946bb79d6d65 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:26:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:26:47 +0000 Subject: osmo-bsc[master]: HO: Count neighbor measurements and reduce window of neigh_m... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c74f27f9663a3083610c985a080fca331c19bd3 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:27:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:27:04 +0000 Subject: osmo-bsc[master]: fixup: neigh_meas_avg: detect invalid window size as <=0, lo... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c5d0642aeb4fbee73a035b9f73cf3a09b1bcf90 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:27:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:27:22 +0000 Subject: osmo-bsc[master]: fixup: neigh_meas_avg: fix condition to reduce window size In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2269be448436d676289c84b9b05da7f51ee4a85 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:27:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:27:47 +0000 Subject: osmo-bsc[master]: HO: Changed availablilty of ts_is_usable() from static to ex... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3471e38327c4b98490faed9b604fb76438ba9954 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:28:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:28:17 +0000 Subject: osmo-bsc[master]: HO: Always update rqd_ta after receiving measurement report In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If1a592e590cfed55ff3dca5be89e2946e8017a22 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:28:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:28:51 +0000 Subject: osmo-bsc[master]: HO: If handover logic is used to do assignment, signal assig... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I465caef03626e67d9b3a21bdf730589b9852c211 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:29:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:29:07 +0000 Subject: osmo-bsc[master]: HO: Add handover decision debugging category In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf99d4e9ae08c38bf364dbb37d42098f976f6b8c Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:29:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:29:37 +0000 Subject: osmo-bsc[master]: Do not perform assignment, if the new channel equals the cur... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:30:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:30:04 +0000 Subject: osmo-bsc[master]: Allow assignment to TCH channel with signalling only mode In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2efe9d7ab429e902581ebb9e0e006f2aec6d8972 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:30:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:30:59 +0000 Subject: osmo-bsc[master]: Correctly set T3105 for ipaccess BTS type In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d9687619ba4de35f5d2eff3026d903534b2bbd4 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:31:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:31:16 +0000 Subject: osmo-bsc[master]: HO: fix: increase the number of measurement report history t... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia7cfac073bdc464092ca3e51dec319ac30401dd1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:31:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:31:45 +0000 Subject: osmo-bsc[master]: HO: enable handover by initializing at startup; rename init ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:32:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:32:06 +0000 Subject: osmo-bsc[master]: HO: add handover algo 2 parameters; skip HO 1 if HO 2 is con... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:32:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:32:20 +0000 Subject: osmo-bsc[master]: HO: Change debug category at handover decision: DHO -> DHODEC In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:33:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:33:40 +0000 Subject: osmo-bsc[master]: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:33:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:33:59 +0000 Subject: osmo-bsc[master]: HO: make bts_by_arfcn_bsic() public In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:35:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:35:02 +0000 Subject: osmo-bsc[master]: HO: add queue to cache DTAP messages during handover/assignment In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:35:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:35:36 +0000 Subject: osmo-bsc[master]: HO: Add a penalty timer list to the subscriber connection en... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:36:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:36:03 +0000 Subject: osmo-bsc[master]: HO: always use Handover Command, not Assignment In-Reply-To: References: Message-ID: Patch Set 6: Why? -- To view, visit https://gerrit.osmocom.org/5922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:36:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:36:21 +0000 Subject: osmo-bsc[master]: Fix: meas_rep.c will only use valid DL measurement reports In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33056225ead788340755e98113d72e1cbf3ebce6 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:39:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:39:03 +0000 Subject: [MERGED] osmo-mgw[master]: client/common: move constant MGCP_ENDPOINT_MAXLEN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client/common: move constant MGCP_ENDPOINT_MAXLEN ...................................................................... client/common: move constant MGCP_ENDPOINT_MAXLEN MGCP_ENDPOINT_MAXLEN is currently only defined for the mgcp client, since this is in general a common parameter it should be moved to mgcp_common.h so that both sides can use it. Change-Id: I9e1c52aa5ebd83b2d9e5178ea24cb27d96cb7ddd --- M include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp_client/mgcp_client.h 2 files changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 29dc458..7684936 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -72,4 +72,8 @@ * (see also RFC3435 2.1.3.2 Names of Connections) */ #define MGCP_CONN_ID_LENGTH 32+1 +/* String length of Endpoint Identifiers. +/ (see also RFC3435 section 3.2.1.3) */ +#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) + #endif diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 4caf656..882c908 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -55,9 +55,6 @@ #define MGCP_MSG_PRESENCE_AUDIO_PORT 0x0010 #define MGCP_MSG_PRESENCE_CONN_MODE 0x0020 -/* See also RFC3435 section 3.2.1.3 */ -#define MGCP_ENDPOINT_MAXLEN (255*2+1+1) - struct mgcp_msg { enum mgcp_verb verb; /* See MGCP_MSG_PRESENCE_* constants */ -- To view, visit https://gerrit.osmocom.org/5877 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e1c52aa5ebd83b2d9e5178ea24cb27d96cb7ddd Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:39:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:39:04 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp: allow endpoints beginning from zero In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: allow endpoints beginning from zero ...................................................................... mgcp: allow endpoints beginning from zero there is a now obsolete constraint that endpoint numbers must start at 1. - remove the check to allow also endpoints starting at 0 Change-Id: Iec2f4e36e1ab01ff23875d99e4b0e04af7c1ad98 --- M src/libosmo-mgcp/mgcp_msg.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 7f05a44..45195de 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -193,7 +193,7 @@ return find_e1_endpoint(cfg, mgcp); gw = strtoul(mgcp, &endptr, 16); - if (gw > 0 && gw < cfg->trunk.number_endpoints && endptr[0] == '@') + if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; LOGP(DLMGCP, LOGL_ERROR, "Not able to find the endpoint: '%s'\n", mgcp); -- To view, visit https://gerrit.osmocom.org/5876 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iec2f4e36e1ab01ff23875d99e4b0e04af7c1ad98 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:39:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:39:43 +0000 Subject: osmo-iuh[master]: hnbap: log errors on decoding/encoding HNB-REGISTER msgs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:39:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:39:46 +0000 Subject: [MERGED] osmo-iuh[master]: hnbap: log errors on decoding/encoding HNB-REGISTER msgs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbap: log errors on decoding/encoding HNB-REGISTER msgs ...................................................................... hnbap: log errors on decoding/encoding HNB-REGISTER msgs Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1 --- M src/hnbgw_hnbap.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Stefan Sperling: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 2746c21..8fba13c 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -63,6 +63,8 @@ memset(&accept_out, 0, sizeof(accept_out)); rc = hnbap_encode_hnbregisteraccepties(&accept_out, &accept); if (rc < 0) { + LOGP(DHNBAP, LOGL_ERROR, "Failure to encode HNB-REGISTER-ACCEPT to %s: rc=%d\n", + ctx->identity_info, rc); return rc; } @@ -370,8 +372,11 @@ int rc; rc = hnbap_decode_hnbregisterrequesties(&ies, in); - if (rc < 0) + if (rc < 0) { + LOGP(DHNBAP, LOGL_ERROR, "Failure to decode HNB-REGISTER-REQ from %s: rc=%d\n", + ctx->identity_info, rc); return rc; + } /* copy all identity parameters from the message to ctx */ asn1_strncpy(ctx->identity_info, &ies.hnB_Identity.hNB_Identity_Info, -- To view, visit https://gerrit.osmocom.org/5883 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3c039267fa2cc047c5678bcfe4a603f70c21cdd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:40:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:40:46 +0000 Subject: libosmocore[master]: libosmocoding: fix typo in library documentation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef 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 Fri Jan 19 15:42:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:42:57 +0000 Subject: libosmocore[master]: Embedded: add sercomm stubs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:43:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:43:23 +0000 Subject: osmo-gsm-manuals[master]: Add note on vty logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2bb52feb37622d0ef35f6be172759adc3813f008 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:43:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:43:25 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Add note on vty logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add note on vty logging ...................................................................... Add note on vty logging Change-Id: I2bb52feb37622d0ef35f6be172759adc3813f008 --- M common/chapters/logging.adoc 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index beb1341..e79b3ec 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -127,6 +127,10 @@ one only for logging, while the other is used for interacting with the system. Another option would be to use different log target. +To review the current vty logging configuration, you +can use: + `show logging vty` + ==== Logging to the ring buffer To avoid having separate VTY session just for logging output while still having immediate access to them, -- To view, visit https://gerrit.osmocom.org/5868 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2bb52feb37622d0ef35f6be172759adc3813f008 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:43:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:43:37 +0000 Subject: osmo-gsm-manuals[master]: Clarify app-specific log filters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I53e8aed658774781a70fea0b46cafc55496925eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:43:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:43:41 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Clarify app-specific log filters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Clarify app-specific log filters ...................................................................... Clarify app-specific log filters Change-Id: I53e8aed658774781a70fea0b46cafc55496925eb --- M common/chapters/logging.adoc 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index e79b3ec..1b4000b 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -81,7 +81,10 @@ To request no filtering, i.e. see all messages, you may use: `log filter all 1` -As another example, to only see messages relating to a particular +In addition to generic filtering, applications can implement special log filters using the same framework +to filter on particular context. + +For example in OsmoBSC, to only see messages relating to a particular subscriber identified by his IMSI, you may use: `log filter imsi 262020123456789` -- To view, visit https://gerrit.osmocom.org/5866 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I53e8aed658774781a70fea0b46cafc55496925eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:44:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:44:17 +0000 Subject: libosmocore[master]: jenkins: add dispatcher script In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:44:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:44:21 +0000 Subject: [MERGED] libosmocore[master]: jenkins: add dispatcher script In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: add dispatcher script ...................................................................... jenkins: add dispatcher script Similar to the way we test osmo-bts, add simple dispatcher script which calls appropriate test depending on a given parameter. This will allow to simplify the job description. While at it, also rename jenkins-arm.sh -> jenkins_arm.sh to match the OsmoBTS. The older scripts are preserved for compatibility and shall be removed once we update job description in osmo-ci. Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 --- A contrib/jenkins_amd64.sh A contrib/jenkins_arch.sh A contrib/jenkins_arm.sh 3 files changed, 94 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_amd64.sh b/contrib/jenkins_amd64.sh new file mode 100755 index 0000000..d336f0a --- /dev/null +++ b/contrib/jenkins_amd64.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# jenkins build helper script for libosmocore. This is how we build on jenkins.osmocom.org + +. $(dirname "$0")/jenkins_common.sh + +ENABLE_SANITIZE="--enable-sanitize" + +if [ "x$label" = "xFreeBSD_amd64" ]; then + ENABLE_SANITIZE="" +fi + +src_dir="$PWD" +build() { + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + $MAKE V=1 $PARALLEL_MAKE check \ + || cat-testlogs.sh +} + +# verify build in dir other than source tree +build builddir +# verify build in source tree +build . + +# do distcheck only once, which is fine from built source tree, since distcheck +# is well separated from the source tree state. +$MAKE distcheck \ + || cat-testlogs.sh + +osmo-clean-workspace.sh diff --git a/contrib/jenkins_arch.sh b/contrib/jenkins_arch.sh new file mode 100755 index 0000000..bac9278 --- /dev/null +++ b/contrib/jenkins_arch.sh @@ -0,0 +1,33 @@ +#!/bin/sh +# this is a dispatcher script which will call the arch-specific +# script based on the arch specified as command line argument + +arch="$1" + +if [ "x$arch" == "x" ]; then + echo "Error: You have to specify the architecture as first argument, e.g. $0 amd64" + exit 2 +fi + +if [ ! -d "./contrib" ]; then + echo "Run ./contrib/jenkins_arch.sh from the root of the libosmocore tree" + exit 1 +fi + +set -x -e + +case "$arch" in + + amd64) + ./contrib/jenkins_amd64.sh + ;; + + arch) + ./contrib/jenkins_arch.sh + ;; + + *) + set +x + echo "Unexpected architecture '$arch'" + ;; +esac diff --git a/contrib/jenkins_arm.sh b/contrib/jenkins_arm.sh new file mode 100755 index 0000000..acdbe3c --- /dev/null +++ b/contrib/jenkins_arm.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +. $(dirname "$0")/jenkins_common.sh + +src_dir="$PWD" +build() { + build_dir="$1" + + prep_build "$src_dir" "$build_dir" + + "$src_dir"/configure --enable-static \ + --prefix=/usr/local/arm-none-eabi \ + --host=arm-none-eabi \ + --enable-embedded \ + --disable-doxygen \ + --disable-shared \ + CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + + $MAKE $PARALLEL_MAKE \ + || cat-testlogs.sh +} + +# verify build in dir other than source tree +build builddir +# verify build in source tree +build . + +osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5884 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2955e866bce4f000a53369bd601a346c36c82468 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:44:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:44:41 +0000 Subject: libosmocore[master]: jenkins: move make invocation into shared function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:45:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:45:57 +0000 Subject: osmo-mgw[master]: client: do not insist on \n\n when parsing MGCP messages In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:46:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:46:45 +0000 Subject: osmo-mgw[master]: main: display mgcp ip/port In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf5e8b6a7344c4ebaf9b89940456a496b2c23334 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw 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 Jan 19 15:46:49 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 15:46:49 +0000 Subject: [MERGED] libosmocore[master]: logging vty: add 'logging print file (0|1|basename)' cmd In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: logging vty: add 'logging print file (0|1|basename)' cmd ...................................................................... logging vty: add 'logging print file (0|1|basename)' cmd Add a VTY command that allows configuring the output of source filename. So far, this was not configurable by VTY at all. Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc --- M src/vty/logging_vty.c 1 file changed, 27 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index fd76d04..0eaa7fd 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -237,6 +237,29 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_file, + logging_prnt_file_cmd, + "logging print file (0|1|basename)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with the source file and line\n" + "Prefix each log message with the source file's basename (strip leading paths) and line\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + enum log_filename_type lft; + + if (!tgt) + return CMD_WARNING; + + if (!strcmp(argv[0], "basename")) + lft = LOG_FILENAME_BASENAME; + else + lft = atoi(argv[0])? LOG_FILENAME_PATH : LOG_FILENAME_NONE; + log_set_print_filename2(tgt, lft); + return CMD_SUCCESS; +} + DEFUN(logging_level, logging_level_cmd, NULL, /* cmdstr is dynamically set in logging_vty_add_cmds(). */ @@ -770,6 +793,8 @@ tgt->print_timestamp ? 1 : 0, VTY_NEWLINE); if (tgt->print_level) vty_out(vty, " logging print level 1%s", VTY_NEWLINE); + if (tgt->print_filename) + vty_out(vty, " logging print file 1%s", VTY_NEWLINE); /* stupid old osmo logging API uses uppercase strings... */ osmo_str2lower(level_lower, log_level_str(tgt->loglevel)); @@ -821,6 +846,7 @@ install_element_ve(&logging_prnt_cat_cmd); install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); + install_element_ve(&logging_prnt_file_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -839,6 +865,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_file_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); install_element(CONFIG_NODE, &cfg_log_stderr_cmd); -- To view, visit https://gerrit.osmocom.org/5813 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1bd79026a3c680ccf7587d545d12f7759a998fc Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:46:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 15:46:50 +0000 Subject: [MERGED] libosmocore[master]: logging: allow to log only the basename of each source In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: logging: allow to log only the basename of each source ...................................................................... logging: allow to log only the basename of each source In the C API, add another enum log_file_type value, and when set print only the basename of the source file path. Rationale: especially when not building directly in the source dir, the paths to the source files can become rather long. Usually, just the basename of the file is sufficient to identify the source line. Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e --- M include/osmocom/core/logging.h M src/logging.c 2 files changed, 15 insertions(+), 0 deletions(-) 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 1e79dab..617d78e 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -224,6 +224,7 @@ enum log_filename_type { LOG_FILENAME_NONE, LOG_FILENAME_PATH, + LOG_FILENAME_BASENAME, }; /*! structure representing a logging target */ diff --git a/src/logging.c b/src/logging.c index 8cb3407..66074ea 100644 --- a/src/logging.c +++ b/src/logging.c @@ -323,6 +323,14 @@ return NULL; } +static const char *const_basename(const char *path) +{ + const char *bn = strrchr(path, '/'); + if (!bn || !bn[1]) + return path; + return bn + 1; +} + static void _output(struct log_target *target, unsigned int subsys, unsigned int level, const char *file, int line, int cont, const char *format, va_list ap) @@ -400,6 +408,12 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); break; + case LOG_FILENAME_BASENAME: + ret = snprintf(buf + offset, rem, "%s:%d ", const_basename(file), line); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + break; } } ret = vsnprintf(buf + offset, rem, format, ap); -- To view, visit https://gerrit.osmocom.org/5814 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3e4d5fb2066f8bf86e59c82d1752b1a843cf58e 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 Jan 19 15:46:50 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 15:46:50 +0000 Subject: [MERGED] libosmocore[master]: logging: separate the '<000b>' subsys from filename logging In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: logging: separate the '<000b>' subsys from filename logging ...................................................................... logging: separate the '<000b>' subsys from filename logging Add a separate flag and API to switch the category-in-hex output: log_set_print_category_hex(). Add log_set_print_filename2() to modify only the print_filename flag. The old log_set_print_filename() function still affects both flags. Explain the rationale in the comment for log_set_print_filename(). There is no need to deprecate log_set_print_filename(); it might cause compiler warnings and break strict builds unnecessarily. Add VTY command 'logging print category-hex (0|1)'. Since there is no VTY command to switch filename output, nothing needs to be adjusted there (a command will be added in a subsequent patch). Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 --- M include/osmocom/core/logging.h M src/logging.c M src/vty/logging_vty.c 3 files changed, 74 insertions(+), 7 deletions(-) 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 1e809d0..1e79dab 100644 --- a/include/osmocom/core/logging.h +++ b/include/osmocom/core/logging.h @@ -220,6 +220,12 @@ LOG_TGT_TYPE_GSMTAP, /*!< GSMTAP network logging */ }; +/*! Whether/how to log the source filename (and line number). */ +enum log_filename_type { + LOG_FILENAME_NONE, + LOG_FILENAME_PATH, +}; + /*! structure representing a logging target */ struct log_target { struct llist_head entry; /*!< linked list */ @@ -238,7 +244,7 @@ unsigned int use_color:1; /*! should log messages be prefixed with a timestamp? */ unsigned int print_timestamp:1; - /*! should log messages be prefixed with a filename? */ + /*! DEPRECATED: use print_filename2 instead. */ unsigned int print_filename:1; /*! should log messages be prefixed with a category name? */ unsigned int print_category:1; @@ -301,6 +307,10 @@ /* Should the log level be printed? */ bool print_level; + /* Should we print the subsys in hex like '<000b>'? */ + bool print_category_hex; + /* Should we print the source file and line, and in which way? */ + enum log_filename_type print_filename2; }; /* use the above macros */ @@ -322,7 +332,9 @@ void log_set_print_extended_timestamp(struct log_target *target, int); void log_set_print_timestamp(struct log_target *target, int); void log_set_print_filename(struct log_target *target, int); +void log_set_print_filename2(struct log_target *target, enum log_filename_type lft); void log_set_print_category(struct log_target *target, int); +void log_set_print_category_hex(struct log_target *target, int); void log_set_print_level(struct log_target *target, int); void log_set_log_level(struct log_target *target, int log_level); void log_parse_category_mask(struct log_target *target, const char* mask); diff --git a/src/logging.c b/src/logging.c index e6e09e0..8cb3407 100644 --- a/src/logging.c +++ b/src/logging.c @@ -385,12 +385,21 @@ goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); } - if (target->print_filename) { - ret = snprintf(buf + offset, rem, "<%4.4x> %s:%d ", - subsys, file, line); + if (target->print_category_hex) { + ret = snprintf(buf + offset, rem, "<%4.4x> ", subsys); if (ret < 0) goto err; OSMO_SNPRINTF_RET(ret, rem, offset, len); + } + switch (target->print_filename2) { + case LOG_FILENAME_NONE: + break; + case LOG_FILENAME_PATH: + ret = snprintf(buf + offset, rem, "%s:%d ", file, line); + if (ret < 0) + goto err; + OSMO_SNPRINTF_RET(ret, rem, offset, len); + break; } } ret = vsnprintf(buf + offset, rem, format, ap); @@ -621,13 +630,30 @@ target->print_ext_timestamp = print_timestamp; } -/*! Enable or disable printing of the filename while logging +/*! Use log_set_print_filename2() instead. + * Call log_set_print_filename2() with LOG_FILENAME_PATH or LOG_FILENAME_NONE, *as well as* call + * log_set_print_category_hex() with the argument passed to this function. This is to mirror legacy + * behavior, which combined the category in hex with the filename. For example, if the category-hex + * output were no longer affected by log_set_print_filename(), many unit tests (in libosmocore as well as + * dependent projects) would fail since they expect the category to disappear along with the filename. * \param[in] target Log target to be affected * \param[in] print_filename Enable (1) or disable (0) filenames */ void log_set_print_filename(struct log_target *target, int print_filename) { - target->print_filename = print_filename; + log_set_print_filename2(target, print_filename ? LOG_FILENAME_PATH : LOG_FILENAME_NONE); + log_set_print_category_hex(target, print_filename); +} + +/*! Enable or disable printing of the filename while logging. + * \param[in] target Log target to be affected. + * \param[in] print_filename An LOG_FILENAME_* enum value. + * LOG_FILENAME_NONE omits the source file and line information from logs. + * LOG_FILENAME_PATH prints the entire source file path as passed to LOGP macros. + */ +void log_set_print_filename2(struct log_target *target, enum log_filename_type lft) +{ + target->print_filename2 = lft; } /*! Enable or disable printing of the category name @@ -639,6 +665,15 @@ void log_set_print_category(struct log_target *target, int print_category) { target->print_category = print_category; +} + +/*! Enable or disable printing of the category number in hex ('<000b>'). + * \param[in] target Log target to be affected. + * \param[in] print_category_hex Enable (1) or disable (0) hex category. + */ +void log_set_print_category_hex(struct log_target *target, int print_category_hex) +{ + target->print_category_hex = print_category_hex; } /*! Enable or disable printing of the log level name. @@ -723,7 +758,8 @@ /* global settings */ target->use_color = 1; target->print_timestamp = 0; - target->print_filename = 1; + target->print_filename2 = LOG_FILENAME_PATH; + target->print_category_hex = true; /* global log level */ target->loglevel = 0; diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index 5914822..fd76d04 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -203,6 +203,23 @@ return CMD_SUCCESS; } +DEFUN(logging_prnt_cat_hex, + logging_prnt_cat_hex_cmd, + "logging print category-hex (0|1)", + LOGGING_STR "Log output settings\n" + "Configure log message\n" + "Don't prefix each log message\n" + "Prefix each log message with category/subsystem nr in hex ('<000b>')\n") +{ + struct log_target *tgt = osmo_log_vty2tgt(vty); + + if (!tgt) + return CMD_WARNING; + + log_set_print_category_hex(tgt, atoi(argv[0])); + return CMD_SUCCESS; +} + DEFUN(logging_prnt_level, logging_prnt_level_cmd, "logging print level (0|1)", @@ -802,6 +819,7 @@ install_element_ve(&logging_prnt_timestamp_cmd); install_element_ve(&logging_prnt_ext_timestamp_cmd); install_element_ve(&logging_prnt_cat_cmd); + install_element_ve(&logging_prnt_cat_hex_cmd); install_element_ve(&logging_prnt_level_cmd); install_element_ve(&logging_set_category_mask_cmd); install_element_ve(&logging_set_category_mask_old_cmd); @@ -819,6 +837,7 @@ install_element(CFG_LOG_NODE, &logging_prnt_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_ext_timestamp_cmd); install_element(CFG_LOG_NODE, &logging_prnt_cat_cmd); + install_element(CFG_LOG_NODE, &logging_prnt_cat_hex_cmd); install_element(CFG_LOG_NODE, &logging_prnt_level_cmd); install_element(CFG_LOG_NODE, &logging_level_cmd); -- To view, visit https://gerrit.osmocom.org/5812 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba03a2b7915853c6dccaf6c393c31405320538b4 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 Jan 19 15:48:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 15:48:05 +0000 Subject: osmo-mgw[master]: mgcp: add prefix to virtual trunk In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 15:59:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 15:59:32 +0000 Subject: [PATCH] osmo-bsc[master]: HO: intra-cell assignment: always use Handover Command, not ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5922 to look at the new patch set (#7). HO: intra-cell assignment: always use Handover Command, not Assignment Before adding handover_decision_2.c in Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 we would always transmit an RR Handover Command for both inter-cell handover and intra-cell assignment, and re-assignment within the same cell worked fine. That commit moved to sending an RR Assignment for intra-cell assignment, and re-assignment stopped working. I am not sure about the precise reasons, and it may make sense to move back to an RR Assignment with better fixes. For the meantime, staying with the previous assignment technique is the easiest way to fix intra-cell re-assignment. Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e --- M src/libbsc/handover_logic.c 1 file changed, 4 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/22/5922/7 diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 0cce1d9..d59cc5e 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -171,10 +171,8 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; - if (!do_assignment) { - ho->inter_cell = true; - ho->async = true; - } + ho->inter_cell = !do_assignment; + ho->async = true; LOGPHO(ho, LOGL_INFO, "Triggering %s\n", do_assignment? "Assignment" : "Handover"); @@ -199,9 +197,7 @@ new_lchan->conn->ho_lchan = new_lchan; rc = rsl_chan_activate_lchan(new_lchan, - ho->inter_cell - ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) - : RSL_ACT_INTRA_IMM_ASS, + ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC, ho->ho_ref); if (rc < 0) { LOGPHO(ho, LOGL_INFO, "%s Failure: activate lchan rc = %d\n", @@ -276,11 +272,7 @@ /* we can now send the 04.08 HANDOVER COMMAND to the MS * using the old lchan */ - if (ho->inter_cell) { - gsm48_send_rr_ass_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power); - } else { - gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); - } + gsm48_send_ho_cmd(ho->old_lchan, new_lchan, new_lchan->ms_power, ho->ho_ref); /* start T3103. We can continue either with T3103 expiration, * 04.08 HANDOVER COMPLETE or 04.08 HANDOVER FAIL */ -- To view, visit https://gerrit.osmocom.org/5922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 16:00:32 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 16:00:32 +0000 Subject: osmo-bsc[master]: HO: Implement load based handover, as handover_decision_2.c In-Reply-To: References: Message-ID: Patch Set 7: hmm, this is quite the code bomb without a proper commit log ... maybe I'll get a chance to write some more about it and separate? -- To view, visit https://gerrit.osmocom.org/5921 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice2d3ef5668564a9d3bc4d5118d59dfaa9af6978 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc 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 Jan 19 16:33:28 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 16:33:28 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 3: What I can say for sure is that I constantly got linking errors like in the commit log for at least ctrl_test, so that requires linking libosmovty, and it was (guessing) probably pulled in by dynamic libs / pkgconfig / something from the system-wide installation instead of the just built lib that matches the code. Applying this patch gets rid of all these problems regarding libosmovty linking. I can't say that I've fully grokked the details of *why* the system installed one is linked magically. I just know that it is. -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr 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 Fri Jan 19 16:38:44 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 16:38:44 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 3: and also I haven't even looked at whether the other libs exhibit the same behavior. Maybe there should be a better fix, but I can't investigate now... -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr 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 Fri Jan 19 16:59:35 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 16:59:35 +0000 Subject: osmo-mgw[master]: client: add an optional FSM interface In-Reply-To: References: Message-ID: Patch Set 2: > I think you fogot some 'git add' commands... Thanks, added it now. -- To view, visit https://gerrit.osmocom.org/5881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:01:49 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 17:01:49 +0000 Subject: osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Patch Set 2: > actually, it is the host name and domain name that you make > configurable in this patch. Not entirely sure what's the best > naming here. FQDN? how does the spec call it? I think the spec is just calling it domain-name, have a look at 2.1.2 Endpoint Identifiers: "Endpoint names are of the form: local-endpoint-name at domain-name" -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:15:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 17:15:30 +0000 Subject: osmo-bsc[master]: HO: Count number of free timeslot on a given BTS In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/5916/5/src/libbsc/chan_alloc.c File src/libbsc/chan_alloc.c: Line 80: for (j = 0; j < 8; j++) { let's not use magic numbers but ARRAY_SIZE() here -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:16:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 17:16:59 +0000 Subject: osmo-bsc[master]: HO: intra-cell assignment: always use Handover Command, not ... In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5922 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c1ec8c228a557ac59a31ea47e21fb856467742e Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:17:53 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 17:17:53 +0000 Subject: osmo-bsc[master]: HO: Count number of free timeslot on a given BTS In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/5916/5/src/libbsc/chan_alloc.c File src/libbsc/chan_alloc.c: Line 80: for (j = 0; j < 8; j++) { > let's not use magic numbers but ARRAY_SIZE() here I actually considered changing jolly's patch here, but thought "nah, timeslots are 8, whatever" :) -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:20:19 2018 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 19 Jan 2018 17:20:19 +0000 Subject: [PATCH] osmo-bsc[master]: HO: Count number of free timeslot on a given BTS In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5916 to look at the new patch set (#6). HO: Count number of free timeslot on a given BTS This is needed for handover algorithm to balance free slots and to prevent congestion of one cell, while other cells still have free capacities. Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b --- M include/osmocom/bsc/chan_alloc.h M src/libbsc/chan_alloc.c 2 files changed, 67 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/16/5916/6 diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index f2a75c5..748e9cd 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -24,6 +24,9 @@ struct gsm_subscriber_connection; +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan); + /* Allocate a logical channel (SDCCH, TCH, ...) */ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 9946628..21c81aa 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -68,6 +68,70 @@ return true; } +static int trx_count_free_ts(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx_ts *ts; + int j, ss; + int count = 0; + + if (!trx_is_usable(trx)) + return 0; + + for (j = 0; j < ARRAY_SIZE(trx->ts); j++) { + enum gsm_phys_chan_config ts_pchan_is; + ts = &trx->ts[j]; + if (!ts_is_usable(ts)) + continue; + + ts_pchan_is = ts_pchan(ts); + + if (ts_pchan_is == GSM_PCHAN_PDCH) { + /* Dynamic timeslots in PDCH mode will become TCH if needed. */ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + continue; + + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + else if (pchan == GSM_PCHAN_TCH_H) + count += 2; + continue; + + default: + /* Not dynamic, not applicable. */ + continue; + } + } + + if (ts_pchan_is != pchan) + continue; + /* check if all sub-slots are allocated yet */ + for (ss = 0; ss < ts_subslots(ts); ss++) { + struct gsm_lchan *lc = &ts->lchan[ss]; + if (lc->type == GSM_LCHAN_NONE && + lc->state == LCHAN_S_NONE) + count++; + } + } + + return count; +} + +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx *trx; + int count = 0; + + llist_for_each_entry(trx, &bts->trx_list, list) + count += trx_count_free_ts(trx, pchan); + + return count; +} + static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, enum gsm_phys_chan_config dyn_as_pchan) -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:26:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 17:26:29 +0000 Subject: osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:26:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 17:26:52 +0000 Subject: osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Patch Set 2: > I think the spec is just calling it domain-name, have a look at > 2.1.2 Endpoint Identifiers: > > "Endpoint names are of the form: > local-endpoint-name at domain-name" ok, then my understanding was wrong, sorry. -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:26:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 17:26:55 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp: make domain name configurable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: make domain name configurable ...................................................................... mgcp: make domain name configurable At the moment the MGW has a fixed domain name string that is not even checked properly. - Make domain name configurable, use the current "mgw" string as defualt to maintain compatibility - Check the domain name with each request. If the endpoint contains an unexpected domain name, the request must be rejected. Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e --- M include/osmocom/mgcp/mgcp.h M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M tests/mgcp/mgcp_test.c M tests/mgcp/mgcp_test.ok 6 files changed, 52 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index d6397d3..0d156c6 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -212,6 +212,8 @@ * message. */ uint16_t osmux_dummy; + /* domain name of the media gateway */ + char domain[255+1]; }; /* config management */ diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 45195de..74acffa 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,22 @@ return &tcfg->endpoints[endp]; } +/* Check if the domain name, which is supplied with the endpoint name + * matches the configuration. */ +static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) +{ + char *domain_to_check; + + domain_to_check = strstr(mgcp, "@"); + if (!domain_to_check) + return -EINVAL; + + if (strcmp(domain_to_check+1, cfg->domain) != 0) + return -EINVAL; + + return 0; +} + /* Search the endpoint pool for the endpoint that had been selected via the * MGCP message (helper function for mgcp_analyze_header()) */ static struct mgcp_endpoint *find_endpoint(struct mgcp_config *cfg, @@ -189,6 +205,11 @@ char *endptr = NULL; unsigned int gw = INT_MAX; + if (check_domain_name(cfg, mgcp)) { + LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp); + return NULL; + } + if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 9d79343..5f1a734 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1072,6 +1072,8 @@ return NULL; } + osmo_strlcpy(cfg->domain, "mgw", sizeof(cfg->domain)); + cfg->net_ports.range_start = RTP_PORT_DEFAULT_RANGE_START; cfg->net_ports.range_end = RTP_PORT_DEFAULT_RANGE_END; cfg->net_ports.last_port = cfg->net_ports.range_start; @@ -1208,13 +1210,16 @@ * \returns 0 on success, -1 on error */ int mgcp_send_reset_all(struct mgcp_config *cfg) { + char buf[MGCP_ENDPOINT_MAXLEN + 128]; + int len; int rc; - static const char mgcp_reset[] = { - "RSIP 1 *@mgw MGCP 1.0\r\n" - }; + len = snprintf(buf, sizeof(buf), + "RSIP 1 *@%s MGCP 1.0\r\n", cfg->domain); + if (len < 0) + return -1; - rc = send_agent(cfg, mgcp_reset, sizeof mgcp_reset - 1); + rc = send_agent(cfg, buf, len); if (rc <= 0) return -1; @@ -1228,12 +1233,12 @@ * \returns 0 on success, -1 on error */ int mgcp_send_reset_ep(struct mgcp_endpoint *endp, int endpoint) { - char buf[128]; + char buf[MGCP_ENDPOINT_MAXLEN + 128]; int len; int rc; len = snprintf(buf, sizeof(buf), - "RSIP 39 %x at mgw MGCP 1.0\r\n", endpoint); + "RSIP 39 %x@%s MGCP 1.0\r\n", endpoint, endp->cfg->domain); if (len < 0) return -1; diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 7fa3949..7043527 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -63,6 +63,7 @@ static int config_write_mgcp(struct vty *vty) { vty_out(vty, "mgcp%s", VTY_NEWLINE); + vty_out(vty, " domain %s%s", g_cfg->domain, VTY_NEWLINE); if (g_cfg->local_ip) vty_out(vty, " local ip %s%s", g_cfg->local_ip, VTY_NEWLINE); vty_out(vty, " bind ip %s%s", g_cfg->source_addr, VTY_NEWLINE); @@ -1179,6 +1180,14 @@ return CMD_SUCCESS; } +DEFUN(cfg_mgcp_domain, + cfg_mgcp_domain_cmd, + "domain NAME", "domain\n" "qualified domain name\n") +{ + osmo_strlcpy(g_cfg->domain, argv[0], sizeof(g_cfg->domain)); + return CMD_SUCCESS; +} + int mgcp_vty_init(void) { install_element_ve(&show_mgcp_cmd); @@ -1240,6 +1249,7 @@ install_element(MGCP_NODE, &cfg_mgcp_osmux_dummy_cmd); install_element(MGCP_NODE, &cfg_mgcp_allow_transcoding_cmd); install_element(MGCP_NODE, &cfg_mgcp_no_allow_transcoding_cmd); + install_element(MGCP_NODE, &cfg_mgcp_domain_cmd); install_element(MGCP_NODE, &cfg_mgcp_trunk_cmd); install_node(&trunk_node, config_write_trunk); diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 46fd69b..467cb6c 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -66,18 +66,18 @@ OSMO_ASSERT(counter == EXPECTED_NUMBER_OF_LINES); } -#define AUEP1 "AUEP 158663169 ds/e1-1/2 at 172.16.6.66 MGCP 1.0\r\n" +#define AUEP1 "AUEP 158663169 ds/e1-1/2 at mgw MGCP 1.0\r\n" #define AUEP1_RET "200 158663169 OK\r\n" -#define AUEP2 "AUEP 18983213 ds/e1-2/1 at 172.16.6.66 MGCP 1.0\r\n" +#define AUEP2 "AUEP 18983213 ds/e1-2/1 at mgw MGCP 1.0\r\n" #define AUEP2_RET "500 18983213 FAIL\r\n" #define EMPTY "\r\n" #define EMPTY_RET NULL #define SHORT "CRCX \r\n" #define SHORT_RET "510 000000 FAIL\r\n" -#define MDCX_WRONG_EP "MDCX 18983213 ds/e1-3/1 at 172.16.6.66 MGCP 1.0\r\n" +#define MDCX_WRONG_EP "MDCX 18983213 ds/e1-3/1 at mgw MGCP 1.0\r\n" #define MDCX_ERR_RET "500 18983213 FAIL\r\n" -#define MDCX_UNALLOCATED "MDCX 18983214 ds/e1-1/2 at 172.16.6.66 MGCP 1.0\r\n" +#define MDCX_UNALLOCATED "MDCX 18983214 ds/e1-1/2 at mgw MGCP 1.0\r\n" #define MDCX_RET "400 18983214 FAIL\r\n" #define MDCX3 \ diff --git a/tests/mgcp/mgcp_test.ok b/tests/mgcp/mgcp_test.ok index 23f0658..09ad9e1 100644 --- a/tests/mgcp/mgcp_test.ok +++ b/tests/mgcp/mgcp_test.ok @@ -16,7 +16,7 @@ Testing AUEP1 creating message from statically defined input: ---------8<--------- -AUEP 158663169 ds/e1-1/2 at 172.16.6.66 MGCP 1.0 +AUEP 158663169 ds/e1-1/2 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -28,7 +28,7 @@ Testing AUEP2 creating message from statically defined input: ---------8<--------- -AUEP 18983213 ds/e1-2/1 at 172.16.6.66 MGCP 1.0 +AUEP 18983213 ds/e1-2/1 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -40,7 +40,7 @@ Testing MDCX1 creating message from statically defined input: ---------8<--------- -MDCX 18983213 ds/e1-3/1 at 172.16.6.66 MGCP 1.0 +MDCX 18983213 ds/e1-3/1 at mgw MGCP 1.0 ---------8<--------- checking response: @@ -52,7 +52,7 @@ Testing MDCX2 creating message from statically defined input: ---------8<--------- -MDCX 18983214 ds/e1-1/2 at 172.16.6.66 MGCP 1.0 +MDCX 18983214 ds/e1-1/2 at mgw MGCP 1.0 ---------8<--------- checking response: -- To view, visit https://gerrit.osmocom.org/5878 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia91ac428ba83ac1f9b52a0ec8dbf00ef7876da9e Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:27:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 17:27:00 +0000 Subject: [MERGED] osmo-mgw[master]: cosmetic: protocol: remove unnecessary nul termination In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: protocol: remove unnecessary nul termination ...................................................................... cosmetic: protocol: remove unnecessary nul termination Adding a NUL manually is a common idiom after calling strncpy() because strncpy() does not always NUL-terminate the string. But snprintf() is fine. - remove NUL termination after snprintf in mgcp_send_reset_ep() Change-Id: I5a1187b13b21b11674f13d3449c730616b0a4ddf --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 5f1a734..4c04712 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1242,8 +1242,6 @@ if (len < 0) return -1; - buf[sizeof(buf) - 1] = '\0'; - rc = send_agent(endp->cfg, buf, len); if (rc <= 0) return -1; -- To view, visit https://gerrit.osmocom.org/5925 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5a1187b13b21b11674f13d3449c730616b0a4ddf Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:49:38 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 19 Jan 2018 17:49:38 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: add dedicated log categories Message-ID: Review at https://gerrit.osmocom.org/5933 TBF: add dedicated log categories Previously all TBF-related events were logged as part of DRLCMAC which is too broad to make it practically useful due to excessive amount of log messages generated. Introduce dedicated log categories for TBF-related events. Adjust test output as necessary. Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa --- M src/gprs_debug.cpp M src/gprs_debug.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 8 files changed, 136,637 insertions(+), 4,992 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/33/5933/1 -- To view, visit https://gerrit.osmocom.org/5933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:59:14 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 17:59:14 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) 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/5879 to look at the new patch set (#3). mgcp: permit wildcarded endpoint assignment (CRCX) The mgcp protocol in general allows wildcarded endpoints on CRCX. osmo-mgw does not support this feature yet. - when the endpoint name contains a wildcard character, search a free endpoint automatically - return the resulting endpoint name in the parameter section of the mgcp response - add parsing support for the returned endpoint names - Be more concious about the parameters that are returned with each response. Do not unnecessarily attach known parameters. Return the connection ID only on CRCX commands. Only return the endpoint ID on CRCX commands that are wildcarded. Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 related: OS#2631 --- M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M tests/mgcp/mgcp_test.c 6 files changed, 140 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/79/5879/3 diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 33a754c..c0ee556 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -260,6 +260,10 @@ /* fields for re-transmission */ char *last_trans; char *last_response; + + /* Memorize if this endpoint was choosen by the MGW (wildcarded, true) + * or if the user has choosen the particular endpoint explicitly */ + bool wildcarded_crcx; }; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 882c908..676850f 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -31,6 +31,7 @@ mgcp_trans_id_t trans_id; const char *comment; char conn_id[MGCP_CONN_ID_LENGTH]; + char endpoint[MGCP_ENDPOINT_MAXLEN]; }; struct mgcp_response { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 9fc414d..1d9a858 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -146,8 +146,8 @@ /* Mark the end of the comment */ *end = '\0'; r->body = end + 1; - if (r->body[0] == '\n') - r->body ++; +// if (r->body[0] == '\n') +// r->body ++; return 0; response_parse_failure: @@ -226,6 +226,10 @@ OSMO_ASSERT(r->body); char *data = strstr(r->body, "\n\n"); + /* Warning: This function performs a destructive parsing on r->body. + * Since this function is called at the very end of the persing + * process, destructive parsing is acceptable. */ + if (!data) { LOGP(DLMGCP, LOGL_ERROR, "MGCP response: cannot find start of parameters\n"); @@ -261,21 +265,29 @@ return 0; } -/* Parse a line like "I: 0cedfd5a19542d197af9afe5231f1d61" */ -static int mgcp_parse_conn_id(struct mgcp_response *r, const char *line) +/* Parse a line like "X: something" */ +static int mgcp_parse_head_param(char *result, unsigned int result_len, + char label, const char *line) { + char label_string[4]; + + /* Detect empty parameters */ if (strlen(line) < 4) goto response_parse_failure; - if (memcmp("I: ", line, 3) != 0) + /* Check if the label matches */ + snprintf(label_string, sizeof(label_string), "%c: ", label); + if (memcmp(label_string, line, 3) != 0) goto response_parse_failure; - osmo_strlcpy(r->head.conn_id, line + 3, sizeof(r->head.conn_id)); + /* Copy payload part of the string to destinations (the label string + * is always 3 chars long) */ + osmo_strlcpy(result, line + 3, result_len); return 0; response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response (connectionIdentifier)\n"); + "Failed to parse MGCP response (parameter label: %c)\n", label); return -EINVAL; } @@ -285,18 +297,37 @@ char *line; int rc = 0; OSMO_ASSERT(r->body); - char *data = r->body; - char *data_end = strstr(r->body, "\n\n"); + char *data; + char *data_ptr; + char *data_end; - /* Protect SDP body, for_each_non_empty_line() will - * only parse until it hits \0 mark. */ + /* Since this functions performs a destructive parsing, we create a + * local copy of the body data */ + data = talloc_zero_size(NULL, strlen(r->body)+1); + OSMO_ASSERT(data); + data_ptr = data; + osmo_strlcpy(data, r->body, strlen(r->body)); + + /* If there is an SDP body attached, prevent for_each_non_empty_line() + * into running in there, we are not yet interested in the parameters + * stored there. */ + data_end = strstr(data, "\n\n"); if (data_end) *data_end = '\0'; - for_each_non_empty_line(line, data) { + for_each_non_empty_line(line, data_ptr) { switch (line[0]) { + case 'Z': + rc = mgcp_parse_head_param(r->head.endpoint, + sizeof(r->head.endpoint), + 'Z', line); + if (rc) + goto exit; + break; case 'I': - rc = mgcp_parse_conn_id(r, line); + rc = mgcp_parse_head_param(r->head.conn_id, + sizeof(r->head.conn_id), + 'I', line); if (rc) goto exit; break; @@ -306,10 +337,7 @@ } } exit: - /* Restore original state */ - if (data_end) - *data_end = '\n'; - + talloc_free(data); return rc; } diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 74acffa..9bb2805 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,30 @@ return &tcfg->endpoints[endp]; } +/* Find an endpoint that is not in use. Do this by going through the endpoint + * array, check the callid. A callid nullpointer indicates that the endpoint + * is free */ +static struct mgcp_endpoint *find_free_endpoint(struct mgcp_endpoint *endpoints, + unsigned int number_endpoints) +{ + struct mgcp_endpoint *endp; + unsigned int i; + + for (i = 0; i < number_endpoints; i++) { + if (endpoints[i].callid == NULL) { + endp = &endpoints[i]; + LOGP(DLMGCP, LOGL_DEBUG, + "endpoint:0x%x found free endpoint\n", + ENDPOINT_NUMBER(endp)); + endp->wildcarded_crcx = true; + return endp; + } + } + + LOGP(DLMGCP, LOGL_ERROR, "Not able to find a free endpoint"); + return NULL; +} + /* Check if the domain name, which is supplied with the endpoint name * matches the configuration. */ static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) @@ -213,6 +237,11 @@ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); + if (strncmp(mgcp, "*", 1) == 0) { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 4c04712..16e9cb8 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -192,11 +192,32 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } +/* Add MGCP parameters to a message buffer */ +static int add_params(struct msgb *msg, const struct mgcp_endpoint *endp, + const struct mgcp_conn_rtp *conn) +{ + int rc; + + if (endp->wildcarded_crcx) { + rc = msgb_printf(msg, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), + endp->cfg->domain); + if (rc < 0) + return -EINVAL; + } + + rc = msgb_printf(msg, "I: %s\n", conn->conn->id); + if (rc < 0) + return -EINVAL; + + return 0; +} + /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, const char *msg, - const char *trans_id) + const char *trans_id, + bool add_conn_params) { const char *addr = endp->cfg->local_ip; struct msgb *sdp; @@ -221,7 +242,14 @@ osmux_extension[0] = '\0'; } - rc = msgb_printf(sdp, "I: %s%s\n\n", conn->conn->id, osmux_extension); + /* Attach optional connection parameters */ + if (add_conn_params) { + rc = add_params(sdp, endp, conn); + if (rc < 0) + goto error; + } + + rc = msgb_printf(sdp, "%s\n", osmux_extension); if (rc < 0) goto error; @@ -648,7 +676,7 @@ LOGP(DLMGCP, LOGL_NOTICE, "CRCX: endpoint:0x%x connection successfully created\n", ENDPOINT_NUMBER(endp)); - return create_response_with_sdp(endp, conn, "CRCX", p->trans); + return create_response_with_sdp(endp, conn, "CRCX", p->trans, true); error2: mgcp_release_endp(endp); LOGP(DLMGCP, LOGL_NOTICE, @@ -801,7 +829,7 @@ LOGP(DLMGCP, LOGL_NOTICE, "MDCX: endpoint:0x%x connection successfully modified\n", ENDPOINT_NUMBER(endp)); - return create_response_with_sdp(endp, conn, "MDCX", p->trans); + return create_response_with_sdp(endp, conn, "MDCX", p->trans, false); error3: return create_err_response(endp, error_code, "MDCX", p->trans); @@ -1196,6 +1224,7 @@ endp->local_options.string = NULL; talloc_free(endp->local_options.codec); endp->local_options.codec = NULL; + endp->wildcarded_crcx = false; } static int send_agent(struct mgcp_config *cfg, const char *buf, int len) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 467cb6c..ddee8c5 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -86,7 +86,6 @@ #define MDCX3_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -99,7 +98,6 @@ #define MDCX3A_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -112,7 +110,6 @@ #define MDCX3_FMTP_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -141,7 +138,6 @@ #define MDCX4_RET(Ident) \ "200 " Ident " OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -154,7 +150,6 @@ #define MDCX4_RO_RET(Ident) \ "200 " Ident " OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -561,25 +556,39 @@ { char *conn_id_ptr; int i; + bool got_conn_id = false; + /* First try to get the conn_id from the I: parameter */ conn_id_ptr = strstr((char *)resp, "I: "); - if (!conn_id_ptr) - return -EINVAL; - - memset(conn_id, 0, conn_id_len); - memcpy(conn_id, conn_id_ptr + 3, 32); - - for (i = 0; i < conn_id_len; i++) { - if (conn_id[i] == '\n' || conn_id[i] == '\r') - conn_id[i] = '\0'; + if (conn_id_ptr) { + memset(conn_id, 0, conn_id_len); + memcpy(conn_id, conn_id_ptr + 3, 32); + got_conn_id = true; + } else { + /* Alternatively try to extract the conn_id from the o=- SDP + * parameter */ + conn_id_ptr = strstr((char *)resp, "o=- "); + if(conn_id_ptr) { + memset(conn_id, 0, conn_id_len); + memcpy(conn_id, conn_id_ptr + 4, 32); + got_conn_id = true; + } } - /* A valid conn_id must at least contain one digit, and must - * not exceed a length of 32 digits */ - OSMO_ASSERT(strlen(conn_id) <= 32); - OSMO_ASSERT(strlen(conn_id) > 0); + if (got_conn_id) { + for (i = 0; i < conn_id_len; i++) { + if (conn_id[i] == '\n' || conn_id[i] == '\r') + conn_id[i] = '\0'; + } - return 0; + /* A valid conn_id must at least contain one digit, and must + * not exceed a length of 32 digits */ + OSMO_ASSERT(strlen(conn_id) <= 32); + OSMO_ASSERT(strlen(conn_id) > 0); + + return 0; + } + return -EINVAL; } /* Check response, automatically patch connection ID if needed */ -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:59:14 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 17:59:14 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: add prefix to virtual trunk 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/5880 to look at the new patch set (#3). mgcp: add prefix to virtual trunk the virtual trunk is addressed without a prefix (just *@domain). - reorganize find_endpoint() so that it accepts a prefix when addressing the virtual trunk. - do no longer accept wildcarded CRCX requests without prefix (will not break anything, the feature of wildcarded CRCX is not in use yet) - keep the old prefix-less method but print a warning that it is depreacted. Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 --- M include/osmocom/mgcp/mgcp_common.h M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c 3 files changed, 30 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/80/5880/3 diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 7684936..7aa5d3f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -76,4 +76,7 @@ / (see also RFC3435 section 3.2.1.3) */ #define MGCP_ENDPOINT_MAXLEN (255*2+1+1) +/* A prefix to denote the virtual trunk (RTP on both ends) */ +#define MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK "rtpbridge/" + #endif diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 9bb2805..3aa93b7 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -228,20 +228,38 @@ { char *endptr = NULL; unsigned int gw = INT_MAX; + const char *endpoint_number_str; + /* Check if the domainname in the request is correct */ if (check_domain_name(cfg, mgcp)) { LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp); return NULL; } + /* Check if the E1 trunk is requested */ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); - if (strncmp(mgcp, "*", 1) == 0) { - return find_free_endpoint(cfg->trunk.endpoints, - cfg->trunk.number_endpoints); + /* Check if the virtual trunk is addressed (new, correct way with prefix) */ + if (strncmp + (mgcp, MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK)) == 0) { + endpoint_number_str = + mgcp + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK); + if (endpoint_number_str[0] == '*') { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + + gw = strtoul(endpoint_number_str, &endptr, 16); + if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') + return &cfg->trunk.endpoints[gw]; } + /* Deprecated method without prefix */ + LOGP(DLMGCP, LOGL_NOTICE, + "Addressing virtual trunk without prefix (deprecated), please use %s: '%s'\n", + MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, mgcp); gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 16e9cb8..daedc8d 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -198,9 +198,12 @@ { int rc; - if (endp->wildcarded_crcx) { - rc = msgb_printf(msg, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), - endp->cfg->domain); + /* NOTE: Only in the virtual trunk we allow dynamic endpoint names */ + if (endp->wildcarded_crcx + && endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) { + rc = msgb_printf(msg, "Z: %s%u@%s\n", + MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, + ENDPOINT_NUMBER(endp), endp->cfg->domain); if (rc < 0) return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/5880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 17:59:14 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 17:59:14 +0000 Subject: [PATCH] osmo-mgw[master]: client: add an optional FSM interface In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5881 to look at the new patch set (#3). client: add an optional FSM interface the client API is not very intuitive and requires a lot of extra care when it is used from an osmo-fsm. - Add an FSM that permits comfortable handling of an MGCP connection. Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_fsm.h M include/osmocom/mgcp_client/mgcp_client_internal.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_fsm.c 5 files changed, 654 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/5881/3 diff --git a/include/Makefile.am b/include/Makefile.am index b52e5ea..e8fc211 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,6 +7,7 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_client_fsm.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ osmocom/mgcp/mgcp_common.h \ diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h new file mode 100644 index 0000000..a9ee876 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include + +/*! Connection information. This struct organizes the connection infromation + * one connection side (either remote or local). It is used to pass parameters + * (local) to the FSM and get responses (remote) from the FSM as pointer + * attached to the FSM event */ +struct mgcp_conn_info { + /*!< RTP connection IP-Address (optional, string e.g. "127.0.0.1") */ + char addr[INET_ADDRSTRLEN]; + + /*!< RTP connection IP-Port (optional) */ + uint16_t port; + + /*!< RTP endpoint */ + char endpoint[MGCP_ENDPOINT_MAXLEN]; + + /*!< CALL ID (unique per call) */ + unsigned int call_id; +}; + +struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt, + uint32_t parent_evt, struct mgcp_conn_info *conn_info); +int mgcp_conn_modify(struct osmo_fsm_inst *fi, uint32_t parent_evt, struct mgcp_conn_info *conn_info); +void mgcp_conn_delete(struct osmo_fsm_inst *fi); diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 690a4af..a2b330e 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -28,8 +28,6 @@ int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg); -struct mgcp_response_pending * mgcp_client_pending_add( - struct mgcp_client *mgcp, - mgcp_trans_id_t trans_id, - mgcp_response_cb_t response_cb, - void *priv); +struct mgcp_response_pending *mgcp_client_pending_add(struct mgcp_client *mgcp, + mgcp_trans_id_t trans_id, + mgcp_response_cb_t response_cb, void *priv); diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 1e4e764..a3a920b 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -29,6 +29,7 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ + mgcp_client_fsm.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c new file mode 100644 index 0000000..44a5740 --- /dev/null +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -0,0 +1,621 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include + +/* Context information, this is attached to the priv pointer of the FSM and + * is also handed back when dispatcheing events to the parent FSM. This is + * purly intened and not meant to be accessible for the API user */ +struct mgcp_ctx { + /* MGCP client instance that is used to interact with the MGW */ + struct mgcp_client *mgcp; + + /* The ID of the last pending transaction. This is used internally + * to cancel the transaction in case of an error */ + mgcp_trans_id_t mgw_pending_trans; + + /* Flag to mark that there is a pending transaction */ + bool mgw_trans_pending; + + /* Connection ID which has been assigned by he MGW */ + char conn_id[MGCP_CONN_ID_LENGTH]; + + /* Local RTP connection info, the MGW will send outgoing traffic to the + * ip/port specified here. The Address does not have to be choosen right + * on the creation of a connection. It can always be modified later by + * the user. */ + struct mgcp_conn_info conn_info_local; + + /* Remote RTP connection info, the ip/port specified here is the address + * where the MGW expects the RTP data to be sent. This address is + * defined by soly by the MGW and can not be influenced by the user. */ + struct mgcp_conn_info conn_info_remote; + + /* The terminate flag is a way to handle cornercase sitations that + * might occur when the user runs into an error situation and sends + * a DLCX command while the FSM is waiting for a response. In this + * case the DLCX command is not executed immediately. Instead the + * terminate flag is set. When the response to from the previous + * operation is received, we know that there is a DLCX event is + * pending. The FSM then generates the EV_DLCX by itsself before + * it enters ST_READY to cause the immediate execution of the + * DLCX procedure. (If normal operations are executed too fast, + * the API functions will return an error. In general, the user + * should synchronize using the callback events) */ + bool terminate; + + /* Event that is sent when the current operation is completed (except + * for DLCX, there the specified parent_term_evt is sent instead) */ + uint32_t parent_evt; +}; + +#define S(x) (1 << (x)) + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 + +enum fsm_bsc_mgcp_states { + ST_CRCX, + ST_CRCX_RESP, + ST_READY, + ST_MDCX_RESP, + ST_DLCX_RESP, +}; + +enum bsc_mgcp_fsm_evt { + EV_CRCX, + EV_CRCX_RESP, + EV_MDCX, + EV_MDCX_RESP, + EV_DLCX, + EV_DLCX_RESP, +}; + +struct msgb *make_crcx_msg_bind(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->conn_info_local.call_id, + .conn_mode = MGCP_CONN_LOOPBACK, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_local.endpoint, MGCP_ENDPOINT_MAXLEN); + + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +struct msgb *make_crcx_msg_bind_connect(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX,.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->conn_info_local.call_id, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = mgcp_ctx->conn_info_local.addr, + .audio_port = mgcp_ctx->conn_info_local.port, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_local.endpoint, MGCP_ENDPOINT_MAXLEN); + + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +struct msgb *make_mdcx_msg(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->conn_info_remote.call_id, + .conn_id = mgcp_ctx->conn_id, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = mgcp_ctx->conn_info_local.addr, + .audio_port = mgcp_ctx->conn_info_local.port, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_remote.endpoint, MGCP_ENDPOINT_MAXLEN); + + /* Note: We take the endpoint and the call_id from the remote + * connection info, because we can be confident that the + * information there is valid. For the local info, we explicitly + * allow endpoint and call_id to be optional */ + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +struct msgb *make_dlcx_msg(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID), + .call_id = mgcp_ctx->conn_info_remote.call_id, + .conn_id = mgcp_ctx->conn_id, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_remote.endpoint, MGCP_ENDPOINT_MAXLEN); + + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +static void mgw_crcx_resp_cb(struct mgcp_response *r, void *priv); + +static void fsm_crcx_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_CRCX: + LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: creating connection on MGW endpoint:%s...\n", + mgcp_ctx->conn_info_local.endpoint); + + if (mgcp_ctx->conn_info_local.port) + msg = make_crcx_msg_bind_connect(mgcp_ctx); + else + msg = make_crcx_msg_bind(mgcp_ctx); + OSMO_ASSERT(msg); + + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + mgcp_ctx->mgw_trans_pending = true; + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_resp_cb, fi); + if (rc < 0) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_RESP, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static void mgw_crcx_resp_cb(struct mgcp_response *r, void *priv) +{ + struct osmo_fsm_inst *fi = priv; + struct mgcp_ctx *mgcp_ctx; + int rc; + + OSMO_ASSERT(fi); + mgcp_ctx = fi->priv; + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->mgw_trans_pending = false; + + if (r->head.response_code != 200) { + LOGPFSML(fi, LOGL_ERROR, + "MGW/CRCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_strlcpy(mgcp_ctx->conn_id, r->head.conn_id, sizeof(mgcp_ctx->conn_id)); + LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: MGW responded with CI: %s\n", mgcp_ctx->conn_id); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, "MGW/CRCX: Cannot parse CRCX response\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + osmo_strlcpy(mgcp_ctx->conn_info_remote.addr, r->audio_ip, sizeof(mgcp_ctx->conn_info_remote.addr)); + mgcp_ctx->conn_info_remote.port = r->audio_port; + osmo_strlcpy(mgcp_ctx->conn_info_remote.endpoint, r->head.endpoint, + sizeof(mgcp_ctx->conn_info_remote.endpoint)); + mgcp_ctx->conn_info_remote.call_id = mgcp_ctx->conn_info_local.call_id; + + osmo_fsm_inst_dispatch(fi, EV_CRCX_RESP, mgcp_ctx); +} + +static void fsm_crcx_resp_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_CRCX_RESP: + osmo_fsm_inst_state_chg(fi, ST_READY, 0, 0); + if (mgcp_ctx->terminate) { + /* Trigger immediate DLCX if DLCX was requested while the FSM was + * busy with the previous operation */ + LOGPFSML(fi, LOGL_ERROR, "MGW/CRCX: FSM was busy while DLCX was requested, executing now...\n"); + osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); + } else + osmo_fsm_inst_dispatch(fi->proc.parent, mgcp_ctx->parent_evt, &mgcp_ctx->conn_info_remote); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static void mgw_mdcx_resp_cb(struct mgcp_response *r, void *priv); +static void mgw_dlcx_resp_cb(struct mgcp_response *r, void *priv); + +static void fsm_ready_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct msgb *msg; + struct mgcp_client *mgcp; + uint32_t new_state; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_MDCX: + msg = make_mdcx_msg(mgcp_ctx); + OSMO_ASSERT(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_resp_cb, fi); + new_state = ST_MDCX_RESP; + break; + case EV_DLCX: + msg = make_dlcx_msg(mgcp_ctx); + OSMO_ASSERT(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_dlcx_resp_cb, fi); + new_state = ST_DLCX_RESP; + break; + default: + OSMO_ASSERT(false); + break; + } + + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + mgcp_ctx->mgw_trans_pending = true; + + if (rc < 0) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_fsm_inst_state_chg(fi, new_state, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +static void mgw_mdcx_resp_cb(struct mgcp_response *r, void *priv) +{ + struct osmo_fsm_inst *fi = priv; + struct mgcp_ctx *mgcp_ctx; + int rc; + + OSMO_ASSERT(fi); + mgcp_ctx = fi->priv; + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->mgw_trans_pending = false; + + if (r->head.response_code != 200) { + LOGPFSML(fi, LOGL_ERROR, "MGW/MDCX: response yields error: %d %s\n", r->head.response_code, + r->head.comment); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, "MGW/MDCX: Cannot parse MDCX response\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + LOGPFSML(fi, LOGL_DEBUG, "MGW/MDCX: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + osmo_strlcpy(mgcp_ctx->conn_info_remote.addr, r->audio_ip, sizeof(mgcp_ctx->conn_info_remote.addr)); + mgcp_ctx->conn_info_remote.port = r->audio_port; + + osmo_fsm_inst_dispatch(fi, EV_MDCX_RESP, mgcp_ctx); +} + +static void fsm_mdcx_resp_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_MDCX_RESP: + osmo_fsm_inst_state_chg(fi, ST_READY, 0, 0); + if (mgcp_ctx->terminate) { + /* Trigger immediate DLCX if DLCX was requested while the FSM was + * busy with the previous operation */ + LOGPFSML(fi, LOGL_ERROR, "MGW/MDCX: FSM was busy while DLCX was requested, executing now...\n"); + osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); + } else + osmo_fsm_inst_dispatch(fi->proc.parent, mgcp_ctx->parent_evt, &mgcp_ctx->conn_info_remote); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static void mgw_dlcx_resp_cb(struct mgcp_response *r, void *priv) +{ + struct osmo_fsm_inst *fi = priv; + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(fi); + mgcp_ctx = fi->priv; + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->mgw_trans_pending = false; + + if (r->head.response_code != 250) { + LOGPFSML(fi, LOGL_ERROR, + "MGW/DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_fsm_inst_dispatch(fi, EV_DLCX_RESP, mgcp_ctx); +} + +static void fsm_dlcx_resp_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_DLCX_RESP: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* Note: We were unable to communicate with the MGW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + } else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static void fsm_cleanup_cb(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (mgcp_ctx->mgw_trans_pending) + mgcp_client_cancel(mgcp, mgcp_ctx->mgw_pending_trans); + + talloc_free(mgcp_ctx); +} + +static struct osmo_fsm_state fsm_mgcp_client_states[] = { + + /* Initial CRCX state. This state is immediately entered and executed + * when the FSM is started. The rationale is that we first have to + * create a connectin before we can execute other operations on that + * connection. */ + [ST_CRCX] = { + .in_event_mask = S(EV_CRCX), + .out_state_mask = S(ST_CRCX_RESP), + .name = OSMO_STRINGIFY(ST_CRCX), + .action = fsm_crcx_cb, + }, + + /* Wait for the response to a CRCX operation, check and process the + * results, change to ST_READY afterwards. */ + [ST_CRCX_RESP] = { + .in_event_mask = S(EV_CRCX_RESP), + .out_state_mask = S(ST_READY), + .name = OSMO_STRINGIFY(ST_CRCX_RESP), + .action = fsm_crcx_resp_cb, + }, + + /* In this idle state we wait for further operations (e.g. MDCX) that + * can be executed by the user using the API. There is no timeout in + * this state. The connection lives on until the user decides to + * terminate it (DLCX). */ + [ST_READY] = { + .in_event_mask = S(EV_MDCX) | S(EV_DLCX), + .out_state_mask = S(ST_MDCX_RESP) | S(ST_DLCX_RESP), + .name = OSMO_STRINGIFY(ST_READY), + .action = fsm_ready_cb, + }, + + /* Wait for the response of a MDCX operation, check and process the + * results, change to ST_READY afterwards. */ + [ST_MDCX_RESP] = { + .in_event_mask = S(EV_MDCX_RESP), + .out_state_mask = S(ST_READY), + .name = OSMO_STRINGIFY(ST_MDCX_RESP), + .action = fsm_mdcx_resp_cb, + }, + + /* Wait for the response of a DLCX operation and terminate the FSM + * normally. */ + [ST_DLCX_RESP] = { + .in_event_mask = S(EV_DLCX_RESP), + .out_state_mask = 0, + .name = OSMO_STRINGIFY(ST_DLCX_RESP), + .action = fsm_dlcx_resp_cb, + }, +}; + +static struct osmo_fsm fsm_mgcp_client = { + .name = "MGCP_CLIENT", + .states = fsm_mgcp_client_states, + .num_states = ARRAY_SIZE(fsm_mgcp_client_states), + .timer_cb = fsm_timeout_cb, + .cleanup = fsm_cleanup_cb, +}; + +/*! allocate FSM, and create a new connection on the MGW. + * \param[in] mgcp MGCP client descriptor. + * \param[in] mgcpparent_fi Parent FSM instance. + * \param[in] parent_term_evt Event to be sent to parent when terminating. + * \param[in] parent_evt Event to be sent to parent when operation is done. + * \param[in] conn_info Connection parameters (ip, port...). + * \returns newly-allocated, initialized and registered FSM instance, NULL on error. */ +struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, + uint32_t parent_term_evt, uint32_t parent_evt, struct mgcp_conn_info *conn_info) +{ + struct mgcp_ctx *mgcp_ctx; + static bool fsm_registered = false; + struct osmo_fsm_inst *fi; + struct in_addr ip_test; + + OSMO_ASSERT(parent_fi); + OSMO_ASSERT(mgcp); + OSMO_ASSERT(conn_info); + + /* Check if IP/Port informstaion in conn info makes sense */ + if (conn_info->port && inet_aton(conn_info->addr, &ip_test) == 0) + return NULL; + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_mgcp_client); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + fi = osmo_fsm_inst_alloc_child(&fsm_mgcp_client, parent_fi, parent_term_evt); + OSMO_ASSERT(fi); + mgcp_ctx = talloc_zero(fi, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->parent_evt = parent_evt; + + memcpy(&mgcp_ctx->conn_info_local, conn_info, sizeof(mgcp_ctx->conn_info_local)); + fi->priv = mgcp_ctx; + + /* start state machine */ + OSMO_ASSERT(fi->state == ST_CRCX); + osmo_fsm_inst_dispatch(fi, EV_CRCX, mgcp_ctx); + + return fi; +} + +/*! modify an existing connection on the MGW. + * \param[in] fi FSM instance. + * \param[in] parent_evt Event to be sent to parent when operation is done. + * \param[in] conn_info New connection information (ip, port...). + * \returns 0 on success, -EINVAL on error. */ +int mgcp_conn_modify(struct osmo_fsm_inst *fi, uint32_t parent_evt, struct mgcp_conn_info *conn_info) +{ + OSMO_ASSERT(fi); + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct in_addr ip_test; + + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(conn_info); + + /* The user must not issue an MDCX before the CRCX has completed, + * if this happens, it means that the parent FSM has overhead the + * parent_evt (mandatory!) and executed the MDCX without even + * waiting for the results. Another reason could be that the + * parent FSM got messed up */ + OSMO_ASSERT(fi->state != ST_CRCX_RESP); + + /* If the user tries to issue an MDCX while an DLCX operation is + * pending, there must be a serious problem with the paren FSM. + * Eeither the parent_term_evt (mandatory!) has been overheard, + * or the parant FSM got messed so badly that it still assumes + * a live connection although it as killed it. */ + OSMO_ASSERT(fi->state != ST_DLCX_RESP); + + /* Check if IP/Port parameters make sense */ + if (conn_info->port == 0) + return -EINVAL; + if (inet_aton(conn_info->addr, &ip_test) == 0) + return -EINVAL; + + /* The user may supply an endpoint identifier that is then checked + * here. This check is optional. Later steps do not depend on the + * endpoint identifier supplied here */ + if (strlen(conn_info->endpoint) && strcmp(conn_info->endpoint, mgcp_ctx->conn_info_remote.endpoint)) + return -EINVAL; + + /* Note: The call-id is implicitly known from the previoes CRCX and + * will not be checked even when it is set here. */ + + mgcp_ctx->parent_evt = parent_evt; + memcpy(&mgcp_ctx->conn_info_local, conn_info, sizeof(mgcp_ctx->conn_info_local)); + osmo_fsm_inst_dispatch(fi, EV_MDCX, mgcp_ctx); + return 0; +} + +/*! delete existing connection on the MGW, destroy FSM afterwards. + * \param[in] fi FSM instance. */ +void mgcp_conn_delete(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + struct mgcp_ctx *mgcp_ctx = fi->priv; + + OSMO_ASSERT(mgcp_ctx); + + /* Unlink FSM from parent */ + osmo_fsm_inst_unlink_parent(fi); + + /* An error situation where the parent FSM must be killed immediately + * may lead into a situation where the DLCX can not be executed right + * at that moment because the FSM is still busy with another operation. + * In those cases we postpone the DLCX so that the FSM and the + * connections on the MGW get cleaned up gracefully. */ + if (fi->state != ST_READY) { + LOGPFSML(fi, LOGL_ERROR, "MGW: operation still pending, DLCX will be postponed.\n"); + mgcp_ctx->terminate = true; + return; + } + osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); +} -- To view, visit https://gerrit.osmocom.org/5881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw 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 Fri Jan 19 18:03:39 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 18:03:39 +0000 Subject: [MERGED] osmo-mgw[master]: client: do not insist on \n\n when parsing MGCP messages In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: client: do not insist on \n\n when parsing MGCP messages ...................................................................... client: do not insist on \n\n when parsing MGCP messages The current implementation of mgcp_client.c requires MGCP paragraphs to be separated wit a \n\n sequence. However, when the client is used with servers other than osmo-mgcp, the parapgraph may be formatted differently. Also allow \n\r\n\r and \r\n\r\n as separator Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 23 insertions(+), 2 deletions(-) Approvals: daniel: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 9fc414d..f094a09 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -219,12 +219,33 @@ return -EINVAL; } +/* A new section is marked by a double line break, check a few more + * patterns as there may be variants */ +static char *mgcp_find_section_end(char *string) +{ + char *rc; + + rc = strstr(string, "\n\n"); + if (rc) + return rc; + + rc = strstr(string, "\n\r\n\r"); + if (rc) + return rc; + + rc = strstr(string, "\r\n\r\n"); + if (rc) + return rc; + + return NULL; +} + int mgcp_response_parse_params(struct mgcp_response *r) { char *line; int rc; OSMO_ASSERT(r->body); - char *data = strstr(r->body, "\n\n"); + char *data = mgcp_find_section_end(r->body); if (!data) { LOGP(DLMGCP, LOGL_ERROR, @@ -286,7 +307,7 @@ int rc = 0; OSMO_ASSERT(r->body); char *data = r->body; - char *data_end = strstr(r->body, "\n\n"); + char *data_end = mgcp_find_section_end(r->body); /* Protect SDP body, for_each_non_empty_line() will * only parse until it hits \0 mark. */ -- To view, visit https://gerrit.osmocom.org/5867 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie209fb71499e011e52f58575c6af118de2fdee88 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 19 18:03:58 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 19 Jan 2018 18:03:58 +0000 Subject: [MERGED] osmo-mgw[master]: main: display mgcp ip/port In-Reply-To: References: Message-ID: dexter has submitted this change and it was merged. Change subject: main: display mgcp ip/port ...................................................................... main: display mgcp ip/port osmo-mgw does not display the IP/Port on which it is listening for MGCP commands. However, this information can be very helpful when working with multiple MGCP instances on one machine. - print IP/Port on which we listen for MGCP commands on startup Change-Id: Idf5e8b6a7344c4ebaf9b89940456a496b2c23334 --- M src/osmo-mgw/mgw_main.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c index ba8883b..a2714e0 100644 --- a/src/osmo-mgw/mgw_main.c +++ b/src/osmo-mgw/mgw_main.c @@ -309,7 +309,8 @@ return -1; } - LOGP(DLMGCP, LOGL_NOTICE, "Configured for MGCP.\n"); + LOGP(DLMGCP, LOGL_NOTICE, "Configured for MGCP, listen on %s:%u\n", + cfg->source_addr, cfg->source_port); /* initialisation */ srand(time(NULL)); -- To view, visit https://gerrit.osmocom.org/5872 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf5e8b6a7344c4ebaf9b89940456a496b2c23334 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 19 19:43:24 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 19:43:24 +0000 Subject: libosmocore[master]: tests: fix LDADD: link libosmovty from current build In-Reply-To: References: Message-ID: Patch Set 3: Hmm, I just tried to compile the library without libosmovty at all, and... discovered that it's impossible: $ ./configure --disable-vty $ make ....... make[2]: *** No rule to make target `../../src/vty/libosmovty.la', needed by `libosmogb.la'. Stop. even this way: $ ./configure --disable-vty --disable-gb $ make ........ make[2]: *** No rule to make target `../../src/vty/libosmovty.la', needed by `libosmoctrl.la'. Stop. and finally: $ ./configure --disable-vty --disable-gb --disable-ctrl $ make [i] SUCCESS! Probably, this is unrelated to your issue, but anyway seems abnormal for me. I think we should have some kind of dependency trancing within configure... -- To view, visit https://gerrit.osmocom.org/5844 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id084e6e6efd25cd62b1bd7a4fc7c5985c39130c6 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr 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 Fri Jan 19 19:48:18 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 19:48:18 +0000 Subject: osmo-bsc[master]: HO: enable handover by initializing at startup; rename init ... In-Reply-To: References: Message-ID: Patch Set 4: Is there any explanation of the '_1_' is a new symbol? -- To view, visit https://gerrit.osmocom.org/5912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:03 +0000 Subject: osmo-bsc[master]: HO: Count number of free timeslot on a given BTS In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:19 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Count number of free timeslot on a given BTS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Count number of free timeslot on a given BTS ...................................................................... HO: Count number of free timeslot on a given BTS This is needed for handover algorithm to balance free slots and to prevent congestion of one cell, while other cells still have free capacities. Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b --- M include/osmocom/bsc/chan_alloc.h M src/libbsc/chan_alloc.c 2 files changed, 67 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index f2a75c5..748e9cd 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -24,6 +24,9 @@ struct gsm_subscriber_connection; +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan); + /* Allocate a logical channel (SDCCH, TCH, ...) */ struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 9946628..21c81aa 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -68,6 +68,70 @@ return true; } +static int trx_count_free_ts(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx_ts *ts; + int j, ss; + int count = 0; + + if (!trx_is_usable(trx)) + return 0; + + for (j = 0; j < ARRAY_SIZE(trx->ts); j++) { + enum gsm_phys_chan_config ts_pchan_is; + ts = &trx->ts[j]; + if (!ts_is_usable(ts)) + continue; + + ts_pchan_is = ts_pchan(ts); + + if (ts_pchan_is == GSM_PCHAN_PDCH) { + /* Dynamic timeslots in PDCH mode will become TCH if needed. */ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + continue; + + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (pchan == GSM_PCHAN_TCH_F) + count++; + else if (pchan == GSM_PCHAN_TCH_H) + count += 2; + continue; + + default: + /* Not dynamic, not applicable. */ + continue; + } + } + + if (ts_pchan_is != pchan) + continue; + /* check if all sub-slots are allocated yet */ + for (ss = 0; ss < ts_subslots(ts); ss++) { + struct gsm_lchan *lc = &ts->lchan[ss]; + if (lc->type == GSM_LCHAN_NONE && + lc->state == LCHAN_S_NONE) + count++; + } + } + + return count; +} + +/* Count number of free TS of given pchan type */ +int bts_count_free_ts(struct gsm_bts *bts, enum gsm_phys_chan_config pchan) +{ + struct gsm_bts_trx *trx; + int count = 0; + + llist_for_each_entry(trx, &bts->trx_list, list) + count += trx_count_free_ts(trx, pchan); + + return count; +} + static struct gsm_lchan * _lc_find_trx(struct gsm_bts_trx *trx, enum gsm_phys_chan_config pchan, enum gsm_phys_chan_config dyn_as_pchan) -- To view, visit https://gerrit.osmocom.org/5916 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8bee8a515ee8aa9a99af71756fe60b8dd8f868b Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:19 +0000 Subject: [MERGED] osmo-bsc[master]: HO: enable handover by initializing at startup; rename init ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: enable handover by initializing at startup; rename init function ...................................................................... HO: enable handover by initializing at startup; rename init function Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779 --- M include/osmocom/bsc/handover_decision.h M src/libbsc/handover_decision.c M src/osmo-bsc/osmo_bsc_main.c 3 files changed, 6 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h index 81078b0..fe551ca 100644 --- a/include/osmocom/bsc/handover_decision.h +++ b/include/osmocom/bsc/handover_decision.h @@ -1,7 +1,3 @@ -#ifndef _HANDOVER_DECISION_H -#define _HANDOVER_DECISION_H +#pragma once -void on_dso_load_ho_dec(void); - -#endif /* _HANDOVER_DECISION_H */ - +void handover_decision_1_init(void); diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 127b362..158fc1c 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -343,7 +343,7 @@ return 0; } -void on_dso_load_ho_dec(void) +void handover_decision_1_init(void) { osmo_signal_register_handler(SS_LCHAN, ho_dec_sig_cb, NULL); } diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index 1555ac1..1aff4c5 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -296,6 +297,8 @@ mgcp_init(bsc_gsmnet); + handover_decision_1_init(); + signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); -- To view, visit https://gerrit.osmocom.org/5912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I224884c84895ebf6c8cf498c16616214cb2b5779 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:20 +0000 Subject: [MERGED] osmo-bsc[master]: HO: add indicators for inter-cell and async ho, use for chan... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: add indicators for inter-cell and async ho, use for chan act type ...................................................................... HO: add indicators for inter-cell and async ho, use for chan act type Change-Id: I2d91765c1f9719c64fd99426a872cecc724215db --- M src/libbsc/handover_logic.c 1 file changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index cad0144..f525b21 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -48,6 +48,9 @@ struct osmo_timer_list T3103; uint8_t ho_ref; + + bool inter_cell; + bool async; }; static LLIST_HEAD(bsc_handovers); @@ -125,6 +128,10 @@ ho->old_lchan = old_lchan; ho->new_lchan = new_lchan; ho->ho_ref = ho_ref++; + if (old_lchan->ts->trx->bts != bts) { + ho->inter_cell = true; + ho->async = true; + } /* copy some parameters from old lchan */ memcpy(&new_lchan->encr, &old_lchan->encr, sizeof(new_lchan->encr)); @@ -139,7 +146,11 @@ new_lchan->conn->ho_lchan = new_lchan; /* FIXME: do we have a better idea of the timing advance? */ - rc = rsl_chan_activate_lchan(new_lchan, RSL_ACT_INTER_ASYNC, ho->ho_ref); + rc = rsl_chan_activate_lchan(new_lchan, + ho->inter_cell + ? (ho->async ? RSL_ACT_INTER_ASYNC : RSL_ACT_INTER_SYNC) + : RSL_ACT_INTRA_IMM_ASS, + ho->ho_ref); if (rc < 0) { LOGP(DHO, LOGL_ERROR, "could not activate channel\n"); new_lchan->conn->ho_lchan = NULL; -- To view, visit https://gerrit.osmocom.org/5894 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d91765c1f9719c64fd99426a872cecc724215db Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:20 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Always update rqd_ta after receiving measurement report In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Always update rqd_ta after receiving measurement report ...................................................................... HO: Always update rqd_ta after receiving measurement report The up-to-date rqd_ta is required for assignment command. If the phone moves, the timing advance might change. The rqd_ta will be updated by each measurement report. Change-Id: If1a592e590cfed55ff3dca5be89e2946e8017a22 --- M src/libbsc/abis_rsl.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 457cc95..b54fab8 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1512,6 +1512,8 @@ if (msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_BS11 || msg->lchan->ts->trx->bts->type == GSM_BTS_TYPE_NOKIA_SITE) mr->ms_l1.ta >>= 2; + /* store TA for next assignment/handover */ + mr->lchan->rqd_ta = mr->ms_l1.ta; } if (TLVP_PRESENT(&tp, RSL_IE_L3_INFO)) { msg->l3h = (uint8_t *) TLVP_VAL(&tp, RSL_IE_L3_INFO); -- To view, visit https://gerrit.osmocom.org/5905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If1a592e590cfed55ff3dca5be89e2946e8017a22 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:20 +0000 Subject: [MERGED] osmo-bsc[master]: Allow assignment to TCH channel with signalling only mode In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Allow assignment to TCH channel with signalling only mode ...................................................................... Allow assignment to TCH channel with signalling only mode This makes sense, if silent call is used. Assignment allows to change from SDCCH (or whatever was available) to given TCH rate. Change-Id: I2efe9d7ab429e902581ebb9e0e006f2aec6d8972 --- M src/libbsc/bsc_api.c 1 file changed, 2 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 714fc11..dad1d54 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -240,7 +240,8 @@ /* copy new data to it */ new_lchan->tch_mode = chan_mode; - new_lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH; + new_lchan->rsl_cmode = (chan_mode == GSM48_CMODE_SIGN) ? + RSL_CMOD_SPD_SIGN : RSL_CMOD_SPD_SPEECH; /* handle AMR correctly */ if (chan_mode == GSM48_CMODE_SPEECH_AMR) @@ -358,8 +359,6 @@ { switch (chan_mode) { case GSM48_CMODE_SIGN: - /* signalling is always possible */ - return 1; case GSM48_CMODE_SPEECH_V1: case GSM48_CMODE_SPEECH_AMR: case GSM48_CMODE_DATA_3k6: -- To view, visit https://gerrit.osmocom.org/5909 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2efe9d7ab429e902581ebb9e0e006f2aec6d8972 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:21 +0000 Subject: [MERGED] osmo-bsc[master]: HO: fix recovery from failed handover In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: fix recovery from failed handover ...................................................................... HO: fix recovery from failed handover Do not instruct the MGW to move the RTP to the new lchan before we have received a HANDOVER DETECT. Before: Chan Activ Chan Activ Ack IPACC-CRCX -ACK IPACC-MDCX -ACK MGCP MDCX --> MGW ... HANDOVER DETECT Call continues on new lchan In above sequence, if the HANDOVER DETECT times out, the MGW has moved to the new lchan which never becomes used and is released. Furthermore, from the IPACC MDCX until the HANDOVER DETECT, the RTP stream would break off momentarily. After: Chan Activ Chan Activ Ack IPACC-CRCX -ACK IPACC-MDCX -ACK ... HANDOVER DETECT MGCP MDCX --> MGW Call continues on new lchan If the HANDOVER DETECT times out, the call happily continues on the old lchan. This change is inspired by Ivan Kluchnikov's HO work, who implemented a similar fix in the openbsc.git codebase (branch fairwaves/master-rebase): his patch moves ipacc_mdcx() to connect RTP to the new lchan from switch_for_handover() (which triggered on S_ABISIP_CRCX_ACK, i.e. creation of the new lchan) to later on in ho_detect() a.k.a. the S_LCHAN_HANDOVER_DETECT signal handler: http://git.osmocom.org/openbsc/commit/?h=fairwaves/master-rebase&id=9507a7a1ea627e07370c9d264816bb190b3b91b8 This patch does essentially the same: remove the mgcp_handover() call from the MDCX-ACK handling (creation of the new lchan), and add a signal handler for S_LCHAN_HANDOVER_DETECT to osmo_bsc_mgcp.c to effect the MGW switchover. Note, it would have been possible to call mgcp_handover() directly from rx of the HANDOVER DETECT message, but that produces linking fallout in some utils/ projects, which then need to link the mgcp code as well. That is because those aren't properly separated from the more complex parts of libbsc. Using the signal is a bit bloaty, but saves the linking hell for now. I've faced a similar problem twice recently, it would pay off to separate out the simpler utils/ and ipaccess/ tools so that they don't need to link all of libbsc and osmo-bsc, at some point (TM). Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f --- M include/osmocom/bsc/osmo_bsc_mgcp.h M src/libbsc/handover_logic.c M src/osmo-bsc/osmo_bsc_audio.c M src/osmo-bsc/osmo_bsc_mgcp.c 4 files changed, 66 insertions(+), 16 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h index 1e06331..dc2ba34 100644 --- a/include/osmocom/bsc/osmo_bsc_mgcp.h +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -58,5 +58,4 @@ enum gsm48_chan_mode chan_mode, bool full_rate); void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); void mgcp_ass_complete(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *lchan); -void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan); void mgcp_free_ctx(struct mgcp_ctx *mgcp_ctx); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index a30cd09..cad0144 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -325,7 +325,11 @@ return -ENODEV; } - /* FIXME: do we actually want to do something here ? */ + LOGP(DHO, LOGL_DEBUG, "%s Handover RACH detected\n", gsm_lchan_name(new_lchan)); + + /* This is just for logging on the DHO category. The actual MGCP switchover happens in + * osmo_bsc_mgcp.c by receiving the same S_LCHAN_HANDOVER_DETECT signal. + * (Calling mgcp_handover() directly currently breaks linking in utils/...) */ return 0; } diff --git a/src/osmo-bsc/osmo_bsc_audio.c b/src/osmo-bsc/osmo_bsc_audio.c index 433dc6c..ceec469 100644 --- a/src/osmo-bsc/osmo_bsc_audio.c +++ b/src/osmo-bsc/osmo_bsc_audio.c @@ -50,11 +50,6 @@ switch (signal) { case S_ABISIP_CRCX_ACK: - /* - * TODO: handle handover here... then the audio should go to - * the old mgcp port.. - */ - /* we can ask it to connect now */ LOGP(DMSC, LOGL_DEBUG, "Connecting BTS to port: %d conn: %d\n", con->sccp_con->user_plane.rtp_port, lchan->abis_ip.conn_id); @@ -77,14 +72,11 @@ case S_ABISIP_MDCX_ACK: if (con->ho_lchan) { - /* NOTE: When an ho_lchan exists, the MDCX is part of an - * handover operation (intra-bsc). This means we will not - * inform the MSC about the event, which means that no - * assignment complete message is transmitted, we just - * inform the logic that controls the MGW about the new - * connection info */ - LOGP(DMSC, LOGL_INFO,"RTP connection handover initiated...\n"); - mgcp_handover(con->sccp_con->user_plane.mgcp_ctx, con->ho_lchan); + LOGP(DHO, LOGL_DEBUG, "%s -> %s BTS sent MDCX ACK\n", gsm_lchan_name(lchan), + gsm_lchan_name(con->ho_lchan)); + /* No need to do anything for handover here. As soon as a HANDOVER DETECT + * happens, osmo_bsc_mgcp.c will trigger the MGCP MDCX towards MGW by + * receiving an S_LCHAN_HANDOVER_DETECT signal. */ } else if (is_ipaccess_bts(conn_get_bts(con)) && con->sccp_con->user_plane.rtp_ip) { /* NOTE: This is only relevant on AoIP networks with * IPA based base stations. See also osmo_bsc_api.c, diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 519eaf4..bdf2dd2 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1048,7 +1049,7 @@ * Parameter: * mgcp_ctx: context information (FSM, and pointer to external system data) * ho_lchan: the lchan on the new BTS */ -void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan) +static void mgcp_handover(struct mgcp_ctx *mgcp_ctx, struct gsm_lchan *ho_lchan) { OSMO_ASSERT(mgcp_ctx); OSMO_ASSERT(ho_lchan); @@ -1066,6 +1067,59 @@ osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_HANDOVER, mgcp_ctx); return; +} + +/* GSM 08.58 HANDOVER DETECT has been received */ +static int mgcp_sig_ho_detect(struct gsm_lchan *new_lchan) +{ + struct gsm_subscriber_connection *conn; + if (!new_lchan) { + LOGP(DHO, LOGL_ERROR, "HO Detect signal for NULL lchan\n"); + return -EINVAL; + } + + conn = new_lchan->conn; + + if (!conn) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for lchan without conn\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + if (!conn->sccp_con) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for conn without sccp_con\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + if (!conn->sccp_con->user_plane.mgcp_ctx) { + LOGP(DHO, LOGL_ERROR, "%s HO Detect for conn without MGCP ctx\n", + gsm_lchan_name(new_lchan)); + return -EINVAL; + } + + mgcp_handover(conn->sccp_con->user_plane.mgcp_ctx, new_lchan); + return 0; +} + +static int mgcp_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct lchan_signal_data *lchan_data; + + switch (subsys) { + case SS_LCHAN: + lchan_data = signal_data; + switch (signal) { + case S_LCHAN_HANDOVER_DETECT: + return mgcp_sig_ho_detect(lchan_data->lchan); + } + break; + default: + break; + } + + return 0; } /* Free an existing mgcp context gracefully @@ -1090,4 +1144,5 @@ void mgcp_init(struct gsm_network *net) { osmo_fsm_register(&fsm_bsc_mgcp); + osmo_signal_register_handler(SS_LCHAN, mgcp_sig_cb, NULL); } -- To view, visit https://gerrit.osmocom.org/5891 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iec58c5fcc5697f1775da7ec0111135108ed1fc8f Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:21 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Add function to count currently ongoing handovers to a g... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Add function to count currently ongoing handovers to a given BTS ...................................................................... HO: Add function to count currently ongoing handovers to a given BTS In order to keep processing power at BTS at a defined level, the handover decision might want to limit maximum number of slots that require RACH detection. Change-Id: I8908e37fe0d8d2eda906cc6301ba0969b25a5575 --- M include/osmocom/bsc/handover.h M src/libbsc/handover_logic.c 2 files changed, 20 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h index 9e2ba1a..a9349ee 100644 --- a/include/osmocom/bsc/handover.h +++ b/include/osmocom/bsc/handover.h @@ -7,3 +7,5 @@ int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); + +int bsc_ho_count(struct gsm_bts *bts, bool inter_cell); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index f525b21..ee7b683 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -389,3 +389,21 @@ { osmo_signal_register_handler(SS_LCHAN, ho_logic_sig_cb, NULL); } + +/* Count number of currently ongoing handovers + * inter_cell: if true, count only handovers between two cells. If false, count only handovers within one + * cell. */ +int bsc_ho_count(struct gsm_bts *bts, bool inter_cell) +{ + struct bsc_handover *ho; + int count = 0; + + llist_for_each_entry(ho, &bsc_handovers, list) { + if (ho->inter_cell != inter_cell) + continue; + if (ho->new_lchan->ts->trx->bts == bts) + count++; + } + + return count; +} -- To view, visit https://gerrit.osmocom.org/5895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8908e37fe0d8d2eda906cc6301ba0969b25a5575 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:21 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Changed availablilty of ts_is_usable() from static to ex... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Changed availablilty of ts_is_usable() from static to extern ...................................................................... HO: Changed availablilty of ts_is_usable() from static to extern Change-Id: I3471e38327c4b98490faed9b604fb76438ba9954 --- M include/osmocom/bsc/chan_alloc.h M src/libbsc/chan_alloc.c 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index 62d0286..f2a75c5 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -47,5 +47,6 @@ void network_chan_load(struct pchan_load *pl, struct gsm_network *net); bool trx_is_usable(const struct gsm_bts_trx *trx); +bool ts_is_usable(const struct gsm_bts_trx_ts *ts); #endif /* _CHAN_ALLOC_H */ diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 1caa13d..9946628 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -34,7 +34,7 @@ #include -static bool ts_is_usable(const struct gsm_bts_trx_ts *ts) +bool ts_is_usable(const struct gsm_bts_trx_ts *ts) { if (!trx_is_usable(ts->trx)) return false; -- To view, visit https://gerrit.osmocom.org/5904 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3471e38327c4b98490faed9b604fb76438ba9954 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:22 +0000 Subject: [MERGED] osmo-bsc[master]: fixup: neigh_meas_avg: detect invalid window size as <=0, lo... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid ...................................................................... fixup: neigh_meas_avg: detect invalid window size as <=0, log if invalid Change-Id: I8c5d0642aeb4fbee73a035b9f73cf3a09b1bcf90 --- M src/libbsc/handover_decision.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 04ca144..1ad4b36 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -103,8 +103,10 @@ if (window < nmp->rxlev_cnt) window = nmp->rxlev_cnt; /* this should never happen */ - if (window == 0) + if (window <= 0) { + LOGP(DHO, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); return 0; + } idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), -- To view, visit https://gerrit.osmocom.org/5902 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c5d0642aeb4fbee73a035b9f73cf3a09b1bcf90 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:22 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Assign SDCCH on channel request In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Assign SDCCH on channel request ...................................................................... HO: Assign SDCCH on channel request This is needed, so channel can be negotiated before the actual channel type is assigned. In case there is no SDCCH available, try to assign what ever the MS requested. If this is not possible try to assign TCH/F. If this is still not possible, reject channel request. Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 --- M src/libbsc/abis_rsl.c 1 file changed, 20 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 980b3e6..64e5c92 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1890,8 +1890,26 @@ */ is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); - /* check availability / allocate channel */ - lchan = lchan_alloc(bts, lctype, is_lu); + /* check availability / allocate channel + * + * - First try to allocate SDCCH. + * - If SDCCH is not available, try whatever MS requested, if not SDCCH. + * - If there is still no channel available, reject channel request. + * + * lchan_alloc() possibly tries to allocate larger lchans. + * + * Note: If the MS requests not TCH/H, we don't know if the phone + * supports TCH/H, so we must assign TCH/F or SDCCH. + */ + lchan = lchan_alloc(bts, GSM_LCHAN_SDCCH, 0); + if (!lchan && lctype != GSM_LCHAN_SDCCH) { + LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s " + "0x%x, retrying with %s\n", + msg->lchan->ts->trx->bts->nr, + gsm_lchant_name(GSM_LCHAN_SDCCH), rqd_ref->ra, + gsm_lchant_name(lctype)); + lchan = lchan_alloc(bts, lctype, 0); + } if (!lchan) { LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); -- To view, visit https://gerrit.osmocom.org/5898 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:22 +0000 Subject: [MERGED] osmo-bsc[master]: Do not perform assignment, if the new channel equals the cur... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Do not perform assignment, if the new channel equals the current one ...................................................................... Do not perform assignment, if the new channel equals the current one This can happen, if a TCH/H was requested, but because it is not available, a TCH/F is allocated. If the old channel was TCH/F already, it makes no sense to assign it. Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae --- M src/libbsc/bsc_api.c 1 file changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index ec64bb8..714fc11 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -210,7 +210,7 @@ static int handle_new_assignment(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate) { struct gsm_lchan *new_lchan; - int chan_type; + enum gsm_chan_t chan_type; chan_type = full_rate ? GSM_LCHAN_TCH_F : GSM_LCHAN_TCH_H; @@ -221,6 +221,17 @@ return -1; } + /* check if we are on TCH/F and requested TCH/H, but got TCH/F */ + if (conn->lchan->type == new_lchan->type + && chan_type != new_lchan->type) { + LOGP(DHO, LOGL_NOTICE, "%s -> %s Will not re-assign to identical channel type," + " %s was requested\n", + gsm_lchan_name(conn->lchan), gsm_lchan_name(new_lchan), + gsm_lchant_name(chan_type)); + lchan_free(new_lchan); + return -1; + } + /* copy old data to the new channel */ memcpy(&new_lchan->encr, &conn->lchan->encr, sizeof(new_lchan->encr)); new_lchan->ms_power = conn->lchan->ms_power; -- To view, visit https://gerrit.osmocom.org/5908 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I284125483fc14b8f82e32ee61aa3866746238eae Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:22 +0000 Subject: [MERGED] osmo-bsc[master]: HO prep: introduce per-BTS handover config, with defaults on... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO prep: introduce per-BTS handover config, with defaults on net node ...................................................................... HO prep: introduce per-BTS handover config, with defaults on net node It is desirable to allow configuring handover for each individual network cell. At the same time, it is desirable to set global defaults. Treat the 'network' node handover parameters as global defaults, add another set of parameters for each individual BTS. This raises questions on how the 'network' node should affect the individual BTS. The simplistic solution would have been: on creating a BTS in the config, just copy the current defaults; with serious drawbacks: - tweaking any parameter in the telnet VTY on network node will never affect any running BTS. - network node defaults *must* be issued before the bts sections in the config file. - when writing a config back to file, we would copy all net node defaults to each BTS node, making the network node configs pointless. Instead, add a handover_cfg API that tracks whether a given node has a value set or not. A bts node ho_cfg gets a pointer to the network node config and returns those values if locally unset. If no value is set on any node, use the "factory" defaults, which are hardcoded in the API. Only write back exactly those config items that were actually issued in a config file / on the telnet VTY. (ho_cfg API wise, we could trivially add another ho_cfg level per TRX if we so desire in the future.) Implement ho parameters as an opaque config struct with getters and setters to ensure the tracking is always heeded. Opaqueness dictates allocating instead of direct embedding in gsm_network and gsm_bts structs, ctx is gsm_net / bts. This is 100% backwards compatible to old configs. - No VTY command syntax changes (only the online help). - If a 'bts' sets nothing, it will use the 'network' defaults. - The 'show network' output only changes in presence of individual BTS configs. On 'show network', say "Handover: On|Off" as before, iff all BTS reflect identical behavior. Otherwise, output BTS counts of handover being enabled or not. Use the same set of VTY commands (same VTY cmd syntax as before) on network and BTS nodes, i.e. don't duplicate VTY code. From the current vty->node, figure out which ho_cfg to modify. For linking, add handover_cfg.c (the value API) in libcommon, while the handover_vty.c is in libbsc. This is mainly because some utility programs use gsm_network and hence suck in the ho stuff, but don't need the VTY commands. Review the VTY online help strings. Add VTY transcript test for handover options, testing config propagation from network to bts nodes, 'show network' output and VTY online help strings. (Needs recent addition of '... !' wildcard to osmo_interact_common.py.) I considered leaving parts of this more readable, but in the end decided for heavy use of macros to define and declare the API, because more values will be added in upcoming patches and I want to prevent myself from messing them up. Inspired-by: jolly/new_handover branch, which moves the config to 'bts' level Depends: I7c1ebb2e7f059047903a53de26a0ec1ce7fa9b98 (osmo-python-tests) Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a --- M include/osmocom/bsc/Makefile.am M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h A include/osmocom/bsc/handover_cfg.h A include/osmocom/bsc/handover_vty.h M src/libbsc/Makefile.am M src/libbsc/bsc_vty.c M src/libbsc/handover_decision.c A src/libbsc/handover_vty.c M src/libbsc/net_init.c M src/libcommon/Makefile.am M src/libcommon/gsm_data.c M src/libcommon/gsm_data_shared.c A src/libcommon/handover_cfg.c M tests/Makefile.am A tests/handover_cfg.vty 16 files changed, 653 insertions(+), 150 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/Makefile.am b/include/osmocom/bsc/Makefile.am index b067fc2..699aeb3 100644 --- a/include/osmocom/bsc/Makefile.am +++ b/include/osmocom/bsc/Makefile.am @@ -25,7 +25,9 @@ gsm_data.h \ gsm_data_shared.h \ handover.h \ + handover_cfg.h \ handover_decision.h \ + handover_vty.h \ ipaccess.h \ meas_feed.h \ meas_rep.h \ diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index ed2a95c..c09d546 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -227,22 +227,7 @@ uint16_t network_code; int a5_encryption; int neci; - struct { - int active; - /* Window RXLEV averaging */ - unsigned int win_rxlev_avg; /* number of SACCH frames */ - /* Window RXQUAL averaging */ - unsigned int win_rxqual_avg; /* number of SACCH frames */ - /* Window RXLEV neighbouring cells averaging */ - unsigned int win_rxlev_avg_neigh; /* number of SACCH frames */ - - /* how often should we check for power budget HO */ - unsigned int pwr_interval; /* SACCH frames */ - /* how much better does a neighbor cell have to be ? */ - unsigned int pwr_hysteresis; /* dBm */ - /* maximum distacne before we try a handover */ - unsigned int max_distance; /* TA values */ - } handover; + struct handover_cfg *ho; struct rate_ctr_group *bsc_ctrs; diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index db854fd..fd566d2 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -799,6 +799,8 @@ struct pcu_sock_state *pcu_state; struct rate_ctr_group *bts_ctrs; + + struct handover_cfg *ho; }; diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h new file mode 100644 index 0000000..95c0e50 --- /dev/null +++ b/include/osmocom/bsc/handover_cfg.h @@ -0,0 +1,112 @@ +#pragma once + +#include + +struct vty; + +/* handover_cfg is an opaque struct to manage several levels of configuration. There is an overall handover + * config on 'network' level and a per-'bts' specific handover config. If the 'bts' level sets no values, + * the defaults from 'network' level are used implicitly, and changes take effect immediately. */ +struct handover_cfg; + +struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg); + +#define HO_CFG_STR_HANDOVER "Handover options\n" +#define HO_CFG_STR_WIN HO_CFG_STR_HANDOVER "Measurement averaging settings\n" +#define HO_CFG_STR_WIN_RXLEV HO_CFG_STR_WIN "Received-Level averaging\n" +#define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" +#define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" +#define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" + +#define as_is(x) (x) + +static inline bool a2bool(const char *arg) +{ + return (bool)(atoi(arg)); +} + +static inline int bool2i(bool arg) +{ + return arg? 1 : 0; +} + + +/* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, + * function declarations or definitions... It is of the format + * HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, + * VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, + * VTY_WRITE_FMT, VTY_WRITE_CONV, + * VTY_DOC) + * Then using HO_CFG_ALL_MEMBERS can save a lot of code dup in defining API declaration, API + * definitions, VTY commands and VTY write code. Of course this doesn't prevent us from adding manual + * members as well, in case future additions don't fit in this scheme. + * + * TYPE: a type name like int. + * NAME: a variable name suitable for a struct member. + * DEFAULT_VAL: default value, as passed to the VTY, e.g. '0' or 'foo', without quotes. + * VTY_CMD: a command string for VTY without any arguments. + * VTY_CMD_ARG: VTY value range like '<0-23>' or 'foo|bar', will become '(VTY_CMD_ARG|default)'. + * VTY_ARG_EVAL: function name for parsing the VTY arg[0], e.g. 'atoi'. + * VTY_WRITE_FMT: printf-like string format for vty_out(). + * VTY_WRITE_CONV: function name to convert struct value to VTY_WRITE_FMT, e.g. 'as_is'. + * VTY_DOC: VTY documentation strings to match VTY_CMD and VTY_CMD_ARGs. + */ +#define HO_CFG_ALL_MEMBERS \ + \ + HO_CFG_ONE_MEMBER(bool, ho_active, 0, \ + "handover", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Disable in-call handover\n" \ + "Enable in-call handover\n" \ + "Enable/disable handover: ") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ + "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXLEV \ + "How many RxLev measurements are used for averaging\n" \ + "RxLev averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxqual_avg_win, 1, \ + "handover window rxqual averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXQUAL \ + "How many RxQual measurements are used for averaging\n" \ + "RxQual averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, rxlev_neigh_avg_win, 10, \ + "handover window rxlev neighbor averaging", "<1-10>", atoi, "%u", as_is, \ + HO_CFG_STR_WIN_RXLEV \ + "How many Neighbor RxLev measurements are used for averaging\n" \ + "How many Neighbor RxLev measurements are used for averaging\n" \ + "Neighbor RxLev averaging: " HO_CFG_STR_AVG_COUNT) \ + \ + HO_CFG_ONE_MEMBER(unsigned int, pwr_interval, 6, \ + "handover power budget interval", "<1-99>", atoi, "%u", as_is, \ + HO_CFG_STR_POWER_BUDGET \ + "How often to check for a better cell (SACCH frames)\n" \ + "Check for stronger neighbor every N number of SACCH frames\n") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, pwr_hysteresis, 3, \ + "handover power budget hysteresis", "<0-999>", atoi, "%u", as_is, \ + HO_CFG_STR_POWER_BUDGET \ + "How many dBm stronger must a neighbor be to become a HO candidate\n" \ + "Neighbor's strength difference in dBm\n") \ + \ + HO_CFG_ONE_MEMBER(unsigned int, max_distance, 9999, \ + "handover maximum distance" , "<0-9999>", atoi, "%u", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ + "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ + + +/* Declare public API for handover cfg parameters... */ + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + TYPE ho_get_##NAME(struct handover_cfg *ho); \ + void ho_set_##NAME(struct handover_cfg *ho, TYPE val); \ + bool ho_isset_##NAME(struct handover_cfg *ho); \ + void ho_clear_##NAME(struct handover_cfg *ho); \ + bool ho_isset_on_parent_##NAME(struct handover_cfg *ho); + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER diff --git a/include/osmocom/bsc/handover_vty.h b/include/osmocom/bsc/handover_vty.h new file mode 100644 index 0000000..48af136 --- /dev/null +++ b/include/osmocom/bsc/handover_vty.h @@ -0,0 +1,7 @@ +#pragma once + +#include +#include + +void ho_vty_init(); +void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho); diff --git a/src/libbsc/Makefile.am b/src/libbsc/Makefile.am index 3ac1c0b..d118f44 100644 --- a/src/libbsc/Makefile.am +++ b/src/libbsc/Makefile.am @@ -57,5 +57,6 @@ net_init.c \ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ + handover_vty.c \ $(NULL) diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 75b0b9a..b4a8e2d 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -58,6 +58,8 @@ #include #include #include +#include +#include #include #include @@ -178,8 +180,27 @@ VTY_NEWLINE); vty_out(vty, " Use TCH for Paging any: %d%s", net->pag_any_tch, VTY_NEWLINE); - vty_out(vty, " Handover: %s%s", net->handover.active ? "On" : "Off", - VTY_NEWLINE); + + { + struct gsm_bts *bts; + unsigned int ho_active_count = 0; + unsigned int ho_inactive_count = 0; + + llist_for_each_entry(bts, &net->bts_list, list) { + if (ho_get_ho_active(bts->ho)) + ho_active_count ++; + else + ho_inactive_count ++; + } + + if (ho_active_count && ho_inactive_count) + vty_out(vty, " Handover: On at %u BTS, Off at %u BTS%s", + ho_active_count, ho_inactive_count, VTY_NEWLINE); + else + vty_out(vty, " Handover: %s%s", ho_active_count ? "On" : "Off", + VTY_NEWLINE); + } + network_chan_load(&pl, net); vty_out(vty, " Current Channel Load:%s", VTY_NEWLINE); dump_pchan_load_vty(vty, " ", &pl); @@ -778,6 +799,8 @@ if (bts->pcu_sock_path) vty_out(vty, " pcu-socket %s%s", bts->pcu_sock_path, VTY_NEWLINE); + ho_vty_write(vty, " ", bts->ho); + config_write_bts_model(vty, bts); } @@ -807,19 +830,9 @@ vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); vty_out(vty, " neci %u%s", gsmnet->neci, VTY_NEWLINE); vty_out(vty, " paging any use tch %d%s", gsmnet->pag_any_tch, VTY_NEWLINE); - vty_out(vty, " handover %u%s", gsmnet->handover.active, VTY_NEWLINE); - vty_out(vty, " handover window rxlev averaging %u%s", - gsmnet->handover.win_rxlev_avg, VTY_NEWLINE); - vty_out(vty, " handover window rxqual averaging %u%s", - gsmnet->handover.win_rxqual_avg, VTY_NEWLINE); - vty_out(vty, " handover window rxlev neighbor averaging %u%s", - gsmnet->handover.win_rxlev_avg_neigh, VTY_NEWLINE); - vty_out(vty, " handover power budget interval %u%s", - gsmnet->handover.pwr_interval, VTY_NEWLINE); - vty_out(vty, " handover power budget hysteresis %u%s", - gsmnet->handover.pwr_hysteresis, VTY_NEWLINE); - vty_out(vty, " handover maximum distance %u%s", - gsmnet->handover.max_distance, VTY_NEWLINE); + + ho_vty_write(vty, " ", gsmnet->ho); + VTY_OUT_TIMER(3101); VTY_OUT_TIMER(3103); VTY_OUT_TIMER(3105); @@ -1646,100 +1659,6 @@ gsmnet->neci = atoi(argv[0]); gsm_net_update_ctype(gsmnet); - return CMD_SUCCESS; -} - -#define HANDOVER_STR "Handover Options\n" - -DEFUN(cfg_net_handover, cfg_net_handover_cmd, - "handover (0|1)", - HANDOVER_STR - "Don't perform in-call handover\n" - "Perform in-call handover\n") -{ - int enable = atoi(argv[0]); - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - if (enable && ipacc_rtp_direct) { - vty_out(vty, "%% Cannot enable handover unless RTP Proxy mode " - "is enabled by using the -P command line option%s", - VTY_NEWLINE); - return CMD_WARNING; - } - gsmnet->handover.active = enable; - - return CMD_SUCCESS; -} - -#define HO_WIN_STR HANDOVER_STR "Measurement Window\n" -#define HO_WIN_RXLEV_STR HO_WIN_STR "Received Level Averaging\n" -#define HO_WIN_RXQUAL_STR HO_WIN_STR "Received Quality Averaging\n" -#define HO_PBUDGET_STR HANDOVER_STR "Power Budget\n" -#define HO_AVG_COUNT_STR "Amount to use for Averaging\n" - -DEFUN(cfg_net_ho_win_rxlev_avg, cfg_net_ho_win_rxlev_avg_cmd, - "handover window rxlev averaging <1-10>", - HO_WIN_RXLEV_STR - "How many RxLev measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxlev_avg = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_win_rxqual_avg, cfg_net_ho_win_rxqual_avg_cmd, - "handover window rxqual averaging <1-10>", - HO_WIN_RXQUAL_STR - "How many RxQual measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxqual_avg = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_win_rxlev_neigh_avg, cfg_net_ho_win_rxlev_avg_neigh_cmd, - "handover window rxlev neighbor averaging <1-10>", - HO_WIN_RXLEV_STR "Neighbor\n" - "How many RxQual measurements are used for averaging\n" - HO_AVG_COUNT_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.win_rxlev_avg_neigh = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_pwr_interval, cfg_net_ho_pwr_interval_cmd, - "handover power budget interval <1-99>", - HO_PBUDGET_STR - "How often to check if we have a better cell (SACCH frames)\n" - "Interval\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.pwr_interval = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_pwr_hysteresis, cfg_net_ho_pwr_hysteresis_cmd, - "handover power budget hysteresis <0-999>", - HO_PBUDGET_STR - "How many dB does a neighbor to be stronger to become a HO candidate\n" - "Hysteresis\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.pwr_hysteresis = atoi(argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ho_max_distance, cfg_net_ho_max_distance_cmd, - "handover maximum distance <0-9999>", - HANDOVER_STR - "How big is the maximum timing advance before HO is forced\n" - "Distance\n" "Number\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->handover.max_distance = atoi(argv[0]); return CMD_SUCCESS; } @@ -4387,13 +4306,6 @@ logging_vty_add_cmds(NULL); install_element(GSMNET_NODE, &cfg_net_neci_cmd); - install_element(GSMNET_NODE, &cfg_net_handover_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_neigh_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_pwr_interval_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_pwr_hysteresis_cmd); - install_element(GSMNET_NODE, &cfg_net_ho_max_distance_cmd); install_element(GSMNET_NODE, &cfg_net_T3101_cmd); install_element(GSMNET_NODE, &cfg_net_T3103_cmd); install_element(GSMNET_NODE, &cfg_net_T3105_cmd); @@ -4408,6 +4320,7 @@ install_element(GSMNET_NODE, &cfg_net_T3141_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); + /* See also handover commands added on net level from handover_vty.c */ install_element(GSMNET_NODE, &cfg_bts_cmd); install_node(&bts_node, config_write_bts); @@ -4513,6 +4426,7 @@ install_element(BTS_NODE, &cfg_bts_amr_hr_hyst3_cmd); install_element(BTS_NODE, &cfg_bts_amr_hr_start_mode_cmd); install_element(BTS_NODE, &cfg_bts_pcu_sock_cmd); + /* See also handover commands added on bts level from handover_vty.c */ install_element(BTS_NODE, &cfg_trx_cmd); install_node(&trx_node, dummy_config_write); @@ -4551,6 +4465,8 @@ e1inp_vty_init(); osmo_fsm_vty_add_cmds(); + ho_vty_init(); + bsc_vty_init_extra(); return 0; diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 3bca05f..a2abb39 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -30,8 +30,10 @@ #include #include #include -#include #include + +#include +#include /* Get reference to a neighbor cell on a given BCCH ARFCN */ static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, @@ -187,7 +189,7 @@ /* attempt to do a handover */ static int attempt_handover(struct gsm_meas_rep *mr) { - struct gsm_network *net = mr->lchan->ts->trx->bts->network; + struct gsm_bts *bts = mr->lchan->ts->trx->bts; struct neigh_meas_proc *best_cell = NULL; unsigned int best_better_db = 0; int i, rc; @@ -204,10 +206,10 @@ continue; /* caculate average rxlev for this cell over the window */ - avg = neigh_meas_avg(nmp, net->handover.win_rxlev_avg_neigh); + avg = neigh_meas_avg(nmp, ho_get_rxlev_neigh_avg_win(bts->ho)); /* check if hysteresis is fulfilled */ - if (avg < mr->dl.full.rx_lev + net->handover.pwr_hysteresis) + if (avg < mr->dl.full.rx_lev + ho_get_pwr_hysteresis(bts->ho)) continue; better = avg - mr->dl.full.rx_lev; @@ -222,7 +224,7 @@ LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", gsm_ts_name(mr->lchan->ts), best_cell->arfcn); - if (!net->handover.active) { + if (!ho_get_ho_active(bts->ho)) { LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n"); return 0; } @@ -248,9 +250,10 @@ * attempt a handover */ static int process_meas_rep(struct gsm_meas_rep *mr) { - struct gsm_network *net = mr->lchan->ts->trx->bts->network; + struct gsm_bts *bts = mr->lchan->ts->trx->bts; enum meas_rep_field dlev, dqual; int av_rxlev; + unsigned int pwr_interval; /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { @@ -274,7 +277,7 @@ process_meas_neigh(mr); av_rxlev = get_meas_rep_avg(mr->lchan, dlev, - net->handover.win_rxlev_avg); + ho_get_rxlev_avg_win(bts->ho)); /* Interference HO */ if (rxlev2dbm(av_rxlev) > -85 && @@ -297,14 +300,15 @@ } /* Distance */ - if (mr->ms_l1.ta > net->handover.max_distance) { - LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%u\n", - rxlev2dbm(av_rxlev), mr->ms_l1.ta); + if (mr->ms_l1.ta > ho_get_max_distance(bts->ho)) { + LOGPC(DHO, LOGL_INFO, "HO cause: Distance av_rxlev=%d dBm ta=%d \n", + rxlev2dbm(av_rxlev), mr->ms_l1.ta); return attempt_handover(mr); } /* Power Budget AKA Better Cell */ - if ((mr->nr % net->handover.pwr_interval) == net->handover.pwr_interval - 1) + pwr_interval = ho_get_pwr_interval(bts->ho); + if ((mr->nr % pwr_interval) == pwr_interval - 1) return attempt_handover(mr); return 0; diff --git a/src/libbsc/handover_vty.c b/src/libbsc/handover_vty.c new file mode 100644 index 0000000..225e9a9 --- /dev/null +++ b/src/libbsc/handover_vty.c @@ -0,0 +1,101 @@ +/* OsmoBSC interface to quagga VTY for handover parameters */ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2009-2010 by Harald Welte + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include + +static struct handover_cfg *ho_cfg_from_vty(struct vty *vty) +{ + switch (vty->node) { + case GSMNET_NODE: + return gsmnet_from_vty(vty)->ho; + case BTS_NODE: + OSMO_ASSERT(vty->index); + return ((struct gsm_bts *)vty->index)->ho; + default: + OSMO_ASSERT(false); + } +} + + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ + VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ + VTY_WRITE_FMT, VTY_WRITE_CONV, \ + VTY_DOC) \ +DEFUN(cfg_ho_##NAME, cfg_ho_##NAME##_cmd, \ + VTY_CMD " (" VTY_CMD_ARG "|default)", \ + VTY_DOC \ + "Use default (" #DEFAULT_VAL "), remove explicit setting on this node\n") \ +{ \ + struct handover_cfg *ho = ho_cfg_from_vty(vty); \ + const char *val = argv[0]; \ + if (!strcmp(val, "default")) { \ + const char *msg; \ + if (ho_isset_##NAME(ho)) {\ + ho_clear_##NAME(ho); \ + msg = "setting removed, now is"; \ + } else \ + msg = "already was unset, still is"; \ + vty_out(vty, "%% '" VTY_CMD "' %s " VTY_WRITE_FMT "%s%s", \ + msg, VTY_WRITE_CONV( ho_get_##NAME(ho) ), \ + ho_isset_on_parent_##NAME(ho)? " (set on higher level node)" : "", \ + VTY_NEWLINE); \ + } \ + else \ + ho_set_##NAME(ho, VTY_ARG_EVAL(val)); \ + return CMD_SUCCESS; \ +} + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER + + +void ho_vty_write(struct vty *vty, const char *indent, struct handover_cfg *ho) +{ +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, \ + VTY_CMD, VTY_CMD_ARG, VTY_ARG_EVAL, \ + VTY_WRITE_FMT, VTY_WRITE_CONV, \ + VTY_DOC) \ + if (ho_isset_##NAME(ho)) \ + vty_out(vty, "%s" VTY_CMD " " VTY_WRITE_FMT "%s", indent, \ + VTY_WRITE_CONV( ho_get_##NAME(ho) ), VTY_NEWLINE); + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +} + +static void ho_vty_init_cmds(int parent_node) +{ +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + install_element(parent_node, &cfg_ho_##NAME##_cmd); + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +} + +void ho_vty_init() +{ + ho_vty_init_cmds(GSMNET_NODE); + ho_vty_init_cmds(BTS_NODE); +} + diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 30de0cc..57d8241 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -21,6 +21,7 @@ #include #include #include +#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, @@ -55,13 +56,7 @@ net->T3122 = GSM_T3122_DEFAULT; net->T3141 = GSM_T3141_DEFAULT; - /* default set of handover parameters */ - net->handover.win_rxlev_avg = 10; - net->handover.win_rxqual_avg = 1; - net->handover.win_rxlev_avg_neigh = 10; - net->handover.pwr_interval = 6; - net->handover.pwr_hysteresis = 3; - net->handover.max_distance = 9999; + net->ho = ho_cfg_init(net, NULL); INIT_LLIST_HEAD(&net->bts_list); diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index c66cbcd..9f7e7b9 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -27,4 +27,5 @@ gsm_data_shared.c \ socket.c \ talloc_ctx.c \ + handover_cfg.c \ $(NULL) diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 87d954a..92ebbfe 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -37,6 +37,7 @@ #include #include #include +#include void *tall_bsc_ctx; diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index c14047d..e4ec594 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -33,6 +33,7 @@ #include #include +#include void gsm_abis_mo_reset(struct gsm_abis_mo *mo) { @@ -374,6 +375,8 @@ /* si handling */ bts->bcch_change_mark = 1; + bts->ho = ho_cfg_init(bts, net->ho); + return bts; } diff --git a/src/libcommon/handover_cfg.c b/src/libcommon/handover_cfg.c new file mode 100644 index 0000000..8c208f6 --- /dev/null +++ b/src/libcommon/handover_cfg.c @@ -0,0 +1,83 @@ +/* OsmoBSC handover configuration implementation */ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * (C) 2009-2010 by Harald Welte + * All Rights Reserved + * + * Author: Neels Hofmeyr + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +#include +#include +#include + +struct handover_cfg { + struct handover_cfg *higher_level_cfg; + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY3, VTY4, VTY5, VTY6) \ + TYPE NAME; \ + bool has_##NAME; + + HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER +}; + +struct handover_cfg *ho_cfg_init(void *ctx, struct handover_cfg *higher_level_cfg) +{ + struct handover_cfg *ho = talloc_zero(ctx, struct handover_cfg); + OSMO_ASSERT(ho); + ho->higher_level_cfg = higher_level_cfg; + return ho; +} + +#define HO_CFG_ONE_MEMBER(TYPE, NAME, DEFAULT_VAL, VTY1, VTY2, VTY_ARG_EVAL, VTY4, VTY5, VTY6) \ +TYPE ho_get_##NAME(struct handover_cfg *ho) \ +{ \ + if (ho->has_##NAME) \ + return ho->NAME; \ + if (ho->higher_level_cfg) \ + return ho_get_##NAME(ho->higher_level_cfg); \ + return VTY_ARG_EVAL(#DEFAULT_VAL); \ +} \ +\ +void ho_set_##NAME(struct handover_cfg *ho, TYPE value) \ +{ \ + ho->NAME = value; \ + ho->has_##NAME = true; \ +} \ +\ +bool ho_isset_##NAME(struct handover_cfg *ho) \ +{ \ + return ho->has_##NAME; \ +} \ +\ +void ho_clear_##NAME(struct handover_cfg *ho) \ +{ \ + ho->has_##NAME = false; \ +} \ +\ +bool ho_isset_on_parent_##NAME(struct handover_cfg *ho) \ +{ \ + return ho->higher_level_cfg \ + && (ho_isset_##NAME(ho->higher_level_cfg) \ + || ho_isset_on_parent_##NAME(ho->higher_level_cfg)); \ +} + +HO_CFG_ALL_MEMBERS +#undef HO_CFG_ONE_MEMBER diff --git a/tests/Makefile.am b/tests/Makefile.am index 9207434..ba8a5e1 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -34,6 +34,7 @@ $(TESTSUITE) \ vty_test_runner.py \ ctrl_test_runner.py \ + handover_cfg.vty \ $(NULL) TESTSUITE = $(srcdir)/testsuite @@ -44,11 +45,21 @@ if ENABLE_EXT_TESTS python-tests: $(BUILT_SOURCES) + $(MAKE) vty-test osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v $(srcdir)/vty_test_runner.py -w $(abs_top_builddir) -v $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v rm -f $(top_builddir)/sms.db $(top_builddir)/gsn_restart $(top_builddir)/gtphub_restart_count + +# To update the VTY script from current application behavior, +# pass -u to vty_script_runner.py by doing: +# make vty-test U=-u +vty-test: + osmo_verify_transcript_vty.py -v \ + -n OsmoBSC -p 4242 \ + -r "$(top_builddir)/src/osmo-bsc/osmo-bsc -c $(top_srcdir)/doc/examples/osmo-bsc/osmo-bsc-minimal.cfg" \ + $(U) $(srcdir)/*.vty else python-tests: $(BUILT_SOURCES) echo "Not running python-based tests (determined at configure-time)" diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty new file mode 100644 index 0000000..e181797 --- /dev/null +++ b/tests/handover_cfg.vty @@ -0,0 +1,279 @@ +OsmoBSC> show network +... + Handover: Off +... +OsmoBSC> enable + +OsmoBSC# ### No handover config present +OsmoBSC# show running-config +... !handover + +OsmoBSC# ### Toggling handover on network level affects 'show network': +OsmoBSC# configure terminal +OsmoBSC(config)# network +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# handover 1 +OsmoBSC(config-net)# do show network +... + Handover: On +... + +OsmoBSC(config-net)# ### If network level default is 'on', bts level can still override to 'off': +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover 0 +OsmoBSC(config-net-bts)# do show network +... + Handover: Off +... +OsmoBSC(config-net-bts)# exit + +OsmoBSC(config-net)# ### Create a *second* BTS that is not explicitly 'off': +OsmoBSC(config-net)# bts 1 +OsmoBSC(config-net-bts)# do show network +... + Handover: On at 1 BTS, Off at 1 BTS +... + +OsmoBSC(config-net-bts)# ### Add arbitrary handover config item for bts 1: +OsmoBSC(config-net-bts)# handover power budget interval 23 +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# ### HO is 'on' globally, bts 0 disables it, bts 1 tweaks a param: +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Set global default to 'off', now bts 1 also uses the global default of 'off': +OsmoBSC(config-net)# handover 0 +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 0 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Remove the global setting, i.e. use the factory default net level, with same effect: +OsmoBSC(config-net)# handover default +% 'handover' setting removed, now is 0 +OsmoBSC(config-net)# handover default +% 'handover' already was unset, still is 0 +OsmoBSC(config-net)# do show network +... + Handover: Off +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Re-enable net-level handover, but bts 0 remains disabled explicitly +OsmoBSC(config-net)# handover 1 +OsmoBSC(config-net)# do show network +... + Handover: On at 1 BTS, Off at 1 BTS +... +OsmoBSC(config-net)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + handover 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + +OsmoBSC(config-net)# ### Remove explicit setting of bts 0 to also use the global setting: +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover default +% 'handover' setting removed, now is 1 (set on higher level node) +OsmoBSC(config-net-bts)# handover default +% 'handover' already was unset, still is 1 (set on higher level node) +OsmoBSC(config-net-bts)# do show network +... + Handover: On +... +OsmoBSC(config-net-bts)# show running-config +... +network +... !handover + handover 1 +... !handover + bts 0 +... !handover + bts 1 +... !handover + handover power budget interval 23 +... !handover + + +OsmoBSC(config-net-bts)# ### Checking online help +OsmoBSC(config-net-bts)# exit +OsmoBSC(config-net)# list +... + handover (0|1|default) + handover window rxlev averaging (<1-10>|default) + handover window rxqual averaging (<1-10>|default) + handover window rxlev neighbor averaging (<1-10>|default) + handover power budget interval (<1-99>|default) + handover power budget hysteresis (<0-999>|default) + handover maximum distance (<0-9999>|default) +... + +OsmoBSC(config-net)# handover? + handover Handover options + +OsmoBSC(config-net)# handover ? + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net)# handover window ? + rxlev Received-Level averaging + rxqual Received-Quality averaging + +OsmoBSC(config-net)# handover window rxlev ? + averaging How many RxLev measurements are used for averaging + neighbor How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net)# handover window rxlev averaging ? + <1-10> RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover window rxlev neighbor ? + averaging How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net)# handover window rxlev neighbor averaging ? + <1-10> Neighbor RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net)# handover window rxqual ? + averaging How many RxQual measurements are used for averaging + +OsmoBSC(config-net)# handover window rxqual averaging ? + <1-10> RxQual averaging: Number of values to average over + default Use default (1), remove explicit setting on this node + +OsmoBSC(config-net)# handover power ? + budget Neighbor cell power triggering + +OsmoBSC(config-net)# handover power budget ? + interval How often to check for a better cell (SACCH frames) + hysteresis How many dBm stronger must a neighbor be to become a HO candidate + +OsmoBSC(config-net)# handover power budget interval ? + <1-99> Check for stronger neighbor every N number of SACCH frames + default Use default (6), remove explicit setting on this node + +OsmoBSC(config-net)# handover power budget hysteresis ? + <0-999> Neighbor's strength difference in dBm + default Use default (3), remove explicit setting on this node + +OsmoBSC(config-net)# handover maximum ? + distance Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net)# handover maximum distance ? + <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO + default Use default (9999), remove explicit setting on this node + + +OsmoBSC(config-net)# ### Same on BTS level +OsmoBSC(config-net)# bts 0 +OsmoBSC(config-net-bts)# handover? + handover Handover options + +OsmoBSC(config-net-bts)# handover ? + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net-bts)# handover window ? + rxlev Received-Level averaging + rxqual Received-Quality averaging + +OsmoBSC(config-net-bts)# handover window rxlev ? + averaging How many RxLev measurements are used for averaging + neighbor How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxlev averaging ? + <1-10> RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover window rxlev neighbor ? + averaging How many Neighbor RxLev measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxlev neighbor averaging ? + <1-10> Neighbor RxLev averaging: Number of values to average over + default Use default (10), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover window rxqual ? + averaging How many RxQual measurements are used for averaging + +OsmoBSC(config-net-bts)# handover window rxqual averaging ? + <1-10> RxQual averaging: Number of values to average over + default Use default (1), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover power ? + budget Neighbor cell power triggering + +OsmoBSC(config-net-bts)# handover power budget ? + interval How often to check for a better cell (SACCH frames) + hysteresis How many dBm stronger must a neighbor be to become a HO candidate + +OsmoBSC(config-net-bts)# handover power budget interval ? + <1-99> Check for stronger neighbor every N number of SACCH frames + default Use default (6), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover power budget hysteresis ? + <0-999> Neighbor's strength difference in dBm + default Use default (3), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover maximum ? + distance Maximum Timing-Advance value (i.e. MS distance) before triggering HO + +OsmoBSC(config-net-bts)# handover maximum distance ? + <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO + default Use default (9999), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5892 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79d35f6d3c0fbee67904378ad7f216df34fde79a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:23 +0000 Subject: [MERGED] osmo-bsc[master]: osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm init ...................................................................... osmo_bsc_mgcp: cosmetic: introduce mgcp_init(), soak up fsm init A subsequent patch will add registration of a signal; cosmetically prepare by creating a common mgcp_init() function. It makes sense for the FSM registration to move to it. Change-Id: I510e1081171706eb3d9fb2db50a9aa4f768929b5 --- M include/osmocom/bsc/osmo_bsc_mgcp.h M src/osmo-bsc/osmo_bsc_main.c M src/osmo-bsc/osmo_bsc_mgcp.c 3 files changed, 10 insertions(+), 7 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/bsc/osmo_bsc_mgcp.h b/include/osmocom/bsc/osmo_bsc_mgcp.h index 7452513..1e06331 100644 --- a/include/osmocom/bsc/osmo_bsc_mgcp.h +++ b/include/osmocom/bsc/osmo_bsc_mgcp.h @@ -52,6 +52,8 @@ mgcp_trans_id_t mgw_pending_trans; }; +void mgcp_init(struct gsm_network *net); + struct mgcp_ctx *mgcp_assignm_req(void *ctx, struct mgcp_client *mgcp, struct osmo_bsc_sccp_con *conn, enum gsm48_chan_mode chan_mode, bool full_rate); void mgcp_clear_complete(struct mgcp_ctx *mgcp_ctx, struct msgb *resp); diff --git a/src/osmo-bsc/osmo_bsc_main.c b/src/osmo-bsc/osmo_bsc_main.c index e4c8fc5..1555ac1 100644 --- a/src/osmo-bsc/osmo_bsc_main.c +++ b/src/osmo-bsc/osmo_bsc_main.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -293,6 +294,8 @@ exit(1); } + mgcp_init(bsc_gsmnet); + signal(SIGINT, &signal_handler); signal(SIGTERM, &signal_handler); signal(SIGABRT, &signal_handler); diff --git a/src/osmo-bsc/osmo_bsc_mgcp.c b/src/osmo-bsc/osmo_bsc_mgcp.c index 186c8c5..519eaf4 100644 --- a/src/osmo-bsc/osmo_bsc_mgcp.c +++ b/src/osmo-bsc/osmo_bsc_mgcp.c @@ -964,18 +964,11 @@ { struct mgcp_ctx *mgcp_ctx; char name[32]; - static bool fsm_registered = false; OSMO_ASSERT(mgcp); OSMO_ASSERT(conn); OSMO_ASSERT(snprintf(name, sizeof(name), "MGW_%i", conn->conn_id) < sizeof(name)); - - /* Register the fsm description (if not already done) */ - if (fsm_registered == false) { - osmo_fsm_register(&fsm_bsc_mgcp); - fsm_registered = true; - } /* Allocate and configure a new fsm instance */ mgcp_ctx = talloc_zero(ctx, struct mgcp_ctx); @@ -1093,3 +1086,8 @@ osmo_fsm_inst_free(mgcp_ctx->fsm); talloc_free(mgcp_ctx); } + +void mgcp_init(struct gsm_network *net) +{ + osmo_fsm_register(&fsm_bsc_mgcp); +} -- To view, visit https://gerrit.osmocom.org/5890 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I510e1081171706eb3d9fb2db50a9aa4f768929b5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:23 +0000 Subject: [MERGED] osmo-bsc[master]: Fix of checking TCH rate at chan_compat_with_mode In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix of checking TCH rate at chan_compat_with_mode ...................................................................... Fix of checking TCH rate at chan_compat_with_mode In case of current channel equals TCH/F and we request half rate, we must return 0, so the calling function will trigger assignment. Change-Id: Ibb4cb9aef1a1146f984d7c969bfba53c647cae07 --- M src/libbsc/bsc_api.c 1 file changed, 5 insertions(+), 1 deletion(-) 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/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index bd55dfc..3592c00 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -357,7 +357,11 @@ * an explicit override by the 'full_rate' argument */ switch (lchan->type) { case GSM_LCHAN_TCH_F: - return 1; + if (full_rate) + return 1; + else + return 0; + break; case GSM_LCHAN_TCH_H: if (full_rate) return 0; -- To view, visit https://gerrit.osmocom.org/5899 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibb4cb9aef1a1146f984d7c969bfba53c647cae07 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:24 +0000 Subject: [MERGED] osmo-bsc[master]: fixup: neigh_meas_avg: fix condition to reduce window size In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fixup: neigh_meas_avg: fix condition to reduce window size ...................................................................... fixup: neigh_meas_avg: fix condition to reduce window size Change-Id: Ia2269be448436d676289c84b9b05da7f51ee4a85 --- M src/libbsc/handover_decision.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 1ad4b36..127b362 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -100,7 +100,7 @@ int avg = 0; /* reduce window to the actual number of existing measurements */ - if (window < nmp->rxlev_cnt) + if (window > nmp->rxlev_cnt) window = nmp->rxlev_cnt; /* this should never happen */ if (window <= 0) { -- To view, visit https://gerrit.osmocom.org/5903 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2269be448436d676289c84b9b05da7f51ee4a85 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:24 +0000 Subject: [MERGED] osmo-bsc[master]: HO: add handover algo 2 parameters; skip HO 1 if HO 2 is con... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: add handover algo 2 parameters; skip HO 1 if HO 2 is configured ...................................................................... HO: add handover algo 2 parameters; skip HO 1 if HO 2 is configured Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 --- M include/osmocom/bsc/handover_cfg.h M src/libbsc/handover_decision.c M tests/handover_cfg.vty 3 files changed, 336 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/handover_cfg.h b/include/osmocom/bsc/handover_cfg.h index 95c0e50..63a393e 100644 --- a/include/osmocom/bsc/handover_cfg.h +++ b/include/osmocom/bsc/handover_cfg.h @@ -1,6 +1,7 @@ #pragma once #include +#include struct vty; @@ -17,6 +18,11 @@ #define HO_CFG_STR_WIN_RXQUAL HO_CFG_STR_WIN "Received-Quality averaging\n" #define HO_CFG_STR_POWER_BUDGET HO_CFG_STR_HANDOVER "Neighbor cell power triggering\n" "Neighbor cell power triggering\n" #define HO_CFG_STR_AVG_COUNT "Number of values to average over\n" +#define HO_CFG_STR_2 " (HO algo 2 only)\n" +#define HO_CFG_STR_MIN "Minimum Level/Quality thresholds before triggering HO" HO_CFG_STR_2 +#define HO_CFG_STR_AFS_BIAS "Configure bias to prefer AFS (AMR on TCH/F) over other codecs" HO_CFG_STR_2 +#define HO_CFG_STR_MIN_TCH "Minimum free TCH timeslots before cell is considered congested" HO_CFG_STR_2 +#define HO_CFG_STR_PENALTY_TIME "Set penalty times to wait between repeated handovers" HO_CFG_STR_2 #define as_is(x) (x) @@ -30,6 +36,17 @@ return arg? 1 : 0; } +static inline bool a2tdma(const char *arg) +{ + if (!strcmp(arg, "full")) + return true; + return false; +} + +static inline const char *tdma2a(bool val) +{ + return val? "full" : "subset"; +} /* The HO_CFG_ONE_MEMBER macro gets redefined, depending on whether to define struct members, * function declarations or definitions... It is of the format @@ -59,6 +76,15 @@ "Disable in-call handover\n" \ "Enable in-call handover\n" \ "Enable/disable handover: ") \ + \ + HO_CFG_ONE_MEMBER(int, algorithm, 1, \ + "handover algorithm", "1|2", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Choose algorithm for handover decision\n" \ + "Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual," \ + " only.\n" \ + "Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several" \ + " cells. Consider available codecs. Prevent repeated handover by penalty timers.\n") \ \ HO_CFG_ONE_MEMBER(unsigned int, rxlev_avg_win, 10, \ "handover window rxlev averaging", "<1-10>", atoi, "%u", as_is, \ @@ -97,6 +123,95 @@ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n" \ "Maximum Timing-Advance value (i.e. MS distance) before triggering HO\n") \ + \ + HO_CFG_ONE_MEMBER(bool, as_active, 0, \ + "handover assignment", "0|1", a2bool, "%d", bool2i, \ + HO_CFG_STR_HANDOVER \ + "Enable or disable in-call channel re-assignment" HO_CFG_STR_2 \ + "Disable in-call assignment\n" \ + "Enable in-call assignment\n") \ + \ + HO_CFG_ONE_MEMBER(bool, full_tdma, subset, \ + "handover tdma-measurement", "full|subset", a2tdma, "%s", tdma2a, \ + HO_CFG_STR_HANDOVER \ + "Define measurement set of TDMA frames" HO_CFG_STR_2 \ + "Full set of 102/104 TDMA frames\n" \ + "Sub set of 4 TDMA frames (SACCH)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxlev, -100, \ + "handover min rxlev", "<-110--50>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How weak may RxLev of an MS become before triggering HO\n" \ + "minimum RxLev (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, min_rxqual, 5, \ + "handover min rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN \ + "How bad may RxQual of an MS become before triggering HO\n" \ + "minimum RxQual (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxlev, 0, \ + "handover afs-bias rxlev", "<0-20>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxLev improvement bias for AFS over other codecs\n" \ + "Virtual RxLev improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, afs_bias_rxqual, 0, \ + "handover afs-bias rxqual", "<0-7>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_AFS_BIAS \ + "RxQual improvement bias for AFS over other codecs\n" \ + "Virtual RxQual improvement (dBm)\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchf_min_slots, 0, \ + "handover min-free-slots tch/f", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/F timeslots before cell is considered congested\n" \ + "Number of TCH/F slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, tchh_min_slots, 0, \ + "handover min-free-slots tch/h", "<0-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_MIN_TCH \ + "Minimum free TCH/H timeslots before cell is considered congested\n" \ + "Number of TCH/H slots\n") \ + \ + HO_CFG_ONE_MEMBER(int, ho_max, 9999, \ + "handover max-handovers", "<1-9999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Maximum number of concurrent handovers allowed per cell" HO_CFG_STR_2 \ + "Number\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_max_dist, 300, \ + "handover penalty-time max-distance", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after leaving this cell due to exceeding max distance\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_ho, 60, \ + "handover penalty-time failed-ho", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after handover failure to this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, penalty_failed_as, 60, \ + "handover penalty-time failed-assignment", "<0-99999>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + HO_CFG_STR_PENALTY_TIME \ + "Time to suspend handovers after assignment failure in this cell\n" \ + "Seconds\n") \ + \ + HO_CFG_ONE_MEMBER(int, retries, 0, \ + "handover retries", "<0-9>", atoi, "%d", as_is, \ + HO_CFG_STR_HANDOVER \ + "Immediately retry on handover/assignment failure" HO_CFG_STR_2 \ + "Number of retries\n") \ /* Declare public API for handover cfg parameters... */ diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 158fc1c..1e2e0d9 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -265,6 +265,10 @@ int av_rxlev; unsigned int pwr_interval; + /* If this cell does not use handover algorithm 1, then we're not responsible. */ + if (ho_get_algorithm(bts->ho) != 1) + return 0; + /* we currently only do handover for TCH channels */ switch (mr->lchan->type) { case GSM_LCHAN_TCH_F: diff --git a/tests/handover_cfg.vty b/tests/handover_cfg.vty index e181797..ff67c8f 100644 --- a/tests/handover_cfg.vty +++ b/tests/handover_cfg.vty @@ -143,30 +143,73 @@ handover power budget interval 23 ... !handover +OsmoBSC(config-net-bts)# ### Verify that 'min rxlev' value range stops at -50 +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node +OsmoBSC(config-net-bts)# handover min rxlev -111 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev -110 +OsmoBSC(config-net-bts)# handover min rxlev -50 +OsmoBSC(config-net-bts)# handover min rxlev -49 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev 50 +% Unknown command. +OsmoBSC(config-net-bts)# handover min rxlev default +% 'handover min rxlev' setting removed, now is -100 + OsmoBSC(config-net-bts)# ### Checking online help OsmoBSC(config-net-bts)# exit OsmoBSC(config-net)# list ... handover (0|1|default) + handover algorithm (1|2|default) handover window rxlev averaging (<1-10>|default) handover window rxqual averaging (<1-10>|default) handover window rxlev neighbor averaging (<1-10>|default) handover power budget interval (<1-99>|default) handover power budget hysteresis (<0-999>|default) handover maximum distance (<0-9999>|default) + handover assignment (0|1|default) + handover tdma-measurement (full|subset|default) + handover min rxlev (<-110--50>|default) + handover min rxqual (<0-7>|default) + handover afs-bias rxlev (<0-20>|default) + handover afs-bias rxqual (<0-7>|default) + handover min-free-slots tch/f (<0-9999>|default) + handover min-free-slots tch/h (<0-9999>|default) + handover max-handovers (<1-9999>|default) + handover penalty-time max-distance (<0-99999>|default) + handover penalty-time failed-ho (<0-99999>|default) + handover penalty-time failed-assignment (<0-99999>|default) + handover retries (<0-9>|default) ... OsmoBSC(config-net)# handover? handover Handover options OsmoBSC(config-net)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net)# handover window ? rxlev Received-Level averaging @@ -216,6 +259,80 @@ <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node +OsmoBSC(config-net)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node + OsmoBSC(config-net)# ### Same on BTS level OsmoBSC(config-net)# bts 0 @@ -223,12 +340,26 @@ handover Handover options OsmoBSC(config-net-bts)# handover ? - 0 Disable in-call handover - 1 Enable in-call handover - default Enable/disable handover: Use default (0), remove explicit setting on this node - window Measurement averaging settings - power Neighbor cell power triggering - maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + 0 Disable in-call handover + 1 Enable in-call handover + default Enable/disable handover: Use default (0), remove explicit setting on this node + algorithm Choose algorithm for handover decision + window Measurement averaging settings + power Neighbor cell power triggering + maximum Maximum Timing-Advance value (i.e. MS distance) before triggering HO + assignment Enable or disable in-call channel re-assignment (HO algo 2 only) + tdma-measurement Define measurement set of TDMA frames (HO algo 2 only) + min Minimum Level/Quality thresholds before triggering HO (HO algo 2 only) + afs-bias Configure bias to prefer AFS (AMR on TCH/F) over other codecs (HO algo 2 only) + min-free-slots Minimum free TCH timeslots before cell is considered congested (HO algo 2 only) + max-handovers Maximum number of concurrent handovers allowed per cell (HO algo 2 only) + penalty-time Set penalty times to wait between repeated handovers (HO algo 2 only) + retries Immediately retry on handover/assignment failure (HO algo 2 only) + +OsmoBSC(config-net-bts)# handover algorithm ? + 1 Algorithm 1: trigger handover based on comparing current cell and neighbor RxLev and RxQual, only. + 2 Algorithm 2: trigger handover on RxLev/RxQual, and also to balance the load across several cells. Consider available codecs. Prevent repeated handover by penalty timers. + default Use default (1), remove explicit setting on this node OsmoBSC(config-net-bts)# handover window ? rxlev Received-Level averaging @@ -277,3 +408,77 @@ OsmoBSC(config-net-bts)# handover maximum distance ? <0-9999> Maximum Timing-Advance value (i.e. MS distance) before triggering HO default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover assignment ? + 0 Disable in-call assignment + 1 Enable in-call assignment + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover tdma-measurement ? + full Full set of 102/104 TDMA frames + subset Sub set of 4 TDMA frames (SACCH) + default Use default (subset), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min ? + rxlev How weak may RxLev of an MS become before triggering HO + rxqual How bad may RxQual of an MS become before triggering HO + +OsmoBSC(config-net-bts)# handover min rxlev ? + <-110--50> minimum RxLev (dBm) + default Use default (-100), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min rxqual ? + <0-7> minimum RxQual (dBm) + default Use default (5), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias ? + rxlev RxLev improvement bias for AFS over other codecs + rxqual RxQual improvement bias for AFS over other codecs + +OsmoBSC(config-net-bts)# handover afs-bias rxlev ? + <0-20> Virtual RxLev improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover afs-bias rxqual ? + <0-7> Virtual RxQual improvement (dBm) + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots ? + tch/f Minimum free TCH/F timeslots before cell is considered congested + tch/h Minimum free TCH/H timeslots before cell is considered congested + +OsmoBSC(config-net-bts)# handover min-free-slots tch/f ? + <0-9999> Number of TCH/F slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover min-free-slots TCH/F ? +% There is no matched command. + +OsmoBSC(config-net-bts)# handover min-free-slots tch/h ? + <0-9999> Number of TCH/H slots + default Use default (0), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover max-handovers ? + <1-9999> Number + default Use default (9999), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time ? + max-distance Time to suspend handovers after leaving this cell due to exceeding max distance + failed-ho Time to suspend handovers after handover failure to this cell + failed-assignment Time to suspend handovers after assignment failure in this cell + +OsmoBSC(config-net-bts)# handover penalty-time max-distance ? + <0-99999> Seconds + default Use default (300), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-ho ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover penalty-time failed-assignment ? + <0-99999> Seconds + default Use default (60), remove explicit setting on this node + +OsmoBSC(config-net-bts)# handover retries ? + <0-9> Number of retries + default Use default (0), remove explicit setting on this node -- To view, visit https://gerrit.osmocom.org/5914 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8811ee8a75be09048042b511ee4bd9bc1de63976 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:25 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Change debug category at handover decision: DHO -> DHODEC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Change debug category at handover decision: DHO -> DHODEC ...................................................................... HO: Change debug category at handover decision: DHO -> DHODEC Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 --- M src/libbsc/handover_decision.c 1 file changed, 8 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 1e2e0d9..0693613 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -65,7 +65,7 @@ /* resolve the gsm_bts structure for the best neighbor */ new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic); if (!new_bts) { - LOGP(DHO, LOGL_NOTICE, "unable to determine neighbor BTS " + LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS " "for ARFCN %u BSIC %u ?!?\n", arfcn, bsic); return -EINVAL; } @@ -104,7 +104,7 @@ window = nmp->rxlev_cnt; /* this should never happen */ if (window <= 0) { - LOGP(DHO, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); + LOGP(DHODEC, LOGL_ERROR, "Requested Neighbor RxLev for invalid window size of %d\n", window); return 0; } @@ -232,26 +232,26 @@ if (!best_cell) return 0; - LOGP(DHO, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", + LOGP(DHODEC, LOGL_INFO, "%s: Cell on ARFCN %u is better: ", gsm_ts_name(mr->lchan->ts), best_cell->arfcn); if (!ho_get_ho_active(bts->ho)) { - LOGPC(DHO, LOGL_INFO, "Skipping, Handover disabled\n"); + LOGPC(DHODEC, LOGL_INFO, "Skipping, Handover disabled\n"); return 0; } rc = handover_to_arfcn_bsic(mr->lchan, best_cell->arfcn, best_cell->bsic); switch (rc) { case 0: - LOGPC(DHO, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); + LOGPC(DHODEC, LOGL_INFO, "Starting handover: meas report number %d \n", mr->nr); break; case -ENOSPC: - LOGPC(DHO, LOGL_INFO, "No channel available\n"); + LOGPC(DHODEC, LOGL_INFO, "No channel available\n"); break; case -EBUSY: - LOGPC(DHO, LOGL_INFO, "Handover already active\n"); + LOGPC(DHODEC, LOGL_INFO, "Handover already active\n"); break; default: - LOGPC(DHO, LOGL_ERROR, "Unknown error\n"); + LOGPC(DHODEC, LOGL_ERROR, "Unknown error\n"); } return rc; } -- To view, visit https://gerrit.osmocom.org/5915 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7322b790f647b681bfe3a9c95b04516fbc7cbf88 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:25 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Send Channel Mode and Multirate IE along with handover c... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Send Channel Mode and Multirate IE along with handover command ...................................................................... HO: Send Channel Mode and Multirate IE along with handover command This is needed, if the channel mode should change when doing handover. A change in channel mode makes sense, if available resources at the new BTS are different. Change-Id: Ib6b17a9be252f1655006ab6773483868017d7926 --- M src/libbsc/gsm_04_08_utils.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index 414fd6d..b17e58e 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -406,6 +406,13 @@ } /* FIXME: optional bits for type of synchronization? */ + msgb_tv_put(msg, GSM48_IE_CHANMODE_1, new_lchan->tch_mode); + + /* in case of multi rate we need to attach a config */ + if (new_lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + msgb_tlv_put(msg, GSM48_IE_MUL_RATE_CFG, new_lchan->mr_ms_lv[0], + new_lchan->mr_ms_lv + 1); + return gsm48_sendmsg(msg); } -- To view, visit https://gerrit.osmocom.org/5893 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6b17a9be252f1655006ab6773483868017d7926 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:26 +0000 Subject: [MERGED] osmo-bsc[master]: HO: fix: increase the number of measurement report history t... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: fix: increase the number of measurement report history to 10 ...................................................................... HO: fix: increase the number of measurement report history to 10 If we want to average over up to 10 measurement reports (as configurable at VTY), we need a history of at least 10 measurements. Change-Id: Ia7cfac073bdc464092ca3e51dec319ac30401dd1 --- M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h 2 files changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index c09d546..6659b72 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -50,6 +50,8 @@ #define MAX_NEIGH_MEAS 10 /* Maximum size of the averaging window for neighbor cells */ #define MAX_WIN_NEIGH_AVG 10 +/* Maximum number of report history we store */ +#define MAX_MEAS_REP 10 /* processed neighbor measurements for one cell */ struct neigh_meas_proc { diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index fed3494..86c5ca9 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -266,7 +266,7 @@ struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; + struct gsm_meas_rep meas_rep[MAX_MEAS_REP]; int meas_rep_idx; int meas_rep_count; -- To view, visit https://gerrit.osmocom.org/5911 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia7cfac073bdc464092ca3e51dec319ac30401dd1 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:26 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Add handover decision debugging category In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Add handover decision debugging category ...................................................................... HO: Add handover decision debugging category Change-Id: Iaf99d4e9ae08c38bf364dbb37d42098f976f6b8c --- M include/osmocom/bsc/debug.h M src/libcommon/debug.c 2 files changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/debug.h b/include/osmocom/bsc/debug.h index 65e197d..131ae8a 100644 --- a/include/osmocom/bsc/debug.h +++ b/include/osmocom/bsc/debug.h @@ -21,6 +21,7 @@ DMSC, DMGCP, DHO, + DHODEC, DDB, DREF, DGPRS, diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 68fc597..b5a490b 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -106,7 +106,14 @@ }, [DHO] = { .name = "DHO", - .description = "Hand-Over", + .description = "Hand-Over Process", + .color = "\033[1;38m", + .enabled = 1, .loglevel = LOGL_NOTICE, + }, + [DHODEC] = { + .name = "DHODEC", + .description = "Hand-Over Decision", + .color = "\033[1;38m", .enabled = 1, .loglevel = LOGL_NOTICE, }, [DDB] = { -- To view, visit https://gerrit.osmocom.org/5907 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iaf99d4e9ae08c38bf364dbb37d42098f976f6b8c Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:26 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Count neighbor measurements and reduce window of neigh_m... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Count neighbor measurements and reduce window of neigh_meas_avg ...................................................................... HO: Count neighbor measurements and reduce window of neigh_meas_avg Always start with a counter of 0 for a new measurement report. If the neigh_meas_avg is caluclated over the given window, the window is reduced, if there are less measurement reports received so far. Change-Id: I1c74f27f9663a3083610c985a080fca331c19bd3 --- M src/libbsc/handover_decision.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index a2abb39..04ca144 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -99,6 +99,13 @@ unsigned int i, idx; int avg = 0; + /* reduce window to the actual number of existing measurements */ + if (window < nmp->rxlev_cnt) + window = nmp->rxlev_cnt; + /* this should never happen */ + if (window == 0) + return 0; + idx = calc_initial_idx(ARRAY_SIZE(nmp->rxlev), nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev), window); @@ -177,6 +184,7 @@ nmp->arfcn = mrc->arfcn; nmp->bsic = mrc->bsic; + nmp->rxlev_cnt = 0; idx = nmp->rxlev_cnt % ARRAY_SIZE(nmp->rxlev); nmp->rxlev[idx] = mrc->rxlev; nmp->rxlev_cnt++; -- To view, visit https://gerrit.osmocom.org/5901 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c74f27f9663a3083610c985a080fca331c19bd3 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:26 +0000 Subject: [MERGED] osmo-bsc[master]: Fix: If paging for half rate was requested, use hr, if suppo... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix: If paging for half rate was requested, use hr, if supported by MS ...................................................................... Fix: If paging for half rate was requested, use hr, if supported by MS Change-Id: I6d1c9701808ee542771fee145250927019a2f5f6 --- M src/libbsc/gsm_04_08_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/gsm_04_08_utils.c b/src/libbsc/gsm_04_08_utils.c index b17e58e..85eb7b5 100644 --- a/src/libbsc/gsm_04_08_utils.c +++ b/src/libbsc/gsm_04_08_utils.c @@ -116,7 +116,7 @@ [CHREQ_T_PAG_R_ANY_NECI1] = GSM_LCHAN_SDCCH, [CHREQ_T_PAG_R_ANY_NECI0] = GSM_LCHAN_SDCCH, [CHREQ_T_PAG_R_TCH_F] = GSM_LCHAN_TCH_F, - [CHREQ_T_PAG_R_TCH_FH] = GSM_LCHAN_TCH_F, + [CHREQ_T_PAG_R_TCH_FH] = GSM_LCHAN_TCH_H, [CHREQ_T_LMU] = GSM_LCHAN_SDCCH, [CHREQ_T_RESERVED_SDCCH] = GSM_LCHAN_SDCCH, [CHREQ_T_PDCH_ONE_PHASE] = GSM_LCHAN_PDTCH, -- To view, visit https://gerrit.osmocom.org/5897 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d1c9701808ee542771fee145250927019a2f5f6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:27 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Count the actual meas.rep. get_meas_rep_avg fails if not... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Count the actual meas.rep. get_meas_rep_avg fails if not reached ...................................................................... HO: Count the actual meas.rep. get_meas_rep_avg fails if not reached get_meas_rep_avg will return -EINVAL, if the required number of measurements are not reached. There will be no handover possible until the given number of measurements are available. Change-Id: Ibc4410b4e162cdb6c070128d2c63946bb79d6d65 --- M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/abis_rsl.c M src/libbsc/chan_alloc.c M src/libbsc/meas_rep.c 4 files changed, 18 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index fd566d2..fed3494 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -268,6 +268,7 @@ /* cache of last measurement reports on this lchan */ struct gsm_meas_rep meas_rep[6]; int meas_rep_idx; + int meas_rep_count; /* GSM Random Access data */ struct gsm48_req_ref *rqd_ref; diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index 64e5c92..457cc95 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1470,8 +1470,11 @@ if (!TLVP_PRESENT(&tp, RSL_IE_MEAS_RES_NR) || !TLVP_PRESENT(&tp, RSL_IE_UPLINK_MEAS) || - !TLVP_PRESENT(&tp, RSL_IE_BS_POWER)) + !TLVP_PRESENT(&tp, RSL_IE_BS_POWER)) { + LOGP(DRSL, LOGL_ERROR, "%s Measurement Report lacks mandatory IEs\n", + gsm_lchan_name(mr->lchan)); return -EIO; + } /* Mandatory Parts */ mr->nr = *TLVP_VAL(&tp, RSL_IE_MEAS_RES_NR); @@ -1517,6 +1520,10 @@ return rc; } + mr->lchan->meas_rep_count++; + LOGP(DRSL, LOGL_DEBUG, "%s: meas_rep_cnt++=%d\n", + gsm_lchan_name(mr->lchan), mr->lchan->meas_rep_count); + print_meas_rep(msg->lchan, mr); send_lchan_signal(S_LCHAN_MEAS_REP, msg->lchan, mr); diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 07248fb..1caa13d 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -347,6 +347,10 @@ gsm_ts_and_pchan_name(lchan->ts), lchan->nr, gsm_lchant_name(lchan->type)); + /* reset measurement report counter and index */ + lchan->meas_rep_count = 0; + lchan->meas_rep_idx = 0; + /* clear sapis */ memset(lchan->sapis, 0, ARRAY_SIZE(lchan->sapis)); diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index cb8379e..fbd1515 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -19,6 +19,7 @@ * */ +#include #include #include @@ -75,7 +76,10 @@ int avg = 0; if (num < 1) - return 0; + return -EINVAL; + + if (num > lchan->meas_rep_count) + return -EINVAL; idx = calc_initial_idx(ARRAY_SIZE(lchan->meas_rep), lchan->meas_rep_idx, num); -- To view, visit https://gerrit.osmocom.org/5900 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibc4410b4e162cdb6c070128d2c63946bb79d6d65 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:27 +0000 Subject: [MERGED] osmo-bsc[master]: HO: make bts_by_arfcn_bsic() public In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: make bts_by_arfcn_bsic() public ...................................................................... HO: make bts_by_arfcn_bsic() public Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 --- M include/osmocom/bsc/handover_decision.h M src/libbsc/handover_decision.c 2 files changed, 4 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/handover_decision.h b/include/osmocom/bsc/handover_decision.h index fe551ca..09430d8 100644 --- a/include/osmocom/bsc/handover_decision.h +++ b/include/osmocom/bsc/handover_decision.h @@ -1,3 +1,5 @@ #pragma once +struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, uint16_t arfcn, uint8_t bsic); + void handover_decision_1_init(void); diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 93ca28b..19fb3ab 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -36,8 +36,8 @@ #include /* Find BTS by ARFCN and BSIC */ -static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, - uint16_t arfcn, uint8_t bsic) +struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, + uint16_t arfcn, uint8_t bsic) { struct gsm_bts *bts; -- To view, visit https://gerrit.osmocom.org/5918 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie746f76433f6b46a71a91b7714cc034c4355d993 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:27 +0000 Subject: [MERGED] osmo-bsc[master]: HO: add queue to cache DTAP messages during handover/assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: add queue to cache DTAP messages during handover/assignment ...................................................................... HO: add queue to cache DTAP messages during handover/assignment Add ho_dtap_cache to gsm_subscriber_connection, a stock msgb queue to be used with msgb_enqueue() and msgb_dequeue(). Keep a counter of queue length, to enforce a sane maximum counter for cached messages. So far a hardcoded maximum of 23 messages will be cached. Have balanced ho_dtap_cache_add() and ho_dtap_cache_flush() functions. The original patch was by jolly, but I have basically completely replaced it with the simpler msgb queue pattern. Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c 2 files changed, 77 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 6659b72..4e07f26 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -100,6 +100,10 @@ /* buffer/cache for classmark of the ME of the subscriber */ struct gsm_classmark classmark; + + /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ + struct llist_head ho_dtap_cache; + unsigned int ho_dtap_cache_len; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index dad1d54..9c60af9 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -39,6 +39,8 @@ #define GSM0808_T10_VALUE 6, 0 +#define HO_DTAP_CACHE_MSGB_CB_LINK_ID 0 +#define HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH 1 static void rll_ind_cb(struct gsm_lchan *, uint8_t, void *, enum bsc_rllr_ind); static void send_sapi_reject(struct gsm_subscriber_connection *conn, int link_id); @@ -274,8 +276,52 @@ conn->lchan = lchan; conn->bts = lchan->ts->trx->bts; lchan->conn = conn; + INIT_LLIST_HEAD(&conn->ho_dtap_cache); llist_add_tail(&conn->entry, &net->subscr_conns); return conn; +} + +static void ho_dtap_cache_add(struct gsm_subscriber_connection *conn, struct msgb *msg, + int link_id, bool allow_sacch) +{ + if (conn->ho_dtap_cache_len >= 23) { + LOGP(DHO, LOGL_ERROR, "%s: Cannot cache more DTAP messages," + " already reached sane maximum of %u cached messages\n", + bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); + msgb_free(msg); + return; + } + conn->ho_dtap_cache_len ++; + LOGP(DHO, LOGL_DEBUG, "%s: Caching DTAP message during ho/ass (%u)\n", + bsc_subscr_name(conn->bsub), conn->ho_dtap_cache_len); + msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID] = (unsigned long)link_id; + msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH] = allow_sacch ? 1 : 0; + msgb_enqueue(&conn->ho_dtap_cache, msg); +} + +static void ho_dtap_cache_flush(struct gsm_subscriber_connection *conn, int send) +{ + struct msgb *msg; + unsigned int flushed_count = 0; + + if (conn->secondary_lchan || conn->ho_lchan) { + LOGP(DHO, LOGL_ERROR, "%s: Cannot send cached DTAP messages, handover/assignment is still ongoing\n", + bsc_subscr_name(conn->bsub)); + send = 0; + } + + while ((msg = msgb_dequeue(&conn->ho_dtap_cache))) { + conn->ho_dtap_cache_len --; + flushed_count ++; + if (send) { + int link_id = (int)msg->cb[HO_DTAP_CACHE_MSGB_CB_LINK_ID]; + bool allow_sacch = !!msg->cb[HO_DTAP_CACHE_MSGB_CB_ALLOW_SACCH]; + LOGP(DHO, LOGL_DEBUG, "%s: Sending cached DTAP message after handover/assignment (%u/%u)\n", + bsc_subscr_name(conn->bsub), flushed_count, conn->ho_dtap_cache_len); + gsm0808_submit_dtap(conn, msg, link_id, allow_sacch); + } else + msgb_free(msg); + } } void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) @@ -301,6 +347,9 @@ conn->secondary_lchan->conn = NULL; } + /* drop pending messages */ + ho_dtap_cache_flush(conn, 0); + llist_del(&conn->entry); talloc_free(conn); } @@ -323,6 +372,12 @@ "Called submit dtap without an lchan.\n"); msgb_free(msg); return -1; + } + + /* buffer message during assignment / handover */ + if (conn->secondary_lchan || conn->ho_lchan) { + ho_dtap_cache_add(conn, msg, link_id, !! allow_sacch); + return 0; } sapi = link_id & 0x7; @@ -458,6 +513,9 @@ osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); /* FIXME: release old channel */ + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); + return; } @@ -479,6 +537,9 @@ lchan_release(conn->lchan, 0, RSL_REL_LOCAL_END); conn->lchan = conn->secondary_lchan; conn->secondary_lchan = NULL; + + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); if (is_ipaccess_bts(conn_get_bts(conn)) && conn->lchan->tch_mode != GSM48_CMODE_SIGN) rsl_ipacc_crcx(conn->lchan); @@ -508,6 +569,9 @@ osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); /* FIXME: release allocated new channel */ + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); + return; } @@ -522,6 +586,9 @@ lchan_release(conn->secondary_lchan, 0, RSL_REL_LOCAL_END); conn->secondary_lchan = NULL; } + + /* send pending messages, if any */ + ho_dtap_cache_flush(conn, 1); gh = msgb_l3(msg); if (msgb_l3len(msg) - sizeof(*gh) != 1) { @@ -588,6 +655,9 @@ sig.mr = NULL; osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_COMPL, &sig); /* FIXME: release old channel */ + + /* send pending messages, if any */ + ho_dtap_cache_flush(msg->lchan->conn, 1); } /* Chapter 9.1.17 Handover Failure */ @@ -603,6 +673,9 @@ sig.mr = NULL; osmo_signal_dispatch(SS_LCHAN, S_LCHAN_HANDOVER_FAIL, &sig); /* FIXME: release allocated new channel */ + + /* send pending messages, if any */ + ho_dtap_cache_flush(msg->lchan->conn, 1); } -- To view, visit https://gerrit.osmocom.org/5919 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e4d93628befb3d97e5cee0343cd9f8ba0b8620c Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:27 +0000 Subject: [MERGED] osmo-bsc[master]: cosmetic: explicitly init ho_ref start value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: explicitly init ho_ref start value ...................................................................... cosmetic: explicitly init ho_ref start value The static ho_ref seems to be implicitly initialized to zero, but let's make it explicit for code readability. Change-Id: I00493bcb7ef3e38fb8e0077c60c5bac7199f1073 --- M src/libbsc/handover_logic.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index ee7b683..4b86de7 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -93,7 +93,7 @@ { struct gsm_lchan *new_lchan; struct bsc_handover *ho; - static uint8_t ho_ref; + static uint8_t ho_ref = 0; int rc; /* don't attempt multiple handovers for the same lchan at -- To view, visit https://gerrit.osmocom.org/5896 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00493bcb7ef3e38fb8e0077c60c5bac7199f1073 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:28 +0000 Subject: [MERGED] osmo-bsc[master]: Correctly set T3105 for ipaccess BTS type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Correctly set T3105 for ipaccess BTS type ...................................................................... Correctly set T3105 for ipaccess BTS type The given value is 10 * ms, so 13 is used instead of 128. If T3105 is set at config to something greater 0, it is used instead of the default value. Adjusst nanobts_omlattr_test.c accordingly. Change-Id: I3d9687619ba4de35f5d2eff3026d903534b2bbd4 --- M src/libbsc/bts_ipaccess_nanobts_omlattr.c M tests/nanobts_omlattr/nanobts_omlattr_test.c M tests/nanobts_omlattr/nanobts_omlattr_test.ok 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/src/libbsc/bts_ipaccess_nanobts_omlattr.c index 22ae484..926322c 100644 --- a/src/libbsc/bts_ipaccess_nanobts_omlattr.c +++ b/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -89,8 +89,8 @@ } msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); - /* miliseconds */ - msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, 128); + /* 10 milliseconds */ + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, bts->network->T3105 > 0? bts->network->T3105 : 13); /* 10 retransmissions of physical config */ msgb_tv_put(msgb, NM_ATT_NY1, 10); diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.c b/tests/nanobts_omlattr/nanobts_omlattr_test.c index cdb37a3..674148a 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.c +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -219,7 +219,7 @@ 0x02, 0x01, 0x20, 0x33, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21, 0xa8, 0x1f, 0x3f, 0x25, 0x00, 0x01, 0x0a, 0x0c, 0x0a, 0x0b, 0x01, 0x2a, 0x0a, 0x2b, - 0x03, 0xe8, 0x0a, 0x80, + 0x03, 0xe8, 0x0a, 0x0d, 0x23, 0x0a, 0x08, 0x03, 0x62, 0x09, 0x3f, 0x99, 0x00, 0x07, 0x00, 0xf1, 0x10, 0x00, 0x01, 0x05, 0x39 diff --git a/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/tests/nanobts_omlattr/nanobts_omlattr_test.ok index 91b655f..9504c09 100644 --- a/tests/nanobts_omlattr/nanobts_omlattr_test.ok +++ b/tests/nanobts_omlattr/nanobts_omlattr_test.ok @@ -1,6 +1,6 @@ Testing nanobts_attr_bts_get()... -result= 19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a80230a080362093f99000700f11000010539 -expected=19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a80230a080362093f99000700f11000010539 +result= 19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a0d230a080362093f99000700f11000010539 +expected=19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a0d230a080362093f99000700f11000010539 ok. Testing nanobts_attr_nse_get()... -- To view, visit https://gerrit.osmocom.org/5910 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d9687619ba4de35f5d2eff3026d903534b2bbd4 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:28 +0000 Subject: [MERGED] osmo-bsc[master]: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() ...................................................................... HO: rename gsm_bts_neighbor() to bts_by_arfcn_bsic() The name sounds like it is looking up neighbors, instead it simply traverses the global list of BTSes. Rename to reflect what it does. Move FIXME comment to its logical place: at the invocation of bts_by_arfcn_bsic(). Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd --- M src/libbsc/handover_decision.c 1 file changed, 13 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/handover_decision.c b/src/libbsc/handover_decision.c index 0693613..93ca28b 100644 --- a/src/libbsc/handover_decision.c +++ b/src/libbsc/handover_decision.c @@ -35,21 +35,16 @@ #include #include -/* Get reference to a neighbor cell on a given BCCH ARFCN */ -static struct gsm_bts *gsm_bts_neighbor(const struct gsm_bts *bts, - uint16_t arfcn, uint8_t bsic) +/* Find BTS by ARFCN and BSIC */ +static struct gsm_bts *bts_by_arfcn_bsic(const struct gsm_network *net, + uint16_t arfcn, uint8_t bsic) { - struct gsm_bts *neigh; - /* FIXME: use some better heuristics here to determine which cell - * using this ARFCN really is closest to the target cell. For - * now we simply assume that each ARFCN will only be used by one - * cell */ + struct gsm_bts *bts; - llist_for_each_entry(neigh, &bts->network->bts_list, list) { - /* FIXME: this is probably returning the same bts again!? */ - if (neigh->c0->arfcn == arfcn && - neigh->bsic == bsic) - return neigh; + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->c0->arfcn == arfcn && + bts->bsic == bsic) + return bts; } return NULL; @@ -63,7 +58,11 @@ struct gsm_bts *new_bts; /* resolve the gsm_bts structure for the best neighbor */ - new_bts = gsm_bts_neighbor(lchan->ts->trx->bts, arfcn, bsic); + /* FIXME: use some better heuristics here to determine which cell + * using this ARFCN really is closest to the target cell. For + * now we simply assume that each ARFCN will only be used by one + * cell */ + new_bts = bts_by_arfcn_bsic(lchan->ts->trx->bts->network, arfcn, bsic); if (!new_bts) { LOGP(DHODEC, LOGL_NOTICE, "unable to determine neighbor BTS " "for ARFCN %u BSIC %u ?!?\n", arfcn, bsic); -- To view, visit https://gerrit.osmocom.org/5917 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I063870d09f782a4f18e85d87c7cd17fe660cb3fd Gerrit-PatchSet: 6 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:28 +0000 Subject: [MERGED] osmo-bsc[master]: HO: If handover logic is used to do assignment, signal assig... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: If handover logic is used to do assignment, signal assignment result ...................................................................... HO: If handover logic is used to do assignment, signal assignment result Change-Id: I465caef03626e67d9b3a21bdf730589b9852c211 --- M include/osmocom/bsc/signal.h M src/libbsc/bsc_api.c 2 files changed, 31 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/signal.h b/include/osmocom/bsc/signal.h index 58d9acf..9c0d5a3 100644 --- a/include/osmocom/bsc/signal.h +++ b/include/osmocom/bsc/signal.h @@ -85,6 +85,8 @@ S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */ S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */ S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */ + S_LCHAN_ASSIGNMENT_COMPL, /* 04.08 Assignment Completed */ + S_LCHAN_ASSIGNMENT_FAIL, /* 04.08 Assignment Failed */ S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */ S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */ }; diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 3592c00..ec64bb8 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -436,6 +436,21 @@ struct gsm48_hdr *gh; struct bsc_api *api = conn->network->bsc_api; + if (conn->ho_lchan) { + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + DEBUGP(DRR, "ASSIGNMENT COMPLETE cause = %s\n", + rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_COMPL, &sig); + /* FIXME: release old channel */ + + return; + } + if (conn->secondary_lchan != msg->lchan) { LOGP(DMSC, LOGL_ERROR, "Assignment Compl should occur on second lchan.\n"); return; @@ -471,6 +486,20 @@ uint8_t *rr_failure; struct gsm48_hdr *gh; + if (conn->ho_lchan) { + struct lchan_signal_data sig; + struct gsm48_hdr *gh = msgb_l3(msg); + + DEBUGP(DRR, "ASSIGNMENT FAILED cause = %s\n", + rr_cause_name(gh->data[0])); + + sig.lchan = msg->lchan; + sig.mr = NULL; + osmo_signal_dispatch(SS_LCHAN, S_LCHAN_ASSIGNMENT_FAIL, &sig); + /* FIXME: release allocated new channel */ + + return; + } if (conn->lchan != msg->lchan) { LOGP(DMSC, LOGL_ERROR, "Assignment failure should occur on primary lchan.\n"); -- To view, visit https://gerrit.osmocom.org/5906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I465caef03626e67d9b3a21bdf730589b9852c211 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:29 +0000 Subject: [MERGED] osmo-bsc[master]: vty: add various manual handover and assignment trigger comm... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: add various manual handover and assignment trigger commands ...................................................................... vty: add various manual handover and assignment trigger commands Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 --- M src/libbsc/bsc_vty.c 1 file changed, 192 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index aafdd2d..75b0b9a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1342,12 +1342,27 @@ return CMD_SUCCESS; } -DEFUN(handover_subscr_conn, - handover_subscr_conn_cmd, - "handover <0-255> <0-255> <0-7> <0-7> <0-255>", - "Handover subscriber connection to other BTS\n" - "Current " BTS_TRX_TS_LCHAN_STR - "New " BTS_NR_STR) +static int trigger_ho_or_as(struct vty *vty, struct gsm_lchan *from_lchan, struct gsm_bts *to_bts) +{ + int rc; + + if (!to_bts || from_lchan->ts->trx->bts == to_bts) { + LOGP(DHO, LOGL_NOTICE, "%s Manually triggering Assignment from VTY\n", + gsm_lchan_name(from_lchan)); + to_bts = from_lchan->ts->trx->bts; + } else + LOGP(DHO, LOGL_NOTICE, "%s (ARFCN %u) --> BTS %u Manually triggering Handover from VTY\n", + gsm_lchan_name(from_lchan), from_lchan->ts->trx->arfcn, to_bts->nr); + rc = bsc_handover_start(from_lchan, to_bts); + if (rc) { + vty_out(vty, "bsc_handover_start() returned %d=%s%s", rc, + strerror(-rc), VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} + +static int ho_or_as(struct vty *vty, const char *argv[], int argc) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_subscriber_connection *conn; @@ -1357,41 +1372,190 @@ unsigned int trx_nr = atoi(argv[1]); unsigned int ts_nr = atoi(argv[2]); unsigned int ss_nr = atoi(argv[3]); - unsigned int bts_nr_new = atoi(argv[4]); + unsigned int bts_nr_new; + const char *action; - /* Lookup the BTS where we want to handover to */ - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == bts_nr_new) { - new_bts = bts; - break; + if (argc > 4) { + bts_nr_new = atoi(argv[4]); + + /* Lookup the BTS where we want to handover to */ + llist_for_each_entry(bts, &net->bts_list, list) { + if (bts->nr == bts_nr_new) { + new_bts = bts; + break; + } + } + + if (!new_bts) { + vty_out(vty, "Unable to trigger handover, specified bts #%u does not exist %s", + bts_nr_new, VTY_NEWLINE); + return CMD_WARNING; } } - if (!new_bts) { - vty_out(vty, "Unable to trigger handover," - "specified bts #%u does not exist %s", bts_nr_new, - VTY_NEWLINE); - return CMD_WARNING; - } + action = new_bts ? "handover" : "assignment"; /* Find the connection/lchan that we want to handover */ llist_for_each_entry(conn, &net->subscr_conns, entry) { if (conn_get_bts(conn)->nr == bts_nr && conn->lchan->ts->trx->nr == trx_nr && conn->lchan->ts->nr == ts_nr && conn->lchan->nr == ss_nr) { - vty_out(vty, "starting handover for lchan %s...%s", - conn->lchan->name, VTY_NEWLINE); + vty_out(vty, "starting %s for lchan %s...%s", action, conn->lchan->name, VTY_NEWLINE); lchan_dump_full_vty(vty, conn->lchan); - bsc_handover_start(conn->lchan, new_bts); - return CMD_SUCCESS; + return trigger_ho_or_as(vty, conn->lchan, new_bts); } } - vty_out(vty, "Unable to trigger handover," - "specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", - bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); + vty_out(vty, "Unable to trigger %s, specified connection (bts=%u,trx=%u,ts=%u,ss=%u) does not exist%s", + action, bts_nr, trx_nr, ts_nr, ss_nr, VTY_NEWLINE); return CMD_WARNING; +} + +#define MANUAL_HANDOVER_STR "Manually trigger handover (for debugging)\n" +#define MANUAL_ASSIGNMENT_STR "Manually trigger assignment (for debugging)\n" + +DEFUN(handover_subscr_conn, + handover_subscr_conn_cmd, + "handover <0-255> <0-255> <0-7> <0-7> <0-255>", + MANUAL_HANDOVER_STR + "Current " BTS_TRX_TS_LCHAN_STR + "New " BTS_NR_STR) +{ + return ho_or_as(vty, argv, argc); +} + +DEFUN(assignment_subscr_conn, + assignment_subscr_conn_cmd, + "assignment <0-255> <0-255> <0-7> <0-7>", + MANUAL_ASSIGNMENT_STR + "Current " BTS_TRX_TS_LCHAN_STR) +{ + return ho_or_as(vty, argv, argc); +} + +static struct gsm_lchan *find_used_voice_lchan(struct vty *vty) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_ACTIVE + && (lchan->type == GSM_LCHAN_TCH_F + || lchan->type == GSM_LCHAN_TCH_H)) { + + vty_out(vty, "Found voice call: %s%s", + gsm_lchan_name(lchan), VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return lchan; + } + } + } + } + } + + vty_out(vty, "Cannot find any ongoing voice calls%s", VTY_NEWLINE); + return NULL; +} + +static struct gsm_bts *find_other_bts_with_free_slots(struct vty *vty, struct gsm_bts *not_this_bts, + enum gsm_phys_chan_config free_type) +{ + struct gsm_bts *bts; + struct gsm_network *network = gsmnet_from_vty(vty); + + llist_for_each_entry(bts, &network->bts_list, list) { + struct gsm_bts_trx *trx; + + if (bts == not_this_bts) + continue; + + llist_for_each_entry(trx, &bts->trx_list, list) { + int i; + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + struct gsm_bts_trx_ts *ts = &trx->ts[i]; + int j; + int subslots; + + /* skip administratively deactivated timeslots */ + if (!nm_is_running(&ts->mo.nm_state)) + continue; + + if (ts->pchan != free_type) + continue; + + subslots = ts_subslots(ts); + for (j = 0; j < subslots; j++) { + struct gsm_lchan *lchan = &ts->lchan[j]; + + if (lchan->state == LCHAN_S_NONE) { + vty_out(vty, "Found unused %s slot: %s%s", + gsm_pchan_name(free_type), + gsm_lchan_name(lchan), + VTY_NEWLINE); + lchan_dump_full_vty(vty, lchan); + return bts; + } + } + } + } + } + vty_out(vty, "Cannot find any BTS (other than BTS %u) with free %s lchan%s", + not_this_bts? not_this_bts->nr : 255, gsm_lchant_name(free_type), VTY_NEWLINE); + return NULL; +} + +DEFUN(handover_any, handover_any_cmd, + "handover any", + MANUAL_HANDOVER_STR + "Pick any actively used TCH/F or TCH/H lchan and handover to any other BTS." + " This is likely to fail if not all BTS are guaranteed to be reachable by the MS.\n") +{ + struct gsm_lchan *from_lchan; + struct gsm_bts *to_bts; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + to_bts = find_other_bts_with_free_slots(vty, from_lchan->ts->trx->bts, + ts_pchan(from_lchan->ts)); + if (!to_bts) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, to_bts); +} + +DEFUN(assignment_any, assignment_any_cmd, + "assignment any", + MANUAL_ASSIGNMENT_STR + "Pick any actively used TCH/F or TCH/H lchan and re-assign within the same BTS." + " This will fail if no lchans of the same type are available besides the used one.\n") +{ + struct gsm_lchan *from_lchan; + + from_lchan = find_used_voice_lchan(vty); + if (!from_lchan) + return CMD_WARNING; + + return trigger_ho_or_as(vty, from_lchan, NULL); } static void paging_dump_vty(struct vty *vty, struct gsm_paging_request *pag) @@ -4213,6 +4377,9 @@ install_element_ve(&show_subscr_conn_cmd); install_element_ve(&handover_subscr_conn_cmd); + install_element_ve(&handover_any_cmd); + install_element_ve(&assignment_subscr_conn_cmd); + install_element_ve(&assignment_any_cmd); install_element_ve(&show_paging_cmd); install_element_ve(&show_paging_group_cmd); -- To view, visit https://gerrit.osmocom.org/5889 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9745609f2620baa09a693b713d76e355e798abc7 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:29 +0000 Subject: [MERGED] osmo-bsc[master]: vty: cosmetic: use common BTS, TRX, TS, LCHAN strings In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: cosmetic: use common BTS, TRX, TS, LCHAN strings ...................................................................... vty: cosmetic: use common BTS, TRX, TS, LCHAN strings Change-Id: Ic015ebd3a330769638dddeab2f52321b0302a5a1 --- M src/libbsc/bsc_vty.c 1 file changed, 27 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index 983ce20..aafdd2d 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -64,9 +64,13 @@ #include "../../bscconfig.h" - +#define BTS_NR_STR "BTS Number\n" +#define TRX_NR_STR "TRX Number\n" +#define TS_NR_STR "Timeslot Number\n" #define LCHAN_NR_STR "Logical Channel Number\n" - +#define BTS_TRX_STR BTS_NR_STR TRX_NR_STR +#define BTS_TRX_TS_STR BTS_TRX_STR TS_NR_STR +#define BTS_TRX_TS_LCHAN_STR BTS_TRX_TS_STR LCHAN_NR_STR /* FIXME: this should go to some common file */ static const struct value_string gprs_ns_timer_strs[] = { @@ -883,8 +887,7 @@ show_trx_cmd, "show trx [<0-255>] [<0-255>]", SHOW_STR "Display information about a TRX\n" - "BTS Number\n" - "TRX Number\n") + BTS_TRX_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts = NULL; @@ -944,7 +947,7 @@ show_ts_cmd, "show timeslot [<0-255>] [<0-255>] [<0-7>]", SHOW_STR "Display information about a TS\n" - "BTS Number\n" "TRX Number\n" "Timeslot Number\n") + BTS_TRX_TS_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts = NULL; @@ -1299,9 +1302,7 @@ show_lchan_cmd, "show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" - "BTS Number\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR) - + BTS_TRX_TS_LCHAN_STR) { return lchan_summary(vty, argc, argv, lchan_dump_full_vty); } @@ -1311,8 +1312,7 @@ "show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "Short summary\n" - "BTS Number\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR) + BTS_TRX_TS_LCHAN_STR) { return lchan_summary(vty, argc, argv, lchan_dump_short_vty); } @@ -1346,8 +1346,8 @@ handover_subscr_conn_cmd, "handover <0-255> <0-255> <0-7> <0-7> <0-255>", "Handover subscriber connection to other BTS\n" - "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" - LCHAN_NR_STR "BTS Number (new)\n") + "Current " BTS_TRX_TS_LCHAN_STR + "New " BTS_NR_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_subscriber_connection *conn; @@ -1415,7 +1415,7 @@ show_paging_cmd, "show paging [<0-255>]", SHOW_STR "Display information about paging reuqests of a BTS\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts; @@ -1446,7 +1446,7 @@ show_paging_group_cmd, "show paging-group <0-255> IMSI", SHOW_STR "Display the paging group\n" - "BTS Number\n" "IMSI\n") + BTS_NR_STR "IMSI\n") { struct gsm_network *net = gsmnet_from_vty(vty); struct gsm_bts *bts; @@ -1646,7 +1646,7 @@ cfg_bts_cmd, "bts <0-255>", "Select a BTS to configure\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); int bts_nr = atoi(argv[0]); @@ -3125,7 +3125,8 @@ DEFUN(cfg_bts_depends_on, cfg_bts_depends_on_cmd, "depends-on-bts <0-255>", - "This BTS can only be started if another one is up\n" "BTS Number\n") + "This BTS can only be started if another one is up\n" + BTS_NR_STR) { struct gsm_bts *bts = vty->index; struct gsm_bts *other_bts; @@ -3158,7 +3159,7 @@ DEFUN(cfg_bts_no_depends_on, cfg_bts_no_depends_on_cmd, "depeneds-on-bts <0-255>", NO_STR "This BTS can only be started if another one is up\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_bts *bts = vty->index; int dep = atoi(argv[0]); @@ -3834,7 +3835,7 @@ DEFUN(restart_bts, restart_bts_cmd, "restart-bts <0-65535>", "Restart ip.access nanoBTS through OML\n" - "BTS Number\n") + BTS_NR_STR) { struct gsm_network *gsmnet; struct gsm_bts_trx *trx; @@ -3871,7 +3872,7 @@ DEFUN(bts_resend, bts_resend_cmd, "bts <0-255> resend-system-information", - "BTS Specific Commands\n" "BTS Number\n" + "BTS Specific Commands\n" BTS_NR_STR "Re-generate + re-send BCCH SYSTEM INFORMATION\n") { struct gsm_network *gsmnet; @@ -3903,7 +3904,7 @@ DEFUN(smscb_cmd, smscb_cmd_cmd, "bts <0-255> smscb-command <1-4> HEXSTRING", - "BTS related commands\n" "BTS Number\n" + "BTS related commands\n" BTS_NR_STR "SMS Cell Broadcast\n" "Last Valid Block\n" "Hex Encoded SMSCB message (up to 88 octets)\n") { @@ -3979,8 +3980,8 @@ DEFUN(pdch_act, pdch_act_cmd, "bts <0-255> trx <0-255> timeslot <0-7> pdch (activate|deactivate)", - "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" - "TRX Timeslot\n" "Timeslot Number\n" "Packet Data Channel\n" + "BTS related commands\n" BTS_NR_STR "Transceiver\n" TRX_NR_STR + "TRX Timeslot\n" TS_NR_STR "Packet Data Channel\n" "Activate Dynamic PDCH/TCH (-> PDCH mode)\n" "Deactivate Dynamic PDCH/TCH (-> TCH mode)\n") { @@ -4065,8 +4066,8 @@ * performance testing (FER/RBER/...) */ DEFUN(lchan_act, lchan_act_cmd, "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> (activate|deactivate) (hr|fr|efr|amr) [<0-7>]", - "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" - "TRX Timeslot\n" "Timeslot Number\n" "Sub-Slot Number\n" "Sub-Slot Number\n" + "BTS related commands\n" BTS_NR_STR "Transceiver\n" TRX_NR_STR + "TRX Timeslot\n" TS_NR_STR "Sub-Slot Number\n" LCHAN_NR_STR "Manual Channel Activation (e.g. for BER test)\n" "Manual Channel Deactivation (e.g. for BER test)\n" "Half-Rate v1\n" "Full-Rate\n" "Enhanced Full Rate\n" "Adaptive Multi-Rate\n" "AMR Mode\n") @@ -4133,8 +4134,8 @@ DEFUN(lchan_mdcx, lchan_mdcx_cmd, "bts <0-255> trx <0-255> timeslot <0-7> sub-slot <0-7> mdcx A.B.C.D <0-65535>", - "BTS related commands\n" "BTS Number\n" "Transceiver\n" "Transceiver Number\n" - "TRX Timeslot\n" "Timeslot Number\n" "Sub-Slot\n" "Sub-Slot Number\n" + "BTS related commands\n" BTS_NR_STR "Transceiver\n" TRX_NR_STR + "TRX Timeslot\n" TS_NR_STR "Sub-Slot\n" LCHAN_NR_STR "Modify RTP Connection\n" "MGW IP Address\n" "MGW UDP Port\n") { struct gsm_bts_trx_ts *ts; -- To view, visit https://gerrit.osmocom.org/5932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic015ebd3a330769638dddeab2f52321b0302a5a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:29 +0000 Subject: [MERGED] osmo-bsc[master]: vty: fix 'show lchan ...' arg [lchan_nr] to [<0-7>] In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: fix 'show lchan ...' arg [lchan_nr] to [<0-7>] ...................................................................... vty: fix 'show lchan ...' arg [lchan_nr] to [<0-7>] A lower-case argument is a keyword, not a variable placeholder. Hence the user would not be able to pass a number, just the "lchan_nr" string itself, hence this would never work. Depending on pchan, lchans can range 0..7, so use that instead. Change-Id: Ib9a0b43b68c4682cd6de24d01c0de421c9ce957a --- M src/libbsc/bsc_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index e60bdaf..dcdd28a 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1297,7 +1297,7 @@ DEFUN(show_lchan, show_lchan_cmd, - "show lchan [<0-255>] [<0-255>] [<0-7>] [lchan_nr]", + "show lchan [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "BTS Number\n" "TRX Number\n" "Timeslot Number\n" LCHAN_NR_STR) @@ -1308,7 +1308,7 @@ DEFUN(show_lchan_summary, show_lchan_summary_cmd, - "show lchan summary [<0-255>] [<0-255>] [<0-7>] [lchan_nr]", + "show lchan summary [<0-255>] [<0-255>] [<0-7>] [<0-7>]", SHOW_STR "Display information about a logical channel\n" "Short summary\n" "BTS Number\n" "TRX Number\n" "Timeslot Number\n" -- To view, visit https://gerrit.osmocom.org/5930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9a0b43b68c4682cd6de24d01c0de421c9ce957a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:30 +0000 Subject: [MERGED] osmo-bsc[master]: vty: change handover command's arg LCHAN_NR to <0-7> In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: change handover command's arg LCHAN_NR to <0-7> ...................................................................... vty: change handover command's arg LCHAN_NR to <0-7> Even thought the lchan number range depends on the pchan, using LCHAN_NR allows passing arbitrary arguments. Limit it to 0-7. Change-Id: I2c078b420b6183862acb5c18d1230cf8f6c9f0ce --- M src/libbsc/bsc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index dcdd28a..983ce20 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1344,7 +1344,7 @@ DEFUN(handover_subscr_conn, handover_subscr_conn_cmd, - "handover <0-255> <0-255> <0-7> LCHAN_NR <0-255>", + "handover <0-255> <0-255> <0-7> <0-7> <0-255>", "Handover subscriber connection to other BTS\n" "BTS Number (current)\n" "TRX Number\n" "Timeslot Number\n" LCHAN_NR_STR "BTS Number (new)\n") -- To view, visit https://gerrit.osmocom.org/5931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2c078b420b6183862acb5c18d1230cf8f6c9f0ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:51 +0000 Subject: osmo-gsm-manuals[master]: Document workaround for gsmtap logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8e64a0075b5a4bad3f83660e0668e6de45b21008 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:09:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:09:53 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Document workaround for gsmtap logging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Document workaround for gsmtap logging ...................................................................... Document workaround for gsmtap logging Document a way to minimize logging to stderr when gsmtap is used as a log target. Change-Id: I8e64a0075b5a4bad3f83660e0668e6de45b21008 --- M common/chapters/logging.adoc 1 file changed, 8 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/logging.adoc b/common/chapters/logging.adoc index 1b4000b..fab4991 100644 --- a/common/chapters/logging.adoc +++ b/common/chapters/logging.adoc @@ -174,7 +174,14 @@ .Wireshark with logs delivered over GSMTAP image::../common/images/wireshark-gsmtap-log.png[] -Note: the logs are also duplicated to stderr when GSMTAP logging is configured. +Note: the logs are also duplicated to stderr when GSMTAP logging is configured because stderr is the default log target which is +initialized automatically. To descrease stderr logging to absolute minimum, you can configure it as follows: +---- +OsmoBSC> enable +OsmoBSC# configure terminal +OsmoBSC(config)# log stderr +OsmoBSC(config-log)# logging level all fatal +---- ==== Logging to a file -- To view, visit https://gerrit.osmocom.org/5865 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8e64a0075b5a4bad3f83660e0668e6de45b21008 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:11:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:11:20 +0000 Subject: osmo-msc[master]: Store/retrieve SMS validity time in the SMS datebase In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:11:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 19 Jan 2018 22:11:55 +0000 Subject: libosmocore[master]: Extend Kc buffer In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 my original comment against version 1 remains. -- To view, visit https://gerrit.osmocom.org/1538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 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 Fri Jan 19 22:55:14 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 22:55:14 +0000 Subject: [PATCH] libosmocore[master]: tests/ussd: prevent uninitialized memory access Message-ID: Review at https://gerrit.osmocom.org/5934 tests/ussd: prevent uninitialized memory access Previously an incorrect length value was passed to both gsm_7bit_decode_n_ussd() and gsm_7bit_encode_n_ussd() functions during test_7bit_ussd() execution, due to: octets_written = strlen(decoded); The problem is that strlen() returns one-byte bigger value, that octets_written is. This then causes the uninitialized memory access. Found using Valgrind: Conditional jump or move depends on uninitialised value(s) at 0x506DCCC: gsm_7bit_decode_n_ussd (gsm_utils.c:248) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBB7: gsm_7bit_decode_n_hdr (gsm_utils.c:220) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBCB: gsm_septet_lookup (gsm_utils.c:153) by 0x506DBCB: gsm_7bit_decode_n_hdr (gsm_utils.c:224) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c --- M tests/ussd/ussd_test.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/5934/1 diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 8d88dbb..429c72d 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -90,8 +90,7 @@ OSMO_ASSERT(strcmp(encoded_hex, osmo_hexdump_nospc(coded, octets_written)) == 0); gsm_7bit_decode_n_ussd(decoded, sizeof(decoded), coded, octets_written * 8 / 7); - octets_written = strlen(decoded); - printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, octets_written)); + printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, strlen(decoded))); OSMO_ASSERT(strncmp(text, decoded, strlen(text)) == 0); OSMO_ASSERT(strcmp(appended_after_decode, decoded + strlen(text)) == 0); -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Fri Jan 19 22:57:34 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 19 Jan 2018 22:57:34 +0000 Subject: libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Patch Set 1: It's funny that the address sanitizer didn't catch this bug ;) -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 20 00:00:08 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Sat, 20 Jan 2018 00:00:08 +0000 Subject: [PATCH] osmo-mgw[master]: client: eliminate destructive parameter parsing Message-ID: Review at https://gerrit.osmocom.org/5935 client: eliminate destructive parameter parsing The function mgcp_response_parse_params() that is used to parse the SDP parameters edits the content of the r->body. - Create a local copy of r->body and work on this copy to keep the original r-body in its original state. Change-Id: Ia475036f7f3802b1638e0511a5e9162fea1592eb --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 19 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/35/5935/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index fa59a61..494b09a 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -244,24 +244,25 @@ int rc; OSMO_ASSERT(r->body); char *data = mgcp_find_section_end(r->body); + char *data_ptr; - /* Warning: This function performs a destructive parsing on r->body. - * Since this function is called at the very end of the persing - * process, destructive parsing is acceptable. */ + /* Since this functions performs a destructive parsing, we create a + * local copy of the body data */ + data = talloc_zero_size(NULL, strlen(r->body)+1); + OSMO_ASSERT(data); + data_ptr = data; + osmo_strlcpy(data, r->body, strlen(r->body)); + /* Find beginning of the parameter (SDP) section */ + data_ptr = mgcp_find_section_end(data); if (!data) { LOGP(DLMGCP, LOGL_ERROR, "MGCP response: cannot find start of parameters\n"); - return -EINVAL; + rc = -EINVAL; + goto exit; } - /* Advance to after the \n\n, replace the second \n with \0. That's - * where the parameters start. */ - data ++; - *data = '\0'; - data ++; - - for_each_non_empty_line(line, data) { + for_each_non_empty_line(line, data_ptr) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -269,19 +270,23 @@ case 'm': rc = mgcp_parse_audio_port(r, line); if (rc) - return rc; + goto exit; break; case 'c': rc = mgcp_parse_audio_ip(r, line); if (rc) - return rc; + goto exit; break; default: /* skip unhandled parameters */ break; } } - return 0; + + rc = 0; +exit: + talloc_free(data); + return rc; } /* Parse a line like "X: something" */ -- To view, visit https://gerrit.osmocom.org/5935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia475036f7f3802b1638e0511a5e9162fea1592eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Sat Jan 20 00:00:06 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Sat, 20 Jan 2018 00:00:06 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) 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/5879 to look at the new patch set (#4). mgcp: permit wildcarded endpoint assignment (CRCX) The mgcp protocol in general allows wildcarded endpoints on CRCX. osmo-mgw does not support this feature yet. - when the endpoint name contains a wildcard character, search a free endpoint automatically - return the resulting endpoint name in the parameter section of the mgcp response - add parsing support for the returned endpoint names - Be more concious about the parameters that are returned with each response. Do not unnecessarily attach known parameters. Return the connection ID only on CRCX commands. Only return the endpoint ID on CRCX commands that are wildcarded. Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 related: OS#2631 --- M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M tests/mgcp/mgcp_test.c 6 files changed, 138 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/79/5879/4 diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 33a754c..c0ee556 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -260,6 +260,10 @@ /* fields for re-transmission */ char *last_trans; char *last_response; + + /* Memorize if this endpoint was choosen by the MGW (wildcarded, true) + * or if the user has choosen the particular endpoint explicitly */ + bool wildcarded_crcx; }; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 882c908..676850f 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -31,6 +31,7 @@ mgcp_trans_id_t trans_id; const char *comment; char conn_id[MGCP_CONN_ID_LENGTH]; + char endpoint[MGCP_ENDPOINT_MAXLEN]; }; struct mgcp_response { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index f094a09..fa59a61 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -146,8 +146,6 @@ /* Mark the end of the comment */ *end = '\0'; r->body = end + 1; - if (r->body[0] == '\n') - r->body ++; return 0; response_parse_failure: @@ -247,6 +245,10 @@ OSMO_ASSERT(r->body); char *data = mgcp_find_section_end(r->body); + /* Warning: This function performs a destructive parsing on r->body. + * Since this function is called at the very end of the persing + * process, destructive parsing is acceptable. */ + if (!data) { LOGP(DLMGCP, LOGL_ERROR, "MGCP response: cannot find start of parameters\n"); @@ -282,21 +284,29 @@ return 0; } -/* Parse a line like "I: 0cedfd5a19542d197af9afe5231f1d61" */ -static int mgcp_parse_conn_id(struct mgcp_response *r, const char *line) +/* Parse a line like "X: something" */ +static int mgcp_parse_head_param(char *result, unsigned int result_len, + char label, const char *line) { + char label_string[4]; + + /* Detect empty parameters */ if (strlen(line) < 4) goto response_parse_failure; - if (memcmp("I: ", line, 3) != 0) + /* Check if the label matches */ + snprintf(label_string, sizeof(label_string), "%c: ", label); + if (memcmp(label_string, line, 3) != 0) goto response_parse_failure; - osmo_strlcpy(r->head.conn_id, line + 3, sizeof(r->head.conn_id)); + /* Copy payload part of the string to destinations (the label string + * is always 3 chars long) */ + osmo_strlcpy(result, line + 3, result_len); return 0; response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response (connectionIdentifier)\n"); + "Failed to parse MGCP response (parameter label: %c)\n", label); return -EINVAL; } @@ -306,18 +316,37 @@ char *line; int rc = 0; OSMO_ASSERT(r->body); - char *data = r->body; - char *data_end = mgcp_find_section_end(r->body); + char *data; + char *data_ptr; + char *data_end; - /* Protect SDP body, for_each_non_empty_line() will - * only parse until it hits \0 mark. */ + /* Since this functions performs a destructive parsing, we create a + * local copy of the body data */ + data = talloc_zero_size(NULL, strlen(r->body)+1); + OSMO_ASSERT(data); + data_ptr = data; + osmo_strlcpy(data, r->body, strlen(r->body)); + + /* If there is an SDP body attached, prevent for_each_non_empty_line() + * into running in there, we are not yet interested in the parameters + * stored there. */ + data_end = mgcp_find_section_end(data); if (data_end) *data_end = '\0'; - for_each_non_empty_line(line, data) { + for_each_non_empty_line(line, data_ptr) { switch (line[0]) { + case 'Z': + rc = mgcp_parse_head_param(r->head.endpoint, + sizeof(r->head.endpoint), + 'Z', line); + if (rc) + goto exit; + break; case 'I': - rc = mgcp_parse_conn_id(r, line); + rc = mgcp_parse_head_param(r->head.conn_id, + sizeof(r->head.conn_id), + 'I', line); if (rc) goto exit; break; @@ -327,10 +356,7 @@ } } exit: - /* Restore original state */ - if (data_end) - *data_end = '\n'; - + talloc_free(data); return rc; } diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 74acffa..9bb2805 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,30 @@ return &tcfg->endpoints[endp]; } +/* Find an endpoint that is not in use. Do this by going through the endpoint + * array, check the callid. A callid nullpointer indicates that the endpoint + * is free */ +static struct mgcp_endpoint *find_free_endpoint(struct mgcp_endpoint *endpoints, + unsigned int number_endpoints) +{ + struct mgcp_endpoint *endp; + unsigned int i; + + for (i = 0; i < number_endpoints; i++) { + if (endpoints[i].callid == NULL) { + endp = &endpoints[i]; + LOGP(DLMGCP, LOGL_DEBUG, + "endpoint:0x%x found free endpoint\n", + ENDPOINT_NUMBER(endp)); + endp->wildcarded_crcx = true; + return endp; + } + } + + LOGP(DLMGCP, LOGL_ERROR, "Not able to find a free endpoint"); + return NULL; +} + /* Check if the domain name, which is supplied with the endpoint name * matches the configuration. */ static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) @@ -213,6 +237,11 @@ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); + if (strncmp(mgcp, "*", 1) == 0) { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 4c04712..16e9cb8 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -192,11 +192,32 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } +/* Add MGCP parameters to a message buffer */ +static int add_params(struct msgb *msg, const struct mgcp_endpoint *endp, + const struct mgcp_conn_rtp *conn) +{ + int rc; + + if (endp->wildcarded_crcx) { + rc = msgb_printf(msg, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), + endp->cfg->domain); + if (rc < 0) + return -EINVAL; + } + + rc = msgb_printf(msg, "I: %s\n", conn->conn->id); + if (rc < 0) + return -EINVAL; + + return 0; +} + /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, const char *msg, - const char *trans_id) + const char *trans_id, + bool add_conn_params) { const char *addr = endp->cfg->local_ip; struct msgb *sdp; @@ -221,7 +242,14 @@ osmux_extension[0] = '\0'; } - rc = msgb_printf(sdp, "I: %s%s\n\n", conn->conn->id, osmux_extension); + /* Attach optional connection parameters */ + if (add_conn_params) { + rc = add_params(sdp, endp, conn); + if (rc < 0) + goto error; + } + + rc = msgb_printf(sdp, "%s\n", osmux_extension); if (rc < 0) goto error; @@ -648,7 +676,7 @@ LOGP(DLMGCP, LOGL_NOTICE, "CRCX: endpoint:0x%x connection successfully created\n", ENDPOINT_NUMBER(endp)); - return create_response_with_sdp(endp, conn, "CRCX", p->trans); + return create_response_with_sdp(endp, conn, "CRCX", p->trans, true); error2: mgcp_release_endp(endp); LOGP(DLMGCP, LOGL_NOTICE, @@ -801,7 +829,7 @@ LOGP(DLMGCP, LOGL_NOTICE, "MDCX: endpoint:0x%x connection successfully modified\n", ENDPOINT_NUMBER(endp)); - return create_response_with_sdp(endp, conn, "MDCX", p->trans); + return create_response_with_sdp(endp, conn, "MDCX", p->trans, false); error3: return create_err_response(endp, error_code, "MDCX", p->trans); @@ -1196,6 +1224,7 @@ endp->local_options.string = NULL; talloc_free(endp->local_options.codec); endp->local_options.codec = NULL; + endp->wildcarded_crcx = false; } static int send_agent(struct mgcp_config *cfg, const char *buf, int len) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 467cb6c..ddee8c5 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -86,7 +86,6 @@ #define MDCX3_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -99,7 +98,6 @@ #define MDCX3A_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -112,7 +110,6 @@ #define MDCX3_FMTP_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -141,7 +138,6 @@ #define MDCX4_RET(Ident) \ "200 " Ident " OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -154,7 +150,6 @@ #define MDCX4_RO_RET(Ident) \ "200 " Ident " OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -561,25 +556,39 @@ { char *conn_id_ptr; int i; + bool got_conn_id = false; + /* First try to get the conn_id from the I: parameter */ conn_id_ptr = strstr((char *)resp, "I: "); - if (!conn_id_ptr) - return -EINVAL; - - memset(conn_id, 0, conn_id_len); - memcpy(conn_id, conn_id_ptr + 3, 32); - - for (i = 0; i < conn_id_len; i++) { - if (conn_id[i] == '\n' || conn_id[i] == '\r') - conn_id[i] = '\0'; + if (conn_id_ptr) { + memset(conn_id, 0, conn_id_len); + memcpy(conn_id, conn_id_ptr + 3, 32); + got_conn_id = true; + } else { + /* Alternatively try to extract the conn_id from the o=- SDP + * parameter */ + conn_id_ptr = strstr((char *)resp, "o=- "); + if(conn_id_ptr) { + memset(conn_id, 0, conn_id_len); + memcpy(conn_id, conn_id_ptr + 4, 32); + got_conn_id = true; + } } - /* A valid conn_id must at least contain one digit, and must - * not exceed a length of 32 digits */ - OSMO_ASSERT(strlen(conn_id) <= 32); - OSMO_ASSERT(strlen(conn_id) > 0); + if (got_conn_id) { + for (i = 0; i < conn_id_len; i++) { + if (conn_id[i] == '\n' || conn_id[i] == '\r') + conn_id[i] = '\0'; + } - return 0; + /* A valid conn_id must at least contain one digit, and must + * not exceed a length of 32 digits */ + OSMO_ASSERT(strlen(conn_id) <= 32); + OSMO_ASSERT(strlen(conn_id) > 0); + + return 0; + } + return -EINVAL; } /* Check response, automatically patch connection ID if needed */ -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 4 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 20 00:00:08 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Sat, 20 Jan 2018 00:00:08 +0000 Subject: [PATCH] osmo-mgw[master]: client: eliminate destructive head parsing Message-ID: Review at https://gerrit.osmocom.org/5936 client: eliminate destructive head parsing While parsing the head of an MGCP response the r->body buffer is manipulated in order to NUL terminate the extracted comment filed. - Use a static buffer to store and manipulate the comment field. Change-Id: Ib273c13d6fe7ee042fb4e3b8ed46ac02602226f6 --- M include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c 3 files changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/36/5936/1 diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 7aa5d3f..d23339f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -68,6 +68,9 @@ return 0; } +/* Maximum length of the comment field */ +#define MGCP_COMMENT_MAXLEN 256 + /* String length of Connection Identifiers * (see also RFC3435 2.1.3.2 Names of Connections) */ #define MGCP_CONN_ID_LENGTH 32+1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 676850f..73f3bba 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -29,7 +29,7 @@ struct mgcp_response_head { int response_code; mgcp_trans_id_t trans_id; - const char *comment; + char comment[MGCP_COMMENT_MAXLEN]; char conn_id[MGCP_CONN_ID_LENGTH]; char endpoint[MGCP_ENDPOINT_MAXLEN]; }; diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 494b09a..13c6529 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -139,13 +139,12 @@ &comment_pos) != 2) goto response_parse_failure; - r->head.comment = r->body + comment_pos; + osmo_strlcpy(r->head.comment, r->body + comment_pos, sizeof(r->head.comment)); end = strchr(r->head.comment, '\r'); if (!end) goto response_parse_failure; /* Mark the end of the comment */ *end = '\0'; - r->body = end + 1; return 0; response_parse_failure: -- To view, visit https://gerrit.osmocom.org/5936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib273c13d6fe7ee042fb4e3b8ed46ac02602226f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Sat Jan 20 00:00:09 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Sat, 20 Jan 2018 00:00:09 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: client: add doxygen comments Message-ID: Review at https://gerrit.osmocom.org/5937 cosmetic: client: add doxygen comments The client lacks doxygen apidoc comments - Add missing doxygen apidoc comments Change-Id: I0b8a0652e60f2b3d72ee1cedfa6e2d5547d88455 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 46 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/37/5937/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 13c6529..581c6a4 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -36,6 +36,8 @@ #include #include +/*! Initalize MGCP client configuration struct with default values. + * \param[out] conf Client configuration.*/ void mgcp_client_conf_init(struct mgcp_client_conf *conf) { /* NULL and -1 default to MGCP_CLIENT_*_DEFAULT values */ @@ -62,7 +64,9 @@ return false; } -/* Find and seize an unsused endpoint id */ +/*! Pick next free endpoint ID. + * \param[in,out] client MGCP client descriptor. + * \returns 0 on success, -EINVAL on error. */ int mgcp_client_next_endpoint(struct mgcp_client *client) { int i; @@ -95,6 +99,9 @@ return -EINVAL; } +/*! Release a seized endpoint ID to make it available again for other calls. + * \param[in] id Endpoint ID + * \param[in,out] client MGCP client descriptor. */ /* Release a seized endpoint id to make it available again for other calls */ void mgcp_client_release_endpoint(uint16_t id, struct mgcp_client *client) { @@ -237,6 +244,9 @@ return NULL; } +/*! Parse body (SDP) parameters of the MGCP response + * \param[in,out] r Response data + * \returns 0 on success, -EINVAL on error. */ int mgcp_response_parse_params(struct mgcp_response *r) { char *line; @@ -498,6 +508,9 @@ return mgcp; } +/*! Initalize client connection (opens socket only, no request is sent yet) + * \param[in,out] mgcp MGCP client descriptor. + * \returns 0 on success, -EINVAL on error. */ int mgcp_client_connect(struct mgcp_client *mgcp) { struct sockaddr_in addr; @@ -543,17 +556,25 @@ return rc; } +/*! Get the IP-Aaddress of the associated MGW as string. + * \param[in] mgcp MGCP client descriptor. + * \returns a pointer to the address string. */ const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp) { return mgcp->actual.remote_addr; } +/*! Get the IP-Port of the associated MGW. + * \param[in] mgcp MGCP client descriptor. + * \returns port number. */ uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp) { return mgcp->actual.remote_port; } -/* Return the MGCP GW binary IPv4 address in network byte order. */ +/*! Get the IP-Aaddress of the associated MGW as its numeric representation. + * \param[in] mgcp MGCP client descriptor. + * \returns IP-Address as 32 bit integer (network byte order) */ uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp) { return mgcp->remote_addr; @@ -626,29 +647,32 @@ return -1; } -/* Cancel a pending transaction. +/*! Cancel a pending transaction. + * \param[in] mgcp MGCP client descriptor. + * \param[in,out] trans_id Transaction id. + * \returns 0 on success, -ENOENT on error. + * * Should a priv pointer passed to mgcp_client_tx() become invalid, this function must be called. In * practical terms, if the caller of mgcp_client_tx() wishes to tear down a transaction without having * received a response this function must be called. The trans_id can be obtained by calling - * mgcp_msg_trans_id() on the msgb produced by mgcp_msg_gen(). - */ + * mgcp_msg_trans_id() on the msgb produced by mgcp_msg_gen(). */ int mgcp_client_cancel(struct mgcp_client *mgcp, mgcp_trans_id_t trans_id) { struct mgcp_response_pending *pending = mgcp_client_response_pending_get(mgcp, trans_id); if (!pending) { - /* INFO is sufficient, it is not harmful to cancel a transaction twice. */ + /*! Note: it is not harmful to cancel a transaction twice. */ LOGP(DLMGCP, LOGL_INFO, "Cannot cancel, no such transaction: %u\n", trans_id); return -ENOENT; } LOGP(DLMGCP, LOGL_INFO, "Canceled transaction %u\n", trans_id); talloc_free(pending); return 0; - /* We don't really need to clean up the wqueue: In all sane cases, the msgb has already been sent - * out and is no longer in the wqueue. If it still is in the wqueue, then sending MGCP messages - * per se is broken and the program should notice so by a full wqueue. Even if this was called - * before we had a chance to send out the message and it is still going to be sent, we will just - * ignore the reply to it later. Removing a msgb from the wqueue here would just introduce more - * bug surface in terms of failing to update wqueue API's counters or some such. + /*! We don't really need to clean up the wqueue: In all sane cases, the msgb has already been sent + * out and is no longer in the wqueue. If it still is in the wqueue, then sending MGCP messages + * per se is broken and the program should notice so by a full wqueue. Even if this was called + * before we had a chance to send out the message and it is still going to be sent, we will just + * ignore the reply to it later. Removing a msgb from the wqueue here would just introduce more + * bug surface in terms of failing to update wqueue API's counters or some such. */ } @@ -763,6 +787,10 @@ #define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) #define MGCP_RSIP_MANDATORY 0 /* none */ +/*! Generate an MGCP message + * \param[in] mgcp MGCP client descriptor. + * \param[in] mgcp_msg Message description + * \returns message buffer on success, NULL on error. */ struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) { mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); @@ -881,12 +909,17 @@ return msg; } -/* Retrieve the MGCP transaction ID from a msgb generated by mgcp_msg_gen() */ +/*! Retrieve the MGCP transaction ID from a msgb generated by mgcp_msg_gen() + * \param[in] msg message buffer + * \returns Transaction id. */ mgcp_trans_id_t mgcp_msg_trans_id(struct msgb *msg) { return (mgcp_trans_id_t)msg->cb[MSGB_CB_MGCP_TRANS_ID]; } +/*! Get the configuration parameters a given MGCP client instance + * \param[in] mgcp MGCP client descriptor. + * \returns configuration */ struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; -- To view, visit https://gerrit.osmocom.org/5937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b8a0652e60f2b3d72ee1cedfa6e2d5547d88455 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Sat Jan 20 15:01:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Jan 2018 15:01:14 +0000 Subject: libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5934/1//COMMIT_MSG Commit Message: Line 16: value, that octets_written is. This then causes the and why is that? strlen() doesn't include any NUL byte, so why is it longer? -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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: Yes From gerrit-no-reply at lists.osmocom.org Sat Jan 20 15:02:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Jan 2018 15:02:22 +0000 Subject: libosmocore[master]: MNCC: Add MNCC to string dumper In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5625 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 20 15:02:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Jan 2018 15:02:28 +0000 Subject: [MERGED] libosmocore[master]: MNCC: Add MNCC to string dumper In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC: Add MNCC to string dumper ...................................................................... MNCC: Add MNCC to string dumper As MNCC is rather hard to debug (wireshark cannot trace UNIX domain sockets), let's add our own decoder that we can use from related debug log statements in the respective programs. Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 --- M include/osmocom/gsm/mncc.h M src/gsm/Makefile.am M src/gsm/libosmogsm.map A src/gsm/mncc.c 4 files changed, 429 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/mncc.h b/include/osmocom/gsm/mncc.h index f2450d9..5ca2986 100644 --- a/include/osmocom/gsm/mncc.h +++ b/include/osmocom/gsm/mncc.h @@ -82,3 +82,12 @@ GSM_MNCC_BCAP_OTHER_ITC = 5, GSM_MNCC_BCAP_RESERVED = 7, }; + +struct msgb; +struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len); + +void _osmo_mncc_log(int subsys, int level, const char *file, int line, const char *prefix, + const uint8_t *msg, unsigned int len); + +#define osmo_mncc_log(ss, level, prefix, msg, len) \ + _osmo_mncc_log(ss, level, __BASE_FILE__, __LINE__, prefix, msg, len); diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am index 12f56db..f85aba3 100644 --- a/src/gsm/Makefile.am +++ b/src/gsm/Makefile.am @@ -30,7 +30,7 @@ milenage/aes-internal.c milenage/aes-internal-enc.c \ milenage/milenage.c gan.c ipa.c gsm0341.c apn.c \ gsup.c gprs_gea.c gsm0503_conv.c oap.c gsm0808_utils.c \ - gsm23003.c + gsm23003.c mncc.c libgsmint_la_LDFLAGS = -no-undefined libgsmint_la_LIBADD = $(top_builddir)/src/libosmocore.la diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 985ec83..9a7073d 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -427,5 +427,8 @@ osmo_imsi_str_valid; osmo_msisdn_str_valid; +osmo_mncc_stringify; +_osmo_mncc_log; + local: *; }; diff --git a/src/gsm/mncc.c b/src/gsm/mncc.c new file mode 100644 index 0000000..fa4726c --- /dev/null +++ b/src/gsm/mncc.c @@ -0,0 +1,416 @@ +/* mncc.c - utility routines for the MNCC API between the 04.08 + * message parsing and the actual Call Control logic */ + +/* (C) 2008-2017 by Harald Welte + * (C) 2009 by Andreas Eversberg + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include "../config.h" + +#ifdef HAVE_SYS_SOCKET_H + +#include +#include +#include +#include +#include + +#include +#include +#include + +/* FIXME FIXME FIXME FIXME FIXME START */ +#define MNCC_SETUP_REQ 0x0101 +#define MNCC_SETUP_IND 0x0102 +#define MNCC_SETUP_RSP 0x0103 +#define MNCC_SETUP_CNF 0x0104 +#define MNCC_SETUP_COMPL_REQ 0x0105 +#define MNCC_SETUP_COMPL_IND 0x0106 +/* MNCC_REJ_* is perfomed via MNCC_REL_* */ +#define MNCC_CALL_CONF_IND 0x0107 +#define MNCC_CALL_PROC_REQ 0x0108 +#define MNCC_PROGRESS_REQ 0x0109 +#define MNCC_ALERT_REQ 0x010a +#define MNCC_ALERT_IND 0x010b +#define MNCC_NOTIFY_REQ 0x010c +#define MNCC_NOTIFY_IND 0x010d +#define MNCC_DISC_REQ 0x010e +#define MNCC_DISC_IND 0x010f +#define MNCC_REL_REQ 0x0110 +#define MNCC_REL_IND 0x0111 +#define MNCC_REL_CNF 0x0112 +#define MNCC_FACILITY_REQ 0x0113 +#define MNCC_FACILITY_IND 0x0114 +#define MNCC_START_DTMF_IND 0x0115 +#define MNCC_START_DTMF_RSP 0x0116 +#define MNCC_START_DTMF_REJ 0x0117 +#define MNCC_STOP_DTMF_IND 0x0118 +#define MNCC_STOP_DTMF_RSP 0x0119 +#define MNCC_MODIFY_REQ 0x011a +#define MNCC_MODIFY_IND 0x011b +#define MNCC_MODIFY_RSP 0x011c +#define MNCC_MODIFY_CNF 0x011d +#define MNCC_MODIFY_REJ 0x011e +#define MNCC_HOLD_IND 0x011f +#define MNCC_HOLD_CNF 0x0120 +#define MNCC_HOLD_REJ 0x0121 +#define MNCC_RETRIEVE_IND 0x0122 +#define MNCC_RETRIEVE_CNF 0x0123 +#define MNCC_RETRIEVE_REJ 0x0124 +#define MNCC_USERINFO_REQ 0x0125 +#define MNCC_USERINFO_IND 0x0126 +#define MNCC_REJ_REQ 0x0127 +#define MNCC_REJ_IND 0x0128 + +#define MNCC_BRIDGE 0x0200 +#define MNCC_FRAME_RECV 0x0201 +#define MNCC_FRAME_DROP 0x0202 +#define MNCC_LCHAN_MODIFY 0x0203 +#define MNCC_RTP_CREATE 0x0204 +#define MNCC_RTP_CONNECT 0x0205 +#define MNCC_RTP_FREE 0x0206 + +#define GSM_TCHF_FRAME 0x0300 +#define GSM_TCHF_FRAME_EFR 0x0301 +#define GSM_TCHH_FRAME 0x0302 +#define GSM_TCH_FRAME_AMR 0x0303 +#define GSM_BAD_FRAME 0x03ff + +#define MNCC_SOCKET_HELLO 0x0400 + +#define GSM_MAX_FACILITY 128 +#define GSM_MAX_SSVERSION 128 +#define GSM_MAX_USERUSER 128 + +#define MNCC_F_BEARER_CAP 0x0001 +#define MNCC_F_CALLED 0x0002 +#define MNCC_F_CALLING 0x0004 +#define MNCC_F_REDIRECTING 0x0008 +#define MNCC_F_CONNECTED 0x0010 +#define MNCC_F_CAUSE 0x0020 +#define MNCC_F_USERUSER 0x0040 +#define MNCC_F_PROGRESS 0x0080 +#define MNCC_F_EMERGENCY 0x0100 +#define MNCC_F_FACILITY 0x0200 +#define MNCC_F_SSVERSION 0x0400 +#define MNCC_F_CCCAP 0x0800 +#define MNCC_F_KEYPAD 0x1000 +#define MNCC_F_SIGNAL 0x2000 + +struct gsm_mncc { + /* context based information */ + uint32_t msg_type; + uint32_t callref; + + /* which fields are present */ + uint32_t fields; + + /* data derived informations (MNCC_F_ based) */ + struct gsm_mncc_bearer_cap bearer_cap; + struct gsm_mncc_number called; + struct gsm_mncc_number calling; + struct gsm_mncc_number redirecting; + struct gsm_mncc_number connected; + struct gsm_mncc_cause cause; + struct gsm_mncc_progress progress; + struct gsm_mncc_useruser useruser; + struct gsm_mncc_facility facility; + struct gsm_mncc_cccap cccap; + struct gsm_mncc_ssversion ssversion; + struct { + int sup; + int inv; + } clir; + int signal; + + /* data derived information, not MNCC_F based */ + int keypad; + int more; + int notify; /* 0..127 */ + int emergency; + char imsi[16]; + + unsigned char lchan_type; + unsigned char lchan_mode; +}; + +struct gsm_data_frame { + uint32_t msg_type; + uint32_t callref; + unsigned char data[0]; +}; + +#define MNCC_SOCK_VERSION 5 +struct gsm_mncc_hello { + uint32_t msg_type; + uint32_t version; + + /* send the sizes of the structs */ + uint32_t mncc_size; + uint32_t data_frame_size; + + /* send some offsets */ + uint32_t called_offset; + uint32_t signal_offset; + uint32_t emergency_offset; + uint32_t lchan_type_offset; +}; + +struct gsm_mncc_rtp { + uint32_t msg_type; + uint32_t callref; + uint32_t ip; + uint16_t port; + uint32_t payload_type; + uint32_t payload_msg_type; +}; + +struct gsm_mncc_bridge { + uint32_t msg_type; + uint32_t callref[2]; +}; + +/* FIXME FIXME FIXME FIXME FIXME END */ + +const struct value_string osmo_mncc_names[] = { + { MNCC_SETUP_REQ, "MNCC_SETUP_REQ" }, + { MNCC_SETUP_IND, "MNCC_SETUP_IND" }, + { MNCC_SETUP_RSP, "MNCC_SETUP_RSP" }, + { MNCC_SETUP_CNF, "MNCC_SETUP_CNF" }, + { MNCC_SETUP_COMPL_REQ, "MNCC_SETUP_COMPL_REQ" }, + { MNCC_SETUP_COMPL_IND, "MNCC_SETUP_COMPL_IND" }, + { MNCC_CALL_CONF_IND, "MNCC_CALL_CONF_IND" }, + { MNCC_CALL_PROC_REQ, "MNCC_CALL_PROC_REQ" }, + { MNCC_PROGRESS_REQ, "MNCC_PROGRESS_REQ" }, + { MNCC_ALERT_REQ, "MNCC_ALERT_REQ" }, + { MNCC_ALERT_IND, "MNCC_ALERT_IND" }, + { MNCC_NOTIFY_REQ, "MNCC_NOTIFY_REQ" }, + { MNCC_NOTIFY_IND, "MNCC_NOTIFY_IND" }, + { MNCC_DISC_REQ, "MNCC_DISC_REQ" }, + { MNCC_DISC_IND, "MNCC_DISC_IND" }, + { MNCC_REL_REQ, "MNCC_REL_REQ" }, + { MNCC_REL_IND, "MNCC_REL_IND" }, + { MNCC_REL_CNF, "MNCC_REL_CNF" }, + { MNCC_FACILITY_REQ, "MNCC_FACILITY_REQ" }, + { MNCC_FACILITY_IND, "MNCC_FACILITY_IND" }, + { MNCC_START_DTMF_IND, "MNCC_START_DTMF_IND" }, + { MNCC_START_DTMF_RSP, "MNCC_START_DTMF_RSP" }, + { MNCC_START_DTMF_REJ, "MNCC_START_DTMF_REJ" }, + { MNCC_STOP_DTMF_IND, "MNCC_STOP_DTMF_IND" }, + { MNCC_STOP_DTMF_RSP, "MNCC_STOP_DTMF_RSP" }, + { MNCC_MODIFY_REQ, "MNCC_MODIFY_REQ" }, + { MNCC_MODIFY_IND, "MNCC_MODIFY_IND" }, + { MNCC_MODIFY_RSP, "MNCC_MODIFY_RSP" }, + { MNCC_MODIFY_CNF, "MNCC_MODIFY_CNF" }, + { MNCC_MODIFY_REJ, "MNCC_MODIFY_REJ" }, + { MNCC_HOLD_IND, "MNCC_HOLD_IND" }, + { MNCC_HOLD_CNF, "MNCC_HOLD_CNF" }, + { MNCC_HOLD_REJ, "MNCC_HOLD_REJ" }, + { MNCC_RETRIEVE_IND, "MNCC_RETRIEVE_IND" }, + { MNCC_RETRIEVE_CNF, "MNCC_RETRIEVE_CNF" }, + { MNCC_RETRIEVE_REJ, "MNCC_RETRIEVE_REJ" }, + { MNCC_USERINFO_REQ, "MNCC_USERINFO_REQ" }, + { MNCC_USERINFO_IND, "MNCC_USERINFO_IND" }, + { MNCC_REJ_REQ, "MNCC_REJ_REQ" }, + { MNCC_REJ_IND, "MNCC_REJ_IND" }, + { MNCC_BRIDGE, "MNCC_BRIDGE" }, + { MNCC_FRAME_RECV, "MNCC_FRAME_RECV" }, + { MNCC_FRAME_DROP, "MNCC_FRAME_DROP" }, + { MNCC_LCHAN_MODIFY, "MNCC_LCHAN_MODIFY" }, + { MNCC_RTP_CREATE, "MNCC_RTP_CREATE" }, + { MNCC_RTP_CONNECT, "MNCC_RTP_CONNECT" }, + { MNCC_RTP_FREE, "MNCC_RTP_FREE" }, + { GSM_TCHF_FRAME, "GSM_TCHF_FRAME" }, + { GSM_TCHF_FRAME_EFR, "GSM_TCHF_FRAME_EFR" }, + { GSM_TCHH_FRAME, "GSM_TCHH_FRAME" }, + { GSM_TCH_FRAME_AMR, "GSM_TCH_FRAME_AMR" }, + { GSM_BAD_FRAME, "GSM_BAD_FRAME" }, + { MNCC_SOCKET_HELLO, "MNCC_SOCKET_HELLO" }, + { 0, NULL }, +}; + +static inline const char *osmo_mncc_name(uint32_t msg_type) { + return get_value_string(osmo_mncc_names, msg_type); +} + +static void mncc_dump_rtp(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_rtp *rtp = (const struct gsm_mncc_rtp *) msg; + struct in_addr ia; + if (len < sizeof(*rtp)) { + msgb_printf(str, "short MNCC RTP message (%u bytes)", len); + return; + } + + ia.s_addr = rtp->ip; + msgb_printf(str, "%s(ref=0x%08x, ip=%s, port=%u, pt=%u, pt_mt=%u)", + osmo_mncc_name(rtp->msg_type), rtp->callref, inet_ntoa(ia), + ntohs(rtp->port), rtp->payload_type, rtp->payload_msg_type); +} + +static void mncc_dump_data(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_data_frame *data = (const struct gsm_data_frame *) msg; + if (len < sizeof(*data)) { + msgb_printf(str, "short MNCC DATA message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ref=0x%08x, data=%s)", osmo_mncc_name(data->msg_type), data->callref, + osmo_hexdump_nospc(data->data, len - sizeof(*data))); +} + +static void mncc_dump_hello(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_hello *hello = (const struct gsm_mncc_hello *) msg; + if (len < sizeof(*hello)) { + msgb_printf(str, "short MNCC HELLO message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ver=%u, mncc_sz=%u, data_size=%u called_off=%u, signal_off=%u, " + "emerg_off=%u, lchan_t_off=%u)\n", osmo_mncc_name(hello->msg_type), + hello->version, hello->mncc_size, hello->data_frame_size, hello->called_offset, + hello->signal_offset, hello->emergency_offset, hello->lchan_type_offset); +} + +static void msg_dump_number(struct msgb *str, const char *pfx, const struct gsm_mncc_number *num) +{ + msgb_printf(str, "%s(%d,%d,%d,%d,%s)", pfx, num->type, num->plan, num->present, num->screen, + num->number); +} + +static void mncc_dump_bridge(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc_bridge *bridge = (const struct gsm_mncc_bridge *)msg; + if (len < sizeof(*bridge)) { + msgb_printf(str, "short MNCC BRIDGE message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(call_a=0x%08x, call_b=0x%08x)", osmo_mncc_name(bridge->msg_type), + bridge->callref[0], bridge->callref[1]); +} + +static void mncc_dump_sign(struct msgb *str, const uint8_t *msg, unsigned int len) +{ + const struct gsm_mncc *sign = (const struct gsm_mncc *) msg; + if (len < sizeof(*sign)) { + msgb_printf(str, "short MNCC SIGN message (%u bytes)", len); + return; + } + + msgb_printf(str, "%s(ref=0x%08x, imsi=%s", osmo_mncc_name(sign->msg_type), sign->callref, + sign->imsi); + //if (sign->fields & MNCC_F_BEARER_CAP) + // msgb_printf(str, ", bcap=%s", osmo_hexdump_nospc()); + if (sign->fields & MNCC_F_CALLED) + msg_dump_number(str, ", called=", &sign->called); + if (sign->fields & MNCC_F_CALLING) + msg_dump_number(str, ", calling=", &sign->calling); + if (sign->fields & MNCC_F_REDIRECTING) + msg_dump_number(str, ", redirecting=", &sign->redirecting); + if (sign->fields & MNCC_F_CONNECTED) + msg_dump_number(str, ", connected=", &sign->connected); + if (sign->fields & MNCC_F_CAUSE) { + msgb_printf(str, ", cause=(%d,%d,%d,%d,%d,'%s')", sign->cause.location, + sign->cause.coding, sign->cause.rec, sign->cause.rec_val, + sign->cause.value, sign->cause.diag_len ? sign->cause.diag : ""); + } + if (sign->fields & MNCC_F_USERUSER) { + msgb_printf(str, ", useruser=(%u, '%s')", sign->useruser.proto, + sign->useruser.info); + } + if (sign->fields & MNCC_F_PROGRESS) { + msgb_printf(str, ", progress=(%d, %d, %d)", sign->progress.coding, + sign->progress.location, sign->progress.descr); + } + if (sign->fields & MNCC_F_EMERGENCY) + msgb_printf(str, ", emergency=%d", sign->emergency); + if (sign->fields & MNCC_F_FACILITY) + msgb_printf(str, ", facility='%s'", sign->facility.info); + if (sign->fields & MNCC_F_SSVERSION) + msgb_printf(str, ", ssversion='%s'", sign->ssversion.info); + if (sign->fields & MNCC_F_CCCAP) + msgb_printf(str, ", cccap=(%d, %d)", sign->cccap.dtmf, sign->cccap.pcp); + if (sign->fields & MNCC_F_KEYPAD) + msgb_printf(str, ", keypad=%d", sign->keypad); + if (sign->fields & MNCC_F_SIGNAL) + msgb_printf(str, ", signal=%d", sign->signal); + + msgb_printf(str, ", clir.sup=%d, clir.inv=%d, more=%d, notify=%d)", sign->clir.sup, + sign->clir.inv, sign->more, sign->notify); + /* lchan_type/lchan_mode? */ +} + + +struct msgb *osmo_mncc_stringify(const uint8_t *msg, unsigned int len) +{ + uint32_t msg_type; + struct msgb *str = msgb_alloc(2048, __func__); + + OSMO_ASSERT(str); + + if (len <= sizeof(msg_type)) { + msgb_printf(str, "short MNCC message (%d bytes)", len); + return NULL; + } + + msg_type = *(const uint32_t *)msg; + switch (msg_type) { + case MNCC_RTP_CREATE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_FREE: + mncc_dump_rtp(str, msg, len); + break; + case GSM_TCHF_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHH_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_BAD_FRAME: + mncc_dump_data(str, msg, len); + break; + case MNCC_SOCKET_HELLO: + mncc_dump_hello(str, msg, len); + break; + case MNCC_BRIDGE: + mncc_dump_bridge(str, msg, len); + break; + default: + mncc_dump_sign(str, msg, len); + break; + } + return str; +} + +void _osmo_mncc_log(int ss, int level, const char *file, int line, const char *prefix, + const uint8_t *msg, unsigned int len) +{ + struct msgb *str; + if (!log_check_level(ss, level)) + return; + + str = osmo_mncc_stringify(msg, len); + if (!str) + return; + + logp2(ss, level, file, line, 0, "%s%s\n", prefix, str->data); + msgb_free(str); +} + +#endif /* HAVE_SYS_SOCKET_H */ -- To view, visit https://gerrit.osmocom.org/5625 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I216aaf70868ba5f3860a60c4b2442957531a3011 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 Sat Jan 20 15:02:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 20 Jan 2018 15:02:41 +0000 Subject: [MERGED] osmo-msc[master]: Store/retrieve SMS validity time in the SMS datebase In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Store/retrieve SMS validity time in the SMS datebase ...................................................................... Store/retrieve SMS validity time in the SMS datebase Compute a validity timestamp based on SMS validity time. Store the computed value in the database and recompute the validity time when an SMS is read from the database. Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568 --- M src/libmsc/db.c 1 file changed, 11 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/db.c b/src/libmsc/db.c index e80ef53..4bf9b1f 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -690,9 +691,7 @@ dbi_result result; char *q_text, *q_daddr, *q_saddr; unsigned char *q_udata; - char *validity_timestamp = "2222-2-2"; - - /* FIXME: generate validity timestamp based on validity_minutes */ + time_t now, validity_timestamp; dbi_conn_quote_string_copy(conn, (char *)sms->text, &q_text); dbi_conn_quote_string_copy(conn, (char *)sms->dst.addr, &q_daddr); @@ -700,7 +699,9 @@ dbi_conn_quote_binary_copy(conn, sms->user_data, sms->user_data_len, &q_udata); - /* FIXME: correct validity period */ + now = time(NULL); + validity_timestamp = now + sms->validity_minutes * 60; + result = dbi_conn_queryf(conn, "INSERT INTO SMS " "(created, valid_until, " @@ -710,14 +711,14 @@ "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " - "(datetime('now'), %u, " + "(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), " "%u, %u, %u, " "%u, %u, %u, " "%u, " "%s, %s, " "%s, %u, %u, " "%s, %u, %u)", - validity_timestamp, + (int64_t)now, (int64_t)validity_timestamp, sms->reply_path_req, sms->status_rep_req, sms->is_report, sms->msg_ref, sms->protocol_id, sms->data_coding_scheme, sms->ud_hdr_ind, @@ -741,15 +742,17 @@ struct gsm_sms *sms = sms_alloc(); const char *text, *daddr, *saddr; const unsigned char *user_data; + time_t validity_timestamp; if (!sms) return NULL; sms->id = dbi_result_get_ulonglong(result, "id"); - /* FIXME: validity */ - /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + sms->validity_minutes = (validity_timestamp - sms->created) / 60; + /* FIXME: those should all be get_uchar, but sqlite3 is braindead */ sms->reply_path_req = dbi_result_get_ulonglong(result, "reply_path_req"); sms->status_rep_req = dbi_result_get_ulonglong(result, "status_rep_req"); sms->is_report = dbi_result_get_ulonglong(result, "is_report"); -- To view, visit https://gerrit.osmocom.org/5875 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id27c250d3a64cd109416450e8ca155b18a8b9568 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 20 15:06:51 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Jan 2018 15:06:51 +0000 Subject: libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5934/1//COMMIT_MSG Commit Message: Line 16: value, that octets_written is. This then causes the > and why is that? strlen() doesn't include any NUL byte, so why is it longer Good question, I'll look closer and update commit msg. You can also check putting a debug printf ;) -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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: Yes From gerrit-no-reply at lists.osmocom.org Sat Jan 20 16:58:45 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 20 Jan 2018 16:58:45 +0000 Subject: [PATCH] libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5934 to look at the new patch set (#2). tests/ussd: prevent uninitialized memory access Previously an incorrect length value was passed to both gsm_7bit_decode_n_ussd() and gsm_7bit_encode_n_ussd() functions during test_7bit_ussd() execution, due to: octets_written = strlen(decoded); The problem is that a 7-bit encoded string takes less memory than its 8-bit equivalent. So, here strlen() returns one-byte bigger value, that octets_written is. This then causes the uninitialized memory access. Found using Valgrind: Conditional jump or move depends on uninitialised value(s) at 0x506DCCC: gsm_7bit_decode_n_ussd (gsm_utils.c:248) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBB7: gsm_7bit_decode_n_hdr (gsm_utils.c:220) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBCB: gsm_septet_lookup (gsm_utils.c:153) by 0x506DBCB: gsm_7bit_decode_n_hdr (gsm_utils.c:224) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c --- M tests/ussd/ussd_test.c 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/5934/2 diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 8d88dbb..429c72d 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -90,8 +90,7 @@ OSMO_ASSERT(strcmp(encoded_hex, osmo_hexdump_nospc(coded, octets_written)) == 0); gsm_7bit_decode_n_ussd(decoded, sizeof(decoded), coded, octets_written * 8 / 7); - octets_written = strlen(decoded); - printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, octets_written)); + printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, strlen(decoded))); OSMO_ASSERT(strncmp(text, decoded, strlen(text)) == 0); OSMO_ASSERT(strcmp(appended_after_decode, decoded + strlen(text)) == 0); -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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 Sat Jan 20 22:28:00 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Sat, 20 Jan 2018 22:28:00 +0000 Subject: [PATCH] osmo-trx[master]: Unbreak `./configure --with-usrp1` build Message-ID: Review at https://gerrit.osmocom.org/5938 Unbreak `./configure --with-usrp1` build Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30 --- M Transceiver52M/Makefile.am M Transceiver52M/USRPDevice.cpp M configure.ac 3 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/38/5938/1 diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 8df2d34..5b5fafa 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -91,12 +91,13 @@ libtransceiver.la \ $(ARCH_LA) \ $(GSM_LA) \ - $(COMMON_LA) + $(COMMON_LA) \ + $(FFTWF_LIBS) if USRP1 libtransceiver_la_SOURCES += USRPDevice.cpp osmo_trx_LDADD += $(USRP_LIBS) else libtransceiver_la_SOURCES += UHDDevice.cpp -osmo_trx_LDADD += $(UHD_LIBS) $(FFTWF_LIBS) +osmo_trx_LDADD += $(UHD_LIBS) endif diff --git a/Transceiver52M/USRPDevice.cpp b/Transceiver52M/USRPDevice.cpp index 034ccd8..e5be58d 100644 --- a/Transceiver52M/USRPDevice.cpp +++ b/Transceiver52M/USRPDevice.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "Logger.h" #include "Threads.h" #include "USRPDevice.h" @@ -599,7 +600,7 @@ #endif RadioDevice *RadioDevice::make(size_t tx_sps, size_t rx_sps, - size_t chans, double) + RadioDevice::InterfaceType, size_t chans, double) { return new USRPDevice(tx_sps); } diff --git a/configure.ac b/configure.ac index 5cee4a6..7d26ced 100644 --- a/configure.ac +++ b/configure.ac @@ -113,7 +113,6 @@ )] ) AC_DEFINE(USE_UHD, 1, All UHD versions) - PKG_CHECK_MODULES(FFTWF, fftw3f) ]) AS_IF([test "x$with_singledb" = "xyes"], [ @@ -160,6 +159,7 @@ AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) PKG_CHECK_MODULES(LIBUSB, libusb-1.0) +PKG_CHECK_MODULES(FFTWF, fftw3f) AC_CHECK_HEADER([boost/config.hpp],[], [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) -- To view, visit https://gerrit.osmocom.org/5938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Alexander Huemer From admin at opensuse.org Sun Jan 21 06:15:45 2018 From: admin at opensuse.org (OBS Notification) Date: Sun, 21 Jan 2018 06:15:45 +0000 Subject: Build failure of network:osmocom:nightly/osmo-pcap in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <5a64302e17c4d_3ff47e8f601192144@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-pcap/Debian_9.0/aarch64 Package network:osmocom:nightly/osmo-pcap failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-pcap Last lines of build log: [ 162s] libncurses.so.5 -> libncurses.so.5.9 [ 162s] libcidn.so.1 -> libcidn-2.24.so [ 162s] libanl.so.1 -> libanl-2.24.so [ 162s] /usr/lib/aarch64-linux-gnu: [ 162s] libdebconfclient.so.0 -> libdebconfclient.so.0.0.0 [ 162s] libpcreposix.so.3 -> libpcreposix.so.3.13.3 [ 162s] libustr-1.0.so.1 -> libustr-1.0.so.1.0.4 [ 162s] libsemanage.so.1 -> libsemanage.so.1 [ 162s] libtic.so.5 -> libtic.so.5.9 [ 162s] libdb-5.3.so -> libdb-5.3.so [ 162s] libsigsegv.so.2 -> libsigsegv.so.2.0.3 [ 162s] libmenu.so.5 -> libmenu.so.5.9 [ 162s] libpanel.so.5 -> libpanel.so.5.9 [ 162s] libperl.so.5.24 -> libperl.so.5.24.1 [ 162s] libform.so.5 -> libform.so.5.9 [ 162s] /usr/lib/aarch64-linux-gnu/libfakeroot: [ 162s] libfakeroot-0.so -> libfakeroot-tcp.so [ 162s] /usr/local/lib: [ 162s] /lib: [ 162s] /usr/lib: [ 163s] [28/199] installing libffi6-3.2.1-6 [28973s] qemu-system-aarch64: terminating on signal 15 from pid 35159 (fuser) [28973s] ### VM INTERACTION END ### [28973s] /var/run/obs/worker/32/build/build-vm: line 913: warning: command substitution: ignored null byte in input [28973s] No buildstatus set, either the base system is broken (kernel/initrd/udev/glibc/bash/perl) [28973s] or the build host has a kernel or hardware problem... Job seems to be stuck here, killed. (after 28800 seconds of inactivity) -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From gerrit-no-reply at lists.osmocom.org Sun Jan 21 11:07:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:07:11 +0000 Subject: osmo-trx[master]: Unbreak `./configure --with-usrp1` build In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 21 11:07:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:07:14 +0000 Subject: [MERGED] osmo-trx[master]: Unbreak `./configure --with-usrp1` build In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Unbreak `./configure --with-usrp1` build ...................................................................... Unbreak `./configure --with-usrp1` build Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30 --- M Transceiver52M/Makefile.am M Transceiver52M/USRPDevice.cpp M configure.ac 3 files changed, 6 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 8df2d34..5b5fafa 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -91,12 +91,13 @@ libtransceiver.la \ $(ARCH_LA) \ $(GSM_LA) \ - $(COMMON_LA) + $(COMMON_LA) \ + $(FFTWF_LIBS) if USRP1 libtransceiver_la_SOURCES += USRPDevice.cpp osmo_trx_LDADD += $(USRP_LIBS) else libtransceiver_la_SOURCES += UHDDevice.cpp -osmo_trx_LDADD += $(UHD_LIBS) $(FFTWF_LIBS) +osmo_trx_LDADD += $(UHD_LIBS) endif diff --git a/Transceiver52M/USRPDevice.cpp b/Transceiver52M/USRPDevice.cpp index 034ccd8..e5be58d 100644 --- a/Transceiver52M/USRPDevice.cpp +++ b/Transceiver52M/USRPDevice.cpp @@ -33,6 +33,7 @@ #include #include #include +#include "Logger.h" #include "Threads.h" #include "USRPDevice.h" @@ -599,7 +600,7 @@ #endif RadioDevice *RadioDevice::make(size_t tx_sps, size_t rx_sps, - size_t chans, double) + RadioDevice::InterfaceType, size_t chans, double) { return new USRPDevice(tx_sps); } diff --git a/configure.ac b/configure.ac index 5cee4a6..7d26ced 100644 --- a/configure.ac +++ b/configure.ac @@ -113,7 +113,6 @@ )] ) AC_DEFINE(USE_UHD, 1, All UHD versions) - PKG_CHECK_MODULES(FFTWF, fftw3f) ]) AS_IF([test "x$with_singledb" = "xyes"], [ @@ -160,6 +159,7 @@ AM_CONDITIONAL(ARCH_ARM_A15, [test "x$with_neon_vfpv4" = "xyes"]) PKG_CHECK_MODULES(LIBUSB, libusb-1.0) +PKG_CHECK_MODULES(FFTWF, fftw3f) AC_CHECK_HEADER([boost/config.hpp],[], [AC_MSG_ERROR([boost/config.hpp not found, install e.g. libboost-dev])]) -- To view, visit https://gerrit.osmocom.org/5938 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I49b385594271ae64a48d4d39ee9fe26d7c95bd30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 11:07:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:07:38 +0000 Subject: openbsc[master]: gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b84e5d87068aba4926d6950b4c419be837bbcc3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Sun Jan 21 11:07:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:07:55 +0000 Subject: openbsc[master]: src/libmsc/ussd.c: drop useless forward declaration In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d804398cfa460eaa5a5f84f0ed90909488d0bdd Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Sun Jan 21 11:08:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:08:19 +0000 Subject: openbsc[master]: gsm_04_80.h: cosmetic: whitespace fix In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ife129bc8b01122444511f6ee52e30cd6367f8593 Gerrit-PatchSet: 1 Gerrit-Project: openbsc 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 Sun Jan 21 11:08:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:08:26 +0000 Subject: [MERGED] openbsc[master]: gsm_04_80.h: cosmetic: whitespace fix In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_04_80.h: cosmetic: whitespace fix ...................................................................... gsm_04_80.h: cosmetic: whitespace fix Change-Id: Ife129bc8b01122444511f6ee52e30cd6367f8593 --- M openbsc/include/openbsc/gsm_04_80.h 1 file changed, 2 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/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index dd699f2..ce1b5c2 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -7,10 +7,10 @@ struct gsm_subscriber_connection; int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, - const struct msgb *in_msg, const char* response_text, + const struct msgb *in_msg, const char* response_text, const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, - const struct msgb *msg, + const struct msgb *msg, const struct ss_request *request); int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, -- To view, visit https://gerrit.osmocom.org/5738 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ife129bc8b01122444511f6ee52e30cd6367f8593 Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Sun Jan 21 11:08:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 11:08:26 +0000 Subject: [MERGED] openbsc[master]: gsm_04_80.h: use '#pragma once' instead of includes In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_04_80.h: use '#pragma once' instead of includes ...................................................................... gsm_04_80.h: use '#pragma once' instead of includes This is a common include guard way for Osmocom projects. Change-Id: I9b84e5d87068aba4926d6950b4c419be837bbcc3 --- M openbsc/include/openbsc/gsm_04_80.h 1 file changed, 1 insertion(+), 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/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index d65f640..dd699f2 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -1,5 +1,4 @@ -#ifndef _GSM_04_80_H -#define _GSM_04_80_H +#pragma once #include #include @@ -21,5 +20,3 @@ int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text); int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); - -#endif -- To view, visit https://gerrit.osmocom.org/5737 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b84e5d87068aba4926d6950b4c419be837bbcc3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc 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 Sun Jan 21 11:43:00 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 21 Jan 2018 11:43:00 +0000 Subject: [MERGED] openbsc[master]: src/libmsc/ussd.c: drop useless forward declaration In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: src/libmsc/ussd.c: drop useless forward declaration ...................................................................... src/libmsc/ussd.c: drop useless forward declaration There is no any significant reason to define static function 'send_own_number' after the code that calls it. Change-Id: I8d804398cfa460eaa5a5f84f0ed90909488d0bdd --- M openbsc/src/libmsc/ussd.c 1 file changed, 10 insertions(+), 13 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c index f12c1f2..488e813 100644 --- a/openbsc/src/libmsc/ussd.c +++ b/openbsc/src/libmsc/ussd.c @@ -37,8 +37,16 @@ /* Declarations of USSD strings to be recognised */ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; -/* Forward declarations of network-specific handler functions */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req); +/* A network-specific handler function */ +static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) +{ + char *own_number = conn->subscr->extension; + char response_string[GSM_EXTENSION_LENGTH + 20]; + + /* Need trailing CR as EOT character */ + snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); + return gsm0480_send_ussd_response(conn, msg, response_string, req); +} /* Entrypoint - handler function common to all mobile-originated USSDs */ @@ -81,15 +89,4 @@ /* check if we can release it */ msc_release_connection(conn); return rc; -} - -/* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) -{ - char *own_number = conn->subscr->extension; - char response_string[GSM_EXTENSION_LENGTH + 20]; - - /* Need trailing CR as EOT character */ - snprintf(response_string, sizeof(response_string), "Your extension is %s\r", own_number); - return gsm0480_send_ussd_response(conn, msg, response_string, req); } -- To view, visit https://gerrit.osmocom.org/5739 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d804398cfa460eaa5a5f84f0ed90909488d0bdd Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 21 17:30:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 17:30:37 +0000 Subject: [PATCH] libusrp[master]: Add contrib/jenkins.sh for jenkins.osmocom.org integration Message-ID: Review at https://gerrit.osmocom.org/5939 Add contrib/jenkins.sh for jenkins.osmocom.org integration Change-Id: Ie186074b338314e560ccf7f87b17dae2617a0966 --- A contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libusrp refs/changes/39/5939/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..57da9fa --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -ex + +autoreconf --install --force +./configure +$MAKE $PARALLEL_MAKE -- To view, visit https://gerrit.osmocom.org/5939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie186074b338314e560ccf7f87b17dae2617a0966 Gerrit-PatchSet: 1 Gerrit-Project: libusrp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 17:31:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 17:31:15 +0000 Subject: libusrp[master]: Add contrib/jenkins.sh for jenkins.osmocom.org integration In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie186074b338314e560ccf7f87b17dae2617a0966 Gerrit-PatchSet: 1 Gerrit-Project: libusrp 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 Jan 21 17:31:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 17:31:16 +0000 Subject: [MERGED] libusrp[master]: Add contrib/jenkins.sh for jenkins.osmocom.org integration In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add contrib/jenkins.sh for jenkins.osmocom.org integration ...................................................................... Add contrib/jenkins.sh for jenkins.osmocom.org integration Change-Id: Ie186074b338314e560ccf7f87b17dae2617a0966 --- A contrib/jenkins.sh 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh new file mode 100755 index 0000000..57da9fa --- /dev/null +++ b/contrib/jenkins.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -ex + +autoreconf --install --force +./configure +$MAKE $PARALLEL_MAKE -- To view, visit https://gerrit.osmocom.org/5939 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie186074b338314e560ccf7f87b17dae2617a0966 Gerrit-PatchSet: 1 Gerrit-Project: libusrp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 17:34:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 17:34:35 +0000 Subject: [PATCH] osmo-ci[master]: jobs: Add {master,gerrit}-libusrp Message-ID: Review at https://gerrit.osmocom.org/5940 jobs: Add {master,gerrit}-libusrp Change-Id: I2b208455b7bd008fb25322280894c100e51f2227 --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/40/5940/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b402ce7..d0df20c 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -55,6 +55,7 @@ fi - libsmpp34 + - libusrp - openbsc: a1_name: SMPP diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 6b34693..ba77514 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -72,6 +72,7 @@ trigger: master-osmo-msc, master-openbsc - libtelnet + - libusrp - openbsc: a1_name: SMPP -- To view, visit https://gerrit.osmocom.org/5940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b208455b7bd008fb25322280894c100e51f2227 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:13 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Add MNCC_Emulation layer (similar to BSSMAP_Emulation) Message-ID: Review at https://gerrit.osmocom.org/5941 Add MNCC_Emulation layer (similar to BSSMAP_Emulation) This allows us to dispatch the MNCC messages to different TTCN3 components, based on the callref of the MNCC message. Change-Id: I2f10df139397da26aaa7961c595cdce141299af0 --- A library/MNCC_Emulation.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 3 files changed, 371 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/5941/1 diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn new file mode 100644 index 0000000..bcf6c0f --- /dev/null +++ b/library/MNCC_Emulation.ttcn @@ -0,0 +1,346 @@ +module MNCC_Emulation { + +/* MNCC Emulation, runs on top of MNCC_CodecPort. It multiplexes/demultiplexes + * the individual calls, so there can be separate TTCN-3 components handling + * each of the calls + * + * The MNCC_Emulation.main() function processes MNCC primitives from the MNCC + * socket via the MNCC_CodecPort, and dispatches them to the per-connection components. + * + * Outbound MNCC connections are initiated by sending a MNCC_Call_Req primitive + * to the component running the MNCC_Emulation.main() function. + * + * For each new inbound connections, the MnccOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + MNCC, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the MNCC emulation. + * + * Inbound Unit Data messages (such as are dispatched to the MnccOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2018 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + +import from Osmocom_Types all; +import from MNCC_CodecPort all; +import from MNCC_Types all; + +/* General "base class" component definition, of which specific implementations + * derive themselves by means of the "extends" feature */ +type component MNCC_ConnHdlr { + /* port towards MNCC Emulator core / call dispatchar */ + port MNCC_Conn_PT MNCC; +} + +/* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ +type enumerated MNCC_Conn_Prim { + /* MNCC tell us that connection was released */ + MNCC_CONN_PRIM_DISC_IND, + /* we tell MNCC to release connection */ + MNCC_CONN_PRIM_DISC_REQ +} + +type record MNCC_Conn_Req { + MNCC_PDU mncc +} + +/* port between individual per-connection components and this dispatcher */ +type port MNCC_Conn_PT message { + inout MNCC_PDU, MNCC_Conn_Prim, MNCC_Conn_Req; +} with { extension "internal" }; + + +/* represents a single MNCC call */ +type record ConnectionData { + /* reference to the instance of the per-connection component */ + MNCC_ConnHdlr comp_ref, + integer mncc_call_id +} + +type component MNCC_Emulation_CT { + /* UNIX DOMAIN socket on the bottom side, using primitives */ + port MNCC_CODEC_PT MNCC; + /* MNCC port to the per-connection clients */ + port MNCC_Conn_PT MNCC_CLIENT; + + /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ + var ConnectionData MnccCallTable[16]; + + /* pending expected incoming connections */ + var ExpectData MnccExpectTable[8]; + /* procedure based port to register for incoming connections */ + port MNCCEM_PROC_PT MNCC_PROC; + + var integer g_mncc_ud_id; +}; + +private function f_call_id_known(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id){ + return true; + } + } + return false; +} + +private function f_comp_known(MNCC_ConnHdlr client) +runs on MNCC_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +/* resolve component reference by connection ID */ +private function f_comp_by_call_id(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id) { + return MnccCallTable[i].comp_ref; + } + } + log("MNCC Call table not found by MNCC Call ID ", mncc_call_id); + setverdict(fail); + self.stop; +} + +/* resolve connection ID by component reference */ +private function f_call_id_by_comp(MNCC_ConnHdlr client) +runs on MNCC_Emulation_CT return integer { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].comp_ref == client) { + return MnccCallTable[i].mncc_call_id; + } + } + log("MNCC Call table not found by component ", client); + setverdict(fail); + self.stop; +} + +private function f_gen_call_id() +runs on MNCC_Emulation_CT return integer { + var uint32_t call_id; + + do { + call_id := float2int(rnd()*4294967296.0); + } while (f_call_id_known(call_id) == true); + + return call_id; +} + +private function f_call_table_init() +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + MnccCallTable[i].comp_ref := null; + MnccCallTable[i].mncc_call_id := -1; + } +} + +private function f_call_table_add(MNCC_ConnHdlr comp_ref, uint32_t mncc_call_id) +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == -1) { + MnccCallTable[i].comp_ref := comp_ref; + MnccCallTable[i].mncc_call_id := mncc_call_id; + log("Added conn table entry ", i, comp_ref, mncc_call_id); + return; + } + } + log("MNCC Call table full!"); + setverdict(fail); + self.stop; +} + +private function f_call_table_del(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id) { + log("Deleted conn table entry ", i, + MnccCallTable[i].comp_ref, mncc_call_id); + MnccCallTable[i].mncc_call_id := -1; + MnccCallTable[i].comp_ref := null; + return + } + } + log("MNCC Call table attempt to delete non-existant ", mncc_call_id); + setverdict(fail); + self.stop; +} + + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function MnccCreateCallback(MNCC_PDU conn_ind, charstring id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr; + +type function MnccUnitdataCallback(MNCC_PDU mncp) +runs on MNCC_Emulation_CT return template MNCC_PDU; + +type record MnccOps { + MnccCreateCallback create_cb, + MnccUnitdataCallback unitdata_cb +} + +function main(MnccOps ops, charstring id) runs on MNCC_Emulation_CT { + + f_call_table_init(); + + while (true) { + var MNCC_send_data sd; + var MNCC_Conn_Req creq; + var MNCC_ConnHdlr vc_conn; + var MNCC_PDU mncc; + var MNCC_ConnHdlr vc_hdlr; + var charstring dest_nr; + + alt { + /* MNCC -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, MNCC_SOCKET_HELLO)) -> value sd { + /* Connectionless Procedures like HELLO */ + var template MNCC_PDU resp; + resp := ops.unitdata_cb.apply(sd.data); + if (isvalue(resp)) { + MNCC.send(t_SD_MNCC(g_mncc_ud_id, resp)); + } + } + + /* MNCC -> Client: Release Indication / confirmation */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, (MNCC_REL_IND, MNCC_REL_CNF))) -> value sd { + var uint32_t call_id := f_mncc_get_call_id(sd.data); + /* forward to respective client */ + vc_conn := f_comp_by_call_id(call_id); + MNCC_CLIENT.send(sd.data) to vc_conn; + /* remove from call table */ + f_call_table_del(call_id); + } + + /* MNCC -> Client: call related messages */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, ?)) -> value sd { + var uint32_t call_id := f_mncc_get_call_id(sd.data); + + if (f_call_id_known(call_id)) { + vc_conn := f_comp_by_call_id(call_id); + MNCC_CLIENT.send(sd.data) to vc_conn; + } else { + /* TODO: Only accept this for SETUP.req? */ + vc_conn := ops.create_cb.apply(sd.data, id) + /* store mapping between client components and SCCP connectionId */ + f_call_table_add(vc_conn, call_id); + /* handle user payload */ + MNCC_CLIENT.send(sd.data) to vc_conn; + } + } + + /* Client -> MNCC Socket: RELEASE.ind or RELEASE.cnf: forward + drop call table entry */ + [] MNCC_CLIENT.receive(MNCC_PDU:{msg_type := (MNCC_REL_IND, MNCC_REL_CNF), u:=?}) -> value mncc sender vc_conn { + var integer call_id := f_call_id_by_comp(vc_conn); + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + /* remove from call table */ + f_call_table_del(call_id); + } + + /* Client -> MNCC Socket: Normal message */ + [] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn { + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + } + + + /* Client -> us: procedure call to register expect */ + [] MNCC_PROC.getcall(MNCCEM_register:{?,?}) -> param(dest_nr, vc_hdlr) { + f_create_expect(dest_nr, vc_hdlr); + MNCC_PROC.reply(MNCCEM_register:{dest_nr, vc_hdlr}); + } + + } + } +} + +private function f_mgcp_ep_extract_cic(charstring inp) return integer { + var charstring local_part := regexp(inp, "(*)@*", 0); + return hex2int(str2hex(local_part)); + +} + +/*********************************************************************** + * "Expect" Handling (mapping for expected incoming MNCC calls from IUT) + ***********************************************************************/ + +/* data about an expected future incoming connection */ +type record ExpectData { + /* destination number based on which we can match it */ + charstring dest_number optional, + /* component reference for this connection */ + MNCC_ConnHdlr vc_conn +} + +/* procedure based port to register for incoming calls */ +signature MNCCEM_register(in charstring dest_nr, in MNCC_ConnHdlr hdlr); + +type port MNCCEM_PROC_PT procedure { + inout MNCCEM_register; +} with { extension "internal" }; + +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function ExpectedCreateCallback(MNCC_PDU conn_ind, charstring id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr { + var MNCC_ConnHdlr ret := null; + var charstring dest_number; + var integer i; + + if (not ischosen(conn_ind.u.signal) or conn_ind.msg_type != MNCC_SETUP_IND) { + setverdict(fail, "MNCC ExpectedCreateCallback needs MNCC_SETUP_IND"); + return ret; + } + dest_number := conn_ind.u.signal.called.number; + + for (i := 0; i < sizeof(MnccExpectTable); i:= i+1) { + if (not ispresent(MnccExpectTable[i].dest_number)) { + continue; + } + if (dest_number == MnccExpectTable[i].dest_number) { + ret := MnccExpectTable[i].vc_conn; + /* release this entry to be used again */ + MnccExpectTable[i].dest_number := omit; + MnccExpectTable[i].vc_conn := null; + log("Found MnccExpect[", i, "] for ", dest_number, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find MnccExpect for incoming call ", dest_number); + return ret; +} + +private function f_create_expect(charstring dest_number, MNCC_ConnHdlr hdlr) +runs on MNCC_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MnccExpectTable); i := i+1) { + if (not ispresent(MnccExpectTable[i].dest_number)) { + MnccExpectTable[i].dest_number := dest_number; + MnccExpectTable[i].vc_conn := hdlr; + log("Created MnccExpect[", i, "] for ", dest_number, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in MnccMnccExpectTable"); +} + + +} diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 6625b11..7703b52 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -19,6 +19,15 @@ FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h" gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src +FILES="Socket_API_Definitions.ttcn" +gen_links $DIR $FILES + +# Required by MGCP and IPA +DIR=$BASEDIR/titan.TestPorts.IPL4asp/src +FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" +gen_links $DIR $FILES + # required by M3UA_Emulation DIR=$BASEDIR/titan.ProtocolModules.M3UA/src FILES="M3UA_Types.ttcn" @@ -52,7 +61,21 @@ FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SDP/src +FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l +SDP_parser.y lex.SDP_parse_.c" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolModules.RTP/src +FILES="RTP_EncDec.cc RTP_Types.ttcn" +gen_links $DIR $FILES + DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h" +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " +FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn " +FILES+="Osmocom_CTRL_Types.ttcn L3_Templates.ttcn L3_Templates.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " +FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index f271c88..ce33695 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/5941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f10df139397da26aaa7961c595cdce141299af0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:13 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler Message-ID: Review at https://gerrit.osmocom.org/5942 BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler ... and pave the way from using it on the other side in MSC testing Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2 --- M bsc/BSC_Tests.ttcn M bsc/BSSAP_Adapter.ttcn 2 files changed, 10 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/5942/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 0080fe0..880b693 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -237,7 +237,11 @@ /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the * MSC-side BSSAP emulation */ - f_bssap_init("VirtMSC", handler_mode); + if (handler_mode) { + f_bssap_init("VirtMSC", MSC_BssmapOps); + } else { + f_bssap_init("VirtMSC", omit); + } f_ipa_ctrl_start(ctrl, mp_bsc_ip, mp_bsc_ctrl_port, 0); for (i := 0; i < nr_bts; i := i+1) { diff --git a/bsc/BSSAP_Adapter.ttcn b/bsc/BSSAP_Adapter.ttcn index 4268b29..98a30d8 100644 --- a/bsc/BSSAP_Adapter.ttcn +++ b/bsc/BSSAP_Adapter.ttcn @@ -24,8 +24,6 @@ import from BSSMAP_Templates all; import from BSSMAP_Emulation all; -import from MSC_ConnectionHandler all; - type component BSSAP_Adapter_CT { /* component references */ var M3UA_CT vc_M3UA; @@ -85,14 +83,14 @@ } -function f_bssap_init(charstring id, boolean handler_mode := false) runs on BSSAP_Adapter_CT +function f_bssap_init(charstring id, template BssmapOps ops) runs on BSSAP_Adapter_CT { init_pars(); /* create components */ vc_M3UA := M3UA_CT.create(id & "-M3UA"); vc_SCCP := SCCP_CT.create(id & "-SCCP"); - if (handler_mode) { + if (isvalue(ops)) { vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); } @@ -100,7 +98,7 @@ /* connect MTP3 service provider (M3UA) to lower side of SCCP */ connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - if (handler_mode) { + if (isvalue(ops)) { connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); } else { /* connect BSSNAP dispatcher to upper side of SCCP */ @@ -109,8 +107,8 @@ vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); vc_SCCP.start(SCCPStart(g_sccp_pars)); - if (handler_mode) { - vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_BssmapOps, "")); + if (isvalue(ops)) { + vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), "")); } } -- To view, visit https://gerrit.osmocom.org/5942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:13 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc test: Abstract out CTRL handling so it can be re-used fr... Message-ID: Review at https://gerrit.osmocom.org/5943 bsc test: Abstract out CTRL handling so it can be re-used from MSC test We create a new Osmocom_CTRL_Adapter module which can be used by test suites using the 'extends' functionality. Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb --- M bsc/BSC_Tests.ttcn M bsc/gen_links.sh A library/Osmocom_CTRL_Adapter.ttcn 3 files changed, 72 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/43/5943/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 880b693..6b5ce24 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -34,6 +34,7 @@ import from Osmocom_CTRL_Functions all; import from Osmocom_CTRL_Types all; +import from Osmocom_CTRL_Adapter all; import from MobileL3_CommonIE_Types all; import from L3_Templates all; @@ -46,42 +47,17 @@ const integer NUM_TCHF_PER_BTS := 5; -/* BSC specific CTRL helper functions */ -function f_ctrl_get_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix) return CtrlValue { - return f_ctrl_get(pt, "bts." & int2str(bts_nr) & "." & suffix); -} - -template charstring ts_bts(integer bts_nr) := "bts." & int2str(bts_nr) & "."; -template charstring ts_bts_trx(integer bts_nr, integer trx_nr ) := - valueof(ts_bts(bts_nr)) & "trx." & int2str(trx_nr) & "."; - -function f_ctrl_get_exp_bts(IPA_CTRL_PT pt, integer bts_nr, CtrlVariable suffix, template CtrlValue exp) { - f_ctrl_get_exp(pt, valueof(ts_bts(bts_nr)) & suffix, exp); -} - -function f_ctrl_get_exp_trx(IPA_CTRL_PT pt, integer bts_nr, integer trx_nr, CtrlVariable suffix, - template CtrlValue exp) -{ - f_ctrl_get_exp(pt, valueof(ts_bts_trx(bts_nr, trx_nr)) & suffix, exp); -} - - /* per-BTS state which we keep */ type record BTS_State { /* component reference to the IPA_Client component used for RSL */ IPA_Client rsl } -type component test_CT extends BSSAP_Adapter_CT { +type component test_CT extends BSSAP_Adapter_CT, CTRL_Adapter_CT { /* Array of per-BTS state */ var BTS_State bts[NUM_BTS]; /* array of per-BTS RSL test ports */ port IPA_RSL_PT IPA_RSL[NUM_BTS]; - - /* component reference to the IPA_Client component used for CTRL to BSC */ - var IPA_Client ctrl; - /* test port for the CTRL interface of the BSC */ - port IPA_CTRL_PT IPA_CTRL; /* are we initialized yet */ var boolean g_initialized := false; @@ -160,30 +136,6 @@ } } -/*! Start the CTRL connection to the specified BSC IP+Port */ -function f_ipa_ctrl_start(inout IPA_Client clnt, charstring bsc_host, PortNumber bsc_port, integer i) -runs on test_CT { - timer T := 10.0; - - clnt.id := "IPA" & int2str(i) & "-CTRL"; - clnt.vc_IPA := IPA_Emulation_CT.create(clnt.id & "-IPA"); - - map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT); - connect(clnt.vc_IPA:IPA_CTRL_PORT, self:IPA_CTRL); - - clnt.vc_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", -1)); - - /* wait for IPA CTRL link to connect and send UP */ - T.start; - alt { - [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } - [] T.timeout { - setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); - self.stop; - } - } -} - /* Wait for the OML connection to be brought up by the external osmo-bts-omldummy */ function f_wait_oml(integer bts_nr, charstring status, float secs_max) runs on test_CT { timer T := secs_max; @@ -242,7 +194,7 @@ } else { f_bssap_init("VirtMSC", omit); } - f_ipa_ctrl_start(ctrl, mp_bsc_ip, mp_bsc_ctrl_port, 0); + f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); for (i := 0; i < nr_bts; i := i+1) { /* wait until osmo-bts-omldummy has respawned */ diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index 14771a7..94bea21 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn new file mode 100644 index 0000000..4cfe739 --- /dev/null +++ b/library/Osmocom_CTRL_Adapter.ttcn @@ -0,0 +1,68 @@ +module Osmocom_CTRL_Adapter { + +/* Module that test suites can 'inherit' in order to have a CTRL connection to the IUT which they're testing */ + +import from IPL4asp_Types all; + +import from IPA_Emulation all; +import from IPA_Types all; + +import from Osmocom_CTRL_Functions all; +import from Osmocom_CTRL_Types all; + + +type component CTRL_Adapter_CT { + var IPA_Emulation_CT vc_CTRL_IPA; + /* test port for the CTRL interface of the BSC */ + port IPA_CTRL_PT IPA_CTRL; +} + + +/*! Start the CTRL connection to the specified BSC IP+Port */ +function f_ipa_ctrl_start(charstring bsc_host, PortNumber bsc_port) +runs on CTRL_Adapter_CT { + var charstring id := "IPA-CTRL" + timer T := 10.0; + + vc_CTRL_IPA := IPA_Emulation_CT.create(id & "-IPA"); + + map(vc_CTRL_IPA:IPA_PORT, system:IPA_CODEC_PT); + connect(vc_CTRL_IPA:IPA_CTRL_PORT, self:IPA_CTRL); + + vc_CTRL_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", -1)); + + /* wait for IPA CTRL link to connect and send UP */ + T.start; + alt { + [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } + [] T.timeout { + setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); + self.stop; + } + } +} + + + + +/* BSC specific CTRL helper functions */ +function f_ctrl_get_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix) return CtrlValue { + return f_ctrl_get(pt, "bts." & int2str(bts_nr) & "." & suffix); +} + +template charstring ts_bts(integer bts_nr) := "bts." & int2str(bts_nr) & "."; +template charstring ts_bts_trx(integer bts_nr, integer trx_nr ) := + valueof(ts_bts(bts_nr)) & "trx." & int2str(trx_nr) & "."; + +function f_ctrl_get_exp_bts(IPA_CTRL_PT pt, integer bts_nr, CtrlVariable suffix, template CtrlValue exp) { + f_ctrl_get_exp(pt, valueof(ts_bts(bts_nr)) & suffix, exp); +} + +function f_ctrl_get_exp_trx(IPA_CTRL_PT pt, integer bts_nr, integer trx_nr, CtrlVariable suffix, + template CtrlValue exp) +{ + f_ctrl_get_exp(pt, valueof(ts_bts_trx(bts_nr, trx_nr)) & suffix, exp); +} + + +} -- To view, visit https://gerrit.osmocom.org/5943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:13 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Move BSSAP_Adapter.ttcn to library so it can be reused Message-ID: Review at https://gerrit.osmocom.org/5944 Move BSSAP_Adapter.ttcn to library so it can be reused Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42 --- M bsc/gen_links.sh R library/BSSAP_Adapter.ttcn 2 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/44/5944/1 diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index 94bea21..01655c0 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES diff --git a/bsc/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn similarity index 100% rename from bsc/BSSAP_Adapter.ttcn rename to library/BSSAP_Adapter.ttcn -- To view, visit https://gerrit.osmocom.org/5944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Add missing procedure port on ConnHdlr side Message-ID: Review at https://gerrit.osmocom.org/5945 BSSMAP_Emulation: Add missing procedure port on ConnHdlr side Change-Id: Ib5ead8beb4e129f7f9c8d4591be2f3aeaeca2912 --- M library/BSSMAP_Emulation.ttcn 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/5945/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 8475d55..14174f8 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -44,6 +44,8 @@ type component BSSAP_ConnHdlr { /* port towards MSC Emulator core / SCCP connection dispatchar */ port BSSAP_Conn_PT BSSAP; + /* procedure based port to register for incoming connections */ + port BSSMAPEM_PROC_PT BSSAP_PROC; } /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/5945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5ead8beb4e129f7f9c8d4591be2f3aeaeca2912 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSAP_Adapter: Always perform BSSMAP Reset on start-up Message-ID: Review at https://gerrit.osmocom.org/5946 BSSAP_Adapter: Always perform BSSMAP Reset on start-up Change-Id: I1f8834be3409348b3a30b1489f5faa4d1c47b086 --- M library/BSSAP_Adapter.ttcn 1 file changed, 13 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/46/5946/1 diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn index 98a30d8..0ebcc3d 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/BSSAP_Adapter.ttcn @@ -98,16 +98,23 @@ /* connect MTP3 service provider (M3UA) to lower side of SCCP */ connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - if (isvalue(ops)) { - connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); - } else { - /* connect BSSNAP dispatcher to upper side of SCCP */ - connect(self:BSSAP, vc_SCCP:SCCP_SP_PORT); - } + /* connect ourselves to upper side of SCCP */ + connect(self:BSSAP, vc_SCCP:SCCP_SP_PORT); vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); vc_SCCP.start(SCCPStart(g_sccp_pars)); + if (isvalue(ops)) { + timer T := 5.0; + T.start; + T.timeout; + /* Perform reset procedure */ + f_bssap_reset(); + /* disconect ourselves */ + disconnect(self:BSSAP, vc_SCCP:SCCP_SP_PORT); + /* connect BSSNAP component to upposer side of SCCP */ + connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); + /* start the BSSMAP emulation */ vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), "")); } } -- To view, visit https://gerrit.osmocom.org/5946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f8834be3409348b3a30b1489f5faa4d1c47b086 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may ... Message-ID: Review at https://gerrit.osmocom.org/5947 BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may be present Change-Id: I98b313e354b31fae8c1fea9e61a838970d575d69 --- M library/BSSMAP_Templates.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/47/5947/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index f452263..2a9cef7 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -107,7 +107,7 @@ template PDU_BSSAP tr_BSSAP_BSSMAP := { discriminator := '0'B, spare := '0000000'B, - dlci := omit, + dlci := *, lengthIndicator := ?, pdu := { bssmap := ? @@ -127,7 +127,7 @@ template PDU_BSSAP tr_BSSAP_DTAP := { discriminator := '1'B, spare := '0000000'B, - dlci := omit, + dlci := *, lengthIndicator := ?, pdu := { dtap := ? -- To view, visit https://gerrit.osmocom.org/5947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I98b313e354b31fae8c1fea9e61a838970d575d69 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP_Types: Templates for UpdateLocation + ISD Message-ID: Review at https://gerrit.osmocom.org/5948 GSUP_Types: Templates for UpdateLocation + ISD Change-Id: If7a5a1159f098645652114e0c36fea98f63f946c --- M library/GSUP_Types.ttcn 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/48/5948/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index fc524a1..95b2cc2 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -147,6 +147,16 @@ tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); +template GSUP_PDU tr_GSUP_UL_REQ(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { + tr_GSUP_IE_IMSI(imsi), * }); + +template GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := + ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); + +template GSUP_PDU tr_GSUP_ISD_REQ(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { + tr_GSUP_IE_IMSI(imsi), * }); template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { -- To view, visit https://gerrit.osmocom.org/5948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7a5a1159f098645652114e0c36fea98f63f946c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Make ts_BSSAP_DTAP usable Message-ID: Review at https://gerrit.osmocom.org/5949 BSSMAP_Templates: Make ts_BSSAP_DTAP usable A send template with '?' is broken. Also, allow caller to specify DTAP payload as well as optionally a DLCI. Change-Id: I641ee8ce5e5ae70b514342cf68cdc79b1926c4d0 --- M library/BSSMAP_Templates.ttcn 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/49/5949/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 2a9cef7..49844e7 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -114,13 +114,13 @@ } } -template PDU_BSSAP ts_BSSAP_DTAP := { +template PDU_BSSAP ts_BSSAP_DTAP(octetstring dtap, template OCT1 dlci := omit) := { discriminator := '1'B, spare := '0000000'B, - dlci := omit, + dlci := dlci, lengthIndicator := 0, /* overwritten by codec */ pdu := { - dtap := ? + dtap := dtap } } -- To view, visit https://gerrit.osmocom.org/5949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I641ee8ce5e5ae70b514342cf68cdc79b1926c4d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Fix + enable ts_CellId_CGI Message-ID: Review at https://gerrit.osmocom.org/5950 BSSMAP_Templates: Fix + enable ts_CellId_CGI Change-Id: Icafe6415b3f896176edcac604a0945e83126db09 --- M library/BSSMAP_Templates.ttcn 1 file changed, 2 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/50/5950/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 49844e7..8227a14 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -200,18 +200,12 @@ type uint16_t BssmapLAC; type uint16_t BssmapCI; -/* -template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci) +template BSSMAP_IE_CellIdentifier ts_CellId_CGI(hexstring mcc, hexstring mnc, BssmapLAC lac, BssmapCI ci) modifies ts_BSSMAP_IE_CellID := { cellIdentification := { - cI_LAC_CGI := { - mnc_mcc := FIXME, - lac := int2oct(lac, 2), - ci := int2oct(ci, 2) - } + cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci) } } -*/ template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) modifies ts_BSSMAP_IE_CellID := { -- To view, visit https://gerrit.osmocom.org/5950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icafe6415b3f896176edcac604a0945e83126db09 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC_Emulation: Make sure to connect to MNCC sokcket at star... Message-ID: Review at https://gerrit.osmocom.org/5951 MNCC_Emulation: Make sure to connect to MNCC sokcket at start of main() Change-Id: I5f72031693915e4b869f8004404d8d6d276fd66c --- M library/MNCC_Emulation.ttcn 1 file changed, 39 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/5951/1 diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index bcf6c0f..b368816 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -33,6 +33,7 @@ import from Osmocom_Types all; import from MNCC_CodecPort all; import from MNCC_Types all; +import from UD_Types all; /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ @@ -183,12 +184,34 @@ } +function f_connect(charstring sock) runs on MNCC_Emulation_CT { + var UD_connect_result res; + timer T := 5.0; + + T.start; + MNCC.send(UD_connect:{sock, -1}); + alt { + [] MNCC.receive(UD_connect_result:?) -> value res { + if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { + setverdict(fail, "Error connecting to MNCC socket", res); + self.stop; + } else { + g_mncc_ud_id := res.id; + } + } + [] T.timeout { + setverdict(fail, "Timeout connecting to MNCC socket"); + self.stop; + } + } +} + /* call-back type, to be provided by specific implementation; called when new SCCP connection * arrives */ type function MnccCreateCallback(MNCC_PDU conn_ind, charstring id) runs on MNCC_Emulation_CT return MNCC_ConnHdlr; -type function MnccUnitdataCallback(MNCC_PDU mncp) +type function MnccUnitdataCallback(MNCC_PDU mncc) runs on MNCC_Emulation_CT return template MNCC_PDU; type record MnccOps { @@ -196,8 +219,9 @@ MnccUnitdataCallback unitdata_cb } -function main(MnccOps ops, charstring id) runs on MNCC_Emulation_CT { +function main(MnccOps ops, charstring id, charstring sock) runs on MNCC_Emulation_CT { + f_connect(sock); f_call_table_init(); while (true) { @@ -328,6 +352,7 @@ return ret; } +/* server/emulation side function to create expect */ private function f_create_expect(charstring dest_number, MNCC_ConnHdlr hdlr) runs on MNCC_Emulation_CT { var integer i; @@ -342,5 +367,17 @@ setverdict(fail, "No space left in MnccMnccExpectTable"); } +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mncc_expect(charstring dest_number) runs on MNCC_ConnHdlr { + MNCC_PROC.call(MNCCEM_register:{dest_number, self}) { + [] MNCC_PROC.getreply(MNCCEM_register:{?,?}) {}; + } +} + +function DummyUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC ", mncc); + return omit; +} } -- To view, visit https://gerrit.osmocom.org/5951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f72031693915e4b869f8004404d8d6d276fd66c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC_Emulation: Add missing procedure port to MNCC_ConnHdlr Message-ID: Review at https://gerrit.osmocom.org/5952 MNCC_Emulation: Add missing procedure port to MNCC_ConnHdlr Change-Id: I775039ffcbeb8223a662e10b40263f9029fddca6 --- M library/MNCC_Emulation.ttcn 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/5952/1 diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index b368816..4bf516d 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -38,8 +38,9 @@ /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ type component MNCC_ConnHdlr { - /* port towards MNCC Emulator core / call dispatchar */ + /* ports towards MNCC Emulator core / call dispatchar */ port MNCC_Conn_PT MNCC; + port MNCCEM_PROC_PT MNCC_PROC; } /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/5952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I775039ffcbeb8223a662e10b40263f9029fddca6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req Message-ID: Review at https://gerrit.osmocom.org/5953 L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req Change-Id: Iad1596a3b80de16a9b0e2d644cf9a0fe2c51ad21 --- M library/L3_Templates.ttcn 1 file changed, 76 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/5953/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 19cb99f..b44ccba 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -14,6 +14,10 @@ import from MobileL3_CommonIE_Types all; import from MobileL3_MM_Types all; import from MobileL3_RRM_Types all; +import from MobileL3_CC_Types all; +//import from MobileL3_GMM_SM_Types all; +//import from MobileL3_SMS_Types all; + type enumerated CmServiceType { CM_TYPE_MO_CALL ('0001'B), @@ -98,6 +102,23 @@ } } +template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + cMServiceReject := { + messageType := '100010'B, + nsd := ?, + rejectCause := rej_cause, + t3246_Value := * + } + } + } +} + /* Send template for PAGING RESPONSE */ template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := { discriminator := '0000'B, /* overwritten */ @@ -151,4 +172,59 @@ } +template PDU_ML3_MS_NW ts_ML3_MO := { + discriminator := '0000'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := ? +} + +template LocationUpdatingType ts_ML3_IE_LuType := { + lut := ?, + spare1_1 := '0'B, + fop := '0'B +} + +template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := { + lut := '00'B +} + +template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := { + lut := '01'B +} + +template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := { + lut := '10'B +} + +template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := { + keySequence := int2bit(cksn, 3), + spare := '0'B +} + +template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai, + MobileIdentityLV mi, MobileStationClassmark1_V cm1) +modifies ts_ML3_MO := { + msgs := { + mm := { + locationUpdateRequest := { + messageType := '001000'B, + nsd := '00'B, /* ? */ + locationUpdatingType := lu_type, + cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0), + locationAreaIdentification := lai, + mobileStationClassmark1 := cm1, + mobileIdentityLV := mi, + classmarkInformationType2_forUMTS := omit, + additionalUpdateParameterTV := omit, + deviceProperties := omit, + mS_NetworkFeatureSupport := omit + } + } + } +} + + + } -- To view, visit https://gerrit.osmocom.org/5953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iad1596a3b80de16a9b0e2d644cf9a0fe2c51ad21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Add new GSUP Emulation module, dispatching GSUP based on IMSI Message-ID: Review at https://gerrit.osmocom.org/5954 Add new GSUP Emulation module, dispatching GSUP based on IMSI Change-Id: I6d06280fa5729ee921d319854a9b11636cf83495 --- A library/GSUP_Emulation.ttcn 1 file changed, 291 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/5954/1 diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn new file mode 100644 index 0000000..e1a515c --- /dev/null +++ b/library/GSUP_Emulation.ttcn @@ -0,0 +1,291 @@ +module GSUP_Emulation { + +/* GSUP Emulation, runs on top of IPA_Emulation. It multiplexes/demultiplexes + * the individual calls, so there can be separate TTCN-3 components handling + * each of the calls + * + * The GSUP_Emulation.main() function processes GSUP primitives from the IPA/GSUP + * socket via the IPA_Emulation, and dispatches them to the per-connection components. + * + * Outbound GSUP connections are initiated by sending a FIXME primitive + * to the component running the GSUP_Emulation.main() function. + * + * For each new inbound connections, the GsupOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + HUL, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the GSUP emulation. + * + * (C) 2018 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + +import from Osmocom_Types all; +import from GSUP_Types all; +import from IPA_Emulation all; + +/* General "base class" component definition, of which specific implementations + * derive themselves by means of the "extends" feature */ +type component GSUP_ConnHdlr { + /* ports towards GSUP Emulator core / call dispatchar */ + port GSUP_Conn_PT GSUP; + port GSUPEM_PROC_PT GSUP_PROC; +} + +/* port between individual per-connection components and this dispatcher */ +type port GSUP_Conn_PT message { + inout GSUP_PDU; +} with { extension "internal" }; + + +/* represents a single GSUP call */ +type record ConnectionData { + /* reference to the instance of the per-connection component */ + GSUP_ConnHdlr comp_ref, + charstring imsi +} + +type component GSUP_Emulation_CT { + /* UNIX DOMAIN socket on the bottom side, using primitives */ + port IPA_GSUP_PT GSUP; + /* GSUP port to the per-connection clients */ + port GSUP_Conn_PT GSUP_CLIENT; + + /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ + var ConnectionData GsupImsiTable[16]; + + /* pending expected incoming connections */ + var ExpectData GsupExpectTable[8]; + /* procedure based port to register for incoming connections */ + port GSUPEM_PROC_PT GSUP_PROC; +}; + +private function f_imsi_known(charstring imsi) +runs on GSUP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == imsi) { + return true; + } + } + return false; +} + +private function f_comp_known(GSUP_ConnHdlr client) +runs on GSUP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +/* resolve component reference by connection ID */ +private function f_comp_by_imsi(charstring imsi) +runs on GSUP_Emulation_CT return GSUP_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == imsi) { + return GsupImsiTable[i].comp_ref; + } + } + log("GSUP IMSI table not found by IMSI ", imsi); + setverdict(fail); + self.stop; +} + +/* resolve connection ID by component reference */ +private function f_imsi_by_comp(GSUP_ConnHdlr client) +runs on GSUP_Emulation_CT return charstring { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].comp_ref == client) { + return GsupImsiTable[i].imsi; + } + } + log("GSUP IMSI table not found by component ", client); + setverdict(fail); + self.stop; +} + +private function f_imsi_table_init() +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + GsupImsiTable[i].comp_ref := null; + GsupImsiTable[i].imsi := ""; + } +} + +private function f_imsi_table_add(GSUP_ConnHdlr comp_ref, charstring imsi) +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == "") { + GsupImsiTable[i].comp_ref := comp_ref; + GsupImsiTable[i].imsi := imsi; + log("Added IMSI table entry ", i, comp_ref, imsi); + return; + } + } + log("GSUP IMSI table full!"); + setverdict(fail); + self.stop; +} + +private function f_imsi_table_del(charstring imsi) +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == imsi) { + log("Deleted GSUP IMSI table entry ", i, + GsupImsiTable[i].comp_ref, imsi); + GsupImsiTable[i].imsi := ""; + GsupImsiTable[i].comp_ref := null; + return + } + } + log("GSUP IMSI table attempt to delete non-existant ", imsi); + setverdict(fail); + self.stop; +} + + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function GsupCreateCallback(GSUP_PDU gsup, charstring id) +runs on GSUP_Emulation_CT return GSUP_ConnHdlr; + +type record GsupOps { + GsupCreateCallback create_cb +} + +function main(GsupOps ops, charstring id) runs on GSUP_Emulation_CT { + + f_imsi_table_init(); + + while (true) { + var GSUP_ConnHdlr vc_conn; + var GSUP_ConnHdlr vc_hdlr; + var GSUP_PDU gsup; + var charstring imsi; + + alt { + + [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_ID_ACK}) { repeat; } + [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_UP}) { repeat; } + [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_DOWN}) { + setverdict(fail, "GSUP Connection Lost"); + self.stop; + } + + /* GSUP -> Client: call related messages */ + [] GSUP.receive(GSUP_PDU:?) -> value gsup { + imsi := hex2str(gsup.ies[0].val.imsi); + + if (f_imsi_known(imsi)) { + vc_conn := f_comp_by_imsi(imsi); + GSUP_CLIENT.send(gsup) to vc_conn; + } else { + /* TODO: Only accept this for SETUP.req? */ + vc_conn := ops.create_cb.apply(gsup, id) + /* store mapping between client components and SCCP connectionId */ + f_imsi_table_add(vc_conn, imsi); + /* handle user payload */ + GSUP_CLIENT.send(gsup) to vc_conn; + } + } + + [] GSUP.receive { repeat; } + + /* Client -> GSUP Socket: Normal message */ + [] GSUP_CLIENT.receive(GSUP_PDU:?) -> value gsup sender vc_conn { + /* forward to GSUP socket */ + GSUP.send(gsup); + } + + + /* Client -> us: procedure call to register expect */ + [] GSUP_PROC.getcall(GSUPEM_register:{?,?}) -> param(imsi, vc_hdlr) { + f_create_expect(imsi, vc_hdlr); + GSUP_PROC.reply(GSUPEM_register:{imsi, vc_hdlr}); + } + + } + } +} + +/*********************************************************************** + * "Expect" Handling (mapping for expected incoming GSUP calls from IUT) + ***********************************************************************/ + +/* data about an expected future incoming connection */ +type record ExpectData { + /* destination number based on which we can match it */ + charstring imsi optional, + /* component reference for this connection */ + GSUP_ConnHdlr vc_conn +} + +/* procedure based port to register for incoming calls */ +signature GSUPEM_register(in charstring imsi, in GSUP_ConnHdlr hdlr); + +type port GSUPEM_PROC_PT procedure { + inout GSUPEM_register; +} with { extension "internal" }; + +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function ExpectedCreateCallback(GSUP_PDU gsup, charstring id) +runs on GSUP_Emulation_CT return GSUP_ConnHdlr { + var GSUP_ConnHdlr ret := null; + var charstring imsi; + var integer i; + + imsi := hex2str(gsup.ies[0].val.imsi); + + for (i := 0; i < sizeof(GsupExpectTable); i:= i+1) { + if (not ispresent(GsupExpectTable[i].imsi)) { + continue; + } + if (imsi == GsupExpectTable[i].imsi) { + ret := GsupExpectTable[i].vc_conn; + /* release this entry to be used again */ + GsupExpectTable[i].imsi := omit; + GsupExpectTable[i].vc_conn := null; + log("Found GsupExpect[", i, "] for ", imsi, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find GsupExpect for incoming imsi ", imsi); + return ret; +} + +/* server/emulation side function to create expect */ +private function f_create_expect(charstring imsi, GSUP_ConnHdlr hdlr) +runs on GSUP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(GsupExpectTable); i := i+1) { + if (not ispresent(GsupExpectTable[i].imsi)) { + GsupExpectTable[i].imsi := imsi; + GsupExpectTable[i].vc_conn := hdlr; + log("Created GsupExpect[", i, "] for ", imsi, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in GsupExpectTable"); +} + +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_gsup_expect(charstring imsi) runs on GSUP_ConnHdlr { + GSUP_PROC.call(GSUPEM_register:{imsi, self}) { + [] GSUP_PROC.getreply(GSUPEM_register:{?,?}) {}; + } +} + +} -- To view, visit https://gerrit.osmocom.org/5954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6d06280fa5729ee921d319854a9b11636cf83495 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... Message-ID: Review at https://gerrit.osmocom.org/5955 MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c --- A msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh 3 files changed, 291 insertions(+), 96 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/5955/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn new file mode 100644 index 0000000..cc3e2e8 --- /dev/null +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -0,0 +1,122 @@ +module BSC_ConnectionHandler { + +import from General_Types all; +import from Osmocom_Types all; +import from GSM_Types all; +import from SCCPasp_Types all; +import from BSSAP_Types all; +import from BSSMAP_Emulation all; +import from BSSMAP_Templates all; + +import from GSUP_Types all; +import from GSUP_Emulation all; + +import from MNCC_Types all; +import from MNCC_Emulation all; + +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from L3_Templates all; + +/* this component represents a single subscriber connection */ +type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { +} + +/* Callback function from general BSSMAP_Emulation whenever a connectionless + * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ +private function BscUnitdataCallback(PDU_BSSAP bssap) +runs on BSSMAP_Emulation_CT return template PDU_BSSAP { + var template PDU_BSSAP resp := omit; + + log("BSSMAP_BscUnitdataCallback"); + /* answer all RESET with RESET ACK */ + if (match(bssap, tr_BSSMAP_Reset)){ + log("BSSMAP_BscUnitdataCallback: Responding to RESET with RESET-ACK"); + resp := ts_BSSMAP_ResetAck; + } + + /* FIXME: Handle paging, etc. */ + return resp; +} + +const BssmapOps BSC_BssmapOps := { + /* Create call-back for inbound connections from MSC (hand-over) */ + create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(BscUnitdataCallback) +} + + +private function MnccUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC", mncc); + return omit; +} + +const MnccOps BCC_MnccOps := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MnccUnitdataCallback) +} + + + +template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { + addr_peer := peer, + addr_own := own, + bssap := bssap +}; + +template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { + rf_PowerCapability := '010'B, + a5_1 := a5_1_unavail, + esind := '1'B, + revisionLevel := rev, + spare1_1 := '0'B +} + +function f_establish_fully(SCCP_PAR_Address sccp_addr_peer, SCCP_PAR_Address sccp_addr_own) +runs on BSC_ConnHdlr { + + var hexstring imsi := '26242012345678'H; + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; + var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23,42)); + var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), + old_lai, mi, valueof(ts_CM1))); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info); + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(imsi)); + + log("Sending COMPL L3", l3_info); + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + BSSAP.send(ts_BSSAP_Conn_Req(sccp_addr_peer, sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(cell_id, l3_enc)))); + + GSUP.receive(tr_GSUP_UL_REQ(imsi)); + GSUP.send(ts_GSUP_UL_RES(imsi)); + +} + +function f_foo() runs on BSC_ConnHdlr{ + /* SCCP CC handled by BSSMAP_Emulation_CT.main() */ + /* Expect auth, if enabled */ + + /* TODO: ISD */ + /* Expect encr, if enabled */ + /* Expect encr, if enabled */ + /* Expect ASS CMD, if chan_type != requested */ + /* Send ASS CMPL in successful case */ + + /* Expect AoIP port/ip information for RTP stream */ + /* Expect MSC-originated MGCP to our simulated MGW */ + /* Verify Counters via CTRL */ + /* re-configure MSC behaviour via VTY */ +} + + + + + +} + + diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index adb9453..de65b0b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -16,112 +16,104 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; +import from Osmocom_CTRL_Functions all; +import from Osmocom_CTRL_Types all; +import from Osmocom_CTRL_Adapter all; + +import from MNCC_Emulation all; + +import from GSUP_Emulation all; +import from IPA_Emulation all; + import from BSSAP_Types all; +import from BSSAP_Adapter all; +import from BSSAP_CodecPort all; +import from BSSMAP_Templates all; +import from BSC_ConnectionHandler all; -type component MTC_CT { - /* M3UA emulation component */ - var M3UA_CT vc_M3UA; - /* SCCP emulation component */ - var SCCP_CT vc_SCCP; - /* test port to SCCP emulation */ - port SCCPasp_PT SCCP; +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from L3_Templates all; - var octetstring g_sio; - var MSC_SCCP_MTP3_parameters g_sccp_pars; - var SCCP_PAR_Address g_sccp_addr_own, g_sccp_addr_peer; +type component MTC_CT extends BSSAP_Adapter_CT, CTRL_Adapter_CT { var boolean g_initialized := false; + + /* no 'adapter_CT' for MNCC or GSUP */ + var MNCC_Emulation_CT vc_MNCC; + var GSUP_Emulation_CT vc_GSUP; + var IPA_Emulation_CT vc_GSUP_IPA; + + /* only to get events from IPA underneath GSUP */ + port IPA_CTRL_PT GSUP_IPA_EVENT; } modulepar { - charstring mp_sccp_service_type := "mtp3_itu"; + /* remote parameters of IUT */ + charstring mp_msc_ip := "127.0.0.1"; + integer mp_msc_ctrl_port := 4255; + integer mp_msc_vty_port := 4254; - SCTP_Association_Address mp_sctp_addr := { 22905, "127.0.0.1", 2905, "127.0.0.1" }; - integer mp_own_pc := 196; - integer mp_own_ssn := 254; + /* local parameters of emulated HLR */ + charstring mp_hlr_ip := "127.0.0.1"; + integer mp_hlr_port := 4222; - integer mp_peer_pc := 185; /* 0.23.1 */ - integer mp_peer_ssn := 254; + charstring mp_msc_mncc := "/tmp/mncc"; } -/* construct a SCCP_PAR_Address with just PC + SSN and no GT */ -template (value) SCCP_PAR_Address ts_SccpAddr_PC_SSN(integer pc, integer ssn) := { - addressIndicator := { - pointCodeIndic := '1'B, - ssnIndicator := '1'B, - globalTitleIndic := '0000'B, - routingIndicator := '1'B - }, - signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, '83'O), - //signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, g_sio), - subsystemNumber := ssn, - globalTitle := omit +function f_init_mncc(charstring id) runs on MTC_CT { + id := id & "-MNCC"; + var MnccOps ops := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MNCC_Emulation.DummyUnitdataCallback) + } + + vc_MNCC := MNCC_Emulation_CT.create(id); + map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); + vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); } -function init_pars() runs on MTC_CT { - g_sio := '83'O; - g_sccp_pars := { - sio := { - ni := substr(oct2bit(g_sio),0,2), - prio := substr(oct2bit(g_sio),2,2), - si := substr(oct2bit(g_sio),4,4) - }, - opc := mp_own_pc, - dpc := mp_peer_pc, - sls := 0, - sccp_serviceType := mp_sccp_service_type, - ssn := mp_own_ssn - }; - g_sccp_addr_own := valueof(ts_SccpAddr_PC_SSN(mp_own_pc, mp_own_ssn)); - g_sccp_addr_peer := valueof(ts_SccpAddr_PC_SSN(mp_peer_pc, mp_peer_ssn)); +function f_init_gsup(charstring id) runs on MTC_CT { + id := id & "-GSUP"; + var GsupOps ops := { + create_cb := refers(GSUP_Emulation.ExpectedCreateCallback) + } + + vc_GSUP_IPA := IPA_Emulation_CT.create(id & "-IPA"); + vc_GSUP := GSUP_Emulation_CT.create(id); + + map(vc_GSUP_IPA:IPA_PORT, system:IPA_CODEC_PT); + connect(vc_GSUP:GSUP, vc_GSUP_IPA:IPA_GSUP_PORT); + /* we use this hack to get events like ASP_IPA_EVENT_UP */ + connect(vc_GSUP_IPA:IPA_CTRL_PORT, self:GSUP_IPA_EVENT); + + vc_GSUP.start(GSUP_Emulation.main(ops, id)); + vc_GSUP_IPA.start(IPA_Emulation.main_server(mp_hlr_ip, mp_hlr_port)); + + /* wait for incoming connection to GSUP port before proceeding */ + timer T := 10.0; + T.start; + alt { + [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } + [] T.timeout { + setverdict(inconc, "No connection to GSUP Port"); + self.stop + } + } } -function init() runs on MTC_CT { +function f_init() runs on MTC_CT { if (g_initialized == true) { return; } g_initialized := true; - init_pars(); - - /* Create components */ - vc_M3UA := M3UA_CT.create; - vc_SCCP := SCCP_CT.create; - - /* connect system SCTP port to M3UA lower side */ - map(vc_M3UA:SCTP_PORT, system:sctp); - - /* connect MTP3 service provider to SCCP MTP3 port */ - connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - - /* connect test suite to SCCP service provider port */ - connect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - - vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); - vc_SCCP.start(SCCPStart(g_sccp_pars)); - -} - -function terminate() runs on MTC_CT { - - disconnect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - disconnect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - unmap(vc_M3UA:SCTP_PORT, system:sctp); - - all component.stop; - - self.stop; -} - -testcase TC_nothing() runs on MTC_CT { - init(); - - timer T := 30.0; - T.start; - T.timeout; - + f_bssap_init("MSC_Test", BSC_BssmapOps); + f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); + f_init_mncc("MSC_Test"); + f_init_gsup("MSC_Test"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -290,30 +282,111 @@ // enc_PDU_BSSAP function f_send_BSSAP_UNITDATA(template PDU_BSSAP bssap) runs on MTC_CT { - SCCP.send(t_ASP_N_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, '00000001'B, '00000001'B, - enc_PDU_BSSAP(valueof(bssap)), omit)) + BSSAP.send(ts_BSSAP_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, bssap)) } -testcase TC_reset() runs on MTC_CT { - init(); +type record BSC_ConnHdlrPars { + SCCP_PAR_Address sccp_addr_own, + SCCP_PAR_Address sccp_addr_peer +}; - timer T := 2.0; +type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; + +/* FIXME: move into BSC_ConnectionHandler? */ +function f_start_handler(void_fn fn, charstring id) runs on MTC_CT return BSC_ConnHdlr { + var BSC_ConnHdlr vc_conn; + var BSC_ConnHdlrPars pars := { + sccp_addr_own := g_sccp_addr_own, + sccp_addr_peer := g_sccp_addr_peer + }; + + vc_conn := BSC_ConnHdlr.create(id); + /* BSSMAP part / A interface */ + connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP_PROC, vc_BSSMAP:PROC); + /* MNCC part */ + connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); + connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); + /* GSUP part */ + connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); + connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + + vc_conn.start(derefers(fn)(id, pars)); + return vc_conn; +} + +function f_sleep(float seconds) { + timer T := seconds; T.start; T.timeout; +} - f_send_BSSAP_UNITDATA(ts_BSSMAP_Reset(0)); +private function f_tc_foo(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_establish_fully(pars.sccp_addr_peer, pars.sccp_addr_own); + f_sleep(30.0); +} + +testcase TC_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + + f_init(); + + vc_conn := f_start_handler(refers(f_tc_foo), testcasename()); + vc_conn.done; +} + + +private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + + var hexstring imsi := '262430000000000'H; + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info); + + log("Sending COMPL L3", l3_info); + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + BSSAP.send(ts_BSSAP_Conn_Req(pars.sccp_addr_peer, pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(cell_id, l3_enc)))); + + var PDU_BSSAP bssap_rx; + var PDU_ML3_NW_MS l3_rx; + + timer T := 10.0; T.start; alt { - //[] SCCP.receive(tr_BSSMAP_ResetAck) { } - [] T.timeout { setverdict(fail); } + [] BSSAP.receive(tr_BSSAP_DTAP) -> value bssap_rx { + l3_rx := dec_PDU_ML3_NW_MS(bssap_rx.pdu.dtap); + if (not match(l3_rx, tr_CM_SERV_REJ)) { + setverdict(fail, "Received unexpeted DTAP/L3"); + } + } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } - terminate(); + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + setverdict(pass); + } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } + } } + +testcase TC_cmserv_imsi_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename()); + vc_conn.done; +} + + control { - execute( TC_reset() ); + execute( TC_cmserv_imsi_unknown() ); execute( TC_nothing() ); } diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 7703b52..ef3dc63 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -73,9 +73,9 @@ DIR=../library FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " -FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn " -FILES+="Osmocom_CTRL_Types.ttcn L3_Templates.ttcn L3_Templates.ttcn " -FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " +FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES -- To view, visit https://gerrit.osmocom.org/5955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Decode DTAP Message-ID: Review at https://gerrit.osmocom.org/5956 BSSMAP_Emulation: Decode DTAP It's quite cumbersome if the user of the BSSMAP_Emulation (the ConnHdlr) will have to manually decode the DTAP in every BSSAP/DTAP message he receives (and encode on the transmit side). Let's introduce a new optional mode in which the DTAP messages are already decoded for more convenient matching inside the ConnHdlr. Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc/MSC_ConnectionHandler.ttcn M library/BSSMAP_Emulation.ttcn 4 files changed, 89 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/5956/1 diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 876d2ec..6efb15b 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -50,7 +50,9 @@ const BssmapOps BSC_MS_BssmapOps := { create_cb := refers(CreateCallback), - unitdata_cb := refers(UnitdataCallback) + unitdata_cb := refers(UnitdataCallback), + decode_dtap := false, + role_ms := true } diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index b038ce5..0a06759 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -56,7 +56,9 @@ const BssmapOps MSC_BssmapOps := { create_cb := refers(CreateCallback), - unitdata_cb := refers(UnitdataCallback) + unitdata_cb := refers(UnitdataCallback), + decode_dtap := false, + role_ms := false } type enumerated MSC_State { diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index f683ef4..39b09f6 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -50,7 +50,9 @@ const BssmapOps MSC_BssmapOps := { create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), - unitdata_cb := refers(UnitdataCallback) + unitdata_cb := refers(UnitdataCallback), + decode_dtap := false, + role_ms := false } type enumerated MSC_State { diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 14174f8..dce8eb0 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -22,7 +22,7 @@ * Inbound Unit Data messages (such as are dispatched to the BssmapOps.unitdata_cb() callback, * which is registered with an argument to the main() function below. * - * (C) 2017 by Harald Welte + * (C) 2017-2018 by Harald Welte * All rights reserved. * * Released under the terms of GNU General Public License, Version 2 or @@ -30,6 +30,7 @@ */ +import from General_Types all; import from SCCP_Emulation all; import from SCCPasp_Types all; import from BSSAP_Types all; @@ -38,6 +39,7 @@ import from MGCP_Types all; import from MGCP_Templates all; import from IPA_Emulation all; +import from MobileL3_Types all; /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ @@ -62,9 +64,42 @@ PDU_BSSAP bssap } +/* similar to PDU_BSSAP with DTAP, but DTAP is already decoded! */ +type record PDU_DTAP_MO { + OCT1 dlci optional, + PDU_ML3_MS_NW dtap +} + +/* similar to PDU_BSSAP with DTAP, but DTAP is already decoded! */ +type record PDU_DTAP_MT { + OCT1 dlci optional, + PDU_ML3_NW_MS dtap +} + +template PDU_DTAP_MT ts_PDU_DTAP_MT(template PDU_ML3_NW_MS dtap, template OCT1 dlci := omit) := { + dlci := dlci, + dtap := dtap +} + +template PDU_DTAP_MO ts_PDU_DTAP_MO(template PDU_ML3_MS_NW dtap, template OCT1 dlci := '00'O) := { + dlci := dlci, + dtap := dtap +} + +template PDU_DTAP_MT tr_PDU_DTAP_MT(template PDU_ML3_NW_MS dtap, template OCT1 dlci := *) := { + dlci := dlci, + dtap := dtap +} + +template PDU_DTAP_MO tr_PDU_DTAP_MO(template PDU_ML3_MS_NW dtap, template OCT1 dlci := *) := { + dlci := dlci, + dtap := dtap +} + + /* port between individual per-connection components and this dispatcher */ type port BSSAP_Conn_PT message { - inout PDU_BSSAP, BSSAP_Conn_Prim, BSSAP_Conn_Req, MgcpCommand, MgcpResponse; + inout PDU_BSSAP, PDU_DTAP_MO, PDU_DTAP_MT, BSSAP_Conn_Prim, BSSAP_Conn_Req, MgcpCommand, MgcpResponse; } with { extension "internal" }; @@ -97,6 +132,7 @@ var charstring g_bssmap_id; var integer g_next_e1_ts := 1; + var BssmapOps g_bssmap_ops; }; private function f_conn_id_known(integer sccp_conn_id) @@ -279,7 +315,25 @@ f_comp_store_cic(client, cic); } - CLIENT.send(bssap) to client; + if (ischosen(bssap.pdu.dtap) and g_bssmap_ops.decode_dtap) { + if (g_bssmap_ops.role_ms) { + /* we are the MS, so any message to us must be MT */ + var PDU_DTAP_MT mt := { + dlci := bssap.dlci, + dtap := dec_PDU_ML3_NW_MS(bssap.pdu.dtap) + }; + CLIENT.send(mt) to client; + } else { + /* we are the Network, so any message to us must be MO */ + var PDU_DTAP_MO mo := { + dlci := bssap.dlci, + dtap := dec_PDU_ML3_MS_NW(bssap.pdu.dtap) + }; + CLIENT.send(mo) to client; + } + } else { + CLIENT.send(bssap) to client; + } } /* call-back type, to be provided by specific implementation; called when new SCCP connection @@ -292,12 +346,15 @@ type record BssmapOps { BssmapCreateCallback create_cb, - BssmapUnitdataCallback unitdata_cb + BssmapUnitdataCallback unitdata_cb, + boolean decode_dtap, + boolean role_ms } function main(BssmapOps ops, charstring id) runs on BSSMAP_Emulation_CT { g_bssmap_id := id; + g_bssmap_ops := ops; f_conn_table_init(); f_expect_table_init(); @@ -310,6 +367,8 @@ var BSSAP_Conn_Req creq; var BSSAP_ConnHdlr vc_conn; var PDU_BSSAP bssap; + var PDU_DTAP_MO dtap_mo; + var PDU_DTAP_MT dtap_mt; var MgcpCommand mgcp_req; var MgcpResponse mgcp_resp; var BSSAP_ConnHdlr vc_hdlr; @@ -402,6 +461,23 @@ BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); } + [g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); + bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); + BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); + } + + [not g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); + bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); + BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); + } + + /* Handling of MGCP in IPA SCCPLite case. This predates 3GPP AoIP * and uses a MGCP session in parallel to BSSAP. BSSAP uses CIC * as usual, and MGCP uses "CIC at mgw" endpoint naming, where CIC -- To view, visit https://gerrit.osmocom.org/5956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: More GSUP and L3 Templates Message-ID: Review at https://gerrit.osmocom.org/5957 More GSUP and L3 Templates Change-Id: I0e9136fc3b8f171934f054ec149d8dd344faa034 --- M library/GSUP_Types.ttcn M library/L3_Templates.ttcn 2 files changed, 102 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/5957/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 95b2cc2..ac85fca 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -154,8 +154,16 @@ template GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); -template GSUP_PDU tr_GSUP_ISD_REQ(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { +template GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := + ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); + +template GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := + ts_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); + +template GSUP_PDU tr_GSUP_ISD_RES(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { tr_GSUP_IE_IMSI(imsi), * }); @@ -181,6 +189,23 @@ } } +template (value) GSUP_IE ts_GSUP_IE_MSISDN(hexstring msisdn) := { + tag := OSMO_GSUP_MSISDN_IE, + len := 0, /* overwritten */ + val := { + msisdn := msisdn + } +} + +template GSUP_IE tr_GSUP_IE_MSISDN(template hexstring msisdn) := { + tag := OSMO_GSUP_MSISDN_IE, + len := ?, + val := { + msisdn := msisdn + } +} + + template (value) GSUP_IE ts_GSUP_IE_Cause(integer cause) := { tag := OSMO_GSUP_CAUSE_IE, len := 0, /* overwritten */ diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index b44ccba..87c9bd9 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -102,6 +102,31 @@ } } +template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { + discriminator := discr, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := ? +} + + +template PDU_ML3_NW_MS tr_CM_SERV_ACC := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + cMServiceAccept := { + messageType := '100001'B, + nsd := ? + } + } + } +} + + template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { discriminator := '0101'B, tiOrSkip := { @@ -225,6 +250,56 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := { + msgs := { + mm := { + tmsiReallocComplete := { + messageType := '011011'B, + nsd := '00'B + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + locationUpdateAccept := { + messageType := '000010'B, + nsd := '00'B, + locationAreaIdentification := ?, + mobileIdentityTLV := *, + followOnProceed := *, + cTS_Permission := *, + equivalentPLMNs := *, + emergencyNumberList := *, + perMS_T3212 := * + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + locationUpdateReject := { + messageType := '000100'B, + nsd := '00'B, + rejectCause := cause, + t3246_Value := * + } + } + } +} + } -- To view, visit https://gerrit.osmocom.org/5957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e9136fc3b8f171934f054ec149d8dd344faa034 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:12:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:12:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc tests: Put everything together; implement first ConnHdlr... Message-ID: Review at https://gerrit.osmocom.org/5958 msc tests: Put everything together; implement first ConnHdlr based tests Change-Id: I0e77af4e8eaa9a8134e45a209b279d86d615d081 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 193 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/5958/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index cc3e2e8..15a460b 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -16,11 +16,22 @@ import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; +import from MobileL3_MM_Types all; import from L3_Templates all; /* this component represents a single subscriber connection */ type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { + var BSC_ConnHdlrPars g_pars; } + +type record BSC_ConnHdlrPars { + SCCP_PAR_Address sccp_addr_own, + SCCP_PAR_Address sccp_addr_peer, + BSSMAP_IE_CellIdentifier cell_id, + hexstring imsi, + hexstring msisdn +}; + /* Callback function from general BSSMAP_Emulation whenever a connectionless * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ @@ -42,7 +53,9 @@ const BssmapOps BSC_BssmapOps := { /* Create call-back for inbound connections from MSC (hand-over) */ create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), - unitdata_cb := refers(BscUnitdataCallback) + unitdata_cb := refers(BscUnitdataCallback), + decode_dtap := true, + role_ms := true } @@ -73,28 +86,94 @@ spare1_1 := '0'B } -function f_establish_fully(SCCP_PAR_Address sccp_addr_peer, SCCP_PAR_Address sccp_addr_own) +/* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ +function f_bssap_compl_l3(PDU_ML3_MS_NW l3) runs on BSC_ConnHdlr { + log("Sending COMPL L3: ", l3); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); +} - var hexstring imsi := '26242012345678'H; +/* helper function to fully establish a dedicated channel */ +function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_DTAP_MT dtap_mt; + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + if (expect_auth) { + /* FIXME */ + } + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); +} + +/* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ +function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW +{ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + return f_build_lu(mi); +} +private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW +{ var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; - var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23,42)); var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), old_lai, mi, valueof(ts_CM1))); - var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info); + return l3_info; +} + +function f_perform_lu(boolean expect_auth, boolean expect_tmsi) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; /* tell GSUP dispatcher to send this IMSI to us */ - f_create_gsup_expect(hex2str(imsi)); + f_create_gsup_expect(hex2str(g_pars.imsi)); - log("Sending COMPL L3", l3_info); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ - BSSAP.send(ts_BSSAP_Conn_Req(sccp_addr_peer, sccp_addr_own, - valueof(ts_BSSMAP_ComplL3(cell_id, l3_enc)))); + f_bssap_compl_l3(l3_lu); - GSUP.receive(tr_GSUP_UL_REQ(imsi)); - GSUP.send(ts_GSUP_UL_RES(imsi)); + if (expect_auth) { + /* FIXME */ + } + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt { + var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept; + if (expect_tmsi) { + if (not ispresent(lu_acc.mobileIdentityTLV) or + not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected TMSI but no TMSI was allocated"); + self.stop; + } else { + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); + } + } else { + if (ispresent(lu_acc.mobileIdentityTLV) and + ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected no TMSI but TMSI was allocated"); + self.stop; + } + } + } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { + setverdict(fail, "Expected LU ACK, but received LU REJ"); + self.stop; + } + } + /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); } function f_foo() runs on BSC_ConnHdlr{ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index de65b0b..272cc71 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -23,12 +23,14 @@ import from MNCC_Emulation all; import from GSUP_Emulation all; +import from GSUP_Types all; import from IPA_Emulation all; import from BSSAP_Types all; import from BSSAP_Adapter all; import from BSSAP_CodecPort all; import from BSSMAP_Templates all; +import from BSSMAP_Emulation all; import from BSC_ConnectionHandler all; import from MobileL3_Types all; @@ -285,19 +287,28 @@ BSSAP.send(ts_BSSAP_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, bssap)) } -type record BSC_ConnHdlrPars { - SCCP_PAR_Address sccp_addr_own, - SCCP_PAR_Address sccp_addr_peer -}; - type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; +function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 15 - lengthof(prefix); + suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ + return prefix & int2hex(suffix, suffix_len); +} + +function f_gen_msisdn(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 12 - lengthof(prefix); + return prefix & int2hex(suffix, suffix_len); +} + /* FIXME: move into BSC_ConnectionHandler? */ -function f_start_handler(void_fn fn, charstring id) runs on MTC_CT return BSC_ConnHdlr { +function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { var BSC_ConnHdlr vc_conn; var BSC_ConnHdlrPars pars := { sccp_addr_own := g_sccp_addr_own, - sccp_addr_peer := g_sccp_addr_peer + sccp_addr_peer := g_sccp_addr_peer, + cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), + imsi := f_gen_imsi('26242'H, imsi_suffix), + msisdn := f_gen_msisdn('491239999'H, imsi_suffix) }; vc_conn := BSC_ConnHdlr.create(id); @@ -321,17 +332,88 @@ T.timeout; } -private function f_tc_foo(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - f_establish_fully(pars.sccp_addr_peer, pars.sccp_addr_own); - f_sleep(30.0); +private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, true); } -testcase TC_nothing() runs on MTC_CT { +testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; - f_init(); - vc_conn := f_start_handler(refers(f_tc_foo), testcasename()); + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); + vc_conn.done; +} + +private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, false); +} + +testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); + vc_conn.done; +} + +/* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ +private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej(int2oct(23,1)))) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); + vc_conn.done; +} + +/* Do LU by IMSI, timeout on GSUP */ +private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + /* Normally the HLR would need to respond here, but we decide to force a timeout here */ + alt { + /* FIXME: Expect specific reject cause */ + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); vc_conn.done; } @@ -339,8 +421,7 @@ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - var hexstring imsi := '262430000000000'H; - var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info); @@ -356,12 +437,8 @@ timer T := 10.0; T.start; alt { - [] BSSAP.receive(tr_BSSAP_DTAP) -> value bssap_rx { - l3_rx := dec_PDU_ML3_NW_MS(bssap_rx.pdu.dtap); - if (not match(l3_rx, tr_CM_SERV_REJ)) { - setverdict(fail, "Received unexpeted DTAP/L3"); - } - } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } + //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } @@ -378,7 +455,7 @@ testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename()); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); vc_conn.done; } @@ -387,7 +464,10 @@ control { execute( TC_cmserv_imsi_unknown() ); - execute( TC_nothing() ); + execute( TC_lu_imsi_noauth_tmsi() ); + //execute( TC_lu_imsi_noauth_notmsi() ); + execute( TC_lu_imsi_reject() ); + execute( TC_lu_imsi_timeout_gsup() ); } -- To view, visit https://gerrit.osmocom.org/5958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e77af4e8eaa9a8134e45a209b279d86d615d081 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:32:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:32:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5955 to look at the new patch set (#2). MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c --- A msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 4 files changed, 472 insertions(+), 96 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/5955/2 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn new file mode 100644 index 0000000..15a460b --- /dev/null +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -0,0 +1,201 @@ +module BSC_ConnectionHandler { + +import from General_Types all; +import from Osmocom_Types all; +import from GSM_Types all; +import from SCCPasp_Types all; +import from BSSAP_Types all; +import from BSSMAP_Emulation all; +import from BSSMAP_Templates all; + +import from GSUP_Types all; +import from GSUP_Emulation all; + +import from MNCC_Types all; +import from MNCC_Emulation all; + +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from MobileL3_MM_Types all; +import from L3_Templates all; + +/* this component represents a single subscriber connection */ +type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { + var BSC_ConnHdlrPars g_pars; +} + +type record BSC_ConnHdlrPars { + SCCP_PAR_Address sccp_addr_own, + SCCP_PAR_Address sccp_addr_peer, + BSSMAP_IE_CellIdentifier cell_id, + hexstring imsi, + hexstring msisdn +}; + + +/* Callback function from general BSSMAP_Emulation whenever a connectionless + * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ +private function BscUnitdataCallback(PDU_BSSAP bssap) +runs on BSSMAP_Emulation_CT return template PDU_BSSAP { + var template PDU_BSSAP resp := omit; + + log("BSSMAP_BscUnitdataCallback"); + /* answer all RESET with RESET ACK */ + if (match(bssap, tr_BSSMAP_Reset)){ + log("BSSMAP_BscUnitdataCallback: Responding to RESET with RESET-ACK"); + resp := ts_BSSMAP_ResetAck; + } + + /* FIXME: Handle paging, etc. */ + return resp; +} + +const BssmapOps BSC_BssmapOps := { + /* Create call-back for inbound connections from MSC (hand-over) */ + create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(BscUnitdataCallback), + decode_dtap := true, + role_ms := true +} + + +private function MnccUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC", mncc); + return omit; +} + +const MnccOps BCC_MnccOps := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MnccUnitdataCallback) +} + + + +template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { + addr_peer := peer, + addr_own := own, + bssap := bssap +}; + +template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { + rf_PowerCapability := '010'B, + a5_1 := a5_1_unavail, + esind := '1'B, + revisionLevel := rev, + spare1_1 := '0'B +} + +/* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ +function f_bssap_compl_l3(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + log("Sending COMPL L3: ", l3); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); +} + +/* helper function to fully establish a dedicated channel */ +function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_DTAP_MT dtap_mt; + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + if (expect_auth) { + /* FIXME */ + } + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); +} + +/* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ +function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + return f_build_lu(mi); +} +private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW +{ + var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; + var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), + old_lai, mi, valueof(ts_CM1))); + return l3_info; +} + +function f_perform_lu(boolean expect_auth, boolean expect_tmsi) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + if (expect_auth) { + /* FIXME */ + } + + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt { + var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept; + if (expect_tmsi) { + if (not ispresent(lu_acc.mobileIdentityTLV) or + not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected TMSI but no TMSI was allocated"); + self.stop; + } else { + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); + } + } else { + if (ispresent(lu_acc.mobileIdentityTLV) and + ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected no TMSI but TMSI was allocated"); + self.stop; + } + } + } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { + setverdict(fail, "Expected LU ACK, but received LU REJ"); + self.stop; + } + } + /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} + +function f_foo() runs on BSC_ConnHdlr{ + /* SCCP CC handled by BSSMAP_Emulation_CT.main() */ + /* Expect auth, if enabled */ + + /* TODO: ISD */ + /* Expect encr, if enabled */ + /* Expect encr, if enabled */ + /* Expect ASS CMD, if chan_type != requested */ + /* Send ASS CMPL in successful case */ + + /* Expect AoIP port/ip information for RTP stream */ + /* Expect MSC-originated MGCP to our simulated MGW */ + /* Verify Counters via CTRL */ + /* re-configure MSC behaviour via VTY */ +} + + + + + +} + + diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index adb9453..e336e9a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -16,112 +16,106 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; +import from Osmocom_CTRL_Functions all; +import from Osmocom_CTRL_Types all; +import from Osmocom_CTRL_Adapter all; + +import from MNCC_Emulation all; + +import from GSUP_Emulation all; +import from GSUP_Types all; +import from IPA_Emulation all; + import from BSSAP_Types all; +import from BSSAP_Adapter all; +import from BSSAP_CodecPort all; +import from BSSMAP_Templates all; +import from BSSMAP_Emulation all; +import from BSC_ConnectionHandler all; -type component MTC_CT { - /* M3UA emulation component */ - var M3UA_CT vc_M3UA; - /* SCCP emulation component */ - var SCCP_CT vc_SCCP; - /* test port to SCCP emulation */ - port SCCPasp_PT SCCP; +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from L3_Templates all; - var octetstring g_sio; - var MSC_SCCP_MTP3_parameters g_sccp_pars; - var SCCP_PAR_Address g_sccp_addr_own, g_sccp_addr_peer; +type component MTC_CT extends BSSAP_Adapter_CT, CTRL_Adapter_CT { var boolean g_initialized := false; + + /* no 'adapter_CT' for MNCC or GSUP */ + var MNCC_Emulation_CT vc_MNCC; + var GSUP_Emulation_CT vc_GSUP; + var IPA_Emulation_CT vc_GSUP_IPA; + + /* only to get events from IPA underneath GSUP */ + port IPA_CTRL_PT GSUP_IPA_EVENT; } modulepar { - charstring mp_sccp_service_type := "mtp3_itu"; + /* remote parameters of IUT */ + charstring mp_msc_ip := "127.0.0.1"; + integer mp_msc_ctrl_port := 4255; + integer mp_msc_vty_port := 4254; - SCTP_Association_Address mp_sctp_addr := { 22905, "127.0.0.1", 2905, "127.0.0.1" }; - integer mp_own_pc := 196; - integer mp_own_ssn := 254; + /* local parameters of emulated HLR */ + charstring mp_hlr_ip := "127.0.0.1"; + integer mp_hlr_port := 4222; - integer mp_peer_pc := 185; /* 0.23.1 */ - integer mp_peer_ssn := 254; + charstring mp_msc_mncc := "/tmp/mncc"; } -/* construct a SCCP_PAR_Address with just PC + SSN and no GT */ -template (value) SCCP_PAR_Address ts_SccpAddr_PC_SSN(integer pc, integer ssn) := { - addressIndicator := { - pointCodeIndic := '1'B, - ssnIndicator := '1'B, - globalTitleIndic := '0000'B, - routingIndicator := '1'B - }, - signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, '83'O), - //signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, g_sio), - subsystemNumber := ssn, - globalTitle := omit +function f_init_mncc(charstring id) runs on MTC_CT { + id := id & "-MNCC"; + var MnccOps ops := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MNCC_Emulation.DummyUnitdataCallback) + } + + vc_MNCC := MNCC_Emulation_CT.create(id); + map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); + vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); } -function init_pars() runs on MTC_CT { - g_sio := '83'O; - g_sccp_pars := { - sio := { - ni := substr(oct2bit(g_sio),0,2), - prio := substr(oct2bit(g_sio),2,2), - si := substr(oct2bit(g_sio),4,4) - }, - opc := mp_own_pc, - dpc := mp_peer_pc, - sls := 0, - sccp_serviceType := mp_sccp_service_type, - ssn := mp_own_ssn - }; - g_sccp_addr_own := valueof(ts_SccpAddr_PC_SSN(mp_own_pc, mp_own_ssn)); - g_sccp_addr_peer := valueof(ts_SccpAddr_PC_SSN(mp_peer_pc, mp_peer_ssn)); +function f_init_gsup(charstring id) runs on MTC_CT { + id := id & "-GSUP"; + var GsupOps ops := { + create_cb := refers(GSUP_Emulation.ExpectedCreateCallback) + } + + vc_GSUP_IPA := IPA_Emulation_CT.create(id & "-IPA"); + vc_GSUP := GSUP_Emulation_CT.create(id); + + map(vc_GSUP_IPA:IPA_PORT, system:IPA_CODEC_PT); + connect(vc_GSUP:GSUP, vc_GSUP_IPA:IPA_GSUP_PORT); + /* we use this hack to get events like ASP_IPA_EVENT_UP */ + connect(vc_GSUP_IPA:IPA_CTRL_PORT, self:GSUP_IPA_EVENT); + + vc_GSUP.start(GSUP_Emulation.main(ops, id)); + vc_GSUP_IPA.start(IPA_Emulation.main_server(mp_hlr_ip, mp_hlr_port)); + + /* wait for incoming connection to GSUP port before proceeding */ + timer T := 10.0; + T.start; + alt { + [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } + [] T.timeout { + setverdict(inconc, "No connection to GSUP Port"); + self.stop + } + } } -function init() runs on MTC_CT { +function f_init() runs on MTC_CT { if (g_initialized == true) { return; } g_initialized := true; - init_pars(); - - /* Create components */ - vc_M3UA := M3UA_CT.create; - vc_SCCP := SCCP_CT.create; - - /* connect system SCTP port to M3UA lower side */ - map(vc_M3UA:SCTP_PORT, system:sctp); - - /* connect MTP3 service provider to SCCP MTP3 port */ - connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - - /* connect test suite to SCCP service provider port */ - connect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - - vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); - vc_SCCP.start(SCCPStart(g_sccp_pars)); - -} - -function terminate() runs on MTC_CT { - - disconnect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - disconnect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - unmap(vc_M3UA:SCTP_PORT, system:sctp); - - all component.stop; - - self.stop; -} - -testcase TC_nothing() runs on MTC_CT { - init(); - - timer T := 30.0; - T.start; - T.timeout; - + f_bssap_init("MSC_Test", BSC_BssmapOps); + f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); + f_init_mncc("MSC_Test"); + f_init_gsup("MSC_Test"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -290,31 +284,189 @@ // enc_PDU_BSSAP function f_send_BSSAP_UNITDATA(template PDU_BSSAP bssap) runs on MTC_CT { - SCCP.send(t_ASP_N_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, '00000001'B, '00000001'B, - enc_PDU_BSSAP(valueof(bssap)), omit)) + BSSAP.send(ts_BSSAP_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, bssap)) } -testcase TC_reset() runs on MTC_CT { - init(); +type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; - timer T := 2.0; +function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 15 - lengthof(prefix); + suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ + return prefix & int2hex(suffix, suffix_len); +} + +function f_gen_msisdn(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 12 - lengthof(prefix); + return prefix & int2hex(suffix, suffix_len); +} + +/* FIXME: move into BSC_ConnectionHandler? */ +function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { + var BSC_ConnHdlr vc_conn; + var BSC_ConnHdlrPars pars := { + sccp_addr_own := g_sccp_addr_own, + sccp_addr_peer := g_sccp_addr_peer, + cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), + imsi := f_gen_imsi('26242'H, imsi_suffix), + msisdn := f_gen_msisdn('491239999'H, imsi_suffix) + }; + + vc_conn := BSC_ConnHdlr.create(id); + /* BSSMAP part / A interface */ + connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP_PROC, vc_BSSMAP:PROC); + /* MNCC part */ + connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); + connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); + /* GSUP part */ + connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); + connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + + vc_conn.start(derefers(fn)(id, pars)); + return vc_conn; +} + +function f_sleep(float seconds) { + timer T := seconds; T.start; T.timeout; +} - f_send_BSSAP_UNITDATA(ts_BSSMAP_Reset(0)); +private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, true); +} + +testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); + vc_conn.done; +} + +private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, false); +} + +testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); + vc_conn.done; +} + +/* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ +private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej(int2oct(23,1)))) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); + vc_conn.done; +} + +/* Do LU by IMSI, timeout on GSUP */ +private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + /* Normally the HLR would need to respond here, but we decide to force a timeout here */ + alt { + /* FIXME: Expect specific reject cause */ + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); + vc_conn.done; +} + + +/* Send CM SERVICE REQ for IMSI that has never performed LU before */ +private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + timer T := 10.0; T.start; alt { - //[] SCCP.receive(tr_BSSMAP_ResetAck) { } - [] T.timeout { setverdict(fail); } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } + //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { + setverdict(fail, "Unexpected GSUP UL REQ"); + } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } - terminate(); + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + setverdict(pass); + } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } + } } +testcase TC_cmserv_imsi_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); + vc_conn.done; +} + + control { - execute( TC_reset() ); - execute( TC_nothing() ); + execute( TC_cmserv_imsi_unknown() ); + execute( TC_lu_imsi_noauth_tmsi() ); + //execute( TC_lu_imsi_noauth_notmsi() ); + execute( TC_lu_imsi_reject() ); + execute( TC_lu_imsi_timeout_gsup() ); } diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 6625b11..ef3dc63 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -19,6 +19,15 @@ FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h" gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src +FILES="Socket_API_Definitions.ttcn" +gen_links $DIR $FILES + +# Required by MGCP and IPA +DIR=$BASEDIR/titan.TestPorts.IPL4asp/src +FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" +gen_links $DIR $FILES + # required by M3UA_Emulation DIR=$BASEDIR/titan.ProtocolModules.M3UA/src FILES="M3UA_Types.ttcn" @@ -52,7 +61,21 @@ FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SDP/src +FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l +SDP_parser.y lex.SDP_parse_.c" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolModules.RTP/src +FILES="RTP_EncDec.cc RTP_Types.ttcn" +gen_links $DIR $FILES + DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h" +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " +FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " +FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " +FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index f271c88..ce33695 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/5955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:32:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:32:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr Message-ID: Review at https://gerrit.osmocom.org/5959 BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc --- M library/BSSMAP_Emulation.ttcn 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/5959/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 8475d55..14174f8 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -44,6 +44,8 @@ type component BSSAP_ConnHdlr { /* port towards MSC Emulator core / SCCP connection dispatchar */ port BSSAP_Conn_PT BSSAP; + /* procedure based port to register for incoming connections */ + port BSSMAPEM_PROC_PT BSSAP_PROC; } /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/5959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:32:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:32:09 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC Message-ID: Review at https://gerrit.osmocom.org/5960 MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC Dispatches MNCC to individual ConnHldr's based on IMSI. Change-Id: I850b49ce6a6c894b413b8905008452ce91d2cdb0 --- A library/MNCC_Emulation.ttcn 1 file changed, 384 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/5960/1 diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn new file mode 100644 index 0000000..4bf516d --- /dev/null +++ b/library/MNCC_Emulation.ttcn @@ -0,0 +1,384 @@ +module MNCC_Emulation { + +/* MNCC Emulation, runs on top of MNCC_CodecPort. It multiplexes/demultiplexes + * the individual calls, so there can be separate TTCN-3 components handling + * each of the calls + * + * The MNCC_Emulation.main() function processes MNCC primitives from the MNCC + * socket via the MNCC_CodecPort, and dispatches them to the per-connection components. + * + * Outbound MNCC connections are initiated by sending a MNCC_Call_Req primitive + * to the component running the MNCC_Emulation.main() function. + * + * For each new inbound connections, the MnccOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + MNCC, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the MNCC emulation. + * + * Inbound Unit Data messages (such as are dispatched to the MnccOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2018 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + +import from Osmocom_Types all; +import from MNCC_CodecPort all; +import from MNCC_Types all; +import from UD_Types all; + +/* General "base class" component definition, of which specific implementations + * derive themselves by means of the "extends" feature */ +type component MNCC_ConnHdlr { + /* ports towards MNCC Emulator core / call dispatchar */ + port MNCC_Conn_PT MNCC; + port MNCCEM_PROC_PT MNCC_PROC; +} + +/* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ +type enumerated MNCC_Conn_Prim { + /* MNCC tell us that connection was released */ + MNCC_CONN_PRIM_DISC_IND, + /* we tell MNCC to release connection */ + MNCC_CONN_PRIM_DISC_REQ +} + +type record MNCC_Conn_Req { + MNCC_PDU mncc +} + +/* port between individual per-connection components and this dispatcher */ +type port MNCC_Conn_PT message { + inout MNCC_PDU, MNCC_Conn_Prim, MNCC_Conn_Req; +} with { extension "internal" }; + + +/* represents a single MNCC call */ +type record ConnectionData { + /* reference to the instance of the per-connection component */ + MNCC_ConnHdlr comp_ref, + integer mncc_call_id +} + +type component MNCC_Emulation_CT { + /* UNIX DOMAIN socket on the bottom side, using primitives */ + port MNCC_CODEC_PT MNCC; + /* MNCC port to the per-connection clients */ + port MNCC_Conn_PT MNCC_CLIENT; + + /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ + var ConnectionData MnccCallTable[16]; + + /* pending expected incoming connections */ + var ExpectData MnccExpectTable[8]; + /* procedure based port to register for incoming connections */ + port MNCCEM_PROC_PT MNCC_PROC; + + var integer g_mncc_ud_id; +}; + +private function f_call_id_known(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id){ + return true; + } + } + return false; +} + +private function f_comp_known(MNCC_ConnHdlr client) +runs on MNCC_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +/* resolve component reference by connection ID */ +private function f_comp_by_call_id(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id) { + return MnccCallTable[i].comp_ref; + } + } + log("MNCC Call table not found by MNCC Call ID ", mncc_call_id); + setverdict(fail); + self.stop; +} + +/* resolve connection ID by component reference */ +private function f_call_id_by_comp(MNCC_ConnHdlr client) +runs on MNCC_Emulation_CT return integer { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].comp_ref == client) { + return MnccCallTable[i].mncc_call_id; + } + } + log("MNCC Call table not found by component ", client); + setverdict(fail); + self.stop; +} + +private function f_gen_call_id() +runs on MNCC_Emulation_CT return integer { + var uint32_t call_id; + + do { + call_id := float2int(rnd()*4294967296.0); + } while (f_call_id_known(call_id) == true); + + return call_id; +} + +private function f_call_table_init() +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + MnccCallTable[i].comp_ref := null; + MnccCallTable[i].mncc_call_id := -1; + } +} + +private function f_call_table_add(MNCC_ConnHdlr comp_ref, uint32_t mncc_call_id) +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == -1) { + MnccCallTable[i].comp_ref := comp_ref; + MnccCallTable[i].mncc_call_id := mncc_call_id; + log("Added conn table entry ", i, comp_ref, mncc_call_id); + return; + } + } + log("MNCC Call table full!"); + setverdict(fail); + self.stop; +} + +private function f_call_table_del(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id) { + log("Deleted conn table entry ", i, + MnccCallTable[i].comp_ref, mncc_call_id); + MnccCallTable[i].mncc_call_id := -1; + MnccCallTable[i].comp_ref := null; + return + } + } + log("MNCC Call table attempt to delete non-existant ", mncc_call_id); + setverdict(fail); + self.stop; +} + + +function f_connect(charstring sock) runs on MNCC_Emulation_CT { + var UD_connect_result res; + timer T := 5.0; + + T.start; + MNCC.send(UD_connect:{sock, -1}); + alt { + [] MNCC.receive(UD_connect_result:?) -> value res { + if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { + setverdict(fail, "Error connecting to MNCC socket", res); + self.stop; + } else { + g_mncc_ud_id := res.id; + } + } + [] T.timeout { + setverdict(fail, "Timeout connecting to MNCC socket"); + self.stop; + } + } +} + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function MnccCreateCallback(MNCC_PDU conn_ind, charstring id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr; + +type function MnccUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU; + +type record MnccOps { + MnccCreateCallback create_cb, + MnccUnitdataCallback unitdata_cb +} + +function main(MnccOps ops, charstring id, charstring sock) runs on MNCC_Emulation_CT { + + f_connect(sock); + f_call_table_init(); + + while (true) { + var MNCC_send_data sd; + var MNCC_Conn_Req creq; + var MNCC_ConnHdlr vc_conn; + var MNCC_PDU mncc; + var MNCC_ConnHdlr vc_hdlr; + var charstring dest_nr; + + alt { + /* MNCC -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, MNCC_SOCKET_HELLO)) -> value sd { + /* Connectionless Procedures like HELLO */ + var template MNCC_PDU resp; + resp := ops.unitdata_cb.apply(sd.data); + if (isvalue(resp)) { + MNCC.send(t_SD_MNCC(g_mncc_ud_id, resp)); + } + } + + /* MNCC -> Client: Release Indication / confirmation */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, (MNCC_REL_IND, MNCC_REL_CNF))) -> value sd { + var uint32_t call_id := f_mncc_get_call_id(sd.data); + /* forward to respective client */ + vc_conn := f_comp_by_call_id(call_id); + MNCC_CLIENT.send(sd.data) to vc_conn; + /* remove from call table */ + f_call_table_del(call_id); + } + + /* MNCC -> Client: call related messages */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, ?)) -> value sd { + var uint32_t call_id := f_mncc_get_call_id(sd.data); + + if (f_call_id_known(call_id)) { + vc_conn := f_comp_by_call_id(call_id); + MNCC_CLIENT.send(sd.data) to vc_conn; + } else { + /* TODO: Only accept this for SETUP.req? */ + vc_conn := ops.create_cb.apply(sd.data, id) + /* store mapping between client components and SCCP connectionId */ + f_call_table_add(vc_conn, call_id); + /* handle user payload */ + MNCC_CLIENT.send(sd.data) to vc_conn; + } + } + + /* Client -> MNCC Socket: RELEASE.ind or RELEASE.cnf: forward + drop call table entry */ + [] MNCC_CLIENT.receive(MNCC_PDU:{msg_type := (MNCC_REL_IND, MNCC_REL_CNF), u:=?}) -> value mncc sender vc_conn { + var integer call_id := f_call_id_by_comp(vc_conn); + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + /* remove from call table */ + f_call_table_del(call_id); + } + + /* Client -> MNCC Socket: Normal message */ + [] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn { + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + } + + + /* Client -> us: procedure call to register expect */ + [] MNCC_PROC.getcall(MNCCEM_register:{?,?}) -> param(dest_nr, vc_hdlr) { + f_create_expect(dest_nr, vc_hdlr); + MNCC_PROC.reply(MNCCEM_register:{dest_nr, vc_hdlr}); + } + + } + } +} + +private function f_mgcp_ep_extract_cic(charstring inp) return integer { + var charstring local_part := regexp(inp, "(*)@*", 0); + return hex2int(str2hex(local_part)); + +} + +/*********************************************************************** + * "Expect" Handling (mapping for expected incoming MNCC calls from IUT) + ***********************************************************************/ + +/* data about an expected future incoming connection */ +type record ExpectData { + /* destination number based on which we can match it */ + charstring dest_number optional, + /* component reference for this connection */ + MNCC_ConnHdlr vc_conn +} + +/* procedure based port to register for incoming calls */ +signature MNCCEM_register(in charstring dest_nr, in MNCC_ConnHdlr hdlr); + +type port MNCCEM_PROC_PT procedure { + inout MNCCEM_register; +} with { extension "internal" }; + +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function ExpectedCreateCallback(MNCC_PDU conn_ind, charstring id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr { + var MNCC_ConnHdlr ret := null; + var charstring dest_number; + var integer i; + + if (not ischosen(conn_ind.u.signal) or conn_ind.msg_type != MNCC_SETUP_IND) { + setverdict(fail, "MNCC ExpectedCreateCallback needs MNCC_SETUP_IND"); + return ret; + } + dest_number := conn_ind.u.signal.called.number; + + for (i := 0; i < sizeof(MnccExpectTable); i:= i+1) { + if (not ispresent(MnccExpectTable[i].dest_number)) { + continue; + } + if (dest_number == MnccExpectTable[i].dest_number) { + ret := MnccExpectTable[i].vc_conn; + /* release this entry to be used again */ + MnccExpectTable[i].dest_number := omit; + MnccExpectTable[i].vc_conn := null; + log("Found MnccExpect[", i, "] for ", dest_number, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find MnccExpect for incoming call ", dest_number); + return ret; +} + +/* server/emulation side function to create expect */ +private function f_create_expect(charstring dest_number, MNCC_ConnHdlr hdlr) +runs on MNCC_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MnccExpectTable); i := i+1) { + if (not ispresent(MnccExpectTable[i].dest_number)) { + MnccExpectTable[i].dest_number := dest_number; + MnccExpectTable[i].vc_conn := hdlr; + log("Created MnccExpect[", i, "] for ", dest_number, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in MnccMnccExpectTable"); +} + +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mncc_expect(charstring dest_number) runs on MNCC_ConnHdlr { + MNCC_PROC.call(MNCCEM_register:{dest_number, self}) { + [] MNCC_PROC.getreply(MNCCEM_register:{?,?}) {}; + } +} + +function DummyUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC ", mncc); + return omit; +} + +} -- To view, visit https://gerrit.osmocom.org/5960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I850b49ce6a6c894b413b8905008452ce91d2cdb0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:33:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:33 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:39 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I850b49ce6a6c894b413b8905008452ce91d2cdb0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:41 +0000 Subject: osmo-ttcn3-hacks[master]: BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:43 +0000 Subject: osmo-ttcn3-hacks[master]: bsc test: Abstract out CTRL handling so it can be re-used fr... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:46 +0000 Subject: osmo-ttcn3-hacks[master]: Move BSSAP_Adapter.ttcn to library so it can be reused In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:48 +0000 Subject: osmo-ttcn3-hacks[master]: BSSAP_Adapter: Always perform BSSMAP Reset on start-up In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f8834be3409348b3a30b1489f5faa4d1c47b086 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:51 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I98b313e354b31fae8c1fea9e61a838970d575d69 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:53 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP_Types: Templates for UpdateLocation + ISD In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7a5a1159f098645652114e0c36fea98f63f946c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:56 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Templates: Make ts_BSSAP_DTAP usable In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I641ee8ce5e5ae70b514342cf68cdc79b1926c4d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:33:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:33:58 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Templates: Fix + enable ts_CellId_CGI In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icafe6415b3f896176edcac604a0945e83126db09 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:34:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:00 +0000 Subject: osmo-ttcn3-hacks[master]: L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iad1596a3b80de16a9b0e2d644cf9a0fe2c51ad21 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:34:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:02 +0000 Subject: osmo-ttcn3-hacks[master]: Add new GSUP Emulation module, dispatching GSUP based on IMSI In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6d06280fa5729ee921d319854a9b11636cf83495 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:34:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:04 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Decode DTAP In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:34:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:05 +0000 Subject: osmo-ttcn3-hacks[master]: More GSUP and L3 Templates In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0e9136fc3b8f171934f054ec149d8dd344faa034 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:34:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:20 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: More GSUP and L3 Templates In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: More GSUP and L3 Templates ...................................................................... More GSUP and L3 Templates Change-Id: I0e9136fc3b8f171934f054ec149d8dd344faa034 --- M library/GSUP_Types.ttcn M library/L3_Templates.ttcn 2 files changed, 102 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 95b2cc2..ac85fca 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -154,8 +154,16 @@ template GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); -template GSUP_PDU tr_GSUP_ISD_REQ(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { +template GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := + ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); + +template GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := + ts_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); + +template GSUP_PDU tr_GSUP_ISD_RES(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { tr_GSUP_IE_IMSI(imsi), * }); @@ -181,6 +189,23 @@ } } +template (value) GSUP_IE ts_GSUP_IE_MSISDN(hexstring msisdn) := { + tag := OSMO_GSUP_MSISDN_IE, + len := 0, /* overwritten */ + val := { + msisdn := msisdn + } +} + +template GSUP_IE tr_GSUP_IE_MSISDN(template hexstring msisdn) := { + tag := OSMO_GSUP_MSISDN_IE, + len := ?, + val := { + msisdn := msisdn + } +} + + template (value) GSUP_IE ts_GSUP_IE_Cause(integer cause) := { tag := OSMO_GSUP_CAUSE_IE, len := 0, /* overwritten */ diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index b44ccba..87c9bd9 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -102,6 +102,31 @@ } } +template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { + discriminator := discr, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := ? +} + + +template PDU_ML3_NW_MS tr_CM_SERV_ACC := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + cMServiceAccept := { + messageType := '100001'B, + nsd := ? + } + } + } +} + + template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { discriminator := '0101'B, tiOrSkip := { @@ -225,6 +250,56 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_TmsiRealloc_Cmpl modifies ts_ML3_MO := { + msgs := { + mm := { + tmsiReallocComplete := { + messageType := '011011'B, + nsd := '00'B + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_LU_Acc := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + locationUpdateAccept := { + messageType := '000010'B, + nsd := '00'B, + locationAreaIdentification := ?, + mobileIdentityTLV := *, + followOnProceed := *, + cTS_Permission := *, + equivalentPLMNs := *, + emergencyNumberList := *, + perMS_T3212 := * + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_LU_Rej(template OCT1 cause := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + locationUpdateReject := { + messageType := '000100'B, + nsd := '00'B, + rejectCause := cause, + t3246_Value := * + } + } + } +} + } -- To view, visit https://gerrit.osmocom.org/5957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e9136fc3b8f171934f054ec149d8dd344faa034 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:20 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Decode DTAP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Emulation: Decode DTAP ...................................................................... BSSMAP_Emulation: Decode DTAP It's quite cumbersome if the user of the BSSMAP_Emulation (the ConnHdlr) will have to manually decode the DTAP in every BSSAP/DTAP message he receives (and encode on the transmit side). Let's introduce a new optional mode in which the DTAP messages are already decoded for more convenient matching inside the ConnHdlr. Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc-nat/MSC_ConnectionHandler.ttcn M bsc/MSC_ConnectionHandler.ttcn M library/BSSMAP_Emulation.ttcn 4 files changed, 89 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 876d2ec..6efb15b 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -50,7 +50,9 @@ const BssmapOps BSC_MS_BssmapOps := { create_cb := refers(CreateCallback), - unitdata_cb := refers(UnitdataCallback) + unitdata_cb := refers(UnitdataCallback), + decode_dtap := false, + role_ms := true } diff --git a/bsc-nat/MSC_ConnectionHandler.ttcn b/bsc-nat/MSC_ConnectionHandler.ttcn index b038ce5..0a06759 100644 --- a/bsc-nat/MSC_ConnectionHandler.ttcn +++ b/bsc-nat/MSC_ConnectionHandler.ttcn @@ -56,7 +56,9 @@ const BssmapOps MSC_BssmapOps := { create_cb := refers(CreateCallback), - unitdata_cb := refers(UnitdataCallback) + unitdata_cb := refers(UnitdataCallback), + decode_dtap := false, + role_ms := false } type enumerated MSC_State { diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index f683ef4..39b09f6 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -50,7 +50,9 @@ const BssmapOps MSC_BssmapOps := { create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), - unitdata_cb := refers(UnitdataCallback) + unitdata_cb := refers(UnitdataCallback), + decode_dtap := false, + role_ms := false } type enumerated MSC_State { diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 14174f8..dce8eb0 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -22,7 +22,7 @@ * Inbound Unit Data messages (such as are dispatched to the BssmapOps.unitdata_cb() callback, * which is registered with an argument to the main() function below. * - * (C) 2017 by Harald Welte + * (C) 2017-2018 by Harald Welte * All rights reserved. * * Released under the terms of GNU General Public License, Version 2 or @@ -30,6 +30,7 @@ */ +import from General_Types all; import from SCCP_Emulation all; import from SCCPasp_Types all; import from BSSAP_Types all; @@ -38,6 +39,7 @@ import from MGCP_Types all; import from MGCP_Templates all; import from IPA_Emulation all; +import from MobileL3_Types all; /* General "base class" component definition, of which specific implementations * derive themselves by means of the "extends" feature */ @@ -62,9 +64,42 @@ PDU_BSSAP bssap } +/* similar to PDU_BSSAP with DTAP, but DTAP is already decoded! */ +type record PDU_DTAP_MO { + OCT1 dlci optional, + PDU_ML3_MS_NW dtap +} + +/* similar to PDU_BSSAP with DTAP, but DTAP is already decoded! */ +type record PDU_DTAP_MT { + OCT1 dlci optional, + PDU_ML3_NW_MS dtap +} + +template PDU_DTAP_MT ts_PDU_DTAP_MT(template PDU_ML3_NW_MS dtap, template OCT1 dlci := omit) := { + dlci := dlci, + dtap := dtap +} + +template PDU_DTAP_MO ts_PDU_DTAP_MO(template PDU_ML3_MS_NW dtap, template OCT1 dlci := '00'O) := { + dlci := dlci, + dtap := dtap +} + +template PDU_DTAP_MT tr_PDU_DTAP_MT(template PDU_ML3_NW_MS dtap, template OCT1 dlci := *) := { + dlci := dlci, + dtap := dtap +} + +template PDU_DTAP_MO tr_PDU_DTAP_MO(template PDU_ML3_MS_NW dtap, template OCT1 dlci := *) := { + dlci := dlci, + dtap := dtap +} + + /* port between individual per-connection components and this dispatcher */ type port BSSAP_Conn_PT message { - inout PDU_BSSAP, BSSAP_Conn_Prim, BSSAP_Conn_Req, MgcpCommand, MgcpResponse; + inout PDU_BSSAP, PDU_DTAP_MO, PDU_DTAP_MT, BSSAP_Conn_Prim, BSSAP_Conn_Req, MgcpCommand, MgcpResponse; } with { extension "internal" }; @@ -97,6 +132,7 @@ var charstring g_bssmap_id; var integer g_next_e1_ts := 1; + var BssmapOps g_bssmap_ops; }; private function f_conn_id_known(integer sccp_conn_id) @@ -279,7 +315,25 @@ f_comp_store_cic(client, cic); } - CLIENT.send(bssap) to client; + if (ischosen(bssap.pdu.dtap) and g_bssmap_ops.decode_dtap) { + if (g_bssmap_ops.role_ms) { + /* we are the MS, so any message to us must be MT */ + var PDU_DTAP_MT mt := { + dlci := bssap.dlci, + dtap := dec_PDU_ML3_NW_MS(bssap.pdu.dtap) + }; + CLIENT.send(mt) to client; + } else { + /* we are the Network, so any message to us must be MO */ + var PDU_DTAP_MO mo := { + dlci := bssap.dlci, + dtap := dec_PDU_ML3_MS_NW(bssap.pdu.dtap) + }; + CLIENT.send(mo) to client; + } + } else { + CLIENT.send(bssap) to client; + } } /* call-back type, to be provided by specific implementation; called when new SCCP connection @@ -292,12 +346,15 @@ type record BssmapOps { BssmapCreateCallback create_cb, - BssmapUnitdataCallback unitdata_cb + BssmapUnitdataCallback unitdata_cb, + boolean decode_dtap, + boolean role_ms } function main(BssmapOps ops, charstring id) runs on BSSMAP_Emulation_CT { g_bssmap_id := id; + g_bssmap_ops := ops; f_conn_table_init(); f_expect_table_init(); @@ -310,6 +367,8 @@ var BSSAP_Conn_Req creq; var BSSAP_ConnHdlr vc_conn; var PDU_BSSAP bssap; + var PDU_DTAP_MO dtap_mo; + var PDU_DTAP_MT dtap_mt; var MgcpCommand mgcp_req; var MgcpResponse mgcp_resp; var BSSAP_ConnHdlr vc_hdlr; @@ -402,6 +461,23 @@ BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); } + [g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MO:?) -> value dtap_mo sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_MS_NW(dtap_mo.dtap); + bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); + BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); + } + + [not g_bssmap_ops.role_ms] CLIENT.receive(PDU_DTAP_MT:?) -> value dtap_mt sender vc_conn { + var integer conn_id := f_conn_id_by_comp(vc_conn); + /* convert from decoded DTAP to encoded DTAP */ + var octetstring l3_enc := enc_PDU_ML3_NW_MS(dtap_mt.dtap); + bssap := valueof(ts_BSSAP_DTAP(l3_enc, dtap_mo.dlci)); + BSSAP.send(ts_BSSAP_DATA_req(conn_id, bssap)); + } + + /* Handling of MGCP in IPA SCCPLite case. This predates 3GPP AoIP * and uses a MGCP session in parallel to BSSAP. BSSAP uses CIC * as usual, and MGCP uses "CIC at mgw" endpoint naming, where CIC -- To view, visit https://gerrit.osmocom.org/5956 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I35cd4ea78aca0ce7c7d745e082d7289882c11e81 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:20 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Add new GSUP Emulation module, dispatching GSUP based on IMSI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add new GSUP Emulation module, dispatching GSUP based on IMSI ...................................................................... Add new GSUP Emulation module, dispatching GSUP based on IMSI Change-Id: I6d06280fa5729ee921d319854a9b11636cf83495 --- A library/GSUP_Emulation.ttcn 1 file changed, 291 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn new file mode 100644 index 0000000..e1a515c --- /dev/null +++ b/library/GSUP_Emulation.ttcn @@ -0,0 +1,291 @@ +module GSUP_Emulation { + +/* GSUP Emulation, runs on top of IPA_Emulation. It multiplexes/demultiplexes + * the individual calls, so there can be separate TTCN-3 components handling + * each of the calls + * + * The GSUP_Emulation.main() function processes GSUP primitives from the IPA/GSUP + * socket via the IPA_Emulation, and dispatches them to the per-connection components. + * + * Outbound GSUP connections are initiated by sending a FIXME primitive + * to the component running the GSUP_Emulation.main() function. + * + * For each new inbound connections, the GsupOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + HUL, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the GSUP emulation. + * + * (C) 2018 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + +import from Osmocom_Types all; +import from GSUP_Types all; +import from IPA_Emulation all; + +/* General "base class" component definition, of which specific implementations + * derive themselves by means of the "extends" feature */ +type component GSUP_ConnHdlr { + /* ports towards GSUP Emulator core / call dispatchar */ + port GSUP_Conn_PT GSUP; + port GSUPEM_PROC_PT GSUP_PROC; +} + +/* port between individual per-connection components and this dispatcher */ +type port GSUP_Conn_PT message { + inout GSUP_PDU; +} with { extension "internal" }; + + +/* represents a single GSUP call */ +type record ConnectionData { + /* reference to the instance of the per-connection component */ + GSUP_ConnHdlr comp_ref, + charstring imsi +} + +type component GSUP_Emulation_CT { + /* UNIX DOMAIN socket on the bottom side, using primitives */ + port IPA_GSUP_PT GSUP; + /* GSUP port to the per-connection clients */ + port GSUP_Conn_PT GSUP_CLIENT; + + /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ + var ConnectionData GsupImsiTable[16]; + + /* pending expected incoming connections */ + var ExpectData GsupExpectTable[8]; + /* procedure based port to register for incoming connections */ + port GSUPEM_PROC_PT GSUP_PROC; +}; + +private function f_imsi_known(charstring imsi) +runs on GSUP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == imsi) { + return true; + } + } + return false; +} + +private function f_comp_known(GSUP_ConnHdlr client) +runs on GSUP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +/* resolve component reference by connection ID */ +private function f_comp_by_imsi(charstring imsi) +runs on GSUP_Emulation_CT return GSUP_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == imsi) { + return GsupImsiTable[i].comp_ref; + } + } + log("GSUP IMSI table not found by IMSI ", imsi); + setverdict(fail); + self.stop; +} + +/* resolve connection ID by component reference */ +private function f_imsi_by_comp(GSUP_ConnHdlr client) +runs on GSUP_Emulation_CT return charstring { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].comp_ref == client) { + return GsupImsiTable[i].imsi; + } + } + log("GSUP IMSI table not found by component ", client); + setverdict(fail); + self.stop; +} + +private function f_imsi_table_init() +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + GsupImsiTable[i].comp_ref := null; + GsupImsiTable[i].imsi := ""; + } +} + +private function f_imsi_table_add(GSUP_ConnHdlr comp_ref, charstring imsi) +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == "") { + GsupImsiTable[i].comp_ref := comp_ref; + GsupImsiTable[i].imsi := imsi; + log("Added IMSI table entry ", i, comp_ref, imsi); + return; + } + } + log("GSUP IMSI table full!"); + setverdict(fail); + self.stop; +} + +private function f_imsi_table_del(charstring imsi) +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { + if (GsupImsiTable[i].imsi == imsi) { + log("Deleted GSUP IMSI table entry ", i, + GsupImsiTable[i].comp_ref, imsi); + GsupImsiTable[i].imsi := ""; + GsupImsiTable[i].comp_ref := null; + return + } + } + log("GSUP IMSI table attempt to delete non-existant ", imsi); + setverdict(fail); + self.stop; +} + + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function GsupCreateCallback(GSUP_PDU gsup, charstring id) +runs on GSUP_Emulation_CT return GSUP_ConnHdlr; + +type record GsupOps { + GsupCreateCallback create_cb +} + +function main(GsupOps ops, charstring id) runs on GSUP_Emulation_CT { + + f_imsi_table_init(); + + while (true) { + var GSUP_ConnHdlr vc_conn; + var GSUP_ConnHdlr vc_hdlr; + var GSUP_PDU gsup; + var charstring imsi; + + alt { + + [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_ID_ACK}) { repeat; } + [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_UP}) { repeat; } + [] GSUP.receive(ASP_IPA_Event:{up_down:=ASP_IPA_EVENT_DOWN}) { + setverdict(fail, "GSUP Connection Lost"); + self.stop; + } + + /* GSUP -> Client: call related messages */ + [] GSUP.receive(GSUP_PDU:?) -> value gsup { + imsi := hex2str(gsup.ies[0].val.imsi); + + if (f_imsi_known(imsi)) { + vc_conn := f_comp_by_imsi(imsi); + GSUP_CLIENT.send(gsup) to vc_conn; + } else { + /* TODO: Only accept this for SETUP.req? */ + vc_conn := ops.create_cb.apply(gsup, id) + /* store mapping between client components and SCCP connectionId */ + f_imsi_table_add(vc_conn, imsi); + /* handle user payload */ + GSUP_CLIENT.send(gsup) to vc_conn; + } + } + + [] GSUP.receive { repeat; } + + /* Client -> GSUP Socket: Normal message */ + [] GSUP_CLIENT.receive(GSUP_PDU:?) -> value gsup sender vc_conn { + /* forward to GSUP socket */ + GSUP.send(gsup); + } + + + /* Client -> us: procedure call to register expect */ + [] GSUP_PROC.getcall(GSUPEM_register:{?,?}) -> param(imsi, vc_hdlr) { + f_create_expect(imsi, vc_hdlr); + GSUP_PROC.reply(GSUPEM_register:{imsi, vc_hdlr}); + } + + } + } +} + +/*********************************************************************** + * "Expect" Handling (mapping for expected incoming GSUP calls from IUT) + ***********************************************************************/ + +/* data about an expected future incoming connection */ +type record ExpectData { + /* destination number based on which we can match it */ + charstring imsi optional, + /* component reference for this connection */ + GSUP_ConnHdlr vc_conn +} + +/* procedure based port to register for incoming calls */ +signature GSUPEM_register(in charstring imsi, in GSUP_ConnHdlr hdlr); + +type port GSUPEM_PROC_PT procedure { + inout GSUPEM_register; +} with { extension "internal" }; + +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function ExpectedCreateCallback(GSUP_PDU gsup, charstring id) +runs on GSUP_Emulation_CT return GSUP_ConnHdlr { + var GSUP_ConnHdlr ret := null; + var charstring imsi; + var integer i; + + imsi := hex2str(gsup.ies[0].val.imsi); + + for (i := 0; i < sizeof(GsupExpectTable); i:= i+1) { + if (not ispresent(GsupExpectTable[i].imsi)) { + continue; + } + if (imsi == GsupExpectTable[i].imsi) { + ret := GsupExpectTable[i].vc_conn; + /* release this entry to be used again */ + GsupExpectTable[i].imsi := omit; + GsupExpectTable[i].vc_conn := null; + log("Found GsupExpect[", i, "] for ", imsi, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find GsupExpect for incoming imsi ", imsi); + return ret; +} + +/* server/emulation side function to create expect */ +private function f_create_expect(charstring imsi, GSUP_ConnHdlr hdlr) +runs on GSUP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(GsupExpectTable); i := i+1) { + if (not ispresent(GsupExpectTable[i].imsi)) { + GsupExpectTable[i].imsi := imsi; + GsupExpectTable[i].vc_conn := hdlr; + log("Created GsupExpect[", i, "] for ", imsi, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in GsupExpectTable"); +} + +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_gsup_expect(charstring imsi) runs on GSUP_ConnHdlr { + GSUP_PROC.call(GSUPEM_register:{imsi, self}) { + [] GSUP_PROC.getreply(GSUPEM_register:{?,?}) {}; + } +} + +} -- To view, visit https://gerrit.osmocom.org/5954 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d06280fa5729ee921d319854a9b11636cf83495 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:21 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req ...................................................................... L3_Templates: Template for tr_CM_SERV_REJ and ts_ML3_MO_LU_Req Change-Id: Iad1596a3b80de16a9b0e2d644cf9a0fe2c51ad21 --- M library/L3_Templates.ttcn 1 file changed, 76 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 19cb99f..b44ccba 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -14,6 +14,10 @@ import from MobileL3_CommonIE_Types all; import from MobileL3_MM_Types all; import from MobileL3_RRM_Types all; +import from MobileL3_CC_Types all; +//import from MobileL3_GMM_SM_Types all; +//import from MobileL3_SMS_Types all; + type enumerated CmServiceType { CM_TYPE_MO_CALL ('0001'B), @@ -98,6 +102,23 @@ } } +template PDU_ML3_NW_MS tr_CM_SERV_REJ(template OCT1 rej_cause := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + cMServiceReject := { + messageType := '100010'B, + nsd := ?, + rejectCause := rej_cause, + t3246_Value := * + } + } + } +} + /* Send template for PAGING RESPONSE */ template (value) PDU_ML3_MS_NW ts_PAG_RESP(MobileIdentityLV mi_lv) := { discriminator := '0000'B, /* overwritten */ @@ -151,4 +172,59 @@ } +template PDU_ML3_MS_NW ts_ML3_MO := { + discriminator := '0000'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := ? +} + +template LocationUpdatingType ts_ML3_IE_LuType := { + lut := ?, + spare1_1 := '0'B, + fop := '0'B +} + +template LocationUpdatingType ts_ML3_IE_LuType_Normal modifies ts_ML3_IE_LuType := { + lut := '00'B +} + +template LocationUpdatingType ts_ML3_IE_LuType_Periodic modifies ts_ML3_IE_LuType := { + lut := '01'B +} + +template LocationUpdatingType ts_ML3_IE_LuType_Attach modifies ts_ML3_IE_LuType := { + lut := '10'B +} + +template CipheringKeySequenceNumberV ts_ML3_IE_CKSN(integer cksn) := { + keySequence := int2bit(cksn, 3), + spare := '0'B +} + +template PDU_ML3_MS_NW ts_ML3_MO_LU_Req(LocationUpdatingType lu_type, LocationAreaIdentification_V lai, + MobileIdentityLV mi, MobileStationClassmark1_V cm1) +modifies ts_ML3_MO := { + msgs := { + mm := { + locationUpdateRequest := { + messageType := '001000'B, + nsd := '00'B, /* ? */ + locationUpdatingType := lu_type, + cipheringKeySequenceNumber := ts_ML3_IE_CKSN(0), + locationAreaIdentification := lai, + mobileStationClassmark1 := cm1, + mobileIdentityLV := mi, + classmarkInformationType2_forUMTS := omit, + additionalUpdateParameterTV := omit, + deviceProperties := omit, + mS_NetworkFeatureSupport := omit + } + } + } +} + + + } -- To view, visit https://gerrit.osmocom.org/5953 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iad1596a3b80de16a9b0e2d644cf9a0fe2c51ad21 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:22 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Fix + enable ts_CellId_CGI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Templates: Fix + enable ts_CellId_CGI ...................................................................... BSSMAP_Templates: Fix + enable ts_CellId_CGI Change-Id: Icafe6415b3f896176edcac604a0945e83126db09 --- M library/BSSMAP_Templates.ttcn 1 file changed, 2 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 49844e7..8227a14 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -200,18 +200,12 @@ type uint16_t BssmapLAC; type uint16_t BssmapCI; -/* -template BSSMAP_IE_CellIdentifier ts_CellId_CGI(mcc, mnc, lac, ci) +template BSSMAP_IE_CellIdentifier ts_CellId_CGI(hexstring mcc, hexstring mnc, BssmapLAC lac, BssmapCI ci) modifies ts_BSSMAP_IE_CellID := { cellIdentification := { - cI_LAC_CGI := { - mnc_mcc := FIXME, - lac := int2oct(lac, 2), - ci := int2oct(ci, 2) - } + cI_CGI := ts_BSSMAP_CI_CGI(mcc, mnc, lac, ci) } } -*/ template BSSMAP_IE_CellIdentifier ts_CellID_LAC_CI(BssmapLAC lac, BssmapCI ci) modifies ts_BSSMAP_IE_CellID := { -- To view, visit https://gerrit.osmocom.org/5950 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icafe6415b3f896176edcac604a0945e83126db09 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:22 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Make ts_BSSAP_DTAP usable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Templates: Make ts_BSSAP_DTAP usable ...................................................................... BSSMAP_Templates: Make ts_BSSAP_DTAP usable A send template with '?' is broken. Also, allow caller to specify DTAP payload as well as optionally a DLCI. Change-Id: I641ee8ce5e5ae70b514342cf68cdc79b1926c4d0 --- M library/BSSMAP_Templates.ttcn 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 2a9cef7..49844e7 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -114,13 +114,13 @@ } } -template PDU_BSSAP ts_BSSAP_DTAP := { +template PDU_BSSAP ts_BSSAP_DTAP(octetstring dtap, template OCT1 dlci := omit) := { discriminator := '1'B, spare := '0000000'B, - dlci := omit, + dlci := dlci, lengthIndicator := 0, /* overwritten by codec */ pdu := { - dtap := ? + dtap := dtap } } -- To view, visit https://gerrit.osmocom.org/5949 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I641ee8ce5e5ae70b514342cf68cdc79b1926c4d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:22 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP_Types: Templates for UpdateLocation + ISD In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP_Types: Templates for UpdateLocation + ISD ...................................................................... GSUP_Types: Templates for UpdateLocation + ISD Change-Id: If7a5a1159f098645652114e0c36fea98f63f946c --- M library/GSUP_Types.ttcn 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index fc524a1..95b2cc2 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -147,6 +147,16 @@ tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); +template GSUP_PDU tr_GSUP_UL_REQ(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { + tr_GSUP_IE_IMSI(imsi), * }); + +template GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := + ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); + +template GSUP_PDU tr_GSUP_ISD_REQ(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { + tr_GSUP_IE_IMSI(imsi), * }); template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { -- To view, visit https://gerrit.osmocom.org/5948 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7a5a1159f098645652114e0c36fea98f63f946c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:22 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may be present ...................................................................... BSSMAP_Templates: tr_BSSAP_BSSMAP / tr_BSSAP_DTAP: DLCI may be present Change-Id: I98b313e354b31fae8c1fea9e61a838970d575d69 --- M library/BSSMAP_Templates.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index f452263..2a9cef7 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -107,7 +107,7 @@ template PDU_BSSAP tr_BSSAP_BSSMAP := { discriminator := '0'B, spare := '0000000'B, - dlci := omit, + dlci := *, lengthIndicator := ?, pdu := { bssmap := ? @@ -127,7 +127,7 @@ template PDU_BSSAP tr_BSSAP_DTAP := { discriminator := '1'B, spare := '0000000'B, - dlci := omit, + dlci := *, lengthIndicator := ?, pdu := { dtap := ? -- To view, visit https://gerrit.osmocom.org/5947 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I98b313e354b31fae8c1fea9e61a838970d575d69 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:23 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSAP_Adapter: Always perform BSSMAP Reset on start-up In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSAP_Adapter: Always perform BSSMAP Reset on start-up ...................................................................... BSSAP_Adapter: Always perform BSSMAP Reset on start-up Change-Id: I1f8834be3409348b3a30b1489f5faa4d1c47b086 --- M library/BSSAP_Adapter.ttcn 1 file changed, 13 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn index 98a30d8..0ebcc3d 100644 --- a/library/BSSAP_Adapter.ttcn +++ b/library/BSSAP_Adapter.ttcn @@ -98,16 +98,23 @@ /* connect MTP3 service provider (M3UA) to lower side of SCCP */ connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - if (isvalue(ops)) { - connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); - } else { - /* connect BSSNAP dispatcher to upper side of SCCP */ - connect(self:BSSAP, vc_SCCP:SCCP_SP_PORT); - } + /* connect ourselves to upper side of SCCP */ + connect(self:BSSAP, vc_SCCP:SCCP_SP_PORT); vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); vc_SCCP.start(SCCPStart(g_sccp_pars)); + if (isvalue(ops)) { + timer T := 5.0; + T.start; + T.timeout; + /* Perform reset procedure */ + f_bssap_reset(); + /* disconect ourselves */ + disconnect(self:BSSAP, vc_SCCP:SCCP_SP_PORT); + /* connect BSSNAP component to upposer side of SCCP */ + connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); + /* start the BSSMAP emulation */ vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), "")); } } -- To view, visit https://gerrit.osmocom.org/5946 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f8834be3409348b3a30b1489f5faa4d1c47b086 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:23 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Move BSSAP_Adapter.ttcn to library so it can be reused In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move BSSAP_Adapter.ttcn to library so it can be reused ...................................................................... Move BSSAP_Adapter.ttcn to library so it can be reused Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42 --- M bsc/gen_links.sh R library/BSSAP_Adapter.ttcn 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index 94bea21..01655c0 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES diff --git a/bsc/BSSAP_Adapter.ttcn b/library/BSSAP_Adapter.ttcn similarity index 100% rename from bsc/BSSAP_Adapter.ttcn rename to library/BSSAP_Adapter.ttcn -- To view, visit https://gerrit.osmocom.org/5944 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6ecb1a4823ee036b65d4e4e8ebc23c1db4915a42 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:23 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc test: Abstract out CTRL handling so it can be re-used fr... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc test: Abstract out CTRL handling so it can be re-used from MSC test ...................................................................... bsc test: Abstract out CTRL handling so it can be re-used from MSC test We create a new Osmocom_CTRL_Adapter module which can be used by test suites using the 'extends' functionality. Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb --- M bsc/BSC_Tests.ttcn M bsc/gen_links.sh A library/Osmocom_CTRL_Adapter.ttcn 3 files changed, 72 insertions(+), 52 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 880b693..6b5ce24 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -34,6 +34,7 @@ import from Osmocom_CTRL_Functions all; import from Osmocom_CTRL_Types all; +import from Osmocom_CTRL_Adapter all; import from MobileL3_CommonIE_Types all; import from L3_Templates all; @@ -46,42 +47,17 @@ const integer NUM_TCHF_PER_BTS := 5; -/* BSC specific CTRL helper functions */ -function f_ctrl_get_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix) return CtrlValue { - return f_ctrl_get(pt, "bts." & int2str(bts_nr) & "." & suffix); -} - -template charstring ts_bts(integer bts_nr) := "bts." & int2str(bts_nr) & "."; -template charstring ts_bts_trx(integer bts_nr, integer trx_nr ) := - valueof(ts_bts(bts_nr)) & "trx." & int2str(trx_nr) & "."; - -function f_ctrl_get_exp_bts(IPA_CTRL_PT pt, integer bts_nr, CtrlVariable suffix, template CtrlValue exp) { - f_ctrl_get_exp(pt, valueof(ts_bts(bts_nr)) & suffix, exp); -} - -function f_ctrl_get_exp_trx(IPA_CTRL_PT pt, integer bts_nr, integer trx_nr, CtrlVariable suffix, - template CtrlValue exp) -{ - f_ctrl_get_exp(pt, valueof(ts_bts_trx(bts_nr, trx_nr)) & suffix, exp); -} - - /* per-BTS state which we keep */ type record BTS_State { /* component reference to the IPA_Client component used for RSL */ IPA_Client rsl } -type component test_CT extends BSSAP_Adapter_CT { +type component test_CT extends BSSAP_Adapter_CT, CTRL_Adapter_CT { /* Array of per-BTS state */ var BTS_State bts[NUM_BTS]; /* array of per-BTS RSL test ports */ port IPA_RSL_PT IPA_RSL[NUM_BTS]; - - /* component reference to the IPA_Client component used for CTRL to BSC */ - var IPA_Client ctrl; - /* test port for the CTRL interface of the BSC */ - port IPA_CTRL_PT IPA_CTRL; /* are we initialized yet */ var boolean g_initialized := false; @@ -160,30 +136,6 @@ } } -/*! Start the CTRL connection to the specified BSC IP+Port */ -function f_ipa_ctrl_start(inout IPA_Client clnt, charstring bsc_host, PortNumber bsc_port, integer i) -runs on test_CT { - timer T := 10.0; - - clnt.id := "IPA" & int2str(i) & "-CTRL"; - clnt.vc_IPA := IPA_Emulation_CT.create(clnt.id & "-IPA"); - - map(clnt.vc_IPA:IPA_PORT, system:IPA_CODEC_PT); - connect(clnt.vc_IPA:IPA_CTRL_PORT, self:IPA_CTRL); - - clnt.vc_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", -1)); - - /* wait for IPA CTRL link to connect and send UP */ - T.start; - alt { - [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } - [] T.timeout { - setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); - self.stop; - } - } -} - /* Wait for the OML connection to be brought up by the external osmo-bts-omldummy */ function f_wait_oml(integer bts_nr, charstring status, float secs_max) runs on test_CT { timer T := secs_max; @@ -242,7 +194,7 @@ } else { f_bssap_init("VirtMSC", omit); } - f_ipa_ctrl_start(ctrl, mp_bsc_ip, mp_bsc_ctrl_port, 0); + f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); for (i := 0; i < nr_bts; i := i+1) { /* wait until osmo-bts-omldummy has respawned */ diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index 14771a7..94bea21 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES diff --git a/library/Osmocom_CTRL_Adapter.ttcn b/library/Osmocom_CTRL_Adapter.ttcn new file mode 100644 index 0000000..4cfe739 --- /dev/null +++ b/library/Osmocom_CTRL_Adapter.ttcn @@ -0,0 +1,68 @@ +module Osmocom_CTRL_Adapter { + +/* Module that test suites can 'inherit' in order to have a CTRL connection to the IUT which they're testing */ + +import from IPL4asp_Types all; + +import from IPA_Emulation all; +import from IPA_Types all; + +import from Osmocom_CTRL_Functions all; +import from Osmocom_CTRL_Types all; + + +type component CTRL_Adapter_CT { + var IPA_Emulation_CT vc_CTRL_IPA; + /* test port for the CTRL interface of the BSC */ + port IPA_CTRL_PT IPA_CTRL; +} + + +/*! Start the CTRL connection to the specified BSC IP+Port */ +function f_ipa_ctrl_start(charstring bsc_host, PortNumber bsc_port) +runs on CTRL_Adapter_CT { + var charstring id := "IPA-CTRL" + timer T := 10.0; + + vc_CTRL_IPA := IPA_Emulation_CT.create(id & "-IPA"); + + map(vc_CTRL_IPA:IPA_PORT, system:IPA_CODEC_PT); + connect(vc_CTRL_IPA:IPA_CTRL_PORT, self:IPA_CTRL); + + vc_CTRL_IPA.start(IPA_Emulation.main_client(bsc_host, bsc_port, "", -1)); + + /* wait for IPA CTRL link to connect and send UP */ + T.start; + alt { + [] IPA_CTRL.receive(ASP_IPA_Event:{up_down := ASP_IPA_EVENT_UP}) { } + [] T.timeout { + setverdict(fail, "Timeout CTRL waiting for ASP_IPA_EVENT_UP"); + self.stop; + } + } +} + + + + +/* BSC specific CTRL helper functions */ +function f_ctrl_get_bts(IPA_CTRL_PT pt, integer bts_nr, charstring suffix) return CtrlValue { + return f_ctrl_get(pt, "bts." & int2str(bts_nr) & "." & suffix); +} + +template charstring ts_bts(integer bts_nr) := "bts." & int2str(bts_nr) & "."; +template charstring ts_bts_trx(integer bts_nr, integer trx_nr ) := + valueof(ts_bts(bts_nr)) & "trx." & int2str(trx_nr) & "."; + +function f_ctrl_get_exp_bts(IPA_CTRL_PT pt, integer bts_nr, CtrlVariable suffix, template CtrlValue exp) { + f_ctrl_get_exp(pt, valueof(ts_bts(bts_nr)) & suffix, exp); +} + +function f_ctrl_get_exp_trx(IPA_CTRL_PT pt, integer bts_nr, integer trx_nr, CtrlVariable suffix, + template CtrlValue exp) +{ + f_ctrl_get_exp(pt, valueof(ts_bts_trx(bts_nr, trx_nr)) & suffix, exp); +} + + +} -- To view, visit https://gerrit.osmocom.org/5943 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ef6cfaa738900e008155013a05b8ccf3d4b7aeb Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:23 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler ...................................................................... BSSAP_Adapter: De-couple from BSC-testing MSC_ConnectionHandler ... and pave the way from using it on the other side in MSC testing Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2 --- M bsc/BSC_Tests.ttcn M bsc/BSSAP_Adapter.ttcn 2 files changed, 10 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 0080fe0..880b693 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -237,7 +237,11 @@ /* Call a function of our 'parent component' BSSAP_Adapter_CT to start the * MSC-side BSSAP emulation */ - f_bssap_init("VirtMSC", handler_mode); + if (handler_mode) { + f_bssap_init("VirtMSC", MSC_BssmapOps); + } else { + f_bssap_init("VirtMSC", omit); + } f_ipa_ctrl_start(ctrl, mp_bsc_ip, mp_bsc_ctrl_port, 0); for (i := 0; i < nr_bts; i := i+1) { diff --git a/bsc/BSSAP_Adapter.ttcn b/bsc/BSSAP_Adapter.ttcn index 4268b29..98a30d8 100644 --- a/bsc/BSSAP_Adapter.ttcn +++ b/bsc/BSSAP_Adapter.ttcn @@ -24,8 +24,6 @@ import from BSSMAP_Templates all; import from BSSMAP_Emulation all; -import from MSC_ConnectionHandler all; - type component BSSAP_Adapter_CT { /* component references */ var M3UA_CT vc_M3UA; @@ -85,14 +83,14 @@ } -function f_bssap_init(charstring id, boolean handler_mode := false) runs on BSSAP_Adapter_CT +function f_bssap_init(charstring id, template BssmapOps ops) runs on BSSAP_Adapter_CT { init_pars(); /* create components */ vc_M3UA := M3UA_CT.create(id & "-M3UA"); vc_SCCP := SCCP_CT.create(id & "-SCCP"); - if (handler_mode) { + if (isvalue(ops)) { vc_BSSMAP := BSSMAP_Emulation_CT.create(id & "-BSSMAP"); } @@ -100,7 +98,7 @@ /* connect MTP3 service provider (M3UA) to lower side of SCCP */ connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - if (handler_mode) { + if (isvalue(ops)) { connect(vc_BSSMAP:BSSAP, vc_SCCP:SCCP_SP_PORT); } else { /* connect BSSNAP dispatcher to upper side of SCCP */ @@ -109,8 +107,8 @@ vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); vc_SCCP.start(SCCPStart(g_sccp_pars)); - if (handler_mode) { - vc_BSSMAP.start(BSSMAP_Emulation.main(MSC_BssmapOps, "")); + if (isvalue(ops)) { + vc_BSSMAP.start(BSSMAP_Emulation.main(valueof(ops), "")); } } -- To view, visit https://gerrit.osmocom.org/5942 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0095f7d24dd8b24f759e4c74a4e7856ec4503ed2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:24 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC ...................................................................... MNCC_Emulation: Similar to BSSMAP_Emulation but for MNCC Dispatches MNCC to individual ConnHldr's based on IMSI. Change-Id: I850b49ce6a6c894b413b8905008452ce91d2cdb0 --- A library/MNCC_Emulation.ttcn 1 file changed, 384 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn new file mode 100644 index 0000000..4bf516d --- /dev/null +++ b/library/MNCC_Emulation.ttcn @@ -0,0 +1,384 @@ +module MNCC_Emulation { + +/* MNCC Emulation, runs on top of MNCC_CodecPort. It multiplexes/demultiplexes + * the individual calls, so there can be separate TTCN-3 components handling + * each of the calls + * + * The MNCC_Emulation.main() function processes MNCC primitives from the MNCC + * socket via the MNCC_CodecPort, and dispatches them to the per-connection components. + * + * Outbound MNCC connections are initiated by sending a MNCC_Call_Req primitive + * to the component running the MNCC_Emulation.main() function. + * + * For each new inbound connections, the MnccOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + MNCC, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the MNCC emulation. + * + * Inbound Unit Data messages (such as are dispatched to the MnccOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2018 by Harald Welte + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + + +import from Osmocom_Types all; +import from MNCC_CodecPort all; +import from MNCC_Types all; +import from UD_Types all; + +/* General "base class" component definition, of which specific implementations + * derive themselves by means of the "extends" feature */ +type component MNCC_ConnHdlr { + /* ports towards MNCC Emulator core / call dispatchar */ + port MNCC_Conn_PT MNCC; + port MNCCEM_PROC_PT MNCC_PROC; +} + +/* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ +type enumerated MNCC_Conn_Prim { + /* MNCC tell us that connection was released */ + MNCC_CONN_PRIM_DISC_IND, + /* we tell MNCC to release connection */ + MNCC_CONN_PRIM_DISC_REQ +} + +type record MNCC_Conn_Req { + MNCC_PDU mncc +} + +/* port between individual per-connection components and this dispatcher */ +type port MNCC_Conn_PT message { + inout MNCC_PDU, MNCC_Conn_Prim, MNCC_Conn_Req; +} with { extension "internal" }; + + +/* represents a single MNCC call */ +type record ConnectionData { + /* reference to the instance of the per-connection component */ + MNCC_ConnHdlr comp_ref, + integer mncc_call_id +} + +type component MNCC_Emulation_CT { + /* UNIX DOMAIN socket on the bottom side, using primitives */ + port MNCC_CODEC_PT MNCC; + /* MNCC port to the per-connection clients */ + port MNCC_Conn_PT MNCC_CLIENT; + + /* use 16 as this is also the number of SCCP connections that SCCP_Emulation can handle */ + var ConnectionData MnccCallTable[16]; + + /* pending expected incoming connections */ + var ExpectData MnccExpectTable[8]; + /* procedure based port to register for incoming connections */ + port MNCCEM_PROC_PT MNCC_PROC; + + var integer g_mncc_ud_id; +}; + +private function f_call_id_known(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id){ + return true; + } + } + return false; +} + +private function f_comp_known(MNCC_ConnHdlr client) +runs on MNCC_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +/* resolve component reference by connection ID */ +private function f_comp_by_call_id(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id) { + return MnccCallTable[i].comp_ref; + } + } + log("MNCC Call table not found by MNCC Call ID ", mncc_call_id); + setverdict(fail); + self.stop; +} + +/* resolve connection ID by component reference */ +private function f_call_id_by_comp(MNCC_ConnHdlr client) +runs on MNCC_Emulation_CT return integer { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].comp_ref == client) { + return MnccCallTable[i].mncc_call_id; + } + } + log("MNCC Call table not found by component ", client); + setverdict(fail); + self.stop; +} + +private function f_gen_call_id() +runs on MNCC_Emulation_CT return integer { + var uint32_t call_id; + + do { + call_id := float2int(rnd()*4294967296.0); + } while (f_call_id_known(call_id) == true); + + return call_id; +} + +private function f_call_table_init() +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + MnccCallTable[i].comp_ref := null; + MnccCallTable[i].mncc_call_id := -1; + } +} + +private function f_call_table_add(MNCC_ConnHdlr comp_ref, uint32_t mncc_call_id) +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == -1) { + MnccCallTable[i].comp_ref := comp_ref; + MnccCallTable[i].mncc_call_id := mncc_call_id; + log("Added conn table entry ", i, comp_ref, mncc_call_id); + return; + } + } + log("MNCC Call table full!"); + setverdict(fail); + self.stop; +} + +private function f_call_table_del(uint32_t mncc_call_id) +runs on MNCC_Emulation_CT { + for (var integer i := 0; i < sizeof(MnccCallTable); i := i+1) { + if (MnccCallTable[i].mncc_call_id == mncc_call_id) { + log("Deleted conn table entry ", i, + MnccCallTable[i].comp_ref, mncc_call_id); + MnccCallTable[i].mncc_call_id := -1; + MnccCallTable[i].comp_ref := null; + return + } + } + log("MNCC Call table attempt to delete non-existant ", mncc_call_id); + setverdict(fail); + self.stop; +} + + +function f_connect(charstring sock) runs on MNCC_Emulation_CT { + var UD_connect_result res; + timer T := 5.0; + + T.start; + MNCC.send(UD_connect:{sock, -1}); + alt { + [] MNCC.receive(UD_connect_result:?) -> value res { + if (ispresent(res.result) and ispresent(res.result.result_code) and res.result.result_code == ERROR) { + setverdict(fail, "Error connecting to MNCC socket", res); + self.stop; + } else { + g_mncc_ud_id := res.id; + } + } + [] T.timeout { + setverdict(fail, "Timeout connecting to MNCC socket"); + self.stop; + } + } +} + +/* call-back type, to be provided by specific implementation; called when new SCCP connection + * arrives */ +type function MnccCreateCallback(MNCC_PDU conn_ind, charstring id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr; + +type function MnccUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU; + +type record MnccOps { + MnccCreateCallback create_cb, + MnccUnitdataCallback unitdata_cb +} + +function main(MnccOps ops, charstring id, charstring sock) runs on MNCC_Emulation_CT { + + f_connect(sock); + f_call_table_init(); + + while (true) { + var MNCC_send_data sd; + var MNCC_Conn_Req creq; + var MNCC_ConnHdlr vc_conn; + var MNCC_PDU mncc; + var MNCC_ConnHdlr vc_hdlr; + var charstring dest_nr; + + alt { + /* MNCC -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, MNCC_SOCKET_HELLO)) -> value sd { + /* Connectionless Procedures like HELLO */ + var template MNCC_PDU resp; + resp := ops.unitdata_cb.apply(sd.data); + if (isvalue(resp)) { + MNCC.send(t_SD_MNCC(g_mncc_ud_id, resp)); + } + } + + /* MNCC -> Client: Release Indication / confirmation */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, (MNCC_REL_IND, MNCC_REL_CNF))) -> value sd { + var uint32_t call_id := f_mncc_get_call_id(sd.data); + /* forward to respective client */ + vc_conn := f_comp_by_call_id(call_id); + MNCC_CLIENT.send(sd.data) to vc_conn; + /* remove from call table */ + f_call_table_del(call_id); + } + + /* MNCC -> Client: call related messages */ + [] MNCC.receive(t_SD_MNCC_MSGT(g_mncc_ud_id, ?)) -> value sd { + var uint32_t call_id := f_mncc_get_call_id(sd.data); + + if (f_call_id_known(call_id)) { + vc_conn := f_comp_by_call_id(call_id); + MNCC_CLIENT.send(sd.data) to vc_conn; + } else { + /* TODO: Only accept this for SETUP.req? */ + vc_conn := ops.create_cb.apply(sd.data, id) + /* store mapping between client components and SCCP connectionId */ + f_call_table_add(vc_conn, call_id); + /* handle user payload */ + MNCC_CLIENT.send(sd.data) to vc_conn; + } + } + + /* Client -> MNCC Socket: RELEASE.ind or RELEASE.cnf: forward + drop call table entry */ + [] MNCC_CLIENT.receive(MNCC_PDU:{msg_type := (MNCC_REL_IND, MNCC_REL_CNF), u:=?}) -> value mncc sender vc_conn { + var integer call_id := f_call_id_by_comp(vc_conn); + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + /* remove from call table */ + f_call_table_del(call_id); + } + + /* Client -> MNCC Socket: Normal message */ + [] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn { + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + } + + + /* Client -> us: procedure call to register expect */ + [] MNCC_PROC.getcall(MNCCEM_register:{?,?}) -> param(dest_nr, vc_hdlr) { + f_create_expect(dest_nr, vc_hdlr); + MNCC_PROC.reply(MNCCEM_register:{dest_nr, vc_hdlr}); + } + + } + } +} + +private function f_mgcp_ep_extract_cic(charstring inp) return integer { + var charstring local_part := regexp(inp, "(*)@*", 0); + return hex2int(str2hex(local_part)); + +} + +/*********************************************************************** + * "Expect" Handling (mapping for expected incoming MNCC calls from IUT) + ***********************************************************************/ + +/* data about an expected future incoming connection */ +type record ExpectData { + /* destination number based on which we can match it */ + charstring dest_number optional, + /* component reference for this connection */ + MNCC_ConnHdlr vc_conn +} + +/* procedure based port to register for incoming calls */ +signature MNCCEM_register(in charstring dest_nr, in MNCC_ConnHdlr hdlr); + +type port MNCCEM_PROC_PT procedure { + inout MNCCEM_register; +} with { extension "internal" }; + +/* CreateCallback that can be used as create_cb and will use the expectation table */ +function ExpectedCreateCallback(MNCC_PDU conn_ind, charstring id) +runs on MNCC_Emulation_CT return MNCC_ConnHdlr { + var MNCC_ConnHdlr ret := null; + var charstring dest_number; + var integer i; + + if (not ischosen(conn_ind.u.signal) or conn_ind.msg_type != MNCC_SETUP_IND) { + setverdict(fail, "MNCC ExpectedCreateCallback needs MNCC_SETUP_IND"); + return ret; + } + dest_number := conn_ind.u.signal.called.number; + + for (i := 0; i < sizeof(MnccExpectTable); i:= i+1) { + if (not ispresent(MnccExpectTable[i].dest_number)) { + continue; + } + if (dest_number == MnccExpectTable[i].dest_number) { + ret := MnccExpectTable[i].vc_conn; + /* release this entry to be used again */ + MnccExpectTable[i].dest_number := omit; + MnccExpectTable[i].vc_conn := null; + log("Found MnccExpect[", i, "] for ", dest_number, " handled at ", ret); + /* return the component reference */ + return ret; + } + } + setverdict(fail, "Couldn't find MnccExpect for incoming call ", dest_number); + return ret; +} + +/* server/emulation side function to create expect */ +private function f_create_expect(charstring dest_number, MNCC_ConnHdlr hdlr) +runs on MNCC_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MnccExpectTable); i := i+1) { + if (not ispresent(MnccExpectTable[i].dest_number)) { + MnccExpectTable[i].dest_number := dest_number; + MnccExpectTable[i].vc_conn := hdlr; + log("Created MnccExpect[", i, "] for ", dest_number, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in MnccMnccExpectTable"); +} + +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mncc_expect(charstring dest_number) runs on MNCC_ConnHdlr { + MNCC_PROC.call(MNCCEM_register:{dest_number, self}) { + [] MNCC_PROC.getreply(MNCCEM_register:{?,?}) {}; + } +} + +function DummyUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC ", mncc); + return omit; +} + +} -- To view, visit https://gerrit.osmocom.org/5960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I850b49ce6a6c894b413b8905008452ce91d2cdb0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:24 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr ...................................................................... BSSMAP_Emulation: Add missing procedure port to client/ConnHdlr Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc --- M library/BSSMAP_Emulation.ttcn 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index 8475d55..14174f8 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -44,6 +44,8 @@ type component BSSAP_ConnHdlr { /* port towards MSC Emulator core / SCCP connection dispatchar */ port BSSAP_Conn_PT BSSAP; + /* procedure based port to register for incoming connections */ + port BSSMAPEM_PROC_PT BSSAP_PROC; } /* Auxiliary primitive that can happen on the port between per-connection client and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/5959 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2925f74d5dcc18f37d48ec8a38a308c1adeef3cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:43 +0000 Subject: osmo-ci[master]: jobs: Add {master,gerrit}-libusrp In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b208455b7bd008fb25322280894c100e51f2227 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:34:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:34:45 +0000 Subject: [MERGED] osmo-ci[master]: jobs: Add {master,gerrit}-libusrp In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jobs: Add {master,gerrit}-libusrp ...................................................................... jobs: Add {master,gerrit}-libusrp Change-Id: I2b208455b7bd008fb25322280894c100e51f2227 --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index b402ce7..d0df20c 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -55,6 +55,7 @@ fi - libsmpp34 + - libusrp - openbsc: a1_name: SMPP diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 6b34693..ba77514 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -72,6 +72,7 @@ trigger: master-osmo-msc, master-openbsc - libtelnet + - libusrp - openbsc: a1_name: SMPP -- To view, visit https://gerrit.osmocom.org/5940 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b208455b7bd008fb25322280894c100e51f2227 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:35:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:35:06 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: Add MNCC_Emulation layer (similar to BSSMAP_Emulation) In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: Add MNCC_Emulation layer (similar to BSSMAP_Emulation) ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5941 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I2f10df139397da26aaa7961c595cdce141299af0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:35:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:35:15 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Add missing procedure port on ConnHdlr side In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: BSSMAP_Emulation: Add missing procedure port on ConnHdlr side ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5945 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ib5ead8beb4e129f7f9c8d4591be2f3aeaeca2912 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:35:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:35:22 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: MNCC_Emulation: Make sure to connect to MNCC sokcket at star... In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: MNCC_Emulation: Make sure to connect to MNCC sokcket at start of main() ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5951 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I5f72031693915e4b869f8004404d8d6d276fd66c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:35:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:35:26 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: MNCC_Emulation: Add missing procedure port to MNCC_ConnHdlr In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: MNCC_Emulation: Add missing procedure port to MNCC_ConnHdlr ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5952 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I775039ffcbeb8223a662e10b40263f9029fddca6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:36:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:36:02 +0000 Subject: [ABANDON] osmo-ttcn3-hacks[master]: msc tests: Put everything together; implement first ConnHdlr... In-Reply-To: References: Message-ID: Harald Welte has abandoned this change. Change subject: msc tests: Put everything together; implement first ConnHdlr based tests ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0e77af4e8eaa9a8134e45a209b279d86d615d081 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:38:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:38:21 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5955 to look at the new patch set (#3). MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c --- A msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 4 files changed, 473 insertions(+), 97 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/5955/3 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn new file mode 100644 index 0000000..15a460b --- /dev/null +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -0,0 +1,201 @@ +module BSC_ConnectionHandler { + +import from General_Types all; +import from Osmocom_Types all; +import from GSM_Types all; +import from SCCPasp_Types all; +import from BSSAP_Types all; +import from BSSMAP_Emulation all; +import from BSSMAP_Templates all; + +import from GSUP_Types all; +import from GSUP_Emulation all; + +import from MNCC_Types all; +import from MNCC_Emulation all; + +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from MobileL3_MM_Types all; +import from L3_Templates all; + +/* this component represents a single subscriber connection */ +type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { + var BSC_ConnHdlrPars g_pars; +} + +type record BSC_ConnHdlrPars { + SCCP_PAR_Address sccp_addr_own, + SCCP_PAR_Address sccp_addr_peer, + BSSMAP_IE_CellIdentifier cell_id, + hexstring imsi, + hexstring msisdn +}; + + +/* Callback function from general BSSMAP_Emulation whenever a connectionless + * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ +private function BscUnitdataCallback(PDU_BSSAP bssap) +runs on BSSMAP_Emulation_CT return template PDU_BSSAP { + var template PDU_BSSAP resp := omit; + + log("BSSMAP_BscUnitdataCallback"); + /* answer all RESET with RESET ACK */ + if (match(bssap, tr_BSSMAP_Reset)){ + log("BSSMAP_BscUnitdataCallback: Responding to RESET with RESET-ACK"); + resp := ts_BSSMAP_ResetAck; + } + + /* FIXME: Handle paging, etc. */ + return resp; +} + +const BssmapOps BSC_BssmapOps := { + /* Create call-back for inbound connections from MSC (hand-over) */ + create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(BscUnitdataCallback), + decode_dtap := true, + role_ms := true +} + + +private function MnccUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC", mncc); + return omit; +} + +const MnccOps BCC_MnccOps := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MnccUnitdataCallback) +} + + + +template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { + addr_peer := peer, + addr_own := own, + bssap := bssap +}; + +template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { + rf_PowerCapability := '010'B, + a5_1 := a5_1_unavail, + esind := '1'B, + revisionLevel := rev, + spare1_1 := '0'B +} + +/* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ +function f_bssap_compl_l3(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + log("Sending COMPL L3: ", l3); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); +} + +/* helper function to fully establish a dedicated channel */ +function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_DTAP_MT dtap_mt; + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + if (expect_auth) { + /* FIXME */ + } + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); +} + +/* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ +function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + return f_build_lu(mi); +} +private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW +{ + var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; + var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), + old_lai, mi, valueof(ts_CM1))); + return l3_info; +} + +function f_perform_lu(boolean expect_auth, boolean expect_tmsi) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + if (expect_auth) { + /* FIXME */ + } + + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt { + var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept; + if (expect_tmsi) { + if (not ispresent(lu_acc.mobileIdentityTLV) or + not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected TMSI but no TMSI was allocated"); + self.stop; + } else { + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); + } + } else { + if (ispresent(lu_acc.mobileIdentityTLV) and + ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected no TMSI but TMSI was allocated"); + self.stop; + } + } + } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { + setverdict(fail, "Expected LU ACK, but received LU REJ"); + self.stop; + } + } + /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} + +function f_foo() runs on BSC_ConnHdlr{ + /* SCCP CC handled by BSSMAP_Emulation_CT.main() */ + /* Expect auth, if enabled */ + + /* TODO: ISD */ + /* Expect encr, if enabled */ + /* Expect encr, if enabled */ + /* Expect ASS CMD, if chan_type != requested */ + /* Send ASS CMPL in successful case */ + + /* Expect AoIP port/ip information for RTP stream */ + /* Expect MSC-originated MGCP to our simulated MGW */ + /* Verify Counters via CTRL */ + /* re-configure MSC behaviour via VTY */ +} + + + + + +} + + diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index adb9453..e336e9a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -16,112 +16,106 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; +import from Osmocom_CTRL_Functions all; +import from Osmocom_CTRL_Types all; +import from Osmocom_CTRL_Adapter all; + +import from MNCC_Emulation all; + +import from GSUP_Emulation all; +import from GSUP_Types all; +import from IPA_Emulation all; + import from BSSAP_Types all; +import from BSSAP_Adapter all; +import from BSSAP_CodecPort all; +import from BSSMAP_Templates all; +import from BSSMAP_Emulation all; +import from BSC_ConnectionHandler all; -type component MTC_CT { - /* M3UA emulation component */ - var M3UA_CT vc_M3UA; - /* SCCP emulation component */ - var SCCP_CT vc_SCCP; - /* test port to SCCP emulation */ - port SCCPasp_PT SCCP; +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from L3_Templates all; - var octetstring g_sio; - var MSC_SCCP_MTP3_parameters g_sccp_pars; - var SCCP_PAR_Address g_sccp_addr_own, g_sccp_addr_peer; +type component MTC_CT extends BSSAP_Adapter_CT, CTRL_Adapter_CT { var boolean g_initialized := false; + + /* no 'adapter_CT' for MNCC or GSUP */ + var MNCC_Emulation_CT vc_MNCC; + var GSUP_Emulation_CT vc_GSUP; + var IPA_Emulation_CT vc_GSUP_IPA; + + /* only to get events from IPA underneath GSUP */ + port IPA_CTRL_PT GSUP_IPA_EVENT; } modulepar { - charstring mp_sccp_service_type := "mtp3_itu"; + /* remote parameters of IUT */ + charstring mp_msc_ip := "127.0.0.1"; + integer mp_msc_ctrl_port := 4255; + integer mp_msc_vty_port := 4254; - SCTP_Association_Address mp_sctp_addr := { 22905, "127.0.0.1", 2905, "127.0.0.1" }; - integer mp_own_pc := 196; - integer mp_own_ssn := 254; + /* local parameters of emulated HLR */ + charstring mp_hlr_ip := "127.0.0.1"; + integer mp_hlr_port := 4222; - integer mp_peer_pc := 185; /* 0.23.1 */ - integer mp_peer_ssn := 254; + charstring mp_msc_mncc := "/tmp/mncc"; } -/* construct a SCCP_PAR_Address with just PC + SSN and no GT */ -template (value) SCCP_PAR_Address ts_SccpAddr_PC_SSN(integer pc, integer ssn) := { - addressIndicator := { - pointCodeIndic := '1'B, - ssnIndicator := '1'B, - globalTitleIndic := '0000'B, - routingIndicator := '1'B - }, - signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, '83'O), - //signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, g_sio), - subsystemNumber := ssn, - globalTitle := omit +function f_init_mncc(charstring id) runs on MTC_CT { + id := id & "-MNCC"; + var MnccOps ops := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MNCC_Emulation.DummyUnitdataCallback) + } + + vc_MNCC := MNCC_Emulation_CT.create(id); + map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); + vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); } -function init_pars() runs on MTC_CT { - g_sio := '83'O; - g_sccp_pars := { - sio := { - ni := substr(oct2bit(g_sio),0,2), - prio := substr(oct2bit(g_sio),2,2), - si := substr(oct2bit(g_sio),4,4) - }, - opc := mp_own_pc, - dpc := mp_peer_pc, - sls := 0, - sccp_serviceType := mp_sccp_service_type, - ssn := mp_own_ssn - }; - g_sccp_addr_own := valueof(ts_SccpAddr_PC_SSN(mp_own_pc, mp_own_ssn)); - g_sccp_addr_peer := valueof(ts_SccpAddr_PC_SSN(mp_peer_pc, mp_peer_ssn)); +function f_init_gsup(charstring id) runs on MTC_CT { + id := id & "-GSUP"; + var GsupOps ops := { + create_cb := refers(GSUP_Emulation.ExpectedCreateCallback) + } + + vc_GSUP_IPA := IPA_Emulation_CT.create(id & "-IPA"); + vc_GSUP := GSUP_Emulation_CT.create(id); + + map(vc_GSUP_IPA:IPA_PORT, system:IPA_CODEC_PT); + connect(vc_GSUP:GSUP, vc_GSUP_IPA:IPA_GSUP_PORT); + /* we use this hack to get events like ASP_IPA_EVENT_UP */ + connect(vc_GSUP_IPA:IPA_CTRL_PORT, self:GSUP_IPA_EVENT); + + vc_GSUP.start(GSUP_Emulation.main(ops, id)); + vc_GSUP_IPA.start(IPA_Emulation.main_server(mp_hlr_ip, mp_hlr_port)); + + /* wait for incoming connection to GSUP port before proceeding */ + timer T := 10.0; + T.start; + alt { + [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } + [] T.timeout { + setverdict(inconc, "No connection to GSUP Port"); + self.stop + } + } } -function init() runs on MTC_CT { +function f_init() runs on MTC_CT { if (g_initialized == true) { return; } g_initialized := true; - init_pars(); - - /* Create components */ - vc_M3UA := M3UA_CT.create; - vc_SCCP := SCCP_CT.create; - - /* connect system SCTP port to M3UA lower side */ - map(vc_M3UA:SCTP_PORT, system:sctp); - - /* connect MTP3 service provider to SCCP MTP3 port */ - connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - - /* connect test suite to SCCP service provider port */ - connect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - - vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); - vc_SCCP.start(SCCPStart(g_sccp_pars)); - -} - -function terminate() runs on MTC_CT { - - disconnect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - disconnect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - unmap(vc_M3UA:SCTP_PORT, system:sctp); - - all component.stop; - - self.stop; -} - -testcase TC_nothing() runs on MTC_CT { - init(); - - timer T := 30.0; - T.start; - T.timeout; - + f_bssap_init("MSC_Test", BSC_BssmapOps); + f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); + f_init_mncc("MSC_Test"); + f_init_gsup("MSC_Test"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -290,31 +284,189 @@ // enc_PDU_BSSAP function f_send_BSSAP_UNITDATA(template PDU_BSSAP bssap) runs on MTC_CT { - SCCP.send(t_ASP_N_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, '00000001'B, '00000001'B, - enc_PDU_BSSAP(valueof(bssap)), omit)) + BSSAP.send(ts_BSSAP_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, bssap)) } -testcase TC_reset() runs on MTC_CT { - init(); +type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; - timer T := 2.0; +function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 15 - lengthof(prefix); + suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ + return prefix & int2hex(suffix, suffix_len); +} + +function f_gen_msisdn(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 12 - lengthof(prefix); + return prefix & int2hex(suffix, suffix_len); +} + +/* FIXME: move into BSC_ConnectionHandler? */ +function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { + var BSC_ConnHdlr vc_conn; + var BSC_ConnHdlrPars pars := { + sccp_addr_own := g_sccp_addr_own, + sccp_addr_peer := g_sccp_addr_peer, + cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), + imsi := f_gen_imsi('26242'H, imsi_suffix), + msisdn := f_gen_msisdn('491239999'H, imsi_suffix) + }; + + vc_conn := BSC_ConnHdlr.create(id); + /* BSSMAP part / A interface */ + connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP_PROC, vc_BSSMAP:PROC); + /* MNCC part */ + connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); + connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); + /* GSUP part */ + connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); + connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + + vc_conn.start(derefers(fn)(id, pars)); + return vc_conn; +} + +function f_sleep(float seconds) { + timer T := seconds; T.start; T.timeout; +} - f_send_BSSAP_UNITDATA(ts_BSSMAP_Reset(0)); +private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, true); +} + +testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); + vc_conn.done; +} + +private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, false); +} + +testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); + vc_conn.done; +} + +/* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ +private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej(int2oct(23,1)))) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); + vc_conn.done; +} + +/* Do LU by IMSI, timeout on GSUP */ +private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + /* Normally the HLR would need to respond here, but we decide to force a timeout here */ + alt { + /* FIXME: Expect specific reject cause */ + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); + vc_conn.done; +} + + +/* Send CM SERVICE REQ for IMSI that has never performed LU before */ +private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + timer T := 10.0; T.start; alt { - //[] SCCP.receive(tr_BSSMAP_ResetAck) { } - [] T.timeout { setverdict(fail); } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } + //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { + setverdict(fail, "Unexpected GSUP UL REQ"); + } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } - terminate(); + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + setverdict(pass); + } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } + } } +testcase TC_cmserv_imsi_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); + vc_conn.done; +} + + control { - execute( TC_reset() ); - execute( TC_nothing() ); + execute( TC_cmserv_imsi_unknown() ); + execute( TC_lu_imsi_noauth_tmsi() ); + //execute( TC_lu_imsi_noauth_notmsi() ); + execute( TC_lu_imsi_reject() ); + execute( TC_lu_imsi_timeout_gsup() ); } diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 6625b11..cfef012 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash BASEDIR=../deps @@ -17,6 +17,15 @@ DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src +FILES="Socket_API_Definitions.ttcn" +gen_links $DIR $FILES + +# Required by MGCP and IPA +DIR=$BASEDIR/titan.TestPorts.IPL4asp/src +FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES # required by M3UA_Emulation @@ -52,7 +61,21 @@ FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SDP/src +FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l +SDP_parser.y lex.SDP_parse_.c" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolModules.RTP/src +FILES="RTP_EncDec.cc RTP_Types.ttcn" +gen_links $DIR $FILES + DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h" +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " +FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " +FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " +FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index f271c88..ce33695 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/5955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 18:38:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:38:50 +0000 Subject: osmo-ttcn3-hacks[master]: MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 21 18:38:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 18:38:51 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... ...................................................................... MSC_Tests: Integrate MNCC, GSUP, BSSAP connection handler, ... Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c --- A msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 4 files changed, 473 insertions(+), 97 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn new file mode 100644 index 0000000..15a460b --- /dev/null +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -0,0 +1,201 @@ +module BSC_ConnectionHandler { + +import from General_Types all; +import from Osmocom_Types all; +import from GSM_Types all; +import from SCCPasp_Types all; +import from BSSAP_Types all; +import from BSSMAP_Emulation all; +import from BSSMAP_Templates all; + +import from GSUP_Types all; +import from GSUP_Emulation all; + +import from MNCC_Types all; +import from MNCC_Emulation all; + +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from MobileL3_MM_Types all; +import from L3_Templates all; + +/* this component represents a single subscriber connection */ +type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { + var BSC_ConnHdlrPars g_pars; +} + +type record BSC_ConnHdlrPars { + SCCP_PAR_Address sccp_addr_own, + SCCP_PAR_Address sccp_addr_peer, + BSSMAP_IE_CellIdentifier cell_id, + hexstring imsi, + hexstring msisdn +}; + + +/* Callback function from general BSSMAP_Emulation whenever a connectionless + * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ +private function BscUnitdataCallback(PDU_BSSAP bssap) +runs on BSSMAP_Emulation_CT return template PDU_BSSAP { + var template PDU_BSSAP resp := omit; + + log("BSSMAP_BscUnitdataCallback"); + /* answer all RESET with RESET ACK */ + if (match(bssap, tr_BSSMAP_Reset)){ + log("BSSMAP_BscUnitdataCallback: Responding to RESET with RESET-ACK"); + resp := ts_BSSMAP_ResetAck; + } + + /* FIXME: Handle paging, etc. */ + return resp; +} + +const BssmapOps BSC_BssmapOps := { + /* Create call-back for inbound connections from MSC (hand-over) */ + create_cb := refers(BSSMAP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(BscUnitdataCallback), + decode_dtap := true, + role_ms := true +} + + +private function MnccUnitdataCallback(MNCC_PDU mncc) +runs on MNCC_Emulation_CT return template MNCC_PDU { + log("Ignoring MNCC", mncc); + return omit; +} + +const MnccOps BCC_MnccOps := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MnccUnitdataCallback) +} + + + +template BSSAP_Conn_Req ts_BSSAP_Conn_Req(SCCP_PAR_Address peer, SCCP_PAR_Address own, PDU_BSSAP bssap) := { + addr_peer := peer, + addr_own := own, + bssap := bssap +}; + +template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { + rf_PowerCapability := '010'B, + a5_1 := a5_1_unavail, + esind := '1'B, + revisionLevel := rev, + spare1_1 := '0'B +} + +/* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ +function f_bssap_compl_l3(PDU_ML3_MS_NW l3) +runs on BSC_ConnHdlr { + log("Sending COMPL L3: ", l3); + var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); +} + +/* helper function to fully establish a dedicated channel */ +function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_DTAP_MT dtap_mt; + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + if (expect_auth) { + /* FIXME */ + } + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); +} + +/* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ +function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); + return f_build_lu(mi); +} +private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW +{ + var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; + var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), + old_lai, mi, valueof(ts_CM1))); + return l3_info; +} + +function f_perform_lu(boolean expect_auth, boolean expect_tmsi) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + if (expect_auth) { + /* FIXME */ + } + + /* Expect MSC to perform LU with HLR */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt { + var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept; + if (expect_tmsi) { + if (not ispresent(lu_acc.mobileIdentityTLV) or + not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected TMSI but no TMSI was allocated"); + self.stop; + } else { + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); + } + } else { + if (ispresent(lu_acc.mobileIdentityTLV) and + ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { + setverdict(fail, "Expected no TMSI but TMSI was allocated"); + self.stop; + } + } + } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { + setverdict(fail, "Expected LU ACK, but received LU REJ"); + self.stop; + } + } + /* FIXME: there could be pending SMS or other common procedures by the MSC, let's ignore them */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} + +function f_foo() runs on BSC_ConnHdlr{ + /* SCCP CC handled by BSSMAP_Emulation_CT.main() */ + /* Expect auth, if enabled */ + + /* TODO: ISD */ + /* Expect encr, if enabled */ + /* Expect encr, if enabled */ + /* Expect ASS CMD, if chan_type != requested */ + /* Send ASS CMPL in successful case */ + + /* Expect AoIP port/ip information for RTP stream */ + /* Expect MSC-originated MGCP to our simulated MGW */ + /* Verify Counters via CTRL */ + /* re-configure MSC behaviour via VTY */ +} + + + + + +} + + diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index adb9453..e336e9a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -16,112 +16,106 @@ import from SCTPasp_Types all; import from SCTPasp_PortType all; +import from Osmocom_CTRL_Functions all; +import from Osmocom_CTRL_Types all; +import from Osmocom_CTRL_Adapter all; + +import from MNCC_Emulation all; + +import from GSUP_Emulation all; +import from GSUP_Types all; +import from IPA_Emulation all; + import from BSSAP_Types all; +import from BSSAP_Adapter all; +import from BSSAP_CodecPort all; +import from BSSMAP_Templates all; +import from BSSMAP_Emulation all; +import from BSC_ConnectionHandler all; -type component MTC_CT { - /* M3UA emulation component */ - var M3UA_CT vc_M3UA; - /* SCCP emulation component */ - var SCCP_CT vc_SCCP; - /* test port to SCCP emulation */ - port SCCPasp_PT SCCP; +import from MobileL3_Types all; +import from MobileL3_CommonIE_Types all; +import from L3_Templates all; - var octetstring g_sio; - var MSC_SCCP_MTP3_parameters g_sccp_pars; - var SCCP_PAR_Address g_sccp_addr_own, g_sccp_addr_peer; +type component MTC_CT extends BSSAP_Adapter_CT, CTRL_Adapter_CT { var boolean g_initialized := false; + + /* no 'adapter_CT' for MNCC or GSUP */ + var MNCC_Emulation_CT vc_MNCC; + var GSUP_Emulation_CT vc_GSUP; + var IPA_Emulation_CT vc_GSUP_IPA; + + /* only to get events from IPA underneath GSUP */ + port IPA_CTRL_PT GSUP_IPA_EVENT; } modulepar { - charstring mp_sccp_service_type := "mtp3_itu"; + /* remote parameters of IUT */ + charstring mp_msc_ip := "127.0.0.1"; + integer mp_msc_ctrl_port := 4255; + integer mp_msc_vty_port := 4254; - SCTP_Association_Address mp_sctp_addr := { 22905, "127.0.0.1", 2905, "127.0.0.1" }; - integer mp_own_pc := 196; - integer mp_own_ssn := 254; + /* local parameters of emulated HLR */ + charstring mp_hlr_ip := "127.0.0.1"; + integer mp_hlr_port := 4222; - integer mp_peer_pc := 185; /* 0.23.1 */ - integer mp_peer_ssn := 254; + charstring mp_msc_mncc := "/tmp/mncc"; } -/* construct a SCCP_PAR_Address with just PC + SSN and no GT */ -template (value) SCCP_PAR_Address ts_SccpAddr_PC_SSN(integer pc, integer ssn) := { - addressIndicator := { - pointCodeIndic := '1'B, - ssnIndicator := '1'B, - globalTitleIndic := '0000'B, - routingIndicator := '1'B - }, - signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, '83'O), - //signPointCode := SCCP_SPC_int2bit(pc, mp_sccp_service_type, g_sio), - subsystemNumber := ssn, - globalTitle := omit +function f_init_mncc(charstring id) runs on MTC_CT { + id := id & "-MNCC"; + var MnccOps ops := { + create_cb := refers(MNCC_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MNCC_Emulation.DummyUnitdataCallback) + } + + vc_MNCC := MNCC_Emulation_CT.create(id); + map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); + vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); } -function init_pars() runs on MTC_CT { - g_sio := '83'O; - g_sccp_pars := { - sio := { - ni := substr(oct2bit(g_sio),0,2), - prio := substr(oct2bit(g_sio),2,2), - si := substr(oct2bit(g_sio),4,4) - }, - opc := mp_own_pc, - dpc := mp_peer_pc, - sls := 0, - sccp_serviceType := mp_sccp_service_type, - ssn := mp_own_ssn - }; - g_sccp_addr_own := valueof(ts_SccpAddr_PC_SSN(mp_own_pc, mp_own_ssn)); - g_sccp_addr_peer := valueof(ts_SccpAddr_PC_SSN(mp_peer_pc, mp_peer_ssn)); +function f_init_gsup(charstring id) runs on MTC_CT { + id := id & "-GSUP"; + var GsupOps ops := { + create_cb := refers(GSUP_Emulation.ExpectedCreateCallback) + } + + vc_GSUP_IPA := IPA_Emulation_CT.create(id & "-IPA"); + vc_GSUP := GSUP_Emulation_CT.create(id); + + map(vc_GSUP_IPA:IPA_PORT, system:IPA_CODEC_PT); + connect(vc_GSUP:GSUP, vc_GSUP_IPA:IPA_GSUP_PORT); + /* we use this hack to get events like ASP_IPA_EVENT_UP */ + connect(vc_GSUP_IPA:IPA_CTRL_PORT, self:GSUP_IPA_EVENT); + + vc_GSUP.start(GSUP_Emulation.main(ops, id)); + vc_GSUP_IPA.start(IPA_Emulation.main_server(mp_hlr_ip, mp_hlr_port)); + + /* wait for incoming connection to GSUP port before proceeding */ + timer T := 10.0; + T.start; + alt { + [] GSUP_IPA_EVENT.receive(t_ASP_IPA_EVT_UD(ASP_IPA_EVENT_UP)) { } + [] T.timeout { + setverdict(inconc, "No connection to GSUP Port"); + self.stop + } + } } -function init() runs on MTC_CT { +function f_init() runs on MTC_CT { if (g_initialized == true) { return; } g_initialized := true; - init_pars(); - - /* Create components */ - vc_M3UA := M3UA_CT.create; - vc_SCCP := SCCP_CT.create; - - /* connect system SCTP port to M3UA lower side */ - map(vc_M3UA:SCTP_PORT, system:sctp); - - /* connect MTP3 service provider to SCCP MTP3 port */ - connect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - - /* connect test suite to SCCP service provider port */ - connect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - - vc_M3UA.start(f_M3UA_Emulation(mp_sctp_addr)); - vc_SCCP.start(SCCPStart(g_sccp_pars)); - -} - -function terminate() runs on MTC_CT { - - disconnect(self:SCCP, vc_SCCP:SCCP_SP_PORT); - disconnect(vc_M3UA:MTP3_SP_PORT, vc_SCCP:MTP3_SCCP_PORT); - unmap(vc_M3UA:SCTP_PORT, system:sctp); - - all component.stop; - - self.stop; -} - -testcase TC_nothing() runs on MTC_CT { - init(); - - timer T := 30.0; - T.start; - T.timeout; - + f_bssap_init("MSC_Test", BSC_BssmapOps); + f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); + f_init_mncc("MSC_Test"); + f_init_gsup("MSC_Test"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -290,31 +284,189 @@ // enc_PDU_BSSAP function f_send_BSSAP_UNITDATA(template PDU_BSSAP bssap) runs on MTC_CT { - SCCP.send(t_ASP_N_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, '00000001'B, '00000001'B, - enc_PDU_BSSAP(valueof(bssap)), omit)) + BSSAP.send(ts_BSSAP_UNITDATA_req(g_sccp_addr_peer, g_sccp_addr_own, bssap)) } -testcase TC_reset() runs on MTC_CT { - init(); +type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; - timer T := 2.0; +function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 15 - lengthof(prefix); + suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ + return prefix & int2hex(suffix, suffix_len); +} + +function f_gen_msisdn(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 12 - lengthof(prefix); + return prefix & int2hex(suffix, suffix_len); +} + +/* FIXME: move into BSC_ConnectionHandler? */ +function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { + var BSC_ConnHdlr vc_conn; + var BSC_ConnHdlrPars pars := { + sccp_addr_own := g_sccp_addr_own, + sccp_addr_peer := g_sccp_addr_peer, + cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), + imsi := f_gen_imsi('26242'H, imsi_suffix), + msisdn := f_gen_msisdn('491239999'H, imsi_suffix) + }; + + vc_conn := BSC_ConnHdlr.create(id); + /* BSSMAP part / A interface */ + connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); + connect(vc_conn:BSSAP_PROC, vc_BSSMAP:PROC); + /* MNCC part */ + connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); + connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); + /* GSUP part */ + connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); + connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + + vc_conn.start(derefers(fn)(id, pars)); + return vc_conn; +} + +function f_sleep(float seconds) { + timer T := seconds; T.start; T.timeout; +} - f_send_BSSAP_UNITDATA(ts_BSSMAP_Reset(0)); +private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, true); +} + +testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); + vc_conn.done; +} + +private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, false); +} + +testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); + vc_conn.done; +} + +/* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ +private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_ERR(g_pars.imsi, 23)); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej(int2oct(23,1)))) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); + vc_conn.done; +} + +/* Do LU by IMSI, timeout on GSUP */ +private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + /* Normally the HLR would need to respond here, but we decide to force a timeout here */ + alt { + /* FIXME: Expect specific reject cause */ + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + setverdict(fail, "Expecting LU REJ, but got ACCEPT"); + self.stop; + } + } + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); + vc_conn.done; +} + + +/* Send CM SERVICE REQ for IMSI that has never performed LU before */ +private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) +runs on BSC_ConnHdlr { + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + timer T := 10.0; T.start; alt { - //[] SCCP.receive(tr_BSSMAP_ResetAck) { } - [] T.timeout { setverdict(fail); } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } + //[] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)) { } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)) { + setverdict(fail, "Unexpected GSUP UL REQ"); + } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } - terminate(); + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + setverdict(pass); + } + [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } + [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } + } } +testcase TC_cmserv_imsi_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); + vc_conn.done; +} + + control { - execute( TC_reset() ); - execute( TC_nothing() ); + execute( TC_cmserv_imsi_unknown() ); + execute( TC_lu_imsi_noauth_tmsi() ); + //execute( TC_lu_imsi_noauth_notmsi() ); + execute( TC_lu_imsi_reject() ); + execute( TC_lu_imsi_timeout_gsup() ); } diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 6625b11..cfef012 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash BASEDIR=../deps @@ -17,6 +17,15 @@ DIR=$BASEDIR/titan.Libraries.TCCUsefulFunctions/src FILES="TCCInterface_Functions.ttcn TCCConversion_Functions.ttcn TCCConversion.cc TCCConversion.hh TCCInterface.cc TCCInterface_ip.h" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.TestPorts.Common_Components.Socket-API/src +FILES="Socket_API_Definitions.ttcn" +gen_links $DIR $FILES + +# Required by MGCP and IPA +DIR=$BASEDIR/titan.TestPorts.IPL4asp/src +FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES # required by M3UA_Emulation @@ -52,7 +61,21 @@ FILES="MobileL3_CC_Types.ttcn MobileL3_CommonIE_Types.ttcn MobileL3_GMM_SM_Types.ttcn MobileL3_MM_Types.ttcn MobileL3_RRM_Types.ttcn MobileL3_SMS_Types.ttcn MobileL3_SS_Types.ttcn MobileL3_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.SDP/src +FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l +SDP_parser.y lex.SDP_parse_.c" +gen_links $DIR $FILES + +DIR=$BASEDIR/titan.ProtocolModules.RTP/src +FILES="RTP_EncDec.cc RTP_Types.ttcn" +gen_links $DIR $FILES + DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h" +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " +FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " +FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " +FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index f271c88..ce33695 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/5955 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7bb6660c6b6cef81533f0fbb5e735f08ed275b8c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 19:03:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 19:03:38 +0000 Subject: osmo-ci[master]: libosmocore: use dispatcher script In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I76dfc11a05007ae5c6e0554fe8132695b67cccaa 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 Sun Jan 21 19:03:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 19:03:59 +0000 Subject: osmo-ci[master]: libosmocore: use dispatcher script In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I76dfc11a05007ae5c6e0554fe8132695b67cccaa 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 Sun Jan 21 19:04:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 19:04:55 +0000 Subject: libosmocore[master]: Embedded: disable stats test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42ff7a6619c0a5926fdc2ec779cf04689c567e15 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 21 19:05:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 19:05:01 +0000 Subject: [MERGED] libosmocore[master]: Embedded: disable stats test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Embedded: disable stats test ...................................................................... Embedded: disable stats test As of 67bdd80a96bdfc49d1aadbd32cca2b53f123d180 the stats.c is effectively disable so we should disable the corresponding tests as well. Change-Id: I42ff7a6619c0a5926fdc2ec779cf04689c567e15 --- M configure.ac M tests/Makefile.am 2 files changed, 9 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index f7acf05..3c15896 100644 --- a/configure.ac +++ b/configure.ac @@ -236,6 +236,9 @@ [Enable building for embedded use and disable unsupported features] )], [embedded=$enableval], [embedded="no"]) + +AM_CONDITIONAL(ENABLE_STATS_TEST, true) + if test x"$embedded" = x"yes" then AC_DEFINE([EMBEDDED],[1],[Select building for embedded use]) @@ -250,6 +253,7 @@ AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_PCSC, false) AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true) + AM_CONDITIONAL(ENABLE_STATS_TEST, false) AC_DEFINE([USE_GNUTLS], [0]) AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) fi diff --git a/tests/Makefile.am b/tests/Makefile.am index 877a302..e199ccc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -17,7 +17,7 @@ write_queue/wqueue_test socket/socket_test \ coding/coding_test conv/conv_gsm0503_test \ abis/abis_test endian/endian_test sercomm/sercomm_test \ - stats/stats_test prbs/prbs_test gsm23003/gsm23003_test \ + prbs/prbs_test gsm23003/gsm23003_test \ codec/codec_ecu_fr_test if ENABLE_MSGFILE @@ -40,6 +40,10 @@ check_PROGRAMS += ctrl/ctrl_test fsm/fsm_test endif +if ENABLE_STATS_TEST +check_PROGRAMS += stats/stats_test +endif + if ENABLE_GB check_PROGRAMS += gb/bssgp_fc_test gb/gprs_bssgp_test gb/gprs_ns_test fr/fr_test endif -- To view, visit https://gerrit.osmocom.org/5871 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42ff7a6619c0a5926fdc2ec779cf04689c567e15 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 19:05:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 19:05:36 +0000 Subject: osmocom-bb[master]: mobile: Print an error message if the VTY cannot be initialized In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 21 19:05:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 21 Jan 2018 19:05:38 +0000 Subject: [MERGED] osmocom-bb[master]: mobile: Print an error message if the VTY cannot be initialized In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mobile: Print an error message if the VTY cannot be initialized ...................................................................... mobile: Print an error message if the VTY cannot be initialized If we fail to initialize the VTY, print an error mesage instead of failing silently. For example: "Cannot init VTY on 127.0.0.1 port 4247: Address already in use" Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e --- M src/host/layer23/src/mobile/app_mobile.c 1 file changed, 4 insertions(+), 1 deletion(-) 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/src/host/layer23/src/mobile/app_mobile.c b/src/host/layer23/src/mobile/app_mobile.c index 6e1fffb..b0e2a13 100644 --- a/src/host/layer23/src/mobile/app_mobile.c +++ b/src/host/layer23/src/mobile/app_mobile.c @@ -464,8 +464,11 @@ } vty_reading = 0; rc = telnet_init_dynif(l23_ctx, NULL, vty_ip, vty_port); - if (rc < 0) + if (rc < 0) { + fprintf(stderr, "Cannot init VTY on %s port %u: %s\n", + vty_ip, vty_port, strerror(errno)); return rc; + } printf("VTY available on %s %u\n", vty_ip, vty_port); osmo_signal_register_handler(SS_GLOBAL, &global_signal_cb, NULL); -- To view, visit https://gerrit.osmocom.org/5869 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I24161f53fa621ae1c8b1916bd0c8055c494b531e Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 21 21:14:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 21:14:22 +0000 Subject: [MERGED] libosmocore[master]: Embedded: add sercomm stubs In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Embedded: add sercomm stubs ...................................................................... Embedded: add sercomm stubs The sercomm functions are unavailable in case of embedded build. Add stub and link the tests against it. Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e --- M .gitignore M configure.ac M tests/Makefile.am A tests/libsercomstub.c M tests/sercomm/sercomm_test.c 5 files changed, 15 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 657120d..db17535 100644 --- a/.gitignore +++ b/.gitignore @@ -90,3 +90,4 @@ # vi files *.sw? +/tests/libsercomstub.a diff --git a/configure.ac b/configure.ac index 3c15896..60c177f 100644 --- a/configure.ac +++ b/configure.ac @@ -238,6 +238,7 @@ [embedded=$enableval], [embedded="no"]) AM_CONDITIONAL(ENABLE_STATS_TEST, true) +AM_CONDITIONAL(ENABLE_SERCOM_STUB, false) if test x"$embedded" = x"yes" then @@ -253,6 +254,7 @@ AM_CONDITIONAL(ENABLE_GNUTLS, false) AM_CONDITIONAL(ENABLE_PCSC, false) AM_CONDITIONAL(ENABLE_PSEUDOTALLOC, true) + AM_CONDITIONAL(ENABLE_SERCOM_STUB, true) AM_CONDITIONAL(ENABLE_STATS_TEST, false) AC_DEFINE([USE_GNUTLS], [0]) AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) diff --git a/tests/Makefile.am b/tests/Makefile.am index e199ccc..5dd8e22 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -3,6 +3,11 @@ AM_LDFLAGS = LDADD = $(top_builddir)/src/libosmocore.la $(TALLOC_LIBS) +if ENABLE_SERCOM_STUB +noinst_LIBRARIES = libsercomstub.a +LDADD += $(top_builddir)/tests/libsercomstub.a +endif + check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ smscb/smscb_test bits/bitrev_test a5/a5_test \ conv/conv_test auth/milenage_test lapd/lapd_test \ @@ -55,10 +60,10 @@ stats_stats_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la a5_a5_test_SOURCES = a5/a5_test.c -a5_a5_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +a5_a5_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la kasumi_kasumi_test_SOURCES = kasumi/kasumi_test.c -kasumi_kasumi_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +kasumi_kasumi_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la comp128_comp128_test_SOURCES = comp128/comp128_test.c comp128_comp128_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libosmogsm.la @@ -84,10 +89,10 @@ bits_bitfield_test_SOURCES = bits/bitfield_test.c conv_conv_test_SOURCES = conv/conv_test.c conv/conv.c -conv_conv_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +conv_conv_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_SOURCES = conv/conv_gsm0503_test.c conv/conv.c conv/gsm0503_test_vectors.c -conv_conv_gsm0503_test_LDADD = $(top_builddir)/src/gsm/libgsmint.la +conv_conv_gsm0503_test_LDADD = $(LDADD) $(top_builddir)/src/gsm/libgsmint.la conv_conv_gsm0503_test_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/tests/conv gsm0808_gsm0808_test_SOURCES = gsm0808/gsm0808_test.c diff --git a/tests/libsercomstub.c b/tests/libsercomstub.c new file mode 100644 index 0000000..99662d0 --- /dev/null +++ b/tests/libsercomstub.c @@ -0,0 +1,3 @@ +/* Stubs for embedded build */ +void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} +void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {} diff --git a/tests/sercomm/sercomm_test.c b/tests/sercomm/sercomm_test.c index 4a40f62..058c9eb 100644 --- a/tests/sercomm/sercomm_test.c +++ b/tests/sercomm/sercomm_test.c @@ -27,10 +27,6 @@ struct osmo_sercomm_inst g_osi; -/* Locking details are not checked by this test anyway */ -void sercomm_drv_lock(unsigned long __attribute__((unused)) *flags) {} -void sercomm_drv_unlock(unsigned long __attribute__((unused)) *flags) {} - static const uint8_t valid_dlci3[] = { 0x7E, 3, 0x03, 'f', 'o', 'o', 0x7E }; static const uint8_t valid_dlci23[] = { 0x7E, 23, 0x03, '2', '3', 0x7E }; static const uint8_t valid_dlci23esc[] = { 0x7E, 23, 0x03, 0x7D, '2' ^ (1 << 5), '3', 0x7E }; -- To view, visit https://gerrit.osmocom.org/5873 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9bc5cb2f822b1a3ffdc6ec29f46b6bac8288314e Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 21 21:14:41 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 21:14:41 +0000 Subject: [MERGED] osmo-ci[master]: libosmocore: use dispatcher script In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: libosmocore: use dispatcher script ...................................................................... libosmocore: use dispatcher script Get rid of job name comparison because it depends and exact build server name and hence is highly fragile. Use dispatcher script the same way we do in osmo-bts. N. B: this requires I2955e866bce4f000a53369bd601a346c36c82468 in libosmocore. Change-Id: I76dfc11a05007ae5c6e0554fe8132695b67cccaa --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 2 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index d0df20c..ce9d084 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -46,13 +46,7 @@ a1_name: arch a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' - cmd: > - # keep first line with less indent to preserve newlines - if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then - ./contrib/jenkins-arm.sh - else - ./contrib/jenkins.sh - fi + cmd: './contrib/jenkins_arch.sh "$arch"' - libsmpp34 - libusrp diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index ba77514..0f9bb1e 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -56,13 +56,7 @@ a1_name: arch a1: !!python/tuple [arm-none-eabi, amd64] combination_filter: '!(arch=="arm-none-eabi" && label=="FreeBSD_amd64")' - cmd: > - # keep first line with less indent to preserve newlines - if [[ "$JOB_NAME" == *"arch=arm-none-eabi,label=linux_amd64_debian8"* ]]; then - ./contrib/jenkins-arm.sh - else - ./contrib/jenkins.sh - fi + cmd: './contrib/jenkins_arch.sh "$arch"' trigger: > master-libosmo-abis, master-libosmo-sccp, master-openbsc, master-osmo-pcap, master-osmo-tetra, master-osmo-pcu, master-osmo-gmr, master-osmo-bts, master-osmocom-bb, SIMtrace, xgoldmon, -- To view, visit https://gerrit.osmocom.org/5885 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I76dfc11a05007ae5c6e0554fe8132695b67cccaa Gerrit-PatchSet: 2 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 Sun Jan 21 21:54:12 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 21:54:12 +0000 Subject: [PATCH] osmo-bts[master]: Remove unneeded LIBOSMOCORE_CFLAGS from tests Message-ID: Review at https://gerrit.osmocom.org/5961 Remove unneeded LIBOSMOCORE_CFLAGS from tests When testing for the presence of particular BTS model-specific header during ./configure step, we don't need to add LIBOSMOCORE_CFLAGS because none of those headers use it for compilation. Moreover, adding it might hide the problem if the headers under check are available in the same location where libosmocore headers were checked out. Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 --- M configure.ac 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/5961/1 diff --git a/configure.ac b/configure.ac index 88751f4..8c6a7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,7 @@ AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], @@ -173,7 +173,7 @@ AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $LIBOSMOCORE_CFLAGS" +CPPFLAGS="$CPPFLAGS" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS -- To view, visit https://gerrit.osmocom.org/5961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:06:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 22:06:48 +0000 Subject: [PATCH] osmo-bts[master]: Move -I inside *INCDIR variable Message-ID: Review at https://gerrit.osmocom.org/5962 Move -I inside *INCDIR variable Previouslywe could end-up passing empty '-I' to compilerif corresponding _INCDIR variable was not defined during the ./configure step. This is apparently tolerated by gcc but still seems like a wrong thingto do. Let's fix this by moving -I inside of *_INCDIR. Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/sysmobts/Makefile.am 5 files changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/5962/1 diff --git a/configure.ac b/configure.ac index 8c6a7f8..a98dede 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,12 @@ # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. sysmobts_incdir="." fi -AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) +AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR -I$srcdir/include" AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) @@ -105,12 +105,12 @@ [enable_octphy="yes"],[enable_octphy="no"]) AC_ARG_WITH([octsdr-2g], [AS_HELP_STRING([--with-octsdr-2g], [Location of the OCTSDR-2G API header files])], [octsdr2g_incdir="$withval"],[octsdr2g_incdir="`cd $srcdir; pwd`/src/osmo-bts-octphy/"]) -AC_SUBST([OCTSDR2G_INCDIR], $octsdr2g_incdir) +AC_SUBST([OCTSDR2G_INCDIR], -I$octsdr2g_incdir) AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $OCTSDR2G_INCDIR -I$srcdir/include" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], @@ -168,12 +168,12 @@ [enable_litecell15="yes"],[enable_litecell15="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"]) -AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) +AC_SUBST([LITECELL15_INCDIR], -I$litecell15_incdir) AC_MSG_RESULT([$enable_litecell15]) AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $LITECELL15_INCDIR -I$srcdir/include" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index fdb794d..f30320f 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(LITECELL15_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(LITECELL15_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index 9ca9e44..ccdafaa 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OCTSDR2G_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(OCTSDR2G_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index b837d3a..8e03b77 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 2a57b2b..5f27116 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:15:18 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 22:15:18 +0000 Subject: [PATCH] osmo-bts[master]: Move -I inside *INCDIR variable In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5962 to look at the new patch set (#2). Move -I inside *INCDIR variable Previouslywe could end-up passing empty '-I' to compilerif corresponding _INCDIR variable was not defined during the ./configure step. This is apparently tolerated by gcc but still seems like a wrong thingto do. Let's fix this by moving -I inside of *_INCDIR. Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/sysmobts/Makefile.am 5 files changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/5962/2 diff --git a/configure.ac b/configure.ac index fc9ace6..a695023 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,12 @@ # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. sysmobts_incdir="." fi -AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) +AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR -I$srcdir/include" AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) @@ -105,12 +105,12 @@ [enable_octphy="yes"],[enable_octphy="no"]) AC_ARG_WITH([octsdr-2g], [AS_HELP_STRING([--with-octsdr-2g], [Location of the OCTSDR-2G API header files])], [octsdr2g_incdir="$withval"],[octsdr2g_incdir="`cd $srcdir; pwd`/src/osmo-bts-octphy/"]) -AC_SUBST([OCTSDR2G_INCDIR], $octsdr2g_incdir) +AC_SUBST([OCTSDR2G_INCDIR], -I$octsdr2g_incdir) AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $OCTSDR2G_INCDIR -I$srcdir/include" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], @@ -168,12 +168,12 @@ [enable_litecell15="yes"],[enable_litecell15="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"]) -AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) +AC_SUBST([LITECELL15_INCDIR], -I$litecell15_incdir) AC_MSG_RESULT([$enable_litecell15]) AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $LITECELL15_INCDIR -I$srcdir/include" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR" +CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index fdb794d..f30320f 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(LITECELL15_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(LITECELL15_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index 9ca9e44..ccdafaa 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OCTSDR2G_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(OCTSDR2G_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index b837d3a..8e03b77 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 2a57b2b..5f27116 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:15:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 22:15:19 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: use proper includes forsbts2050 test Message-ID: Review at https://gerrit.osmocom.org/5963 sysmobts: use proper includes forsbts2050 test When testing for sbts2050_header.h during ./configure stage, use proper include path defined earlier. Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/63/5963/1 diff --git a/configure.ac b/configure.ac index 8c6a7f8..fc9ace6 100644 --- a/configure.ac +++ b/configure.ac @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS -- To view, visit https://gerrit.osmocom.org/5963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:16:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 22:16:32 +0000 Subject: [PATCH] osmo-bts[master]: Move -I inside *INCDIR variable In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5962 to look at the new patch set (#3). Move -I inside *INCDIR variable Previouslywe could end-up passing empty '-I' to compilerif corresponding _INCDIR variable was not defined during the ./configure step. This is apparently tolerated by gcc but still seems like a wrong thingto do. Let's fix this by moving -I inside of *_INCDIR. Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/sysmobts/Makefile.am 5 files changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/5962/3 diff --git a/configure.ac b/configure.ac index fc9ace6..a695023 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,12 @@ # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. sysmobts_incdir="." fi -AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) +AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR -I$srcdir/include" AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) @@ -105,12 +105,12 @@ [enable_octphy="yes"],[enable_octphy="no"]) AC_ARG_WITH([octsdr-2g], [AS_HELP_STRING([--with-octsdr-2g], [Location of the OCTSDR-2G API header files])], [octsdr2g_incdir="$withval"],[octsdr2g_incdir="`cd $srcdir; pwd`/src/osmo-bts-octphy/"]) -AC_SUBST([OCTSDR2G_INCDIR], $octsdr2g_incdir) +AC_SUBST([OCTSDR2G_INCDIR], -I$octsdr2g_incdir) AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $OCTSDR2G_INCDIR -I$srcdir/include" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], @@ -168,12 +168,12 @@ [enable_litecell15="yes"],[enable_litecell15="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"]) -AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) +AC_SUBST([LITECELL15_INCDIR], -I$litecell15_incdir) AC_MSG_RESULT([$enable_litecell15]) AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $LITECELL15_INCDIR -I$srcdir/include" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR" +CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index fdb794d..f30320f 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(LITECELL15_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(LITECELL15_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index 9ca9e44..ccdafaa 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OCTSDR2G_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(OCTSDR2G_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index b837d3a..8e03b77 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 2a57b2b..5f27116 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:16:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 22:16:32 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: use proper includes for sbts2050 test In-Reply-To: References: Message-ID: sysmobts: use proper includes for sbts2050 test When testing for sbts2050_header.h during ./configure stage, use proper include path defined earlier. Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/63/5963/2 diff --git a/configure.ac b/configure.ac index 8c6a7f8..fc9ace6 100644 --- a/configure.ac +++ b/configure.ac @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS -- To view, visit https://gerrit.osmocom.org/5963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:36:36 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 21 Jan 2018 22:36:36 +0000 Subject: osmo-bts[master]: Remove unneeded LIBOSMOCORE_CFLAGS from tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/5961/1/configure.ac File configure.ac: Line 113: CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" makes me think: can we remove the -I$srcdir/include too or do we need to keep it? Line 186: CPPFLAGS="$CPPFLAGS" this is NOOP and can be removed. -- To view, visit https://gerrit.osmocom.org/5961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 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: Yes From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:37:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sun, 21 Jan 2018 22:37:00 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: remove weird default header location Message-ID: Review at https://gerrit.osmocom.org/5964 sysmobts: remove weird default header location The sysmoBTS-specific headers were never looked for in the current directory. None of the CI tests use it as well. None of the other BTS models use such defaults. Let's just drop this to restore expected header location semantics. Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5 --- M configure.ac 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/64/5964/1 diff --git a/configure.ac b/configure.ac index a695023..51d94c6 100644 --- a/configure.ac +++ b/configure.ac @@ -73,10 +73,6 @@ # --with-sysmobts was passed, imply enable_sysmocom_bts enable_sysmocom_bts="yes" fi -if test "x$enable_sysmocom_bts" = "xyes" -a "x$sysmobts_incdir" = "x"; then - # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. - sysmobts_incdir="." -fi AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") -- To view, visit https://gerrit.osmocom.org/5964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:40:14 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 21 Jan 2018 22:40:14 +0000 Subject: osmo-bts[master]: Remove unneeded LIBOSMOCORE_CFLAGS from tests In-Reply-To: References: Message-ID: Patch Set 1: -Code-Review (1 comment) https://gerrit.osmocom.org/#/c/5961/1/configure.ac File configure.ac: Line 186: CPPFLAGS="$CPPFLAGS" > this is NOOP and can be removed. Ah I see you re-use it in next patch adding an extra -I... Would have been clearer stating so in the commit description, swapping order of the 2 commits or removing this + oldCPPFLAGs lines and readding them in following commit. But not that important, so I remove the -1 but please check the other comment. -- To view, visit https://gerrit.osmocom.org/5961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 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: Yes From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:41:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 21 Jan 2018 22:41:04 +0000 Subject: osmo-bts[master]: sysmobts: use proper includes for sbts2050 test In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 21 22:46:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 21 Jan 2018 22:46:01 +0000 Subject: osmo-bts[master]: Move -I inside *INCDIR variable In-Reply-To: References: Message-ID: Patch Set 3: IMHO would be more clean and clear leaving xyz_INCDIR without the -I and then create a new xyz_CFLAGS which contains "-I$yxz_INCDIR" which is then used in the different Makefile.am. But anyway this seems to be fixing the big issue, so better than nothing. Rework it if you agree, otherwise it can be merged. -- To view, visit https://gerrit.osmocom.org/5962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 Gerrit-PatchSet: 3 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 Sun Jan 21 22:49:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Sun, 21 Jan 2018 22:49:40 +0000 Subject: osmo-bts[master]: sysmobts: remove weird default header location In-Reply-To: References: Message-ID: Patch Set 1: I think this belongs together with the previous patch. -- To view, visit https://gerrit.osmocom.org/5964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 00:50:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 00:50:27 +0000 Subject: [PATCH] osmo-msc[master]: MNCC: Add input validation Message-ID: Review at https://gerrit.osmocom.org/5965 MNCC: Add input validation There appears to have been no input validation whatsoever on MNCC messages. Hence it was very easy for an external MNCC handler to crash OsmoMSC, such as in OS#2853 Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4 Closes: OS#2853 --- M include/osmocom/msc/mncc.h M src/libmsc/mncc.c M src/libmsc/mncc_sock.c 3 files changed, 188 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/65/5965/1 diff --git a/include/osmocom/msc/mncc.h b/include/osmocom/msc/mncc.h index 49f0c8b..d2f0541 100644 --- a/include/osmocom/msc/mncc.h +++ b/include/osmocom/msc/mncc.h @@ -215,5 +215,6 @@ || msg_type == GSM_TCH_FRAME_AMR \ || msg_type == GSM_BAD_FRAME) +int mncc_prim_check(const struct gsm_mncc *mncc_prim, unsigned int len); #endif diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 4e88bc6..3b4c41d 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -1,7 +1,7 @@ /* mncc.c - utility routines for the MNCC API between the 04.08 * message parsing and the actual Call Control logic */ -/* (C) 2008-2009 by Harald Welte +/* (C) 2008-2018 by Harald Welte * (C) 2009 by Andreas Eversberg * All Rights Reserved * @@ -105,3 +105,185 @@ data->cause.value = val; } + +/*********************************************************************** + * MNCC validation code. Move to libosmocore once headers are merged + ************************************************************************/ + +#define MNCC_F_ALL 0x3fff + +static int check_string_terminated(const char *str, unsigned int size) +{ + int i; + for (i = 0; i < size; i++) { + if (str[i] == 0) + return 0; + } + return -EINVAL; +} + +static int mncc_check_number(const struct gsm_mncc_number *num, const char *str) +{ + int rc; + rc = check_string_terminated(num->number, ARRAY_SIZE(num->number)); + if (rc < 0) + LOGP(DMNCC, LOGL_ERROR, "MNCC %s number not terminated\n", str); + return rc; +} + +static int mncc_check_cause(const struct gsm_mncc_cause *cause) +{ + if (cause->diag_len > sizeof(cause->diag)) + return -EINVAL; + return 0; +} + +static int mncc_check_useruser(const struct gsm_mncc_useruser *uu) +{ + return check_string_terminated(uu->info, ARRAY_SIZE(uu->info)); +} + +static int mncc_check_facility(const struct gsm_mncc_facility *fac) +{ + return check_string_terminated(fac->info, ARRAY_SIZE(fac->info)); +} + +static int mncc_check_ssversion(const struct gsm_mncc_ssversion *ssv) +{ + return check_string_terminated(ssv->info, ARRAY_SIZE(ssv->info)); +} + +static int mncc_prim_check_sign(const struct gsm_mncc *mncc_prim) +{ + int rc; + + if (mncc_prim->fields & ~ MNCC_F_ALL) { + LOGP(DMNCC, LOGL_ERROR, "Unknown MNCC field mask 0x%x\n", mncc_prim->fields); + return -EINVAL; + } + + rc = check_string_terminated(mncc_prim->imsi, sizeof(mncc_prim->imsi)); + if (rc < 0) { + LOGP(DMNCC, LOGL_ERROR, "MNCC IMSI not terminated\n"); + return rc; + } + + if (mncc_prim->fields & MNCC_F_CALLED) { + rc = mncc_check_number(&mncc_prim->called, "called"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_CALLING) { + rc = mncc_check_number(&mncc_prim->calling, "calling"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_REDIRECTING) { + rc = mncc_check_number(&mncc_prim->redirecting, "redirecting"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_CONNECTED) { + rc = mncc_check_number(&mncc_prim->connected, "connected"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_CAUSE) { + rc = mncc_check_cause(&mncc_prim->cause); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_USERUSER) { + rc = mncc_check_useruser(&mncc_prim->useruser); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_FACILITY) { + rc = mncc_check_facility(&mncc_prim->facility); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_SSVERSION) { + rc = mncc_check_ssversion(&mncc_prim->ssversion); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_BEARER_CAP) { + bool m1_found = false; + int i; + + for (i = 0; i < ARRAY_SIZE(mncc_prim->bearer_cap.speech_ver); i++) { + if (mncc_prim->bearer_cap.speech_ver[i] == -1) { + m1_found = true; + break; + } + } + if (!m1_found) { + LOGP(DMNCC, LOGL_ERROR, "Unterminated MNCC bearer capability\n"); + return -EINVAL; + } + } + + return 0; +} + +int mncc_prim_check(const struct gsm_mncc *mncc_prim, unsigned int len) +{ + if (len < sizeof(mncc_prim->msg_type)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC Header\n"); + return -EINVAL; + } + + switch (mncc_prim->msg_type) { + case MNCC_SOCKET_HELLO: + if (len < sizeof(struct gsm_mncc_hello)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC Hello\n"); + return -EINVAL; + } + break; + case GSM_BAD_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_TCHH_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHF_FRAME: + if (len < sizeof(struct gsm_data_frame)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC TCH\n"); + return -EINVAL; + } + break; + case MNCC_RTP_FREE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_CREATE: + if (len < sizeof(struct gsm_mncc_rtp)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC RTP\n"); + return -EINVAL; + } + break; + case MNCC_LCHAN_MODIFY: + case MNCC_FRAME_DROP: + case MNCC_FRAME_RECV: + /* FIXME */ + break; + case MNCC_BRIDGE: + if (len < sizeof(struct gsm_mncc_bridge)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC BRIDGE\n"); + return -EINVAL; + } + break; + default: + if (len < sizeof(struct gsm_mncc)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC Signalling\n"); + return -EINVAL; + } + return mncc_prim_check_sign(mncc_prim); + } + return 0; +} diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index b6b1bc9..14613ca 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -123,8 +123,11 @@ return 0; goto close; } + msgb_put(msg, rc); - rc = mncc_tx_to_cc(state->net, mncc_prim->msg_type, mncc_prim); + rc = mncc_prim_check(mncc_prim, rc); + if (rc == 0) + rc = mncc_tx_to_cc(state->net, mncc_prim->msg_type, mncc_prim); /* as we always synchronously process the message in mncc_send() and * its callbacks, we can free the message here. */ -- To view, visit https://gerrit.osmocom.org/5965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:56:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:56:08 +0000 Subject: osmo-bts[master]: sysmobts: remove weird default header location In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5 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-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:56:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:56:34 +0000 Subject: osmo-bts[master]: sysmobts: use proper includes for sbts2050 test In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:56:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:56:53 +0000 Subject: osmo-bts[master]: Move -I inside *INCDIR variable In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 Gerrit-PatchSet: 3 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 Mon Jan 22 01:57:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:06 +0000 Subject: osmo-bts[master]: sysmobts: use proper includes for sbts2050 test In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/5963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:57:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:17 +0000 Subject: osmo-bts[master]: Remove unneeded LIBOSMOCORE_CFLAGS from tests In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/5961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 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 Mon Jan 22 01:57:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:22 +0000 Subject: osmo-bts[master]: Remove unneeded LIBOSMOCORE_CFLAGS from tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 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 Mon Jan 22 01:57:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:28 +0000 Subject: [MERGED] osmo-bts[master]: Remove unneeded LIBOSMOCORE_CFLAGS from tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove unneeded LIBOSMOCORE_CFLAGS from tests ...................................................................... Remove unneeded LIBOSMOCORE_CFLAGS from tests When testing for the presence of particular BTS model-specific header during ./configure step, we don't need to add LIBOSMOCORE_CFLAGS because none of those headers use it for compilation. Moreover, adding it might hide the problem if the headers under check are available in the same location where libosmocore headers were checked out. Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 --- M configure.ac 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 88751f4..8c6a7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -110,7 +110,7 @@ AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], @@ -173,7 +173,7 @@ AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" + CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $LIBOSMOCORE_CFLAGS" +CPPFLAGS="$CPPFLAGS" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS -- To view, visit https://gerrit.osmocom.org/5961 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1 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 From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:57:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:28 +0000 Subject: [MERGED] osmo-bts[master]: sysmobts: use proper includes for sbts2050 test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmobts: use proper includes for sbts2050 test ...................................................................... sysmobts: use proper includes for sbts2050 test When testing for sbts2050_header.h during ./configure stage, use proper include path defined earlier. Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/configure.ac b/configure.ac index 8c6a7f8..fc9ace6 100644 --- a/configure.ac +++ b/configure.ac @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS -- To view, visit https://gerrit.osmocom.org/5963 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1 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 Mon Jan 22 01:57:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:29 +0000 Subject: [MERGED] osmo-bts[master]: Move -I inside *INCDIR variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move -I inside *INCDIR variable ...................................................................... Move -I inside *INCDIR variable Previouslywe could end-up passing empty '-I' to compilerif corresponding _INCDIR variable was not defined during the ./configure step. This is apparently tolerated by gcc but still seems like a wrong thingto do. Let's fix this by moving -I inside of *_INCDIR. Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 --- M configure.ac M src/osmo-bts-litecell15/Makefile.am M src/osmo-bts-octphy/Makefile.am M src/osmo-bts-sysmo/Makefile.am M tests/sysmobts/Makefile.am 5 files changed, 11 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index fc9ace6..a695023 100644 --- a/configure.ac +++ b/configure.ac @@ -77,12 +77,12 @@ # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. sysmobts_incdir="." fi -AC_SUBST([SYSMOBTS_INCDIR], $sysmobts_incdir) +AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") if test "$enable_sysmocom_bts" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR -I$srcdir/include" AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) @@ -105,12 +105,12 @@ [enable_octphy="yes"],[enable_octphy="no"]) AC_ARG_WITH([octsdr-2g], [AS_HELP_STRING([--with-octsdr-2g], [Location of the OCTSDR-2G API header files])], [octsdr2g_incdir="$withval"],[octsdr2g_incdir="`cd $srcdir; pwd`/src/osmo-bts-octphy/"]) -AC_SUBST([OCTSDR2G_INCDIR], $octsdr2g_incdir) +AC_SUBST([OCTSDR2G_INCDIR], -I$octsdr2g_incdir) AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $OCTSDR2G_INCDIR -I$srcdir/include" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], @@ -168,12 +168,12 @@ [enable_litecell15="yes"],[enable_litecell15="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"]) -AC_SUBST([LITECELL15_INCDIR], $litecell15_incdir) +AC_SUBST([LITECELL15_INCDIR], -I$litecell15_incdir) AC_MSG_RESULT([$enable_litecell15]) AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes") if test "$enable_litecell15" = "yes"; then oldCPPFLAGS=$CPPFLAGS - CPPFLAGS="$CPPFLAGS -I$LITECELL15_INCDIR -I$srcdir/include" + CPPFLAGS="$CPPFLAGS $LITECELL15_INCDIR -I$srcdir/include" AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[], [AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])], [#include ]) @@ -183,7 +183,7 @@ # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS -I$SYSMOBTS_INCDIR" +CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR" AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) CPPFLAGS=$oldCPPFLAGS diff --git a/src/osmo-bts-litecell15/Makefile.am b/src/osmo-bts-litecell15/Makefile.am index fdb794d..f30320f 100644 --- a/src/osmo-bts-litecell15/Makefile.am +++ b/src/osmo-bts-litecell15/Makefile.am @@ -1,6 +1,6 @@ AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(LITECELL15_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(LITECELL15_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) $(LIBSYSTEMD_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index 9ca9e44..ccdafaa 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OCTSDR2G_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(OCTSDR2G_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/src/osmo-bts-sysmo/Makefile.am b/src/osmo-bts-sysmo/Makefile.am index b837d3a..8e03b77 100644 --- a/src/osmo-bts-sysmo/Makefile.am +++ b/src/osmo-bts-sysmo/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBGPS_CFLAGS) $(ORTP_CFLAGS) COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) diff --git a/tests/sysmobts/Makefile.am b/tests/sysmobts/Makefile.am index 2a57b2b..5f27116 100644 --- a/tests/sysmobts/Makefile.am +++ b/tests/sysmobts/Makefile.am @@ -1,4 +1,4 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo -I$(SYSMOBTS_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(top_srcdir)/src/osmo-bts-sysmo $(SYSMOBTS_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(ORTP_LIBS) -- To view, visit https://gerrit.osmocom.org/5962 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9 Gerrit-PatchSet: 3 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 Mon Jan 22 01:57:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:29 +0000 Subject: [MERGED] osmo-bts[master]: sysmobts: remove weird default header location In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmobts: remove weird default header location ...................................................................... sysmobts: remove weird default header location The sysmoBTS-specific headers were never looked for in the current directory. None of the CI tests use it as well. None of the other BTS models use such defaults. Let's just drop this to restore expected header location semantics. Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5 --- M configure.ac 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index a695023..51d94c6 100644 --- a/configure.ac +++ b/configure.ac @@ -73,10 +73,6 @@ # --with-sysmobts was passed, imply enable_sysmocom_bts enable_sysmocom_bts="yes" fi -if test "x$enable_sysmocom_bts" = "xyes" -a "x$sysmobts_incdir" = "x"; then - # --enable-sysmocom-bts was passed but no --with-sysmobts. Use default. - sysmobts_incdir="." -fi AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir) AC_MSG_RESULT([$enable_sysmocom_bts]) AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes") -- To view, visit https://gerrit.osmocom.org/5964 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5 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-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:57:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:35 +0000 Subject: osmo-msc[master]: MNCC: Add input validation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:57:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:45 +0000 Subject: [MERGED] osmo-bsc[master]: Fix: meas_rep.c will only use valid DL measurement reports In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix: meas_rep.c will only use valid DL measurement reports ...................................................................... Fix: meas_rep.c will only use valid DL measurement reports When averaging measurements, only the valid reports are used. If there is no valid report in the averaging window at all, an error is returned. Change-Id: I33056225ead788340755e98113d72e1cbf3ebce6 --- M src/libbsc/meas_rep.c 1 file changed, 19 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/meas_rep.c b/src/libbsc/meas_rep.c index fbd1515..73d9a1f 100644 --- a/src/libbsc/meas_rep.c +++ b/src/libbsc/meas_rep.c @@ -29,12 +29,20 @@ { switch (field) { case MEAS_REP_DL_RXLEV_FULL: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.full.rx_lev; case MEAS_REP_DL_RXLEV_SUB: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.sub.rx_lev; case MEAS_REP_DL_RXQUAL_FULL: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.full.rx_qual; case MEAS_REP_DL_RXQUAL_SUB: + if (!(rep->flags & MEAS_REP_F_DL_VALID)) + return -EINVAL; return rep->dl.sub.rx_qual; case MEAS_REP_UL_RXLEV_FULL: return rep->ul.full.rx_lev; @@ -73,7 +81,7 @@ enum meas_rep_field field, unsigned int num) { unsigned int i, idx; - int avg = 0; + int avg = 0, valid_num = 0; if (num < 1) return -EINVAL; @@ -86,11 +94,18 @@ for (i = 0; i < num; i++) { int j = (idx+i) % ARRAY_SIZE(lchan->meas_rep); + int val = get_field(&lchan->meas_rep[j], field); - avg += get_field(&lchan->meas_rep[j], field); + if (val >= 0) { + avg += val; + valid_num++; + } } - return avg / num; + if (valid_num == 0) + return -EINVAL; + + return avg / valid_num; } /* Check if N out of M last values for FIELD are >= bd */ @@ -108,7 +123,7 @@ int j = (idx + i) % ARRAY_SIZE(lchan->meas_rep); int val = get_field(&lchan->meas_rep[j], field); - if (val >= be) + if (val >= be) /* implies that val < 0 will not count */ count++; if (count >= n) -- To view, visit https://gerrit.osmocom.org/5923 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I33056225ead788340755e98113d72e1cbf3ebce6 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 01:57:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 01:57:50 +0000 Subject: [MERGED] osmo-bsc[master]: HO: Add a penalty timer list to the subscriber connection en... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: HO: Add a penalty timer list to the subscriber connection entity ...................................................................... HO: Add a penalty timer list to the subscriber connection entity This penalty timer is used to temporarily block cells where handover or assignment failed or where handover is not allowed. This is usefull to prevent repeated handover attempts to broken cells or cells that have limited allowed distance. Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c 2 files changed, 20 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index 4e07f26..d9dd2d4 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -71,6 +71,13 @@ uint8_t classmark3[14]; /* if cm3 gets extended by spec, it will be truncated */ }; +/* penalty timers for handover */ +struct ho_penalty_timer { + struct llist_head entry; + uint8_t bts; + time_t timeout; +}; + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -104,6 +111,9 @@ /* Cache DTAP messages during handover/assignment (msgb_enqueue()/msgb_dequeue())*/ struct llist_head ho_dtap_cache; unsigned int ho_dtap_cache_len; + + /* penalty timers for handover */ + struct llist_head ho_penalty_timers; }; static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 9c60af9..27bf739 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -277,6 +277,7 @@ conn->bts = lchan->ts->trx->bts; lchan->conn = conn; INIT_LLIST_HEAD(&conn->ho_dtap_cache); + INIT_LLIST_HEAD(&conn->ho_penalty_timers); llist_add_tail(&conn->entry, &net->subscr_conns); return conn; } @@ -326,6 +327,8 @@ void bsc_subscr_con_free(struct gsm_subscriber_connection *conn) { + struct ho_penalty_timer *penalty; + if (!conn) return; @@ -350,6 +353,13 @@ /* drop pending messages */ ho_dtap_cache_flush(conn, 0); + /* flush handover penalty timers */ + while ((penalty = llist_first_entry_or_null(&conn->ho_penalty_timers, + struct ho_penalty_timer, entry))) { + llist_del(&penalty->entry); + talloc_free(penalty); + } + llist_del(&conn->entry); talloc_free(conn); } -- To view, visit https://gerrit.osmocom.org/5920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I95cb7e3211b2470b773965e7aa94d8eb6c8c1a3a Gerrit-PatchSet: 7 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add missing MSC_Tests.cfg file Message-ID: Review at https://gerrit.osmocom.org/5966 msc: Add missing MSC_Tests.cfg file Change-Id: I7671a95ab83854dab70fa7af5afd3d6420c1880f --- A msc_tests/MSC_Tests.cfg 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/5966/1 diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg new file mode 100644 index 0000000..5ffa322 --- /dev/null +++ b/msc_tests/MSC_Tests.cfg @@ -0,0 +1,30 @@ +[LOGGING] +SourceInfoFormat := Single; +#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; +#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC +FileMask := LOG_ALL | TTCN_MATCHING; + +BSSAP.FileMask := LOG_NOTHING; +"MSC_Test-M3UA".FileMask := ERROR | WARNING; +"MSC_Test-SCCP".FileMask := ERROR | WARNING; +"MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING; +"MSC_Test-GSUP".FileMask := ERROR | WARNING; +"IPA-CTRL-IPA".FileMask := ERROR | WARNING; + +[TESTPORT_PARAMETERS] +#*.*.udpReuseAddress := "yes"; + +[MODULE_PARAMETERS] +M3UA_Emulation.tsp_logVerbose := true; +BSSAP_Adapter.mp_own_pc := 193; /* 0.23.3 */ +BSSAP_Adapter.mp_peer_pc := 185; /* 0.23.1 */ +BSSAP_Adapter.mp_sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" }; + +[MAIN_CONTROLLER] + +[EXECUTE] +#MSC_Tests.TC_reset +#MSC_Tests.TC_cmserv_imsi_unknown +#MSC_Tests.TC_lu_imsi_noauth_tmsi +#MSC_Tests.TC_lu_imsi_noauth_notmsi +MSC_Tests.TC_lu_imsi_reject -- To view, visit https://gerrit.osmocom.org/5966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7671a95ab83854dab70fa7af5afd3d6420c1880f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND Message-ID: Review at https://gerrit.osmocom.org/5967 BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND If the ConnHdlr initiates an outbound connection, it needs to know once that connection is established if it wants to send further data. Transform the N-CONNECT.confirm into a MSC_CONN_PRIM_CONF_IND and send it to the ConnHdlr. Make use of it from the MSC_Tests when issuing a Complete L3 Info. Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef --- M library/BSSMAP_Emulation.ttcn M msc_tests/BSC_ConnectionHandler.ttcn 2 files changed, 13 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/67/5967/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index dce8eb0..e7a432c 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -55,7 +55,9 @@ /* SCCP tell us that connection was released */ MSC_CONN_PRIM_DISC_IND, /* we tell SCCP to release connection */ - MSC_CONN_PRIM_DISC_REQ + MSC_CONN_PRIM_DISC_REQ, + /* Connection confirmed indication */ + MSC_CONN_PRIM_CONF_IND } type record BSSAP_Conn_Req { @@ -420,6 +422,9 @@ /* SCCP -> Client: connection confirm for outbound connection */ [] BSSAP.receive(BSSAP_N_CONNECT_cfm:?) -> value conn_cfm { + vc_conn := f_comp_by_conn_id(conn_cfm.connectionId); + var BSSAP_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; + CLIENT.send(prim) to vc_conn; /* handle user payload */ if (ispresent(conn_cfm.userData)) { f_handle_userData(vc_conn, conn_cfm.userData); diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 15a460b..2d6036f 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -93,6 +93,13 @@ var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); + alt { + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(fail, "DISC.ind from SCCP"); + self.stop; + } + } } /* helper function to fully establish a dedicated channel */ -- To view, visit https://gerrit.osmocom.org/5967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Implement early classmark sending in LU Message-ID: Review at https://gerrit.osmocom.org/5968 MSC_Tests: Implement early classmark sending in LU Change-Id: I019d51703c60203c7cb83a77dc7ca4b3d6623e24 --- M library/BSSMAP_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn 2 files changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/68/5968/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 8227a14..925a8e6 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -762,6 +762,50 @@ } } +template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { + elementIdentifier := '12'O, + lengthIndicator := 0, /* overwritten */ + /* CM1 */ + rf_PowerCapability := '010'B, /* class3 */ + a5_1 := '0'B, /* supported */ + esind := '1'B, /* early classmark supported */ + revisionLevel := '10'B, /* R99 */ + spare1_1 := '0'B, + /* CM2 */ + fc := '1'B, /* E-GSM support */ + vgcs := '0'B, + vbs := '0'B, + sm_Capability := '1'B, + ss_ScreenIndicator := '00'B, + ps_Capability := '1'B, + spare2_1 := '0'B, + classmarkInformationType2_oct5 := { + a5_2 := '0'B, /* not available */ + a5_3 := '1'B, /* available */ + cmsp := '0'B, /* not supported */ + solsa := '0'B, /* not suported */ + ucs2 := '0'B, /* GSM alphabet preferred */ + lcsvacap := '0'B, /* not supported */ + spare := '0'B, + cm3 := '0'B /* no CM3 */ + } +} + +template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, + template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + classmarkUpdate := { + messageType := '54'O, + classmarkInformationType2 := cm2, + classmarkInformationType3 := cm3, + talkerPriority := omit + } + } + } +} + } with { encode "RAW" }; diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 2d6036f..a404ed3 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -142,6 +142,8 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_lu); + BSSAP.send(ts_BSSMAP_ClassmarkUpd); + if (expect_auth) { /* FIXME */ } -- To view, visit https://gerrit.osmocom.org/5968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I019d51703c60203c7cb83a77dc7ca4b3d6623e24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:47 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Store CM2/CM3 in g_pars, so it can be modified Message-ID: Review at https://gerrit.osmocom.org/5969 msc: Store CM2/CM3 in g_pars, so it can be modified Change-Id: I726d851f45379b3efdb5ab62ea8f196cc0e41cc5 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/5969/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index a404ed3..402448e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -29,7 +29,9 @@ SCCP_PAR_Address sccp_addr_peer, BSSMAP_IE_CellIdentifier cell_id, hexstring imsi, - hexstring msisdn + hexstring msisdn, + BSSMAP_IE_ClassmarkInformationType2 cm2, + BSSMAP_IE_ClassmarkInformationType3 cm3 optional }; @@ -142,7 +144,7 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_lu); - BSSAP.send(ts_BSSMAP_ClassmarkUpd); + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); if (expect_auth) { /* FIXME */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index e336e9a..0acfdb2 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -308,7 +308,9 @@ sccp_addr_peer := g_sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), imsi := f_gen_imsi('26242'H, imsi_suffix), - msisdn := f_gen_msisdn('491239999'H, imsi_suffix) + msisdn := f_gen_msisdn('491239999'H, imsi_suffix), + cm2 := valueof(ts_CM2_default), + cm3 := omit }; vc_conn := BSC_ConnHdlr.create(id); -- To view, visit https://gerrit.osmocom.org/5969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I726d851f45379b3efdb5ab62ea8f196cc0e41cc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:48 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC_Types: Define '0' in various enums for unused value Message-ID: Review at https://gerrit.osmocom.org/5970 MNCC_Types: Define '0' in various enums for unused value it seems the decoder is using '0' in positions where we have not defined any enum value for '0'. Work around that. Change-Id: I6bf0540f7ddd4dbe3b6c6ac06421a933126a7e17 --- M library/MNCC_Types.ttcn 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/70/5970/1 diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 7bd47ee..f1d9e37 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -16,6 +16,7 @@ /* GSM 04.08 Bearer Capability: Signalling access protocol */ type enumerated GSM48_bcap_sig_access { + GSM48_BCAP_SA_NONE (0), GSM48_BCAP_SA_I440_I450 (1), GSM48_BCAP_SA_X21 (2), GSM48_BCAP_SA_X28_DP_IN (3), @@ -26,6 +27,7 @@ /* GSM 04.08 Bearer Capability: User Rate */ type enumerated GSM48_bcap_user_rate { + GSM48_BCAP_UR_NONE (0), GSM48_BCAP_UR_300 (1), GSM48_BCAP_UR_1200 (2), GSM48_BCAP_UR_2400 (3), @@ -46,6 +48,7 @@ /* GSM 04.08 Bearer Capability: Intermediate Rate */ type enumerated GSM48_bcap_interm_rate { + GSM48_BCAP_IR_NONE (0), GSM48_BCAP_IR_8k (2), GSM48_BCAP_IR_16k (3) }; -- To view, visit https://gerrit.osmocom.org/5970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6bf0540f7ddd4dbe3b6c6ac06421a933126a7e17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:48 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MNCC: Properly terminate speech version array Message-ID: Review at https://gerrit.osmocom.org/5971 MNCC: Properly terminate speech version array MNCC has this weird encoding that the speech version array must be terminated with one element '-1' at the end. Let's make sure our default complies to this rule. Change-Id: I2e06ed1b558c58a62a00ea8d3573bb31c0c3e750 Related: OS#2853 --- M library/MNCC_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/5971/1 diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index f1d9e37..1d7980a 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -169,7 +169,7 @@ coding := 0, /* GSM standard */ radio := 3, /* FR/HR, FR preferred */ speech_ctm := 0, /* not supported */ - speech_ver := { 0, 2, 4, 1, 5 }, + speech_ver := { 0, 2, 4, 1, 5, -1 }, data := omit }; -- To view, visit https://gerrit.osmocom.org/5971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e06ed1b558c58a62a00ea8d3573bb31c0c3e750 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:49 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: More MNCC and L3 templates towards voice testing Message-ID: Review at https://gerrit.osmocom.org/5972 msc: More MNCC and L3 templates towards voice testing Change-Id: I3132a856175fc9421e1a0bfd37620d6b1625574b --- M library/L3_Templates.ttcn M library/MNCC_Types.ttcn 2 files changed, 141 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/5972/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 87c9bd9..0da4706 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -300,6 +300,134 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := '000'B, + tiFlag := '0'B, + tIExtension := omit + } + } +} + +template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := { + elementIdentifier := '5E'O, + lengthIndicator := 0, /* overwritten */ + numberingPlanIdentification := '0000'B, + typeOfNumber := '000'B, /* unknown */ + ext1 := '0'B, + digits := digits +} + +template (value) BearerCapability_TLV ts_Bcap_voice := { + elementIdentifier := '04'O, + lengthIndicator := 0, /* overwritten */ + octet3 := { + informationTransferCapability := '000'B, + transferMode := '0'B, + codingStandard := '0'B, + radioChannelRequirement := '11'B, /* FR preferred */ + extension_octet_3 := '0'B, /* overwritten */ + speech_aux_3a_3b := omit + }, + octet4 := omit, + octet5 := omit, + octet6 := omit, + octet7 := omit +} + +template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + setup_MS_NW := { + messageType := '000101'B, + nsd := '00'B, + bcRepeatIndicator := omit, + bearerCapability1 := bcap, + bearerCapability2 := omit, + facility := omit, + callingPartySubAddress := omit, + calledPartyBCD_Number := ts_Called(called), + calledPartySubAddress := omit, + llc_RepeatIndicator := omit, + lowLayerCompatibility1 := omit, + lowLayerCompatibility2 := omit, + hlc_RepeatIndicator := omit, + highLayerCompatibility1 := omit, + highLayerCompatibility2 := omit, + user_user := omit, + ss_VersionIndicator := omit, + clir_Suppression := omit, + clir_Invocation := omit, + cC_Capabilities := omit, + facility_ccbs1 := omit, + facility_ccbs2 := omit, + streamIdentifier := omit, + supportedCodecs := omit, + redial := omit + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + callProceeding := { + messageType := '000010'B, + nsd := '00'B, + repeatIndicator := *, + bearerCapability1 := *, + bearerCapability2 := *, + facility := *, + progressIndicator := *, + priorityGranted := *, + networkCCCapabilities := * + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + alerting_NW_MS := { + messageType := '000001'B, + nsd := '00'B, + facility := *, + progressIndicator := *, + user_user := * + } + } + } +} + + } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 1d7980a..e5d6af9 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -238,7 +238,7 @@ -template MNCC_number ts_MNCC_number(charstring number, +template (value) MNCC_number ts_MNCC_number(charstring number, GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL, GSM48_num_plan_ind npi := GSM48_NUMPLAN_E164, GSM48_present_ind pres := GSM48_PRES_IND_ALLOWED, @@ -250,6 +250,18 @@ number := number } +template MNCC_number tr_MNCC_number(template charstring number, + template GSM48_type_of_number ton := ?, + template GSM48_num_plan_ind npi := ?, + template GSM48_present_ind pres := ?, + template GSM48_screening_ind screen := ?) := { + number_type := ton, + plan := npi, + presence := pres, + screen := screen, + number := number +} + type record MNCC_cause { GSM48_cause_loc location, GSM48_cause_coding coding, -- To view, visit https://gerrit.osmocom.org/5972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3132a856175fc9421e1a0bfd37620d6b1625574b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:50 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Prepare authentication support Message-ID: Review at https://gerrit.osmocom.org/5973 msc: Prepare authentication support Change-Id: I930bed1907fd0faf61788cf14e75f2b2337572f4 --- M library/GSUP_Types.ttcn M msc_tests/BSC_ConnectionHandler.ttcn 2 files changed, 5 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/5973/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index ac85fca..7455085 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -139,6 +139,9 @@ template GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); +template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); + template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 402448e..d3dcd29 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -147,7 +147,9 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); if (expect_auth) { + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); /* FIXME */ + //GSUP.send(tr_GSUP_SAI_RES()); } /* Expect MSC to perform LU with HLR */ -- To view, visit https://gerrit.osmocom.org/5973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I930bed1907fd0faf61788cf14e75f2b2337572f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:01:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:01:51 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: make sending of early classmark optional Message-ID: Review at https://gerrit.osmocom.org/5974 msc: make sending of early classmark optional Change-Id: If25ba412ab393029ed7ae9af47e87d5f4a44acfc --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/74/5974/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index d3dcd29..39acfb7 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -133,7 +133,7 @@ return l3_info; } -function f_perform_lu(boolean expect_auth, boolean expect_tmsi) +function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -144,7 +144,9 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_lu); - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (send_early_cm) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } if (expect_auth) { GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 0acfdb2..68e0bef 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -336,9 +336,8 @@ private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - f_perform_lu(false, true); + f_perform_lu(false, true, true); } - testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); @@ -349,9 +348,8 @@ private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - f_perform_lu(false, false); + f_perform_lu(false, false, true); } - testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); -- To view, visit https://gerrit.osmocom.org/5974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If25ba412ab393029ed7ae9af47e87d5f4a44acfc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:18 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:20 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add missing MSC_Tests.cfg file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7671a95ab83854dab70fa7af5afd3d6420c1880f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:23 +0000 Subject: osmo-ttcn3-hacks[master]: MSC_Tests: Implement early classmark sending in LU In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I019d51703c60203c7cb83a77dc7ca4b3d6623e24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:25 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Store CM2/CM3 in g_pars, so it can be modified In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I726d851f45379b3efdb5ab62ea8f196cc0e41cc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:28 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC_Types: Define '0' in various enums for unused value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6bf0540f7ddd4dbe3b6c6ac06421a933126a7e17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:36 +0000 Subject: osmo-ttcn3-hacks[master]: MNCC: Properly terminate speech version array In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2e06ed1b558c58a62a00ea8d3573bb31c0c3e750 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:38 +0000 Subject: osmo-ttcn3-hacks[master]: msc: More MNCC and L3 templates towards voice testing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3132a856175fc9421e1a0bfd37620d6b1625574b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:40 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Prepare authentication support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I930bed1907fd0faf61788cf14e75f2b2337572f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:50 +0000 Subject: osmo-ttcn3-hacks[master]: msc: make sending of early classmark optional In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If25ba412ab393029ed7ae9af47e87d5f4a44acfc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 02:02:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:51 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: make sending of early classmark optional In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: make sending of early classmark optional ...................................................................... msc: make sending of early classmark optional Change-Id: If25ba412ab393029ed7ae9af47e87d5f4a44acfc --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index d3dcd29..39acfb7 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -133,7 +133,7 @@ return l3_info; } -function f_perform_lu(boolean expect_auth, boolean expect_tmsi) +function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -144,7 +144,9 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_lu); - BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + if (send_early_cm) { + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + } if (expect_auth) { GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 0acfdb2..68e0bef 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -336,9 +336,8 @@ private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - f_perform_lu(false, true); + f_perform_lu(false, true, true); } - testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); @@ -349,9 +348,8 @@ private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - f_perform_lu(false, false); + f_perform_lu(false, false, true); } - testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); -- To view, visit https://gerrit.osmocom.org/5974 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If25ba412ab393029ed7ae9af47e87d5f4a44acfc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:51 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Prepare authentication support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Prepare authentication support ...................................................................... msc: Prepare authentication support Change-Id: I930bed1907fd0faf61788cf14e75f2b2337572f4 --- M library/GSUP_Types.ttcn M msc_tests/BSC_ConnectionHandler.ttcn 2 files changed, 5 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index ac85fca..7455085 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -139,6 +139,9 @@ template GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); +template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); + template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 402448e..d3dcd29 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -147,7 +147,9 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); if (expect_auth) { + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); /* FIXME */ + //GSUP.send(tr_GSUP_SAI_RES()); } /* Expect MSC to perform LU with HLR */ -- To view, visit https://gerrit.osmocom.org/5973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I930bed1907fd0faf61788cf14e75f2b2337572f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:52 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: More MNCC and L3 templates towards voice testing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: More MNCC and L3 templates towards voice testing ...................................................................... msc: More MNCC and L3 templates towards voice testing Change-Id: I3132a856175fc9421e1a0bfd37620d6b1625574b --- M library/L3_Templates.ttcn M library/MNCC_Types.ttcn 2 files changed, 141 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 87c9bd9..0da4706 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -300,6 +300,134 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := '000'B, + tiFlag := '0'B, + tIExtension := omit + } + } +} + +template (value) CalledPartyBCD_Number ts_Called(hexstring digits) := { + elementIdentifier := '5E'O, + lengthIndicator := 0, /* overwritten */ + numberingPlanIdentification := '0000'B, + typeOfNumber := '000'B, /* unknown */ + ext1 := '0'B, + digits := digits +} + +template (value) BearerCapability_TLV ts_Bcap_voice := { + elementIdentifier := '04'O, + lengthIndicator := 0, /* overwritten */ + octet3 := { + informationTransferCapability := '000'B, + transferMode := '0'B, + codingStandard := '0'B, + radioChannelRequirement := '11'B, /* FR preferred */ + extension_octet_3 := '0'B, /* overwritten */ + speech_aux_3a_3b := omit + }, + octet4 := omit, + octet5 := omit, + octet6 := omit, + octet7 := omit +} + +template PDU_ML3_MS_NW ts_ML3_MO_CC_SETUP(integer tid, hexstring called, template BearerCapability_TLV bcap := ts_Bcap_voice) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + setup_MS_NW := { + messageType := '000101'B, + nsd := '00'B, + bcRepeatIndicator := omit, + bearerCapability1 := bcap, + bearerCapability2 := omit, + facility := omit, + callingPartySubAddress := omit, + calledPartyBCD_Number := ts_Called(called), + calledPartySubAddress := omit, + llc_RepeatIndicator := omit, + lowLayerCompatibility1 := omit, + lowLayerCompatibility2 := omit, + hlc_RepeatIndicator := omit, + highLayerCompatibility1 := omit, + highLayerCompatibility2 := omit, + user_user := omit, + ss_VersionIndicator := omit, + clir_Suppression := omit, + clir_Invocation := omit, + cC_Capabilities := omit, + facility_ccbs1 := omit, + facility_ccbs2 := omit, + streamIdentifier := omit, + supportedCodecs := omit, + redial := omit + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + callProceeding := { + messageType := '000010'B, + nsd := '00'B, + repeatIndicator := *, + bearerCapability1 := *, + bearerCapability2 := *, + facility := *, + progressIndicator := *, + priorityGranted := *, + networkCCCapabilities := * + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_CC_ALERTING(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + alerting_NW_MS := { + messageType := '000001'B, + nsd := '00'B, + facility := *, + progressIndicator := *, + user_user := * + } + } + } +} + + } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 1d7980a..e5d6af9 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -238,7 +238,7 @@ -template MNCC_number ts_MNCC_number(charstring number, +template (value) MNCC_number ts_MNCC_number(charstring number, GSM48_type_of_number ton := GSM48_TON_INTERNATIONAL, GSM48_num_plan_ind npi := GSM48_NUMPLAN_E164, GSM48_present_ind pres := GSM48_PRES_IND_ALLOWED, @@ -250,6 +250,18 @@ number := number } +template MNCC_number tr_MNCC_number(template charstring number, + template GSM48_type_of_number ton := ?, + template GSM48_num_plan_ind npi := ?, + template GSM48_present_ind pres := ?, + template GSM48_screening_ind screen := ?) := { + number_type := ton, + plan := npi, + presence := pres, + screen := screen, + number := number +} + type record MNCC_cause { GSM48_cause_loc location, GSM48_cause_coding coding, -- To view, visit https://gerrit.osmocom.org/5972 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3132a856175fc9421e1a0bfd37620d6b1625574b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:53 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC: Properly terminate speech version array In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC: Properly terminate speech version array ...................................................................... MNCC: Properly terminate speech version array MNCC has this weird encoding that the speech version array must be terminated with one element '-1' at the end. Let's make sure our default complies to this rule. Change-Id: I2e06ed1b558c58a62a00ea8d3573bb31c0c3e750 Related: OS#2853 --- M library/MNCC_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index f1d9e37..1d7980a 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -169,7 +169,7 @@ coding := 0, /* GSM standard */ radio := 3, /* FR/HR, FR preferred */ speech_ctm := 0, /* not supported */ - speech_ver := { 0, 2, 4, 1, 5 }, + speech_ver := { 0, 2, 4, 1, 5, -1 }, data := omit }; -- To view, visit https://gerrit.osmocom.org/5971 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e06ed1b558c58a62a00ea8d3573bb31c0c3e750 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:53 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MNCC_Types: Define '0' in various enums for unused value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC_Types: Define '0' in various enums for unused value ...................................................................... MNCC_Types: Define '0' in various enums for unused value it seems the decoder is using '0' in positions where we have not defined any enum value for '0'. Work around that. Change-Id: I6bf0540f7ddd4dbe3b6c6ac06421a933126a7e17 --- M library/MNCC_Types.ttcn 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 7bd47ee..f1d9e37 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -16,6 +16,7 @@ /* GSM 04.08 Bearer Capability: Signalling access protocol */ type enumerated GSM48_bcap_sig_access { + GSM48_BCAP_SA_NONE (0), GSM48_BCAP_SA_I440_I450 (1), GSM48_BCAP_SA_X21 (2), GSM48_BCAP_SA_X28_DP_IN (3), @@ -26,6 +27,7 @@ /* GSM 04.08 Bearer Capability: User Rate */ type enumerated GSM48_bcap_user_rate { + GSM48_BCAP_UR_NONE (0), GSM48_BCAP_UR_300 (1), GSM48_BCAP_UR_1200 (2), GSM48_BCAP_UR_2400 (3), @@ -46,6 +48,7 @@ /* GSM 04.08 Bearer Capability: Intermediate Rate */ type enumerated GSM48_bcap_interm_rate { + GSM48_BCAP_IR_NONE (0), GSM48_BCAP_IR_8k (2), GSM48_BCAP_IR_16k (3) }; -- To view, visit https://gerrit.osmocom.org/5970 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6bf0540f7ddd4dbe3b6c6ac06421a933126a7e17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:54 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Store CM2/CM3 in g_pars, so it can be modified In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Store CM2/CM3 in g_pars, so it can be modified ...................................................................... msc: Store CM2/CM3 in g_pars, so it can be modified Change-Id: I726d851f45379b3efdb5ab62ea8f196cc0e41cc5 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 7 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index a404ed3..402448e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -29,7 +29,9 @@ SCCP_PAR_Address sccp_addr_peer, BSSMAP_IE_CellIdentifier cell_id, hexstring imsi, - hexstring msisdn + hexstring msisdn, + BSSMAP_IE_ClassmarkInformationType2 cm2, + BSSMAP_IE_ClassmarkInformationType3 cm3 optional }; @@ -142,7 +144,7 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_lu); - BSSAP.send(ts_BSSMAP_ClassmarkUpd); + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); if (expect_auth) { /* FIXME */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index e336e9a..0acfdb2 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -308,7 +308,9 @@ sccp_addr_peer := g_sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), imsi := f_gen_imsi('26242'H, imsi_suffix), - msisdn := f_gen_msisdn('491239999'H, imsi_suffix) + msisdn := f_gen_msisdn('491239999'H, imsi_suffix), + cm2 := valueof(ts_CM2_default), + cm3 := omit }; vc_conn := BSC_ConnHdlr.create(id); -- To view, visit https://gerrit.osmocom.org/5969 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I726d851f45379b3efdb5ab62ea8f196cc0e41cc5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:54 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC_Tests: Implement early classmark sending in LU In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC_Tests: Implement early classmark sending in LU ...................................................................... MSC_Tests: Implement early classmark sending in LU Change-Id: I019d51703c60203c7cb83a77dc7ca4b3d6623e24 --- M library/BSSMAP_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn 2 files changed, 46 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 8227a14..925a8e6 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -762,6 +762,50 @@ } } +template BSSMAP_IE_ClassmarkInformationType2 ts_CM2_default := { + elementIdentifier := '12'O, + lengthIndicator := 0, /* overwritten */ + /* CM1 */ + rf_PowerCapability := '010'B, /* class3 */ + a5_1 := '0'B, /* supported */ + esind := '1'B, /* early classmark supported */ + revisionLevel := '10'B, /* R99 */ + spare1_1 := '0'B, + /* CM2 */ + fc := '1'B, /* E-GSM support */ + vgcs := '0'B, + vbs := '0'B, + sm_Capability := '1'B, + ss_ScreenIndicator := '00'B, + ps_Capability := '1'B, + spare2_1 := '0'B, + classmarkInformationType2_oct5 := { + a5_2 := '0'B, /* not available */ + a5_3 := '1'B, /* available */ + cmsp := '0'B, /* not supported */ + solsa := '0'B, /* not suported */ + ucs2 := '0'B, /* GSM alphabet preferred */ + lcsvacap := '0'B, /* not supported */ + spare := '0'B, + cm3 := '0'B /* no CM3 */ + } +} + +template PDU_BSSAP ts_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := ts_CM2_default, + template BSSMAP_IE_ClassmarkInformationType3 cm3 := omit) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + classmarkUpdate := { + messageType := '54'O, + classmarkInformationType2 := cm2, + classmarkInformationType3 := cm3, + talkerPriority := omit + } + } + } +} + } with { encode "RAW" }; diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 2d6036f..a404ed3 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -142,6 +142,8 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_lu); + BSSAP.send(ts_BSSMAP_ClassmarkUpd); + if (expect_auth) { /* FIXME */ } -- To view, visit https://gerrit.osmocom.org/5968 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I019d51703c60203c7cb83a77dc7ca4b3d6623e24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:54 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add missing MSC_Tests.cfg file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add missing MSC_Tests.cfg file ...................................................................... msc: Add missing MSC_Tests.cfg file Change-Id: I7671a95ab83854dab70fa7af5afd3d6420c1880f --- A msc_tests/MSC_Tests.cfg 1 file changed, 30 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg new file mode 100644 index 0000000..5ffa322 --- /dev/null +++ b/msc_tests/MSC_Tests.cfg @@ -0,0 +1,30 @@ +[LOGGING] +SourceInfoFormat := Single; +#FileMask := LOG_ALL | TTCN_DEBUG | TTCN_MATCHING | DEBUG_ENCDEC; +#ConsoleMask := ERROR | WARNING | TESTCASE | TTCN_MATCHING | DEBUG_ENCDEC +FileMask := LOG_ALL | TTCN_MATCHING; + +BSSAP.FileMask := LOG_NOTHING; +"MSC_Test-M3UA".FileMask := ERROR | WARNING; +"MSC_Test-SCCP".FileMask := ERROR | WARNING; +"MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING; +"MSC_Test-GSUP".FileMask := ERROR | WARNING; +"IPA-CTRL-IPA".FileMask := ERROR | WARNING; + +[TESTPORT_PARAMETERS] +#*.*.udpReuseAddress := "yes"; + +[MODULE_PARAMETERS] +M3UA_Emulation.tsp_logVerbose := true; +BSSAP_Adapter.mp_own_pc := 193; /* 0.23.3 */ +BSSAP_Adapter.mp_peer_pc := 185; /* 0.23.1 */ +BSSAP_Adapter.mp_sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" }; + +[MAIN_CONTROLLER] + +[EXECUTE] +#MSC_Tests.TC_reset +#MSC_Tests.TC_cmserv_imsi_unknown +#MSC_Tests.TC_lu_imsi_noauth_tmsi +#MSC_Tests.TC_lu_imsi_noauth_notmsi +MSC_Tests.TC_lu_imsi_reject -- To view, visit https://gerrit.osmocom.org/5966 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7671a95ab83854dab70fa7af5afd3d6420c1880f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 02:02:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 02:02:55 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND ...................................................................... BSSMAP_Emulation: Introduce new MSC_CONN_PRIM_CONF_IND If the ConnHdlr initiates an outbound connection, it needs to know once that connection is established if it wants to send further data. Transform the N-CONNECT.confirm into a MSC_CONN_PRIM_CONF_IND and send it to the ConnHdlr. Make use of it from the MSC_Tests when issuing a Complete L3 Info. Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef --- M library/BSSMAP_Emulation.ttcn M msc_tests/BSC_ConnectionHandler.ttcn 2 files changed, 13 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index dce8eb0..e7a432c 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -55,7 +55,9 @@ /* SCCP tell us that connection was released */ MSC_CONN_PRIM_DISC_IND, /* we tell SCCP to release connection */ - MSC_CONN_PRIM_DISC_REQ + MSC_CONN_PRIM_DISC_REQ, + /* Connection confirmed indication */ + MSC_CONN_PRIM_CONF_IND } type record BSSAP_Conn_Req { @@ -420,6 +422,9 @@ /* SCCP -> Client: connection confirm for outbound connection */ [] BSSAP.receive(BSSAP_N_CONNECT_cfm:?) -> value conn_cfm { + vc_conn := f_comp_by_conn_id(conn_cfm.connectionId); + var BSSAP_Conn_Prim prim := MSC_CONN_PRIM_CONF_IND; + CLIENT.send(prim) to vc_conn; /* handle user payload */ if (ispresent(conn_cfm.userData)) { f_handle_userData(vc_conn, conn_cfm.userData); diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 15a460b..2d6036f 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -93,6 +93,13 @@ var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3); BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, l3_enc)))); + alt { + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_CONF_IND) {} + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(fail, "DISC.ind from SCCP"); + self.stop; + } + } } /* helper function to fully establish a dedicated channel */ -- To view, visit https://gerrit.osmocom.org/5967 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7293a9f4993d13c90316224eb9f13e10130388ef Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 09:36:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 09:36:14 +0000 Subject: libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Patch Set 2: > You can also check putting a debug printf That's actually good idea: you can add this printf and update expected test output to remove any doubts. -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:05:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:05:52 +0000 Subject: [PATCH] osmo-ci[master]: Coverity: specify sysmoBTS L1 headers explicitly Message-ID: Review at https://gerrit.osmocom.org/5975 Coverity: specify sysmoBTS L1 headers explicitly Fix upload by specifying L1 headers location properly. Fixes: OS#2845 Change-Id: Iba55922295cb2a258f90c5345f592d7d5f34ac51 --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/75/5975/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index bd30fd7..4da9ec6 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -45,7 +45,7 @@ build_osmobts() { pushd osmo-bts - do_build --enable-sysmocom-bts --enable-trx + do_build --enable-sysmocom-bts --with-sysmobts="$prefix/include/" --enable-trx popd } -- To view, visit https://gerrit.osmocom.org/5975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba55922295cb2a258f90c5345f592d7d5f34ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:05:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:05:53 +0000 Subject: [PATCH] osmo-ci[master]: cosmetic: remove unused function Message-ID: Review at https://gerrit.osmocom.org/5976 cosmetic: remove unused function Change-Id: Ie3885237cea2afbe5e8c0f89d2280284bb4d9150 --- M coverity/build_Osmocom.sh 1 file changed, 0 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/76/5976/1 diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 4da9ec6..18c9b0b 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -10,10 +10,6 @@ export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -git_branch() { - echo "$(git status)" | grep 'On branch' | sed 's/On branch //' -} - do_build() { autoreconf --install --force ./configure --prefix="$prefix" $* -- To view, visit https://gerrit.osmocom.org/5976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3885237cea2afbe5e8c0f89d2280284bb4d9150 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:05:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:05:53 +0000 Subject: [PATCH] osmo-ci[master]: cosmetic: remove wrapper script Message-ID: Review at https://gerrit.osmocom.org/5977 cosmetic: remove wrapper script The jenkins.sh is just a tiny wrapper around coverity_Osmocom.sh - let's remove this unnecessary indirection and move the code directly to jenkins.sh Change-Id: Iead3b8f39327f1d0dd80e12a9d38563c35701993 --- D coverity/coverity_Osmocom.sh M coverity/jenkins.sh 2 files changed, 38 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/77/5977/1 diff --git a/coverity/coverity_Osmocom.sh b/coverity/coverity_Osmocom.sh deleted file mode 100755 index 33d4fa5..0000000 --- a/coverity/coverity_Osmocom.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -e -x - -base_dir="$PWD" -src_dir="$base_dir/source-Osmocom" -cov_dir="$src_dir/cov-int" - -rm -rf "$src_dir" -./prepare_source_Osmcocom.sh - -export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH" - -rm -rf "$cov_dir" -cov-build --dir "$cov_dir" ./build_Osmocom.sh - -cd "$src_dir" -rm -f Osmocom.tgz -tar czf Osmocom.tgz cov-int - -# Don't leak the token to jenkins build logs, but still log the call: -# First compose the call to echo, then run with token inserted by 'eval'. -set +x - -curl_cmd='curl \ - --form token="$token" \ - --form email=holger at freyther.de --form file=@Osmocom.tgz \ - --form version=Version --form description=AutoUpload \ - https://scan.coverity.com/builds?project=Osmocom' -echo "$curl_cmd" - -token="$($base_dir/get_token.sh $base_dir/tokens.txt Osmocom)" -if [ -z "$token" ]; then - echo "TOKEN IS EMPTY" - exit 1 -fi - -eval "$curl_cmd" diff --git a/coverity/jenkins.sh b/coverity/jenkins.sh index 9adfe99..33d4fa5 100755 --- a/coverity/jenkins.sh +++ b/coverity/jenkins.sh @@ -1,2 +1,38 @@ -#!/bin/sh -./coverity_Osmocom.sh +#!/usr/bin/env bash + +set -e -x + +base_dir="$PWD" +src_dir="$base_dir/source-Osmocom" +cov_dir="$src_dir/cov-int" + +rm -rf "$src_dir" +./prepare_source_Osmcocom.sh + +export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH" + +rm -rf "$cov_dir" +cov-build --dir "$cov_dir" ./build_Osmocom.sh + +cd "$src_dir" +rm -f Osmocom.tgz +tar czf Osmocom.tgz cov-int + +# Don't leak the token to jenkins build logs, but still log the call: +# First compose the call to echo, then run with token inserted by 'eval'. +set +x + +curl_cmd='curl \ + --form token="$token" \ + --form email=holger at freyther.de --form file=@Osmocom.tgz \ + --form version=Version --form description=AutoUpload \ + https://scan.coverity.com/builds?project=Osmocom' +echo "$curl_cmd" + +token="$($base_dir/get_token.sh $base_dir/tokens.txt Osmocom)" +if [ -z "$token" ]; then + echo "TOKEN IS EMPTY" + exit 1 +fi + +eval "$curl_cmd" -- To view, visit https://gerrit.osmocom.org/5977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iead3b8f39327f1d0dd80e12a9d38563c35701993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:10:43 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Jan 2018 10:10:43 +0000 Subject: osmo-ci[master]: Coverity: specify sysmoBTS L1 headers explicitly In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba55922295cb2a258f90c5345f592d7d5f34ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:11:18 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Jan 2018 10:11:18 +0000 Subject: osmo-ci[master]: cosmetic: remove unused function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3885237cea2afbe5e8c0f89d2280284bb4d9150 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:11:50 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Jan 2018 10:11:50 +0000 Subject: osmo-ci[master]: cosmetic: remove wrapper script In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iead3b8f39327f1d0dd80e12a9d38563c35701993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:15:23 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:15:23 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: move header check to appropriate place Message-ID: Review at https://gerrit.osmocom.org/5978 sysmobts: move header check to appropriate place Move the header check specific to sysmoBTS 2050 next to generic sysmoBTS header check. Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a --- M configure.ac 1 file changed, 8 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/5978/1 diff --git a/configure.ac b/configure.ac index 51d94c6..8193ef9 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,14 @@ AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) + + # Check for the sbts2050_header.h that was added after the 3.6 release + AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"],[]) + + if test "$sysmo_uc_header" = "yes" ; then + AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050]) + fi + AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") PKG_CHECK_MODULES(LIBGPS, libgps) CPPFLAGS=$oldCPPFLAGS fi @@ -177,17 +185,6 @@ CPPFLAGS=$oldCPPFLAGS fi -# Check for the sbts2050_header.h that was added after the 3.6 release -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR" -AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], - [sysmo_uc_header="yes"],[]) -CPPFLAGS=$oldCPPFLAGS - -if test "$sysmo_uc_header" = "yes" ; then - AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050]) -fi -AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") AM_CONFIG_HEADER(btsconfig.h) AC_OUTPUT( -- To view, visit https://gerrit.osmocom.org/5978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:18:18 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Jan 2018 10:18:18 +0000 Subject: libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Patch Set 2: > > You can also check putting a debug printf > > That's actually good idea: you can add this printf and update > expected test output to remove any doubts. But unrelated to USSD testing at all ;) @Harald, the answer to this question is in the commit msg now. -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:22:08 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Jan 2018 10:22:08 +0000 Subject: osmo-bts[master]: sysmobts: move header check to appropriate place In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/5978/1/configure.ac File configure.ac: Line 92: AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") Be careful because there may be difference with previous logic, as in BUILD_SBTS2050 probably being always defined (either 1 or 0) and now only being defined if --enable-sysmobts is passed. I don't know the details of AM_CONDITIONALS but may be worth having a look if that's fine, as we may require the BUILD_SBTS2050 var to be always defined. -- To view, visit https://gerrit.osmocom.org/5978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts 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 Mon Jan 22 10:24:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:24:55 +0000 Subject: [PATCH] osmo-bts[master]: sysmobts: move header check to appropriate place In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5978 to look at the new patch set (#2). sysmobts: move header check to appropriate place Move the header check specific to sysmoBTS 2050 next to generic sysmoBTS header check. Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a --- M configure.ac 1 file changed, 8 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/78/5978/2 diff --git a/configure.ac b/configure.ac index 51d94c6..db8a97d 100644 --- a/configure.ac +++ b/configure.ac @@ -82,9 +82,17 @@ AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) + + # Check for the sbts2050_header.h that was added after the 3.6 release + AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"], []) + if test "$sysmo_uc_header" = "yes" ; then + AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050]) + fi + PKG_CHECK_MODULES(LIBGPS, libgps) CPPFLAGS=$oldCPPFLAGS fi +AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) AC_ARG_ENABLE(trx, @@ -177,17 +185,6 @@ CPPFLAGS=$oldCPPFLAGS fi -# Check for the sbts2050_header.h that was added after the 3.6 release -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR" -AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], - [sysmo_uc_header="yes"],[]) -CPPFLAGS=$oldCPPFLAGS - -if test "$sysmo_uc_header" = "yes" ; then - AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050]) -fi -AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") AM_CONFIG_HEADER(btsconfig.h) AC_OUTPUT( -- To view, visit https://gerrit.osmocom.org/5978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:27:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:27:15 +0000 Subject: [PATCH] libosmocore[master]: jenkins: move make invocation into shared function 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/5874 to look at the new patch set (#2). jenkins: move make invocation into shared function Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 --- M contrib/jenkins_amd64.sh M contrib/jenkins_arm.sh M contrib/jenkins_common.sh 3 files changed, 8 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/74/5874/2 diff --git a/contrib/jenkins_amd64.sh b/contrib/jenkins_amd64.sh index d336f0a..ff1cfdc 100755 --- a/contrib/jenkins_amd64.sh +++ b/contrib/jenkins_amd64.sh @@ -15,9 +15,9 @@ prep_build "$src_dir" "$build_dir" - "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" - $MAKE V=1 $PARALLEL_MAKE check \ - || cat-testlogs.sh + "$src_dir"/configure --disable-silent-rules --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + + run_make } # verify build in dir other than source tree diff --git a/contrib/jenkins_arm.sh b/contrib/jenkins_arm.sh index acdbe3c..4579596 100755 --- a/contrib/jenkins_arm.sh +++ b/contrib/jenkins_arm.sh @@ -16,8 +16,7 @@ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - $MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh + run_make } # verify build in dir other than source tree diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index a6ffe7f..fa1d544 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -26,3 +26,7 @@ mkdir -p "$_build_dir" cd "$_build_dir" } + +run_make() { + $MAKE $PARALLEL_MAKE check || cat-testlogs.sh +} -- To view, visit https://gerrit.osmocom.org/5874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:31:31 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Jan 2018 10:31:31 +0000 Subject: osmo-bts[master]: sysmobts: move header check to appropriate place In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:31:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:31:59 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Use Osmocom-patched UNIX_DOMAIN_SOCKETasp for SEQPACKET support Message-ID: Review at https://gerrit.osmocom.org/5979 Use Osmocom-patched UNIX_DOMAIN_SOCKETasp for SEQPACKET support Upstream TITAN doesn't have this yet (it's submitted, though), so we have to use our own repo for titan.TestPorts.UNIX_DOMAIN_SOCKETasp and at the same time make sure that our MNCC port is using SEQPACKET in MSC_Tests.cfg Change-Id: Ifa3661d8f818564d595c4612e5612a245a31a8f4 --- M deps/Makefile M msc_tests/MSC_Tests.cfg 2 files changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/79/5979/1 diff --git a/deps/Makefile b/deps/Makefile index ac66493..64f5c2c 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -1,6 +1,7 @@ ECLIPSEGIT:=https://github.com/eclipse ECLIPSEGIT2:=git://git.eclipse.org/gitroot/titan +OSMOGITHUB:=https://github.com/osmocom ECLIPSEGIT_REPOS= titan.Libraries.TCCUsefulFunctions \ titan.ProtocolModules.ICMP \ @@ -20,8 +21,7 @@ titan.TestPorts.SIPmsg \ titan.TestPorts.TCPasp \ titan.TestPorts.TELNETasp \ - titan.TestPorts.UDPasp \ - titan.TestPorts.UNIX_DOMAIN_SOCKETasp + titan.TestPorts.UDPasp ECLIPSEGIT2_REPOS= titan.ProtocolModules.GRE \ titan.ProtocolModules.M2PA \ @@ -40,7 +40,9 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 -ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) +OSMOGITHUB_REPOS= titan.TestPorts.UNIX_DOMAIN_SOCKETasp + +ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) all: $(ALL_REPOS) @@ -65,3 +67,6 @@ $(foreach dir,$(ECLIPSEGIT2_REPOS), \ $(eval $(call GIT_template,$(dir),$(ECLIPSEGIT2)))) + +$(foreach dir,$(OSMOGITHUB_REPOS), \ + $(eval $(call GIT_template,$(dir),$(OSMOGITHUB)))) diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg index 5ffa322..2bd9dd2 100644 --- a/msc_tests/MSC_Tests.cfg +++ b/msc_tests/MSC_Tests.cfg @@ -13,6 +13,7 @@ [TESTPORT_PARAMETERS] #*.*.udpReuseAddress := "yes"; +"MSC_Test-MNCC".MNCC.socket_type := "SEQPACKET"; [MODULE_PARAMETERS] M3UA_Emulation.tsp_logVerbose := true; -- To view, visit https://gerrit.osmocom.org/5979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa3661d8f818564d595c4612e5612a245a31a8f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:34:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:34:45 +0000 Subject: osmo-ttcn3-hacks[master]: Use Osmocom-patched UNIX_DOMAIN_SOCKETasp for SEQPACKET support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa3661d8f818564d595c4612e5612a245a31a8f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 22 10:34:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:34:46 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Use Osmocom-patched UNIX_DOMAIN_SOCKETasp for SEQPACKET support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Use Osmocom-patched UNIX_DOMAIN_SOCKETasp for SEQPACKET support ...................................................................... Use Osmocom-patched UNIX_DOMAIN_SOCKETasp for SEQPACKET support Upstream TITAN doesn't have this yet (it's submitted, though), so we have to use our own repo for titan.TestPorts.UNIX_DOMAIN_SOCKETasp and at the same time make sure that our MNCC port is using SEQPACKET in MSC_Tests.cfg Change-Id: Ifa3661d8f818564d595c4612e5612a245a31a8f4 --- M deps/Makefile M msc_tests/MSC_Tests.cfg 2 files changed, 9 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/deps/Makefile b/deps/Makefile index ac66493..64f5c2c 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -1,6 +1,7 @@ ECLIPSEGIT:=https://github.com/eclipse ECLIPSEGIT2:=git://git.eclipse.org/gitroot/titan +OSMOGITHUB:=https://github.com/osmocom ECLIPSEGIT_REPOS= titan.Libraries.TCCUsefulFunctions \ titan.ProtocolModules.ICMP \ @@ -20,8 +21,7 @@ titan.TestPorts.SIPmsg \ titan.TestPorts.TCPasp \ titan.TestPorts.TELNETasp \ - titan.TestPorts.UDPasp \ - titan.TestPorts.UNIX_DOMAIN_SOCKETasp + titan.TestPorts.UDPasp ECLIPSEGIT2_REPOS= titan.ProtocolModules.GRE \ titan.ProtocolModules.M2PA \ @@ -40,7 +40,9 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 -ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) +OSMOGITHUB_REPOS= titan.TestPorts.UNIX_DOMAIN_SOCKETasp + +ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) all: $(ALL_REPOS) @@ -65,3 +67,6 @@ $(foreach dir,$(ECLIPSEGIT2_REPOS), \ $(eval $(call GIT_template,$(dir),$(ECLIPSEGIT2)))) + +$(foreach dir,$(OSMOGITHUB_REPOS), \ + $(eval $(call GIT_template,$(dir),$(OSMOGITHUB)))) diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg index 5ffa322..2bd9dd2 100644 --- a/msc_tests/MSC_Tests.cfg +++ b/msc_tests/MSC_Tests.cfg @@ -13,6 +13,7 @@ [TESTPORT_PARAMETERS] #*.*.udpReuseAddress := "yes"; +"MSC_Test-MNCC".MNCC.socket_type := "SEQPACKET"; [MODULE_PARAMETERS] M3UA_Emulation.tsp_logVerbose := true; -- To view, visit https://gerrit.osmocom.org/5979 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa3661d8f818564d595c4612e5612a245a31a8f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:35:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:35:52 +0000 Subject: libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:35:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:35:53 +0000 Subject: [MERGED] libosmocore[master]: tests/ussd: prevent uninitialized memory access In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests/ussd: prevent uninitialized memory access ...................................................................... tests/ussd: prevent uninitialized memory access Previously an incorrect length value was passed to both gsm_7bit_decode_n_ussd() and gsm_7bit_encode_n_ussd() functions during test_7bit_ussd() execution, due to: octets_written = strlen(decoded); The problem is that a 7-bit encoded string takes less memory than its 8-bit equivalent. So, here strlen() returns one-byte bigger value, that octets_written is. This then causes the uninitialized memory access. Found using Valgrind: Conditional jump or move depends on uninitialised value(s) at 0x506DCCC: gsm_7bit_decode_n_ussd (gsm_utils.c:248) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBB7: gsm_7bit_decode_n_hdr (gsm_utils.c:220) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Conditional jump or move depends on uninitialised value(s) at 0x506DBCB: gsm_septet_lookup (gsm_utils.c:153) by 0x506DBCB: gsm_7bit_decode_n_hdr (gsm_utils.c:224) by 0x506DC9E: gsm_7bit_decode_n_ussd (gsm_utils.c:246) by 0x40134B: test_7bit_ussd (ussd_test.c:104) by 0x400F5D: main (ussd_test.c:161) Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c --- M tests/ussd/ussd_test.c 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/ussd/ussd_test.c b/tests/ussd/ussd_test.c index 8d88dbb..429c72d 100644 --- a/tests/ussd/ussd_test.c +++ b/tests/ussd/ussd_test.c @@ -90,8 +90,7 @@ OSMO_ASSERT(strcmp(encoded_hex, osmo_hexdump_nospc(coded, octets_written)) == 0); gsm_7bit_decode_n_ussd(decoded, sizeof(decoded), coded, octets_written * 8 / 7); - octets_written = strlen(decoded); - printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, octets_written)); + printf("decoded = %s\n\n", osmo_hexdump((uint8_t *)decoded, strlen(decoded))); OSMO_ASSERT(strncmp(text, decoded, strlen(text)) == 0); OSMO_ASSERT(strcmp(appended_after_decode, decoded + strlen(text)) == 0); -- To view, visit https://gerrit.osmocom.org/5934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic31805b6a5a917dfc6284edba6ffdd21246ac20c 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: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:36:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:36:20 +0000 Subject: osmo-ci[master]: Coverity: specify sysmoBTS L1 headers explicitly In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba55922295cb2a258f90c5345f592d7d5f34ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:36:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:36:23 +0000 Subject: [MERGED] osmo-ci[master]: Coverity: specify sysmoBTS L1 headers explicitly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Coverity: specify sysmoBTS L1 headers explicitly ...................................................................... Coverity: specify sysmoBTS L1 headers explicitly Fix upload by specifying L1 headers location properly. Fixes: OS#2845 Change-Id: Iba55922295cb2a258f90c5345f592d7d5f34ac51 --- M coverity/build_Osmocom.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index bd30fd7..4da9ec6 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -45,7 +45,7 @@ build_osmobts() { pushd osmo-bts - do_build --enable-sysmocom-bts --enable-trx + do_build --enable-sysmocom-bts --with-sysmobts="$prefix/include/" --enable-trx popd } -- To view, visit https://gerrit.osmocom.org/5975 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba55922295cb2a258f90c5345f592d7d5f34ac51 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:37:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:37:11 +0000 Subject: osmo-ci[master]: cosmetic: remove wrapper script In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iead3b8f39327f1d0dd80e12a9d38563c35701993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:37:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:37:18 +0000 Subject: osmo-ci[master]: cosmetic: remove unused function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3885237cea2afbe5e8c0f89d2280284bb4d9150 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:37:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:37:19 +0000 Subject: [MERGED] osmo-ci[master]: cosmetic: remove unused function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: remove unused function ...................................................................... cosmetic: remove unused function Change-Id: Ie3885237cea2afbe5e8c0f89d2280284bb4d9150 --- M coverity/build_Osmocom.sh 1 file changed, 0 insertions(+), 4 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/build_Osmocom.sh b/coverity/build_Osmocom.sh index 4da9ec6..18c9b0b 100755 --- a/coverity/build_Osmocom.sh +++ b/coverity/build_Osmocom.sh @@ -10,10 +10,6 @@ export PKG_CONFIG_PATH="$prefix/lib/pkgconfig" -git_branch() { - echo "$(git status)" | grep 'On branch' | sed 's/On branch //' -} - do_build() { autoreconf --install --force ./configure --prefix="$prefix" $* -- To view, visit https://gerrit.osmocom.org/5976 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3885237cea2afbe5e8c0f89d2280284bb4d9150 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:37:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:37:20 +0000 Subject: [MERGED] osmo-ci[master]: cosmetic: remove wrapper script In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: remove wrapper script ...................................................................... cosmetic: remove wrapper script The jenkins.sh is just a tiny wrapper around coverity_Osmocom.sh - let's remove this unnecessary indirection and move the code directly to jenkins.sh Change-Id: Iead3b8f39327f1d0dd80e12a9d38563c35701993 --- D coverity/coverity_Osmocom.sh M coverity/jenkins.sh 2 files changed, 38 insertions(+), 40 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved; Verified diff --git a/coverity/coverity_Osmocom.sh b/coverity/coverity_Osmocom.sh deleted file mode 100755 index 33d4fa5..0000000 --- a/coverity/coverity_Osmocom.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/usr/bin/env bash - -set -e -x - -base_dir="$PWD" -src_dir="$base_dir/source-Osmocom" -cov_dir="$src_dir/cov-int" - -rm -rf "$src_dir" -./prepare_source_Osmcocom.sh - -export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH" - -rm -rf "$cov_dir" -cov-build --dir "$cov_dir" ./build_Osmocom.sh - -cd "$src_dir" -rm -f Osmocom.tgz -tar czf Osmocom.tgz cov-int - -# Don't leak the token to jenkins build logs, but still log the call: -# First compose the call to echo, then run with token inserted by 'eval'. -set +x - -curl_cmd='curl \ - --form token="$token" \ - --form email=holger at freyther.de --form file=@Osmocom.tgz \ - --form version=Version --form description=AutoUpload \ - https://scan.coverity.com/builds?project=Osmocom' -echo "$curl_cmd" - -token="$($base_dir/get_token.sh $base_dir/tokens.txt Osmocom)" -if [ -z "$token" ]; then - echo "TOKEN IS EMPTY" - exit 1 -fi - -eval "$curl_cmd" diff --git a/coverity/jenkins.sh b/coverity/jenkins.sh index 9adfe99..33d4fa5 100755 --- a/coverity/jenkins.sh +++ b/coverity/jenkins.sh @@ -1,2 +1,38 @@ -#!/bin/sh -./coverity_Osmocom.sh +#!/usr/bin/env bash + +set -e -x + +base_dir="$PWD" +src_dir="$base_dir/source-Osmocom" +cov_dir="$src_dir/cov-int" + +rm -rf "$src_dir" +./prepare_source_Osmcocom.sh + +export PATH="$base_dir/cov-analysis-linux64-8.5.0/bin/:$PATH" + +rm -rf "$cov_dir" +cov-build --dir "$cov_dir" ./build_Osmocom.sh + +cd "$src_dir" +rm -f Osmocom.tgz +tar czf Osmocom.tgz cov-int + +# Don't leak the token to jenkins build logs, but still log the call: +# First compose the call to echo, then run with token inserted by 'eval'. +set +x + +curl_cmd='curl \ + --form token="$token" \ + --form email=holger at freyther.de --form file=@Osmocom.tgz \ + --form version=Version --form description=AutoUpload \ + https://scan.coverity.com/builds?project=Osmocom' +echo "$curl_cmd" + +token="$($base_dir/get_token.sh $base_dir/tokens.txt Osmocom)" +if [ -z "$token" ]; then + echo "TOKEN IS EMPTY" + exit 1 +fi + +eval "$curl_cmd" -- To view, visit https://gerrit.osmocom.org/5977 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iead3b8f39327f1d0dd80e12a9d38563c35701993 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:39:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:39:09 +0000 Subject: osmo-bts[master]: sysmobts: move header check to appropriate place In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a 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 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 10:39:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 10:39:12 +0000 Subject: [MERGED] osmo-bts[master]: sysmobts: move header check to appropriate place In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sysmobts: move header check to appropriate place ...................................................................... sysmobts: move header check to appropriate place Move the header check specific to sysmoBTS 2050 next to generic sysmoBTS header check. Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a --- M configure.ac 1 file changed, 8 insertions(+), 11 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 51d94c6..db8a97d 100644 --- a/configure.ac +++ b/configure.ac @@ -82,9 +82,17 @@ AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[], [AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])], [#include ]) + + # Check for the sbts2050_header.h that was added after the 3.6 release + AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"], []) + if test "$sysmo_uc_header" = "yes" ; then + AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050]) + fi + PKG_CHECK_MODULES(LIBGPS, libgps) CPPFLAGS=$oldCPPFLAGS fi +AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support]) AC_ARG_ENABLE(trx, @@ -177,17 +185,6 @@ CPPFLAGS=$oldCPPFLAGS fi -# Check for the sbts2050_header.h that was added after the 3.6 release -oldCPPFLAGS=$CPPFLAGS -CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR" -AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], - [sysmo_uc_header="yes"],[]) -CPPFLAGS=$oldCPPFLAGS - -if test "$sysmo_uc_header" = "yes" ; then - AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050]) -fi -AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes") AM_CONFIG_HEADER(btsconfig.h) AC_OUTPUT( -- To view, visit https://gerrit.osmocom.org/5978 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a 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 Mon Jan 22 10:39:29 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 10:39:29 +0000 Subject: [PATCH] libosmocore[master]: Extend Kc buffer 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/1538 to look at the new patch set (#4). Extend Kc buffer Double the Kc buffer to match the requirements of A5/4 and GEA4. Related: OS#1910 Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 --- M TODO-RELEASE M include/osmocom/crypt/auth.h 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/1538/4 diff --git a/TODO-RELEASE b/TODO-RELEASE index 782ba19..d498850 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,4 @@ core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) +libosmogsm osmo_auth_vector expand kc[] field to accommodate for GEA4 and A5/4 key sizes \ No newline at end of file diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index e544126..62ed2a1 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -64,7 +64,7 @@ uint8_t ik[16]; /*!< integrity key */ uint8_t res[16]; /*!< authentication result */ uint8_t res_len; /*!< length (in bytes) of res */ - uint8_t kc[8]; /*!< Kc for GSM encryption (A5) */ + uint8_t kc[16]; /*!< Kc for GSM/GPRS encryption (A5 & GEA) */ uint8_t sres[4]; /*!< authentication result for GSM */ uint32_t auth_types; /*!< bitmask of OSMO_AUTH_TYPE_* */ }; -- To view, visit https://gerrit.osmocom.org/1538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 Gerrit-PatchSet: 4 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 Mon Jan 22 11:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 11:08:05 +0000 Subject: [PATCH] osmo-mgw[master]: protocol: fix problem with line break and OSMUX Message-ID: Review at https://gerrit.osmocom.org/5980 protocol: fix problem with line break and OSMUX The SDP parameter block must be detached from the regular parameters using an additional line break (empty line). At the moment this works because the empty OSMOX variable is added and by this also adds a line break. It breaks as soon as OSMUX is used again. - Make clear that no OSMUX variable is added when OSMUX is not in use. - Add the extra line break independently Change-Id: I6261971040db527b96fe79676520ccd7794bd327 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/80/5980/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index daedc8d..49c4c3c 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -226,7 +226,7 @@ struct msgb *sdp; int rc; struct msgb *result; - char osmux_extension[strlen("\nX-Osmux: 255") + 1]; + char osmux_extension[strlen("X-Osmux: 255") + 1]; char local_ip_addr[INET_ADDRSTRLEN]; sdp = msgb_alloc_headroom(4096, 128, "sdp record"); @@ -239,7 +239,7 @@ } if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - sprintf(osmux_extension, "\nX-Osmux: %u", conn->osmux.cid); + sprintf(osmux_extension, "X-Osmux: %u", conn->osmux.cid); conn->osmux.state = OSMUX_STATE_ACTIVATING; } else { osmux_extension[0] = '\0'; @@ -252,9 +252,15 @@ goto error; } - rc = msgb_printf(sdp, "%s\n", osmux_extension); - if (rc < 0) - goto error; + /* Attach optional OSMUX parameters */ + if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { + rc = msgb_printf(sdp, "%s\n", osmux_extension); + if (rc < 0) + goto error; + } + + /* Attach line break to separate the parameters from the SDP block */ + rc = msgb_printf(sdp, "\n"); rc = mgcp_write_response_sdp(endp, conn, sdp, addr); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/5980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6261971040db527b96fe79676520ccd7794bd327 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 22 11:08:05 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 11:08:05 +0000 Subject: [PATCH] osmo-mgw[master]: protocol: fix missing carriage return Message-ID: Review at https://gerrit.osmocom.org/5981 protocol: fix missing carriage return Some of the line breaks lack the \r character, which leads to an inconsistancy. While our software and even wireshark does ignore the problem, other third party implementations might reject those messages. - Add the missing \r characters to make the message format consistant. Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c --- M src/libosmo-mgcp/mgcp_protocol.c M tests/mgcp/mgcp_test.c 2 files changed, 17 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/5981/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 49c4c3c..73d7f5e 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -201,14 +201,14 @@ /* NOTE: Only in the virtual trunk we allow dynamic endpoint names */ if (endp->wildcarded_crcx && endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) { - rc = msgb_printf(msg, "Z: %s%u@%s\n", + rc = msgb_printf(msg, "Z: %s%u@%s\r\n", MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, ENDPOINT_NUMBER(endp), endp->cfg->domain); if (rc < 0) return -EINVAL; } - rc = msgb_printf(msg, "I: %s\n", conn->conn->id); + rc = msgb_printf(msg, "I: %s\r\n", conn->conn->id); if (rc < 0) return -EINVAL; @@ -254,13 +254,13 @@ /* Attach optional OSMUX parameters */ if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - rc = msgb_printf(sdp, "%s\n", osmux_extension); + rc = msgb_printf(sdp, "%s\r\n", osmux_extension); if (rc < 0) goto error; } /* Attach line break to separate the parameters from the SDP block */ - rc = msgb_printf(sdp, "\n"); + rc = msgb_printf(sdp, "\r\n"); rc = mgcp_write_response_sdp(endp, conn, sdp, addr); if (rc < 0) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index ddee8c5..1790444 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -86,7 +86,7 @@ #define MDCX3_RET \ "200 18983215 OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -98,7 +98,7 @@ #define MDCX3A_RET \ "200 18983215 OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -110,7 +110,7 @@ #define MDCX3_FMTP_RET \ "200 18983215 OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -138,7 +138,7 @@ #define MDCX4_RET(Ident) \ "200 " Ident " OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -150,7 +150,7 @@ #define MDCX4_RO_RET(Ident) \ "200 " Ident " OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -247,8 +247,8 @@ #define CRCX_RET \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -260,8 +260,8 @@ #define CRCX_RET_NO_RTPMAP \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -272,8 +272,8 @@ #define CRCX_FMTP_RET \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -296,8 +296,8 @@ #define CRCX_ZYN_RET \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ -- To view, visit https://gerrit.osmocom.org/5981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 22 11:32:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 11:32:30 +0000 Subject: osmo-mgw[master]: protocol: fix problem with line break and OSMUX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6261971040db527b96fe79676520ccd7794bd327 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 11:33:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 11:33:03 +0000 Subject: osmo-mgw[master]: protocol: fix missing carriage return In-Reply-To: References: Message-ID: Patch Set 1: what does the spec say about line endings? -- To view, visit https://gerrit.osmocom.org/5981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 11:33:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 11:33:16 +0000 Subject: osmo-mgw[master]: cosmetic: client: add doxygen comments In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0b8a0652e60f2b3d72ee1cedfa6e2d5547d88455 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 12:32:48 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 12:32:48 +0000 Subject: osmo-mgw[master]: protocol: fix missing carriage return In-Reply-To: References: Message-ID: Patch Set 1: > what does the spec say about line endings? RFC3435 Appendix A: Formal Syntax Description of the Protocol (which is hard to follow) defines EOL as CRLF / LF. In RFC2327 Chapter 6 SDP Specification it is mentioned that it should be an \r\n but \n should be tolerated as well, thats probably also the reason why wireshark did not complain. "Text records such as the session name and information are bytes strings which may contain any byte with the exceptions of 0x00 (Nul), 0x0a (ASCII newline) and 0x0d (ASCII carriage return). The sequence CRLF (0x0d0a) is used to end a record, although parsers should be tolerant and also accept records terminated with a single newline character. By default these byte strings contain ISO-10646 characters in UTF-8 encoding, but this default may be changed using the `charset' attribute. -- To view, visit https://gerrit.osmocom.org/5981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 12:52:35 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 22 Jan 2018 12:52:35 +0000 Subject: [PATCH] osmo-msc[master]: libmsc: msc_vty: Fix compilation warning Message-ID: Review at https://gerrit.osmocom.org/5982 libmsc: msc_vty: Fix compilation warning As the include file gsm_data.h is generic (does not depend on osmo-iuh0s iu_client.h), rab_assign_addr_enc is declared as "int" instead of "enum ranap_nsap_addr_enc". osmo-msc/src/libmsc/msc_vty.c: In function ?msc_vty_init?: osmo-msc/src/libmsc/msc_vty.c:212:30: warning: passing argument 2 of ?ranap_iu_vty_init? from incompatible pointer type [-Wincompatible-pointer-types] ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); ^ Change-Id: I1b63ee350911bdf772a2324fff55035275a455c4 --- M src/libmsc/msc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/82/5982/1 diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index c1c9f6b..82608c6 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -209,6 +209,6 @@ mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)&msc_network->iu.rab_assign_addr_enc); #endif } -- To view, visit https://gerrit.osmocom.org/5982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b63ee350911bdf772a2324fff55035275a455c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 22 14:25:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 14:25:53 +0000 Subject: [PATCH] libosmocore[master]: GSUP: don't fail test on first error Message-ID: Review at https://gerrit.osmocom.org/5983 GSUP: don't fail test on first error Instead of forcing test failure via assert on first error encountered, let it run until completion and print detailed error log. This simplifies troubleshooting by letting user to see more errors from single run and more details on each of the errors. Update test output with explicit test results. Change-Id: I016a28fe04f7b194e22c15e936095004c5f079d1 --- M tests/gsup/gsup_test.c M tests/gsup/gsup_test.ok 2 files changed, 30 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/5983/1 diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index 3b360ac..eddcc92 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -212,21 +212,33 @@ const struct test *t = &test_messages[test_idx]; struct osmo_gsup_message gm = {0}; struct msgb *msg = msgb_alloc(4096, "gsup_test"); + bool passed = true; printf(" Testing %s\n", t->name); rc = osmo_gsup_decode(t->data, t->data_len, &gm); - OSMO_ASSERT(rc >= 0); + if (rc < 0) + passed = false; osmo_gsup_encode(msg, &gm); fprintf(stderr, " generated message: %s\n", msgb_hexdump(msg)); fprintf(stderr, " original message: %s\n", osmo_hexdump(t->data, t->data_len)); fprintf(stderr, " IMSI: %s\n", gm.imsi); - OSMO_ASSERT(strcmp(gm.imsi, TEST_IMSI_STR) == 0); - OSMO_ASSERT(msgb_length(msg) == t->data_len); - OSMO_ASSERT(memcmp(msgb_data(msg), t->data, t->data_len) == 0); + if (strcmp(gm.imsi, TEST_IMSI_STR) != 0 || + msgb_length(msg) != t->data_len || + memcmp(msgb_data(msg), t->data, t->data_len) != 0) + passed = false; + + if (passed) + printf(" %s OK\n", t->name); + else + printf(" %s FAILED: %d<%s> [%u,%u,%zu,%u]\n", + t->name, rc, strerror(-rc), + strcmp(gm.imsi, TEST_IMSI_STR), + msgb_length(msg), t->data_len, + memcmp(msgb_data(msg), t->data, t->data_len)); msgb_free(msg); } diff --git a/tests/gsup/gsup_test.ok b/tests/gsup/gsup_test.ok index a0b3f35..49a85ba 100644 --- a/tests/gsup/gsup_test.ok +++ b/tests/gsup/gsup_test.ok @@ -1,16 +1,30 @@ Test GSUP message decoding/encoding Testing Send Authentication Info Request + Send Authentication Info Request OK Testing Send Authentication Info Error + Send Authentication Info Error OK Testing Send Authentication Info Result + Send Authentication Info Result OK Testing Update Location Request + Update Location Request OK Testing Update Location Error + Update Location Error OK Testing Update Location Result + Update Location Result OK Testing Location Cancellation Request + Location Cancellation Request OK Testing Location Cancellation Error + Location Cancellation Error OK Testing Location Cancellation Result + Location Cancellation Result OK Testing Purge MS Request + Purge MS Request OK Testing Purge MS Error + Purge MS Error OK Testing Purge MS Result + Purge MS Result OK Testing Send Authentication Info Result with IK, CK, AUTN and RES (UMTS) + Send Authentication Info Result with IK, CK, AUTN and RES (UMTS) OK Testing Send Authentication Info Request with AUTS and RAND (UMTS) + Send Authentication Info Request with AUTS and RAND (UMTS) OK Done. -- To view, visit https://gerrit.osmocom.org/5983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I016a28fe04f7b194e22c15e936095004c5f079d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 14:34:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 14:34:48 +0000 Subject: [PATCH] libosmocore[master]: Use define for key buffers 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/1538 to look at the new patch set (#5). Use define for key buffers This effectively doubles the Kc buffer which enable us to match the requirements for future A5/4 and GEA4 support (see 3GPP TS 55.216 V6.2.0 and 3GPP TS 55.226 V9.0.0 specs). Add corresponding spec. references and comments where appropriate. Note: the GSUP test output have to be adjusted because KC parser now accept both 64 and 128 bit Kc lengths as valid. Related: OS#1910 Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 --- M TODO-RELEASE M include/osmocom/crypt/auth.h M src/gsm/auth_core.c M src/gsm/gsup.c M tests/auth/milenage_test.c M tests/gsup/gsup_test.err M utils/osmo-auc-gen.c 7 files changed, 20 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/38/1538/5 diff --git a/TODO-RELEASE b/TODO-RELEASE index 782ba19..d498850 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,3 +10,4 @@ core msgb_queue_free() add inline func to msgb.h coding gsm0503_rach_ext-encode() add func to gsm0503_coding.h codec ecu.c / ecu.h implement ECU for FR (Error Concealment Unit) +libosmogsm osmo_auth_vector expand kc[] field to accommodate for GEA4 and A5/4 key sizes \ No newline at end of file diff --git a/include/osmocom/crypt/auth.h b/include/osmocom/crypt/auth.h index e544126..d2a2ff8 100644 --- a/include/osmocom/crypt/auth.h +++ b/include/osmocom/crypt/auth.h @@ -42,7 +42,7 @@ union { struct { uint8_t opc[16]; /*!< operator invariant value */ - uint8_t k[16]; /*!< secret key of the subscriber */ + uint8_t k[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< secret key of the subscriber */ uint8_t amf[2]; uint64_t sqn; /*!< sequence number (in: prev sqn; out: used sqn) */ int opc_is_op; /*!< is the OPC field OPC (0) or OP (1) ? */ @@ -60,11 +60,11 @@ struct osmo_auth_vector { uint8_t rand[16]; /*!< random challenge */ uint8_t autn[16]; /*!< authentication nonce */ - uint8_t ck[16]; /*!< ciphering key */ - uint8_t ik[16]; /*!< integrity key */ + uint8_t ck[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< ciphering key */ + uint8_t ik[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< integrity key */ uint8_t res[16]; /*!< authentication result */ uint8_t res_len; /*!< length (in bytes) of res */ - uint8_t kc[8]; /*!< Kc for GSM encryption (A5) */ + uint8_t kc[OSMO_A5_MAX_KEY_LEN_BYTES]; /*!< Kc for GSM/GPRS encryption (A5 & GEA) */ uint8_t sres[4]; /*!< authentication result for GSM */ uint32_t auth_types; /*!< bitmask of OSMO_AUTH_TYPE_* */ }; diff --git a/src/gsm/auth_core.c b/src/gsm/auth_core.c index f171ed4..9e750a0 100644 --- a/src/gsm/auth_core.c +++ b/src/gsm/auth_core.c @@ -98,7 +98,7 @@ return 0; } -/* C5 function to derive UMTS IK from GSM Kc */ +/* 3GPP TS 33.102 ?6.8.2.3 C5 function to derive UMTS IK from GSM Kc */ static inline void c5_function(uint8_t *ik, const uint8_t *kc) { unsigned int i; @@ -110,7 +110,7 @@ ik[i] = ik[i-12]; } -/* C4 function to derive UMTS CK from GSM Kc */ +/* 3GPP TS 33.102 ?6.8.2.3 C4 function to derive UMTS CK from GSM Kc */ void osmo_c4(uint8_t *ck, const uint8_t *kc) { memcpy(ck, kc, 8); diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index eb829f7..31d423f 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -154,7 +154,7 @@ break; case OSMO_GSUP_KC_IE: - if (value_len != sizeof(auth_vector->kc)) + if (value_len != OSMO_A5_MAX_KEY_LEN_BYTES && value_len != OSMO_A5_MAX_KEY_LEN_BYTES/2) goto parse_error; memcpy(auth_vector->kc, value, value_len); @@ -450,8 +450,8 @@ msgb_tlv_put(msg, OSMO_GSUP_SRES_IE, sizeof(auth_vector->sres), auth_vector->sres); - msgb_tlv_put(msg, OSMO_GSUP_KC_IE, - sizeof(auth_vector->kc), auth_vector->kc); + /* FIXME: choose proper length for A5/4 and GEA4 support */ + msgb_tlv_put(msg, OSMO_GSUP_KC_IE, OSMO_A5_MAX_KEY_LEN_BYTES/2, auth_vector->kc); } if (auth_vector->auth_types & OSMO_AUTH_TYPE_UMTS) { diff --git a/tests/auth/milenage_test.c b/tests/auth/milenage_test.c index 2bd3cf2..8b058e5 100644 --- a/tests/auth/milenage_test.c +++ b/tests/auth/milenage_test.c @@ -23,7 +23,10 @@ if (vec->auth_types & OSMO_AUTH_TYPE_GSM) { printf("SRES:\t%s\n", osmo_hexdump(vec->sres, sizeof(vec->sres))); - printf("Kc:\t%s\n", osmo_hexdump(vec->kc, sizeof(vec->kc))); + /* According to 3GPP TS 55.205 Sec. 4 the GSM-MILENAGE output is limited to 64 bits. + According to 3GPP TS 33.102 Annex. B5 in UMTS security context Kc can be 128 bits. + Here we test the former, so make sure we only print interesting Kc bits. */ + printf("Kc:\t%s\n", osmo_hexdump(vec->kc, OSMO_A5_MAX_KEY_LEN_BYTES/2)); } } diff --git a/tests/gsup/gsup_test.err b/tests/gsup/gsup_test.err index 05c64fe..1c59d9f 100644 --- a/tests/gsup/gsup_test.err +++ b/tests/gsup/gsup_test.err @@ -57,7 +57,7 @@ DLGSUP Stopping DLGSUP logging message 0: tested 2816 modifications, 510 parse failures message 1: tested 3584 modifications, 768 parse failures - message 2: tested 21248 modifications, 2571 parse failures + message 2: tested 21248 modifications, 2569 parse failures message 3: tested 2816 modifications, 510 parse failures message 4: tested 3584 modifications, 768 parse failures message 5: tested 20736 modifications, 4010 parse failures @@ -67,5 +67,5 @@ message 9: tested 2816 modifications, 510 parse failures message 10: tested 3584 modifications, 768 parse failures message 11: tested 3328 modifications, 767 parse failures - message 12: tested 54016 modifications, 4622 parse failures + message 12: tested 54016 modifications, 4613 parse failures message 13: tested 11520 modifications, 1026 parse failures diff --git a/utils/osmo-auc-gen.c b/utils/osmo-auc-gen.c index ec9bad8..8eaac53 100644 --- a/utils/osmo-auc-gen.c +++ b/utils/osmo-auc-gen.c @@ -45,7 +45,8 @@ printf("imsi,"); printf("%s,", osmo_hexdump_nospc(vec->rand, sizeof(vec->rand))); printf("%s,", osmo_hexdump_nospc(vec->sres, sizeof(vec->sres))); - printf("%s\n", osmo_hexdump_nospc(vec->kc, sizeof(vec->kc))); + /* FIXME: choose proper length for A5/4 and GEA4 support */ + printf("%s\n", osmo_hexdump_nospc(vec->kc, OSMO_A5_MAX_KEY_LEN_BYTES/2)); } static void dump_auth_vec(struct osmo_auth_vector *vec) @@ -61,7 +62,8 @@ if (vec->auth_types & OSMO_AUTH_TYPE_GSM) { printf("SRES:\t%s\n", osmo_hexdump_nospc(vec->sres, sizeof(vec->sres))); - printf("Kc:\t%s\n", osmo_hexdump_nospc(vec->kc, sizeof(vec->kc))); + /* FIXME: choose proper length for A5/4 and GEA4 support */ + printf("Kc:\t%s\n", osmo_hexdump_nospc(vec->kc, OSMO_A5_MAX_KEY_LEN_BYTES/2)); } } -- To view, visit https://gerrit.osmocom.org/1538 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8d347bbeadc14cbc7306ea6e9b73e4a1c8c8cb21 Gerrit-PatchSet: 5 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 Mon Jan 22 14:40:07 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 14:40:07 +0000 Subject: [PATCH] libosmocore[master]: socket: fix socket leak in osmo_sock_local_ip() Message-ID: Review at https://gerrit.osmocom.org/5984 socket: fix socket leak in osmo_sock_local_ip() The socket that is opend to probe the correct local ip-address is not closed when the test is done. - Close socket when it is not needed anymore Change-Id: I7f3562a344b58f6298d2068314be1626a96e1b1d --- M src/socket.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/84/5984/1 diff --git a/src/socket.c b/src/socket.c index 82ccfed..35cce64 100644 --- a/src/socket.c +++ b/src/socket.c @@ -827,6 +827,7 @@ memset(&local_addr, 0, sizeof(local_addr)); local_addr_len = sizeof(local_addr); rc = getsockname(sfd, (struct sockaddr *)&local_addr, &local_addr_len); + close(sfd); if (rc < 0) return -EINVAL; if (local_addr.sin_family == AF_INET) -- To view, visit https://gerrit.osmocom.org/5984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f3562a344b58f6298d2068314be1626a96e1b1d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:00:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 15:00:20 +0000 Subject: libosmocore[master]: socket: fix socket leak in osmo_sock_local_ip() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f3562a344b58f6298d2068314be1626a96e1b1d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:00:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 15:00:21 +0000 Subject: [MERGED] libosmocore[master]: socket: fix socket leak in osmo_sock_local_ip() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket: fix socket leak in osmo_sock_local_ip() ...................................................................... socket: fix socket leak in osmo_sock_local_ip() The socket that is opend to probe the correct local ip-address is not closed when the test is done. - Close socket when it is not needed anymore Change-Id: I7f3562a344b58f6298d2068314be1626a96e1b1d --- M src/socket.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index 82ccfed..35cce64 100644 --- a/src/socket.c +++ b/src/socket.c @@ -827,6 +827,7 @@ memset(&local_addr, 0, sizeof(local_addr)); local_addr_len = sizeof(local_addr); rc = getsockname(sfd, (struct sockaddr *)&local_addr, &local_addr_len); + close(sfd); if (rc < 0) return -EINVAL; if (local_addr.sin_family == AF_INET) -- To view, visit https://gerrit.osmocom.org/5984 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f3562a344b58f6298d2068314be1626a96e1b1d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:03:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 15:03:12 +0000 Subject: libosmocore[master]: fsm: add functions for unlinking and changing parents In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 (1 comment) fine with me, if we add that extra 'void * ctx' argument to the unlink function. https://gerrit.osmocom.org/#/c/5832/4/src/fsm.c File src/fsm.c: Line 285: talloc_steal(NULL, fi); I think it makes sense to pass in the new talloc context as argument to osmo_fsm_inst_unlink_parent. The normal caller would then simply call it with the NULL argument, and those who want to specify the new context can do so. -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:03:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 15:03:48 +0000 Subject: libosmocore[master]: GSUP: don't fail test on first error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I016a28fe04f7b194e22c15e936095004c5f079d1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:04:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 15:04:38 +0000 Subject: osmo-msc[master]: libmsc: msc_vty: Fix compilation warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b63ee350911bdf772a2324fff55035275a455c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:04:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 15:04:41 +0000 Subject: [MERGED] osmo-msc[master]: libmsc: msc_vty: Fix compilation warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc: msc_vty: Fix compilation warning ...................................................................... libmsc: msc_vty: Fix compilation warning As the include file gsm_data.h is generic (does not depend on osmo-iuh0s iu_client.h), rab_assign_addr_enc is declared as "int" instead of "enum ranap_nsap_addr_enc". osmo-msc/src/libmsc/msc_vty.c: In function ?msc_vty_init?: osmo-msc/src/libmsc/msc_vty.c:212:30: warning: passing argument 2 of ?ranap_iu_vty_init? from incompatible pointer type [-Wincompatible-pointer-types] ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); ^ Change-Id: I1b63ee350911bdf772a2324fff55035275a455c4 --- M src/libmsc/msc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index c1c9f6b..82608c6 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -209,6 +209,6 @@ mgcp_client_vty_init(msc_network, MSC_NODE, &msc_network->mgw.conf); #ifdef BUILD_IU - ranap_iu_vty_init(MSC_NODE, &msc_network->iu.rab_assign_addr_enc); + ranap_iu_vty_init(MSC_NODE, (enum ranap_nsap_addr_enc*)&msc_network->iu.rab_assign_addr_enc); #endif } -- To view, visit https://gerrit.osmocom.org/5982 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b63ee350911bdf772a2324fff55035275a455c4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:31:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 15:31:36 +0000 Subject: [PATCH] osmo-ci[master]: jenkins: fix jobs template Message-ID: Review at https://gerrit.osmocom.org/5985 jenkins: fix jobs template The sequential parameter was silently skipped because it was absent from the project template. Fix this for both master- and gerrit- jobs. Change-Id: I0bc28695f4f270bc7b1cc4bcd5d4d43ede6172f3 --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/85/5985/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index ce9d084..3789353 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -18,6 +18,7 @@ a4_name: a4 a4: !!python/tuple [default] combination_filter: '' + sequential: false # most common build invocation cmd: ./contrib/jenkins.sh repos_url: 'ssh://jenkins at gerrit.osmocom.org:29418/{repos}' @@ -211,6 +212,7 @@ Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! execution-strategy: + sequential: '{obj:sequential}' combination-filter: | {obj:combination_filter} axes: diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 0f9bb1e..8cacf27 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -15,6 +15,7 @@ a3_name: a3 a3: !!python/tuple [default] combination_filter: '' + sequential: false # most common build invocation cmd: ./contrib/jenkins.sh trigger: @@ -261,6 +262,7 @@ Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! execution-strategy: + sequential: '{obj:sequential}' combination-filter: | {obj:combination_filter} axes: -- To view, visit https://gerrit.osmocom.org/5985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0bc28695f4f270bc7b1cc4bcd5d4d43ede6172f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:31:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 15:31:37 +0000 Subject: [PATCH] osmo-ci[master]: gerrit: remove obsolete openggsn job Message-ID: Review at https://gerrit.osmocom.org/5986 gerrit: remove obsolete openggsn job The OpenGGSN project was superseded by OsmoGGSN. Remove old job description. Change-Id: If9ea1511fe628b9796b1df55d26b75bbe47d5c15 --- M jobs/gerrit-verifications.yml 1 file changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/86/5986/1 diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index 3789353..dda6cf1 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -71,11 +71,6 @@ -v "$HOME/bin:/build_bin" -v "$ARTIFACT_STORE:/artifact_store" \ osmocom:amd64 /build/contrib/jenkins.sh - - openggsn: - a1_name: GTP - a1: !!python/tuple [--enable-gtp-linux,--disable-gtp-linux] - cmd: GTP="$GTP" ./contrib/jenkins.sh - - osmo-bsc: concurrent: true cmd: > -- To view, visit https://gerrit.osmocom.org/5986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9ea1511fe628b9796b1df55d26b75bbe47d5c15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 15:32:28 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 15:32:28 +0000 Subject: [MERGED] libosmocore[master]: GSUP: don't fail test on first error In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: GSUP: don't fail test on first error ...................................................................... GSUP: don't fail test on first error Instead of forcing test failure via assert on first error encountered, let it run until completion and print detailed error log. This simplifies troubleshooting by letting user to see more errors from single run and more details on each of the errors. Update test output with explicit test results. Change-Id: I016a28fe04f7b194e22c15e936095004c5f079d1 --- M tests/gsup/gsup_test.c M tests/gsup/gsup_test.ok 2 files changed, 30 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index 3b360ac..eddcc92 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -212,21 +212,33 @@ const struct test *t = &test_messages[test_idx]; struct osmo_gsup_message gm = {0}; struct msgb *msg = msgb_alloc(4096, "gsup_test"); + bool passed = true; printf(" Testing %s\n", t->name); rc = osmo_gsup_decode(t->data, t->data_len, &gm); - OSMO_ASSERT(rc >= 0); + if (rc < 0) + passed = false; osmo_gsup_encode(msg, &gm); fprintf(stderr, " generated message: %s\n", msgb_hexdump(msg)); fprintf(stderr, " original message: %s\n", osmo_hexdump(t->data, t->data_len)); fprintf(stderr, " IMSI: %s\n", gm.imsi); - OSMO_ASSERT(strcmp(gm.imsi, TEST_IMSI_STR) == 0); - OSMO_ASSERT(msgb_length(msg) == t->data_len); - OSMO_ASSERT(memcmp(msgb_data(msg), t->data, t->data_len) == 0); + if (strcmp(gm.imsi, TEST_IMSI_STR) != 0 || + msgb_length(msg) != t->data_len || + memcmp(msgb_data(msg), t->data, t->data_len) != 0) + passed = false; + + if (passed) + printf(" %s OK\n", t->name); + else + printf(" %s FAILED: %d<%s> [%u,%u,%zu,%u]\n", + t->name, rc, strerror(-rc), + strcmp(gm.imsi, TEST_IMSI_STR), + msgb_length(msg), t->data_len, + memcmp(msgb_data(msg), t->data, t->data_len)); msgb_free(msg); } diff --git a/tests/gsup/gsup_test.ok b/tests/gsup/gsup_test.ok index a0b3f35..49a85ba 100644 --- a/tests/gsup/gsup_test.ok +++ b/tests/gsup/gsup_test.ok @@ -1,16 +1,30 @@ Test GSUP message decoding/encoding Testing Send Authentication Info Request + Send Authentication Info Request OK Testing Send Authentication Info Error + Send Authentication Info Error OK Testing Send Authentication Info Result + Send Authentication Info Result OK Testing Update Location Request + Update Location Request OK Testing Update Location Error + Update Location Error OK Testing Update Location Result + Update Location Result OK Testing Location Cancellation Request + Location Cancellation Request OK Testing Location Cancellation Error + Location Cancellation Error OK Testing Location Cancellation Result + Location Cancellation Result OK Testing Purge MS Request + Purge MS Request OK Testing Purge MS Error + Purge MS Error OK Testing Purge MS Result + Purge MS Result OK Testing Send Authentication Info Result with IK, CK, AUTN and RES (UMTS) + Send Authentication Info Result with IK, CK, AUTN and RES (UMTS) OK Testing Send Authentication Info Request with AUTS and RAND (UMTS) + Send Authentication Info Request with AUTS and RAND (UMTS) OK Done. -- To view, visit https://gerrit.osmocom.org/5983 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I016a28fe04f7b194e22c15e936095004c5f079d1 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:04:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 16:04:40 +0000 Subject: [PATCH] libosmocore[master]: socket: use inet_ntop() instead of inet_ntoa() in osmo_sock_... Message-ID: Review at https://gerrit.osmocom.org/5988 socket: use inet_ntop() instead of inet_ntoa() in osmo_sock_local_ip() The function inet_ntoa() stores its result in a static buffer and returns the pointer. When inet_ntoa() is called subsequently it overwrite the content of its static buffer with the new result. Since we osmo_sock_local_ip() is a library function we should use the more safe variant inet_ntop() in order to prevent unintentionally overwriting data that the caller might still need. Such an error would be hard to find. - Use the more safe inet_ntop() inestead of inet_ntoa() Change-Id: I9852b57736432032542bd96b6fdd4a2f08fc1f64 --- M src/socket.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/5988/1 diff --git a/src/socket.c b/src/socket.c index 35cce64..0378970 100644 --- a/src/socket.c +++ b/src/socket.c @@ -831,9 +831,9 @@ if (rc < 0) return -EINVAL; if (local_addr.sin_family == AF_INET) - strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET_ADDRSTRLEN); + inet_ntop(AF_INET, &local_addr.sin_addr, local_ip, INET_ADDRSTRLEN); else if (local_addr.sin_family == AF_INET6) - strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET6_ADDRSTRLEN); + inet_ntop(AF_INET6, &local_addr.sin_addr, local_ip, INET6_ADDRSTRLEN); else return -EINVAL; -- To view, visit https://gerrit.osmocom.org/5988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9852b57736432032542bd96b6fdd4a2f08fc1f64 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:13:22 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 16:13:22 +0000 Subject: [PATCH] libosmocore[master]: fsm: add functions for unlinking and changing parents 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/5832 to look at the new patch set (#6). fsm: add functions for unlinking and changing parents At the moment it is not possible to unlink a child from from its parent, nor is it possible to assign a new parent to a child FSM. - osmo_fsm_inst_unlink_parent(): Make it possible to unlink childs from a parent. - osmo_fsm_inst_change_parent(): Make it possible to change the parent of a child. Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 38 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/5832/6 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2fbb250..8f550d1 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -150,6 +150,10 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event); +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx); +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event); void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); diff --git a/src/fsm.c b/src/fsm.c index f9effc4..d688012 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -272,13 +272,44 @@ LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); + osmo_fsm_inst_change_parent(fi, parent, parent_term_event); return fi; } +/*! unlink child FSM from its parent FSM. + * \param[in] fi Descriptor of the child FSM to unlink. + * \param[in] ctx New talloc context */ +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx) +{ + if (fi->proc.parent) { + talloc_steal(ctx, fi); + fi->proc.parent = NULL; + fi->proc.parent_term_event = 0; + llist_del(&fi->proc.child); + } +} + +/*! change parent instance of an FSM. + * \param[in] fi Descriptor of the to-be-allocated FSM. + * \param[in] new_parent New parent FSM instance. + * \param[in] new_parent_term_event Event to be sent to parent when terminating. */ +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event) +{ + /* Make sure a possibly existing old parent is unlinked first */ + osmo_fsm_inst_unlink_parent(fi); + + /* Add new parent */ + if (new_parent) { + talloc_steal(new_parent, fi); + fi->proc.parent = new_parent; + fi->proc.parent_term_event = new_parent_term_event; + llist_add(&fi->proc.child, &new_parent->proc.children); + } +} + /*! delete a given instance of a FSM * \param[in] fsm The FSM to be un-registered and deleted */ -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:19:52 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 16:19:52 +0000 Subject: [PATCH] osmo-msc[master]: Add a VTY command which deletes all expired SMS. Message-ID: Review at https://gerrit.osmocom.org/5989 Add a VTY command which deletes all expired SMS. We already delete SMS which have been sent successfully. However, there are plans to accept SMS for any subscriber in order to fix the problem described in https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). This means we may end up storing SMS which never get sent, e.g. because the B subscriber doesn't actually exist. This could lead to a higher degree of SMS database growth over time, and therefore we need a way to keep database size under control. As a first step, introduce a DB function which removes an expired SMS, and add a VTY command which removes all expired SMS from the DB. Later commits will build upon this to remove expired SMS automatically. The SMS expiry time period is currently hard-coded to 2 weeks. We could make this configurable in the future if desired. Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Related: OS#2354 --- M include/osmocom/msc/db.h M include/osmocom/msc/sms_queue.h M src/libmsc/db.c M src/libmsc/sms_queue.c M src/libmsc/vty_interface_layer3.c 5 files changed, 83 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/5989/1 diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 13c5ed3..2105d38 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -50,6 +50,7 @@ int db_sms_inc_deliver_attempts(struct gsm_sms *sms); int db_sms_delete_by_msisdn(const char *msisdn); int db_sms_delete_sent_message_by_id(unsigned long long sms_id); +int db_sms_delete_expired_message_by_id(unsigned long long sms_id); /* Statistics counter storage */ struct osmo_counter; diff --git a/include/osmocom/msc/sms_queue.h b/include/osmocom/msc/sms_queue.h index 2a8bd58..b5488fe 100644 --- a/include/osmocom/msc/sms_queue.h +++ b/include/osmocom/msc/sms_queue.h @@ -13,5 +13,6 @@ int sms_queue_set_max_pending(struct gsm_sms_queue *, int max); int sms_queue_set_max_failure(struct gsm_sms_queue *, int fail); int sms_queue_clear(struct gsm_sms_queue *); +int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id); #endif diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4bf9b1f..5f9865d 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -989,6 +989,41 @@ return 0; } +int db_sms_delete_expired_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + time_t created, validity_timestamp, now, min_created; + + result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + if (!result) + return -1; + if (!next_row(result)) + return -1; + + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + dbi_result_free(result); + + now = time(NULL); + if (validity_timestamp > now) + return -1; + + /* Our SMS expiry threshold is hard-coded to roughly 2 weeks at the moment. */ + min_created = now - (time_t)(60 * 60 * 24 * 7 * 2); + if (min_created < 0) /* bogus system clock? */ + return -1; + if (created >= min_created) /* not yet expired */ + return -1; + + result = dbi_conn_queryf(conn, "DELETE FROM SMS WHERE id = %llu", sms_id); + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to delete SMS %llu.\n", sms_id); + return -1; + } + dbi_result_free(result); + return 0; +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 1372a2c..8cc9eb3 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -73,21 +73,21 @@ static int sms_sms_cb(unsigned int, unsigned int, void *, void *); static struct gsm_sms_pending *sms_find_pending(struct gsm_sms_queue *smsq, - struct gsm_sms *sms) + unsigned long long sms_id) { struct gsm_sms_pending *pending; llist_for_each_entry(pending, &smsq->pending_sms, entry) { - if (pending->sms_id == sms->id) + if (pending->sms_id == sms_id) return pending; } return NULL; } -static int sms_is_in_pending(struct gsm_sms_queue *smsq, struct gsm_sms *sms) +int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id) { - return sms_find_pending(smsq, sms) != NULL; + return sms_find_pending(smsq, sms_id) != NULL; } static struct gsm_sms_pending *sms_subscriber_find_pending( @@ -287,7 +287,7 @@ } /* no need to send a pending sms */ - if (sms_is_in_pending(smsq, sms)) { + if (sms_queue_sms_is_pending(smsq, sms->id)) { LOGP(DLSMS, LOGL_DEBUG, "SMSqueue with pending sms: %llu. Skipping\n", sms->id); sms_free(sms); @@ -338,7 +338,7 @@ goto no_pending_sms; /* The sms should not be scheduled right now */ - OSMO_ASSERT(!sms_is_in_pending(smsq, sms)); + OSMO_ASSERT(!sms_queue_sms_is_pending(smsq, sms->id)); /* Remember that we deliver this SMS and send it */ pending = sms_pending_from(smsq, sms); @@ -473,7 +473,7 @@ * sms that are not in our control as we just have a channel * open anyway. */ - pending = sms_find_pending(network->sms_queue, sig_sms->sms); + pending = sms_find_pending(network->sms_queue, sig_sms->sms->id); if (!pending) return 0; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c7ec586..df555fd 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -166,6 +166,44 @@ return CMD_SUCCESS; } + +DEFUN(sms_delete_expired, + sms_delete_expired_cmd, + "sms delete expired", + "SMS related commands\n" "SMS Database related commands\n" + "Delete all expired SMS") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_sms *sms; + unsigned long long sms_id = 0; + long long num_deleted = 0; + + while (1) { + sms = db_sms_get_next_unsent(gsmnet, sms_id, UINT_MAX); + if (!sms) + break; + + /* Skip SMS which are currently queued for sending. */ + if (sms_queue_sms_is_pending(gsmnet->sms_queue, sms->id)) + continue; + + /* Expiration check is performed by the DB layer. */ + if (db_sms_delete_expired_message_by_id(sms->id) == 0) + num_deleted++; + + sms_id = sms->id + 1; + } + + if (num_deleted == 0) { + vty_out(vty, "No expired SMS in database%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "Deleted %llu expired SMS from database%s", num_deleted, VTY_NEWLINE); + return CMD_SUCCESS; +} + + static int _send_sms_str(struct vlr_subscr *receiver, struct vlr_subscr *sender, char *str, uint8_t tp_pid) @@ -903,6 +941,7 @@ install_element_ve(&show_subscr_cache_cmd); install_element_ve(&sms_send_pend_cmd); + install_element_ve(&sms_delete_expired_cmd); install_element_ve(&subscriber_create_cmd); install_element_ve(&subscriber_send_sms_cmd); -- To view, visit https://gerrit.osmocom.org/5989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:24:17 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 16:24:17 +0000 Subject: [PATCH] libosmocore[master]: fsm: add functions for unlinking and changing parents 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/5832 to look at the new patch set (#7). fsm: add functions for unlinking and changing parents At the moment it is not possible to unlink a child from from its parent, nor is it possible to assign a new parent to a child FSM. - osmo_fsm_inst_unlink_parent(): Make it possible to unlink childs from a parent. - osmo_fsm_inst_change_parent(): Make it possible to change the parent of a child. Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 38 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/32/5832/7 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2fbb250..8f550d1 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -150,6 +150,10 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event); +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx); +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event); void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); diff --git a/src/fsm.c b/src/fsm.c index f9effc4..d8751c9 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -272,13 +272,44 @@ LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); + osmo_fsm_inst_change_parent(fi, parent, parent_term_event); return fi; } +/*! unlink child FSM from its parent FSM. + * \param[in] fi Descriptor of the child FSM to unlink. + * \param[in] ctx New talloc context */ +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx) +{ + if (fi->proc.parent) { + talloc_steal(ctx, fi); + fi->proc.parent = NULL; + fi->proc.parent_term_event = 0; + llist_del(&fi->proc.child); + } +} + +/*! change parent instance of an FSM. + * \param[in] fi Descriptor of the to-be-allocated FSM. + * \param[in] new_parent New parent FSM instance. + * \param[in] new_parent_term_event Event to be sent to parent when terminating. */ +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event) +{ + /* Make sure a possibly existing old parent is unlinked first + * (new_parent can be NULL) */ + osmo_fsm_inst_unlink_parent(fi, new_parent); + + /* Add new parent */ + if (new_parent) { + fi->proc.parent = new_parent; + fi->proc.parent_term_event = new_parent_term_event; + llist_add(&fi->proc.child, &new_parent->proc.children); + } +} + /*! delete a given instance of a FSM * \param[in] fsm The FSM to be un-registered and deleted */ -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:27:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 16:27:00 +0000 Subject: [PATCH] osmocom-bb[master]: cosmetic: fix Makefile whitespace Message-ID: Review at https://gerrit.osmocom.org/5990 cosmetic: fix Makefile whitespace Change-Id: Ia55d54d7ec7ec04e122d2e5250037c2d166abeb5 --- M src/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/90/5990/1 diff --git a/src/Makefile b/src/Makefile index f5e2128..7a7d283 100644 --- a/src/Makefile +++ b/src/Makefile @@ -51,7 +51,7 @@ host/virt_phy/configure: host/virt_phy/configure.ac cd host/virt_phy && autoreconf -i - + host/virt_phy/Makefile: host/virt_phy/configure cd host/virt_phy && ./configure $(HOST_CONFARGS) -- To view, visit https://gerrit.osmocom.org/5990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia55d54d7ec7ec04e122d2e5250037c2d166abeb5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:31:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 16:31:19 +0000 Subject: osmocom-bb[master]: cosmetic: fix Makefile whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia55d54d7ec7ec04e122d2e5250037c2d166abeb5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb 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 Jan 22 16:31:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 16:31:21 +0000 Subject: [MERGED] osmocom-bb[master]: cosmetic: fix Makefile whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: fix Makefile whitespace ...................................................................... cosmetic: fix Makefile whitespace Change-Id: Ia55d54d7ec7ec04e122d2e5250037c2d166abeb5 --- M src/Makefile 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/Makefile b/src/Makefile index f5e2128..7a7d283 100644 --- a/src/Makefile +++ b/src/Makefile @@ -51,7 +51,7 @@ host/virt_phy/configure: host/virt_phy/configure.ac cd host/virt_phy && autoreconf -i - + host/virt_phy/Makefile: host/virt_phy/configure cd host/virt_phy && ./configure $(HOST_CONFARGS) -- To view, visit https://gerrit.osmocom.org/5990 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia55d54d7ec7ec04e122d2e5250037c2d166abeb5 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:35:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 16:35:05 +0000 Subject: libosmocore[master]: socket: use inet_ntop() instead of inet_ntoa() in osmo_sock_... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9852b57736432032542bd96b6fdd4a2f08fc1f64 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:35:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 16:35:07 +0000 Subject: [MERGED] libosmocore[master]: socket: use inet_ntop() instead of inet_ntoa() in osmo_sock_... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: socket: use inet_ntop() instead of inet_ntoa() in osmo_sock_local_ip() ...................................................................... socket: use inet_ntop() instead of inet_ntoa() in osmo_sock_local_ip() The function inet_ntoa() stores its result in a static buffer and returns the pointer. When inet_ntoa() is called subsequently it overwrite the content of its static buffer with the new result. Since we osmo_sock_local_ip() is a library function we should use the more safe variant inet_ntop() in order to prevent unintentionally overwriting data that the caller might still need. Such an error would be hard to find. - Use the more safe inet_ntop() inestead of inet_ntoa() Change-Id: I9852b57736432032542bd96b6fdd4a2f08fc1f64 --- M src/socket.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index 35cce64..0378970 100644 --- a/src/socket.c +++ b/src/socket.c @@ -831,9 +831,9 @@ if (rc < 0) return -EINVAL; if (local_addr.sin_family == AF_INET) - strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET_ADDRSTRLEN); + inet_ntop(AF_INET, &local_addr.sin_addr, local_ip, INET_ADDRSTRLEN); else if (local_addr.sin_family == AF_INET6) - strncpy(local_ip, inet_ntoa(local_addr.sin_addr), INET6_ADDRSTRLEN); + inet_ntop(AF_INET6, &local_addr.sin_addr, local_ip, INET6_ADDRSTRLEN); else return -EINVAL; -- To view, visit https://gerrit.osmocom.org/5988 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9852b57736432032542bd96b6fdd4a2f08fc1f64 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:35:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 16:35:49 +0000 Subject: libosmocore[master]: fsm: add functions for unlinking and changing parents In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:38:43 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 16:38:43 +0000 Subject: [PATCH] osmo-msc[master]: Add a VTY command which deletes all expired SMS. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5989 to look at the new patch set (#2). Add a VTY command which deletes all expired SMS. We already delete SMS which have been sent successfully. However, there are plans to accept SMS for any subscriber in order to fix the problem described in https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). This means we may end up storing SMS which never get sent, e.g. because the B subscriber doesn't actually exist. This could lead to a higher degree of SMS database growth over time, and therefore we need a way to keep database size under control. As a first step, introduce a DB function which removes an expired SMS, and add a VTY command which removes all expired SMS from the DB. Later commits will build upon this to remove expired SMS automatically. The SMS expiry time period is currently hard-coded to 2 weeks. We could make this configurable in the future if desired. Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Related: OS#2354 --- M include/osmocom/msc/db.h M include/osmocom/msc/sms_queue.h M src/libmsc/db.c M src/libmsc/sms_queue.c M src/libmsc/vty_interface_layer3.c 5 files changed, 85 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/89/5989/2 diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 13c5ed3..2105d38 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -50,6 +50,7 @@ int db_sms_inc_deliver_attempts(struct gsm_sms *sms); int db_sms_delete_by_msisdn(const char *msisdn); int db_sms_delete_sent_message_by_id(unsigned long long sms_id); +int db_sms_delete_expired_message_by_id(unsigned long long sms_id); /* Statistics counter storage */ struct osmo_counter; diff --git a/include/osmocom/msc/sms_queue.h b/include/osmocom/msc/sms_queue.h index 2a8bd58..b5488fe 100644 --- a/include/osmocom/msc/sms_queue.h +++ b/include/osmocom/msc/sms_queue.h @@ -13,5 +13,6 @@ int sms_queue_set_max_pending(struct gsm_sms_queue *, int max); int sms_queue_set_max_failure(struct gsm_sms_queue *, int fail); int sms_queue_clear(struct gsm_sms_queue *); +int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id); #endif diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4bf9b1f..ccd659e 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -989,6 +989,43 @@ return 0; } +int db_sms_delete_expired_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + time_t created, validity_timestamp, now, min_created; + + result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + if (!result) + return -1; + if (!next_row(result)) { + dbi_result_free(result); + return -1; + } + + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + dbi_result_free(result); + + now = time(NULL); + if (validity_timestamp > now) + return -1; + + /* Our SMS expiry threshold is hard-coded to roughly 2 weeks at the moment. */ + min_created = now - (time_t)(60 * 60 * 24 * 7 * 2); + if (min_created < 0) /* bogus system clock? */ + return -1; + if (created >= min_created) /* not yet expired */ + return -1; + + result = dbi_conn_queryf(conn, "DELETE FROM SMS WHERE id = %llu", sms_id); + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to delete SMS %llu.\n", sms_id); + return -1; + } + dbi_result_free(result); + return 0; +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 1372a2c..8cc9eb3 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -73,21 +73,21 @@ static int sms_sms_cb(unsigned int, unsigned int, void *, void *); static struct gsm_sms_pending *sms_find_pending(struct gsm_sms_queue *smsq, - struct gsm_sms *sms) + unsigned long long sms_id) { struct gsm_sms_pending *pending; llist_for_each_entry(pending, &smsq->pending_sms, entry) { - if (pending->sms_id == sms->id) + if (pending->sms_id == sms_id) return pending; } return NULL; } -static int sms_is_in_pending(struct gsm_sms_queue *smsq, struct gsm_sms *sms) +int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id) { - return sms_find_pending(smsq, sms) != NULL; + return sms_find_pending(smsq, sms_id) != NULL; } static struct gsm_sms_pending *sms_subscriber_find_pending( @@ -287,7 +287,7 @@ } /* no need to send a pending sms */ - if (sms_is_in_pending(smsq, sms)) { + if (sms_queue_sms_is_pending(smsq, sms->id)) { LOGP(DLSMS, LOGL_DEBUG, "SMSqueue with pending sms: %llu. Skipping\n", sms->id); sms_free(sms); @@ -338,7 +338,7 @@ goto no_pending_sms; /* The sms should not be scheduled right now */ - OSMO_ASSERT(!sms_is_in_pending(smsq, sms)); + OSMO_ASSERT(!sms_queue_sms_is_pending(smsq, sms->id)); /* Remember that we deliver this SMS and send it */ pending = sms_pending_from(smsq, sms); @@ -473,7 +473,7 @@ * sms that are not in our control as we just have a channel * open anyway. */ - pending = sms_find_pending(network->sms_queue, sig_sms->sms); + pending = sms_find_pending(network->sms_queue, sig_sms->sms->id); if (!pending) return 0; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c7ec586..df555fd 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -166,6 +166,44 @@ return CMD_SUCCESS; } + +DEFUN(sms_delete_expired, + sms_delete_expired_cmd, + "sms delete expired", + "SMS related commands\n" "SMS Database related commands\n" + "Delete all expired SMS") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_sms *sms; + unsigned long long sms_id = 0; + long long num_deleted = 0; + + while (1) { + sms = db_sms_get_next_unsent(gsmnet, sms_id, UINT_MAX); + if (!sms) + break; + + /* Skip SMS which are currently queued for sending. */ + if (sms_queue_sms_is_pending(gsmnet->sms_queue, sms->id)) + continue; + + /* Expiration check is performed by the DB layer. */ + if (db_sms_delete_expired_message_by_id(sms->id) == 0) + num_deleted++; + + sms_id = sms->id + 1; + } + + if (num_deleted == 0) { + vty_out(vty, "No expired SMS in database%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "Deleted %llu expired SMS from database%s", num_deleted, VTY_NEWLINE); + return CMD_SUCCESS; +} + + static int _send_sms_str(struct vlr_subscr *receiver, struct vlr_subscr *sender, char *str, uint8_t tp_pid) @@ -903,6 +941,7 @@ install_element_ve(&show_subscr_cache_cmd); install_element_ve(&sms_send_pend_cmd); + install_element_ve(&sms_delete_expired_cmd); install_element_ve(&subscriber_create_cmd); install_element_ve(&subscriber_send_sms_cmd); -- To view, visit https://gerrit.osmocom.org/5989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:41:39 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 16:41:39 +0000 Subject: [PATCH] osmocom-bb[master]: Don't ignore top-level Makefile Message-ID: Review at https://gerrit.osmocom.org/5991 Don't ignore top-level Makefile Move corresponding .gitignore entry inside virt-phy to avoid interfering with other subprojects still using hand-crafted Makefiles. Change-Id: I19a8661b74ae0b28da51cf2e81f0ca40de76fcbd --- M .gitignore M src/host/virt_phy/.gitignore 2 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/91/5991/1 diff --git a/.gitignore b/.gitignore index 363f656..1a01c26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.o *.a Makefile.in -Makefile .deps build-target diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore index 0d2eba0..b9a2ca7 100644 --- a/src/host/virt_phy/.gitignore +++ b/src/host/virt_phy/.gitignore @@ -1,3 +1,4 @@ +Makefile config.h config.h.in src/virtphy -- To view, visit https://gerrit.osmocom.org/5991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I19a8661b74ae0b28da51cf2e81f0ca40de76fcbd Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 16:41:39 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 22 Jan 2018 16:41:39 +0000 Subject: [PATCH] osmocom-bb[master]: Import gprsdecode utility Message-ID: Review at https://gerrit.osmocom.org/5992 Import gprsdecode utility Add modernized version of gprsdecode: * port to latest libosmocore library * add regression tests The code is based on work of SRLabs available at https://srlabs.de/gprs/ Change-Id: I12234d37c66b83b8abd60f7511fa1d7837db1856 --- M src/Makefile A src/host/gprsdecode/.gitignore A src/host/gprsdecode/Makefile A src/host/gprsdecode/README A src/host/gprsdecode/burst_desc.h A src/host/gprsdecode/crc.c A src/host/gprsdecode/crc.h A src/host/gprsdecode/gprs.c A src/host/gprsdecode/gprs.h A src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.decoded A src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.sample A src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.decoded A src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.sample A src/host/gprsdecode/main.c A src/host/gprsdecode/output.c A src/host/gprsdecode/output.h A src/host/gprsdecode/rlcmac.c A src/host/gprsdecode/rlcmac.h 18 files changed, 7,946 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/92/5992/1 diff --git a/src/Makefile b/src/Makefile index 7a7d283..15b6a4a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -13,7 +13,7 @@ all: libosmocore-target nofirmware firmware mtk-firmware -nofirmware: layer23 osmocon gsmmap virtphy +nofirmware: layer23 osmocon gsmmap gprsdecode virtphy libosmocore-target: shared/libosmocore/build-target/src/.libs/libosmocore.a @@ -83,6 +83,11 @@ host/layer23/layer23: host/layer23/Makefile make -C host/layer23 +.PHONY: gprsdecode +gprsdecode: host/gprsdecode/gprsdecode + +host/gprsdecode/gprsdecode: + make -C host/gprsdecode .PHONY: firmware firmware: libosmocore-target @@ -98,6 +103,7 @@ make -C host/layer23 $@ make -C host/osmocon $@ make -C host/gsmmap $@ + make -C host/gprsdecode $@ make -C host/virt_phy $@ make -C target/firmware $@ make -C target/firmware -f Makefile.mtk $@ @@ -107,6 +113,7 @@ make -C host/layer23 $@ make -C host/osmocon $@ make -C host/gsmmap $@ + make -C host/gprsdecode $@ make -C host/virt_phy $@ # 'firmware' also handles 'mtk-firmware' make -C target/firmware $@ diff --git a/src/host/gprsdecode/.gitignore b/src/host/gprsdecode/.gitignore new file mode 100644 index 0000000..39141b0 --- /dev/null +++ b/src/host/gprsdecode/.gitignore @@ -0,0 +1,3 @@ +bursts* +*.dat +gprsdecode diff --git a/src/host/gprsdecode/Makefile b/src/host/gprsdecode/Makefile new file mode 100644 index 0000000..1bf8b10 --- /dev/null +++ b/src/host/gprsdecode/Makefile @@ -0,0 +1,14 @@ +default: + @echo [CC] $@ + @gcc -Wall -O3 -pipe -flto -std=gnu99 -g -o gprsdecode main.c gprs.c output.c rlcmac.c crc.c -pthread -losmogsm -losmocore + +clean: + rm gprsdecode + +check: default + @echo test CS2 + @./gprsdecode gprs_262_80_0001_0000_20110710_2251_875_494777_0f.sample > cs2.dat + @diff gprs_262_80_0001_0000_20110710_2251_875_494777_0f.decoded cs2.dat + @echo test CS3 + @./gprsdecode gprs_20160129_1744_878_16846_0c.sample > cs3.dat + @diff gprs_20160129_1744_878_16846_0c.decoded cs3.dat diff --git a/src/host/gprsdecode/README b/src/host/gprsdecode/README new file mode 100644 index 0000000..52fec16 --- /dev/null +++ b/src/host/gprsdecode/README @@ -0,0 +1,3 @@ +GPRS decoder for OsmocomBB + +Based on the version from https://srlabs.de/gprs/ diff --git a/src/host/gprsdecode/burst_desc.h b/src/host/gprsdecode/burst_desc.h new file mode 100644 index 0000000..102b16d --- /dev/null +++ b/src/host/gprsdecode/burst_desc.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +#ifndef __L1CTL_PROTO_H__ + +#define BI_FLG_DUMMY (1<<4) +#define BI_FLG_SACCH (1<<5) + +struct l1ctl_burst_ind { + uint32_t frame_nr; + uint16_t band_arfcn; /* ARFCN + band + ul indicator */ + uint8_t chan_nr; /* GSM 08.58 channel number (9.3.1) */ + uint8_t flags; /* BI_FLG_xxx + burst_id = 2LSBs */ + uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */ + uint8_t snr; /* Reported SNR >> 8 (0-255) */ + uint8_t bits[15]; /* 114 bits + 2 steal bits. Filled MSB first */ +} __attribute__((packed)); + +#endif diff --git a/src/host/gprsdecode/crc.c b/src/host/gprsdecode/crc.c new file mode 100644 index 0000000..0d5323a --- /dev/null +++ b/src/host/gprsdecode/crc.c @@ -0,0 +1,148 @@ +/* + * Code imported from GNURadio, GSMSTACK and Linux Kernel. + */ + +#include +#include +#include + +#include "crc.h" + +#define REM(x, y) (x) % (y) + +static int FC_syndrome_shift(FC_CTX *ctx, unsigned int bit); + +int FC_init(FC_CTX *ctx, unsigned int crc_size, unsigned int data_size) +{ + ctx->crc_size = crc_size; + ctx->data_size = data_size; + ctx->syn_start = 0; + + return 0; +} + +int FC_check_crc(FC_CTX *ctx, unsigned char *input_bits, unsigned char *control_data) +{ + int j,error_count = 0, error_index = 0, success_flag = 0, syn_index = 0; + unsigned int i; + + ctx->syn_start = 0; + // reset the syndrome register + memset(ctx->syndrome_reg, 0, sizeof ctx->syndrome_reg); + + // shift in the data bits + for (i=0; i < ctx->data_size; i++) { + error_count = FC_syndrome_shift(ctx, input_bits[i]); + control_data[i] = input_bits[i]; + } + + // shift in the crc bits + for (i=0; i < ctx->crc_size; i++) { + error_count = FC_syndrome_shift(ctx, 1-input_bits[i+ctx->data_size]); + } + + // Find position of error burst + if (error_count == 0) { + error_index = 0; + } + else { + error_index = 1; + error_count = FC_syndrome_shift(ctx, 0); + error_index += 1; + while (error_index < (ctx->data_size + ctx->crc_size) ) { + error_count = FC_syndrome_shift(ctx, 0); + error_index += 1; + if ( error_count == 0 ) break; + } + } + + // Test for correctable errors + //printf("error_index %d\n",error_index); + if (error_index == 224) success_flag = 0; + else { + + // correct index depending on the position of the error + if (error_index == 0) syn_index = error_index; + else syn_index = error_index - 1; + + // error burst lies within data bits + if (error_index < 184) { + //printf("error < bit 184,%d\n",error_index); + j = error_index; + while ( j < (error_index+12) ) { + if (j < 184) { + control_data[j] = control_data[j] ^ + ctx->syndrome_reg[REM(ctx->syn_start+39-j+syn_index,40)]; + } + else break; + j = j + 1; + } + } + else if ( error_index > 212 ) { + //printf("error > bit 212,%d\n",error_index); + j = 0; + while ( j < (error_index - 212) ) { + control_data[j] = control_data[j] ^ + ctx->syndrome_reg[REM(ctx->syn_start+39-j-224+syn_index,40)]; + j = j + 1; + } + } + // for 183 < error_index < 213 error in parity alone so ignore + success_flag = 1; + } + return success_flag; +} + +static int FC_syndrome_shift(FC_CTX *ctx, unsigned int bit) +{ + int error_count = 0; + unsigned int i; + + if (ctx->syn_start == 0) + ctx->syn_start = 39; + else ctx->syn_start -= 1; + + int temp_syndrome_reg[sizeof ctx->syndrome_reg]; + + memcpy(temp_syndrome_reg, ctx->syndrome_reg, sizeof temp_syndrome_reg); + + temp_syndrome_reg[REM(ctx->syn_start+3,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+3,40)] ^ + ctx->syndrome_reg[ctx->syn_start]; + temp_syndrome_reg[REM(ctx->syn_start+17,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+17,40)] ^ + ctx->syndrome_reg[ctx->syn_start]; + temp_syndrome_reg[REM(ctx->syn_start+23,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+23,40)] ^ + ctx->syndrome_reg[ctx->syn_start]; + temp_syndrome_reg[REM(ctx->syn_start+26,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+26,40)] ^ + ctx->syndrome_reg[ctx->syn_start]; + + temp_syndrome_reg[REM(ctx->syn_start+4,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+4,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+6,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+6,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+10,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+10,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+16,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+16,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+27,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+27,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+29,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+29,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+33,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+33,40)] ^ bit; + temp_syndrome_reg[REM(ctx->syn_start+39,40)] = + ctx->syndrome_reg[REM(ctx->syn_start+39,40)] ^ bit; + + temp_syndrome_reg[ctx->syn_start] = ctx->syndrome_reg[ctx->syn_start] ^ bit; + + memcpy(ctx->syndrome_reg, temp_syndrome_reg, sizeof ctx->syndrome_reg); + + for (i = 0; i < 28; i++) { + error_count = error_count + ctx->syndrome_reg[REM(ctx->syn_start+i,40)]; + } + return error_count; +} + diff --git a/src/host/gprsdecode/crc.h b/src/host/gprsdecode/crc.h new file mode 100644 index 0000000..f04a56b --- /dev/null +++ b/src/host/gprsdecode/crc.h @@ -0,0 +1,34 @@ +/* + * Copyright 2005 Free Software Foundation, Inc. + * + * This file is part of GNU Radio + * + * GNU Radio 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, or (at your option) + * any later version. + * + * GNU Radio 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 GNU Radio; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#pragma once + +#include + +typedef struct { + unsigned int crc_size; + unsigned int data_size; + unsigned int syn_start; + int syndrome_reg[40]; +} FC_CTX; + +int FC_init(FC_CTX *ctx, unsigned int crc_size, unsigned int data_size); +int FC_check_crc(FC_CTX *ctx, unsigned char *input_bits, unsigned char *control_data); diff --git a/src/host/gprsdecode/gprs.c b/src/host/gprsdecode/gprs.c new file mode 100644 index 0000000..f6df610 --- /dev/null +++ b/src/host/gprsdecode/gprs.c @@ -0,0 +1,357 @@ +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "crc.h" +#include "gprs.h" +#include "rlcmac.h" + +void gprs_init() +{ + memset(tbf_table, 0, sizeof(tbf_table)); +} + +static inline unsigned distance(const uint8_t *a, const uint8_t *b, const unsigned size) +{ + int distance = 0; + + for (int i = 0; i < size; i++) + distance += !!(a[i] ^ b[i]); + + return distance; +} + +static inline const char *cs_to_s(enum CS cs) +{ + switch (cs) { + case CS1: return "CS1"; + case CS2: return "CS2"; + case CS3: return "CS3"; + case CS4: return "CS4"; + case MCS1_4: return "MCS1_4"; + case MCS5_6: return "MCS5_6"; + case MCS7_9: return "MCS7_9"; + } + return "LOL"; +} + +static inline enum CS cs_estimate(const uint8_t *sflags, bool print, unsigned prefer_mcs) +{ + if (print) + printf("CS estimation for %s:\n", osmo_hexdump(sflags, 8)); + int i; + unsigned cs_dist[7]; + const uint8_t cs_pattern[][8] = {{1, 1, 1, 1, 1, 1, 1, 1}, // CS1 + {1, 1, 0, 0, 1, 0, 0, 0}, // CS2 + {0, 0, 1, 0, 0, 0, 0, 1}, // CS3 + {0, 0, 0, 1, 0, 1, 1, 0}, // CS4 + {0, 0, 0, 1, 0, 1, 1, 0}, // MCS1-4 + {0, 0, 0, 0, 0, 0, 0, 0},// MCS5-6 + {1, 1, 1, 0, 0, 1, 1, 1}// MCS7-9 + }; + + for (i = 0; i < 7; i++) { + cs_dist[i] = distance(sflags, cs_pattern[i], 8); + if (print) + printf("\tD[%d (%s)] = %d\n", i, cs_to_s(i), cs_dist[i]); + } + + if (cs_dist[0] < cs_dist[1]) + i = CS1; + else + i = CS2; + if (cs_dist[2] < cs_dist[i]) + i = CS3; + if (cs_dist[3] < cs_dist[i]) + i = CS4; + + if (prefer_mcs) {// enforce selecting MCS over CS in case of same distance + if (cs_dist[4] <= cs_dist[i]) + i = MCS1_4; + } else { + if (cs_dist[4] < cs_dist[i]) + i = MCS1_4; + } + + if (cs_dist[5] < cs_dist[i]) + i = MCS5_6; + if (cs_dist[6] < cs_dist[i]) + i = MCS7_9; + + if (print) + printf("\tselected: %d (%s)\n\n", i, cs_to_s(i)); + return i; +} + +static inline int usf6_estimate(const uint8_t *data) +{ + int i, min; + unsigned usf_dist[8]; + const uint8_t usf_pattern[][6] = {{0, 0, 0, 0, 0, 0}, + {0, 0, 1, 0, 1, 1}, + {0, 1, 0, 1, 1, 0}, + {0, 1, 1, 1, 0, 1}, + {1, 0, 0, 1, 0, 1}, + {1, 0, 1, 1, 1, 0}, + {1, 1, 0, 0, 1, 1}, + {1, 1, 1, 0, 0, 0}}; + + + for (i = 0; i < 8; i++) + usf_dist[i] = distance(data, usf_pattern[i], 6); + + for (i = 1, min = 0; i < 8; i++) + if (usf_dist[i] < usf_dist[min]) + min = i; + + return min; +} + +static inline int usf12_estimate(const uint8_t *data) +{ + int i, min; + unsigned usf_dist[8]; + const uint8_t usf_pattern[][12] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 1}, + {0, 0, 1, 1, 0, 1, 1, 1, 0, 1, 1, 0}, + {0, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1}, + {1, 1, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1}, + {1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0}, + {1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 1}, + {1, 1, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0}}; + + + for (i = 0; i < 8; i++) + usf_dist[i] = distance(data, usf_pattern[i], 12); + + for (i = 1, min = 0; i < 8; i++) + if (usf_dist[i] < usf_dist[min]) + min = i; + + return min; +} + +static inline void gsm0503_xcch_deinterleave(sbit_t *cB, sbit_t *iB) +{ + int j, B; + + for (int k = 0; k < 456; k++) { + B = k & 3; + j = 2 * ((49 * k) % 57) + ((k & 7) >> 2); + cB[k] = iB[B * 114 + j]; + } +} + +static inline int decode_signalling(const uint8_t *conv_data, uint8_t *msg) +{ + uint8_t decoded_data[PARITY_OUTPUT_SIZE]; + int8_t soft_input[CONV_SIZE]; + + /* convert to soft bits */ + osmo_ubit2sbit(soft_input, conv_data, CONV_SIZE); + + /* Viterbi decoding */ + osmo_conv_decode(&gsm0503_xcch, soft_input, decoded_data); + + /* parity check: if error detected try to fix it */ + int ret = osmo_crc64gen_check_bits(&gsm0503_fire_crc40, decoded_data, 184, decoded_data + 184); + if (ret) { + FC_CTX fc_ctx; + FC_init(&fc_ctx, PARITY_SIZE, DATA_BLOCK_SIZE); +/**/ + unsigned char crc_result[DATA_BLOCK_SIZE + PARITY_SIZE]; + ret = FC_check_crc(&fc_ctx, decoded_data, crc_result); + if (!ret) + return 0; + /* + ubit_t crc_result[DATA_BLOCK_SIZE + PARITY_SIZE]; + osmo_crc64gen_set_bits(&gsm0503_fire_crc40, decoded_data, 184, crc_result); + */ + memcpy(decoded_data, crc_result, sizeof crc_result); + } + + osmo_ubit2pbit_ext(msg, 0, decoded_data, 0, DATA_BLOCK_SIZE, 1); + + return 23; +} + +int process_pdch(struct l1ctl_burst_ind *bi, bool print) +{ + int len, ret, usf; + uint32_t fn; + uint16_t arfcn; + struct burst_buf *bb; + struct gprs_message gm; + uint8_t ts, ul, conv_data[CONV_SIZE], decoded_data[2 * CONV_SIZE], gprs_msg[54]; + int8_t depunct_data[2 * CONV_SIZE]; + + /* get burst parameters */ + fn = ntohl(bi->frame_nr); + arfcn = ntohs(bi->band_arfcn); + ul = !!(arfcn & GSMTAP_ARFCN_F_UPLINK); + ts = bi->chan_nr & 7; + + /* select frame queue */ + bb = (ul) ? (&gprs[2 * ts + 0]) : (&gprs[2 * ts + 1]); + + /* align to first frame */ + if ((bb->count == 0) && (((fn % 13) % 4) != 0)) + return -1; + + /* enqueue data into message buffer */ + osmo_pbit2ubit(bb->data + bb->count * 114, bi->bits, 114); + + /* save stealing flags */ + bb->sbit[bb->count * 2 + 0] = !!(bi->bits[14] & 0x10); // check stealing bits location for MCS > 4 + bb->sbit[bb->count * 2 + 1] = !!(bi->bits[14] & 0x20); + if (print) + printf("added stealing bits (%d::%d) at [%d::%d]\n", !!(bi->bits[14] & 0x10), !!(bi->bits[14] & 0x20), bb->count * 2 + 0, bb->count * 2 + 1); + bb->snr[bb->count] = bi->snr; + bb->rxl[bb->count] = bi->rx_level; + bb->fn[bb->count] = fn; + bb->count++; + + /* Return if not enough bursts for a full message */ + if (bb->count < 4) + return -2; + + /* de-interleaving */ + memset(conv_data, 0, sizeof(conv_data)); + gsm0503_xcch_deinterleave((sbit_t *)conv_data, (sbit_t *)bb->data); // FIXME: hack, working with non-soft bits + len = 0; + + enum CS cs = cs_estimate(bb->sbit, DEBUG_PRINT, PREFER_MCS); + switch (cs) { + case CS1: + if (print) + printf("processing CS1 (%d::%d)\n", *(bb->sbit), cs); + len = decode_signalling(conv_data, gprs_msg); + break; + case CS2: + if (print) + printf("processing CS2 (%d::%d)\n", *(bb->sbit), cs); + /* depuncture and convert to soft bits */ + memset(depunct_data, 0, 294 * 2); + osmo_ubit2sbit(depunct_data, conv_data, 456); + + /* Viterbi decode */ + osmo_conv_decode(&gsm0503_cs2, depunct_data, decoded_data); + + /* decode USF bits */ + usf = usf6_estimate(decoded_data); + + /* rebuild original data string for CRC check */ + decoded_data[3] = (usf >> 2) & 1; + decoded_data[4] = (usf >> 1) & 1; + decoded_data[5] = (usf >> 0) & 1; + + /* compute CRC-16 (CCITT) */ + ret = osmo_crc16gen_check_bits(&gsm0503_cs234_crc16, decoded_data + 3, 271, decoded_data + 3 + 271); + + if (!ret) { + osmo_ubit2pbit_ext(gprs_msg, 0, decoded_data + 3, 0, 33 * 8, 1); + len = 33; + } + + break; + case CS3: + if (print) + printf("processing CS3 (%d::%d)\n", *(bb->sbit), cs); + /* depuncture and convert to soft bits */ + memset(depunct_data, 0, 338 * 2); + osmo_ubit2sbit(depunct_data, conv_data, 456); + + /* Viterbi decode */ + osmo_conv_decode(&gsm0503_cs3, depunct_data, decoded_data); + + /* decode USF bits */ + usf = usf6_estimate(decoded_data); + + /* rebuild original data string for CRC check */ + decoded_data[3] = (usf >> 2) & 1; + decoded_data[4] = (usf >> 1) & 1; + decoded_data[5] = (usf >> 0) & 1; + + /* compute CRC-16 (CCITT) */ + ret = osmo_crc16gen_check_bits(&gsm0503_cs234_crc16, decoded_data + 3, 315, decoded_data + 3 + 315); + if (!ret) { + osmo_ubit2pbit_ext(gprs_msg, 0, decoded_data + 3, 0, 39 * 8, 1); + len = 39; + } + break; + case CS4: + if (print) + printf("processing CS4 (%d::%d)\n", *(bb->sbit), cs); + /* decode USF bits */ + usf = usf12_estimate(conv_data); + + /* rebuild original data string for CRC check */ + conv_data[9] = (usf >> 2) & 1; + conv_data[10] = (usf >> 1) & 1; + conv_data[11] = (usf >> 0) & 1; + + /* compute CRC-16 (CCITT) */ + ret = osmo_crc16gen_check_bits(&gsm0503_cs234_crc16, conv_data + 9, 431, conv_data + 9 + 431); + if (!ret) { + osmo_ubit2pbit_ext(gprs_msg, 0, conv_data + 9, 0, 53 * 8, 1); + len = 53; // last byte not used (0x2b) + } else {// try MCS1-4? + + } + break; + case MCS1_4: + if (print) + printf("MCS1-4 is unsupported ATM\n"); + break; + case MCS5_6: + if (print) + printf("MCS5-6 is unsupported ATM\n"); + break; + case MCS7_9: + if (print) + printf("MCS7-9 is unsupported ATM\n"); + break; + default: + printf("(M)CS estimation failed for %d: %s\n", *(bb->sbit), cs_to_s(cs)); + break; + } + + /* if a message is decoded */ + if (len) { + unsigned s_sum, r_sum; + + /* fill gprs message struct */ + s_sum = 0; + r_sum = 0; + for (int i = 0; i < 4; i++) { + s_sum += bb->snr[i]; + r_sum += bb->rxl[i]; + } + gm.snr = s_sum / 4; + gm.rxl = r_sum / 4; + gm.arfcn = arfcn; + gm.fn = fn - 3; + gm.ts = ts; + gm.len = len; + memcpy(gm.msg, gprs_msg, len); + + /* call handler */ + if (0 == rlc_type_handler(&gm)) + cs_estimate(bb->sbit, DEBUG_PRINT, PREFER_MCS); // check (M)CS selection + } + + /* reset buffer */ + memset(bb->data, 0, sizeof(bb->data)); + bb->count = 0; + + return len; +} + diff --git a/src/host/gprsdecode/gprs.h b/src/host/gprsdecode/gprs.h new file mode 100644 index 0000000..9ca183e --- /dev/null +++ b/src/host/gprsdecode/gprs.h @@ -0,0 +1,63 @@ +#pragma once + +#include +#include + +#include +#include + +#include "burst_desc.h" + +enum CS {CS1 = 0, CS2, CS3, CS4, MCS1_4, MCS5_6, MCS7_9}; + +#define DATA_BLOCK_SIZE 184 +#define PARITY_SIZE 40 +#define FLUSH_BITS_SIZE 4 +#define PARITY_OUTPUT_SIZE (DATA_BLOCK_SIZE + PARITY_SIZE + FLUSH_BITS_SIZE) +#define DEBUG_PRINT false +#define PREFER_MCS 0 +#define CONV_SIZE (2 * PARITY_OUTPUT_SIZE) +#define MAX_MCS 5 +// 5 == MCS1-4 + +enum {UNKNOWN = 0, BCCH = 1, CCCH = 2, SDCCH = 4, SACCH = 8}; + +/* + * GSM PDTCH CS-2, CS-3, CS-4 parity + * + * g(x) = x^16 + x^12 + x^5 + 1 + */ +static const struct osmo_crc16gen_code gsm0503_cs234_crc16 = { + .bits = 16, + .poly = 0x1021, + .init = 0x0000, + .remainder = 0xffff, +}; + +/* + * 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 + */ +static const struct osmo_crc64gen_code gsm0503_fire_crc40 = { + .bits = 40, + .poly = 0x0004820009ULL, + .init = 0x0000000000ULL, + .remainder = 0xffffffffffULL, +}; + +struct burst_buf { + unsigned count; + unsigned errors; + unsigned snr[2 * 4]; + unsigned rxl[2 * 4]; + uint32_t fn[2 * 4]; + uint8_t data[2 * 4 * 114]; + uint8_t sbit[2 * 4 * 2]; +}; + +struct burst_buf gprs[16]; + +void gprs_init(); +int process_pdch(struct l1ctl_burst_ind *bi, bool print); diff --git a/src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.decoded b/src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.decoded new file mode 100644 index 0000000..7af0753 --- /dev/null +++ b/src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.decoded @@ -0,0 +1,6278 @@ +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 16895 fn_last_bsn 16895 delta_bsn 0 old_len 0 +clearing TBF 1, first 0 last 0 +new TBF, starting from 0 + bsn 0 +lime 0 +end of message reached +MSG: 41c001081502de8e9a + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 1 FBI 0 +fn_same_bsn 16986 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 0 +lime 0 + +lime 1 + bsn 1 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS2 DL DATA TFI 0 BSN 1 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 29 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 16999 fn_last_bsn 8 delta_bsn 1 old_len 0 + bsn 1 +lime 0 + bsn 2 +lime 0 +end of message reached +MSG: 41c005081501c7d312 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 17064 fn_last_bsn 30 delta_bsn 1 old_len 0 + bsn 2 +lime 0 + +lime 1 + bsn 3 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS2 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 29 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 29 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 29 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 29 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 17090 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 +end of message reached +MSG: 2b2b2b + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS2 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS2 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 28 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 17142 fn_last_bsn 30 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 17177 fn_last_bsn 13 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 +TS 4 CS3 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 17203 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 17264 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 17324 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 17381 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 17441 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 +lime 0 + bsn 13 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 17498 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 +lime 0 + bsn 13 +lime 0 + bsn 14 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 17558 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 +lime 0 + bsn 13 +lime 0 + bsn 14 +lime 0 + bsn 15 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 16 FBI 1 +fn_same_bsn 18005 fn_last_bsn 425 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 +lime 0 + bsn 13 +lime 0 + bsn 14 +lime 0 + bsn 15 +lime 0 + bsn 16 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 16 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 16 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 16 FBI 1 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 16 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 16 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 35 +duplicate2 + +TS 4 CS3 DL DATA TFI 1 BSN 1 FBI 0 +fn_same_bsn 18109 fn_last_bsn 18109 delta_bsn 1 old_len 0 +clearing TBF 2, first 0 last 0 +new TBF, starting from 1 + bsn 1 +TS 4 CS3 DL DATA TFI 1 BSN 0 FBI 0 +fn_same_bsn 18113 fn_last_bsn 4 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS3 DL DATA TFI 1 BSN 2 FBI 0 +fn_same_bsn 18117 fn_last_bsn 8 delta_bsn 1 old_len 0 + bsn 1 bsn 2 +lime 0 +end of message reached +MSG: 26818000010001000000000277730367746d046163657203636f6d0000010001c00c00010001000000070004c76b780a5a9f7f + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 1 BSN 1 FBI 0 +fn_same_bsn 13 fn_last_bsn 5 delta_bsn -1 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 1 BSN 0 FBI 0 +fn_same_bsn 13 fn_last_bsn 9 delta_bsn -2 old_len 0 +duplicate2 + +TS 4 CS3 DL DATA TFI 1 BSN 2 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 34 +duplicate2 + +TS 4 CS3 DL DATA TFI 1 BSN 1 FBI 0 +fn_same_bsn 13 fn_last_bsn 5 delta_bsn -1 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 18174 fn_last_bsn 44 delta_bsn 1 old_len 0 + bsn 2 +lime 0 + +lime 1 + bsn 3 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 8 fn_last_bsn 8 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 3 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 5 FBI 0 +fn_same_bsn 18234 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 +end of message reached +MSG: 64010303000101080a2df10b9001cbcbdf04020000d10cd2 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 5 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 5 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 5 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 5 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 5 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 6 FBI 0 +fn_same_bsn 18286 fn_last_bsn 30 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 6 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 6 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 6 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 6 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 6 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 7 FBI 0 +fn_same_bsn 18343 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 7 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 7 FBI 0 +fn_same_bsn 8 fn_last_bsn 8 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 9 FBI 0 +fn_same_bsn 18395 fn_last_bsn 31 delta_bsn 2 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 +lime 0 + bsn 8 null + bsn 9 +lime 0 +end of message reached +MSG: 0a2df10e5d01cbcc1afd50b8 + +TS 4 CS4 DL DATA TFI 1 BSN 11 FBI 0 +fn_same_bsn 18399 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 9 +lime 0 + bsn 10 null + bsn 11 +TS 4 CS4 DL DATA TFI 1 BSN 13 FBI 0 +fn_same_bsn 18403 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 9 +lime 0 + bsn 10 null + bsn 11 bsn 12 null + bsn 13 +TS 4 CS4 DL DATA TFI 1 BSN 15 FBI 0 +fn_same_bsn 18408 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 9 +lime 0 + bsn 10 null + bsn 11 bsn 12 null + bsn 13 bsn 14 null + bsn 15 +TS 4 CS4 DL DATA TFI 1 BSN 17 FBI 0 +fn_same_bsn 18412 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 9 +lime 0 + bsn 10 null + bsn 11 bsn 12 null + bsn 13 bsn 14 null + bsn 15 bsn 16 null + bsn 17 +TS 4 CS4 DL DATA TFI 1 BSN 19 FBI 0 +fn_same_bsn 18416 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 9 +lime 0 + bsn 10 null + bsn 11 bsn 12 null + bsn 13 bsn 14 null + bsn 15 bsn 16 null + bsn 17 bsn 18 null + bsn 19 +lime 0 +end of message reached +MSG: 696c61626c653c2f68323e0d0a3c6872ae2662 + +TS 4 CS4 DL DATA TFI 1 BSN 21 FBI 0 +fn_same_bsn 18421 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 +TS 4 CS4 DL DATA TFI 1 BSN 8 FBI 0 +fn_same_bsn 18425 fn_last_bsn 4 delta_bsn -13 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 10 FBI 0 +fn_same_bsn 18429 fn_last_bsn 8 delta_bsn -11 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 12 FBI 0 +fn_same_bsn 18434 fn_last_bsn 13 delta_bsn -9 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 14 FBI 0 +fn_same_bsn 18438 fn_last_bsn 17 delta_bsn -7 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 16 FBI 0 +fn_same_bsn 18442 fn_last_bsn 21 delta_bsn -5 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 18 FBI 0 +fn_same_bsn 18447 fn_last_bsn 26 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 20 FBI 0 +fn_same_bsn 18451 fn_last_bsn 30 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 18455 fn_last_bsn 34 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 +end of message reached +MSG: c015650000044500003406b94000ee0685e8c76b780ac0a800040050db85d1b579a8c324e273801112058d9300000101080a2df10e5e01cbcc1a1347bb + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 9 FBI 0 +fn_same_bsn 65 fn_last_bsn 5 delta_bsn -13 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 11 FBI 0 +fn_same_bsn 65 fn_last_bsn 9 delta_bsn -11 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 13 FBI 0 +fn_same_bsn 65 fn_last_bsn 13 delta_bsn -9 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 22 fn_last_bsn 22 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 23 FBI 0 +fn_same_bsn 18559 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 23 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 23 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 24 FBI 0 +fn_same_bsn 18616 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 + bsn 24 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 24 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 24 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 24 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 24 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 24 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 25 FBI 0 +fn_same_bsn 18676 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 + bsn 24 +lime 0 + bsn 25 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 25 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 25 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 25 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 25 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 25 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 26 FBI 0 +fn_same_bsn 18733 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 + bsn 24 +lime 0 + bsn 25 +lime 0 + bsn 26 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 26 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 26 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 26 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 26 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 26 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 27 FBI 0 +fn_same_bsn 18793 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 + bsn 24 +lime 0 + bsn 25 +lime 0 + bsn 26 +lime 0 + bsn 27 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 27 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 27 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 27 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 27 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 27 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 28 FBI 0 +fn_same_bsn 18850 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 + bsn 24 +lime 0 + bsn 25 +lime 0 + bsn 26 +lime 0 + bsn 27 +lime 0 + bsn 28 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 28 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 28 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 28 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 28 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 28 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 29 FBI 1 +fn_same_bsn 19296 fn_last_bsn 425 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 null + bsn 21 bsn 22 +lime 0 + +lime error! + +lime 1 + bsn 23 +lime 0 + bsn 24 +lime 0 + bsn 25 +lime 0 + bsn 26 +lime 0 + bsn 27 +lime 0 + bsn 28 +lime 0 + bsn 29 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 1 BSN 29 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 29 FBI 1 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 29 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 29 FBI 1 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 1 BSN 29 FBI 1 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 1 FBI 0 +fn_same_bsn 2409 fn_last_bsn 1374 delta_bsn -15 old_len 29 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 2318 fn_last_bsn 1378 delta_bsn -13 old_len 29 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 2297 fn_last_bsn 1383 delta_bsn -11 old_len 28 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 2466 fn_last_bsn 1387 delta_bsn -16 old_len 28 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 2383 fn_last_bsn 1391 delta_bsn -14 old_len 28 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 4 FBI 0 +fn_same_bsn 19422 fn_last_bsn 1396 delta_bsn -12 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 2262 fn_last_bsn 1400 delta_bsn -10 old_len 35 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 1 FBI 0 +fn_same_bsn 30 fn_last_bsn 1404 delta_bsn -15 old_len 29 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 31 fn_last_bsn 1409 delta_bsn -13 old_len 29 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 2275 fn_last_bsn 1448 delta_bsn -9 old_len 36 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 1452 delta_bsn -9 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 1456 delta_bsn -9 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 5 fn_last_bsn 1461 delta_bsn -9 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 1465 delta_bsn -9 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4 fn_last_bsn 1469 delta_bsn -9 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 2275 fn_last_bsn 1474 delta_bsn -7 old_len 35 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 8 FBI 0 +fn_same_bsn 19504 fn_last_bsn 1478 delta_bsn -8 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 2223 fn_last_bsn 1482 delta_bsn -6 old_len 35 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 13 fn_last_bsn 1487 delta_bsn -7 old_len 35 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 2171 fn_last_bsn 1491 delta_bsn -5 old_len 35 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 2058 fn_last_bsn 1495 delta_bsn -3 old_len 35 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 1946 fn_last_bsn 1500 delta_bsn -1 old_len 35 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 17 FBI 0 +fn_same_bsn 19530 fn_last_bsn 1504 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 old segment + bsn 13 +lime 0 + bsn 14 old segment + bsn 15 +lime 0 + bsn 16 +lime 0 + bsn 17 +lime 0 +end of message reached +MSG: b40402080aeee79bbe01cbce350103030706c7b8 + +TS 4 CS4 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 17 fn_last_bsn 4 delta_bsn -6 old_len 35 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 18 fn_last_bsn 9 delta_bsn -4 old_len 35 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 16 FBI 0 +fn_same_bsn 1521 fn_last_bsn 17 delta_bsn -1 old_len 35 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 18 FBI 0 +fn_same_bsn 19552 fn_last_bsn 22 delta_bsn 1 old_len 0 + bsn 17 +lime 0 + bsn 18 +lime 0 +end of message reached +MSG: 03c03d6500000e4500003c000040003206359e57fafa77c0a8000401bb95e64c065295b7e109dba0126e004ec700000204058c0402080a163d99fb01cbce330103030804ed0d + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 20 FBI 0 +fn_same_bsn 19556 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 18 +lime 0 + +lime 1 + bsn 19 null + bsn 20 +lime 0 +end of message reached +MSG: b40402080aeee79bfc01cbce3501030307a1edee + +TS 4 CS4 DL DATA TFI 0 BSN 19 FBI 0 +fn_same_bsn 19560 fn_last_bsn 4 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 21 FBI 0 +fn_same_bsn 19565 fn_last_bsn 9 delta_bsn 1 old_len 0 + bsn 20 +lime 0 + bsn 21 +lime 0 +end of message reached +MSG: 03c0456500001045000038000040002f06df04364c75c3c0a8000401bbb5d384caa283890c2130901245eafe620000020423010402080a1bdb18a601cbce42f8f843 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 20 FBI 0 +fn_same_bsn 13 fn_last_bsn 4 delta_bsn -1 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 19 FBI 0 +fn_same_bsn 13 fn_last_bsn 8 delta_bsn -2 old_len 0 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 21 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 19608 fn_last_bsn 30 delta_bsn 1 old_len 0 + bsn 21 +lime 0 + +lime 1 + bsn 22 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 19669 fn_last_bsn 39 delta_bsn 1 old_len 0 + bsn 22 +lime 0 + bsn 23 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 25 FBI 0 +fn_same_bsn 19695 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 +end of message reached +MSG: 0a163d9a2801cbce5fe94175 + +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 19699 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 25 +lime 0 + bsn 26 null + bsn 27 +TS 4 CS4 DL DATA TFI 0 BSN 29 FBI 0 +fn_same_bsn 19703 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 +end of message reached +MSG: 34e27903be69e04f8071066d74967e6bf6b6a56b6bfdf5fa35 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 25 FBI 0 +fn_same_bsn 13 fn_last_bsn 5 delta_bsn -4 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 13 fn_last_bsn 9 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 29 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 25 FBI 0 +fn_same_bsn 13 fn_last_bsn 5 delta_bsn -4 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 13 fn_last_bsn 9 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 29 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 26 FBI 0 +fn_same_bsn 19738 fn_last_bsn 9 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 19742 fn_last_bsn 13 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 24 FBI 0 +fn_same_bsn 19747 fn_last_bsn 18 delta_bsn -5 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 13 fn_last_bsn 26 delta_bsn -1 old_len 0 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 24 FBI 0 +fn_same_bsn 13 fn_last_bsn 31 delta_bsn -5 old_len 0 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 31 FBI 0 +fn_same_bsn 19773 fn_last_bsn 44 delta_bsn 2 old_len 0 + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 + +lime 1 + bsn 30 null + bsn 31 +lime 0 +end of message reached +MSG: 8c0402080a1639ca4501cbce3301030308e9532c + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 33 FBI 0 +fn_same_bsn 19777 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 + +lime 1 + bsn 30 null + bsn 31 +lime 0 + +lime 1 + bsn 32 null + bsn 33 +lime 0 +end of message reached +MSG: 0a163d996401cbce603a0eaa + +TS 4 CS4 DL DATA TFI 0 BSN 35 FBI 0 +fn_same_bsn 19781 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 33 +lime 0 + bsn 34 null + bsn 35 +TS 4 CS4 DL DATA TFI 0 BSN 37 FBI 0 +fn_same_bsn 19786 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 33 +lime 0 + bsn 34 null + bsn 35 bsn 36 null + bsn 37 +lime 0 +end of message reached +MSG: 555117cafb1754b8f4c55e19a4ac7c2e7ad6797c0eb8aa1f9b + +TS 4 CS4 DL DATA TFI 0 BSN 39 FBI 0 +fn_same_bsn 19790 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 37 +lime 0 + bsn 38 null + bsn 39 +TS 4 CS4 DL DATA TFI 0 BSN 30 FBI 0 +fn_same_bsn 19794 fn_last_bsn 4 delta_bsn -9 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 35 FBI 0 +fn_same_bsn 18 fn_last_bsn 9 delta_bsn -4 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 37 FBI 0 +fn_same_bsn 17 fn_last_bsn 13 delta_bsn -2 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 39 FBI 0 +fn_same_bsn 17 fn_last_bsn 17 delta_bsn 0 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 34 FBI 0 +fn_same_bsn 19812 fn_last_bsn 5 delta_bsn -5 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 36 FBI 0 +fn_same_bsn 19816 fn_last_bsn 9 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 38 FBI 0 +fn_same_bsn 19820 fn_last_bsn 13 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 42 FBI 0 +fn_same_bsn 19825 fn_last_bsn 18 delta_bsn 3 old_len 0 + bsn 37 +lime 0 + bsn 38 null + bsn 39 bsn 40 null + bsn 41 null + bsn 42 +lime 0 +end of message reached +MSG: 8c0402080a0d9c84ec01cbce3301030308ffb276 + +TS 4 CS4 DL DATA TFI 0 BSN 41 FBI 0 +fn_same_bsn 19829 fn_last_bsn 4 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 44 FBI 0 +fn_same_bsn 19838 fn_last_bsn 13 delta_bsn 2 old_len 0 + bsn 42 +lime 0 + bsn 43 null + bsn 44 +TS 4 CS4 DL DATA TFI 0 BSN 41 FBI 0 +fn_same_bsn 13 fn_last_bsn 4 delta_bsn -3 old_len 0 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 43 FBI 0 +fn_same_bsn 19846 fn_last_bsn 8 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 45 FBI 0 +fn_same_bsn 19851 fn_last_bsn 13 delta_bsn 1 old_len 0 + bsn 42 +lime 0 + bsn 43 null + bsn 44 bsn 45 +lime 0 +end of message reached +MSG: 03c06d6500001a4500003c0000400034063d045fd3e938c0a800040050e05adb5fece59e0ae323a01238907b6a0000020405b40402080aeee7a13501cbce350103030754e3ff + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 19855 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 42 +lime 0 + bsn 43 null + bsn 44 bsn 45 +lime 0 + +lime error! + +lime 1 + bsn 46 null + bsn 47 +lime 0 +end of message reached +MSG: 0a1639ca9d01cbce68dafaea + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 19859 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 47 +lime 0 + bsn 48 null + bsn 49 +TS 4 CS4 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 19864 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 47 +lime 0 + bsn 48 null + bsn 49 bsn 50 null + bsn 51 +lime 0 +end of message reached +MSG: 5e8ae919aa7cd608b26f7b8864c5b2498d8e2687925c30fb00 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 45 FBI 0 +fn_same_bsn 17 fn_last_bsn 4 delta_bsn -6 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 17 fn_last_bsn 8 delta_bsn -4 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 18 fn_last_bsn 13 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 17 fn_last_bsn 17 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 8 fn_last_bsn 4 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 9 fn_last_bsn 4 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 8 fn_last_bsn 8 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 53 FBI 0 +fn_same_bsn 19907 fn_last_bsn 9 delta_bsn 2 old_len 0 + bsn 47 +lime 0 + bsn 48 null + bsn 49 bsn 50 null + bsn 51 +lime 0 + +lime 1 + bsn 52 null + bsn 53 +lime 0 +end of message reached +MSG: 0a1639c92a01cbce686b9012 + +TS 4 CS4 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 19911 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 53 +lime 0 + bsn 54 null + bsn 55 +TS 4 CS4 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 19916 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 53 +lime 0 + bsn 54 null + bsn 55 bsn 56 null + bsn 57 +lime 0 +end of message reached +MSG: b8bd67b7679737b1c39971d041f73e4bbd717654a340ef7aee + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 53 FBI 0 +fn_same_bsn 13 fn_last_bsn 4 delta_bsn -4 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 13 fn_last_bsn 8 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 54 FBI 0 +fn_same_bsn 19937 fn_last_bsn 8 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 19942 fn_last_bsn 13 delta_bsn 1 old_len 0 + bsn 53 +lime 0 + bsn 54 null + bsn 55 bsn 56 null + bsn 57 +lime 0 + +lime 1 + bsn 58 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 60 FBI 0 +fn_same_bsn 19972 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 53 +lime 0 + bsn 54 null + bsn 55 bsn 56 null + bsn 57 +lime 0 + +lime 1 + bsn 58 +lime 0 + bsn 59 null + bsn 60 +lime 0 +end of message reached +MSG: 0a0d9c859b01cbce6b917ee3 + +TS 4 CS4 DL DATA TFI 0 BSN 62 FBI 0 +fn_same_bsn 19976 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 +TS 4 CS4 DL DATA TFI 0 BSN 64 FBI 0 +fn_same_bsn 19981 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 +end of message reached +MSG: f1055b922d58930fad49f9855f360b6a8edbc53e5af6808100 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 66 FBI 0 +fn_same_bsn 19985 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 +TS 4 CS4 DL DATA TFI 0 BSN 68 FBI 0 +fn_same_bsn 19989 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 26 fn_last_bsn 5 delta_bsn -10 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 60 FBI 0 +fn_same_bsn 26 fn_last_bsn 9 delta_bsn -8 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 66 FBI 0 +fn_same_bsn 17 fn_last_bsn 13 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 68 FBI 0 +fn_same_bsn 18 fn_last_bsn 18 delta_bsn 0 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 65 FBI 0 +fn_same_bsn 20011 fn_last_bsn 4 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 67 FBI 0 +fn_same_bsn 20015 fn_last_bsn 8 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 69 FBI 0 +fn_same_bsn 20020 fn_last_bsn 13 delta_bsn 1 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 +end of message reached +MSG: 687474702f312e31140303000101160303002896ddbd90638cc55a2a61f5ecb3a75e6441d434e27903be69e04f8071066d74967e6bf6b6a56b6bfd645a6c + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 66 FBI 0 +fn_same_bsn 22 fn_last_bsn 4 delta_bsn -3 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 20028 fn_last_bsn 8 delta_bsn 1 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 20080 fn_last_bsn 30 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 +end of message reached +MSG: 0aeee7a5a901cbce6dd5597d + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 74 FBI 0 +fn_same_bsn 20085 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 +TS 4 CS4 DL DATA TFI 0 BSN 76 FBI 0 +fn_same_bsn 20089 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 +TS 4 CS4 DL DATA TFI 0 BSN 78 FBI 0 +fn_same_bsn 20093 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 +TS 4 CS4 DL DATA TFI 0 BSN 80 FBI 0 +fn_same_bsn 20098 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 +TS 4 CS4 DL DATA TFI 0 BSN 82 FBI 0 +fn_same_bsn 20102 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 +TS 4 CS4 DL DATA TFI 0 BSN 84 FBI 0 +fn_same_bsn 20106 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 +TS 4 CS4 DL DATA TFI 0 BSN 86 FBI 0 +fn_same_bsn 20111 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 +TS 4 CS4 DL DATA TFI 0 BSN 88 FBI 0 +fn_same_bsn 20115 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 +TS 4 CS4 DL DATA TFI 0 BSN 90 FBI 0 +fn_same_bsn 20119 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 +TS 4 CS4 DL DATA TFI 0 BSN 92 FBI 0 +fn_same_bsn 20124 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 bsn 91 null + bsn 92 +TS 4 CS4 DL DATA TFI 0 BSN 94 FBI 0 +fn_same_bsn 20128 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 bsn 91 null + bsn 92 bsn 93 null + bsn 94 +TS 4 CS4 DL DATA TFI 0 BSN 96 FBI 0 +fn_same_bsn 20132 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 bsn 91 null + bsn 92 bsn 93 null + bsn 94 bsn 95 null + bsn 96 +TS 4 CS4 DL DATA TFI 0 BSN 98 FBI 0 +fn_same_bsn 20137 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 bsn 91 null + bsn 92 bsn 93 null + bsn 94 bsn 95 null + bsn 96 bsn 97 null + bsn 98 +TS 4 CS4 DL DATA TFI 0 BSN 100 FBI 0 +fn_same_bsn 20141 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 bsn 91 null + bsn 92 bsn 93 null + bsn 94 bsn 95 null + bsn 96 bsn 97 null + bsn 98 bsn 99 null + bsn 100 +TS 4 CS4 DL DATA TFI 0 BSN 103 FBI 0 +fn_same_bsn 20150 fn_last_bsn 9 delta_bsn 3 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 null + bsn 72 +lime 0 + +lime 1 + bsn 73 null + bsn 74 bsn 75 null + bsn 76 bsn 77 null + bsn 78 bsn 79 null + bsn 80 bsn 81 null + bsn 82 bsn 83 null + bsn 84 bsn 85 null + bsn 86 bsn 87 null + bsn 88 bsn 89 null + bsn 90 bsn 91 null + bsn 92 bsn 93 null + bsn 94 bsn 95 null + bsn 96 bsn 97 null + bsn 98 bsn 99 null + bsn 100 bsn 101 null + bsn 102 null + bsn 103 +lime 0 +end of message reached +MSG: ee0c389b4e15e6e0f8a5d57991a3b726998d0271 + +lime 1 +end of message reached +MSG: 03c09d253023e4e2adccdabd57986c3ecc83f8 + +TS 4 CS4 DL DATA TFI 0 BSN 105 FBI 0 +fn_same_bsn 20154 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 +TS 4 CS4 DL DATA TFI 0 BSN 107 FBI 0 +fn_same_bsn 20158 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 +TS 4 CS4 DL DATA TFI 0 BSN 109 FBI 0 +fn_same_bsn 20163 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 bsn 108 null + bsn 109 +TS 4 CS4 DL DATA TFI 0 BSN 111 FBI 0 +fn_same_bsn 20167 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 bsn 108 null + bsn 109 bsn 110 null + bsn 111 +TS 4 CS4 DL DATA TFI 0 BSN 113 FBI 0 +fn_same_bsn 20171 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 bsn 108 null + bsn 109 bsn 110 null + bsn 111 bsn 112 null + bsn 113 +lime 0 +end of message reached +MSG: ec8bd7f1fb76d96eee54ec86ab6e2d2d266762c91bb72697164d8fe3aa656fbb95c6a9fc3615931fc6d54ea59a987a + +TS 4 CS4 DL DATA TFI 0 BSN 115 FBI 0 +fn_same_bsn 20176 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 +TS 4 CS4 DL DATA TFI 0 BSN 117 FBI 0 +fn_same_bsn 20180 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 +TS 4 CS4 DL DATA TFI 0 BSN 119 FBI 0 +fn_same_bsn 20184 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 +TS 4 CS4 DL DATA TFI 0 BSN 121 FBI 0 +fn_same_bsn 20189 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 bsn 120 null + bsn 121 +TS 4 CS4 DL DATA TFI 0 BSN 123 FBI 0 +fn_same_bsn 20193 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 bsn 120 null + bsn 121 bsn 122 null + bsn 123 +TS 4 CS4 DL DATA TFI 0 BSN 125 FBI 0 +fn_same_bsn 20197 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 bsn 120 null + bsn 121 bsn 122 null + bsn 123 bsn 124 null + bsn 125 +TS 4 CS4 DL DATA TFI 0 BSN 127 FBI 0 +fn_same_bsn 20202 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 bsn 120 null + bsn 121 bsn 122 null + bsn 123 bsn 124 null + bsn 125 bsn 126 null + bsn 127 +TS 4 CS4 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 775 fn_last_bsn 8 delta_bsn -124 old_len 29 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 bsn 120 null + bsn 121 bsn 122 null + bsn 123 bsn 124 null + bsn 125 bsn 126 null + bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 +lime 0 + bsn 2 +lime 0 + +lime 1 + bsn 3 +TS 4 CS4 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 806 fn_last_bsn 5 delta_bsn 2 old_len 28 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 724 fn_last_bsn 9 delta_bsn 4 old_len 36 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 710 fn_last_bsn 13 delta_bsn 6 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 11 FBI 0 +fn_same_bsn 694 fn_last_bsn 18 delta_bsn 8 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 693 fn_last_bsn 22 delta_bsn 10 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 710 fn_last_bsn 26 delta_bsn 12 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 17 FBI 0 +fn_same_bsn 711 fn_last_bsn 31 delta_bsn 14 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 35 fn_last_bsn 35 delta_bsn 0 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 19 FBI 0 +fn_same_bsn 676 fn_last_bsn 4 delta_bsn 16 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 628 fn_last_bsn 13 delta_bsn 19 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 24 FBI 0 +fn_same_bsn 502 fn_last_bsn 17 delta_bsn 21 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 26 FBI 0 +fn_same_bsn 529 fn_last_bsn 22 delta_bsn 23 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 516 fn_last_bsn 26 delta_bsn 25 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 30 FBI 0 +fn_same_bsn 481 fn_last_bsn 30 delta_bsn 27 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 32 FBI 0 +fn_same_bsn 20280 fn_last_bsn 35 delta_bsn 29 old_len 0 + bsn 113 +lime 0 + bsn 114 null + bsn 115 bsn 116 null + bsn 117 bsn 118 null + bsn 119 bsn 120 null + bsn 121 bsn 122 null + bsn 123 bsn 124 null + bsn 125 bsn 126 null + bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 +lime 0 + bsn 2 +lime 0 + +lime 1 + bsn 3 bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 old segment + bsn 13 +lime 0 + bsn 14 old segment + bsn 15 +lime 0 + bsn 16 +lime 0 + bsn 17 +lime 0 + bsn 18 +lime 0 + +lime error! + +lime 1 + bsn 19 null + bsn 20 +lime 0 + bsn 21 +lime 0 + +lime error! + +lime 1 + bsn 22 +lime 0 + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 + +lime 1 + bsn 30 null + bsn 31 +lime 0 + +lime 1 + bsn 32 +TS 4 CS4 DL DATA TFI 0 BSN 34 FBI 0 +fn_same_bsn 472 fn_last_bsn 4 delta_bsn 2 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 36 FBI 0 +fn_same_bsn 472 fn_last_bsn 8 delta_bsn 4 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 38 FBI 0 +fn_same_bsn 473 fn_last_bsn 13 delta_bsn 6 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 40 FBI 0 +fn_same_bsn 20297 fn_last_bsn 17 delta_bsn 8 old_len 0 + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 + +lime 1 + bsn 30 null + bsn 31 +lime 0 + +lime 1 + bsn 32 bsn 33 +lime 0 + +lime error! + bsn 34 null + bsn 35 bsn 36 null + bsn 37 +lime 0 + bsn 38 null + bsn 39 bsn 40 +TS 4 CS4 DL DATA TFI 0 BSN 42 FBI 0 +fn_same_bsn 476 fn_last_bsn 4 delta_bsn 2 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 44 FBI 0 +fn_same_bsn 468 fn_last_bsn 9 delta_bsn 4 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 46 FBI 0 +fn_same_bsn 20310 fn_last_bsn 13 delta_bsn 6 old_len 0 + bsn 37 +lime 0 + bsn 38 null + bsn 39 bsn 40 bsn 41 null + bsn 42 +lime 0 + bsn 43 null + bsn 44 bsn 45 +lime 0 + +lime error! + +lime 1 + bsn 46 +TS 4 CS4 DL DATA TFI 0 BSN 48 FBI 0 +fn_same_bsn 20314 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 42 +lime 0 + bsn 43 null + bsn 44 bsn 45 +lime 0 + +lime error! + +lime 1 + bsn 46 bsn 47 +lime 0 + +lime error! + bsn 48 +TS 4 CS4 DL DATA TFI 0 BSN 50 FBI 0 +fn_same_bsn 20319 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 47 +lime 0 + bsn 48 bsn 49 bsn 50 +TS 4 CS4 DL DATA TFI 0 BSN 52 FBI 0 +fn_same_bsn 20323 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 47 +lime 0 + bsn 48 bsn 49 bsn 50 bsn 51 +lime 0 + +lime error! + +lime 1 + bsn 52 +TS 4 CS4 DL DATA TFI 0 BSN 54 FBI 0 +fn_same_bsn 390 fn_last_bsn 4 delta_bsn 2 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 56 FBI 0 +fn_same_bsn 20332 fn_last_bsn 9 delta_bsn 4 old_len 0 + bsn 47 +lime 0 + bsn 48 bsn 49 bsn 50 bsn 51 +lime 0 + +lime error! + +lime 1 + bsn 52 bsn 53 +lime 0 + +lime error! + bsn 54 null + bsn 55 bsn 56 +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 342 fn_last_bsn 4 delta_bsn 2 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 60 FBI 0 +fn_same_bsn 342 fn_last_bsn 8 delta_bsn 4 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 62 FBI 0 +fn_same_bsn 369 fn_last_bsn 13 delta_bsn 6 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 65 FBI 0 +fn_same_bsn 342 fn_last_bsn 21 delta_bsn 9 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 67 FBI 0 +fn_same_bsn 343 fn_last_bsn 26 delta_bsn 11 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 69 FBI 0 +fn_same_bsn 342 fn_last_bsn 30 delta_bsn 13 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 71 FBI 0 +fn_same_bsn 20366 fn_last_bsn 34 delta_bsn 15 old_len 0 + bsn 53 +lime 0 + bsn 54 null + bsn 55 bsn 56 bsn 57 +lime 0 + +lime error! + +lime 1 + bsn 58 +lime 0 + bsn 59 null + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 +TS 4 CS4 DL DATA TFI 0 BSN 73 FBI 0 +fn_same_bsn 20371 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 +TS 4 CS4 DL DATA TFI 0 BSN 75 FBI 0 +fn_same_bsn 20375 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 20379 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 +TS 4 CS4 DL DATA TFI 0 BSN 79 FBI 0 +fn_same_bsn 20384 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 +TS 4 CS4 DL DATA TFI 0 BSN 81 FBI 0 +fn_same_bsn 20388 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 +TS 4 CS4 DL DATA TFI 0 BSN 83 FBI 0 +fn_same_bsn 20392 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 +TS 4 CS4 DL DATA TFI 0 BSN 85 FBI 0 +fn_same_bsn 20397 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 +TS 4 CS4 DL DATA TFI 0 BSN 87 FBI 0 +fn_same_bsn 20401 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 +TS 4 CS4 DL DATA TFI 0 BSN 89 FBI 0 +fn_same_bsn 20405 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 +TS 4 CS4 DL DATA TFI 0 BSN 91 FBI 0 +fn_same_bsn 20410 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 +TS 4 CS4 DL DATA TFI 0 BSN 93 FBI 0 +fn_same_bsn 20414 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 bsn 92 bsn 93 +TS 4 CS4 DL DATA TFI 0 BSN 95 FBI 0 +fn_same_bsn 20418 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 bsn 92 bsn 93 bsn 94 bsn 95 +TS 4 CS4 DL DATA TFI 0 BSN 97 FBI 0 +fn_same_bsn 20423 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 bsn 92 bsn 93 bsn 94 bsn 95 bsn 96 bsn 97 +TS 4 CS4 DL DATA TFI 0 BSN 99 FBI 0 +fn_same_bsn 20427 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 null + bsn 62 bsn 63 null + bsn 64 +lime 0 + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 bsn 92 bsn 93 bsn 94 bsn 95 bsn 96 bsn 97 bsn 98 bsn 99 +lime 0 +end of message reached +MSG: 3c0ad90c08e00458bf2e78747618f0e88f09501645cbfa54bcf50d095708925ad30db110f0da2889d04d19fa507faab6f0a90aeee7a5b901cbce6d485454502f312e3120323030204f4b0d0a5365727665723a206e67696e780d0a446174653a204d6f6ea153ea304f5d5cf96d0fceed3644a32c5b3cea051d6484df4a955277248b5abe10d6002c84a1a68718c44b5ae88f6d179dae6c3b20636861727365743d77696e646f77732d313235310d0a5472616e736665722d456e636f64696e673a206368756e6b653239042c683604ac53061c8a08878175ca4c0611e12582750a11facbdc5f7605c0c4800887817502de29dbbb3a97ae8c5cda4947494e0d0a436f6e74656e742d456e636f64696e673a20677a69700d0a0d0a343061640d0a1f8b0800000000000003ed9ddd8958c2bf7364d7a0c57d4116b9becda4bd96c8bb8ee0b27d478e084ea2a9356b5fc71caa4d4b42760cc36108924be137abb779bf5fc055fbc651e28d2ab12ccb99caec9b949b209a6ce2d2c4c514e92123eeef39a71b0d4908017638354cd564c602d135154b0ee31c0d812c95018722ad6190a5329341a4758990a583492b804206a4350cb25407097eab03cbc67bc916dd4211736c7af10f4edb6a379caafabcd3b0dbd6ad4973f9ca95b7b8652d5d4aa9e5d554a1982e2d441e66722bf987c589f854321e51db484008a5a2b6c9a91682b2c883d0a4800e8a884292821fe810b82f77442d051c710a614fcfe2cca47ba7e102e46b82a953981622a5f4a3d2a4fe5e48671722c5d266365d5c4da74bba35afbb5c6a8d5befe60b6ba9d2c44aba945e2e65f2b9885acee75599c820c2b94450d5d88d41518500b01810ce305055d0145a236ba22475d4cafa1a79997f9bbdaf5525d4a54cf67eea4ef66a2d93cbac6dac4d149753d9f4423c1ae352ead1ab97bce19d35d7a57c612a39b1965fca64d332e5db53b17822361d9b1e72750d9943bc0d858dd8343f6834699de203642a6163756aa7e6e617a889cd8e760c3ed36108879c26901e64f5b56b987f3abee2f5476b59168e1e5fe933c7dbf11b9be455a71f4dc6e353fa4dbf259b41bf2e59ef95cc83e84f36f2a5b492bfe4a5aa9f29160f7ca4ca4dbb0e3e0882040ecbe304144ec491ca9f4ee3850323689337c16aac6d14c867fbe08314b8f483ab8404c71529c815cfdb250ddd9af4a720b3592e64d64bbd1bf37eea41ca5c8da86261b9bba13753b216d16269f2fe4f36d285cdc978f4466c74b4fd88b4afbd143ccd114f9163f531afe631cb0fab1157284c8a798e63fd96b9c383f5667285cd3b2003ffc88844297798c9dd7b6dce2127cda6f169e6b53594cd79e5ec8564072bf520555077eea57ea216ccc7cf7faede7b7f9e1fe462747da3b879c2607c3ede57e99de9031d9c19063af8dca4076bab4cc891ad69576ad6b6f856240489d54810734f6d39bb80e275289338c97d0f56240f7834f567ee7d279bcd3ffc2e7c305de0e6526123dda7cd5221b5fcc13fa6eec17bd20f75438c71f4ee464e73c82d4092c5f244f64ba38748fcb25d857cc1d658e523bb4ede9f0c4740051a572310bc564b776440fcfa5600879a3ec1275a8fa9e2666e999664403245254fb0afb9343a22bcba3837a2167a7acae60d8b88ae17f2a5fc723eab6e2bef46b87a313ba2e6b0b4d0a881ee40c661806c3321806c33170064ebd91f3ee5de981ac265c478cf1d6994f186215cfa1a8c6393890cd00ca4fff19b9b3f4add93550e26f65eecfd79558caea70accf77bf9957434932ba60ba56fa61109e9d17ba97155d4afecc3b1513eaf0220b635 + +TS 4 CS4 DL DATA TFI 0 BSN 101 FBI 0 +fn_same_bsn 20431 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 99 +lime 0 + bsn 100 bsn 101 +TS 4 CS4 DL DATA TFI 0 BSN 103 FBI 0 +fn_same_bsn 286 fn_last_bsn 5 delta_bsn 2 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 105 FBI 0 +fn_same_bsn 286 fn_last_bsn 9 delta_bsn 4 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 107 FBI 0 +fn_same_bsn 286 fn_last_bsn 13 delta_bsn 6 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 110 FBI 0 +fn_same_bsn 20453 fn_last_bsn 22 delta_bsn 9 old_len 0 + bsn 99 +lime 0 + bsn 100 bsn 101 bsn 102 null + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 bsn 108 null + bsn 109 bsn 110 +TS 4 CS4 DL DATA TFI 0 BSN 112 FBI 0 +fn_same_bsn 20457 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 bsn 108 null + bsn 109 bsn 110 bsn 111 bsn 112 +TS 4 CS4 DL DATA TFI 0 BSN 114 FBI 0 +fn_same_bsn 20462 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 null + bsn 107 bsn 108 null + bsn 109 bsn 110 bsn 111 bsn 112 bsn 113 +lime 0 + +lime error! + bsn 114 +TS 4 CS4 DL DATA TFI 0 BSN 116 FBI 0 +fn_same_bsn 20466 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 +TS 4 CS4 DL DATA TFI 0 BSN 118 FBI 0 +fn_same_bsn 20470 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 +TS 4 CS4 DL DATA TFI 0 BSN 120 FBI 0 +fn_same_bsn 20475 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 +TS 4 CS4 DL DATA TFI 0 BSN 122 FBI 0 +fn_same_bsn 20479 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 +TS 4 CS4 DL DATA TFI 0 BSN 124 FBI 0 +fn_same_bsn 20483 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 +TS 4 CS4 DL DATA TFI 0 BSN 126 FBI 0 +fn_same_bsn 20488 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 +TS 4 CS4 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 1079 fn_last_bsn 4 delta_bsn -126 old_len 28 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +TS 4 CS4 DL DATA TFI 0 BSN 2 FBI 0 +fn_same_bsn 1079 fn_last_bsn 4 delta_bsn 2 old_len 28 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 4 FBI 0 +fn_same_bsn 1079 fn_last_bsn 9 delta_bsn 4 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 6 FBI 0 +fn_same_bsn 1079 fn_last_bsn 13 delta_bsn 6 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 116 FBI 0 +fn_same_bsn 43 fn_last_bsn 17 delta_bsn 116 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 8 FBI 0 +fn_same_bsn 1010 fn_last_bsn 22 delta_bsn 8 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 1010 fn_last_bsn 26 delta_bsn 10 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 3120 fn_last_bsn 30 delta_bsn 12 old_len 35 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 bsn 1 +lime 0 + +lime error! + bsn 2 +lime 0 + +lime 1 + bsn 3 bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 +lime 0 + bsn 11 +lime 0 + bsn 12 +lime 0 +end of message reached +MSG: 2f065dd9364c75c3c0a8000401bbb5d384caa284890c21e88010494826ae00000101080a1bdb241001cbce82028236 + +TS 4 CS4 DL DATA TFI 0 BSN 14 FBI 0 +fn_same_bsn 3008 fn_last_bsn 5 delta_bsn 2 old_len 35 + bsn 12 +lime 0 + bsn 13 +lime 0 + +lime error! + bsn 14 +TS 4 CS4 DL DATA TFI 0 BSN 16 FBI 0 +fn_same_bsn 984 fn_last_bsn 4 delta_bsn 2 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 18 FBI 0 +fn_same_bsn 983 fn_last_bsn 8 delta_bsn 4 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 20 FBI 0 +fn_same_bsn 971 fn_last_bsn 13 delta_bsn 6 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 22 FBI 0 +fn_same_bsn 914 fn_last_bsn 17 delta_bsn 8 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 25 FBI 0 +fn_same_bsn 832 fn_last_bsn 26 delta_bsn 11 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 832 fn_last_bsn 30 delta_bsn 13 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 29 FBI 0 +fn_same_bsn 832 fn_last_bsn 34 delta_bsn 15 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 31 FBI 0 +fn_same_bsn 793 fn_last_bsn 39 delta_bsn 17 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 33 FBI 0 +fn_same_bsn 793 fn_last_bsn 43 delta_bsn 19 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 35 FBI 0 +fn_same_bsn 775 fn_last_bsn 47 delta_bsn 21 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 37 FBI 0 +fn_same_bsn 776 fn_last_bsn 52 delta_bsn 23 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 39 FBI 0 +fn_same_bsn 776 fn_last_bsn 56 delta_bsn 25 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 41 FBI 0 +fn_same_bsn 745 fn_last_bsn 60 delta_bsn 27 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 43 FBI 0 +fn_same_bsn 746 fn_last_bsn 65 delta_bsn 29 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 45 FBI 0 +fn_same_bsn 728 fn_last_bsn 69 delta_bsn 31 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 728 fn_last_bsn 73 delta_bsn 33 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 711 fn_last_bsn 78 delta_bsn 35 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 711 fn_last_bsn 82 delta_bsn 37 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 53 FBI 0 +fn_same_bsn 693 fn_last_bsn 86 delta_bsn 39 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 694 fn_last_bsn 91 delta_bsn 41 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 693 fn_last_bsn 95 delta_bsn 43 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 59 FBI 0 +fn_same_bsn 20626 fn_last_bsn 99 delta_bsn 45 old_len 0 + bsn 12 +lime 0 + bsn 13 +lime 0 + +lime error! + bsn 14 bsn 15 +lime 0 + +lime error! + bsn 16 +lime 0 + bsn 17 +lime 0 + bsn 18 +lime 0 + +lime error! + +lime 1 + bsn 19 null + bsn 20 +lime 0 + bsn 21 +lime 0 + +lime error! + +lime 1 + bsn 22 +lime 0 + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 + +lime 1 + bsn 30 null + bsn 31 +lime 0 + +lime 1 + bsn 32 bsn 33 +lime 0 + +lime error! + bsn 34 null + bsn 35 bsn 36 null + bsn 37 +lime 0 + bsn 38 null + bsn 39 bsn 40 bsn 41 null + bsn 42 +lime 0 + bsn 43 null + bsn 44 bsn 45 +lime 0 + +lime error! + +lime 1 + bsn 46 bsn 47 +lime 0 + +lime error! + bsn 48 bsn 49 bsn 50 bsn 51 +lime 0 + +lime error! + +lime 1 + bsn 52 bsn 53 +lime 0 + +lime error! + bsn 54 null + bsn 55 bsn 56 bsn 57 +lime 0 + +lime error! + +lime 1 + bsn 58 +lime 0 + bsn 59 +TS 4 CS4 DL DATA TFI 0 BSN 61 FBI 0 +fn_same_bsn 20631 fn_last_bsn 5 delta_bsn 2 old_len 0 + bsn 53 +lime 0 + bsn 54 null + bsn 55 bsn 56 bsn 57 +lime 0 + +lime error! + +lime 1 + bsn 58 +lime 0 + bsn 59 bsn 60 +lime 0 + +lime error! + bsn 61 +TS 4 CS4 DL DATA TFI 0 BSN 63 FBI 0 +fn_same_bsn 20635 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 60 +lime 0 + bsn 61 bsn 62 bsn 63 +TS 4 CS4 DL DATA TFI 0 BSN 65 FBI 0 +fn_same_bsn 628 fn_last_bsn 4 delta_bsn 2 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 67 FBI 0 +fn_same_bsn 629 fn_last_bsn 9 delta_bsn 4 old_len 0 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 602 fn_last_bsn 17 delta_bsn 7 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 577 fn_last_bsn 22 delta_bsn 9 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 74 FBI 0 +fn_same_bsn 576 fn_last_bsn 26 delta_bsn 11 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 76 FBI 0 +fn_same_bsn 576 fn_last_bsn 30 delta_bsn 13 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 78 FBI 0 +fn_same_bsn 577 fn_last_bsn 35 delta_bsn 15 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 80 FBI 0 +fn_same_bsn 576 fn_last_bsn 39 delta_bsn 17 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 82 FBI 0 +fn_same_bsn 576 fn_last_bsn 43 delta_bsn 19 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 84 FBI 0 +fn_same_bsn 577 fn_last_bsn 48 delta_bsn 21 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 86 FBI 0 +fn_same_bsn 576 fn_last_bsn 52 delta_bsn 23 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 88 FBI 0 +fn_same_bsn 576 fn_last_bsn 56 delta_bsn 25 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 90 FBI 0 +fn_same_bsn 577 fn_last_bsn 61 delta_bsn 27 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 92 FBI 0 +fn_same_bsn 576 fn_last_bsn 65 delta_bsn 29 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 94 FBI 0 +fn_same_bsn 576 fn_last_bsn 69 delta_bsn 31 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 96 FBI 0 +fn_same_bsn 577 fn_last_bsn 74 delta_bsn 33 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 98 FBI 0 +fn_same_bsn 576 fn_last_bsn 78 delta_bsn 35 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 100 FBI 0 +fn_same_bsn 576 fn_last_bsn 82 delta_bsn 37 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 102 FBI 0 +fn_same_bsn 20722 fn_last_bsn 87 delta_bsn 39 old_len 0 + bsn 60 +lime 0 + bsn 61 bsn 62 bsn 63 bsn 64 +lime 0 + +lime error! + +lime 1 + bsn 65 null + bsn 66 bsn 67 null + bsn 68 bsn 69 +lime 0 + +lime error! + +lime 1 + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 bsn 92 bsn 93 bsn 94 bsn 95 bsn 96 bsn 97 bsn 98 bsn 99 +lime 0 + +lime error! + bsn 100 bsn 101 bsn 102 +TS 4 CS4 DL DATA TFI 0 BSN 106 FBI 0 +fn_same_bsn 20735 fn_last_bsn 13 delta_bsn 4 old_len 0 + bsn 99 +lime 0 + bsn 100 bsn 101 bsn 102 bsn 103 +lime 0 + +lime error! + +lime 1 + bsn 104 null + bsn 105 bsn 106 +TS 4 CS4 DL DATA TFI 0 BSN 108 FBI 0 +fn_same_bsn 20739 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 bsn 107 bsn 108 +TS 4 CS4 DL DATA TFI 0 BSN 102 FBI 0 +fn_same_bsn 43 fn_last_bsn 26 delta_bsn -6 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 120 FBI 0 +fn_same_bsn 316 fn_last_bsn 52 delta_bsn 12 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 121 FBI 0 +fn_same_bsn 797 fn_last_bsn 247 delta_bsn 13 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 123 FBI 0 +fn_same_bsn 797 fn_last_bsn 251 delta_bsn 15 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 116 FBI 0 +fn_same_bsn 529 fn_last_bsn 256 delta_bsn 8 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 0 FBI 0 +fn_same_bsn 750 fn_last_bsn 503 delta_bsn -108 old_len 50 + bsn 103 +lime 0 + +lime 1 + bsn 104 null + bsn 105 bsn 106 bsn 107 bsn 108 bsn 109 bsn 110 bsn 111 bsn 112 bsn 113 +lime 0 + +lime error! + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 +end of message reached +MSG: 03c05c4dd7f0484f5b179a74015059e2d8c307e8ea1227f0273537767e120a01159cb900a860cf9bf249686a7618053e045450c67aeb7b1716ab6edda9b6fc950a1eb89bfa4964d1fd45cbda6bfb7bfb15e2909df9831ffed05f349f6a3cb65a7a9829a1ba6b6d8fe96c14f24fd9bf02e83b91c8f00bb1609d5d52554ecdaf22ad34517e8a5caea165db2d71b0517915e2a9cf4bf91eb0b6bdaf6fbc5b99dcfa46af9a6b5642348688d78df97b3d9b5a4eafe6b370bf8548dbaeb6dacaa939aae1d6eda6b7a922685bd9511be8f4853aa8d95bc4a1f7ed2a3d6a479cbef3093704084777ab86503b3dd0b4c76024dfde1b5c57d03e232e0ceca33b56d321b551cacf1b112057b834ef898139359594af9a010e90f88bb7ae4e4c4c4eaa5b57df7bf75beffce89df744ab7cebfbefa6ed38180d86d5500a89489a2ec43226bdfdf4a73fa58e1a7a0f8ddcbe8aff4e74200d3706838d5a66ba383f0c7126040c71d061eea50b4aa61d198b2ec1724723de0a8dabaee697f6553f79caff9fe84cf2346a130de9573877178db04843bc03517cfc549a949f514442fce490a84270562b6e3b0a6ade10fc730fef618a7a611c50c0cb6d8ad415314c36afa69bcabe655cf1ec7e3ae2998c236885baf73787e83fea7f16d2a58d42ae4741f57fe8fdfc50a5b3c5b4a71ef7fef0fadf98ef85d268e469670706e5e3b9108412023a357301d0a99ef7e1134a3c111f468c86804ec9804389d161a05332934162f41240a77a29c5f756f47760a6185ff0eb87a294faedbcba0b947e91ef695f8810ddfbbc4dfd567bb6d0cfbacffa6d945633c568119fc772a9f7bd4b3ff21d11a6203dc4fac2fe9c45440800438bb02f0c84107aa0c40b1e64ec45f13e63ef8a778b22b52480e394ae368fe58aee4cda4ddc7cff3a8cc56cc305b66e292d031137cb42045f02be153ed9635d6662be8862a8b5838011f7b820165fd17452056676ad360b6a8edbc53e5af6dd9138 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 125 FBI 0 +fn_same_bsn 1049 fn_last_bsn 4 delta_bsn 125 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 127 FBI 0 +fn_same_bsn 1048 fn_last_bsn 8 delta_bsn 127 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 1958 fn_last_bsn 255 delta_bsn 13 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 1976 fn_last_bsn 260 delta_bsn 15 old_len 35 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 17 FBI 0 +fn_same_bsn 1976 fn_last_bsn 264 delta_bsn 17 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 10 FBI 0 +fn_same_bsn 2015 fn_last_bsn 281 delta_bsn 10 old_len 35 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 +lime 0 + bsn 2 +lime 0 + +lime 1 + bsn 3 bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 1824 fn_last_bsn 26 delta_bsn 17 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1920 fn_last_bsn 291 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1924 fn_last_bsn 295 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1928 fn_last_bsn 299 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1941 fn_last_bsn 312 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1950 fn_last_bsn 321 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1954 fn_last_bsn 325 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1959 fn_last_bsn 330 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1963 fn_last_bsn 334 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1967 fn_last_bsn 338 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1972 fn_last_bsn 343 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1976 fn_last_bsn 347 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1980 fn_last_bsn 351 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1985 fn_last_bsn 356 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1989 fn_last_bsn 360 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1993 fn_last_bsn 364 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1998 fn_last_bsn 369 delta_bsn 39 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 2002 fn_last_bsn 373 delta_bsn 39 old_len 50 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 +lime 0 + bsn 2 +lime 0 + +lime 1 + bsn 3 bsn 4 null + bsn 5 +lime 0 + +lime 1 + bsn 6 +lime 0 + bsn 7 bsn 8 null + bsn 9 +lime 0 + bsn 10 old segment + bsn 11 +lime 0 + bsn 12 +lime 0 + bsn 13 +lime 0 + +lime error! + bsn 14 bsn 15 +lime 0 + +lime error! + bsn 16 +lime 0 + bsn 17 +lime 0 + bsn 18 +lime 0 + +lime error! + +lime 1 + bsn 19 null + bsn 20 +lime 0 + bsn 21 +lime 0 + +lime error! + +lime 1 + bsn 22 +lime 0 + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 +lime 0 + +lime 1 + bsn 30 null + bsn 31 +lime 0 + +lime 1 + bsn 32 bsn 33 +lime 0 + +lime error! + bsn 34 null + bsn 35 bsn 36 null + bsn 37 +lime 0 + bsn 38 null + bsn 39 bsn 40 bsn 41 null + bsn 42 +lime 0 + bsn 43 null + bsn 44 bsn 45 +lime 0 + +lime error! + +lime 1 + bsn 46 bsn 47 +lime 0 + +lime error! + bsn 48 bsn 49 +lime 0 +end of message reached +MSG: 03c0756500001c450000ca37bd40003206fd5257fafa77c0a8000401bb95e397cdfdee0abb68f450a4af68c4676e0ca16930e0733b6f64c061340dfa1aecbc91990cd034a4ff73691aff91bc3236c04f3b7ba30fafc4fb43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 2076 fn_last_bsn 4 delta_bsn 2 old_len 48 + bsn 47 +lime 0 + bsn 48 bsn 49 +lime 0 + +lime error! + bsn 50 bsn 51 +TS 4 CS4 DL DATA TFI 0 BSN 53 FBI 0 +fn_same_bsn 2058 fn_last_bsn 4 delta_bsn 2 old_len 49 + bsn 47 +lime 0 + bsn 48 bsn 49 +lime 0 + +lime error! + bsn 50 bsn 51 bsn 52 bsn 53 +TS 4 CS4 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 2059 fn_last_bsn 5 delta_bsn 2 old_len 50 + bsn 47 +lime 0 + bsn 48 bsn 49 +lime 0 + +lime error! + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 +TS 4 CS4 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 2058 fn_last_bsn 4 delta_bsn 2 old_len 48 + bsn 47 +lime 0 + bsn 48 bsn 49 +lime 0 + +lime error! + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 +TS 4 CS4 DL DATA TFI 0 BSN 59 FBI 0 +fn_same_bsn 1365 fn_last_bsn 4 delta_bsn 2 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 61 FBI 0 +fn_same_bsn 1365 fn_last_bsn 9 delta_bsn 4 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 54 FBI 0 +fn_same_bsn 2072 fn_last_bsn 22 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 56 FBI 0 +fn_same_bsn 1681 fn_last_bsn 26 delta_bsn -1 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 2023 fn_last_bsn 30 delta_bsn 1 old_len 49 + bsn 47 +lime 0 + bsn 48 bsn 49 +lime 0 + +lime error! + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 +TS 4 CS4 DL DATA TFI 0 BSN 62 FBI 0 +fn_same_bsn 2050 fn_last_bsn 9 delta_bsn 4 old_len 50 + bsn 47 +lime 0 + bsn 48 bsn 49 +lime 0 + +lime error! + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 bsn 59 bsn 60 +lime 0 + +lime error! + bsn 61 bsn 62 +TS 4 CS4 DL DATA TFI 0 BSN 64 FBI 0 +fn_same_bsn 2049 fn_last_bsn 4 delta_bsn 2 old_len 48 + bsn 60 +lime 0 + bsn 61 bsn 62 bsn 63 bsn 64 +TS 4 CS4 DL DATA TFI 0 BSN 68 FBI 0 +fn_same_bsn 2032 fn_last_bsn 9 delta_bsn 4 old_len 50 + bsn 60 +lime 0 + bsn 61 bsn 62 bsn 63 bsn 64 bsn 65 null + bsn 66 old segment + bsn 67 null + bsn 68 +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 1993 fn_last_bsn 4 delta_bsn 2 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 1968 fn_last_bsn 9 delta_bsn 4 old_len 48 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 74 FBI 0 +fn_same_bsn 1967 fn_last_bsn 13 delta_bsn 6 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 1 FBI 0 +fn_same_bsn 4169 fn_last_bsn 1560 delta_bsn -67 old_len 29 + bsn 60 +lime 0 + bsn 61 bsn 62 bsn 63 bsn 64 bsn 65 null + bsn 66 old segment + bsn 67 null + bsn 68 bsn 69 old segment + bsn 70 +lime 0 + bsn 71 bsn 72 +lime 0 + +lime error! + +lime 1 + bsn 73 bsn 74 bsn 75 bsn 76 bsn 77 bsn 78 bsn 79 bsn 80 bsn 81 bsn 82 bsn 83 bsn 84 bsn 85 bsn 86 bsn 87 bsn 88 bsn 89 bsn 90 bsn 91 bsn 92 bsn 93 bsn 94 bsn 95 bsn 96 bsn 97 bsn 98 bsn 99 +lime 0 + +lime error! + bsn 100 bsn 101 bsn 102 bsn 103 +lime 0 + +lime error! + +lime 1 + bsn 104 null + bsn 105 bsn 106 bsn 107 bsn 108 bsn 109 bsn 110 bsn 111 bsn 112 bsn 113 +lime 0 + +lime error! + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 3 FBI 0 +fn_same_bsn 3358 fn_last_bsn 4 delta_bsn 2 old_len 50 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 old segment + bsn 2 +lime 0 + +lime 1 + bsn 3 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 5 FBI 0 +fn_same_bsn 4199 fn_last_bsn 5 delta_bsn 2 old_len 28 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 old segment + bsn 2 +lime 0 + +lime 1 + bsn 3 old segment + bsn 4 null + bsn 5 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 4117 fn_last_bsn 4 delta_bsn 2 old_len 36 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 old segment + bsn 2 +lime 0 + +lime 1 + bsn 3 old segment + bsn 4 null + bsn 5 old segment + bsn 6 +lime 0 + bsn 7 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 9 FBI 0 +fn_same_bsn 4103 fn_last_bsn 4 delta_bsn 2 old_len 35 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 old segment + bsn 2 +lime 0 + +lime 1 + bsn 3 old segment + bsn 4 null + bsn 5 old segment + bsn 6 +lime 0 + bsn 7 old segment + bsn 8 null + bsn 9 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 4086 fn_last_bsn 9 delta_bsn 4 old_len 35 + bsn 113 +lime 0 + bsn 114 bsn 115 bsn 116 bsn 117 bsn 118 bsn 119 bsn 120 bsn 121 bsn 122 bsn 123 bsn 124 bsn 125 bsn 126 bsn 127 bsn 0 +lime 0 + +lime error! + +lime 1 + bsn 1 old segment + bsn 2 +lime 0 + +lime 1 + bsn 3 old segment + bsn 4 null + bsn 5 old segment + bsn 6 +lime 0 + bsn 7 old segment + bsn 8 null + bsn 9 old segment + bsn 10 old segment + bsn 11 +lime 0 + bsn 12 +lime 0 + bsn 13 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 15 FBI 0 +fn_same_bsn 4103 fn_last_bsn 4 delta_bsn 2 old_len 35 + bsn 12 +lime 0 + bsn 13 old segment + bsn 14 bsn 15 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 19 FBI 0 +fn_same_bsn 4065 fn_last_bsn 9 delta_bsn 4 old_len 0 + bsn 12 +lime 0 + bsn 13 old segment + bsn 14 bsn 15 old segment + bsn 16 +lime 0 + bsn 17 +lime 0 + bsn 18 +lime 0 + +lime error! + +lime 1 + bsn 19 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 29 FBI 0 +fn_same_bsn 3931 fn_last_bsn 22 delta_bsn 10 old_len 48 + bsn 17 +lime 0 + bsn 18 +lime 0 + +lime error! + +lime 1 + bsn 19 old segment + bsn 20 +lime 0 + bsn 21 +lime 0 + +lime error! + +lime 1 + bsn 22 +lime 0 + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 31 FBI 0 +fn_same_bsn 3891 fn_last_bsn 4 delta_bsn 2 old_len 48 + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 old segment + bsn 30 null + bsn 31 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 34 FBI 0 +fn_same_bsn 3861 fn_last_bsn 9 delta_bsn 3 old_len 0 + bsn 25 +lime 0 + bsn 26 null + bsn 27 bsn 28 null + bsn 29 old segment + bsn 30 null + bsn 31 old segment + bsn 32 bsn 33 +lime 0 + +lime error! + bsn 34 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 24 FBI 0 +fn_same_bsn 3917 fn_last_bsn 4 delta_bsn -10 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 26 FBI 0 +fn_same_bsn 3943 fn_last_bsn 8 delta_bsn -8 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 32 FBI 0 +fn_same_bsn 3414 fn_last_bsn 21 delta_bsn -2 old_len 50 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 34 FBI 0 +fn_same_bsn 26 fn_last_bsn 26 delta_bsn 0 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 36 FBI 0 +fn_same_bsn 3887 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 33 +lime 0 + bsn 34 old segment + bsn 35 bsn 36 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 38 FBI 0 +fn_same_bsn 3887 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 33 +lime 0 + bsn 34 old segment + bsn 35 bsn 36 old segment + bsn 37 +lime 0 + bsn 38 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 40 FBI 0 +fn_same_bsn 3415 fn_last_bsn 5 delta_bsn 2 old_len 50 + bsn 37 +lime 0 + bsn 38 old segment + bsn 39 bsn 40 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 37 FBI 0 +fn_same_bsn 3917 fn_last_bsn 8 delta_bsn -3 old_len 49 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 39 FBI 0 +fn_same_bsn 3918 fn_last_bsn 13 delta_bsn -1 old_len 50 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 36 FBI 0 +fn_same_bsn 26 fn_last_bsn 17 delta_bsn -4 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 38 FBI 0 +fn_same_bsn 26 fn_last_bsn 21 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 40 FBI 0 +fn_same_bsn 26 fn_last_bsn 26 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 42 FBI 0 +fn_same_bsn 3917 fn_last_bsn 4 delta_bsn 2 old_len 49 + bsn 37 +lime 0 + bsn 38 bsn 39 bsn 40 +lime 0 +end of message reached +MSG: 03c05d6500001645000038000040002f06df04364c75c3c01f1120abc1965ea60c31f0d55c55ae3cbc43ce8e7f5af9db38514f7b1f3dcaf7a6b839c02b000012ff0100010033740009084500003c0000400034063d045fd3e938c0a800040050e05b19d049c8d8cf3372a012389055cb0000020405b40402080aeee7f73e4bbd717654a3404f0744 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + bsn 41 null + bsn 42 +TS 4 CS4 DL DATA TFI 0 BSN 44 FBI 0 +fn_same_bsn 3908 fn_last_bsn 4 delta_bsn 2 old_len 50 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 +TS 4 CS4 DL DATA TFI 0 BSN 46 FBI 0 +fn_same_bsn 3441 fn_last_bsn 5 delta_bsn 2 old_len 50 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 +end of message reached +MSG: 01000436b70e872c7883 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 42 FBI 0 +fn_same_bsn 13 fn_last_bsn 4 delta_bsn -4 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 44 FBI 0 +fn_same_bsn 13 fn_last_bsn 8 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 46 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 42 FBI 0 +fn_same_bsn 13 fn_last_bsn 4 delta_bsn -4 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 44 FBI 0 +fn_same_bsn 13 fn_last_bsn 8 delta_bsn -2 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 3905 fn_last_bsn 13 delta_bsn 1 old_len 49 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 47 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 49 FBI 0 +fn_same_bsn 1846 fn_last_bsn 18 delta_bsn 2 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 50 FBI 0 +fn_same_bsn 3505 fn_last_bsn 26 delta_bsn 3 old_len 50 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 +TS 4 CS4 DL DATA TFI 0 BSN 52 FBI 0 +fn_same_bsn 3506 fn_last_bsn 5 delta_bsn 2 old_len 50 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 +TS 4 CS4 DL DATA TFI 0 BSN 56 FBI 0 +fn_same_bsn 1824 fn_last_bsn 8 delta_bsn 4 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 1825 fn_last_bsn 13 delta_bsn 6 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 60 FBI 0 +fn_same_bsn 3848 fn_last_bsn 17 delta_bsn 8 old_len 49 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 bsn 59 bsn 60 old segment + +TS 4 CS4 DL DATA TFI 0 BSN 53 FBI 0 +fn_same_bsn 1881 fn_last_bsn 13 delta_bsn -7 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 1881 fn_last_bsn 22 delta_bsn -3 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 64 FBI 0 +fn_same_bsn 1842 fn_last_bsn 26 delta_bsn 4 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 66 FBI 0 +fn_same_bsn 3852 fn_last_bsn 30 delta_bsn 6 old_len 50 + bsn 40 +lime 0 + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 bsn 59 bsn 60 old segment + bsn 61 bsn 62 bsn 63 bsn 64 bsn 65 null + bsn 66 +lime 0 +end of message reached +MSG: 840abbd16d8010007b8e8400000101080a1639dcbc01cbd5c461f664 + +TS 4 CS4 DL DATA TFI 0 BSN 63 FBI 0 +fn_same_bsn 3246 fn_last_bsn 5 delta_bsn -3 old_len 50 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 65 FBI 0 +fn_same_bsn 3874 fn_last_bsn 9 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 67 FBI 0 +fn_same_bsn 3874 fn_last_bsn 13 delta_bsn 1 old_len 0 + bsn 66 +lime 0 + bsn 67 +lime 0 +end of message reached +MSG: 03c1c56500004b4500003437bf40003206fde657fafa77c0a8000401bb95e397cdfe840abbd16d8011007b8e8300000101080a1639dcbc01cbd5c4da773a + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 64 FBI 0 +fn_same_bsn 1864 fn_last_bsn 5 delta_bsn -3 old_len 50 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 68 FBI 0 +fn_same_bsn 1859 fn_last_bsn 9 delta_bsn 1 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 70 FBI 0 +fn_same_bsn 3852 fn_last_bsn 13 delta_bsn 3 old_len 49 + bsn 67 +lime 0 + +lime 1 + bsn 68 bsn 69 old segment + bsn 70 +lime 0 +end of message reached +MSG: 2d616e616c7974696373016c06676f6f676c65c021c036000100010000005e0004d83ad34e48fecd + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 3835 fn_last_bsn 13 delta_bsn 2 old_len 48 + bsn 67 +lime 0 + +lime 1 + bsn 68 bsn 69 old segment + bsn 70 +lime 0 + +lime 1 + bsn 71 old segment + bsn 72 +lime 0 +end of message reached +MSG: 23 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 72 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 73 FBI 0 +fn_same_bsn 3575 fn_last_bsn 9 delta_bsn 1 old_len 50 + bsn 67 +lime 0 + +lime 1 + bsn 68 bsn 69 old segment + bsn 70 +lime 0 + +lime 1 + bsn 71 old segment + bsn 72 +lime 0 + +lime 1 + bsn 73 +TS 4 CS4 DL DATA TFI 0 BSN 74 FBI 0 +fn_same_bsn 3869 fn_last_bsn 8 delta_bsn 1 old_len 50 + bsn 67 +lime 0 + +lime 1 + bsn 68 bsn 69 old segment + bsn 70 +lime 0 + +lime 1 + bsn 71 old segment + bsn 72 +lime 0 + +lime 1 + bsn 73 bsn 74 +lime 0 +end of message reached +MSG: 03c1d16500004e4500003c0000400034063d055fd3e937c0a800040050e85c23fe0d33dbc2bd33a0123890a0b00000020405b40402080aeee7eb4501cbd62a010303075247e3 + +TS 4 CS4 DL DATA TFI 0 BSN 74 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 76 FBI 0 +fn_same_bsn 3883 fn_last_bsn 5 delta_bsn 2 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 3610 fn_last_bsn 17 delta_bsn 1 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 +end of message reached +MSG: 03c1d9650000504500003c000040002b06d71736b78141c0a800040050a2efb3d3d9ab159e9e3ca01238909dee0000020405b40402080af609464e01cbd60e01030308bff2bd + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 77 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 83 FBI 0 +fn_same_bsn 3658 fn_last_bsn 26 delta_bsn 6 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 old segment + bsn 80 old segment + bsn 81 old segment + bsn 82 old segment + bsn 83 +lime 0 +end of message reached +MSG: 960402080aa3c65a3801cbd64201030307abdf87 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 83 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 81 FBI 0 +fn_same_bsn 3683 fn_last_bsn 8 delta_bsn -2 old_len 50 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 83 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 79 FBI 0 +fn_same_bsn 3705 fn_last_bsn 13 delta_bsn -4 old_len 50 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 87 FBI 0 +fn_same_bsn 3696 fn_last_bsn 21 delta_bsn 4 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 +end of message reached +MSG: 960402080aa3c6607c01cbd65d0103030772f846 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 89 FBI 0 +fn_same_bsn 3697 fn_last_bsn 5 delta_bsn 2 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 +end of message reached +MSG: 960402080aa43557eb01cbd668010303073b787f + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 87 FBI 0 +fn_same_bsn 13 fn_last_bsn 8 delta_bsn -2 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 91 FBI 0 +fn_same_bsn 3709 fn_last_bsn 17 delta_bsn 2 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 old segment + bsn 91 +lime 0 +end of message reached +MSG: 960402080aa3c65b6401cbd64201030307b35ba6 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 89 FBI 0 +fn_same_bsn 21 fn_last_bsn 4 delta_bsn -2 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 92 FBI 0 +fn_same_bsn 4021 fn_last_bsn 26 delta_bsn 1 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 old segment + bsn 91 +lime 0 + +lime 1 + bsn 92 +TS 4 CS4 DL DATA TFI 0 BSN 122 FBI 0 +fn_same_bsn 3731 fn_last_bsn 65 delta_bsn 30 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 old segment + bsn 91 +lime 0 + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 old segment + bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 +TS 4 CS4 DL DATA TFI 0 BSN 124 FBI 0 +fn_same_bsn 3731 fn_last_bsn 4 delta_bsn 2 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 old segment + bsn 91 +lime 0 + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 old segment + bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 +TS 4 CS4 DL DATA TFI 0 BSN 13 FBI 0 +fn_same_bsn 628 fn_last_bsn 39 delta_bsn -111 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 old segment + bsn 91 +lime 0 + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 old segment + bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 bsn 125 old segment + bsn 126 old segment + bsn 127 old segment + bsn 0 old segment + bsn 1 bsn 2 old segment + bsn 3 bsn 4 null + bsn 5 bsn 6 old segment + bsn 7 bsn 8 null + bsn 9 bsn 10 old segment + bsn 11 old segment + bsn 12 old segment + bsn 13 +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 4559 fn_last_bsn 31 delta_bsn 14 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 old segment + bsn 91 +lime 0 + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 old segment + bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 bsn 125 old segment + bsn 126 old segment + bsn 127 old segment + bsn 0 old segment + bsn 1 bsn 2 old segment + bsn 3 bsn 4 null + bsn 5 bsn 6 old segment + bsn 7 bsn 8 null + bsn 9 bsn 10 old segment + bsn 11 old segment + bsn 12 old segment + bsn 13 bsn 14 old segment + bsn 15 bsn 16 old segment + bsn 17 old segment + bsn 18 old segment + bsn 19 +lime 0 +end of message reached +MSG: c9c9 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 old segment + bsn 24 null + bsn 25 old segment + bsn 26 null + bsn 27 +TS 4 CS3 DL DATA TFI 0 BSN 51 FBI 0 +fn_same_bsn 2392 fn_last_bsn 82 delta_bsn 24 old_len 50 + bsn 19 +lime 0 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 old segment + bsn 24 null + bsn 25 old segment + bsn 26 null + bsn 27 bsn 28 null + bsn 29 bsn 30 null + bsn 31 +lime 0 +end of message reached +MSG: 86028727b54aaec540b87534a56f099c3abd + bsn 32 bsn 33 old segment + bsn 34 bsn 35 old segment + bsn 36 bsn 37 +lime 0 + +lime error! + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 +TS 4 CS3 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 2392 fn_last_bsn 9 delta_bsn 4 old_len 50 + bsn 37 +lime 0 + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 +TS 4 CS3 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 511 fn_last_bsn 4 delta_bsn 2 old_len 50 +fucking error d_bsn! + +TS 4 CS3 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 17 fn_last_bsn 17 delta_bsn 0 old_len 36 +duplicate2 + +TS 4 CS3 DL DATA TFI 0 BSN 57 FBI 0 +fn_same_bsn 528 fn_last_bsn 4 delta_bsn 2 old_len 50 +fucking error d_bsn! + +TS 4 CS3 DL DATA TFI 0 BSN 54 FBI 0 +fn_same_bsn 2392 fn_last_bsn 9 delta_bsn -1 old_len 0 +duplicate + +TS 4 CS3 DL DATA TFI 0 BSN 56 FBI 0 +fn_same_bsn 2392 fn_last_bsn 13 delta_bsn 1 old_len 50 + bsn 37 +lime 0 + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 +TS 4 CS3 DL DATA TFI 0 BSN 58 FBI 0 +fn_same_bsn 2392 fn_last_bsn 4 delta_bsn 2 old_len 50 + bsn 37 +lime 0 + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 +lime 0 +end of message reached +MSG: 0e000037116eb308080808c0a8000400357aea005c6e58ce5f8180000100020000000007616e64726f696407636c69656e747306676f6f676c6503636f6d0000010001c00c000500e98e95f24fc0197bdcd2efd3a7c91c164d46fbc132b155951b986dda15244ccbd3cbced0e833245333cb33a8ff9d2c0bed949f7c + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS3 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 22 fn_last_bsn 5 delta_bsn -3 old_len 36 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 68 FBI 0 +fn_same_bsn 2435 fn_last_bsn 65 delta_bsn 10 old_len 50 + bsn 37 +lime 0 + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 old segment + bsn 46 +lime 0 + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 +lime 0 + +lime error! + +lime 1 + bsn 59 old segment + bsn 60 bsn 61 old segment + bsn 62 bsn 63 bsn 64 bsn 65 null + bsn 66 +lime 0 + bsn 67 +lime 0 + +lime error! + +lime 1 + bsn 68 +TS 4 CS4 DL DATA TFI 0 BSN 90 FBI 0 +fn_same_bsn 4403 fn_last_bsn 48 delta_bsn 22 old_len 50 + bsn 66 +lime 0 + bsn 67 +lime 0 + +lime error! + +lime 1 + bsn 68 bsn 69 old segment + bsn 70 +lime 0 + +lime 1 + bsn 71 old segment + bsn 72 +lime 0 + +lime 1 + bsn 73 bsn 74 +lime 0 + +lime error! + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 +TS 4 CS4 DL DATA TFI 0 BSN 100 FBI 0 +fn_same_bsn 4446 fn_last_bsn 65 delta_bsn 10 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 bsn 91 +lime 0 + +lime error! + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 +TS 4 CS4 DL DATA TFI 0 BSN 12 FBI 0 +fn_same_bsn 4117 fn_last_bsn 52 delta_bsn -88 old_len 49 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 bsn 91 +lime 0 + +lime error! + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 bsn 125 old segment + bsn 126 old segment + bsn 127 old segment + bsn 0 old segment + bsn 1 bsn 2 old segment + bsn 3 bsn 4 null + bsn 5 bsn 6 old segment + bsn 7 bsn 8 null + bsn 9 bsn 10 old segment + bsn 11 old segment + bsn 12 +TS 4 CS4 DL DATA TFI 0 BSN 45 FBI 0 +fn_same_bsn 4845 fn_last_bsn 74 delta_bsn 33 old_len 48 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 bsn 91 +lime 0 + +lime error! + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 bsn 125 old segment + bsn 126 old segment + bsn 127 old segment + bsn 0 old segment + bsn 1 bsn 2 old segment + bsn 3 bsn 4 null + bsn 5 bsn 6 old segment + bsn 7 bsn 8 null + bsn 9 bsn 10 old segment + bsn 11 old segment + bsn 12 bsn 13 bsn 14 old segment + bsn 15 bsn 16 old segment + bsn 17 old segment + bsn 18 old segment + bsn 19 +lime 0 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 old segment + bsn 24 null + bsn 25 old segment + bsn 26 null + bsn 27 bsn 28 null + bsn 29 bsn 30 null + bsn 31 +lime 0 + bsn 32 bsn 33 old segment + bsn 34 bsn 35 old segment + bsn 36 bsn 37 +lime 0 + +lime error! + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 +TS 4 CS4 DL DATA TFI 0 BSN 55 FBI 0 +fn_same_bsn 320 fn_last_bsn 21 delta_bsn 10 old_len 36 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 125 FBI 0 +fn_same_bsn 4702 fn_last_bsn 186 delta_bsn 80 old_len 50 + bsn 37 +lime 0 + bsn 38 bsn 39 bsn 40 +lime 0 + +lime error! + +lime 1 + bsn 41 null + bsn 42 bsn 43 null + bsn 44 bsn 45 bsn 46 +lime 0 + +lime error! + +lime 1 + bsn 47 +lime 0 + bsn 48 old segment + bsn 49 +lime 0 + bsn 50 bsn 51 bsn 52 bsn 53 bsn 54 null + bsn 55 bsn 56 bsn 57 bsn 58 +lime 0 + +lime error! + +lime 1 + bsn 59 old segment + bsn 60 bsn 61 old segment + bsn 62 bsn 63 bsn 64 bsn 65 null + bsn 66 +lime 0 + bsn 67 +lime 0 + +lime error! + +lime 1 + bsn 68 bsn 69 old segment + bsn 70 +lime 0 + +lime 1 + bsn 71 old segment + bsn 72 +lime 0 + +lime 1 + bsn 73 bsn 74 +lime 0 + +lime error! + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 bsn 91 +lime 0 + +lime error! + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 bsn 125 +TS 4 CS4 DL DATA TFI 0 BSN 7 FBI 0 +fn_same_bsn 1309 fn_last_bsn 22 delta_bsn -118 old_len 50 + bsn 74 +lime 0 + bsn 75 old segment + bsn 76 bsn 77 +lime 0 + +lime error! + +lime 1 + bsn 78 old segment + bsn 79 bsn 80 old segment + bsn 81 bsn 82 old segment + bsn 83 +lime 0 + +lime 1 + bsn 84 old segment + bsn 85 old segment + bsn 86 old segment + bsn 87 +lime 0 + +lime 1 + bsn 88 old segment + bsn 89 +lime 0 + +lime 1 + bsn 90 bsn 91 +lime 0 + +lime error! + +lime 1 + bsn 92 bsn 93 old segment + bsn 94 old segment + bsn 95 old segment + bsn 96 old segment + bsn 97 old segment + bsn 98 old segment + bsn 99 old segment + bsn 100 bsn 101 old segment + bsn 102 old segment + bsn 103 old segment + bsn 104 null + bsn 105 old segment + bsn 106 old segment + bsn 107 old segment + bsn 108 old segment + bsn 109 old segment + bsn 110 old segment + bsn 111 old segment + bsn 112 old segment + bsn 113 old segment + bsn 114 old segment + bsn 115 old segment + bsn 116 old segment + bsn 117 old segment + bsn 118 old segment + bsn 119 old segment + bsn 120 old segment + bsn 121 old segment + bsn 122 bsn 123 old segment + bsn 124 bsn 125 bsn 126 old segment + bsn 127 old segment + bsn 0 old segment + bsn 1 bsn 2 old segment + bsn 3 bsn 4 null + bsn 5 bsn 6 old segment + bsn 7 +lime 0 +end of message reached +MSG: 0100000035000436b7cfd882fd7f + +TS 4 CS4 DL DATA TFI 0 BSN 4 FBI 0 +fn_same_bsn 5529 fn_last_bsn 30 delta_bsn -3 old_len 0 +duplicate + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 5317 fn_last_bsn 86 delta_bsn 16 old_len 49 + bsn 7 +lime 0 + bsn 8 null + bsn 9 bsn 10 old segment + bsn 11 old segment + bsn 12 bsn 13 bsn 14 old segment + bsn 15 bsn 16 old segment + bsn 17 old segment + bsn 18 old segment + bsn 19 +lime 0 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 23 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 25 FBI 0 +fn_same_bsn 5317 fn_last_bsn 18 delta_bsn 2 old_len 49 + bsn 19 +lime 0 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 +end of message reached +MSG: 010402080a1bdb7b6501cbd7ad4c0575 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 27 FBI 0 +fn_same_bsn 758 fn_last_bsn 4 delta_bsn 2 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 25 FBI 0 +fn_same_bsn 8 fn_last_bsn 8 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 5304 fn_last_bsn 13 delta_bsn 3 old_len 0 + bsn 19 +lime 0 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 + +lime 1 + bsn 26 null + bsn 27 bsn 28 +lime 0 +end of message reached +MSG: 5472616e736665722d456e636f64696e673a206368756e6b65640d0a436f6e6e656374696f6e3a206b6565702d616c69766543c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 13 fn_last_bsn 13 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 28 FBI 0 +fn_same_bsn 17 fn_last_bsn 17 delta_bsn 0 old_len 49 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 30 FBI 0 +fn_same_bsn 5317 fn_last_bsn 4 delta_bsn 2 old_len 0 + bsn 19 +lime 0 + bsn 20 old segment + bsn 21 old segment + bsn 22 old segment + bsn 23 +lime 0 + bsn 24 null + bsn 25 +lime 0 + +lime 1 + bsn 26 null + bsn 27 bsn 28 +lime 0 + +lime error! + bsn 29 bsn 30 +lime 0 +end of message reached +MSG: 40d486f6b93071160dffd2ad4c133ca892764b19c946f823996fb70573d9939ab7e19c9776447e75551957a5f0ffa3e4e75d960402080aa3c66aa701cbd7b1010303076209bb + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 4 CS4 DL DATA TFI 0 BSN 30 FBI 0 +fn_same_bsn 18 fn_last_bsn 18 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 30 FBI 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 48 +duplicate2 + +TS 4 CS4 DL DATA TFI 0 BSN 31 FBI 0 +fn_same_bsn 1478 fn_last_bsn 9 delta_bsn 1 old_len 49 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 32 FBI 0 +fn_same_bsn 1456 fn_last_bsn 17 delta_bsn 2 old_len 50 +fucking error d_bsn! + +TS 4 CS4 DL DATA TFI 0 BSN 31 FBI 0 +fn_same_bsn 1491 fn_last_bsn 22 delta_bsn 1 old_len 49 +fucking error d_bsn! + diff --git a/src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.sample b/src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.sample new file mode 100644 index 0000000..08f5f45 --- /dev/null +++ b/src/host/gprsdecode/gprs_20160129_1744_878_16846_0c.sample Binary files differ diff --git a/src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.decoded b/src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.decoded new file mode 100644 index 0000000..ea3cf94 --- /dev/null +++ b/src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.decoded @@ -0,0 +1,450 @@ +TS 7 CS2 UL DATA TFI 21 BSN 0 CV 1 +fn_same_bsn 494819 fn_last_bsn 494819 delta_bsn 0 old_len 0 +clearing TBF 22, first 0 last 0 +new TBF, starting from 0 + bsn 0 +TS 7 CS2 UL DATA TFI 21 BSN 1 CV 0 +fn_same_bsn 494823 fn_last_bsn 4 delta_bsn 1 old_len 0 + bsn 0 bsn 1 +lime 0 +end of message reached +MSG: 01c001080102e5e071070405f41b40072b62f208000100121953422ae57ef909006aa4d594321200d5401716cfabbb + +TS 7 CS2 UL DATA TFI 21 BSN 0 CV 1 +fn_same_bsn 8 fn_last_bsn 4 delta_bsn -1 old_len 30 +duplicate2 + +TS 7 CS2 UL DATA TFI 21 BSN 1 CV 0 +fn_same_bsn 9 fn_last_bsn 9 delta_bsn 0 old_len 29 +duplicate2 + +TS 7 CS2 UL DATA TFI 21 BSN 0 CV 1 +fn_same_bsn 9 fn_last_bsn 4 delta_bsn -1 old_len 30 +duplicate2 + +TS 7 CS2 DL DATA TFI 16 BSN 0 FBI 0 +fn_same_bsn 494866 fn_last_bsn 494866 delta_bsn 0 old_len 0 +clearing TBF 17, first 0 last 0 +new TBF, starting from 0 + bsn 0 +lime 0 +end of message reached +MSG: 01c0010802012a0462f2080001001805f444f70250b6151a + +TS 7 CS4 DL DATA TFI 16 BSN 1 FBI 0 +fn_same_bsn 494897 fn_last_bsn 31 delta_bsn 1 old_len 0 + bsn 0 +lime 0 + bsn 1 +lime 0 +end of message reached +MSG: 43c0012b2b2b + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 2 FBI 0 +fn_same_bsn 494914 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 1 +lime 0 + +lime 1 + bsn 2 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 3 FBI 0 +fn_same_bsn 494936 fn_last_bsn 22 delta_bsn 1 old_len 0 + bsn 2 +lime 0 + bsn 3 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 UL DATA TFI 20 BSN 0 CV 0 +fn_same_bsn 494953 fn_last_bsn 494953 delta_bsn 0 old_len 0 +clearing TBF 21, first 1 last 1 + bsn 1 +lime 0 +new TBF, starting from 0 + bsn 0 +lime 0 +end of message reached +MSG: 01c00508038d8a47 + +TS 7 CS4 UL DATA TFI 20 BSN 0 CV 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 7 CS4 UL DATA TFI 20 BSN 0 CV 0 +fn_same_bsn 5 fn_last_bsn 5 delta_bsn 0 old_len 49 +duplicate2 + +TS 7 CS4 UL DATA TFI 20 BSN 0 CV 0 +fn_same_bsn 4 fn_last_bsn 4 delta_bsn 0 old_len 49 +duplicate2 + +TS 7 CS4 DL DATA TFI 16 BSN 4 FBI 0 +fn_same_bsn 494992 fn_last_bsn 56 delta_bsn 1 old_len 0 + bsn 3 +lime 0 + bsn 4 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 5 FBI 0 +fn_same_bsn 495009 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 4 +lime 0 + bsn 5 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 6 FBI 0 +fn_same_bsn 495031 fn_last_bsn 22 delta_bsn 1 old_len 0 + bsn 5 +lime 0 + bsn 6 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 UL DATA TFI 19 BSN 0 CV 1 +fn_same_bsn 495048 fn_last_bsn 495048 delta_bsn 0 old_len 0 +clearing TBF 20, first 0 last 0 + bsn 0 +lime 0 +new TBF, starting from 0 + bsn 0 +TS 7 CS4 UL DATA TFI 19 BSN 1 CV 0 +fn_same_bsn 495053 fn_last_bsn 5 delta_bsn 1 old_len 0 + bsn 0 bsn 1 +lime 0 +end of message reached +MSG: 01c0090a4105030e00001f10000000000000000000000201212806056a7564666f272680c0230f0100000f04666a6b640567666a6d668021100100001081060000000083060000000032e5d0 + +TS 7 CS4 UL DATA TFI 19 BSN 0 CV 1 +fn_same_bsn 9 fn_last_bsn 4 delta_bsn -1 old_len 50 +duplicate2 + +TS 7 CS4 UL DATA TFI 19 BSN 1 CV 0 +fn_same_bsn 8 fn_last_bsn 8 delta_bsn 0 old_len 49 +duplicate2 + +TS 7 CS4 DL DATA TFI 16 BSN 7 FBI 0 +fn_same_bsn 495066 fn_last_bsn 35 delta_bsn 1 old_len 0 + bsn 6 +lime 0 + bsn 7 +TS 7 CS4 UL DATA TFI 19 BSN 0 CV 1 +fn_same_bsn 9 fn_last_bsn 5 delta_bsn -1 old_len 50 +duplicate2 + +TS 7 CS4 DL DATA TFI 16 BSN 8 FBI 0 +fn_same_bsn 495074 fn_last_bsn 8 delta_bsn 1 old_len 0 + bsn 6 +lime 0 + bsn 7 bsn 8 +lime 0 +end of message reached +MSG: 01c0058a42030e23621f72993f3f1143ffff000000002b0601210a00000627148080211002000010810608080808830600000000d68800 + +lime 1 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 9 FBI 0 +fn_same_bsn 495096 fn_last_bsn 22 delta_bsn 1 old_len 0 + bsn 8 +lime 0 + +lime 1 + bsn 9 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 10 FBI 0 +fn_same_bsn 495113 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 9 +lime 0 + bsn 10 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 11 FBI 0 +fn_same_bsn 495131 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 10 +lime 0 + bsn 11 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 12 FBI 0 +fn_same_bsn 495148 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 11 +lime 0 + bsn 12 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 13 FBI 0 +fn_same_bsn 495165 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 12 +lime 0 + bsn 13 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 14 FBI 0 +fn_same_bsn 495183 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 13 +lime 0 + bsn 14 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 15 FBI 0 +fn_same_bsn 495200 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 14 +lime 0 + bsn 15 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 16 FBI 0 +fn_same_bsn 495217 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 15 +lime 0 + bsn 16 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 17 FBI 0 +fn_same_bsn 495235 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 16 +lime 0 + bsn 17 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 18 FBI 0 +fn_same_bsn 495252 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 17 +lime 0 + bsn 18 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 19 FBI 0 +fn_same_bsn 495269 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 18 +lime 0 + bsn 19 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 20 FBI 0 +fn_same_bsn 495287 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 19 +lime 0 + bsn 20 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 21 FBI 0 +fn_same_bsn 495304 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 20 +lime 0 + bsn 21 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 22 FBI 0 +fn_same_bsn 495321 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 21 +lime 0 + bsn 22 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 23 FBI 0 +fn_same_bsn 495339 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 22 +lime 0 + bsn 23 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 24 FBI 0 +fn_same_bsn 495356 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 23 +lime 0 + bsn 24 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 25 FBI 0 +fn_same_bsn 495373 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 24 +lime 0 + bsn 25 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 26 FBI 0 +fn_same_bsn 495391 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 25 +lime 0 + bsn 26 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 27 FBI 0 +fn_same_bsn 495408 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 26 +lime 0 + bsn 27 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 28 FBI 0 +fn_same_bsn 495425 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 27 +lime 0 + bsn 28 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 29 FBI 0 +fn_same_bsn 495443 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 28 +lime 0 + bsn 29 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 30 FBI 0 +fn_same_bsn 495460 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 29 +lime 0 + bsn 30 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 31 FBI 0 +fn_same_bsn 495477 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 30 +lime 0 + bsn 31 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 32 FBI 0 +fn_same_bsn 495495 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 31 +lime 0 + bsn 32 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 33 FBI 0 +fn_same_bsn 495512 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 32 +lime 0 + bsn 33 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 34 FBI 0 +fn_same_bsn 495529 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 33 +lime 0 + bsn 34 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 35 FBI 0 +fn_same_bsn 495547 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 34 +lime 0 + bsn 35 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 36 FBI 0 +fn_same_bsn 495564 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 35 +lime 0 + bsn 36 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 37 FBI 0 +fn_same_bsn 495581 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 36 +lime 0 + bsn 37 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 38 FBI 0 +fn_same_bsn 495599 fn_last_bsn 18 delta_bsn 1 old_len 0 + bsn 37 +lime 0 + bsn 38 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 39 FBI 0 +fn_same_bsn 495616 fn_last_bsn 17 delta_bsn 1 old_len 0 + bsn 38 +lime 0 + bsn 39 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + +TS 7 CS4 DL DATA TFI 16 BSN 40 FBI 1 +fn_same_bsn 495620 fn_last_bsn 4 delta_bsn 1 old_len 0 + bsn 39 +lime 0 + bsn 40 +lime 0 +end of message reached +MSG: 43c0012b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b + diff --git a/src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.sample b/src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.sample new file mode 100644 index 0000000..4fe83da --- /dev/null +++ b/src/host/gprsdecode/gprs_262_80_0001_0000_20110710_2251_875_494777_0f.sample Binary files differ diff --git a/src/host/gprsdecode/main.c b/src/host/gprsdecode/main.c new file mode 100644 index 0000000..238ae9b --- /dev/null +++ b/src/host/gprsdecode/main.c @@ -0,0 +1,74 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "burst_desc.h" +#include "gprs.h" +#include "output.h" + +void process_handle_burst(struct l1ctl_burst_ind *bi) +{ + uint32_t fn; + uint8_t type, subch, ts; + + fn = ntohl(bi->frame_nr); + rsl_dec_chan_nr(bi->chan_nr, &type, &subch, &ts); + + switch (type) { + case RSL_CHAN_Bm_ACCHs: + if ((ts > 0) && ((fn % 13) != 12)) // wtf is 12? + process_pdch(bi, DEBUG_PRINT); +/* printf("TS = %d, FN = %d (%d)\n", ts, fn, process_pdch(bi)); + else + printf("TS = %d, FN = %d [%d]\n", ts, fn, fn % 13); +*/ break; + case RSL_CHAN_Lm_ACCHs: + case RSL_CHAN_BCCH: + case RSL_CHAN_SDCCH4_ACCH: + case RSL_CHAN_SDCCH8_ACCH: + case RSL_CHAN_RACH: + case RSL_CHAN_PCH_AGCH: + default: + break; + //printf("Type not handled! %.02x\n", type); + } +} + +int main(int argc, char **argv) +{ + int ret; + FILE *burst_fd; + struct l1ctl_burst_ind bi; + + if (argc < 2) { + printf("\nUsage: %s \n", argv[0]); + return -1; + } + + burst_fd = fopen(argv[1], "rb"); + if (!burst_fd) { + printf("Cannot open file\n"); + return 0; + } + + net_init(); + gprs_init(); + memset(gprs, 0, 16 * sizeof(struct burst_buf)); + + while (!feof(burst_fd)) { + ret = fread(&bi, sizeof(bi), 1, burst_fd); + if (!ret) + break; + process_handle_burst(&bi); + } + + fclose(burst_fd); + fflush(NULL); + return 0; +} + diff --git a/src/host/gprsdecode/output.c b/src/host/gprsdecode/output.c new file mode 100644 index 0000000..e14de00 --- /dev/null +++ b/src/host/gprsdecode/output.c @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include + +#include "burst_desc.h" +#include "output.h" + +static struct gsmtap_inst *gti; + +void net_init() +{ + gti = gsmtap_source_init("127.0.0.1", GSMTAP_UDP_PORT, 0); + gsmtap_source_add_sink(gti); +} + +void net_send_rlcmac(uint8_t *msg, int len, uint8_t ts, uint8_t ul) +{ + if (gti) { + gsmtap_send(gti, ul ? GSMTAP_ARFCN_F_UPLINK : 0, ts, GSMTAP_CHANNEL_PACCH, 0, 0, 0, 0, msg, len); + while (osmo_select_main(1)); + } +} + +void net_send_llc(uint8_t *data, int len, uint8_t ul) +{ + struct msgb *msg; + struct gsmtap_hdr *gh; + uint8_t *dst; + + if (!gti) + return; + + /* skip null frames */ + if ((data[0] == 0x43) && + (data[1] == 0xc0) && + (data[2] == 0x01)) + return; + + msg = msgb_alloc(sizeof(*gh) + len, "gsmtap_tx"); + if (!msg) + return; + + gh = (struct gsmtap_hdr *) msgb_put(msg, sizeof(*gh)); + + gh->version = GSMTAP_VERSION; + gh->hdr_len = sizeof(*gh) / 4; + gh->type = GSMTAP_TYPE_GB_LLC; + gh->timeslot = 0; + gh->sub_slot = 0; + gh->arfcn = ul ? htons(GSMTAP_ARFCN_F_UPLINK) : 0; + gh->snr_db = 0; + gh->signal_dbm = 0; + gh->frame_number = 0; + gh->sub_type = 0; + gh->antenna_nr = 0; + + dst = msgb_put(msg, len); + memcpy(dst, data, len); + + gsmtap_sendmsg(gti, msg); + + while (osmo_select_main(1)); +} + diff --git a/src/host/gprsdecode/output.h b/src/host/gprsdecode/output.h new file mode 100644 index 0000000..5709307 --- /dev/null +++ b/src/host/gprsdecode/output.h @@ -0,0 +1,7 @@ +#pragma once + +#include + +void net_init(); +void net_send_rlcmac(uint8_t *msg, int len, uint8_t ts, uint8_t ul); +void net_send_llc(uint8_t *data, int len, uint8_t ul); diff --git a/src/host/gprsdecode/rlcmac.c b/src/host/gprsdecode/rlcmac.c new file mode 100644 index 0000000..9b7642a --- /dev/null +++ b/src/host/gprsdecode/rlcmac.c @@ -0,0 +1,377 @@ +#include +#include +#include +#include +#include +#include + +#include "rlcmac.h" +#include "output.h" + +inline int too_old(uint32_t current_fn, uint32_t test_fn) +{ + uint32_t delta = (current_fn - test_fn) & 0xffffffff; + + /* more and less 30 seconds from now */ + return (abs(delta) > OLD_TIME) ? 1 : 0; +} + +inline int bsn_is_next(uint8_t first, uint8_t second) +{ + return (((first + 1) % 128) == second); +} + +void print_pkt(uint8_t *msg, unsigned len) +{ + printf("MSG: "); + for (unsigned i = 0; i < len; i++) + printf("%.02x", msg[i]); + + printf("\n"); + fflush(stdout); +} + +void process_blocks(struct gprs_tbf *t, int ul) +{ + struct gprs_frag *f; + struct gprs_lime *l; + unsigned skip, llc_len = 0; + uint8_t bsn, bsn2, llc_data[65536], llc_first_bsn, llc_last_bsn = 0, li_off; + uint32_t current_fn; + + /* get current "time", oldest unreassembled frag */ + bsn = t->start_bsn; + while (t->frags[bsn].len == 0) { + bsn = (bsn + 1) % 128; + if (bsn == t->start_bsn) { + printf("no valid blocks in current TBF!\n"); + fflush(stdout); + return; + } + } + current_fn = t->frags[bsn].fn; + t->start_bsn = bsn; + + /* walk through fragments, mark reassembled/used blocks */ + skip = 0; + for (bsn = t->start_bsn; bsn != ((t->last_bsn + 1) % 128); bsn = (bsn + 1) % 128) { + /* get fragment descriptor */ + f = &t->frags[bsn]; + + printf(" bsn %d ", bsn); + fflush(stdout); + + /* already processed or null */ + if (!f->len) { + printf("null\n"); + fflush(stdout); + llc_len = 0; + skip = 1; + continue; + } + + /* check fragment age */ + if (too_old(current_fn, f->fn)) { + printf("old segment\n"); + fflush(stdout); + llc_len = 0; + skip = 1; + continue; + } + + /* update "time" */ + current_fn = f->fn; + + if (llc_len && !bsn_is_next(llc_last_bsn, bsn)) { + printf("missing bsn, previous %d\n", llc_last_bsn); + fflush(stdout); + llc_len = 0; + skip = 1; + continue; + } + + /* check for multiple blocks/parts */ + if (f->n_blocks == 0) { + /* check if first part of message */ + if (!llc_len) + llc_first_bsn = bsn; + + /* append data to buffer */ + memcpy(&llc_data[llc_len], f->data, f->len); + + llc_len += f->len; + + llc_last_bsn = bsn; + + /* last TBF block? (very rare condition) */ + if (f->last) { + printf("end of TBF\n"); + fflush(stdout); + print_pkt(llc_data, llc_len); + + net_send_llc(llc_data, llc_len, ul); + + /* reset all fragments */ + for (bsn2 = 0; bsn2 < 128; bsn2++) { + f = &t->frags[bsn2]; + f->len = 0; + f->n_blocks = 0; + } + + /* reset buffer state */ + llc_len = 0; + t->start_bsn = 0; + } + } else { + /* multiple data parts */ + li_off = 0; + for (unsigned i = 0; i < f->n_blocks; i++) { + printf("\nlime %d\n", i); + fflush(stdout); + l = &f->blocks[i]; + if (l->used) { + if (llc_len) { + // error! + printf("\nlime error!\n"); + fflush(stdout); + llc_len = 0; + } + } else { + if (!llc_len) + llc_first_bsn = bsn; + + /* append data to buffer */ + memcpy(&llc_data[llc_len], &f->data[li_off], l->li); + + llc_len += l->li; + + llc_last_bsn = bsn; + + if (!l->e || !l->m || (l->e && l->m)) { + /* message ends here */ + printf("end of message reached\n"); + fflush(stdout); + print_pkt(llc_data, llc_len); + + net_send_llc(llc_data, llc_len, ul); + + /* mark frags as used */ + l->used = 1; + if (llc_first_bsn != bsn) { + } + + + llc_len = 0; + if (!skip) + t->start_bsn = bsn; + } + } + + li_off += l->li; + } + + /* is spare data valid? */ + if (l->m) { + if (llc_len) { + printf("spare and buffer not empty!\n"); + print_pkt(llc_data, llc_len); + fflush(stdout); + } + if ((f->len > li_off) && (f->len-li_off < 65536)) { + memcpy(llc_data, &f->data[li_off], f->len-li_off); + llc_len = f->len - li_off; + llc_first_bsn = bsn; + llc_last_bsn = bsn; + t->start_bsn = bsn; + } + } + + } + } + + /* shift window if needed */ + if (((t->last_bsn - t->start_bsn) % 128) > 64) { + t->start_bsn = (t->last_bsn - 64) % 128; + printf("shifting window\n"); + fflush(stdout); + } +} + +void rlc_data_handler(struct gprs_message *gm) +{ + int ul, off, d_bsn; + uint8_t tfi, bsn, cv = 1, fbi = 0; + uint32_t d_same_bsn, d_last_bsn; + struct gprs_tbf *t, *t_prev; + struct gprs_frag *f; + struct gprs_lime *l; + + tfi = (gm->msg[1] & 0x3e) >> 1; + bsn = (gm->msg[2] & 0xfe) >> 1; + + /* get "end of TBF" according to direction */ + ul = !!(gm->arfcn & GSMTAP_ARFCN_F_UPLINK); + if (ul) { + cv = (gm->msg[0] & 0x3c) >> 2; + printf("TFI %d BSN %d CV %d ", tfi, bsn, cv); + } else { + fbi = (gm->msg[1] & 0x01); + printf("TFI %d BSN %d FBI %d ", tfi, bsn, fbi); + } + + /* get TBF descriptor for TFI,UL couple */ + t = &tbf_table[2 * tfi + ul]; + + d_same_bsn = (gm->fn - t->frags[bsn].fn) & 0xffffffff; + d_last_bsn = (gm->fn - t->frags[t->last_bsn].fn) & 0xffffffff; + d_bsn = (bsn - t->last_bsn) % 128; + + printf("\nfn_same_bsn %d fn_last_bsn %d delta_bsn %d old_len %d\n", + d_same_bsn, d_last_bsn, d_bsn, t->frags[bsn].len); + + /* new/old fragment decision */ + if (d_same_bsn > OLD_TIME) { + if (d_last_bsn > OLD_TIME) { + // new tbf is starting, close old one... + t_prev = &tbf_table[2 * ((tfi + 1) % 32) + ul]; + printf("clearing TBF %d, first %d last %d\n", (tfi + 1) % 32, t_prev->start_bsn, t_prev->last_bsn); + f = &t_prev->frags[t_prev->last_bsn]; + + // ...only if data is present + if (f->len) { + f->last = 1; + process_blocks(t_prev, ul); + } + + printf("new TBF, starting from %d\n", bsn); + t->start_bsn = 0; + t->last_bsn = bsn; + memset(t->frags, 0, 128 * sizeof(struct gprs_frag)); + } else { + // fresh frag, current tbf + if ((d_bsn >= 0) || (d_bsn < -64)) { + // new frag + t->last_bsn = bsn; + } else { + // out of sequence / duplicate + t->frags[bsn].fn = gm->fn; + printf("duplicate\n"); + fflush(stdout); + return; + } + } + } else { + if (d_last_bsn > OLD_TIME) { + printf("fucking error last_bsn!\n"); + fflush(stdout); + return; + } else { + // fresh frag, current tbf + if (d_bsn > 0) { + printf("fucking error d_bsn!\n"); + fflush(stdout); + return; + } else { + if (d_bsn < -64) { + // new frag + t->last_bsn = bsn; + } else { + // duplicate + t->frags[bsn].fn = gm->fn; + printf("duplicate2\n"); + fflush(stdout); + return; + } + } + } + } + + /* get fragment struct for current BSN */ + f = &t->frags[bsn]; + + /* scan for LI_M_E entries */ + off = 2; + f->n_blocks = 0; + while (!(gm->msg[off++] & 0x01)) { + l = &f->blocks[f->n_blocks++]; + l->li = (gm->msg[off] & 0xfc) >> 2; + l->m = (gm->msg[off] & 0x02) >> 1; + l->e = (gm->msg[off] & 0x01); + l->used = 0; + } + + /* end of TBF? */ + f->last = (!cv || fbi) ? 1 : 0; + + /* optional fields for uplink, indicated in TI and PI */ + if (ul) { + if (gm->msg[1] & 0x01) { + printf("TLLI 0x%.02x%.02x%.02x%.02x ", gm->msg[off], + gm->msg[off+1], gm->msg[off + 2], gm->msg[off + 3]); + off += 4; + } + if (gm->msg[1] & 0x40) { + printf("PFI %d ", gm->msg[off]); + off += 1; + } + } + + /* copy data part of message */ + f->len = gm->len - off; + f->fn = gm->fn; + memcpy(f->data, &gm->msg[off], f->len); + + process_blocks(t, ul); +} + +int rlc_type_handler(struct gprs_message *gm) +{ + int ret = 0; + switch((gm->msg[0] & 0xc0) >> 6) { + case 0: + /* data block */ + printf("TS %d ", gm->ts); + + switch(gm->len) { + case 23: + printf("CS1 "); + break; + case 33: + printf("CS2 "); + break; + case 39: + printf("CS3 "); + break; + case 53: + printf("CS4 "); + break; + default: + printf("unknown (M)CS "); + } + + printf((gm->arfcn & GSMTAP_ARFCN_F_UPLINK) ? "UL " : "DL "); + + net_send_rlcmac(gm->msg, gm->len, gm->ts, !!(gm->arfcn & GSMTAP_ARFCN_F_UPLINK)); + printf("DATA "); + rlc_data_handler(gm); + printf("\n"); + fflush(stdout); + break; + case 1: + case 2: + /* control block */ +// printf("RLC type: control block on TS %d (case %d)\n", gm->ts, (gm->msg[0] & 0xc0) >> 6); + net_send_rlcmac(gm->msg, gm->len, gm->ts, !!(gm->arfcn & GSMTAP_ARFCN_F_UPLINK)); + return 1; + case 3: + /* reserved */ + printf("RLC type: reserved\n"); + return 3; + + default: + printf("Unrecognized RLC type: %d\n", (gm->msg[0] & 0xc0) >> 6); + return -1; + } + return ret; +} + diff --git a/src/host/gprsdecode/rlcmac.h b/src/host/gprsdecode/rlcmac.h new file mode 100644 index 0000000..952fe02 --- /dev/null +++ b/src/host/gprsdecode/rlcmac.h @@ -0,0 +1,44 @@ +#pragma once + +#include + +#define OLD_TIME 2000 + +struct gprs_message { + uint16_t arfcn; + uint32_t fn; + uint8_t ts; + uint8_t rxl; + uint8_t snr; + uint8_t len; + uint8_t msg[53]; +}; + +struct gprs_lime { + uint8_t li:6, + m:1, + e:1; + uint8_t used; +} __attribute__ ((packed)); + +struct gprs_frag { + uint32_t fn; + uint8_t last; + uint8_t len; + uint8_t data[53]; + uint8_t n_blocks; + struct gprs_lime blocks[20]; +} __attribute__ ((packed)); + +struct gprs_tbf { + uint8_t last_bsn; // for windowing + uint8_t start_bsn; // first block of current message + struct gprs_frag frags[128]; +} __attribute__ ((packed)); + +static struct gprs_tbf tbf_table[32 * 2]; // for one cell + +void print_pkt(uint8_t *msg, unsigned len); +void process_blocks(struct gprs_tbf *t, int ul); +void rlc_data_handler(struct gprs_message *gm); +int rlc_type_handler(struct gprs_message *gm); -- To view, visit https://gerrit.osmocom.org/5992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I12234d37c66b83b8abd60f7511fa1d7837db1856 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:20:40 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 17:20:40 +0000 Subject: [PATCH] osmo-mgw[master]: client: add an optional FSM interface In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5881 to look at the new patch set (#5). client: add an optional FSM interface the client API is not very intuitive and requires a lot of extra care when it is used from an osmo-fsm. - Add an FSM that permits comfortable handling of an MGCP connection. Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 --- M include/Makefile.am A include/osmocom/mgcp_client/mgcp_client_fsm.h M include/osmocom/mgcp_client/mgcp_client_internal.h M src/libosmo-mgcp-client/Makefile.am A src/libosmo-mgcp-client/mgcp_client_fsm.c 5 files changed, 654 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/81/5881/5 diff --git a/include/Makefile.am b/include/Makefile.am index b52e5ea..e8fc211 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -7,6 +7,7 @@ osmocom/legacy_mgcp/mgcp_internal.h \ osmocom/legacy_mgcp/osmux.h \ osmocom/mgcp_client/mgcp_client.h \ + osmocom/mgcp_client/mgcp_client_fsm.h \ osmocom/mgcp_client/mgcp_common.h \ osmocom/mgcp/mgcp.h \ osmocom/mgcp/mgcp_common.h \ diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h new file mode 100644 index 0000000..a9ee876 --- /dev/null +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -0,0 +1,28 @@ +#pragma once + +#include +#include +#include + +/*! Connection information. This struct organizes the connection infromation + * one connection side (either remote or local). It is used to pass parameters + * (local) to the FSM and get responses (remote) from the FSM as pointer + * attached to the FSM event */ +struct mgcp_conn_info { + /*!< RTP connection IP-Address (optional, string e.g. "127.0.0.1") */ + char addr[INET_ADDRSTRLEN]; + + /*!< RTP connection IP-Port (optional) */ + uint16_t port; + + /*!< RTP endpoint */ + char endpoint[MGCP_ENDPOINT_MAXLEN]; + + /*!< CALL ID (unique per call) */ + unsigned int call_id; +}; + +struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, uint32_t parent_term_evt, + uint32_t parent_evt, struct mgcp_conn_info *conn_info); +int mgcp_conn_modify(struct osmo_fsm_inst *fi, uint32_t parent_evt, struct mgcp_conn_info *conn_info); +void mgcp_conn_delete(struct osmo_fsm_inst *fi); diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 690a4af..a2b330e 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -28,8 +28,6 @@ int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg); -struct mgcp_response_pending * mgcp_client_pending_add( - struct mgcp_client *mgcp, - mgcp_trans_id_t trans_id, - mgcp_response_cb_t response_cb, - void *priv); +struct mgcp_response_pending *mgcp_client_pending_add(struct mgcp_client *mgcp, + mgcp_trans_id_t trans_id, + mgcp_response_cb_t response_cb, void *priv); diff --git a/src/libosmo-mgcp-client/Makefile.am b/src/libosmo-mgcp-client/Makefile.am index 1e4e764..a3a920b 100644 --- a/src/libosmo-mgcp-client/Makefile.am +++ b/src/libosmo-mgcp-client/Makefile.am @@ -29,6 +29,7 @@ libosmo_mgcp_client_la_SOURCES = \ mgcp_client.c \ mgcp_client_vty.c \ + mgcp_client_fsm.c \ $(NULL) libosmo_mgcp_client_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(MGCP_CLIENT_LIBVERSION) diff --git a/src/libosmo-mgcp-client/mgcp_client_fsm.c b/src/libosmo-mgcp-client/mgcp_client_fsm.c new file mode 100644 index 0000000..cc65855 --- /dev/null +++ b/src/libosmo-mgcp-client/mgcp_client_fsm.c @@ -0,0 +1,621 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include + +/* Context information, this is attached to the priv pointer of the FSM and + * is also handed back when dispatcheing events to the parent FSM. This is + * purly intened and not meant to be accessible for the API user */ +struct mgcp_ctx { + /* MGCP client instance that is used to interact with the MGW */ + struct mgcp_client *mgcp; + + /* The ID of the last pending transaction. This is used internally + * to cancel the transaction in case of an error */ + mgcp_trans_id_t mgw_pending_trans; + + /* Flag to mark that there is a pending transaction */ + bool mgw_trans_pending; + + /* Connection ID which has been assigned by he MGW */ + char conn_id[MGCP_CONN_ID_LENGTH]; + + /* Local RTP connection info, the MGW will send outgoing traffic to the + * ip/port specified here. The Address does not have to be choosen right + * on the creation of a connection. It can always be modified later by + * the user. */ + struct mgcp_conn_info conn_info_local; + + /* Remote RTP connection info, the ip/port specified here is the address + * where the MGW expects the RTP data to be sent. This address is + * defined by soly by the MGW and can not be influenced by the user. */ + struct mgcp_conn_info conn_info_remote; + + /* The terminate flag is a way to handle cornercase sitations that + * might occur when the user runs into an error situation and sends + * a DLCX command while the FSM is waiting for a response. In this + * case the DLCX command is not executed immediately. Instead the + * terminate flag is set. When the response to from the previous + * operation is received, we know that there is a DLCX event is + * pending. The FSM then generates the EV_DLCX by itsself before + * it enters ST_READY to cause the immediate execution of the + * DLCX procedure. (If normal operations are executed too fast, + * the API functions will return an error. In general, the user + * should synchronize using the callback events) */ + bool terminate; + + /* Event that is sent when the current operation is completed (except + * for DLCX, there the specified parent_term_evt is sent instead) */ + uint32_t parent_evt; +}; + +#define S(x) (1 << (x)) + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 + +enum fsm_bsc_mgcp_states { + ST_CRCX, + ST_CRCX_RESP, + ST_READY, + ST_MDCX_RESP, + ST_DLCX_RESP, +}; + +enum bsc_mgcp_fsm_evt { + EV_CRCX, + EV_CRCX_RESP, + EV_MDCX, + EV_MDCX_RESP, + EV_DLCX, + EV_DLCX_RESP, +}; + +struct msgb *make_crcx_msg_bind(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->conn_info_local.call_id, + .conn_mode = MGCP_CONN_LOOPBACK, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_local.endpoint, MGCP_ENDPOINT_MAXLEN); + + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +struct msgb *make_crcx_msg_bind_connect(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX,.presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->conn_info_local.call_id, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = mgcp_ctx->conn_info_local.addr, + .audio_port = mgcp_ctx->conn_info_local.port, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_local.endpoint, MGCP_ENDPOINT_MAXLEN); + + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +struct msgb *make_mdcx_msg(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->conn_info_remote.call_id, + .conn_id = mgcp_ctx->conn_id, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = mgcp_ctx->conn_info_local.addr, + .audio_port = mgcp_ctx->conn_info_local.port, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_remote.endpoint, MGCP_ENDPOINT_MAXLEN); + + /* Note: We take the endpoint and the call_id from the remote + * connection info, because we can be confident that the + * information there is valid. For the local info, we explicitly + * allow endpoint and call_id to be optional */ + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +struct msgb *make_dlcx_msg(struct mgcp_ctx *mgcp_ctx) +{ + struct mgcp_msg mgcp_msg; + + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID), + .call_id = mgcp_ctx->conn_info_remote.call_id, + .conn_id = mgcp_ctx->conn_id, + }; + osmo_strlcpy(mgcp_msg.endpoint, mgcp_ctx->conn_info_remote.endpoint, MGCP_ENDPOINT_MAXLEN); + + return mgcp_msg_gen(mgcp_ctx->mgcp, &mgcp_msg); +} + +static void mgw_crcx_resp_cb(struct mgcp_response *r, void *priv); + +static void fsm_crcx_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_CRCX: + LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: creating connection on MGW endpoint:%s...\n", + mgcp_ctx->conn_info_local.endpoint); + + if (mgcp_ctx->conn_info_local.port) + msg = make_crcx_msg_bind_connect(mgcp_ctx); + else + msg = make_crcx_msg_bind(mgcp_ctx); + OSMO_ASSERT(msg); + + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + mgcp_ctx->mgw_trans_pending = true; + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_resp_cb, fi); + if (rc < 0) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_RESP, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static void mgw_crcx_resp_cb(struct mgcp_response *r, void *priv) +{ + struct osmo_fsm_inst *fi = priv; + struct mgcp_ctx *mgcp_ctx; + int rc; + + OSMO_ASSERT(fi); + mgcp_ctx = fi->priv; + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->mgw_trans_pending = false; + + if (r->head.response_code != 200) { + LOGPFSML(fi, LOGL_ERROR, + "MGW/CRCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_strlcpy(mgcp_ctx->conn_id, r->head.conn_id, sizeof(mgcp_ctx->conn_id)); + LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: MGW responded with CI: %s\n", mgcp_ctx->conn_id); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, "MGW/CRCX: Cannot parse CRCX response\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + LOGPFSML(fi, LOGL_DEBUG, "MGW/CRCX: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + osmo_strlcpy(mgcp_ctx->conn_info_remote.addr, r->audio_ip, sizeof(mgcp_ctx->conn_info_remote.addr)); + mgcp_ctx->conn_info_remote.port = r->audio_port; + osmo_strlcpy(mgcp_ctx->conn_info_remote.endpoint, r->head.endpoint, + sizeof(mgcp_ctx->conn_info_remote.endpoint)); + mgcp_ctx->conn_info_remote.call_id = mgcp_ctx->conn_info_local.call_id; + + osmo_fsm_inst_dispatch(fi, EV_CRCX_RESP, mgcp_ctx); +} + +static void fsm_crcx_resp_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_CRCX_RESP: + osmo_fsm_inst_state_chg(fi, ST_READY, 0, 0); + if (mgcp_ctx->terminate) { + /* Trigger immediate DLCX if DLCX was requested while the FSM was + * busy with the previous operation */ + LOGPFSML(fi, LOGL_ERROR, "MGW/CRCX: FSM was busy while DLCX was requested, executing now...\n"); + osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); + } else + osmo_fsm_inst_dispatch(fi->proc.parent, mgcp_ctx->parent_evt, &mgcp_ctx->conn_info_remote); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static void mgw_mdcx_resp_cb(struct mgcp_response *r, void *priv); +static void mgw_dlcx_resp_cb(struct mgcp_response *r, void *priv); + +static void fsm_ready_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct msgb *msg; + struct mgcp_client *mgcp; + uint32_t new_state; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_MDCX: + msg = make_mdcx_msg(mgcp_ctx); + OSMO_ASSERT(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_resp_cb, fi); + new_state = ST_MDCX_RESP; + break; + case EV_DLCX: + msg = make_dlcx_msg(mgcp_ctx); + OSMO_ASSERT(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_dlcx_resp_cb, fi); + new_state = ST_DLCX_RESP; + break; + default: + OSMO_ASSERT(false); + break; + } + + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + mgcp_ctx->mgw_trans_pending = true; + + if (rc < 0) { + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_fsm_inst_state_chg(fi, new_state, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +static void mgw_mdcx_resp_cb(struct mgcp_response *r, void *priv) +{ + struct osmo_fsm_inst *fi = priv; + struct mgcp_ctx *mgcp_ctx; + int rc; + + OSMO_ASSERT(fi); + mgcp_ctx = fi->priv; + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->mgw_trans_pending = false; + + if (r->head.response_code != 200) { + LOGPFSML(fi, LOGL_ERROR, "MGW/MDCX: response yields error: %d %s\n", r->head.response_code, + r->head.comment); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(fi, LOGL_ERROR, "MGW/MDCX: Cannot parse MDCX response\n"); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + LOGPFSML(fi, LOGL_DEBUG, "MGW/MDCX: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + osmo_strlcpy(mgcp_ctx->conn_info_remote.addr, r->audio_ip, sizeof(mgcp_ctx->conn_info_remote.addr)); + mgcp_ctx->conn_info_remote.port = r->audio_port; + + osmo_fsm_inst_dispatch(fi, EV_MDCX_RESP, mgcp_ctx); +} + +static void fsm_mdcx_resp_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_MDCX_RESP: + osmo_fsm_inst_state_chg(fi, ST_READY, 0, 0); + if (mgcp_ctx->terminate) { + /* Trigger immediate DLCX if DLCX was requested while the FSM was + * busy with the previous operation */ + LOGPFSML(fi, LOGL_ERROR, "MGW/MDCX: FSM was busy while DLCX was requested, executing now...\n"); + osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); + } else + osmo_fsm_inst_dispatch(fi->proc.parent, mgcp_ctx->parent_evt, &mgcp_ctx->conn_info_remote); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static void mgw_dlcx_resp_cb(struct mgcp_response *r, void *priv) +{ + struct osmo_fsm_inst *fi = priv; + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(fi); + mgcp_ctx = fi->priv; + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->mgw_trans_pending = false; + + if (r->head.response_code != 250) { + LOGPFSML(fi, LOGL_ERROR, + "MGW/DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_ERROR, NULL); + return; + } + + osmo_fsm_inst_dispatch(fi, EV_DLCX_RESP, mgcp_ctx); +} + +static void fsm_dlcx_resp_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_DLCX_RESP: + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + break; + default: + OSMO_ASSERT(false); + break; + } +} + +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* Note: We were unable to communicate with the MGW, + * unfortunately there is no meaningful action we can take + * now other than giving up. */ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); + } else { + /* Note: Ther must not be any unsolicited timers + * in this FSM. If so, we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static void fsm_cleanup_cb(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (mgcp_ctx->mgw_trans_pending) + mgcp_client_cancel(mgcp, mgcp_ctx->mgw_pending_trans); + + talloc_free(mgcp_ctx); +} + +static struct osmo_fsm_state fsm_mgcp_client_states[] = { + + /* Initial CRCX state. This state is immediately entered and executed + * when the FSM is started. The rationale is that we first have to + * create a connectin before we can execute other operations on that + * connection. */ + [ST_CRCX] = { + .in_event_mask = S(EV_CRCX), + .out_state_mask = S(ST_CRCX_RESP), + .name = OSMO_STRINGIFY(ST_CRCX), + .action = fsm_crcx_cb, + }, + + /* Wait for the response to a CRCX operation, check and process the + * results, change to ST_READY afterwards. */ + [ST_CRCX_RESP] = { + .in_event_mask = S(EV_CRCX_RESP), + .out_state_mask = S(ST_READY), + .name = OSMO_STRINGIFY(ST_CRCX_RESP), + .action = fsm_crcx_resp_cb, + }, + + /* In this idle state we wait for further operations (e.g. MDCX) that + * can be executed by the user using the API. There is no timeout in + * this state. The connection lives on until the user decides to + * terminate it (DLCX). */ + [ST_READY] = { + .in_event_mask = S(EV_MDCX) | S(EV_DLCX), + .out_state_mask = S(ST_MDCX_RESP) | S(ST_DLCX_RESP), + .name = OSMO_STRINGIFY(ST_READY), + .action = fsm_ready_cb, + }, + + /* Wait for the response of a MDCX operation, check and process the + * results, change to ST_READY afterwards. */ + [ST_MDCX_RESP] = { + .in_event_mask = S(EV_MDCX_RESP), + .out_state_mask = S(ST_READY), + .name = OSMO_STRINGIFY(ST_MDCX_RESP), + .action = fsm_mdcx_resp_cb, + }, + + /* Wait for the response of a DLCX operation and terminate the FSM + * normally. */ + [ST_DLCX_RESP] = { + .in_event_mask = S(EV_DLCX_RESP), + .out_state_mask = 0, + .name = OSMO_STRINGIFY(ST_DLCX_RESP), + .action = fsm_dlcx_resp_cb, + }, +}; + +static struct osmo_fsm fsm_mgcp_client = { + .name = "MGCP_CLIENT", + .states = fsm_mgcp_client_states, + .num_states = ARRAY_SIZE(fsm_mgcp_client_states), + .timer_cb = fsm_timeout_cb, + .cleanup = fsm_cleanup_cb, +}; + +/*! allocate FSM, and create a new connection on the MGW. + * \param[in] mgcp MGCP client descriptor. + * \param[in] mgcpparent_fi Parent FSM instance. + * \param[in] parent_term_evt Event to be sent to parent when terminating. + * \param[in] parent_evt Event to be sent to parent when operation is done. + * \param[in] conn_info Connection parameters (ip, port...). + * \returns newly-allocated, initialized and registered FSM instance, NULL on error. */ +struct osmo_fsm_inst *mgcp_conn_create(struct mgcp_client *mgcp, struct osmo_fsm_inst *parent_fi, + uint32_t parent_term_evt, uint32_t parent_evt, struct mgcp_conn_info *conn_info) +{ + struct mgcp_ctx *mgcp_ctx; + static bool fsm_registered = false; + struct osmo_fsm_inst *fi; + struct in_addr ip_test; + + OSMO_ASSERT(parent_fi); + OSMO_ASSERT(mgcp); + OSMO_ASSERT(conn_info); + + /* Check if IP/Port informstaion in conn info makes sense */ + if (conn_info->port && inet_aton(conn_info->addr, &ip_test) == 0) + return NULL; + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_mgcp_client); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + fi = osmo_fsm_inst_alloc_child(&fsm_mgcp_client, parent_fi, parent_term_evt); + OSMO_ASSERT(fi); + mgcp_ctx = talloc_zero(fi, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->parent_evt = parent_evt; + + memcpy(&mgcp_ctx->conn_info_local, conn_info, sizeof(mgcp_ctx->conn_info_local)); + fi->priv = mgcp_ctx; + + /* start state machine */ + OSMO_ASSERT(fi->state == ST_CRCX); + osmo_fsm_inst_dispatch(fi, EV_CRCX, mgcp_ctx); + + return fi; +} + +/*! modify an existing connection on the MGW. + * \param[in] fi FSM instance. + * \param[in] parent_evt Event to be sent to parent when operation is done. + * \param[in] conn_info New connection information (ip, port...). + * \returns 0 on success, -EINVAL on error. */ +int mgcp_conn_modify(struct osmo_fsm_inst *fi, uint32_t parent_evt, struct mgcp_conn_info *conn_info) +{ + OSMO_ASSERT(fi); + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct in_addr ip_test; + + OSMO_ASSERT(mgcp_ctx); + OSMO_ASSERT(conn_info); + + /* The user must not issue an MDCX before the CRCX has completed, + * if this happens, it means that the parent FSM has overhead the + * parent_evt (mandatory!) and executed the MDCX without even + * waiting for the results. Another reason could be that the + * parent FSM got messed up */ + OSMO_ASSERT(fi->state != ST_CRCX_RESP); + + /* If the user tries to issue an MDCX while an DLCX operation is + * pending, there must be a serious problem with the paren FSM. + * Eeither the parent_term_evt (mandatory!) has been overheard, + * or the parant FSM got messed so badly that it still assumes + * a live connection although it as killed it. */ + OSMO_ASSERT(fi->state != ST_DLCX_RESP); + + /* Check if IP/Port parameters make sense */ + if (conn_info->port == 0) + return -EINVAL; + if (inet_aton(conn_info->addr, &ip_test) == 0) + return -EINVAL; + + /* The user may supply an endpoint identifier that is then checked + * here. This check is optional. Later steps do not depend on the + * endpoint identifier supplied here */ + if (strlen(conn_info->endpoint) && strcmp(conn_info->endpoint, mgcp_ctx->conn_info_remote.endpoint)) + return -EINVAL; + + /* Note: The call-id is implicitly known from the previoes CRCX and + * will not be checked even when it is set here. */ + + mgcp_ctx->parent_evt = parent_evt; + memcpy(&mgcp_ctx->conn_info_local, conn_info, sizeof(mgcp_ctx->conn_info_local)); + osmo_fsm_inst_dispatch(fi, EV_MDCX, mgcp_ctx); + return 0; +} + +/*! delete existing connection on the MGW, destroy FSM afterwards. + * \param[in] fi FSM instance. */ +void mgcp_conn_delete(struct osmo_fsm_inst *fi) +{ + OSMO_ASSERT(fi); + struct mgcp_ctx *mgcp_ctx = fi->priv; + + OSMO_ASSERT(mgcp_ctx); + + /* Unlink FSM from parent */ + osmo_fsm_inst_unlink_parent(fi, NULL); + + /* An error situation where the parent FSM must be killed immediately + * may lead into a situation where the DLCX can not be executed right + * at that moment because the FSM is still busy with another operation. + * In those cases we postpone the DLCX so that the FSM and the + * connections on the MGW get cleaned up gracefully. */ + if (fi->state != ST_READY) { + LOGPFSML(fi, LOGL_ERROR, "MGW: operation still pending, DLCX will be postponed.\n"); + mgcp_ctx->terminate = true; + return; + } + osmo_fsm_inst_dispatch(fi, EV_DLCX, mgcp_ctx); +} -- To view, visit https://gerrit.osmocom.org/5881 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I887ce0c15a831dffeb6251a975337b83942af566 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw 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 Mon Jan 22 17:20:42 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 17:20:42 +0000 Subject: [PATCH] osmo-mgw[master]: client: make callid in MDCX mandatory Message-ID: Review at https://gerrit.osmocom.org/5993 client: make callid in MDCX mandatory An MDCX without call-id does not make much sense. The call-id is an integral element of the MDCX message to ensure that the correct call is modified. - update the presence check bitmasks to mark the call-id field mandatory for MDCX requests Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/93/5993/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index f094a09..135aed0 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -728,6 +728,7 @@ MGCP_MSG_PRESENCE_CALL_ID | \ MGCP_MSG_PRESENCE_CONN_MODE) #define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ MGCP_MSG_PRESENCE_CONN_ID) #define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) #define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) -- To view, visit https://gerrit.osmocom.org/5993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:20:42 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 22 Jan 2018 17:20:42 +0000 Subject: [PATCH] osmo-mgw[master]: client: add missing mandatory SDP fields Message-ID: Review at https://gerrit.osmocom.org/5994 client: add missing mandatory SDP fields The mcgp message generator function mgcp_msg_gen() lacks support for the mandatory SDP fields (v)ersion, (o)rigin, (s)ession and (t)ime. - Automatically generate the missing fields when SDP is generated. Change-Id: I5fbc31a17e8ac10c7cc5dbc31357b61e8920aaa5 Related: OS#2837 --- M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.ok 2 files changed, 32 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/94/5994/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 135aed0..116baf3 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -740,6 +740,7 @@ uint32_t mandatory_mask; struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); int rc = 0; + char local_ip[INET_ADDRSTRLEN]; msg->l2h = msg->data; msg->cb[MSGB_CB_MGCP_TRANS_ID] = trans_id; @@ -820,9 +821,32 @@ msgb_printf(msg, "M: %s\r\n", mgcp_client_cmode_name(mgcp_msg->conn_mode)); - /* Add RTP address and port (SDP) */ + /* Add SDP body */ if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + + /* Add separator to mark the beginning of the SDP block */ + rc += msgb_printf(msg, "\r\n"); + + /* Add SDP protocol version */ + rc += msgb_printf(msg, "v=0\r\n"); + + /* Add session name (none) */ + rc += msgb_printf(msg, "s=-\r\n"); + + /* Determine local IP-Address */ + if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) < 0) { + LOGP(DLMGCP, LOGL_ERROR, + "Could not determine local IP-Address!\n"); + msgb_free(msg); + return NULL; + } + + /* Add owner/creator (SDP) */ + rc += msgb_printf(msg, "o=- %x 23 IN IP4 %s\r\n", + mgcp_msg->call_id, local_ip); + + /* Add RTP address and port */ if (mgcp_msg->audio_port == 0) { LOGP(DLMGCP, LOGL_ERROR, "Invalid port number, can not generate MGCP message\n"); @@ -835,11 +859,13 @@ msgb_free(msg); return NULL; } - rc += msgb_printf(msg, "\r\n"); rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); rc += msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", mgcp_msg->audio_port); + + /* Add time description, active time (SDP) */ + rc += msgb_printf(msg, "t=0 0\r\n"); } if (rc != 0) { diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 4039bb0..00c7f7c 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -43,8 +43,12 @@ I: 11 M: sendrecv +v=0 +s=- +o=- 2f 23 IN IP4 127.0.0.1 c=IN IP4 192.168.100.23 m=audio 1234 RTP/AVP 255 +t=0 0 Generated DLCX message: DLCX 3 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/5994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5fbc31a17e8ac10c7cc5dbc31357b61e8920aaa5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:29:28 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 17:29:28 +0000 Subject: [PATCH] osmo-msc[master]: Fix value of stored SMS validity time. Message-ID: Review at https://gerrit.osmocom.org/5995 Fix value of stored SMS validity time. Quote the argument to sqlite's datetime(). Otherwise, the timestamp stored in the database reads back as a negative value for some reason. Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a --- M src/libmsc/db.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/5995/1 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4bf9b1f..b48d137 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -711,7 +711,7 @@ "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " - "(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), " + "(datetime('%lld', 'unixepoch'), datetime('%lld', 'unixepoch'), " "%u, %u, %u, " "%u, %u, %u, " "%u, " -- To view, visit https://gerrit.osmocom.org/5995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:39:52 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 17:39:52 +0000 Subject: [PATCH] osmo-msc[master]: Fix value of stored SMS validity time. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5995 to look at the new patch set (#2). Fix value of stored SMS validity time. Quote the argument to sqlite's datetime(). Otherwise, the timestamp stored in the database reads back as a negative value for some reason. Before: 1032 validity_timestamp = dbi_result_get_datetime(result, "valid_until"); (gdb) p validity_timestamp $2 = -1516814654 After: 1032 validity_timestamp = dbi_result_get_datetime(result, "valid_until"); (gdb) p validity_timestamp $2 = 1516814654 Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a --- M src/libmsc/db.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/95/5995/2 diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4bf9b1f..b48d137 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -711,7 +711,7 @@ "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " - "(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), " + "(datetime('%lld', 'unixepoch'), datetime('%lld', 'unixepoch'), " "%u, %u, %u, " "%u, %u, %u, " "%u, " -- To view, visit https://gerrit.osmocom.org/5995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:40:55 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 17:40:55 +0000 Subject: [PATCH] osmo-msc[master]: Delete expired SMS automatically. Message-ID: Review at https://gerrit.osmocom.org/5996 Delete expired SMS automatically. Delete expired SMS whenever we are done processing an SMS-related signal. In order to minimize additional latency only one SMS is removed at a time. Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Depends: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Related: OS#2354 --- M include/osmocom/msc/db.h M src/libmsc/db.c M src/libmsc/sms_queue.c 3 files changed, 48 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/5996/1 diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 2105d38..a1de7d6 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -51,6 +51,7 @@ int db_sms_delete_by_msisdn(const char *msisdn); int db_sms_delete_sent_message_by_id(unsigned long long sms_id); int db_sms_delete_expired_message_by_id(unsigned long long sms_id); +void db_sms_delete_oldest_expired_message(void); /* Statistics counter storage */ struct osmo_counter; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ccd659e..972bc5f 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -989,22 +989,11 @@ return 0; } -int db_sms_delete_expired_message_by_id(unsigned long long sms_id) + +static int delete_expired_sms(unsigned long long sms_id, time_t created, time_t validity_timestamp) { dbi_result result; - time_t created, validity_timestamp, now, min_created; - - result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); - if (!result) - return -1; - if (!next_row(result)) { - dbi_result_free(result); - return -1; - } - - created = dbi_result_get_datetime(result, "created"); - validity_timestamp = dbi_result_get_datetime(result, "valid_until"); - dbi_result_free(result); + time_t now, min_created; now = time(NULL); if (validity_timestamp > now) @@ -1026,6 +1015,47 @@ return 0; } +int db_sms_delete_expired_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + time_t created, validity_timestamp; + + result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + if (!result) + return -1; + if (!next_row(result)) { + dbi_result_free(result); + return -1; + } + + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + + dbi_result_free(result); + return delete_expired_sms(sms_id, created, validity_timestamp); +} + +void db_sms_delete_oldest_expired_message(void) +{ + dbi_result result; + + result = dbi_conn_queryf(conn, "SELECT id,created,valid_until FROM SMS ORDER BY created LIMIT 1"); + if (!result) + return; + + if (next_row(result)) { + unsigned long long sms_id; + time_t created, validity_timestamp; + + sms_id = dbi_result_get_ulonglong(result, "id"); + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + delete_expired_sms(sms_id, created, validity_timestamp); + } + + dbi_result_free(result); +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 8cc9eb3..6db8ba9 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -530,6 +530,9 @@ sig_sms->paging_result); } + /* While here, attempt to remove an expired SMS from the DB. */ + db_sms_delete_oldest_expired_message(); + return 0; } -- To view, visit https://gerrit.osmocom.org/5996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:42:07 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 17:42:07 +0000 Subject: [PATCH] osmo-msc[master]: Delete expired SMS automatically. In-Reply-To: References: Message-ID: Delete expired SMS automatically. Delete expired SMS whenever we are done processing an SMS-related signal. In order to minimize additional latency only one SMS is removed at a time. Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Related: OS#2354 --- M include/osmocom/msc/db.h M src/libmsc/db.c M src/libmsc/sms_queue.c 3 files changed, 48 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/96/5996/2 diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 2105d38..a1de7d6 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -51,6 +51,7 @@ int db_sms_delete_by_msisdn(const char *msisdn); int db_sms_delete_sent_message_by_id(unsigned long long sms_id); int db_sms_delete_expired_message_by_id(unsigned long long sms_id); +void db_sms_delete_oldest_expired_message(void); /* Statistics counter storage */ struct osmo_counter; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index ccd659e..972bc5f 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -989,22 +989,11 @@ return 0; } -int db_sms_delete_expired_message_by_id(unsigned long long sms_id) + +static int delete_expired_sms(unsigned long long sms_id, time_t created, time_t validity_timestamp) { dbi_result result; - time_t created, validity_timestamp, now, min_created; - - result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); - if (!result) - return -1; - if (!next_row(result)) { - dbi_result_free(result); - return -1; - } - - created = dbi_result_get_datetime(result, "created"); - validity_timestamp = dbi_result_get_datetime(result, "valid_until"); - dbi_result_free(result); + time_t now, min_created; now = time(NULL); if (validity_timestamp > now) @@ -1026,6 +1015,47 @@ return 0; } +int db_sms_delete_expired_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + time_t created, validity_timestamp; + + result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + if (!result) + return -1; + if (!next_row(result)) { + dbi_result_free(result); + return -1; + } + + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + + dbi_result_free(result); + return delete_expired_sms(sms_id, created, validity_timestamp); +} + +void db_sms_delete_oldest_expired_message(void) +{ + dbi_result result; + + result = dbi_conn_queryf(conn, "SELECT id,created,valid_until FROM SMS ORDER BY created LIMIT 1"); + if (!result) + return; + + if (next_row(result)) { + unsigned long long sms_id; + time_t created, validity_timestamp; + + sms_id = dbi_result_get_ulonglong(result, "id"); + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + delete_expired_sms(sms_id, created, validity_timestamp); + } + + dbi_result_free(result); +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 8cc9eb3..6db8ba9 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -530,6 +530,9 @@ sig_sms->paging_result); } + /* While here, attempt to remove an expired SMS from the DB. */ + db_sms_delete_oldest_expired_message(); + return 0; } -- To view, visit https://gerrit.osmocom.org/5996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:42:07 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Mon, 22 Jan 2018 17:42:07 +0000 Subject: [PATCH] osmo-msc[master]: Accept SMS for any receiver Message-ID: Review at https://gerrit.osmocom.org/5997 Accept SMS for any receiver Accept any SMS and store it in the database, even if the receiver of the message cannot be determined when the message arrives at the MSC. This fixes https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Depends: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Depends: I56cbe716e52b679c4b94f6cbb4a171306975be2e Depends: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Related: OS#2354 --- M src/libmsc/gsm_04_11.c 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/97/5997/1 diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 50242a6..e921f33 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -521,9 +521,10 @@ rc = sms_route_mt_sms(conn, gsms); - /* This SMS got routed through SMPP or no receiver exists. */ - if (!gsms->receiver) - return rc; + /* + * This SMS got routed through SMPP or no receiver exists. + * In any case, we store it in the database for further processing. + */ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 22 17:49:43 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 22 Jan 2018 17:49:43 +0000 Subject: osmocom-bb[master]: Import gprsdecode utility In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (24 comments) Regarding to the gprs_* files, i.e. samples and decoding references, I would prefer to keep them in a separate directory, for example, called 'samples' or 'test', since they only used for testing. Regarding to the CRC code, may we use the code from libosmocore? Probably, we don't need CRC-related code here, because the most part of 'gprs.c' could be rewritten to use the libosmocoding API. You only need to collect a few bursts in buffer, and call a proper *_decode function, which would return L2 payload. Please see my comments. Lots of them are mostly related to the Osmocom coding style... https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/Makefile File src/host/gprsdecode/Makefile: Line 15 I think, it would be better to use automake here. https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/README File src/host/gprsdecode/README: Line 3: Based on the version from https://srlabs.de/gprs/ Let's add a minimalistic description and usage examples here? Example: http://git.osmocom.org/osmocom-bb/tree/src/target/fake_trx/README?h=fixeria/trx This link is broken :( I think it would be enough to only mention SRLabs as the authors, and you as the patch customizer / integrator, e.g. customized by... And BTW: what about the license? https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/burst_desc.h File src/host/gprsdecode/burst_desc.h: PS1, Line 7: #define BI_FLG_DUMMY (1<<4) : #define BI_FLG_SACCH (1<<5) : : struct l1ctl_burst_ind { : uint32_t frame_nr; : uint16_t band_arfcn; /* ARFCN + band + ul indicator */ : uint8_t chan_nr; /* GSM 08.58 channel number (9.3.1) */ : uint8_t flags; /* BI_FLG_xxx + burst_id = 2LSBs */ : uint8_t rx_level; /* 0 .. 63 in typical GSM notation (dBm+110) */ : uint8_t snr; /* Reported SNR >> 8 (0-255) */ : uint8_t bits[15]; /* 114 bits + 2 steal bits. Filled MSB first */ : } __attribute__((packed)); This part should be migrated to the l1ctl_proto.h. https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/crc.c File src/host/gprsdecode/crc.c: Line 2: * Code imported from GNURadio, GSMSTACK and Linux Kernel. The license header from crc.h shout be (also) here. Line 15: int FC_init(FC_CTX *ctx, unsigned int crc_size, unsigned int data_size) Return value is always zero => void is better.. Line 24: int FC_check_crc(FC_CTX *ctx, unsigned char *input_bits, unsigned char *control_data) Mix of spaces and tabs... Line 30: // reset the syndrome register Comment style /* ... */ is preferred. Line 80: } ... } else if { ... https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/crc.h File src/host/gprsdecode/crc.h: Line 24: #include Useless header... https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/gprs.c File src/host/gprsdecode/gprs.c: Line 43: return "LOL"; LOL :) Line 98: const uint8_t usf_pattern[][6] = {{0, 0, 0, 0, 0, 0}, Could be separated as a static symbol. Line 122: const uint8_t usf_pattern[][12] = {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, Also could be separated... PS1, Line 142: static inline void gsm0503_xcch_deinterleave(sbit_t *cB, sbit_t *iB) : { : int j, B; : : for (int k = 0; k < 456; k++) { : B = k & 3; : j = 2 * ((49 * k) % 57) + ((k & 7) >> 2); : cB[k] = iB[B * 114 + j]; : } : } Already in libosmocoding. PS1, Line 153: static inline int decode_signalling(const uint8_t *conv_data, uint8_t *msg) : { : uint8_t decoded_data[PARITY_OUTPUT_SIZE]; : int8_t soft_input[CONV_SIZE]; : : /* convert to soft bits */ : osmo_ubit2sbit(soft_input, conv_data, CONV_SIZE); : : /* Viterbi decoding */ : osmo_conv_decode(&gsm0503_xcch, soft_input, decoded_data); : : /* parity check: if error detected try to fix it */ : int ret = osmo_crc64gen_check_bits(&gsm0503_fire_crc40, decoded_data, 184, decoded_data + 184); : if (ret) { : FC_CTX fc_ctx; : FC_init(&fc_ctx, PARITY_SIZE, DATA_BLOCK_SIZE); : /**/ : unsigned char crc_result[DATA_BLOCK_SIZE + PARITY_SIZE]; : ret = FC_check_crc(&fc_ctx, decoded_data, crc_result); : if (!ret) : return 0; : /* : ubit_t crc_result[DATA_BLOCK_SIZE + PARITY_SIZE]; : osmo_crc64gen_set_bits(&gsm0503_fire_crc40, decoded_data, 184, crc_result); : */ : memcpy(decoded_data, crc_result, sizeof crc_result); : } : : osmo_ubit2pbit_ext(msg, 0, decoded_data, 0, DATA_BLOCK_SIZE, 1); : : return 23; : } Also looks like a code duplication, should be in libosmocoding. Line 186: int process_pdch(struct l1ctl_burst_ind *bi, bool print) The most part of this function could be rewritten to use the libosmocoding API, like OsmoBTS does. Reference: http://git.osmocom.org/libosmocore/tree/include/osmocom/coding/gsm0503_coding.h#n37 https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/gprs.h File src/host/gprsdecode/gprs.h: PS1, Line 13: #define DATA_BLOCK_SIZE 184 : #define PARITY_SIZE 40 : #define FLUSH_BITS_SIZE 4 : #define PARITY_OUTPUT_SIZE (DATA_BLOCK_SIZE + PARITY_SIZE + FLUSH_BITS_SIZE) : #define DEBUG_PRINT false : #define PREFER_MCS 0 : #define CONV_SIZE (2 * PARITY_OUTPUT_SIZE) : #define MAX_MCS 5 Tabs are welcome for alignment ;) PS1, Line 25: /* : * GSM PDTCH CS-2, CS-3, CS-4 parity : * : * g(x) = x^16 + x^12 + x^5 + 1 : */ : static const struct osmo_crc16gen_code gsm0503_cs234_crc16 = { : .bits = 16, : .poly = 0x1021, : .init = 0x0000, : .remainder = 0xffff, : }; : : /* : * 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 : */ : static const struct osmo_crc64gen_code gsm0503_fire_crc40 = { : .bits = 40, : .poly = 0x0004820009ULL, : .init = 0x0000000000ULL, : .remainder = 0xffffffffffULL, : }; Both are in libosmocore now. Line 60: struct burst_buf gprs[16]; WTF? Shouldn't be here. https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/main.c File src/host/gprsdecode/main.c: Line 6: #include Select API isn't used here. PS1, Line 26: /* printf("TS = %d, FN = %d (%d)\n", ts, fn, process_pdch(bi)); : else : printf("TS = %d, FN = %d [%d]\n", ts, fn, fn % 13); : */ Why this part is commented out? PS1, Line 30: case RSL_CHAN_Lm_ACCHs: : case RSL_CHAN_BCCH: : case RSL_CHAN_SDCCH4_ACCH: : case RSL_CHAN_SDCCH8_ACCH: : case RSL_CHAN_RACH: : case RSL_CHAN_PCH_AGCH: : default: : break; : //printf("Type not handled! %.02x\n", type); We are not interested in other than GPRS channels, right? So, we can merely skip them, putting only 'default' label. Line 64: ret = fread(&bi, sizeof(bi), 1, burst_fd); Would be great to put a error message here. Line 71: fflush(NULL); Why do we need this? https://gerrit.osmocom.org/#/c/5992/1/src/host/gprsdecode/output.c File src/host/gprsdecode/output.c: Line 64: while (osmo_select_main(1)); Shouldn't this be in main.c, like all other application do? -- To view, visit https://gerrit.osmocom.org/5992 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I12234d37c66b83b8abd60f7511fa1d7837db1856 Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: fixeria Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 22 20:31:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 20:31:19 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 20:32:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 20:32:07 +0000 Subject: osmo-msc[master]: Delete expired SMS automatically. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 22 20:33:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 22 Jan 2018 20:33:21 +0000 Subject: osmocom-bb[master]: Don't ignore top-level Makefile In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I19a8661b74ae0b28da51cf2e81f0ca40de76fcbd Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 07:11:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 07:11:14 +0000 Subject: [MERGED] osmocom-bb[master]: Don't ignore top-level Makefile In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Don't ignore top-level Makefile ...................................................................... Don't ignore top-level Makefile Move corresponding .gitignore entry inside virt-phy to avoid interfering with other subprojects still using hand-crafted Makefiles. Change-Id: I19a8661b74ae0b28da51cf2e81f0ca40de76fcbd --- M .gitignore M src/host/virt_phy/.gitignore 2 files changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 363f656..1a01c26 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,6 @@ *.o *.a Makefile.in -Makefile .deps build-target diff --git a/src/host/virt_phy/.gitignore b/src/host/virt_phy/.gitignore index 0d2eba0..b9a2ca7 100644 --- a/src/host/virt_phy/.gitignore +++ b/src/host/virt_phy/.gitignore @@ -1,3 +1,4 @@ +Makefile config.h config.h.in src/virtphy -- To view, visit https://gerrit.osmocom.org/5991 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I19a8661b74ae0b28da51cf2e81f0ca40de76fcbd Gerrit-PatchSet: 1 Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 07:26:47 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 23 Jan 2018 07:26:47 +0000 Subject: osmo-msc[master]: Delete expired SMS automatically. In-Reply-To: References: Message-ID: Patch Set 2: Just curious - have validity time calculation been fixed in mainline? I remember my patches for it have not been merged when i looked into it several months ago. -- To view, visit https://gerrit.osmocom.org/5996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 14:37:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 14:37:38 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: Shouldn't we be checking if we can find the subscriber in the VLR/HLR instead of blindly accepting? -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:09:21 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 15:09:21 +0000 Subject: [PATCH] osmo-iuh[master]: configure.ac: Enable -Wall flag Message-ID: Review at https://gerrit.osmocom.org/5998 configure.ac: Enable -Wall flag Change-Id: Ib05f7862081708d578d8f0302d926aab42897dc2 --- M configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/98/5998/1 diff --git a/configure.ac b/configure.ac index 2b8974f..dd1d75e 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,9 @@ CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" + AC_OUTPUT( libosmo-ranap.pc src/Makefile -- To view, visit https://gerrit.osmocom.org/5998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib05f7862081708d578d8f0302d926aab42897dc2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:26:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 15:26:05 +0000 Subject: [PATCH] pysim[master]: Revert "pySim-prog: ADM code can be longer 8 digits, it's im... Message-ID: Review at https://gerrit.osmocom.org/5999 Revert "pySim-prog: ADM code can be longer 8 digits, it's implementation specific." This reverts commit a51592e1807c1d13f88b32275aa4a8a77d7d3b40, which broke the use of ADM pins on sysmoUSIM-SJS1 (and possibly others?) The ADM pins have so far always been specified as ASCII decimal digits, i.e. something like "-a 53204025" gets translated to hex "3533323034303235" After the above patch this is broken and gets instead translated to "53204025ffffffff" in hex which obviously breaks. Let's revert back to the old behavior to make it work again. Change-Id: I3d68b7e09938a2fcb7a9a6a31048388cc3141f79 --- M pySim-prog.py 1 file changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/99/5999/1 diff --git a/pySim-prog.py b/pySim-prog.py index c08f43b..f27daf0 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -361,9 +361,10 @@ opc = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]) if opts.pin_adm is not None: - pin_adm = opts.pin_adm - if not re.match('^([0-9a-fA-F][0-9a-fA-F])+$', pin_adm): - raise ValueError('ADM pin needs to be in hex format (even number of hex digits)') + if len(opts.pin_adm) > 8: + raise ValueError("PIN-ADM needs to be <=8 digits") + pin_adm = ''.join(['%02x'%(ord(x)) for x in opts.pin_adm]) + pin_adm = rpad(pin_adm, 16) else: pin_adm = None -- To view, visit https://gerrit.osmocom.org/5999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d68b7e09938a2fcb7a9a6a31048388cc3141f79 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:27:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 15:27:39 +0000 Subject: pysim[master]: Revert "pySim-prog: ADM code can be longer 8 digits, it's im... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d68b7e09938a2fcb7a9a6a31048388cc3141f79 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:27:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 15:27:41 +0000 Subject: [MERGED] pysim[master]: Revert "pySim-prog: ADM code can be longer 8 digits, it's im... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Revert "pySim-prog: ADM code can be longer 8 digits, it's implementation specific." ...................................................................... Revert "pySim-prog: ADM code can be longer 8 digits, it's implementation specific." This reverts commit a51592e1807c1d13f88b32275aa4a8a77d7d3b40, which broke the use of ADM pins on sysmoUSIM-SJS1 (and possibly others?) The ADM pins have so far always been specified as ASCII decimal digits, i.e. something like "-a 53204025" gets translated to hex "3533323034303235" After the above patch this is broken and gets instead translated to "53204025ffffffff" in hex which obviously breaks. Let's revert back to the old behavior to make it work again. Change-Id: I3d68b7e09938a2fcb7a9a6a31048388cc3141f79 --- M pySim-prog.py 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/pySim-prog.py b/pySim-prog.py index c08f43b..f27daf0 100755 --- a/pySim-prog.py +++ b/pySim-prog.py @@ -361,9 +361,10 @@ opc = ''.join(['%02x' % random.randrange(0,256) for i in range(16)]) if opts.pin_adm is not None: - pin_adm = opts.pin_adm - if not re.match('^([0-9a-fA-F][0-9a-fA-F])+$', pin_adm): - raise ValueError('ADM pin needs to be in hex format (even number of hex digits)') + if len(opts.pin_adm) > 8: + raise ValueError("PIN-ADM needs to be <=8 digits") + pin_adm = ''.join(['%02x'%(ord(x)) for x in opts.pin_adm]) + pin_adm = rpad(pin_adm, 16) else: pin_adm = None -- To view, visit https://gerrit.osmocom.org/5999 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d68b7e09938a2fcb7a9a6a31048388cc3141f79 Gerrit-PatchSet: 1 Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:40:54 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 15:40:54 +0000 Subject: osmo-iuh[master]: configure.ac: Enable -Wall flag In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib05f7862081708d578d8f0302d926aab42897dc2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Jan 23 15:54:27 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 15:54:27 +0000 Subject: [PATCH] osmo-sgsn[master]: configure.ac: Enable Wall in CFLAGS 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/5673 to look at the new patch set (#2). configure.ac: Enable Wall in CFLAGS Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 --- M configure.ac 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/73/5673/2 diff --git a/configure.ac b/configure.ac index b89c046..ba82eb1 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,9 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) +CPPFLAGS="$CPPFLAGS -Wall" +CFLAGS="$CFLAGS -Wall" + AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"]) AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"]) -- To view, visit https://gerrit.osmocom.org/5673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:58:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 15:58:09 +0000 Subject: [ABANDON] osmo-ggsn[master]: Add configure flag to disable ipv6 support In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: Add configure flag to disable ipv6 support ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I651a12d63d025bde61dcbc3c6b949cd0fed43580 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:58:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 15:58:15 +0000 Subject: [ABANDON] osmo-ggsn[master]: contrib: Add IPv6 build option In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: contrib: Add IPv6 build option ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Id62f186d93bb0165764d9d25fbee2d359df79149 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 23 15:58:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 15:58:26 +0000 Subject: [ABANDON] osmo-ci[master]: jobs: Add IPv6 build option to osmo-ggsn job In-Reply-To: References: Message-ID: Pau Espin Pedrol has abandoned this change. Change subject: jobs: Add IPv6 build option to osmo-ggsn job ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I3f97bcd163b0458d00c0def7982cdaa349f08747 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:03:23 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 23 Jan 2018 16:03:23 +0000 Subject: osmo-sgsn[master]: contrib/jenkins.sh: Enable Werror In-Reply-To: References: Message-ID: Patch Set 2: This one fails due to warnings in osmo-iuh when built with --eanble-iu. It can be merged once https://osmocom.org/issues/2435 is resolved since then the osmo-iuh will have disappeared. -- To view, visit https://gerrit.osmocom.org/5672 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd110c4eaecab5268e1f87c11ba96460bda274ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:52:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 16:52:42 +0000 Subject: osmo-sgsn[master]: configure.ac: Enable Wall in CFLAGS In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:52:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 16:52:49 +0000 Subject: [MERGED] osmo-sgsn[master]: configure.ac: Enable Wall in CFLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Enable Wall in CFLAGS ...................................................................... configure.ac: Enable Wall in CFLAGS Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 --- 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 b89c046..ba82eb1 100644 --- a/configure.ac +++ b/configure.ac @@ -104,6 +104,9 @@ CFLAGS="$saved_CFLAGS" AC_SUBST(SYMBOL_VISIBILITY) +CPPFLAGS="$CPPFLAGS -Wall" +CFLAGS="$CFLAGS -Wall" + AX_CHECK_COMPILE_FLAG([-Werror=implicit], [CFLAGS="$CFLAGS -Werror=implicit"]) AX_CHECK_COMPILE_FLAG([-Werror=maybe-uninitialized], [CFLAGS="$CFLAGS -Werror=maybe-uninitialized"]) AX_CHECK_COMPILE_FLAG([-Werror=memset-transposed-args], [CFLAGS="$CFLAGS -Werror=memset-transposed-args"]) -- To view, visit https://gerrit.osmocom.org/5673 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I042b4918bc74955cc5162fad8c16d989402c29a1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:55:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 16:55:09 +0000 Subject: osmo-pcu[master]: TBF: add dedicated log categories In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:55:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 16:55:15 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: add dedicated log categories In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: add dedicated log categories ...................................................................... TBF: add dedicated log categories Previously all TBF-related events were logged as part of DRLCMAC which is too broad to make it practically useful due to excessive amount of log messages generated. Introduce dedicated log categories for TBF-related events. Adjust test output as necessary. Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa --- M src/gprs_debug.cpp M src/gprs_debug.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 8 files changed, 136,637 insertions(+), 4,992 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/5933 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I64d660e5971263d5c63d2ba95d50625c16a594aa Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:57:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 16:57:42 +0000 Subject: osmo-msc[master]: Fix value of stored SMS validity time. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 16:57:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 16:57:52 +0000 Subject: [MERGED] osmo-msc[master]: Fix value of stored SMS validity time. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix value of stored SMS validity time. ...................................................................... Fix value of stored SMS validity time. Quote the argument to sqlite's datetime(). Otherwise, the timestamp stored in the database reads back as a negative value for some reason. Before: 1032 validity_timestamp = dbi_result_get_datetime(result, "valid_until"); (gdb) p validity_timestamp $2 = -1516814654 After: 1032 validity_timestamp = dbi_result_get_datetime(result, "valid_until"); (gdb) p validity_timestamp $2 = 1516814654 Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a --- M src/libmsc/db.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/db.c b/src/libmsc/db.c index 4bf9b1f..b48d137 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -711,7 +711,7 @@ "user_data, text, " "dest_addr, dest_ton, dest_npi, " "src_addr, src_ton, src_npi) VALUES " - "(datetime('%lld', 'unixepoch'), datetime(%lld, 'unixepoch'), " + "(datetime('%lld', 'unixepoch'), datetime('%lld', 'unixepoch'), " "%u, %u, %u, " "%u, %u, %u, " "%u, " -- To view, visit https://gerrit.osmocom.org/5995 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Keith Whyte From gerrit-no-reply at lists.osmocom.org Tue Jan 23 17:01:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 17:01:32 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Patch Set 7: Code-Review-1 Not all of holgers comments adrresed -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 17:03:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 17:03:05 +0000 Subject: [MERGED] osmo-msc[master]: MNCC: Add input validation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MNCC: Add input validation ...................................................................... MNCC: Add input validation There appears to have been no input validation whatsoever on MNCC messages. Hence it was very easy for an external MNCC handler to crash OsmoMSC, such as in OS#2853 Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4 Closes: OS#2853 --- M include/osmocom/msc/mncc.h M src/libmsc/mncc.c M src/libmsc/mncc_sock.c 3 files changed, 188 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/mncc.h b/include/osmocom/msc/mncc.h index 49f0c8b..d2f0541 100644 --- a/include/osmocom/msc/mncc.h +++ b/include/osmocom/msc/mncc.h @@ -215,5 +215,6 @@ || msg_type == GSM_TCH_FRAME_AMR \ || msg_type == GSM_BAD_FRAME) +int mncc_prim_check(const struct gsm_mncc *mncc_prim, unsigned int len); #endif diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 4e88bc6..3b4c41d 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -1,7 +1,7 @@ /* mncc.c - utility routines for the MNCC API between the 04.08 * message parsing and the actual Call Control logic */ -/* (C) 2008-2009 by Harald Welte +/* (C) 2008-2018 by Harald Welte * (C) 2009 by Andreas Eversberg * All Rights Reserved * @@ -105,3 +105,185 @@ data->cause.value = val; } + +/*********************************************************************** + * MNCC validation code. Move to libosmocore once headers are merged + ************************************************************************/ + +#define MNCC_F_ALL 0x3fff + +static int check_string_terminated(const char *str, unsigned int size) +{ + int i; + for (i = 0; i < size; i++) { + if (str[i] == 0) + return 0; + } + return -EINVAL; +} + +static int mncc_check_number(const struct gsm_mncc_number *num, const char *str) +{ + int rc; + rc = check_string_terminated(num->number, ARRAY_SIZE(num->number)); + if (rc < 0) + LOGP(DMNCC, LOGL_ERROR, "MNCC %s number not terminated\n", str); + return rc; +} + +static int mncc_check_cause(const struct gsm_mncc_cause *cause) +{ + if (cause->diag_len > sizeof(cause->diag)) + return -EINVAL; + return 0; +} + +static int mncc_check_useruser(const struct gsm_mncc_useruser *uu) +{ + return check_string_terminated(uu->info, ARRAY_SIZE(uu->info)); +} + +static int mncc_check_facility(const struct gsm_mncc_facility *fac) +{ + return check_string_terminated(fac->info, ARRAY_SIZE(fac->info)); +} + +static int mncc_check_ssversion(const struct gsm_mncc_ssversion *ssv) +{ + return check_string_terminated(ssv->info, ARRAY_SIZE(ssv->info)); +} + +static int mncc_prim_check_sign(const struct gsm_mncc *mncc_prim) +{ + int rc; + + if (mncc_prim->fields & ~ MNCC_F_ALL) { + LOGP(DMNCC, LOGL_ERROR, "Unknown MNCC field mask 0x%x\n", mncc_prim->fields); + return -EINVAL; + } + + rc = check_string_terminated(mncc_prim->imsi, sizeof(mncc_prim->imsi)); + if (rc < 0) { + LOGP(DMNCC, LOGL_ERROR, "MNCC IMSI not terminated\n"); + return rc; + } + + if (mncc_prim->fields & MNCC_F_CALLED) { + rc = mncc_check_number(&mncc_prim->called, "called"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_CALLING) { + rc = mncc_check_number(&mncc_prim->calling, "calling"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_REDIRECTING) { + rc = mncc_check_number(&mncc_prim->redirecting, "redirecting"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_CONNECTED) { + rc = mncc_check_number(&mncc_prim->connected, "connected"); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_CAUSE) { + rc = mncc_check_cause(&mncc_prim->cause); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_USERUSER) { + rc = mncc_check_useruser(&mncc_prim->useruser); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_FACILITY) { + rc = mncc_check_facility(&mncc_prim->facility); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_SSVERSION) { + rc = mncc_check_ssversion(&mncc_prim->ssversion); + if (rc < 0) + return rc; + } + + if (mncc_prim->fields & MNCC_F_BEARER_CAP) { + bool m1_found = false; + int i; + + for (i = 0; i < ARRAY_SIZE(mncc_prim->bearer_cap.speech_ver); i++) { + if (mncc_prim->bearer_cap.speech_ver[i] == -1) { + m1_found = true; + break; + } + } + if (!m1_found) { + LOGP(DMNCC, LOGL_ERROR, "Unterminated MNCC bearer capability\n"); + return -EINVAL; + } + } + + return 0; +} + +int mncc_prim_check(const struct gsm_mncc *mncc_prim, unsigned int len) +{ + if (len < sizeof(mncc_prim->msg_type)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC Header\n"); + return -EINVAL; + } + + switch (mncc_prim->msg_type) { + case MNCC_SOCKET_HELLO: + if (len < sizeof(struct gsm_mncc_hello)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC Hello\n"); + return -EINVAL; + } + break; + case GSM_BAD_FRAME: + case GSM_TCH_FRAME_AMR: + case GSM_TCHH_FRAME: + case GSM_TCHF_FRAME_EFR: + case GSM_TCHF_FRAME: + if (len < sizeof(struct gsm_data_frame)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC TCH\n"); + return -EINVAL; + } + break; + case MNCC_RTP_FREE: + case MNCC_RTP_CONNECT: + case MNCC_RTP_CREATE: + if (len < sizeof(struct gsm_mncc_rtp)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC RTP\n"); + return -EINVAL; + } + break; + case MNCC_LCHAN_MODIFY: + case MNCC_FRAME_DROP: + case MNCC_FRAME_RECV: + /* FIXME */ + break; + case MNCC_BRIDGE: + if (len < sizeof(struct gsm_mncc_bridge)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC BRIDGE\n"); + return -EINVAL; + } + break; + default: + if (len < sizeof(struct gsm_mncc)) { + LOGP(DMNCC, LOGL_ERROR, "Short MNCC Signalling\n"); + return -EINVAL; + } + return mncc_prim_check_sign(mncc_prim); + } + return 0; +} diff --git a/src/libmsc/mncc_sock.c b/src/libmsc/mncc_sock.c index b6b1bc9..14613ca 100644 --- a/src/libmsc/mncc_sock.c +++ b/src/libmsc/mncc_sock.c @@ -123,8 +123,11 @@ return 0; goto close; } + msgb_put(msg, rc); - rc = mncc_tx_to_cc(state->net, mncc_prim->msg_type, mncc_prim); + rc = mncc_prim_check(mncc_prim, rc); + if (rc == 0) + rc = mncc_tx_to_cc(state->net, mncc_prim->msg_type, mncc_prim); /* as we always synchronously process the message in mncc_send() and * its callbacks, we can free the message here. */ -- To view, visit https://gerrit.osmocom.org/5965 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idaf3b8e409c84564b1eb26d01a19c605f89b14f4 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 23 17:04:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 17:04:35 +0000 Subject: osmo-mgw[master]: client: eliminate destructive head parsing In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib273c13d6fe7ee042fb4e3b8ed46ac02602226f6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 17:07:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 17:07:42 +0000 Subject: osmo-ci[master]: gerrit: remove obsolete openggsn job In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 We might still need to apply some bug fixes or the like, I don't want to remove the job -- To view, visit https://gerrit.osmocom.org/5986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9ea1511fe628b9796b1df55d26b75bbe47d5c15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 17:08:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 17:08:46 +0000 Subject: osmo-ci[master]: jenkins: fix jobs template In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/5985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0bc28695f4f270bc7b1cc4bcd5d4d43ede6172f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 17:08:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 17:08:55 +0000 Subject: [MERGED] osmo-ci[master]: jenkins: fix jobs template In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: fix jobs template ...................................................................... jenkins: fix jobs template The sequential parameter was silently skipped because it was absent from the project template. Fix this for both master- and gerrit- jobs. Change-Id: I0bc28695f4f270bc7b1cc4bcd5d4d43ede6172f3 --- M jobs/gerrit-verifications.yml M jobs/master-builds.yml 2 files changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/jobs/gerrit-verifications.yml b/jobs/gerrit-verifications.yml index ce9d084..3789353 100644 --- a/jobs/gerrit-verifications.yml +++ b/jobs/gerrit-verifications.yml @@ -18,6 +18,7 @@ a4_name: a4 a4: !!python/tuple [default] combination_filter: '' + sequential: false # most common build invocation cmd: ./contrib/jenkins.sh repos_url: 'ssh://jenkins at gerrit.osmocom.org:29418/{repos}' @@ -211,6 +212,7 @@ Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! execution-strategy: + sequential: '{obj:sequential}' combination-filter: | {obj:combination_filter} axes: diff --git a/jobs/master-builds.yml b/jobs/master-builds.yml index 0f9bb1e..8cacf27 100644 --- a/jobs/master-builds.yml +++ b/jobs/master-builds.yml @@ -15,6 +15,7 @@ a3_name: a3 a3: !!python/tuple [default] combination_filter: '' + sequential: false # most common build invocation cmd: ./contrib/jenkins.sh trigger: @@ -261,6 +262,7 @@ Auto-generated using Jenkins Job Builder. DO NOT EDIT MANUALLY! execution-strategy: + sequential: '{obj:sequential}' combination-filter: | {obj:combination_filter} axes: -- To view, visit https://gerrit.osmocom.org/5985 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0bc28695f4f270bc7b1cc4bcd5d4d43ede6172f3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jan 23 18:01:38 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 18:01:38 +0000 Subject: [ABANDON] osmo-ci[master]: gerrit: remove obsolete openggsn job In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: gerrit: remove obsolete openggsn job ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/5986 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: If9ea1511fe628b9796b1df55d26b75bbe47d5c15 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jan 23 18:15:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 18:15:03 +0000 Subject: libosmo-sccp[master]: sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I113645bd6df1ec9ae5137977028df38560fc4789 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 18:15:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 18:15:07 +0000 Subject: [MERGED] libosmo-sccp[master]: sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER ...................................................................... sccp_types.h: Fix value for SCCP_REFUSAL_UNEQUIPPED_USER It seems we have been sending the wrong numeric value in SCCP connection refusal due to an unqeuipped user. It turns out our list of refusal causes was missing one entry, causing an off-by-one for this refusal cause. While at it, add a comment which section of which spec is relevant for this enum. Change-Id: I113645bd6df1ec9ae5137977028df38560fc4789 --- M include/sccp/sccp_types.h 1 file changed, 3 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/include/sccp/sccp_types.h b/include/sccp/sccp_types.h index 962bde4..ab7f74f 100644 --- a/include/sccp/sccp_types.h +++ b/include/sccp/sccp_types.h @@ -245,6 +245,7 @@ SCCP_ERROR_UNQUALIFIED = 4, }; +/* ITU=T Q.713 Section 3.15 */ enum sccp_refusal_cause { SCCP_REFUSAL_END_USER_ORIGINATED = 0, SCCP_REFUSAL_END_USER_CONGESTION = 1, @@ -264,7 +265,8 @@ SCCP_REFUSAL_UNQUALIFIED = 15, SCCP_REFUSAL_HOP_COUNTER_VIOLATION = 16, SCCP_REFUSAL_SCCP_FAILURE = 17, - SCCP_REFUSAL_UNEQUIPPED_USER = 18, + SCCP_REFUSAL_NO_TRANS_FOR_ADDRESS_NATURE = 18, + SCCP_REFUSAL_UNEQUIPPED_USER = 19, }; /* -- To view, visit https://gerrit.osmocom.org/5860 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I113645bd6df1ec9ae5137977028df38560fc4789 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 18:15:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 18:15:18 +0000 Subject: osmo-trx[master]: Remove unneeded libdl dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ttsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 18:15:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 23 Jan 2018 18:15:24 +0000 Subject: [MERGED] osmo-trx[master]: Remove unneeded libdl dependency In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove unneeded libdl dependency ...................................................................... Remove unneeded libdl dependency Closes: OS#1929 Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd --- M CommonLibs/Makefile.am M Makefile.am M Transceiver52M/Makefile.am 3 files changed, 5 insertions(+), 5 deletions(-) Approvals: Vadim Yanitskiy: Looks good to me, but someone else must approve Alexander Chemeris: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/CommonLibs/Makefile.am b/CommonLibs/Makefile.am index 46cc143..fa0b285 100644 --- a/CommonLibs/Makefile.am +++ b/CommonLibs/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) -AM_CXXFLAGS = -Wall -O3 -g -ldl -lpthread +AM_CXXFLAGS = -Wall -O3 -g -lpthread EXTRA_DIST = \ example.config \ diff --git a/Makefile.am b/Makefile.am index 1e659a0..71f7b91 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,9 +22,9 @@ ACLOCAL_AMFLAGS = -I config AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(USB_INCLUDES) $(WITH_INCLUDES) -AM_CXXFLAGS = -Wall -pthread -ldl -#AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread -ldl -#AM_CFLAGS = -Wall -O2 -NDEBUG -pthread -ldl +AM_CXXFLAGS = -Wall -pthread +#AM_CXXFLAGS = -Wall -O2 -NDEBUG -pthread +#AM_CFLAGS = -Wall -O2 -NDEBUG -pthread # Order must be preserved SUBDIRS = \ diff --git a/Transceiver52M/Makefile.am b/Transceiver52M/Makefile.am index 5b5fafa..f36f4d4 100644 --- a/Transceiver52M/Makefile.am +++ b/Transceiver52M/Makefile.am @@ -22,7 +22,7 @@ include $(top_srcdir)/Makefile.common AM_CPPFLAGS = -Wall $(STD_DEFINES_AND_INCLUDES) -I${srcdir}/common -AM_CXXFLAGS = -ldl -lpthread +AM_CXXFLAGS = -lpthread SUBDIRS = arm x86 -- To view, visit https://gerrit.osmocom.org/5819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0caea2a2a8e6bd07432fd73bae72b42b1ce022cd Gerrit-PatchSet: 2 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: ttsou From gerrit-no-reply at lists.osmocom.org Tue Jan 23 19:50:04 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 19:50:04 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make UL/DL state internal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5862 to look at the new patch set (#2). TBF: make UL/DL state internal * add functions/macros for setting TBF's UL/DL state * add functions for checking TBF's UL/DL state * move pre-free check into separate function * update TBF test output due to extended state transition logging N. B: this should not be confused with TBF-UL or TBF-DL state. Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 7 files changed, 170 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/62/5862/2 diff --git a/src/bts.cpp b/src/bts.cpp index 873af73..f614c1a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1022,11 +1022,11 @@ tbf_free(tbf); return; } - if (tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) { + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; if (!new_tbf) { @@ -1054,11 +1054,11 @@ tbf_assign_control_ts(new_tbf); return; } - if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; if (!new_tbf) { @@ -1156,10 +1156,10 @@ /* schedule uplink assignment or reject */ if (ul_tbf) { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); } else { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); } } @@ -1403,7 +1403,7 @@ ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); /* get capabilities */ if (ul_tbf->ms()) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 8925032..a87217f 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -54,11 +54,10 @@ *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) *ul_ack_tbf = ul_tbf; - if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || ul_tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = ul_tbf; /* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states? */ @@ -73,10 +72,10 @@ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; - if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = dl_tbf; } @@ -139,13 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - if (tbf == ul_ass_tbf && tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf == ul_ass_tbf && tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - if (tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else msg = ul_ass_tbf->create_ul_ass(fn, ts); diff --git a/src/tbf.cpp b/src/tbf.cpp index 699f960..0cb54bc 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -165,8 +165,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), - ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), @@ -185,6 +183,8 @@ m_ta(GSM48_TA_INVALID), m_ms_class(0), state(GPRS_RLCMAC_NULL), + dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), + ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) @@ -452,21 +452,7 @@ } LOGPTBF(tbf, LOGL_INFO, "free\n"); - if (tbf->ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending uplink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, - tbf->ul_ass_state)); - if (tbf->dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending downlink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, - tbf->dl_ass_state)); - + tbf->check_pending_ass(); tbf->stop_timers("freeing TBF"); /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); @@ -1513,7 +1499,7 @@ ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); ul_tbf->control_ts = ts; ul_tbf->trx = trx; ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0); diff --git a/src/tbf.h b/src/tbf.h index 244ddd4..2d51945 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -181,6 +181,8 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -191,7 +193,12 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; + bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; + bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); + void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); + void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; @@ -272,8 +279,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; - enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; enum gprs_rlcmac_tbf_poll_state poll_state; @@ -336,6 +341,8 @@ private: enum gprs_rlcmac_tbf_state state; + enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; + enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -368,6 +375,16 @@ return state == rhs; } +inline bool gprs_rlcmac_tbf::dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const +{ + return dl_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const +{ + return ul_ass_state == rhs; +} + inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const { return state != rhs; @@ -399,6 +416,39 @@ state = new_state; } +inline void gprs_rlcmac_tbf::set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes DL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, new_state)); + dl_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes UL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, new_state)); + ul_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::check_pending_ass() +{ + if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending uplink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state)); + + if (dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending downlink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state)); +} + inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) { if ((state_flags & (1 << state_flag))) { diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 9a0bf78..fdbbd16 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -483,7 +483,7 @@ /* check for downlink tbf: */ if (old_tbf) { LOGPTBFDL(this, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", old_tbf->name()); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(old_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 9e21c73..968f9eb 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -175,7 +175,7 @@ check_tbf(dl_tbf); /* "Establish" the DL TBF */ - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); @@ -276,7 +276,7 @@ OSMO_ASSERT(new_tbf != dl_tbf); OSMO_ASSERT(new_tbf->tfi() == 1); check_tbf(dl_tbf); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); if (test_mode == TEST_MODE_REVERSE_FREE) { GprsMs::Guard guard(ms); tbf_free(new_tbf); @@ -365,7 +365,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); printf("=== end %s ===\n", __func__); @@ -2699,7 +2699,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); } @@ -2748,7 +2748,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index f0f67c0..29d718d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -43,6 +43,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -64,6 +65,8 @@ - Assign downlink TS=4 TFI=1 PDCH(TS 4, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL), 2 TBFs, USFs = 00, TFIs = 00000003. Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_SEND_ASS +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING), 1 TBFs, USFs = 00, TFIs = 00000002. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) PDCH(TS 4, TRX 0): Detaching TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000. @@ -85,6 +88,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -106,6 +110,8 @@ - Assign downlink TS=4 TFI=1 PDCH(TS 4, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL), 2 TBFs, USFs = 00, TFIs = 00000003. Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_SEND_ASS +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=RELEASING), 1 TBFs, USFs = 00, TFIs = 00000001. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000. @@ -127,6 +133,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -227,6 +234,7 @@ -- Chunk with length 19 is less than remaining space (20): add length header to to delimit LLC frame -- Final block, so we done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=203 block=11 data=07 01 2c 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING) Destroying MS object, TLLI = 0xffeeddcc @@ -246,6 +254,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Searching for first unallocated TFI: TRX=0 Found TFI=1. Creating MS object, TLLI = 0x00000000 @@ -262,6 +271,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL), 2 TBFs, USFs = 00, TFIs = 00000003. Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xf1000001, partly confirmed The MS object cannot fully confirm an unexpected TLLI: 0xf1000002, partly confirmed Modifying MS object, TLLI = 0xf1000001, IMSI '' -> '001001000000001' @@ -936,11 +946,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -961,6 +973,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation @@ -989,11 +1002,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1013,6 +1028,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 1 Received RTS for PDCH: TRX=0 TS=7 FN=2654275 block_nr=9 scheduling USF=0 for required uplink resource of UL TFI=0 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) @@ -1020,6 +1036,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -1062,12 +1079,14 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Modifying MS object, UL TLLI: 0x00000000 -> 0xf5667788, not yet confirmed Modifying MS object, TLLI = 0xf5667788, TA 220 -> 7 +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS Received RTS for PDCH: TRX=0 TS=7 FN=2654335 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=1, CPS=0, RSB=0, rc=184 @@ -1108,11 +1127,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1132,6 +1153,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 UL RSSI of TLLI=0xf1223344: 31 dBm PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW), 0 TBFs, USFs = 00, TFIs = 00000000. @@ -1162,11 +1184,13 @@ - Assign uplink TS=7 TFI=0 USF=0 PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=NULL) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled @@ -1178,6 +1202,7 @@ - Assign downlink TS=7 TFI=0 PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1212,11 +1237,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1236,6 +1263,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 UL RSSI of TLLI=0xf1223344: 31 dBm PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW), 0 TBFs, USFs = 00, TFIs = 00000000. @@ -1301,11 +1329,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1325,6 +1355,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 40 Received RTS for PDCH: TRX=0 TS=7 FN=2654275 block_nr=9 scheduling USF=0 for required uplink resource of UL TFI=0 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) (TRX=0, TS=7) @@ -1332,6 +1363,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -1723,12 +1755,14 @@ - Assign downlink TS=7 TFI=1 PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL), 2 TBFs, USFs = 01, TFIs = 00000003. Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=NULL) +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Received RTS for PDCH: TRX=0 TS=7 FN=2654400 block_nr=2 scheduling USF=0 for required uplink resource of UL TFI=0 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING), 1 TBFs, USFs = 01, TFIs = 00000002. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) Received RTS on disabled PDCH: TRX=0 TS=0 @@ -1955,12 +1989,14 @@ ws(64) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -1983,6 +2019,7 @@ ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation @@ -2014,12 +2051,14 @@ ws(64) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -2100,6 +2139,7 @@ ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Searching for first unallocated TFI: TRX=0 Found TFI=0. Creating MS object, TLLI = 0x00000000 @@ -2118,6 +2158,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2201,6 +2242,7 @@ -- Chunk with length 14 is less than remaining space (15): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=108 block=1 data=07 00 06 16 18 3a 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2222,6 +2264,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2290,6 +2333,7 @@ -- Chunk with length 18 is less than remaining space (19): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 c0 04 12 20 4a 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2311,6 +2355,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2368,6 +2413,7 @@ -- Chunk with length 34 is less than remaining space (35): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 06 04 8a 56 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2389,6 +2435,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2436,6 +2483,7 @@ -- Chunk with length 14 is less than remaining space (15): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 00 70 3a 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2457,6 +2505,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2498,6 +2547,7 @@ -- Chunk with length 46 is less than remaining space (47): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2519,6 +2569,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2555,6 +2606,7 @@ -- Chunk with length 71 is less than remaining space (72): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 80 c0 e3 ca 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 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=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2576,6 +2628,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2609,6 +2662,7 @@ -- Chunk with length 46 is less than remaining space (47): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2630,6 +2684,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2659,6 +2714,7 @@ -- Chunk with length 30 is less than remaining space (31): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 00 60 20 f5 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 80 d4 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 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 02 +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2680,6 +2736,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed 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 @@ -2710,6 +2767,7 @@ -- Chunk with length 71 is less than remaining space (72): add length header to to delimit LLC frame -- No space left, so we are done. Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 80 c0 e3 ca 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 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=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2731,8 +2789,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2754,8 +2814,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (22) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2777,8 +2839,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (28) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2800,11 +2864,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done -- Chunk with length 44 is less than remaining space (56): add length header to to delimit LLC frame -- Chunk with length 10 is less than remaining space (11): add length header to to delimit LLC frame -- No space left, so we are done. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2826,11 +2892,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done -- Chunk with length 26 is less than remaining space (74): add length header to to delimit LLC frame -- Chunk with length 46 is less than remaining space (47): add length header to to delimit LLC frame -- No space left, so we are done. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2852,11 +2920,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done -- Chunk with length 44 is less than remaining space (56): add length header to to delimit LLC frame -- Chunk with length 10 is less than remaining space (11): add length header to to delimit LLC frame -- No space left, so we are done. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2878,11 +2948,13 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done -- Chunk with length 26 is less than remaining space (74): add length header to to delimit LLC frame -- Chunk with length 46 is less than remaining space (47): add length header to to delimit LLC frame -- No space left, so we are done. +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2904,8 +2976,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2927,8 +3001,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (56) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2950,8 +3026,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (44) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -2973,8 +3051,10 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed -- Chunk with length 100 larger than space (74) left in block: copy only remaining space, and we are done +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc @@ -3009,12 +3089,14 @@ ws(64) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 @@ -3054,6 +3136,7 @@ ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 @@ -3126,12 +3209,14 @@ ws(64) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 1d 00 40 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got MCS-4 RLC block: R=1, SI=0, TFI=0, CPS=5, RSB=0, rc=385 @@ -3163,6 +3248,7 @@ ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Searching for first unallocated TFI: TRX=0 Found TFI=0. Creating MS object, TLLI = 0x00000000 @@ -3181,6 +3267,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed ws(480) - got ack for BSN=1176 @@ -3462,12 +3549,14 @@ ws(192) Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS max_cs_ul cannot be derived (current UL CS: UNKNOWN) 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)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 00 00 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -3896,6 +3985,7 @@ ws(192) Modifying MS object, TLLI: 0xf1223344 confirmed Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 00 00 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -4442,6 +4532,7 @@ PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed MS requests UL TBF on RACH, so we provide one: ra=0x78 Fn=2654167 qta=31 is_11bit=0: Creating MS object, TLLI = 0x00000000 @@ -4577,6 +4668,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b @@ -4584,6 +4676,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) -- To view, visit https://gerrit.osmocom.org/5862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 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 Tue Jan 23 19:50:04 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 19:50:04 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make UL ack state internal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5863 to look at the new patch set (#2). TBF: make UL ack state internal * add functions/macros for setting TBF's UL ack state * add functions for checking TBF's UL ack state * update TBF test output due to extended state transition logging N. B: this should not be confused with TBF-UL state. Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Related: OS#1539 --- M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 6 files changed, 49 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/63/5863/2 diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a87217f..3f9fcb1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -52,7 +52,7 @@ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; - if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) + if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; diff --git a/src/tbf.cpp b/src/tbf.cpp index 0cb54bc..b99c521 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -60,6 +60,13 @@ { 0, NULL } }; +const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_SEND_ACK), /* send acknowledge on next RTS */ + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_WAIT_ACK), /* wait for PACKET CONTROL ACK */ + { 0, NULL } +}; + static const struct value_string tbf_timers_names[] = { OSMO_VALUE_STRING(T0), OSMO_VALUE_STRING(T3169), @@ -165,7 +172,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), @@ -185,6 +191,7 @@ state(GPRS_RLCMAC_NULL), dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), + ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 2d51945..2828772 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -87,6 +87,8 @@ GPRS_RLCMAC_UL_ACK_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; +extern const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[]; + enum gprs_rlcmac_tbf_direction { GPRS_RLCMAC_DL_TBF, GPRS_RLCMAC_UL_TBF @@ -183,6 +185,7 @@ #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -195,9 +198,11 @@ bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; + bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -279,8 +284,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -343,6 +346,7 @@ enum gprs_rlcmac_tbf_state state; enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; + enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -383,6 +387,11 @@ inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const { return ul_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const +{ + return ul_ack_state == rhs; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -434,6 +443,15 @@ ul_ass_state = new_state; } +inline void gprs_rlcmac_tbf::set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes UL ACK state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, ul_ack_state), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, new_state)); + ul_ack_state = new_state; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index ba048e5..c1a3388 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -106,8 +106,8 @@ bool gprs_rlcmac_ul_tbf::handle_ctrl_ack() { /* check if this control ack belongs to packet uplink ack */ - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return true; } @@ -124,7 +124,7 @@ if (final) { if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; @@ -158,7 +158,7 @@ /* waiting for final acknowledge */ m_final_ack_sent = 1; } else - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return msg; } @@ -362,9 +362,9 @@ "Scheduling Ack/Nack, because %d frames received.\n", SEND_ACK_AFTER_FRAMES); } - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE) { + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)) { /* trigger sending at next RTS */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_SEND_ACK; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_SEND_ACK); } else { /* already triggered */ LOGPTBFUL(this, LOGL_DEBUG, diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 968f9eb..0ac519c 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1350,7 +1350,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1434,7 +1434,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1522,7 +1522,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 29d718d..514a654 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -901,6 +901,7 @@ - Taking block 0 out, raising V(Q) to 1 LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) len=16 No bctx +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 Slot Allocation (Algorithm A) for class 0 @@ -1300,6 +1301,7 @@ - Taking block 0 out, raising V(Q) to 1 LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) len=16 No bctx +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: @@ -2075,6 +2077,7 @@ max_cs_ul cannot be derived (current UL CS: UNKNOWN) - Raising V(R) to 2 - Taking block 1 out, raising V(Q) to 2 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-3, length: 42 (42)) UL data: 1f 10 40 cd 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got MCS-3 RLC block: R=1, SI=1, TFI=0, CPS=5, RSB=0, rc=329 @@ -3112,6 +3115,7 @@ Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) EGPRS URBB, urbb len = 0, SSN = 3, ESN_CRBB = 2, len present = yes,desc len = 15, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 2, BOW, EOW Uplink Ack/Nack bit count 98, max 184, message = 40 24 01 3f 3e 24 46 68 90 87 b0 06 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-3, length: 42 (42)) UL data: 1d 20 40 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 Got MCS-3 RLC block: R=1, SI=0, TFI=0, CPS=5, RSB=0, rc=329 @@ -3120,6 +3124,7 @@ Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) EGPRS URBB, urbb len = 2, SSN = 3, ESN_CRBB = 2, len present = yes,desc len = 17, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 5, BOW, EOW Uplink Ack/Nack bit count 100, max 184, message = 40 24 01 3f 3e 24 46 68 90 88 b0 06 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_NONE Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 Slot Allocation (Algorithm A) for class 0 @@ -3658,6 +3663,7 @@ Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 max_cs_ul cannot be derived (current UL CS: UNKNOWN) - Raising V(R) to 39 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 40 01 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -3963,6 +3969,7 @@ the ucmp len=157 uclen_crbb=19 num_blocks=157 crbb length 78, and the CRBB bitmap = 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e EGPRS URBB, urbb len = 94, SSN = 2, ESN_CRBB = 1, len present = No,desc len = 109, SNS = 2048, WS = 192, V(Q) = 1, V(R) = 159, BOW Uplink Ack/Nack bit count 184, max 184, message = 40 24 01 3f 3e 24 46 68 90 20 04 55 55 55 55 55 55 55 55 55 55 55 54 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_SEND_ACK to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 00 00 02 80 00 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 2b 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -4082,6 +4089,7 @@ Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 max_cs_ul cannot be derived (current UL CS: UNKNOWN) - Raising V(R) to 37 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 30 01 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -4090,6 +4098,7 @@ Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) EGPRS URBB, urbb len = 37, SSN = 2, ESN_CRBB = 1, len present = yes,desc len = 52, SNS = 2048, WS = 192, V(Q) = 1, V(R) = 39, BOW, EOW Uplink Ack/Nack bit count 135, max 184, message = 40 24 01 3f 3e 24 46 68 90 9a 30 04 aa aa aa aa a9 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_SEND_ACK to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 00 00 02 80 00 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 2b 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -4190,6 +4199,7 @@ Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 max_cs_ul cannot be derived (current UL CS: UNKNOWN) - Raising V(R) to 98 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 10 03 80 00 00 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 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -4507,6 +4517,7 @@ EGPRS CRBB, crbb_len = 30, crbb_start_clr_code = 0 EGPRS URBB, urbb len = 0, SSN = 1, ESN_CRBB = 159, len present = yes,desc len = 53, SNS = 2048, WS = 192, V(Q) = 0, V(R) = 160, BOW, EOW Uplink Ack/Nack bit count 136, max 184, message = 40 24 01 3f 3e 24 46 68 90 9a b0 03 3c 03 c3 1b a0 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes UL ACK state from GPRS_RLCMAC_UL_ACK_SEND_ACK to GPRS_RLCMAC_UL_ACK_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 00 00 02 80 00 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 2b 2b 2b 2b 2b Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 -- To view, visit https://gerrit.osmocom.org/5863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 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 Tue Jan 23 19:50:04 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 19:50:04 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make poll state internal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5864 to look at the new patch set (#2). TBF: make poll state internal * add functions/macros for setting TBF's poll state * add function for checking TBF's poll state * update TBF test output due to extended state transition logging Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/poll_controller.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/tbf/TbfTest.err 8 files changed, 59 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/64/5864/2 diff --git a/src/bts.cpp b/src/bts.cpp index f614c1a..94354f2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -399,7 +399,7 @@ static inline bool tbf_check(gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t trx_no, uint8_t ts) { - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_scheduled() && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) return true; @@ -1010,7 +1010,7 @@ tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(tbf); /* check if this control ack belongs to packet uplink ack */ ul_tbf = as_ul_tbf(tbf); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 3f9fcb1..ebf4714 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -49,8 +49,7 @@ if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && ul_tbf->poll_fn == poll_fn) + if (ul_tbf->poll_scheduled() && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; @@ -69,8 +68,7 @@ if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && dl_tbf->poll_fn == poll_fn) + if (dl_tbf->poll_scheduled() && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index f8ab6c9..5c5a717 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -47,14 +47,14 @@ llist_for_each(pos, &m_bts.ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (ul_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, ul_tbf->poll_fn)) ul_tbf->poll_timeout(); } } llist_for_each(pos, &m_bts.dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (dl_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, dl_tbf->poll_fn)) dl_tbf->poll_timeout(); } diff --git a/src/tbf.cpp b/src/tbf.cpp index b99c521..672c296 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -45,6 +45,12 @@ static void tbf_timer_cb(void *_tbf); +const struct value_string gprs_rlcmac_tbf_poll_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_SCHED), /* a polling was scheduled */ + { 0, NULL } +}; + const struct value_string gprs_rlcmac_tbf_dl_ass_state_names[] = { OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_NONE), OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_SEND_ASS), @@ -172,7 +178,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), n3105(0), @@ -192,6 +197,7 @@ dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), + poll_state(GPRS_RLCMAC_POLL_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 2828772..bb5fd0a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,8 @@ GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ }; +extern const struct value_string gprs_rlcmac_tbf_poll_state_names[]; + enum gprs_rlcmac_tbf_dl_ass_state { GPRS_RLCMAC_DL_ASS_NONE = 0, GPRS_RLCMAC_DL_ASS_SEND_ASS, /* send downlink assignment on next RTS */ @@ -186,6 +188,8 @@ #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_SET(t) do { t->poll_sched_set(__FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_UNSET(t) do { t->poll_sched_unset(__FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -199,10 +203,13 @@ bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; + bool poll_scheduled() const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); + void poll_sched_set(const char *file, int line); + void poll_sched_unset(const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -284,7 +291,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -347,6 +353,7 @@ enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; + enum gprs_rlcmac_tbf_poll_state poll_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -392,6 +399,11 @@ inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const { return ul_ack_state == rhs; +} + +inline bool gprs_rlcmac_tbf::poll_scheduled() const +{ + return poll_state == GPRS_RLCMAC_POLL_SCHED; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -452,6 +464,20 @@ ul_ack_state = new_state; } +inline void gprs_rlcmac_tbf::poll_sched_set(const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_SCHED\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_SCHED; +} + +inline void gprs_rlcmac_tbf::poll_sched_unset(const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_NONE\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_NONE; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index fdbbd16..80e3831 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -635,7 +635,7 @@ /* reset N3105 */ n3105 = 0; t_stop(T3191, "ACK/NACK received"); - poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(this); return ack_recovered; } @@ -1181,7 +1181,7 @@ bool gprs_rlcmac_dl_tbf::need_control_ts() const { - if (poll_state != GPRS_RLCMAC_POLL_NONE) + if (poll_scheduled()) return false; return state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK) || diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index c1a3388..1560eb0 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -123,8 +123,7 @@ uint32_t new_poll_fn = 0; if (final) { - if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + if (poll_scheduled() && ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 514a654..9da7d82 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -953,6 +953,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1009,6 +1010,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1037,6 +1039,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 @@ -1087,6 +1090,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 02 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1134,6 +1138,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1191,6 +1196,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Slot Allocation (Algorithm A) for class 1 - Skipping TS 0, because not enabled @@ -1244,6 +1250,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1337,6 +1344,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -1365,6 +1373,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 @@ -1717,6 +1726,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE Got GPRS DL ACK bitmap: SSN: 0, BSN 0 to 28 - 1 (28 blocks), "RRRRRRRRRRRRRRRRRRRRRRRRRRRR" - got ack for BSN=0 - got ack for BSN=1 @@ -1764,6 +1774,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_NONE PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING), 1 TBFs, USFs = 01, TFIs = 00000002. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=RELEASING) @@ -1998,6 +2009,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -2060,6 +2072,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -3099,6 +3112,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: CS-1, length: 23 (23)) UL data: 3c 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -3221,6 +3235,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 1d 00 40 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -3561,6 +3576,7 @@ Got RLC block, coding scheme: CS-1, length: 23 (23)) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes poll state from GPRS_RLCMAC_POLL_SCHED to GPRS_RLCMAC_POLL_NONE TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes UL ASS state from GPRS_RLCMAC_UL_ASS_WAIT_ACK to GPRS_RLCMAC_UL_ASS_NONE Got RLC block, coding scheme: MCS-4, length: 49 (49)) UL data: 28 00 00 80 00 00 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 2b 2b 2b 2b -- To view, visit https://gerrit.osmocom.org/5864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 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 Tue Jan 23 19:50:05 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 19:50:05 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: adjust test log levels Message-ID: Review at https://gerrit.osmocom.org/6000 TBF: adjust test log levels * enable debugging for DTBF* * disable excessive DRLCMAC* Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 2 files changed, 4,665 insertions(+), 1,175 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/00/6000/1 -- To view, visit https://gerrit.osmocom.org/6000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 20:00:34 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 20:00:34 +0000 Subject: [PATCH] osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4072 to look at the new patch set (#8). Add multislot classes from latest spec The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via Emacs macros into C struct to avoid typos. The test output expanded accordingly. The allocation test expectations and output are adjusted accordingly. Note: classes 35-45 which need TA offset are not properly supported yet. This can be extended once we have such devices available for tests. Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 72,880 insertions(+), 3,439 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/72/4072/8 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 20:00:34 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 20:00:34 +0000 Subject: [PATCH] osmo-pcu[master]: AllocTest: remove assumption on max MS class In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4958 to look at the new patch set (#5). AllocTest: remove assumption on max MS class So far the allocation was only tested up to hardcoded MS class 29. Drop that assumption and test for all supported MS classes. Adjust expected test output as necessary. Note: using mslot_class_max() forces allocation for MS classes 30 and 31 for which no actual data is available (will be added in follow-up patches) which current implementation treats differently depending on TX/RX direction - see gprs_alloc_max_dl_slots_per_ms(). Because of that we have to adjust the expected number of allocations in test_successive_allocation() as well. Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433 Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok 3 files changed, 4,536 insertions(+), 3,196 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/58/4958/5 -- To view, visit https://gerrit.osmocom.org/4958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 23 20:03:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 23 Jan 2018 20:03:01 +0000 Subject: [PATCH] osmo-pcu[master]: Remove ASAN preprocessor warning Message-ID: Review at https://gerrit.osmocom.org/6001 Remove ASAN preprocessor warning We have ASAN integrated into CI tests directly so there's no need in additional manual warnings at compile time. Change-Id: Idaabb4203a282be6779d7ab29de3f827b0ca6462 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 2 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/01/6001/1 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index a86e09d..a9d4617 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -964,10 +964,9 @@ /* FIXME: move this to libgb: btsctx_free() */ llist_del(&the_pcu.bctx->list); -#warning "This causes ASAN to complain. It is not critical for normal operation but should be fixed nevertheless" -#if 0 + talloc_free(the_pcu.bctx); -#endif + the_pcu.bctx = NULL; } -- To view, visit https://gerrit.osmocom.org/6001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaabb4203a282be6779d7ab29de3f827b0ca6462 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 23 21:17:23 2018 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Tue, 23 Jan 2018 21:17:23 +0000 Subject: [PATCH] osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support: In-Reply-To: References: Message-ID: Hello Harald Welte, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/2817 to look at the new patch set (#3). adding dmo support: physical layer: If DMO preamble bits are present, burst are send to DMO SAPs lower mac layer: Decoding DMO Bursts and adding a new SAP for DMO. This SAP forwards all requests to the TMO SAP because the processing is quite similar. Nevertheless this SAP is important because in further developments you can change the lower mac without addopting the physical layer. 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.h 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 12 files changed, 477 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-tetra refs/changes/17/2817/3 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..b0f95ed 100644 --- a/src/lower_mac/tetra_lower_mac.c +++ b/src/lower_mac/tetra_lower_mac.c @@ -103,6 +103,42 @@ .type2_bits = 30, .type1_bits = 14, }, + /* DMO Synchronization Burst Block 1 */ + [DPSAP_SCH_S] = { + .name = "SCH/S", + .type345_bits = 120, + .type2_bits = 80, + .type1_bits = 60, + .interleave_a = 11, + .have_crc16 = 1, + }, + /* DMO Synchronization Burst Block 2 */ + [DPSAP_SCH_H] = { + .name = "SCH/H", + .type345_bits = 216, + .type2_bits = 144, + .type1_bits = 124, + .interleave_a = 101, + .have_crc16 = 1, + }, + /* DMO Normal Burst Block 1+2 */ + [DPSAP_SCH_F] = { + .name = "SCH/F", + .type345_bits = 432, + .type2_bits = 288, + .type1_bits = 268, + .interleave_a = 103, + .have_crc16 = 1, + }, + /* DMO Normal Burst with Slot Flag */ + [DPSAP_STCH] = { + .name = "STCH", + .type345_bits = 216, + .type2_bits = 144, + .type1_bits = 124, + .interleave_a = 101, + .have_crc16 = 1, + }, }; struct tetra_cell_data { @@ -112,6 +148,7 @@ struct tetra_tdma_time time; uint32_t scramb_init; + uint32_t textmessage_length; }; static struct tetra_cell_data _tcd, *tcd = &_tcd; @@ -151,6 +188,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 +219,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 +273,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 +334,294 @@ } /* 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"); + tup->lchan = TETRA_LC_DMO_SCH_H; /* FIXME: Implement LC DMO Channel */ + break; default: /* FIXME: do something */ break; @@ -306,4 +632,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..9a7c691 100644 --- a/src/lower_mac/tetra_scramb.c +++ b/src/lower_mac/tetra_scramb.c @@ -20,6 +20,7 @@ * */ +#include #include #include 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..2406471 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.h b/src/phy/tetra_burst.h index 8feb09c..4b75fb3 100644 --- a/src/phy/tetra_burst.h +++ b/src/phy/tetra_burst.h @@ -10,9 +10,15 @@ TPSAP_T_BBK, TPSAP_T_SCH_HU, TPSAP_T_SCH_F, + DPSAP_SCH_S, + DPSAP_SCH_H, + DPSAP_SCH_F, + DPSAP_STCH, }; extern void tp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv); + +extern void dp_sap_udata_ind(enum tp_sap_data_type type, const uint8_t *bits, unsigned int len, void *priv); /* 9.4.4.2.6 Synchronization continuous downlink burst */ int build_sync_c_d_burst(uint8_t *buf, const uint8_t *sb, const uint8_t *bb, const uint8_t *bkn); @@ -22,14 +28,20 @@ enum tetra_train_seq { TETRA_TRAIN_NORM_1, + TETRA_TRAIN_NORM_1_DMO, TETRA_TRAIN_NORM_2, + TETRA_TRAIN_NORM_2_DMO, TETRA_TRAIN_NORM_3, TETRA_TRAIN_SYNC, + TETRA_TRAIN_SYNC_DMO, TETRA_TRAIN_EXT, }; /* find a TETRA training sequence in the burst buffer indicated */ 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); + +/* checks if the DMO preamble is present and returns the proper burst type */ +int check_tmo_or_dmo(const uint8_t *in, enum tetra_train_seq type); #endif /* TETRA_BURST_H */ diff --git a/src/phy/tetra_burst_sync.c b/src/phy/tetra_burst_sync.c index e363c74..9cf3710 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_1: /* fall through */ case TETRA_TRAIN_NORM_2: - case TETRA_TRAIN_NORM_3: - if (train_seq_offs == 244) + 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..d65ddcf 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: newpatchset Gerrit-Change-Id: Ifa5521d7313595384e74dd790a56550755b93fe9 Gerrit-PatchSet: 3 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 From gerrit-no-reply at lists.osmocom.org Tue Jan 23 21:26:38 2018 From: gerrit-no-reply at lists.osmocom.org (allesklar2) Date: Tue, 23 Jan 2018 21:26:38 +0000 Subject: osmo-tetra[laforge/sq5bpf-rebase-20161218]: adding dmo support: In-Reply-To: References: Message-ID: Patch Set 3: > Patch Set 3: Published edit on patch set 2. I found out that a file (tetra_burst.h) was uploaded without changes in my first commit and there was also a type in tetra-rx.c -- 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: 3 Gerrit-Project: osmo-tetra Gerrit-Branch: laforge/sq5bpf-rebase-20161218 Gerrit-Owner: allesklar2 Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: allesklar2 Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 23 21:34:16 2018 From: gerrit-no-reply at lists.osmocom.org (roox) Date: Tue, 23 Jan 2018 21:34:16 +0000 Subject: [PATCH] libusrp[master]: build: Link libusrp_la also to boost_system Message-ID: Review at https://gerrit.osmocom.org/6002 build: Link libusrp_la also to boost_system Change-Id: I184214c37251dde0ea9bd05f4a4cebfed35a8d9f --- M host/lib/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libusrp refs/changes/02/6002/1 diff --git a/host/lib/Makefile.am b/host/lib/Makefile.am index 40c59f2..a0de559 100644 --- a/host/lib/Makefile.am +++ b/host/lib/Makefile.am @@ -29,6 +29,7 @@ libusrp_la_common_LIBADD = \ $(USB_LIBS) \ $(BOOST_THREAD_LIB) \ + $(BOOST_SYSTEM_LIB) \ ../misc/libmisc.la AM_CPPFLAGS = $(common_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES) -- To view, visit https://gerrit.osmocom.org/6002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I184214c37251dde0ea9bd05f4a4cebfed35a8d9f Gerrit-PatchSet: 1 Gerrit-Project: libusrp Gerrit-Branch: master Gerrit-Owner: roox From gerrit-no-reply at lists.osmocom.org Wed Jan 24 09:16:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 09:16:57 +0000 Subject: libusrp[master]: build: Link libusrp_la also to boost_system In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I184214c37251dde0ea9bd05f4a4cebfed35a8d9f Gerrit-PatchSet: 1 Gerrit-Project: libusrp Gerrit-Branch: master Gerrit-Owner: roox Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 09:17:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 09:17:18 +0000 Subject: [MERGED] libosmocore[master]: libosmocoding: fix typo in library documentation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmocoding: fix typo in library documentation ...................................................................... libosmocoding: fix typo in library documentation Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef --- M src/coding/gsm0503_coding.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/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index f3b319a..3f4be97 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -55,7 +55,7 @@ * 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 + * libosmocoding 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 -- To view, visit https://gerrit.osmocom.org/5888 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I535d4eba5bad9094a1e9e662f32cd2bfac5b0cef 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 Wed Jan 24 09:17:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 09:17:36 +0000 Subject: libosmocore[master]: libosmocoding: use frame length definitions from codec.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90 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 Wed Jan 24 09:17:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 09:17:37 +0000 Subject: [MERGED] libosmocore[master]: libosmocoding: use frame length definitions from codec.h In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libosmocoding: use frame length definitions from codec.h ...................................................................... libosmocoding: use frame length definitions from codec.h Since commit e094157e125a70b9a384ba3cec01261624f4eb59, TCH frame length definitions were added to libosmocodec. No need to define them again. Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90 --- M src/coding/gsm0503_coding.c 1 file changed, 0 insertions(+), 7 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/coding/gsm0503_coding.c b/src/coding/gsm0503_coding.c index 3f4be97..c94bca7 100644 --- a/src/coding/gsm0503_coding.c +++ b/src/coding/gsm0503_coding.c @@ -131,13 +131,6 @@ #define EGPRS_DATA_C1 612 #define EGPRS_DATA_C2 EGPRS_DATA_C1 -/* TS 101318 Chapter 5.1: 260 bits + 4bit sig */ -#define GSM_FR_BYTES 33 -/* TS 101318 Chapter 5.2: 112 bits, no sig */ -#define GSM_HR_BYTES 14 -/* TS 101318 Chapter 5.3: 244 bits + 4bit sig */ -#define GSM_EFR_BYTES 31 - /*! union across the three different EGPRS Uplink header types */ union gprs_rlc_ul_hdr_egprs { struct gprs_rlc_ul_header_egprs_1 type1; -- To view, visit https://gerrit.osmocom.org/5887 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8c6132534e36ea1e368432bb259fd4f3a531f90 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 Wed Jan 24 09:18:04 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 09:18:04 +0000 Subject: [PATCH] osmo-pcu[master]: Add tests for find_multi_slots() 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/4636 to look at the new patch set (#5). Add tests for find_multi_slots() * make function public * add tests Change-Id: I4174703808335c19341cd5b5f4422496d958967f --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/Makefile.am A tests/alloc/MslotTest.cpp A tests/alloc/MslotTest.ok M tests/testsuite.at 6 files changed, 1,343 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/36/4636/5 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index aa773fc..64b6d6c 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -62,6 +62,9 @@ uint8_t block_payload; }; +/* TS allocation internal functions */ +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5e670d7..471b601 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -443,7 +443,7 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 04136f5..1595a07 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) -I$(top_srcdir)/src/ -I$(top_srcdir)/include/ AM_LDFLAGS = -lrt -check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest +check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest alloc/MslotTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest noinst_PROGRAMS = emu/pcu_emu rlcmac_RLCMACTest_SOURCES = rlcmac/RLCMACTest.cpp @@ -12,6 +12,14 @@ alloc_AllocTest_SOURCES = alloc/AllocTest.cpp alloc_AllocTest_LDADD = \ + $(top_builddir)/src/libgprs.la \ + $(LIBOSMOGB_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(COMMON_LA) + +alloc_MslotTest_SOURCES = alloc/MslotTest.cpp +alloc_MslotTest_LDADD = \ $(top_builddir)/src/libgprs.la \ $(LIBOSMOGB_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -124,7 +132,7 @@ tbf/TbfTest.ok tbf/TbfTest.err \ bitcomp/BitcompTest.ok bitcomp/BitcompTest.err \ types/TypesTest.ok types/TypesTest.err \ - ms/MsTest.ok ms/MsTest.err \ + ms/MsTest.ok ms/MsTest.err alloc/MslotTest.ok \ llc/LlcTest.ok llc/LlcTest.err \ llist/LListTest.ok llist/LListTest.err \ codel/codel_test.ok \ diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp new file mode 100644 index 0000000..240b295 --- /dev/null +++ b/tests/alloc/MslotTest.cpp @@ -0,0 +1,167 @@ +/* MslotTest.cpp + * + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "gprs_rlcmac.h" +#include "gprs_debug.h" +#include "tbf.h" +#include "bts.h" + +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +/* globals used by the code */ +void *tall_pcu_ctx; +int16_t spoof_mnc = 0, spoof_mcc = 0; + +static inline void test_all_classes(struct gprs_rlcmac_trx *trx, bool clear_masks) +{ + int i, rc; + uint8_t dl_slots = 0, ul_slots = 0; + + for (i = 0; i < 64; i++) { + rc = find_multi_slots(trx, i, &ul_slots, &dl_slots); + + printf(" [%s] multislot class %3u - UL: " OSMO_BIT_SPEC " DL: " OSMO_BIT_SPEC " [%d]\n", + clear_masks ? "SEQ" : "ACC", i, OSMO_BIT_PRINT(ul_slots), OSMO_BIT_PRINT(dl_slots), rc); + + if (rc == -EINVAL) + return; + + if (clear_masks) { + dl_slots = 0; + ul_slots = 0; + } + } +} + +static inline void test_multislot_total_ascending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 0; i < 8; i++) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_total_descending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 7; i >= 0; i--) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_middle(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[2].enable(); + trx->pdch[3].enable(); + trx->pdch[4].enable(); + + test_all_classes(trx, seq); +} + +static inline void test_multislot_ends(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[0].enable(); + trx->pdch[7].enable(); + + test_all_classes(trx, seq); +} + + +int main(int argc, char **argv) +{ + tall_pcu_ctx = talloc_named_const(NULL, 1, "MslotTest context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); + + osmo_init_logging(&gprs_log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_log_level(osmo_stderr_target, LOGL_DEBUG); + + test_multislot_total_ascending(true); + test_multislot_total_ascending(false); + + test_multislot_total_descending(true); + test_multislot_total_descending(false); + + test_multislot_middle(true); + test_multislot_middle(false); + + test_multislot_ends(true); + test_multislot_ends(false); + + return EXIT_SUCCESS; +} diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok new file mode 100644 index 0000000..0cd50c8 --- /dev/null +++ b/tests/alloc/MslotTest.ok @@ -0,0 +1,1156 @@ +test_multislot_total_ascending(): sequential + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 5 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 6 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 7 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 9 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 10 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 11 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 12 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 13 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 14 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 15 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 16 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 17 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 18 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 19 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 20 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 21 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 22 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 23 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 24 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 25 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 26 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 27 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 28 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 29 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 7 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 10 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 11 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 12 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 13 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 14 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 15 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 16 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 17 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 18 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 19 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 20 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 21 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 22 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 23 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 24 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 25 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 26 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 27 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 28 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 29 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 11 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 12 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 15 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 16 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 17 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 18 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 19 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 20 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 21 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 22 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 23 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 24 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 25 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 26 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 27 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 28 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 29 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 16 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 17 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 18 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 17 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 18 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 18 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_ascending(): accumulative + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ......11 DL: ......11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: .....11. DL: .....111 [0] + [ACC] multislot class 1 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 2 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 3 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 4 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 5 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 6 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 7 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 8 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 9 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 10 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 11 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 12 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 13 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 14 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 15 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 16 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 17 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 18 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 19 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 20 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 21 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 22 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 23 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 24 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 25 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 26 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 27 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 28 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 29 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 30 - UL: ......1. DL: ......1. [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_total_descending(): sequential + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 1 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 4 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 5 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 6 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 7 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 8 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 9 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 10 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 11 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 12 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 13 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 14 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 15 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 16 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 17 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 18 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 19 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 20 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 21 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 22 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 23 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 24 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 25 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 26 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 27 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 28 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 29 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 1 - UL: .1...... DL: .1...... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 5 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 6 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 7 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 13 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 14 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 15 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 16 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 17 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 18 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [SEQ] multislot class 2 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 3 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 5 - UL: .11..... DL: .11..... [0] + [SEQ] multislot class 6 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 7 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 13 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 14 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 15 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 16 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 17 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 18 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [SEQ] multislot class 2 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 3 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 4 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 5 - UL: ..11.... DL: ..11.... [0] + [SEQ] multislot class 6 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 7 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 9 - UL: .11..... DL: .111.... [0] + [SEQ] multislot class 10 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 11 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 12 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 13 - UL: .111.... DL: .111.... [0] + [SEQ] multislot class 14 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 15 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 16 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 17 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 18 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 19 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 20 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 21 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 22 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 23 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 24 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 25 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 26 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 27 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 28 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 29 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 1 - UL: ....1... DL: ....1... [0] + [SEQ] multislot class 2 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 3 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 4 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 5 - UL: ...11... DL: ...11... [0] + [SEQ] multislot class 6 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 7 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 8 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 9 - UL: ..11.... DL: ..111... [0] + [SEQ] multislot class 10 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 11 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 12 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 13 - UL: ..111... DL: ..111... [0] + [SEQ] multislot class 14 - UL: .1111... DL: .1111... [0] + [SEQ] multislot class 15 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 16 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 17 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 18 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 19 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 20 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 21 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 22 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 23 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 24 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 25 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 26 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 27 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 28 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 29 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 11 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 12 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ..1111.. DL: ..1111.. [0] + [SEQ] multislot class 15 - UL: .11111.. DL: .11111.. [0] + [SEQ] multislot class 16 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 17 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 18 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 19 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 20 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 21 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 22 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 23 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 24 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 25 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 26 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 27 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 28 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 29 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 1 - UL: ......1. DL: ......1. [0] + [SEQ] multislot class 2 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 3 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 4 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 5 - UL: .....11. DL: .....11. [0] + [SEQ] multislot class 6 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 7 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 9 - UL: ....11.. DL: ....111. [0] + [SEQ] multislot class 10 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 11 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 12 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 13 - UL: ....111. DL: ....111. [0] + [SEQ] multislot class 14 - UL: ...1111. DL: ...1111. [0] + [SEQ] multislot class 15 - UL: ..11111. DL: ..11111. [0] + [SEQ] multislot class 16 - UL: .111111. DL: .111111. [0] + [SEQ] multislot class 17 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 18 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 19 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 20 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 21 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 22 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 23 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 24 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 25 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 26 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 27 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 28 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 29 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_descending(): accumulative + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 1 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 2 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 3 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 4 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 5 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 6 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 7 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 8 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 9 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 10 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 11 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 12 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 13 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 14 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 15 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 16 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 17 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 18 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 19 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 20 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 21 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 22 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 23 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 24 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 25 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 26 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 27 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 28 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 29 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 30 - UL: 1....... DL: 1....... [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 11...... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 111..... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .1...... DL: 1111.... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: ..1..... DL: .1111... [0] + [ACC] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 2 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 3 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 4 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 5 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 6 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 7 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 8 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 9 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 10 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 11 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 12 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 13 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 14 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 15 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 16 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 17 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 18 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 19 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 20 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 21 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 22 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 23 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 24 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 25 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 26 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 27 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 28 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 29 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 30 - UL: ..1..... DL: ..1..... [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [ACC] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 2 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 3 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 4 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 5 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 6 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 7 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 8 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 9 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 10 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 11 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 12 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 13 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 14 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 15 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 16 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 17 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 18 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 19 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 20 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 21 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 22 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 23 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 24 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 25 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 26 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 27 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 28 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 29 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 30 - UL: ...1.... DL: ...1.... [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ....1... DL: ...1111. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_middle(): sequential + [SEQ] multislot class 0 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 11 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 12 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 15 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 16 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 17 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 18 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 19 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 20 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 21 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 22 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 23 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 24 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 25 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 26 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 27 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 28 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 29 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_middle(): accumulative + [ACC] multislot class 0 - UL: ...11... DL: ...111.. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] +test_multislot_ends(): sequential + [SEQ] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 5 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 6 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 7 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 9 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 10 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 11 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 12 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 13 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 14 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 15 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 16 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 17 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 18 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 19 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 20 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 21 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 22 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 23 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 24 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 25 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 26 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 27 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 28 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 29 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_ends(): accumulative + [ACC] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] diff --git a/tests/testsuite.at b/tests/testsuite.at index d8f8f9a..86f45a8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -9,6 +9,12 @@ AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/rlcmac/RLCMACTest], [0], [expout], [experr]) AT_CLEANUP +AT_SETUP([multi_slot]) +AT_KEYWORDS([multi_slot]) +cat $abs_srcdir/alloc/MslotTest.ok > expout +AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/alloc/MslotTest], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([ts_alloc]) AT_KEYWORDS([ts_alloc]) cat $abs_srcdir/alloc/AllocTest.ok > expout -- To view, visit https://gerrit.osmocom.org/4636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4174703808335c19341cd5b5f4422496d958967f Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Jan 24 09:33:03 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 09:33:03 +0000 Subject: [PATCH] osmo-pcu[master]: Add tests for find_multi_slots() 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/4636 to look at the new patch set (#6). Add tests for find_multi_slots() * make function public * add tests Change-Id: I4174703808335c19341cd5b5f4422496d958967f --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/Makefile.am A tests/alloc/MslotTest.cpp A tests/alloc/MslotTest.ok M tests/testsuite.at 6 files changed, 1,345 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/36/4636/6 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index aa773fc..64b6d6c 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -62,6 +62,9 @@ uint8_t block_payload; }; +/* TS allocation internal functions */ +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5e670d7..471b601 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -443,7 +443,7 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 04136f5..1595a07 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) -I$(top_srcdir)/src/ -I$(top_srcdir)/include/ AM_LDFLAGS = -lrt -check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest +check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest alloc/MslotTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest noinst_PROGRAMS = emu/pcu_emu rlcmac_RLCMACTest_SOURCES = rlcmac/RLCMACTest.cpp @@ -12,6 +12,14 @@ alloc_AllocTest_SOURCES = alloc/AllocTest.cpp alloc_AllocTest_LDADD = \ + $(top_builddir)/src/libgprs.la \ + $(LIBOSMOGB_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(COMMON_LA) + +alloc_MslotTest_SOURCES = alloc/MslotTest.cpp +alloc_MslotTest_LDADD = \ $(top_builddir)/src/libgprs.la \ $(LIBOSMOGB_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -124,7 +132,7 @@ tbf/TbfTest.ok tbf/TbfTest.err \ bitcomp/BitcompTest.ok bitcomp/BitcompTest.err \ types/TypesTest.ok types/TypesTest.err \ - ms/MsTest.ok ms/MsTest.err \ + ms/MsTest.ok ms/MsTest.err alloc/MslotTest.ok \ llc/LlcTest.ok llc/LlcTest.err \ llist/LListTest.ok llist/LListTest.err \ codel/codel_test.ok \ diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp new file mode 100644 index 0000000..d9594d2 --- /dev/null +++ b/tests/alloc/MslotTest.cpp @@ -0,0 +1,169 @@ +/* MslotTest.cpp + * + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "gprs_rlcmac.h" +#include "gprs_debug.h" +#include "tbf.h" +#include "bts.h" + +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +/* globals used by the code */ +void *tall_pcu_ctx; +int16_t spoof_mnc = 0, spoof_mcc = 0; + +static inline void test_all_classes(struct gprs_rlcmac_trx *trx, bool clear_masks) +{ + int i, rc; + uint8_t dl_slots = 0, ul_slots = 0; + + for (i = 0; i < 64; i++) { + rc = find_multi_slots(trx, i, &ul_slots, &dl_slots); + + printf(" [%s] multislot class %3u - UL: " OSMO_BIT_SPEC " DL: " OSMO_BIT_SPEC " [%d]\n", + clear_masks ? "SEQ" : "ACC", i, OSMO_BIT_PRINT(ul_slots), OSMO_BIT_PRINT(dl_slots), rc); + + if (rc == -EINVAL) + return; + + if (clear_masks) { + dl_slots = 0; + ul_slots = 0; + } + } +} + +static inline void test_multislot_total_ascending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 0; i < 8; i++) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_total_descending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 7; i >= 0; i--) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_middle(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[2].enable(); + trx->pdch[3].enable(); + trx->pdch[4].enable(); + + test_all_classes(trx, seq); +} + +static inline void test_multislot_ends(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[0].enable(); + trx->pdch[7].enable(); + + test_all_classes(trx, seq); +} + + +int main(int argc, char **argv) +{ + tall_pcu_ctx = talloc_named_const(NULL, 1, "MslotTest context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); + + osmo_init_logging(&gprs_log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_log_level(osmo_stderr_target, LOGL_DEBUG); + + test_multislot_total_ascending(true); + test_multislot_total_ascending(false); + + test_multislot_total_descending(true); + test_multislot_total_descending(false); + + test_multislot_middle(true); + test_multislot_middle(false); + + test_multislot_ends(true); + test_multislot_ends(false); + + return EXIT_SUCCESS; +} + +void l1if_pdch_req() { abort(); } diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok new file mode 100644 index 0000000..0cd50c8 --- /dev/null +++ b/tests/alloc/MslotTest.ok @@ -0,0 +1,1156 @@ +test_multislot_total_ascending(): sequential + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 5 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 6 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 7 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 9 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 10 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 11 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 12 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 13 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 14 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 15 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 16 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 17 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 18 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 19 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 20 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 21 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 22 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 23 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 24 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 25 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 26 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 27 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 28 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 29 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 7 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 10 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 11 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 12 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 13 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 14 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 15 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 16 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 17 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 18 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 19 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 20 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 21 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 22 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 23 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 24 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 25 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 26 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 27 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 28 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 29 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 11 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 12 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 15 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 16 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 17 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 18 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 19 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 20 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 21 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 22 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 23 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 24 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 25 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 26 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 27 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 28 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 29 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 16 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 17 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 18 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 17 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 18 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 18 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_ascending(): accumulative + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ......11 DL: ......11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: .....11. DL: .....111 [0] + [ACC] multislot class 1 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 2 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 3 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 4 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 5 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 6 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 7 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 8 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 9 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 10 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 11 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 12 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 13 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 14 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 15 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 16 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 17 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 18 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 19 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 20 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 21 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 22 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 23 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 24 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 25 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 26 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 27 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 28 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 29 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 30 - UL: ......1. DL: ......1. [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_total_descending(): sequential + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 1 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 4 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 5 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 6 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 7 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 8 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 9 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 10 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 11 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 12 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 13 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 14 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 15 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 16 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 17 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 18 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 19 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 20 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 21 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 22 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 23 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 24 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 25 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 26 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 27 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 28 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 29 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 1 - UL: .1...... DL: .1...... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 5 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 6 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 7 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 13 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 14 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 15 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 16 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 17 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 18 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [SEQ] multislot class 2 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 3 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 5 - UL: .11..... DL: .11..... [0] + [SEQ] multislot class 6 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 7 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 13 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 14 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 15 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 16 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 17 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 18 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [SEQ] multislot class 2 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 3 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 4 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 5 - UL: ..11.... DL: ..11.... [0] + [SEQ] multislot class 6 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 7 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 9 - UL: .11..... DL: .111.... [0] + [SEQ] multislot class 10 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 11 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 12 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 13 - UL: .111.... DL: .111.... [0] + [SEQ] multislot class 14 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 15 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 16 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 17 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 18 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 19 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 20 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 21 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 22 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 23 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 24 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 25 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 26 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 27 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 28 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 29 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 1 - UL: ....1... DL: ....1... [0] + [SEQ] multislot class 2 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 3 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 4 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 5 - UL: ...11... DL: ...11... [0] + [SEQ] multislot class 6 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 7 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 8 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 9 - UL: ..11.... DL: ..111... [0] + [SEQ] multislot class 10 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 11 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 12 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 13 - UL: ..111... DL: ..111... [0] + [SEQ] multislot class 14 - UL: .1111... DL: .1111... [0] + [SEQ] multislot class 15 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 16 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 17 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 18 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 19 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 20 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 21 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 22 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 23 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 24 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 25 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 26 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 27 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 28 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 29 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 11 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 12 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ..1111.. DL: ..1111.. [0] + [SEQ] multislot class 15 - UL: .11111.. DL: .11111.. [0] + [SEQ] multislot class 16 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 17 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 18 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 19 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 20 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 21 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 22 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 23 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 24 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 25 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 26 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 27 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 28 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 29 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 1 - UL: ......1. DL: ......1. [0] + [SEQ] multislot class 2 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 3 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 4 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 5 - UL: .....11. DL: .....11. [0] + [SEQ] multislot class 6 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 7 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 9 - UL: ....11.. DL: ....111. [0] + [SEQ] multislot class 10 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 11 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 12 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 13 - UL: ....111. DL: ....111. [0] + [SEQ] multislot class 14 - UL: ...1111. DL: ...1111. [0] + [SEQ] multislot class 15 - UL: ..11111. DL: ..11111. [0] + [SEQ] multislot class 16 - UL: .111111. DL: .111111. [0] + [SEQ] multislot class 17 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 18 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 19 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 20 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 21 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 22 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 23 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 24 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 25 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 26 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 27 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 28 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 29 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_descending(): accumulative + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 1 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 2 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 3 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 4 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 5 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 6 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 7 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 8 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 9 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 10 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 11 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 12 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 13 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 14 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 15 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 16 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 17 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 18 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 19 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 20 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 21 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 22 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 23 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 24 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 25 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 26 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 27 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 28 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 29 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 30 - UL: 1....... DL: 1....... [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 11...... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 111..... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .1...... DL: 1111.... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: ..1..... DL: .1111... [0] + [ACC] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 2 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 3 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 4 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 5 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 6 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 7 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 8 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 9 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 10 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 11 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 12 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 13 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 14 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 15 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 16 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 17 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 18 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 19 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 20 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 21 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 22 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 23 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 24 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 25 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 26 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 27 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 28 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 29 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 30 - UL: ..1..... DL: ..1..... [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [ACC] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 2 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 3 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 4 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 5 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 6 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 7 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 8 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 9 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 10 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 11 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 12 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 13 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 14 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 15 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 16 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 17 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 18 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 19 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 20 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 21 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 22 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 23 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 24 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 25 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 26 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 27 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 28 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 29 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 30 - UL: ...1.... DL: ...1.... [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ....1... DL: ...1111. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_middle(): sequential + [SEQ] multislot class 0 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 11 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 12 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 15 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 16 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 17 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 18 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 19 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 20 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 21 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 22 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 23 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 24 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 25 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 26 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 27 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 28 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 29 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_middle(): accumulative + [ACC] multislot class 0 - UL: ...11... DL: ...111.. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] +test_multislot_ends(): sequential + [SEQ] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 5 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 6 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 7 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 9 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 10 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 11 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 12 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 13 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 14 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 15 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 16 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 17 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 18 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 19 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 20 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 21 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 22 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 23 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 24 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 25 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 26 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 27 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 28 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 29 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_ends(): accumulative + [ACC] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] diff --git a/tests/testsuite.at b/tests/testsuite.at index d8f8f9a..86f45a8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -9,6 +9,12 @@ AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/rlcmac/RLCMACTest], [0], [expout], [experr]) AT_CLEANUP +AT_SETUP([multi_slot]) +AT_KEYWORDS([multi_slot]) +cat $abs_srcdir/alloc/MslotTest.ok > expout +AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/alloc/MslotTest], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([ts_alloc]) AT_KEYWORDS([ts_alloc]) cat $abs_srcdir/alloc/AllocTest.ok > expout -- To view, visit https://gerrit.osmocom.org/4636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4174703808335c19341cd5b5f4422496d958967f Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Jan 24 09:50:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 09:50:53 +0000 Subject: [PATCH] osmo-pcu[master]: Remove ASAN preprocessor warning In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6001 to look at the new patch set (#2). Remove ASAN preprocessor warning We have ASAN integrated into CI tests directly so there's no need in additional manual warnings at compile time. Change-Id: Idaabb4203a282be6779d7ab29de3f827b0ca6462 --- M src/gprs_bssgp_pcu.cpp 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/01/6001/2 diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index a86e09d..371392e 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -964,10 +964,10 @@ /* FIXME: move this to libgb: btsctx_free() */ llist_del(&the_pcu.bctx->list); -#warning "This causes ASAN to complain. It is not critical for normal operation but should be fixed nevertheless" -#if 0 - talloc_free(the_pcu.bctx); -#endif + + if (the_pcu.bctx) + talloc_free(the_pcu.bctx); + the_pcu.bctx = NULL; } -- To view, visit https://gerrit.osmocom.org/6001 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idaabb4203a282be6779d7ab29de3f827b0ca6462 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 Wed Jan 24 09:51:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 09:51:44 +0000 Subject: [PATCH] osmo-msc[master]: Log difference between SETUP and EMERGENCY_SETUP Message-ID: Review at https://gerrit.osmocom.org/6003 Log difference between SETUP and EMERGENCY_SETUP An emergency call should be logged different from a normal call, and we also increase the log level from INFO to NOTICE in such a situation. Change-Id: I83f3b8bd0aeda70f03aa7b8d264a9008d10d5687 --- M src/libmsc/gsm_04_08.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/03/6003/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3045f71..848650c 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1605,8 +1605,8 @@ new_cc_state(trans, GSM_CSTATE_INITIATED); - LOGP(DCC, LOGL_INFO, "Subscriber %s (%s) sends SETUP to %s\n", - vlr_subscr_name(trans->vsub), trans->vsub->msisdn, + LOGP(DCC, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "Subscriber %s (%s) sends %sSETUP to %s\n", + vlr_subscr_name(trans->vsub), trans->vsub->msisdn, setup.emergency ? "EMERGENCY_" : "", setup.called.number); rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]); -- To view, visit https://gerrit.osmocom.org/6003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83f3b8bd0aeda70f03aa7b8d264a9008d10d5687 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:09:10 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 10:09:10 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: adjust test log levels In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6000 to look at the new patch set (#2). TBF: adjust test log levels * enable debugging for DTBF* * disable excessive DRLCMAC* Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 2 files changed, 4,785 insertions(+), 1,175 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/00/6000/2 -- To view, visit https://gerrit.osmocom.org/6000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab 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 Wed Jan 24 10:09:10 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 10:09:10 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make UL/DL state internal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5862 to look at the new patch set (#3). TBF: make UL/DL state internal * add functions/macros for setting TBF's UL/DL state * add functions for checking TBF's UL/DL state * move pre-free check into separate function N. B: this should not be confused with TBF-UL or TBF-DL state. Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp 6 files changed, 77 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/62/5862/3 diff --git a/src/bts.cpp b/src/bts.cpp index 873af73..f614c1a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1022,11 +1022,11 @@ tbf_free(tbf); return; } - if (tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) { + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; if (!new_tbf) { @@ -1054,11 +1054,11 @@ tbf_assign_control_ts(new_tbf); return; } - if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; if (!new_tbf) { @@ -1156,10 +1156,10 @@ /* schedule uplink assignment or reject */ if (ul_tbf) { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); } else { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); } } @@ -1403,7 +1403,7 @@ ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); /* get capabilities */ if (ul_tbf->ms()) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 8925032..a87217f 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -54,11 +54,10 @@ *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) *ul_ack_tbf = ul_tbf; - if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || ul_tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = ul_tbf; /* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states? */ @@ -73,10 +72,10 @@ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; - if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = dl_tbf; } @@ -139,13 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - if (tbf == ul_ass_tbf && tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf == ul_ass_tbf && tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - if (tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else msg = ul_ass_tbf->create_ul_ass(fn, ts); diff --git a/src/tbf.cpp b/src/tbf.cpp index 699f960..0cb54bc 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -165,8 +165,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), - ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), @@ -185,6 +183,8 @@ m_ta(GSM48_TA_INVALID), m_ms_class(0), state(GPRS_RLCMAC_NULL), + dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), + ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) @@ -452,21 +452,7 @@ } LOGPTBF(tbf, LOGL_INFO, "free\n"); - if (tbf->ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending uplink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, - tbf->ul_ass_state)); - if (tbf->dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending downlink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, - tbf->dl_ass_state)); - + tbf->check_pending_ass(); tbf->stop_timers("freeing TBF"); /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); @@ -1513,7 +1499,7 @@ ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); ul_tbf->control_ts = ts; ul_tbf->trx = trx; ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0); diff --git a/src/tbf.h b/src/tbf.h index 244ddd4..2d51945 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -181,6 +181,8 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -191,7 +193,12 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; + bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; + bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); + void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); + void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; @@ -272,8 +279,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; - enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; enum gprs_rlcmac_tbf_poll_state poll_state; @@ -336,6 +341,8 @@ private: enum gprs_rlcmac_tbf_state state; + enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; + enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -368,6 +375,16 @@ return state == rhs; } +inline bool gprs_rlcmac_tbf::dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const +{ + return dl_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const +{ + return ul_ass_state == rhs; +} + inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const { return state != rhs; @@ -399,6 +416,39 @@ state = new_state; } +inline void gprs_rlcmac_tbf::set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes DL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, new_state)); + dl_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes UL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, new_state)); + ul_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::check_pending_ass() +{ + if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending uplink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state)); + + if (dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending downlink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state)); +} + inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) { if ((state_flags & (1 << state_flag))) { diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 9a0bf78..fdbbd16 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -483,7 +483,7 @@ /* check for downlink tbf: */ if (old_tbf) { LOGPTBFDL(this, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", old_tbf->name()); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(old_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 9e21c73..968f9eb 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -175,7 +175,7 @@ check_tbf(dl_tbf); /* "Establish" the DL TBF */ - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); @@ -276,7 +276,7 @@ OSMO_ASSERT(new_tbf != dl_tbf); OSMO_ASSERT(new_tbf->tfi() == 1); check_tbf(dl_tbf); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); if (test_mode == TEST_MODE_REVERSE_FREE) { GprsMs::Guard guard(ms); tbf_free(new_tbf); @@ -365,7 +365,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); printf("=== end %s ===\n", __func__); @@ -2699,7 +2699,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); } @@ -2748,7 +2748,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:09:10 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 10:09:10 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make UL ack state internal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5863 to look at the new patch set (#3). TBF: make UL ack state internal * add functions/macros for setting TBF's UL ack state * add functions for checking TBF's UL ack state N. B: this should not be confused with TBF-UL state. Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Related: OS#1539 --- M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp M tests/tbf/TbfTest.cpp 5 files changed, 38 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/63/5863/3 diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a87217f..3f9fcb1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -52,7 +52,7 @@ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; - if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) + if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; diff --git a/src/tbf.cpp b/src/tbf.cpp index 0cb54bc..b99c521 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -60,6 +60,13 @@ { 0, NULL } }; +const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_SEND_ACK), /* send acknowledge on next RTS */ + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_WAIT_ACK), /* wait for PACKET CONTROL ACK */ + { 0, NULL } +}; + static const struct value_string tbf_timers_names[] = { OSMO_VALUE_STRING(T0), OSMO_VALUE_STRING(T3169), @@ -165,7 +172,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), @@ -185,6 +191,7 @@ state(GPRS_RLCMAC_NULL), dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), + ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 2d51945..2828772 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -87,6 +87,8 @@ GPRS_RLCMAC_UL_ACK_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; +extern const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[]; + enum gprs_rlcmac_tbf_direction { GPRS_RLCMAC_DL_TBF, GPRS_RLCMAC_UL_TBF @@ -183,6 +185,7 @@ #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -195,9 +198,11 @@ bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; + bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -279,8 +284,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -343,6 +346,7 @@ enum gprs_rlcmac_tbf_state state; enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; + enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -383,6 +387,11 @@ inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const { return ul_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const +{ + return ul_ack_state == rhs; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -434,6 +443,15 @@ ul_ass_state = new_state; } +inline void gprs_rlcmac_tbf::set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes UL ACK state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, ul_ack_state), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, new_state)); + ul_ack_state = new_state; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index ba048e5..c1a3388 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -106,8 +106,8 @@ bool gprs_rlcmac_ul_tbf::handle_ctrl_ack() { /* check if this control ack belongs to packet uplink ack */ - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return true; } @@ -124,7 +124,7 @@ if (final) { if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; @@ -158,7 +158,7 @@ /* waiting for final acknowledge */ m_final_ack_sent = 1; } else - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return msg; } @@ -362,9 +362,9 @@ "Scheduling Ack/Nack, because %d frames received.\n", SEND_ACK_AFTER_FRAMES); } - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE) { + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)) { /* trigger sending at next RTS */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_SEND_ACK; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_SEND_ACK); } else { /* already triggered */ LOGPTBFUL(this, LOGL_DEBUG, diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 968f9eb..0ac519c 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1350,7 +1350,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1434,7 +1434,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1522,7 +1522,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); -- To view, visit https://gerrit.osmocom.org/5863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:09:10 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 10:09:10 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: make poll state internal In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5864 to look at the new patch set (#3). TBF: make poll state internal * add functions/macros for setting TBF's poll state * add function for checking TBF's poll state Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/poll_controller.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 7 files changed, 43 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/64/5864/3 diff --git a/src/bts.cpp b/src/bts.cpp index f614c1a..94354f2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -399,7 +399,7 @@ static inline bool tbf_check(gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t trx_no, uint8_t ts) { - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_scheduled() && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) return true; @@ -1010,7 +1010,7 @@ tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(tbf); /* check if this control ack belongs to packet uplink ack */ ul_tbf = as_ul_tbf(tbf); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 3f9fcb1..ebf4714 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -49,8 +49,7 @@ if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && ul_tbf->poll_fn == poll_fn) + if (ul_tbf->poll_scheduled() && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; @@ -69,8 +68,7 @@ if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && dl_tbf->poll_fn == poll_fn) + if (dl_tbf->poll_scheduled() && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index f8ab6c9..5c5a717 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -47,14 +47,14 @@ llist_for_each(pos, &m_bts.ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (ul_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, ul_tbf->poll_fn)) ul_tbf->poll_timeout(); } } llist_for_each(pos, &m_bts.dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (dl_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, dl_tbf->poll_fn)) dl_tbf->poll_timeout(); } diff --git a/src/tbf.cpp b/src/tbf.cpp index b99c521..672c296 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -45,6 +45,12 @@ static void tbf_timer_cb(void *_tbf); +const struct value_string gprs_rlcmac_tbf_poll_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_SCHED), /* a polling was scheduled */ + { 0, NULL } +}; + const struct value_string gprs_rlcmac_tbf_dl_ass_state_names[] = { OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_NONE), OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_SEND_ASS), @@ -172,7 +178,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), n3105(0), @@ -192,6 +197,7 @@ dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), + poll_state(GPRS_RLCMAC_POLL_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 2828772..bb5fd0a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,8 @@ GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ }; +extern const struct value_string gprs_rlcmac_tbf_poll_state_names[]; + enum gprs_rlcmac_tbf_dl_ass_state { GPRS_RLCMAC_DL_ASS_NONE = 0, GPRS_RLCMAC_DL_ASS_SEND_ASS, /* send downlink assignment on next RTS */ @@ -186,6 +188,8 @@ #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_SET(t) do { t->poll_sched_set(__FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_UNSET(t) do { t->poll_sched_unset(__FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -199,10 +203,13 @@ bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; + bool poll_scheduled() const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); + void poll_sched_set(const char *file, int line); + void poll_sched_unset(const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -284,7 +291,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -347,6 +353,7 @@ enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; + enum gprs_rlcmac_tbf_poll_state poll_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -392,6 +399,11 @@ inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const { return ul_ack_state == rhs; +} + +inline bool gprs_rlcmac_tbf::poll_scheduled() const +{ + return poll_state == GPRS_RLCMAC_POLL_SCHED; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -452,6 +464,20 @@ ul_ack_state = new_state; } +inline void gprs_rlcmac_tbf::poll_sched_set(const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_SCHED\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_SCHED; +} + +inline void gprs_rlcmac_tbf::poll_sched_unset(const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_NONE\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_NONE; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index fdbbd16..80e3831 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -635,7 +635,7 @@ /* reset N3105 */ n3105 = 0; t_stop(T3191, "ACK/NACK received"); - poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(this); return ack_recovered; } @@ -1181,7 +1181,7 @@ bool gprs_rlcmac_dl_tbf::need_control_ts() const { - if (poll_state != GPRS_RLCMAC_POLL_NONE) + if (poll_scheduled()) return false; return state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK) || diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index c1a3388..1560eb0 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -123,8 +123,7 @@ uint32_t new_poll_fn = 0; if (final) { - if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + if (poll_scheduled() && ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; -- To view, visit https://gerrit.osmocom.org/5864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:09:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 10:09:51 +0000 Subject: [PATCH] osmo-msc[master]: Emergency Call: Set MNCC_F_EMERGENCY flag Message-ID: Review at https://gerrit.osmocom.org/6004 Emergency Call: Set MNCC_F_EMERGENCY flag MNCC has a MNCC_F_EMERGENCY flag to indicate that the mncc.emergency field is present. However, OsmoMSC never sets this flag. Change-Id: I0ebd8f88e483172988f4a0cb0636b4160688d8ad Closes: OS#2865 --- M src/libmsc/gsm_04_08.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/04/6004/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 848650c..54e8bee 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1546,8 +1546,10 @@ tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); /* emergency setup is identified by msg_type */ - if (msg_type == GSM48_MT_CC_EMERG_SETUP) + if (msg_type == GSM48_MT_CC_EMERG_SETUP) { + setup.fields |= MNCC_F_EMERGENCY; setup.emergency = 1; + } /* use subscriber as calling party number */ setup.fields |= MNCC_F_CALLING; -- To view, visit https://gerrit.osmocom.org/6004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ebd8f88e483172988f4a0cb0636b4160688d8ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:25:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 10:25:16 +0000 Subject: [PATCH] osmo-msc[master]: Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT... Message-ID: Review at https://gerrit.osmocom.org/6005 Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT Cause OsmoMSC rejects an Emergency Call with IMEI as mobile identity with "semantically incorrect message" which is clearly wrong. According to TS 24.008 4.5.1.5 we should reject with cause 5 "IMEI not accepted" Found with TTCN-3 test case MSC_Tests.TC_emerg_call_imei Change-Id: I2f7ab0e32b914a112c0b17c523d149ccd0299099 Closes: #2866 --- M src/libmsc/gsm_04_08.c 1 file changed, 15 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/05/6005/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 54e8bee..90669e1 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -672,16 +672,22 @@ gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); mi_type = mi[0] & GSM_MI_TYPE_MASK; + DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n", + req->cm_service_type, gsm48_mi_type_name(mi_type), mi_string); - if (mi_type == GSM_MI_TYPE_IMSI) { - DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n", - req->cm_service_type, gsm48_mi_type_name(mi_type), - mi_string); - } else if (mi_type == GSM_MI_TYPE_TMSI) { - DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n", - req->cm_service_type, gsm48_mi_type_name(mi_type), - mi_string); - } else { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + case GSM_MI_TYPE_TMSI: + /* continue below */ + break; + case GSM_MI_TYPE_IMEI: + if (req->cm_service_type == GSM48_CMSERV_EMERGENCY) { + /* We don't do emergency calls by IMEI */ + LOGP(DMM, LOGL_NOTICE, "<- CM SERVICE REQUEST(IMEI=%s) rejected\n", mi_string); + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_IMEI_NOT_ACCEPTED); + } + /* fall-through for non-emergency setup */ + default: DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type); return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_INCORRECT_MESSAGE); -- To view, visit https://gerrit.osmocom.org/6005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2f7ab0e32b914a112c0b17c523d149ccd0299099 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:38:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 10:38:53 +0000 Subject: osmo-msc[master]: Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2f7ab0e32b914a112c0b17c523d149ccd0299099 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:38:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 10:38:58 +0000 Subject: osmo-msc[master]: Emergency Call: Set MNCC_F_EMERGENCY flag In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ebd8f88e483172988f4a0cb0636b4160688d8ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:39:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 10:39:22 +0000 Subject: osmo-msc[master]: Log difference between SETUP and EMERGENCY_SETUP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83f3b8bd0aeda70f03aa7b8d264a9008d10d5687 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:40:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 10:40:00 +0000 Subject: [PATCH] osmo-pcu[master]: Add tests for find_multi_slots() 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/4636 to look at the new patch set (#7). Add tests for find_multi_slots() * make function public * add tests Change-Id: I4174703808335c19341cd5b5f4422496d958967f --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/Makefile.am A tests/alloc/MslotTest.cpp A tests/alloc/MslotTest.ok M tests/testsuite.at 6 files changed, 1,353 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/36/4636/7 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index aa773fc..64b6d6c 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -62,6 +62,9 @@ uint8_t block_payload; }; +/* TS allocation internal functions */ +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5e670d7..471b601 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -443,7 +443,7 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 04136f5..1595a07 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) -I$(top_srcdir)/src/ -I$(top_srcdir)/include/ AM_LDFLAGS = -lrt -check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest +check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest alloc/MslotTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest noinst_PROGRAMS = emu/pcu_emu rlcmac_RLCMACTest_SOURCES = rlcmac/RLCMACTest.cpp @@ -12,6 +12,14 @@ alloc_AllocTest_SOURCES = alloc/AllocTest.cpp alloc_AllocTest_LDADD = \ + $(top_builddir)/src/libgprs.la \ + $(LIBOSMOGB_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(COMMON_LA) + +alloc_MslotTest_SOURCES = alloc/MslotTest.cpp +alloc_MslotTest_LDADD = \ $(top_builddir)/src/libgprs.la \ $(LIBOSMOGB_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -124,7 +132,7 @@ tbf/TbfTest.ok tbf/TbfTest.err \ bitcomp/BitcompTest.ok bitcomp/BitcompTest.err \ types/TypesTest.ok types/TypesTest.err \ - ms/MsTest.ok ms/MsTest.err \ + ms/MsTest.ok ms/MsTest.err alloc/MslotTest.ok \ llc/LlcTest.ok llc/LlcTest.err \ llist/LListTest.ok llist/LListTest.err \ codel/codel_test.ok \ diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp new file mode 100644 index 0000000..1fa28bf --- /dev/null +++ b/tests/alloc/MslotTest.cpp @@ -0,0 +1,177 @@ +/* MslotTest.cpp + * + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "gprs_rlcmac.h" +#include "gprs_debug.h" +#include "tbf.h" +#include "bts.h" + +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +/* globals used by the code */ +void *tall_pcu_ctx; +int16_t spoof_mnc = 0, spoof_mcc = 0; + +static inline void test_all_classes(struct gprs_rlcmac_trx *trx, bool clear_masks) +{ + int i, rc; + uint8_t dl_slots = 0, ul_slots = 0; + + for (i = 0; i < 64; i++) { + rc = find_multi_slots(trx, i, &ul_slots, &dl_slots); + + printf(" [%s] multislot class %3u - UL: " OSMO_BIT_SPEC " DL: " OSMO_BIT_SPEC " [%d]\n", + clear_masks ? "SEQ" : "ACC", i, OSMO_BIT_PRINT(ul_slots), OSMO_BIT_PRINT(dl_slots), rc); + + if (rc == -EINVAL) + return; + + if (clear_masks) { + dl_slots = 0; + ul_slots = 0; + } + } +} + +static inline void test_multislot_total_ascending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 0; i < 8; i++) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_total_descending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 7; i >= 0; i--) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_middle(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[2].enable(); + trx->pdch[3].enable(); + trx->pdch[4].enable(); + + test_all_classes(trx, seq); +} + +static inline void test_multislot_ends(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[0].enable(); + trx->pdch[7].enable(); + + test_all_classes(trx, seq); +} + + +int main(int argc, char **argv) +{ + tall_pcu_ctx = talloc_named_const(NULL, 1, "MslotTest context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); + + osmo_init_logging(&gprs_log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_log_level(osmo_stderr_target, LOGL_DEBUG); + + test_multislot_total_ascending(true); + test_multislot_total_ascending(false); + + test_multislot_total_descending(true); + test_multislot_total_descending(false); + + test_multislot_middle(true); + test_multislot_middle(false); + + test_multislot_ends(true); + test_multislot_ends(false); + + return EXIT_SUCCESS; +} + +/* + * stubs that should not be reached + */ +extern "C" { +void l1if_pdch_req() { abort(); } +void l1if_connect_pdch() { abort(); } +void l1if_close_pdch() { abort(); } +void l1if_open_pdch() { abort(); } +} diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok new file mode 100644 index 0000000..0cd50c8 --- /dev/null +++ b/tests/alloc/MslotTest.ok @@ -0,0 +1,1156 @@ +test_multislot_total_ascending(): sequential + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 5 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 6 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 7 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 9 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 10 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 11 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 12 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 13 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 14 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 15 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 16 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 17 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 18 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 19 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 20 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 21 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 22 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 23 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 24 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 25 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 26 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 27 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 28 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 29 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 7 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 10 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 11 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 12 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 13 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 14 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 15 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 16 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 17 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 18 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 19 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 20 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 21 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 22 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 23 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 24 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 25 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 26 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 27 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 28 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 29 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 11 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 12 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 15 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 16 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 17 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 18 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 19 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 20 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 21 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 22 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 23 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 24 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 25 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 26 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 27 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 28 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 29 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 16 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 17 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 18 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 17 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 18 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 18 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_ascending(): accumulative + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ......11 DL: ......11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: .....11. DL: .....111 [0] + [ACC] multislot class 1 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 2 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 3 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 4 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 5 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 6 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 7 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 8 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 9 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 10 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 11 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 12 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 13 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 14 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 15 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 16 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 17 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 18 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 19 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 20 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 21 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 22 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 23 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 24 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 25 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 26 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 27 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 28 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 29 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 30 - UL: ......1. DL: ......1. [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_total_descending(): sequential + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 1 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 4 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 5 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 6 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 7 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 8 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 9 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 10 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 11 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 12 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 13 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 14 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 15 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 16 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 17 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 18 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 19 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 20 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 21 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 22 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 23 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 24 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 25 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 26 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 27 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 28 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 29 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 1 - UL: .1...... DL: .1...... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 5 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 6 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 7 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 13 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 14 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 15 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 16 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 17 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 18 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [SEQ] multislot class 2 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 3 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 5 - UL: .11..... DL: .11..... [0] + [SEQ] multislot class 6 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 7 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 13 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 14 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 15 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 16 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 17 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 18 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [SEQ] multislot class 2 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 3 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 4 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 5 - UL: ..11.... DL: ..11.... [0] + [SEQ] multislot class 6 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 7 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 9 - UL: .11..... DL: .111.... [0] + [SEQ] multislot class 10 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 11 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 12 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 13 - UL: .111.... DL: .111.... [0] + [SEQ] multislot class 14 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 15 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 16 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 17 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 18 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 19 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 20 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 21 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 22 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 23 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 24 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 25 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 26 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 27 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 28 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 29 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 1 - UL: ....1... DL: ....1... [0] + [SEQ] multislot class 2 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 3 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 4 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 5 - UL: ...11... DL: ...11... [0] + [SEQ] multislot class 6 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 7 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 8 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 9 - UL: ..11.... DL: ..111... [0] + [SEQ] multislot class 10 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 11 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 12 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 13 - UL: ..111... DL: ..111... [0] + [SEQ] multislot class 14 - UL: .1111... DL: .1111... [0] + [SEQ] multislot class 15 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 16 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 17 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 18 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 19 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 20 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 21 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 22 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 23 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 24 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 25 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 26 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 27 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 28 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 29 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 11 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 12 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ..1111.. DL: ..1111.. [0] + [SEQ] multislot class 15 - UL: .11111.. DL: .11111.. [0] + [SEQ] multislot class 16 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 17 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 18 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 19 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 20 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 21 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 22 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 23 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 24 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 25 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 26 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 27 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 28 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 29 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 1 - UL: ......1. DL: ......1. [0] + [SEQ] multislot class 2 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 3 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 4 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 5 - UL: .....11. DL: .....11. [0] + [SEQ] multislot class 6 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 7 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 9 - UL: ....11.. DL: ....111. [0] + [SEQ] multislot class 10 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 11 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 12 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 13 - UL: ....111. DL: ....111. [0] + [SEQ] multislot class 14 - UL: ...1111. DL: ...1111. [0] + [SEQ] multislot class 15 - UL: ..11111. DL: ..11111. [0] + [SEQ] multislot class 16 - UL: .111111. DL: .111111. [0] + [SEQ] multislot class 17 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 18 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 19 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 20 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 21 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 22 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 23 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 24 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 25 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 26 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 27 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 28 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 29 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_descending(): accumulative + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 1 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 2 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 3 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 4 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 5 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 6 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 7 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 8 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 9 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 10 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 11 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 12 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 13 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 14 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 15 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 16 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 17 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 18 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 19 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 20 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 21 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 22 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 23 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 24 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 25 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 26 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 27 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 28 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 29 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 30 - UL: 1....... DL: 1....... [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 11...... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 111..... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .1...... DL: 1111.... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: ..1..... DL: .1111... [0] + [ACC] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 2 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 3 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 4 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 5 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 6 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 7 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 8 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 9 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 10 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 11 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 12 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 13 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 14 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 15 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 16 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 17 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 18 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 19 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 20 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 21 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 22 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 23 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 24 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 25 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 26 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 27 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 28 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 29 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 30 - UL: ..1..... DL: ..1..... [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [ACC] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 2 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 3 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 4 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 5 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 6 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 7 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 8 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 9 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 10 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 11 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 12 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 13 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 14 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 15 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 16 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 17 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 18 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 19 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 20 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 21 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 22 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 23 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 24 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 25 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 26 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 27 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 28 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 29 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 30 - UL: ...1.... DL: ...1.... [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ....1... DL: ...1111. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_middle(): sequential + [SEQ] multislot class 0 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 11 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 12 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 15 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 16 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 17 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 18 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 19 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 20 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 21 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 22 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 23 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 24 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 25 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 26 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 27 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 28 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 29 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_middle(): accumulative + [ACC] multislot class 0 - UL: ...11... DL: ...111.. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] +test_multislot_ends(): sequential + [SEQ] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 5 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 6 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 7 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 9 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 10 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 11 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 12 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 13 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 14 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 15 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 16 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 17 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 18 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 19 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 20 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 21 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 22 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 23 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 24 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 25 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 26 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 27 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 28 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 29 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_ends(): accumulative + [ACC] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] diff --git a/tests/testsuite.at b/tests/testsuite.at index d8f8f9a..86f45a8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -9,6 +9,12 @@ AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/rlcmac/RLCMACTest], [0], [expout], [experr]) AT_CLEANUP +AT_SETUP([multi_slot]) +AT_KEYWORDS([multi_slot]) +cat $abs_srcdir/alloc/MslotTest.ok > expout +AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/alloc/MslotTest], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([ts_alloc]) AT_KEYWORDS([ts_alloc]) cat $abs_srcdir/alloc/AllocTest.ok > expout -- To view, visit https://gerrit.osmocom.org/4636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4174703808335c19341cd5b5f4422496d958967f Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Jan 24 10:48:25 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Jan 2018 10:48:25 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: fix use-after-free and add callback for endpoint cleanup Message-ID: Review at https://gerrit.osmocom.org/6006 mgcp: fix use-after-free and add callback for endpoint cleanup Since we will support multiple different types of endpoints in the future, all these endpoints will handle connections slightly different and there will be possibly state that needs to be kept consistant when a connection is deleted. In mgcp_network.c where we implement the callback that is used to create an rtp-bride-endpoint. In that callback we cache the pointer of the connection we where we want to bride to (opposite connection). When one of the connections is deleted using a DLCX operation, the pointer is still there and the next incoming packet causes a use- after-free segfault. - introduce an endpoint specific callback function that is executed before removing the connection. - implement the endpoint specific callback for rtp bridge endpoints, so that the use-after-free is prevented. Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f --- M include/osmocom/mgcp/mgcp_ep.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_ep.c M src/libosmo-mgcp/mgcp_network.c 5 files changed, 38 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/6006/1 diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h index e477a47..a7a6bb1 100644 --- a/include/osmocom/mgcp/mgcp_ep.h +++ b/include/osmocom/mgcp/mgcp_ep.h @@ -25,12 +25,20 @@ struct sockaddr_in; struct mgcp_conn; +struct mgcp_endpoint; /* Callback type for RTP dispatcher functions (e.g mgcp_dispatch_rtp_bridge_cb, see below) */ typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in * addr, char *buf, unsigned int buf_size, struct mgcp_conn * conn); + +/* Callback type for endpoint specific cleanup actions. This function + * is automatically executed when a connection is freed (see mgcp_conn_free() + * in mgcp_conn.c). Depending on the type of the endpoint there may be endpoint + * specific things to take care of once a connection has been removed. */ +typedef void (*mgcp_cleanup_cp) (struct mgcp_endpoint *endp, + struct mgcp_conn *conn); /*! MGCP endpoint properties */ struct mgcp_endpoint_type { @@ -39,6 +47,9 @@ /*!< callback that defines how to dispatch incoming RTP data */ mgcp_dispatch_rtp_cb dispatch_rtp_cb; + + /*!< callback that implements endpoint specific cleanup actions */ + mgcp_cleanup_cp cleanup_cb; }; /*! MGCP endpoint typeset */ diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index c0ee556..5de28ee 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -285,6 +285,7 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn); int mgcp_dispatch_rtp_bridge_cb(int proto, struct sockaddr_in *addr, char *buf, unsigned int buf_size, struct mgcp_conn *conn); +void mgcp_cleanup_rtp_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn); int mgcp_bind_net_rtp_port(struct mgcp_endpoint *endp, int rtp_port, struct mgcp_conn_rtp *conn); void mgcp_free_rtp_port(struct mgcp_rtp_end *end); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index a136fda..b542b70 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -201,6 +201,11 @@ if (!conn) return; + /* Run endpoint cleanup action. By this we inform the endpoint about + * the removal of the connection and allow it to clean up its inner + * state accordingly */ + endp->type->cleanup_cb(endp, conn); + switch (conn->type) { case MGCP_CONN_TYPE_RTP: osmux_disable_conn(&conn->u.rtp); diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_ep.c index 72ca691..9d0dbbc 100644 --- a/src/libosmo-mgcp/mgcp_ep.c +++ b/src/libosmo-mgcp/mgcp_ep.c @@ -28,5 +28,6 @@ const struct mgcp_endpoint_typeset ep_typeset = { /* Specify endpoint properties for RTP endpoint */ .rtp.max_conns = 2, - .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb + .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb, + .rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb }; diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 6cecbb0..4e22e63 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -1043,6 +1043,25 @@ } +/*! cleanup an endpoint when a connection on an RTP bridge endpoint is removed. + * \param[in] endp Endpoint on which the connection resides. + * \param[in] conn Connection that is about to be removed (ignored). + * \returns 0 on success, -1 on ERROR. */ +void mgcp_cleanup_rtp_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn) +{ + struct mgcp_conn *conn_cleanup; + + /* In mgcp_dispatch_rtp_bridge_cb() we use conn->priv to cache the + * pointer to the destination connection, so that we do not have + * to go through the list every time an RTP packet arrives. To prevent + * a use-after-free situation we invalidate this information for all + * connections present when one connection is removed from the + * endpoint. */ + llist_for_each_entry(conn_cleanup, &endp->conns, entry) { + conn_cleanup->priv = NULL; + } +} + /* Handle incoming RTP data from NET */ static int rtp_data_net(struct osmo_fd *fd, unsigned int what) { -- To view, visit https://gerrit.osmocom.org/6006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:00:41 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Jan 2018 11:00:41 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: remove spaces from pointer symbol Message-ID: Review at https://gerrit.osmocom.org/6007 cosmetic: remove spaces from pointer symbol Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 --- M include/osmocom/mgcp/mgcp_ep.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/07/6007/1 diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h index a7a6bb1..0216ff8 100644 --- a/include/osmocom/mgcp/mgcp_ep.h +++ b/include/osmocom/mgcp/mgcp_ep.h @@ -29,9 +29,9 @@ /* Callback type for RTP dispatcher functions (e.g mgcp_dispatch_rtp_bridge_cb, see below) */ -typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in * addr, +typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in *addr, char *buf, unsigned int buf_size, - struct mgcp_conn * conn); + struct mgcp_conn *conn); /* Callback type for endpoint specific cleanup actions. This function * is automatically executed when a connection is freed (see mgcp_conn_free() -- To view, visit https://gerrit.osmocom.org/6007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:00:41 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 24 Jan 2018 11:00:41 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: move mgcp_release_endp() to mgcp_ep.c Message-ID: Review at https://gerrit.osmocom.org/6008 cosmetic: move mgcp_release_endp() to mgcp_ep.c - move mgcp_release_endp() to mgcp_ep.c since it is clearly an endpoint sicific function. Change-Id: I0a65b6e906c52a9e7cd75c88c4cbe1bf473b866b --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_ep.h M src/libosmo-mgcp/mgcp_ep.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_vty.c M src/osmo-mgw/mgw_main.c 6 files changed, 27 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/08/6008/1 diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index 0d156c6..bdc8f87 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -222,7 +222,6 @@ enum mgcp_role role); int mgcp_vty_init(void); int mgcp_endpoints_allocate(struct mgcp_trunk_config *cfg); -void mgcp_release_endp(struct mgcp_endpoint *endp); void mgcp_trunk_set_keepalive(struct mgcp_trunk_config *tcfg, int interval); /* diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h index 0216ff8..7b4ccee 100644 --- a/include/osmocom/mgcp/mgcp_ep.h +++ b/include/osmocom/mgcp/mgcp_ep.h @@ -59,3 +59,5 @@ /*! static MGCP endpoint typeset (pre-initalized, read-only) */ extern const struct mgcp_endpoint_typeset ep_typeset; + +void mgcp_release_endp(struct mgcp_endpoint *endp); diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_ep.c index 9d0dbbc..e23d0f1 100644 --- a/src/libosmo-mgcp/mgcp_ep.c +++ b/src/libosmo-mgcp/mgcp_ep.c @@ -31,3 +31,26 @@ .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb, .rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb }; + +/*! release endpoint, all open connections are closed. + * \param[in] endp endpoint to release */ +void mgcp_release_endp(struct mgcp_endpoint *endp) +{ + LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n", + ENDPOINT_NUMBER(endp)); + + /* Normally this function should only be called when + * all connections have been removed already. In case + * that there are still connections open (e.g. when + * RSIP is executed), free them all at once. */ + mgcp_conn_free_all(endp); + + /* Reset endpoint parameters and states */ + talloc_free(endp->callid); + endp->callid = NULL; + talloc_free(endp->local_options.string); + endp->local_options.string = NULL; + talloc_free(endp->local_options.codec); + endp->local_options.codec = NULL; + endp->wildcarded_crcx = false; +} diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 73d7f5e..bae8c9d 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -1213,29 +1213,6 @@ return 0; } -/*! release endpoint, all open connections are closed. - * \param[in] endp endpoint to release */ -void mgcp_release_endp(struct mgcp_endpoint *endp) -{ - LOGP(DLMGCP, LOGL_DEBUG, "Releasing endpoint:0x%x\n", - ENDPOINT_NUMBER(endp)); - - /* Normally this function should only be called when - * all connections have been removed already. In case - * that there are still connections open (e.g. when - * RSIP is executed), free them all at once. */ - mgcp_conn_free_all(endp); - - /* Reset endpoint parameters and states */ - talloc_free(endp->callid); - endp->callid = NULL; - talloc_free(endp->local_options.string); - endp->local_options.string = NULL; - talloc_free(endp->local_options.codec); - endp->local_options.codec = NULL; - endp->wildcarded_crcx = false; -} - static int send_agent(struct mgcp_config *cfg, const char *buf, int len) { return write(cfg->gw_fd.bfd.fd, buf, len); diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 7043527..99780c8 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -27,6 +27,7 @@ #include #include #include +#include #include diff --git a/src/osmo-mgw/mgw_main.c b/src/osmo-mgw/mgw_main.c index a2714e0..8e956e4 100644 --- a/src/osmo-mgw/mgw_main.c +++ b/src/osmo-mgw/mgw_main.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include -- To view, visit https://gerrit.osmocom.org/6008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a65b6e906c52a9e7cd75c88c4cbe1bf473b866b Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:32:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 11:32:36 +0000 Subject: [MERGED] libosmocore[master]: fsm: add functions for unlinking and changing parents In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fsm: add functions for unlinking and changing parents ...................................................................... fsm: add functions for unlinking and changing parents At the moment it is not possible to unlink a child from from its parent, nor is it possible to assign a new parent to a child FSM. - osmo_fsm_inst_unlink_parent(): Make it possible to unlink childs from a parent. - osmo_fsm_inst_change_parent(): Make it possible to change the parent of a child. Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef --- M include/osmocom/core/fsm.h M src/fsm.c 2 files changed, 38 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2fbb250..8f550d1 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -150,6 +150,10 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event); +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx); +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event); void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); diff --git a/src/fsm.c b/src/fsm.c index f9effc4..d8751c9 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -272,13 +272,44 @@ LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); - fi->proc.parent = parent; - fi->proc.parent_term_event = parent_term_event; - llist_add(&fi->proc.child, &parent->proc.children); + osmo_fsm_inst_change_parent(fi, parent, parent_term_event); return fi; } +/*! unlink child FSM from its parent FSM. + * \param[in] fi Descriptor of the child FSM to unlink. + * \param[in] ctx New talloc context */ +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx) +{ + if (fi->proc.parent) { + talloc_steal(ctx, fi); + fi->proc.parent = NULL; + fi->proc.parent_term_event = 0; + llist_del(&fi->proc.child); + } +} + +/*! change parent instance of an FSM. + * \param[in] fi Descriptor of the to-be-allocated FSM. + * \param[in] new_parent New parent FSM instance. + * \param[in] new_parent_term_event Event to be sent to parent when terminating. */ +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event) +{ + /* Make sure a possibly existing old parent is unlinked first + * (new_parent can be NULL) */ + osmo_fsm_inst_unlink_parent(fi, new_parent); + + /* Add new parent */ + if (new_parent) { + fi->proc.parent = new_parent; + fi->proc.parent_term_event = new_parent_term_event; + llist_add(&fi->proc.child, &new_parent->proc.children); + } +} + /*! delete a given instance of a FSM * \param[in] fsm The FSM to be un-registered and deleted */ -- To view, visit https://gerrit.osmocom.org/5832 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:33:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 11:33:02 +0000 Subject: libosmocore[master]: jenkins: remove obsolete scripts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifbd253cff88c3ac18e469c34e79f1501501e1657 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:33:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 11:33:04 +0000 Subject: libosmocore[master]: jenkins: move make invocation into shared function In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:33:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 11:33:24 +0000 Subject: [MERGED] libosmocore[master]: jenkins: move make invocation into shared function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: move make invocation into shared function ...................................................................... jenkins: move make invocation into shared function Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 --- M contrib/jenkins_amd64.sh M contrib/jenkins_arm.sh M contrib/jenkins_common.sh 3 files changed, 8 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_amd64.sh b/contrib/jenkins_amd64.sh index d336f0a..ff1cfdc 100755 --- a/contrib/jenkins_amd64.sh +++ b/contrib/jenkins_amd64.sh @@ -15,9 +15,9 @@ prep_build "$src_dir" "$build_dir" - "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" - $MAKE V=1 $PARALLEL_MAKE check \ - || cat-testlogs.sh + "$src_dir"/configure --disable-silent-rules --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + + run_make } # verify build in dir other than source tree diff --git a/contrib/jenkins_arm.sh b/contrib/jenkins_arm.sh index acdbe3c..4579596 100755 --- a/contrib/jenkins_arm.sh +++ b/contrib/jenkins_arm.sh @@ -16,8 +16,7 @@ --disable-shared \ CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - $MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh + run_make } # verify build in dir other than source tree diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index a6ffe7f..fa1d544 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -26,3 +26,7 @@ mkdir -p "$_build_dir" cd "$_build_dir" } + +run_make() { + $MAKE $PARALLEL_MAKE check || cat-testlogs.sh +} -- To view, visit https://gerrit.osmocom.org/5874 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ied8c1085b8bee2cc4fa65592e805838b8cdae287 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 Jan 24 11:33:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 11:33:24 +0000 Subject: [MERGED] libosmocore[master]: jenkins: remove obsolete scripts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins: remove obsolete scripts ...................................................................... jenkins: remove obsolete scripts * jenkins.sh is superseded by jenkins_amd64.sh * jenkins-arm.sh is superseded by jenkins_arm.sh N. B: this requires I76dfc11a05007ae5c6e0554fe8132695b67cccaa in osmo-ci. Change-Id: Ifbd253cff88c3ac18e469c34e79f1501501e1657 --- D contrib/jenkins-arm.sh D contrib/jenkins.sh 2 files changed, 0 insertions(+), 61 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins-arm.sh b/contrib/jenkins-arm.sh deleted file mode 100755 index acdbe3c..0000000 --- a/contrib/jenkins-arm.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -. $(dirname "$0")/jenkins_common.sh - -src_dir="$PWD" -build() { - build_dir="$1" - - prep_build "$src_dir" "$build_dir" - - "$src_dir"/configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-doxygen \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" - - $MAKE $PARALLEL_MAKE \ - || cat-testlogs.sh -} - -# verify build in dir other than source tree -build builddir -# verify build in source tree -build . - -osmo-clean-workspace.sh diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh deleted file mode 100755 index c341d05..0000000 --- a/contrib/jenkins.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# jenkins build helper script for libosmo-sccp. This is how we build on jenkins.osmocom.org - -. $(dirname "$0")/jenkins_common.sh - -ENABLE_SANITIZE="--enable-sanitize" - -if [ "x$label" = "xFreeBSD_amd64" ]; then - ENABLE_SANITIZE="" -fi - -src_dir="$PWD" -build() { - build_dir="$1" - - prep_build "$src_dir" "$build_dir" - - "$src_dir"/configure --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" - $MAKE V=1 $PARALLEL_MAKE check \ - || cat-testlogs.sh -} - -# verify build in dir other than source tree -build builddir -# verify build in source tree -build . - -# do distcheck only once, which is fine from built source tree, since distcheck -# is well separated from the source tree state. -$MAKE distcheck \ - || cat-testlogs.sh - -osmo-clean-workspace.sh -- To view, visit https://gerrit.osmocom.org/5886 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifbd253cff88c3ac18e469c34e79f1501501e1657 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 Jan 24 11:35:36 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 11:35:36 +0000 Subject: [PATCH] libosmocore[master]: GSUP: change osmo_gsup_encode() return type Message-ID: Review at https://gerrit.osmocom.org/6009 GSUP: change osmo_gsup_encode() return type * match return type of osmo_gsup_encode() with osmo_gsup_decode() to allow propagating error to caller * check return value of osmo_gsup_encode() in GSUP test * return errors instead of braking app with aseert Change-Id: Idaa1deecb6d9e15329bd51867b4f6a03357461f0 Related: OS#2864 --- M include/osmocom/gsm/gsup.h M src/gsm/gsup.c M tests/gsup/gsup_test.c 3 files changed, 13 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/09/6009/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 5cfe1ec..1a8a3b2 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -179,6 +179,6 @@ int osmo_gsup_decode(const uint8_t *data, size_t data_len, struct osmo_gsup_message *gsup_msg); -void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg); +int osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg); /*! @} */ diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index eb829f7..b6ac56d 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -475,8 +475,9 @@ /*! Encode a GSUP message * \param[out] msg message buffer to which encoded message is written * \param[in] gsup_msg \ref osmo_gsup_message data to be encoded + * \returns 0 on success; negative otherwise */ -void osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg) +int osmo_gsup_encode(struct msgb *msg, const struct osmo_gsup_message *gsup_msg) { uint8_t u8; int idx; @@ -484,14 +485,16 @@ size_t bcd_len; /* generic part */ - OSMO_ASSERT(gsup_msg->message_type); + if(!gsup_msg->message_type) + return -ENOMEM; + msgb_v_put(msg, gsup_msg->message_type); bcd_len = gsm48_encode_bcd_number(bcd_buf, sizeof(bcd_buf), 0, gsup_msg->imsi); - OSMO_ASSERT(bcd_len > 1); - OSMO_ASSERT(bcd_len <= sizeof(bcd_buf)); + if (bcd_len <= 0 || bcd_len > sizeof(bcd_buf)) + return -EINVAL; /* Note that gsm48_encode_bcd_number puts the length into the first * octet. Since msgb_tlv_put will add this length byte, we'll have to @@ -560,6 +563,8 @@ msgb_tlv_put(msg, OSMO_GSUP_CHARG_CHAR_IE, gsup_msg->pdp_charg_enc_len, gsup_msg->pdp_charg_enc); } + + return 0; } /*! @} */ diff --git a/tests/gsup/gsup_test.c b/tests/gsup/gsup_test.c index eddcc92..b55f1d9 100644 --- a/tests/gsup/gsup_test.c +++ b/tests/gsup/gsup_test.c @@ -220,7 +220,9 @@ if (rc < 0) passed = false; - osmo_gsup_encode(msg, &gm); + rc = osmo_gsup_encode(msg, &gm); + if (rc < 0) + passed = false; fprintf(stderr, " generated message: %s\n", msgb_hexdump(msg)); fprintf(stderr, " original message: %s\n", osmo_hexdump(t->data, t->data_len)); -- To view, visit https://gerrit.osmocom.org/6009 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idaa1deecb6d9e15329bd51867b4f6a03357461f0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:50:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 11:50:01 +0000 Subject: [PATCH] osmo-msc[master]: GSUP: check osmo_gsup_encode() result Message-ID: Review at https://gerrit.osmocom.org/6010 GSUP: check osmo_gsup_encode() result Check and handle gracefully any error which might appear in osmo_gsup_encode() N. B: requires Idaa1deecb6d9e15329bd51867b4f6a03357461f0 in libosmocore. Change-Id: I4551212011fb0bd898c020a183756ed7a9afb9e5 Related: OS#2864 --- M src/libcommon/gsup_test_client.c M src/libvlr/vlr.c 2 files changed, 23 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/10/6010/1 diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index 5576292..ceac414 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -106,11 +106,16 @@ struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_SAI); struct osmo_gsup_message gsup = {0}; struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; - osmo_gsup_encode(msg, &gsup); + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } return gsup_client_send(g_gc, msg); } @@ -121,11 +126,16 @@ struct imsi_op *io = imsi_op_alloc(g_gc, imsi, IMSI_OP_LU); struct osmo_gsup_message gsup = {0}; struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; - osmo_gsup_encode(msg, &gsup); + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", imsi, strerror(-rc)); + return rc; + } return gsup_client_send(g_gc, msg); } @@ -134,11 +144,16 @@ { struct osmo_gsup_message gsup = {0}; struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); + int rc; osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; - osmo_gsup_encode(msg, &gsup); + rc = osmo_gsup_encode(msg, &gsup); + if (rc < 0) { + printf("%s: encoding failure (%s)\n", io->imsi, strerror(-rc)); + return rc; + } imsi_op_release(io); diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index f57df8e..a87c4b2 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -130,7 +130,11 @@ { struct msgb *msg = gsup_client_msgb_alloc(); - osmo_gsup_encode(msg, gsup_msg); + int rc = osmo_gsup_encode(msg, gsup_msg); + if (rc < 0) { + LOGP(DVLR, LOGL_ERROR, "GSUP encoding failure: %s\n", strerror(-rc)); + return rc; + } if (!vlr->gsup_client) { LOGP(DVLR, LOGL_NOTICE, "GSUP link is down, cannot " -- To view, visit https://gerrit.osmocom.org/6010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4551212011fb0bd898c020a183756ed7a9afb9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 11:50:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 11:50:43 +0000 Subject: [PATCH] osmo-msc[master]: Reject any CM SERVICE we don't support Message-ID: Review at https://gerrit.osmocom.org/6011 Reject any CM SERVICE we don't support When we receive a CM Service Request, OsmoMSC should eventually verify what kind of service it is the phone requests, and whether we support that service. Change-Id: I499730d760dc9ac7f599e09959c6eac4452f2eab Closes: OS#2668 --- M src/libmsc/gsm_04_08.c 1 file changed, 11 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/11/6011/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90669e1..ea40a96 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -693,6 +693,17 @@ GSM48_REJECT_INCORRECT_MESSAGE); } + switch (req->cm_service_type) { + case GSM48_CMSERV_MO_CALL_PACKET: + case GSM48_CMSERV_EMERGENCY: + case GSM48_CMSERV_SMS: + case GSM48_CMSERV_SUP_SERV: + /* continue below */ + break; + default: + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED); + } + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len)); memcpy(conn->classmark.classmark2, classmark2, classmark2_len); conn->classmark.classmark2_len = classmark2_len; -- To view, visit https://gerrit.osmocom.org/6011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I499730d760dc9ac7f599e09959c6eac4452f2eab Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:16:37 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:16:37 +0000 Subject: [PATCH] libosmocore[master]: Apply fixes suggested by shellcheck Message-ID: Review at https://gerrit.osmocom.org/6012 Apply fixes suggested by shellcheck Change-Id: Ic33fcc707a2913dbc4c7c23ee35ba4c8bc8a3a89 --- M contrib/jenkins_arch.sh M contrib/jenkins_common.sh 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/12/6012/1 diff --git a/contrib/jenkins_arch.sh b/contrib/jenkins_arch.sh index bac9278..5bf4bd3 100755 --- a/contrib/jenkins_arch.sh +++ b/contrib/jenkins_arch.sh @@ -4,7 +4,7 @@ arch="$1" -if [ "x$arch" == "x" ]; then +if [ "x$arch" = "x" ]; then echo "Error: You have to specify the architecture as first argument, e.g. $0 amd64" exit 2 fi diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index fa1d544..41c7fb4 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -28,5 +28,5 @@ } run_make() { - $MAKE $PARALLEL_MAKE check || cat-testlogs.sh + $MAKE "$PARALLEL_MAKE" check || cat-testlogs.sh } -- To view, visit https://gerrit.osmocom.org/6012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic33fcc707a2913dbc4c7c23ee35ba4c8bc8a3a89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:16:40 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:16:40 +0000 Subject: [PATCH] libosmocore[master]: Add generic configure step Message-ID: Review at https://gerrit.osmocom.org/6013 Add generic configure step Add function to run ./configure and use it from arch-specific scripts. Change-Id: Ibb2f018780c82d798ff0e8a0a836d1aa8d0d7670 --- M contrib/jenkins_amd64.sh M contrib/jenkins_arm.sh M contrib/jenkins_common.sh 3 files changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/13/6013/1 diff --git a/contrib/jenkins_amd64.sh b/contrib/jenkins_amd64.sh index ff1cfdc..a1e37b4 100755 --- a/contrib/jenkins_amd64.sh +++ b/contrib/jenkins_amd64.sh @@ -15,7 +15,10 @@ prep_build "$src_dir" "$build_dir" - "$src_dir"/configure --disable-silent-rules --enable-static $ENABLE_SANITIZE CFLAGS="-Werror" CPPFLAGS="-Werror" + _c_flags="-Werror" + _cpp_flags="-Werror" + _conf="--disable-silent-rules --enable-static $ENABLE_SANITIZE" + run_configure "$src_dir" "$_conf" "$_c_flags" "$_cpp_flags" run_make } diff --git a/contrib/jenkins_arm.sh b/contrib/jenkins_arm.sh index 4579596..0c5a507 100755 --- a/contrib/jenkins_arm.sh +++ b/contrib/jenkins_arm.sh @@ -8,13 +8,10 @@ prep_build "$src_dir" "$build_dir" - "$src_dir"/configure --enable-static \ - --prefix=/usr/local/arm-none-eabi \ - --host=arm-none-eabi \ - --enable-embedded \ - --disable-doxygen \ - --disable-shared \ - CFLAGS="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + _c_flags="-Os -ffunction-sections -fdata-sections -nostartfiles -nodefaultlibs -Werror" + _cpp_flags="" + _conf="--enable-static --prefix=/usr/local/arm-none-eabi --host=arm-none-eabi --enable-embedded --disable-doxygen --disable-shared" + run_configure "$src_dir" "$_conf" "$_c_flags" "$_cpp_flags" run_make } diff --git a/contrib/jenkins_common.sh b/contrib/jenkins_common.sh index 41c7fb4..5a54eeb 100644 --- a/contrib/jenkins_common.sh +++ b/contrib/jenkins_common.sh @@ -27,6 +27,15 @@ cd "$_build_dir" } +run_configure() { + _src_dir="$1" + _conf_flags="$2" + _c_flags="$3" + _cpp_flags="$4" + + "$_src_dir"/configure "$_conf_flags" CFLAGS="$_c_flags" CPPFLAGS="$_cpp_flags" +} + run_make() { $MAKE "$PARALLEL_MAKE" check || cat-testlogs.sh } -- To view, visit https://gerrit.osmocom.org/6013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibb2f018780c82d798ff0e8a0a836d1aa8d0d7670 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:25:58 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:25:58 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: enable sanitize for CI tests Message-ID: Review at https://gerrit.osmocom.org/6014 osmo-bts-trx: enable sanitize for CI tests Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed --- M contrib/jenkins_bts_trx.sh 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/6014/1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 7309ba0..b78d2b0 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -19,6 +19,7 @@ configure_flags="\ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ + --enable-sanitize \ " build_bts "osmo-bts-trx" "$configure_flags" -- To view, visit https://gerrit.osmocom.org/6014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:28:39 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:28:39 +0000 Subject: [PATCH] osmo-bts[master]: CI: drop unused OsmoPCU dependency Message-ID: Review at https://gerrit.osmocom.org/6015 CI: drop unused OsmoPCU dependency The independent copy of pcuif_proto.h file is used by OsmoBTS so we don't have to checkout OsmoPCU to obtain it. Change-Id: If8d7330adf3edc44c3b49b1f6e854cce0eca2d8e --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct_and_bts_trx.sh 2 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/15/6015/1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 7309ba0..05726d8 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -13,9 +13,6 @@ cd "$deps" -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - configure_flags="\ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index fef9f5d..f68a9d3 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -13,9 +13,6 @@ cd "$deps" -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" configure_flags="\ -- To view, visit https://gerrit.osmocom.org/6015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If8d7330adf3edc44c3b49b1f6e854cce0eca2d8e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:32:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:32:59 +0000 Subject: [PATCH] osmo-bts[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6014 to look at the new patch set (#2). Enable sanitize for CI tests Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh 4 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/14/6014/2 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh index 7309ba0..b78d2b0 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -19,6 +19,7 @@ configure_flags="\ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ + --enable-sanitize \ " build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index 11cf934..38c1f33 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -14,7 +14,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" +configure_flags="--enable-sanitize --with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4595c0d..efbd368 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -14,7 +14,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" +configure_flags="--enable-sanitize --with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 3e07050..7488419 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts --with-sysmobts=$inst/include/" +configure_flags="--enable-sanitize --enable-sysmocom-bts --with-sysmobts=$inst/include/" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/6014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:35:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:35:19 +0000 Subject: osmo-bts[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed 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 Wed Jan 24 12:35:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:35:52 +0000 Subject: osmo-bts[master]: CI: drop unused OsmoPCU dependency In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If8d7330adf3edc44c3b49b1f6e854cce0eca2d8e 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 Jan 24 12:36:31 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:36:31 +0000 Subject: [MERGED] osmo-bts[master]: CI: drop unused OsmoPCU dependency In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: CI: drop unused OsmoPCU dependency ...................................................................... CI: drop unused OsmoPCU dependency The independent copy of pcuif_proto.h file is used by OsmoBTS so we don't have to checkout OsmoPCU to obtain it. Change-Id: If8d7330adf3edc44c3b49b1f6e854cce0eca2d8e --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_oct_and_bts_trx.sh 2 files changed, 0 insertions(+), 6 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 7309ba0..05726d8 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -13,9 +13,6 @@ cd "$deps" -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - configure_flags="\ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh index fef9f5d..f68a9d3 100755 --- a/contrib/jenkins_oct_and_bts_trx.sh +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -13,9 +13,6 @@ cd "$deps" -# Get osmo-pcu for pcuif_proto.h -osmo-deps.sh osmo-pcu - osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" configure_flags="\ -- To view, visit https://gerrit.osmocom.org/6015 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If8d7330adf3edc44c3b49b1f6e854cce0eca2d8e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:36:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:36:45 +0000 Subject: [MERGED] osmo-bts[master]: Enable sanitize for CI tests In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Enable sanitize for CI tests ...................................................................... Enable sanitize for CI tests Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed --- M contrib/jenkins_bts_trx.sh M contrib/jenkins_lc15.sh M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh 4 files changed, 4 insertions(+), 3 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 05726d8..3e3d8d3 100755 --- a/contrib/jenkins_bts_trx.sh +++ b/contrib/jenkins_bts_trx.sh @@ -16,6 +16,7 @@ configure_flags="\ --with-osmo-pcu=$deps/osmo-pcu/include \ --enable-trx \ + --enable-sanitize \ " build_bts "osmo-bts-trx" "$configure_flags" diff --git a/contrib/jenkins_lc15.sh b/contrib/jenkins_lc15.sh index 11cf934..38c1f33 100755 --- a/contrib/jenkins_lc15.sh +++ b/contrib/jenkins_lc15.sh @@ -14,7 +14,7 @@ cd "$deps" osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION" -configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" +configure_flags="--enable-sanitize --with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15" build_bts "osmo-bts-lc15" "$configure_flags" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4595c0d..efbd368 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -14,7 +14,7 @@ cd "$deps" osmo-layer1-headers.sh oct "$FIRMWARE_VERSION" -configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" +configure_flags="--enable-sanitize --with-octsdr-2g=$deps/layer1-headers/ --enable-octphy" build_bts "osmo-bts-octphy" "$configure_flags" diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index 3e07050..7488419 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -16,7 +16,7 @@ mkdir -p "$inst/include/sysmocom/femtobts" ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/" -configure_flags="--enable-sysmocom-bts --with-sysmobts=$inst/include/" +configure_flags="--enable-sanitize --enable-sysmocom-bts --with-sysmobts=$inst/include/" # This will not work for the femtobts if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then -- To view, visit https://gerrit.osmocom.org/6014 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed 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 Wed Jan 24 12:37:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:37:05 +0000 Subject: osmo-pcu[master]: TBF: adjust test log levels In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab Gerrit-PatchSet: 2 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 Jan 24 12:37:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:37:41 +0000 Subject: osmo-pcu[master]: TBF: make poll state internal In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Gerrit-PatchSet: 3 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 Jan 24 12:38:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:38:36 +0000 Subject: osmo-pcu[master]: TBF: make UL ack state internal In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Gerrit-PatchSet: 3 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 Jan 24 12:39:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:39:34 +0000 Subject: osmo-pcu[master]: TBF: make UL/DL state internal In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Gerrit-PatchSet: 3 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 Jan 24 12:40:24 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:40:24 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: make UL/DL state internal In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF: make UL/DL state internal ...................................................................... TBF: make UL/DL state internal * add functions/macros for setting TBF's UL/DL state * add functions for checking TBF's UL/DL state * move pre-free check into separate function N. B: this should not be confused with TBF-UL or TBF-DL state. Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp 6 files changed, 77 insertions(+), 44 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 873af73..f614c1a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1022,11 +1022,11 @@ tbf_free(tbf); return; } - if (tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_WAIT_ACK) { + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; if (!new_tbf) { @@ -1054,11 +1054,11 @@ tbf_assign_control_ts(new_tbf); return; } - if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_WAIT_ACK) { + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); /* reset N3105 */ tbf->n3105 = 0; - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; if (!new_tbf) { @@ -1156,10 +1156,10 @@ /* schedule uplink assignment or reject */ if (ul_tbf) { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); } else { LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); } } @@ -1403,7 +1403,7 @@ ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); /* get capabilities */ if (ul_tbf->ms()) diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 8925032..a87217f 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -54,11 +54,10 @@ *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) *ul_ack_tbf = ul_tbf; - if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || ul_tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || ul_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = ul_tbf; /* FIXME: Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states? */ @@ -73,10 +72,10 @@ if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; - if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) + if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS - || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS) + || dl_tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) *ul_ass_tbf = dl_tbf; } @@ -139,13 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - if (tbf == ul_ass_tbf && tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf == ul_ass_tbf && tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - if (tbf->ul_ass_state == - GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ)) msg = ul_ass_tbf->create_packet_access_reject(); else msg = ul_ass_tbf->create_ul_ass(fn, ts); diff --git a/src/tbf.cpp b/src/tbf.cpp index 699f960..0cb54bc 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -165,8 +165,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), - ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), @@ -185,6 +183,8 @@ m_ta(GSM48_TA_INVALID), m_ms_class(0), state(GPRS_RLCMAC_NULL), + dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), + ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) @@ -452,21 +452,7 @@ } LOGPTBF(tbf, LOGL_INFO, "free\n"); - if (tbf->ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending uplink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, - tbf->ul_ass_state)); - if (tbf->dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) - LOGPTBF(tbf, LOGL_ERROR, "Software error: Pending downlink " - "assignment in state %s. This may not happen, because the " - "assignment message never gets transmitted. Please " - "be sure not to free in this state. PLEASE FIX!\n", - get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, - tbf->dl_ass_state)); - + tbf->check_pending_ass(); tbf->stop_timers("freeing TBF"); /* TODO: Could/Should generate bssgp_tx_llc_discarded */ tbf_unlink_pdch(tbf); @@ -1513,7 +1499,7 @@ ul_tbf->set_ms(ms); ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); ul_tbf->control_ts = ts; ul_tbf->trx = trx; ul_tbf->m_ctrs = rate_ctr_group_alloc(ul_tbf, &tbf_ctrg_desc, 0); diff --git a/src/tbf.h b/src/tbf.h index 244ddd4..2d51945 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -181,6 +181,8 @@ #define T_START(tbf, t, sec, usec, r, f) tbf->t_start(t, sec, usec, r, f, __FILE__, __LINE__) #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -191,7 +193,12 @@ bool state_is(enum gprs_rlcmac_tbf_state rhs) const; bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; + bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; + bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); + void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); + void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); const char *state_name() const; @@ -272,8 +279,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; - enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; enum gprs_rlcmac_tbf_poll_state poll_state; @@ -336,6 +341,8 @@ private: enum gprs_rlcmac_tbf_state state; + enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; + enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -368,6 +375,16 @@ return state == rhs; } +inline bool gprs_rlcmac_tbf::dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const +{ + return dl_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const +{ + return ul_ass_state == rhs; +} + inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const { return state != rhs; @@ -399,6 +416,39 @@ state = new_state; } +inline void gprs_rlcmac_tbf::set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes DL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state), + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, new_state)); + dl_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes UL ASS state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state), + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, new_state)); + ul_ass_state = new_state; +} + +inline void gprs_rlcmac_tbf::check_pending_ass() +{ + if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending uplink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_ul_ass_state_names, ul_ass_state)); + + if (dl_ass_state != GPRS_RLCMAC_DL_ASS_NONE) + LOGPTBF(this, LOGL_ERROR, "FIXME: Software error: Pending downlink assignment in state %s. " + "This may not happen, because the assignment message never gets transmitted. " + "Please be sure not to free in this state. PLEASE FIX!\n", + get_value_string(gprs_rlcmac_tbf_dl_ass_state_names, dl_ass_state)); +} + inline bool gprs_rlcmac_tbf::check_n_clear(uint8_t state_flag) { if ((state_flags & (1 << state_flag))) { diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 9a0bf78..fdbbd16 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -483,7 +483,7 @@ /* check for downlink tbf: */ if (old_tbf) { LOGPTBFDL(this, LOGL_DEBUG, "Send dowlink assignment on PACCH, because %s exists\n", old_tbf->name()); - old_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(old_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); old_tbf->was_releasing = old_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE); /* change state */ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 9e21c73..968f9eb 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -175,7 +175,7 @@ check_tbf(dl_tbf); /* "Establish" the DL TBF */ - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_SEND_ASS; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_SEND_ASS); TBF_SET_STATE(dl_tbf, GPRS_RLCMAC_FLOW); dl_tbf->m_wait_confirm = 0; check_tbf(dl_tbf); @@ -276,7 +276,7 @@ OSMO_ASSERT(new_tbf != dl_tbf); OSMO_ASSERT(new_tbf->tfi() == 1); check_tbf(dl_tbf); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); if (test_mode == TEST_MODE_REVERSE_FREE) { GprsMs::Guard guard(ms); tbf_free(new_tbf); @@ -365,7 +365,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); printf("=== end %s ===\n", __func__); @@ -2699,7 +2699,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); } @@ -2748,7 +2748,7 @@ /* Clean up and ensure tbfs are in the correct state */ OSMO_ASSERT(dl_tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE)); - dl_tbf->dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; + TBF_SET_ASS_STATE_DL(dl_tbf, GPRS_RLCMAC_DL_ASS_NONE); check_tbf(dl_tbf); tbf_free(dl_tbf); -- To view, visit https://gerrit.osmocom.org/5862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idcbf5775d17b1247f2ed01788f9b0788ce66e871 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:40:24 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:40:24 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: make UL ack state internal In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF: make UL ack state internal ...................................................................... TBF: make UL ack state internal * add functions/macros for setting TBF's UL ack state * add functions for checking TBF's UL ack state N. B: this should not be confused with TBF-UL state. Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Related: OS#1539 --- M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp M tests/tbf/TbfTest.cpp 5 files changed, 38 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a87217f..3f9fcb1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -52,7 +52,7 @@ if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; - if (ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_SEND_ACK) + if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = ul_tbf; diff --git a/src/tbf.cpp b/src/tbf.cpp index 0cb54bc..b99c521 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -60,6 +60,13 @@ { 0, NULL } }; +const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_SEND_ACK), /* send acknowledge on next RTS */ + OSMO_VALUE_STRING(GPRS_RLCMAC_UL_ACK_WAIT_ACK), /* wait for PACKET CONTROL ACK */ + { 0, NULL } +}; + static const struct value_string tbf_timers_names[] = { OSMO_VALUE_STRING(T0), OSMO_VALUE_STRING(T3169), @@ -165,7 +172,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), @@ -185,6 +191,7 @@ state(GPRS_RLCMAC_NULL), dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), + ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 2d51945..2828772 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -87,6 +87,8 @@ GPRS_RLCMAC_UL_ACK_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; +extern const struct value_string gprs_rlcmac_tbf_ul_ack_state_names[]; + enum gprs_rlcmac_tbf_direction { GPRS_RLCMAC_DL_TBF, GPRS_RLCMAC_UL_TBF @@ -183,6 +185,7 @@ #define TBF_SET_STATE(t, st) do { t->set_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) +#define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -195,9 +198,11 @@ bool state_is_not(enum gprs_rlcmac_tbf_state rhs) const; bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; + bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); + void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -279,8 +284,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -343,6 +346,7 @@ enum gprs_rlcmac_tbf_state state; enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; + enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -383,6 +387,11 @@ inline bool gprs_rlcmac_tbf::ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const { return ul_ass_state == rhs; +} + +inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const +{ + return ul_ack_state == rhs; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -434,6 +443,15 @@ ul_ass_state = new_state; } +inline void gprs_rlcmac_tbf::set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes UL ACK state from %s to %s\n", + tbf_name(this), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, ul_ack_state), + get_value_string(gprs_rlcmac_tbf_ul_ack_state_names, new_state)); + ul_ack_state = new_state; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index ba048e5..c1a3388 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -106,8 +106,8 @@ bool gprs_rlcmac_ul_tbf::handle_ctrl_ack() { /* check if this control ack belongs to packet uplink ack */ - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return true; } @@ -124,7 +124,7 @@ if (final) { if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state == GPRS_RLCMAC_UL_ACK_WAIT_ACK) { + ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; @@ -158,7 +158,7 @@ /* waiting for final acknowledge */ m_final_ack_sent = 1; } else - ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_NONE); return msg; } @@ -362,9 +362,9 @@ "Scheduling Ack/Nack, because %d frames received.\n", SEND_ACK_AFTER_FRAMES); } - if (ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE) { + if (ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)) { /* trigger sending at next RTS */ - ul_ack_state = GPRS_RLCMAC_UL_ACK_SEND_ACK; + TBF_SET_ACK_STATE(this, GPRS_RLCMAC_UL_ACK_SEND_ACK); } else { /* already triggered */ LOGPTBFUL(this, LOGL_DEBUG, diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 968f9eb..0ac519c 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1350,7 +1350,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1434,7 +1434,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); @@ -1522,7 +1522,7 @@ request_dl_rlc_block(ul_tbf, fn); check_tbf(ul_tbf); - OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + OSMO_ASSERT(ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_NONE)); ms = the_bts->ms_by_tlli(tlli); OSMO_ASSERT(ms != NULL); -- To view, visit https://gerrit.osmocom.org/5863 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I144483447d4b0b93e775da0e926ee45eb8ab39f3 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:40:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:40:25 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: make poll state internal In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF: make poll state internal ...................................................................... TBF: make poll state internal * add functions/macros for setting TBF's poll state * add function for checking TBF's poll state Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Related: OS#1539 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/poll_controller.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 7 files changed, 43 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index f614c1a..94354f2 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -399,7 +399,7 @@ static inline bool tbf_check(gprs_rlcmac_tbf *tbf, uint32_t fn, uint8_t trx_no, uint8_t ts) { - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_state == GPRS_RLCMAC_POLL_SCHED + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING) && tbf->poll_scheduled() && tbf->poll_fn == fn && tbf->trx->trx_no == trx_no && tbf->poll_ts == ts) return true; @@ -1010,7 +1010,7 @@ tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - tbf->poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(tbf); /* check if this control ack belongs to packet uplink ack */ ul_tbf = as_ul_tbf(tbf); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index 3f9fcb1..ebf4714 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -49,8 +49,7 @@ if (ul_tbf->trx->trx_no != trx || !ul_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && ul_tbf->poll_fn == poll_fn) + if (ul_tbf->poll_scheduled() && ul_tbf->poll_fn == poll_fn) *poll_tbf = ul_tbf; if (ul_tbf->ul_ack_state_is(GPRS_RLCMAC_UL_ACK_SEND_ACK)) *ul_ack_tbf = ul_tbf; @@ -69,8 +68,7 @@ if (dl_tbf->trx->trx_no != trx || !dl_tbf->is_control_ts(ts)) continue; /* polling for next uplink block */ - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED - && dl_tbf->poll_fn == poll_fn) + if (dl_tbf->poll_scheduled() && dl_tbf->poll_fn == poll_fn) *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_SEND_ASS)) *dl_ass_tbf = dl_tbf; diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index f8ab6c9..5c5a717 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -47,14 +47,14 @@ llist_for_each(pos, &m_bts.ul_tbfs()) { ul_tbf = as_ul_tbf(pos->entry()); - if (ul_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (ul_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, ul_tbf->poll_fn)) ul_tbf->poll_timeout(); } } llist_for_each(pos, &m_bts.dl_tbfs()) { dl_tbf = as_dl_tbf(pos->entry()); - if (dl_tbf->poll_state == GPRS_RLCMAC_POLL_SCHED) { + if (dl_tbf->poll_scheduled()) { if (elapsed_fn_check(max_delay, frame_number, dl_tbf->poll_fn)) dl_tbf->poll_timeout(); } diff --git a/src/tbf.cpp b/src/tbf.cpp index b99c521..672c296 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -45,6 +45,12 @@ static void tbf_timer_cb(void *_tbf); +const struct value_string gprs_rlcmac_tbf_poll_state_names[] = { + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_NONE), + OSMO_VALUE_STRING(GPRS_RLCMAC_POLL_SCHED), /* a polling was scheduled */ + { 0, NULL } +}; + const struct value_string gprs_rlcmac_tbf_dl_ass_state_names[] = { OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_NONE), OSMO_VALUE_STRING(GPRS_RLCMAC_DL_ASS_SEND_ASS), @@ -172,7 +178,6 @@ first_ts(0), first_common_ts(0), control_ts(0xff), - poll_state(GPRS_RLCMAC_POLL_NONE), poll_fn(0), poll_ts(0), n3105(0), @@ -192,6 +197,7 @@ dl_ass_state(GPRS_RLCMAC_DL_ASS_NONE), ul_ass_state(GPRS_RLCMAC_UL_ASS_NONE), ul_ack_state(GPRS_RLCMAC_UL_ACK_NONE), + poll_state(GPRS_RLCMAC_POLL_NONE), m_list(this), m_ms_list(this), m_egprs_enabled(false) diff --git a/src/tbf.h b/src/tbf.h index 2828772..bb5fd0a 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,8 @@ GPRS_RLCMAC_POLL_SCHED, /* a polling was scheduled */ }; +extern const struct value_string gprs_rlcmac_tbf_poll_state_names[]; + enum gprs_rlcmac_tbf_dl_ass_state { GPRS_RLCMAC_DL_ASS_NONE = 0, GPRS_RLCMAC_DL_ASS_SEND_ASS, /* send downlink assignment on next RTS */ @@ -186,6 +188,8 @@ #define TBF_SET_ASS_STATE_DL(t, st) do { t->set_ass_state_dl(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ASS_STATE_UL(t, st) do { t->set_ass_state_ul(st, __FILE__, __LINE__); } while(0) #define TBF_SET_ACK_STATE(t, st) do { t->set_ack_state(st, __FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_SET(t) do { t->poll_sched_set(__FILE__, __LINE__); } while(0) +#define TBF_POLL_SCHED_UNSET(t) do { t->poll_sched_unset(__FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { @@ -199,10 +203,13 @@ bool dl_ass_state_is(enum gprs_rlcmac_tbf_dl_ass_state rhs) const; bool ul_ass_state_is(enum gprs_rlcmac_tbf_ul_ass_state rhs) const; bool ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const; + bool poll_scheduled() const; void set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line); void set_ass_state_dl(enum gprs_rlcmac_tbf_dl_ass_state new_state, const char *file, int line); void set_ass_state_ul(enum gprs_rlcmac_tbf_ul_ass_state new_state, const char *file, int line); void set_ack_state(enum gprs_rlcmac_tbf_ul_ack_state new_state, const char *file, int line); + void poll_sched_set(const char *file, int line); + void poll_sched_unset(const char *file, int line); void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); @@ -284,7 +291,6 @@ gprs_llc m_llc; - enum gprs_rlcmac_tbf_poll_state poll_state; uint32_t poll_fn; /* frame number to poll */ uint8_t poll_ts; /* TS to poll */ @@ -347,6 +353,7 @@ enum gprs_rlcmac_tbf_dl_ass_state dl_ass_state; enum gprs_rlcmac_tbf_ul_ass_state ul_ass_state; enum gprs_rlcmac_tbf_ul_ack_state ul_ack_state; + enum gprs_rlcmac_tbf_poll_state poll_state; LListHead m_list; LListHead m_ms_list; bool m_egprs_enabled; @@ -392,6 +399,11 @@ inline bool gprs_rlcmac_tbf::ul_ack_state_is(enum gprs_rlcmac_tbf_ul_ack_state rhs) const { return ul_ack_state == rhs; +} + +inline bool gprs_rlcmac_tbf::poll_scheduled() const +{ + return poll_state == GPRS_RLCMAC_POLL_SCHED; } inline bool gprs_rlcmac_tbf::state_is_not(enum gprs_rlcmac_tbf_state rhs) const @@ -452,6 +464,20 @@ ul_ack_state = new_state; } +inline void gprs_rlcmac_tbf::poll_sched_set(const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_SCHED\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_SCHED; +} + +inline void gprs_rlcmac_tbf::poll_sched_unset(const char *file, int line) +{ + LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes poll state from %s to GPRS_RLCMAC_POLL_NONE\n", + tbf_name(this), get_value_string(gprs_rlcmac_tbf_poll_state_names, poll_state)); + poll_state = GPRS_RLCMAC_POLL_NONE; +} + inline void gprs_rlcmac_tbf::check_pending_ass() { if (ul_ass_state != GPRS_RLCMAC_UL_ASS_NONE) diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index fdbbd16..80e3831 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -635,7 +635,7 @@ /* reset N3105 */ n3105 = 0; t_stop(T3191, "ACK/NACK received"); - poll_state = GPRS_RLCMAC_POLL_NONE; + TBF_POLL_SCHED_UNSET(this); return ack_recovered; } @@ -1181,7 +1181,7 @@ bool gprs_rlcmac_dl_tbf::need_control_ts() const { - if (poll_state != GPRS_RLCMAC_POLL_NONE) + if (poll_scheduled()) return false; return state_flags & (1 << GPRS_RLCMAC_FLAG_TO_DL_ACK) || diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index c1a3388..1560eb0 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -123,8 +123,7 @@ uint32_t new_poll_fn = 0; if (final) { - if (poll_state == GPRS_RLCMAC_POLL_SCHED && - ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { + if (poll_scheduled() && ul_ack_state_is(GPRS_RLCMAC_UL_ACK_WAIT_ACK)) { LOGPTBFUL(this, LOGL_DEBUG, "Polling is already scheduled, so we must wait for the final uplink ack...\n"); return NULL; -- To view, visit https://gerrit.osmocom.org/5864 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6db1c4e7bd0a49aeb5e391afe371c36b96c6a702 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:40:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:40:25 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: adjust test log levels In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TBF: adjust test log levels ...................................................................... TBF: adjust test log levels * enable debugging for DTBF* * disable excessive DRLCMAC* Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 2 files changed, 4,785 insertions(+), 1,175 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/6000 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I122620941e7939d513742c8589a75e0ab76f79ab Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:48:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:48:30 +0000 Subject: osmo-msc[master]: Reject any CM SERVICE we don't support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I499730d760dc9ac7f599e09959c6eac4452f2eab Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:50:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:50:07 +0000 Subject: osmo-mgw[master]: client: make callid in MDCX mandatory In-Reply-To: References: Message-ID: Patch Set 1: What does the spec say? Called is IMHO purely cosmetic for logging. ConnectionId identifies the connection to be modified -- To view, visit https://gerrit.osmocom.org/5993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:50:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:50:54 +0000 Subject: osmo-mgw[master]: client: add missing mandatory SDP fields In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fbc31a17e8ac10c7cc5dbc31357b61e8920aaa5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:53:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:53:11 +0000 Subject: osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) In-Reply-To: References: Message-ID: Patch Set 5: Please make sure we have a test case in the ttcn3 tests for the mgw which validates this new behavior, and name that TC in the commitlog -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:54:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:54:04 +0000 Subject: osmo-mgw[master]: mgcp: add prefix to virtual trunk In-Reply-To: References: Message-ID: Patch Set 5: Same here. We Ned tests for both old and new behavior and show that both succeed after applying this pastch -- To view, visit https://gerrit.osmocom.org/5880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:55:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:55:17 +0000 Subject: osmo-mgw[master]: client: eliminate destructive parameter parsing In-Reply-To: References: Message-ID: Patch Set 2: It would be best to attach this to a tslloc context rather than null. If nijne is reachable, a global context could be used, or we could use the stack instead of heap -- To view, visit https://gerrit.osmocom.org/5935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia475036f7f3802b1638e0511a5e9162fea1592eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:55:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 12:55:32 +0000 Subject: [PATCH] osmo-msc[master]: VLR: constify GSUP-related function parameters Message-ID: Review at https://gerrit.osmocom.org/6016 VLR: constify GSUP-related function parameters Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50 --- M include/osmocom/msc/vlr.h M src/libvlr/vlr.c 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/16/6016/1 diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index 0b61a59..9943f15 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -284,7 +284,7 @@ int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, bool is_utran, const uint8_t *res, uint8_t res_len); int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts); -int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub); +int vlr_subscr_tx_auth_fail_rep(const struct vlr_subscr *vsub); void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res); int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub); int vlr_subscr_rx_imsi_detach(struct vlr_subscr *vsub); diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index f57df8e..21ef082 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -125,8 +125,8 @@ } /* Transmit GSUP message to HLR */ -static int vlr_tx_gsup_message(struct vlr_instance *vlr, - struct osmo_gsup_message *gsup_msg) +static int vlr_tx_gsup_message(const struct vlr_instance *vlr, + const struct osmo_gsup_message *gsup_msg) { struct msgb *msg = gsup_client_msgb_alloc(); @@ -146,7 +146,7 @@ } /* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ -static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, +static int vlr_subscr_tx_gsup_message(const struct vlr_subscr *vsub, struct osmo_gsup_message *gsup_msg) { struct vlr_instance *vlr = vsub->vlr; @@ -158,7 +158,7 @@ } /* Transmit GSUP error in response to original message */ -static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, +static int vlr_tx_gsup_error_reply(const struct vlr_instance *vlr, struct osmo_gsup_message *gsup_orig, enum gsm48_gmm_cause cause) { @@ -561,7 +561,7 @@ } /* Tell HLR that authentication failure occurred */ -int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +int vlr_subscr_tx_auth_fail_rep(const struct vlr_subscr *vsub) { struct osmo_gsup_message gsup_msg = {0}; -- To view, visit https://gerrit.osmocom.org/6016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:56:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:56:22 +0000 Subject: osmo-mgw[master]: protocol: fix problem with line break and OSMUX In-Reply-To: References: Message-ID: Patch Set 2: Please make sure we have a test case that fails without this patch and passes with this patch -- To view, visit https://gerrit.osmocom.org/5980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6261971040db527b96fe79676520ccd7794bd327 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:56:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:56:44 +0000 Subject: osmo-mgw[master]: protocol: fix missing carriage return In-Reply-To: References: Message-ID: Patch Set 2: Again, test case would be great -- To view, visit https://gerrit.osmocom.org/5981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:58:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:58:03 +0000 Subject: osmo-mgw[master]: mgcp: fix use-after-free and add callback for endpoint cleanup In-Reply-To: References: Message-ID: Patch Set 1: Might make sense to permit cleanup_cb=NULL and not call it in that case -- To view, visit https://gerrit.osmocom.org/6006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:58:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:58:50 +0000 Subject: osmo-mgw[master]: cosmetic: move mgcp_release_endp() to mgcp_ep.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6008 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a65b6e906c52a9e7cd75c88c4cbe1bf473b866b Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 12:59:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 12:59:20 +0000 Subject: osmo-msc[master]: VLR: constify GSUP-related function parameters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Jan 24 13:02:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 13:02:19 +0000 Subject: osmo-msc[master]: GSUP: check osmo_gsup_encode() result In-Reply-To: References: Message-ID: Patch Set 1: Not sure about this error propagation. The real problem is that somebody hands a too long IMSI to the encoder, I.e. an imssi from the untrusted subscriber that hasn't been verified at all for conformance -- To view, visit https://gerrit.osmocom.org/6010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4551212011fb0bd898c020a183756ed7a9afb9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Jan 24 13:03:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 13:03:00 +0000 Subject: libosmocore[master]: Apply fixes suggested by shellcheck In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6012 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic33fcc707a2913dbc4c7c23ee35ba4c8bc8a3a89 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 13:04:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 13:04:09 +0000 Subject: libosmocore[master]: Add generic configure step In-Reply-To: References: Message-ID: Patch Set 1: How is this an improvement? Which problem does it addreess? -- To view, visit https://gerrit.osmocom.org/6013 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibb2f018780c82d798ff0e8a0a836d1aa8d0d7670 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 13:04:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 13:04:28 +0000 Subject: [MERGED] osmo-msc[master]: VLR: constify GSUP-related function parameters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: VLR: constify GSUP-related function parameters ...................................................................... VLR: constify GSUP-related function parameters Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50 --- M include/osmocom/msc/vlr.h M src/libvlr/vlr.c 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/vlr.h b/include/osmocom/msc/vlr.h index 0b61a59..9943f15 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -284,7 +284,7 @@ int vlr_subscr_rx_auth_resp(struct vlr_subscr *vsub, bool is_r99, bool is_utran, const uint8_t *res, uint8_t res_len); int vlr_subscr_rx_auth_fail(struct vlr_subscr *vsub, const uint8_t *auts); -int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub); +int vlr_subscr_tx_auth_fail_rep(const struct vlr_subscr *vsub); void vlr_subscr_rx_ciph_res(struct vlr_subscr *vsub, struct vlr_ciph_result *res); int vlr_subscr_rx_tmsi_reall_compl(struct vlr_subscr *vsub); int vlr_subscr_rx_imsi_detach(struct vlr_subscr *vsub); diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index f57df8e..21ef082 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -125,8 +125,8 @@ } /* Transmit GSUP message to HLR */ -static int vlr_tx_gsup_message(struct vlr_instance *vlr, - struct osmo_gsup_message *gsup_msg) +static int vlr_tx_gsup_message(const struct vlr_instance *vlr, + const struct osmo_gsup_message *gsup_msg) { struct msgb *msg = gsup_client_msgb_alloc(); @@ -146,7 +146,7 @@ } /* Transmit GSUP message for subscriber to HLR, using IMSI from subscriber */ -static int vlr_subscr_tx_gsup_message(struct vlr_subscr *vsub, +static int vlr_subscr_tx_gsup_message(const struct vlr_subscr *vsub, struct osmo_gsup_message *gsup_msg) { struct vlr_instance *vlr = vsub->vlr; @@ -158,7 +158,7 @@ } /* Transmit GSUP error in response to original message */ -static int vlr_tx_gsup_error_reply(struct vlr_instance *vlr, +static int vlr_tx_gsup_error_reply(const struct vlr_instance *vlr, struct osmo_gsup_message *gsup_orig, enum gsm48_gmm_cause cause) { @@ -561,7 +561,7 @@ } /* Tell HLR that authentication failure occurred */ -int vlr_subscr_tx_auth_fail_rep(struct vlr_subscr *vsub) +int vlr_subscr_tx_auth_fail_rep(const struct vlr_subscr *vsub) { struct osmo_gsup_message gsup_msg = {0}; -- To view, visit https://gerrit.osmocom.org/6016 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3852e096210713cb5297f6b42ed66dbb98c4a50 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 13:05:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 13:05:00 +0000 Subject: [PATCH] osmo-msc[master]: cosmetic: log prim operation as text Message-ID: Review at https://gerrit.osmocom.org/6017 cosmetic: log prim operation as text When logging SCCP error, log failed primitive operation as text. Change-Id: Icda9f8f18aacc7bcc281aad5fbb89208e6dab336 Related: OS#2851 --- M src/libmsc/a_iface.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/17/6017/1 diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 95d9c91..220642c 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -531,7 +531,8 @@ break; default: - LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN primitive: %u:%u\n", oph->primitive, oph->operation); + LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN operation %s on primitive %u\n", + get_value_string(osmo_prim_op_names, oph->operation), oph->primitive); break; } -- To view, visit https://gerrit.osmocom.org/6017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icda9f8f18aacc7bcc281aad5fbb89208e6dab336 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 13:11:28 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 13:11:28 +0000 Subject: [PATCH] osmo-bsc[master]: cosmetic: log prim operation as text Message-ID: Review at https://gerrit.osmocom.org/6018 cosmetic: log prim operation as text When logging SCCP error, log failed primitive operation as text. Change-Id: I91f739cea9f518a24fff6870f7dceab8175c9646 Related: OS#2851 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/18/6018/1 diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 19a36da..5b06510 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -230,7 +230,8 @@ break; default: - LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN primitive: %u:%u\n", oph->primitive, oph->operation); + LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN operation %s on primitive %u\n", + get_value_string(osmo_prim_op_names, oph->operation), oph->primitive); break; } -- To view, visit https://gerrit.osmocom.org/6018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I91f739cea9f518a24fff6870f7dceab8175c9646 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 13:38:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 13:38:24 +0000 Subject: [PATCH] osmo-msc[master]: Remove traces of meas_feed Message-ID: Review at https://gerrit.osmocom.org/6019 Remove traces of meas_feed Measurement reporting (and the relate feed) are functions of the BSC, not the MSC. This code should never have been inherited from OsmoNITB to OsmoMSC in the first place, let's remove it. Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64 --- M .gitignore M include/osmocom/msc/Makefile.am D include/osmocom/msc/meas_feed.h M src/libmsc/Makefile.am D src/libmsc/meas_feed.c M src/libmsc/vty_interface_layer3.c M tests/vty_test_runner.py 7 files changed, 0 insertions(+), 276 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/19/6019/1 diff --git a/.gitignore b/.gitignore index 4873bbe..a502ad4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,10 +40,6 @@ # apps and app data src/osmo-msc/osmo-msc src/libcommon/gsup_test_client -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db src/utils/smpp_mirror sms.db src/osmo-msc/*.cfg* diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 1419e8e..61c915a 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -33,7 +33,6 @@ iucs.h \ iucs_ranap.h \ iu_dummy.h \ - meas_feed.h \ meas_rep.h \ misdn.h \ mncc.h \ diff --git a/include/osmocom/msc/meas_feed.h b/include/osmocom/msc/meas_feed.h deleted file mode 100644 index 02b7d95..0000000 --- a/include/osmocom/msc/meas_feed.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_MEAS_FEED_H -#define _OPENBSC_MEAS_FEED_H - -#include - -#include - -struct meas_feed_hdr { - uint8_t msg_type; - uint8_t reserved; - uint16_t version; -}; - -struct meas_feed_meas { - struct meas_feed_hdr hdr; - char imsi[15+1]; - char name[31+1]; - char scenario[31+1]; - struct gsm_meas_rep mr; - /* The logical channel type, enum gsm_chan_t */ - uint8_t lchan_type; - /* The physical channel type, enum gsm_phys_chan_config */ - uint8_t pchan_type; - /* number of ths BTS in network */ - uint8_t bts_nr; - /* number of this TRX in the BTS */ - uint8_t trx_nr; - /* number of this timeslot at the TRX */ - uint8_t ts_nr; - /* The logical subslot number in the TS */ - uint8_t ss_nr; -}; - -enum meas_feed_msgtype { - MEAS_FEED_MEAS = 0, -}; - -#define MEAS_FEED_VERSION 1 - - -#endif diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 3ff97a3..6449948 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -19,7 +19,6 @@ $(NULL) noinst_HEADERS = \ - meas_feed.h \ $(NULL) noinst_LIBRARIES = \ @@ -49,7 +48,6 @@ transaction.c \ osmo_msc.c \ ctrl_commands.c \ - meas_feed.c \ subscr_conn.c \ $(NULL) if BUILD_IU diff --git a/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c deleted file mode 100644 index 3daebee..0000000 --- a/src/libmsc/meas_feed.c +++ /dev/null @@ -1,168 +0,0 @@ -/* UDP-Feed of measurement reports */ - -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "meas_feed.h" - -struct meas_feed_state { - struct osmo_wqueue wqueue; - char scenario[31+1]; - char *dst_host; - uint16_t dst_port; -}; - - -static struct meas_feed_state g_mfs; - -static int process_meas_rep(struct gsm_meas_rep *mr) -{ - struct msgb *msg; - struct meas_feed_meas *mfm; - struct vlr_subscr *vsub; - - /* ignore measurements as long as we don't know who it is */ - if (!mr->lchan || !mr->lchan->conn || !mr->lchan->conn->vsub) - return 0; - - vsub = mr->lchan->conn->vsub; - - msg = msgb_alloc(sizeof(struct meas_feed_meas), "Meas. Feed"); - if (!msg) - return 0; - - /* fill in the header */ - mfm = (struct meas_feed_meas *) msgb_put(msg, sizeof(*mfm)); - mfm->hdr.msg_type = MEAS_FEED_MEAS; - mfm->hdr.version = MEAS_FEED_VERSION; - - /* fill in MEAS_FEED_MEAS specific header */ - osmo_strlcpy(mfm->imsi, vsub->imsi, sizeof(mfm->imsi)); - osmo_strlcpy(mfm->name, vsub->name, sizeof(mfm->name)); - osmo_strlcpy(mfm->scenario, g_mfs.scenario, sizeof(mfm->scenario)); - - /* copy the entire measurement report */ - memcpy(&mfm->mr, mr, sizeof(mfm->mr)); - - /* copy channel information */ - /* we assume that the measurement report always belong to some timeslot */ - mfm->lchan_type = (uint8_t)mr->lchan->type; - mfm->pchan_type = (uint8_t)mr->lchan->ts->pchan; - mfm->bts_nr = mr->lchan->ts->trx->bts->nr; - mfm->trx_nr = mr->lchan->ts->trx->nr; - mfm->ts_nr = mr->lchan->ts->nr; - mfm->ss_nr = mr->lchan->nr; - - /* and send it to the socket */ - if (osmo_wqueue_enqueue(&g_mfs.wqueue, msg) != 0) - msgb_free(msg); - - return 0; -} - -static int meas_feed_sig_cb(unsigned int subsys, unsigned int signal, - void *handler_data, void *signal_data) -{ - struct lchan_signal_data *sdata = signal_data; - - if (subsys != SS_LCHAN) - return 0; - - if (signal == S_LCHAN_MEAS_REP) - process_meas_rep(sdata->mr); - - return 0; -} - -static int feed_write_cb(struct osmo_fd *ofd, struct msgb *msg) -{ - return write(ofd->fd, msgb_data(msg), msgb_length(msg)); -} - -static int feed_read_cb(struct osmo_fd *ofd) -{ - int rc; - char buf[256]; - - rc = read(ofd->fd, buf, sizeof(buf)); - ofd->fd &= ~BSC_FD_READ; - - return rc; -} - -int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port) -{ - int rc; - int already_initialized = 0; - - if (g_mfs.wqueue.bfd.fd) - already_initialized = 1; - - - if (already_initialized && - !strcmp(dst_host, g_mfs.dst_host) && - dst_port == g_mfs.dst_port) - return 0; - - if (!already_initialized) { - osmo_wqueue_init(&g_mfs.wqueue, 10); - g_mfs.wqueue.write_cb = feed_write_cb; - g_mfs.wqueue.read_cb = feed_read_cb; - osmo_signal_register_handler(SS_LCHAN, meas_feed_sig_cb, NULL); - } - - if (already_initialized) { - osmo_wqueue_clear(&g_mfs.wqueue); - osmo_fd_unregister(&g_mfs.wqueue.bfd); - close(g_mfs.wqueue.bfd.fd); - /* don't set to zero, as that would mean 'not yet initialized' */ - g_mfs.wqueue.bfd.fd = -1; - } - rc = osmo_sock_init_ofd(&g_mfs.wqueue.bfd, AF_UNSPEC, SOCK_DGRAM, - IPPROTO_UDP, dst_host, dst_port, - OSMO_SOCK_F_CONNECT); - if (rc < 0) - return rc; - - g_mfs.wqueue.bfd.when &= ~BSC_FD_READ; - - if (g_mfs.dst_host) - talloc_free(g_mfs.dst_host); - g_mfs.dst_host = talloc_strdup(NULL, dst_host); - g_mfs.dst_port = dst_port; - - return 0; -} - -void meas_feed_cfg_get(char **host, uint16_t *port) -{ - *port = g_mfs.dst_port; - *host = g_mfs.dst_host; -} - -void meas_feed_scenario_set(const char *name) -{ - osmo_strlcpy(g_mfs.scenario, name, sizeof(g_mfs.scenario)); -} - -const char *meas_feed_scenario_get(void) -{ - return g_mfs.scenario; -} diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c7ec586..dbd826d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -56,8 +56,6 @@ #include -#include "meas_feed.h" - extern struct gsm_network *gsmnet_from_vty(struct vty *v); static void subscr_dump_full_vty(struct vty *vty, struct vlr_subscr *vsub) @@ -754,13 +752,6 @@ static int config_write_mncc_int(struct vty *vty) { - uint16_t meas_port; - char *meas_host; - const char *meas_scenario; - - meas_feed_cfg_get(&meas_host, &meas_port); - meas_scenario = meas_feed_scenario_get(); - vty_out(vty, "mncc-int%s", VTY_NEWLINE); vty_out(vty, " default-codec tch-f %s%s", get_value_string(tchf_codec_names, mncc_int.def_codec[0]), @@ -768,13 +759,6 @@ vty_out(vty, " default-codec tch-h %s%s", get_value_string(tchh_codec_names, mncc_int.def_codec[1]), VTY_NEWLINE); - if (meas_port) - vty_out(vty, " meas-feed destination %s %u%s", - meas_host, meas_port, VTY_NEWLINE); - if (strlen(meas_scenario) > 0) - vty_out(vty, " meas-feed scenario %s%s", - meas_scenario, VTY_NEWLINE); - return CMD_SUCCESS; } @@ -797,29 +781,6 @@ "Half-Rate\n" "Adaptive Multi-Rate\n") { mncc_int.def_codec[1] = get_string_value(tchh_codec_names, argv[0]); - - return CMD_SUCCESS; -} - -#define MEAS_STR "Measurement export related\n" -DEFUN(mnccint_meas_feed, mnccint_meas_feed_cmd, - "meas-feed destination ADDR <0-65535>", - MEAS_STR "destination\n" "address or hostname\n" "port number\n") -{ - int rc; - - rc = meas_feed_cfg_set(argv[0], atoi(argv[1])); - if (rc < 0) - return CMD_WARNING; - - return CMD_SUCCESS; -} - -DEFUN(meas_feed_scenario, meas_feed_scenario_cmd, - "meas-feed scenario NAME", - MEAS_STR "scenario\n" "Name up to 31 characters included in report\n") -{ - meas_feed_scenario_set(argv[0]); return CMD_SUCCESS; } @@ -924,14 +885,11 @@ install_element(ENABLE_NODE, &smsqueue_clear_cmd); install_element(ENABLE_NODE, &smsqueue_fail_cmd); install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd); - install_element(ENABLE_NODE, &meas_feed_scenario_cmd); install_element(CONFIG_NODE, &cfg_mncc_int_cmd); install_node(&mncc_int_node, config_write_mncc_int); install_element(MNCC_INT_NODE, &mnccint_def_codec_f_cmd); install_element(MNCC_INT_NODE, &mnccint_def_codec_h_cmd); - install_element(MNCC_INT_NODE, &mnccint_meas_feed_cmd); - install_element(MNCC_INT_NODE, &meas_feed_scenario_cmd); install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index de1997c..707fc5c 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -225,24 +225,6 @@ res = self.vty.command("show network") self.assert_(res.startswith('BSC is on Country Code') >= 0) - def testMeasurementFeed(self): - self.vty.enable() - self.vty.command("configure terminal") - self.vty.command("mncc-int") - - res = self.vty.command("write terminal") - self.assertEquals(res.find('meas-feed scenario'), -1) - - self.vty.command("meas-feed scenario bla") - res = self.vty.command("write terminal") - self.assert_(res.find('meas-feed scenario bla') > 0) - - self.vty.command("meas-feed scenario abcdefghijklmnopqrstuvwxyz01234567890") - res = self.vty.command("write terminal") - self.assertEquals(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz01234567890'), -1) - self.assertEquals(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz012345'), -1) - self.assert_(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz01234') > 0) - def ipa_handle_small(x, verbose = False): s = data2str(x.recv(4)) if len(s) != 4*2: -- To view, visit https://gerrit.osmocom.org/6019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:03:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:03:49 +0000 Subject: osmo-msc[master]: cosmetic: log prim operation as text In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icda9f8f18aacc7bcc281aad5fbb89208e6dab336 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Jan 24 14:03:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:03:54 +0000 Subject: [MERGED] osmo-msc[master]: cosmetic: log prim operation as text In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: log prim operation as text ...................................................................... cosmetic: log prim operation as text When logging SCCP error, log failed primitive operation as text. Change-Id: Icda9f8f18aacc7bcc281aad5fbb89208e6dab336 Related: OS#2851 --- M src/libmsc/a_iface.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 95d9c91..220642c 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -531,7 +531,8 @@ break; default: - LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN primitive: %u:%u\n", oph->primitive, oph->operation); + LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN operation %s on primitive %u\n", + get_value_string(osmo_prim_op_names, oph->operation), oph->primitive); break; } -- To view, visit https://gerrit.osmocom.org/6017 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icda9f8f18aacc7bcc281aad5fbb89208e6dab336 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:16 +0000 Subject: osmo-bsc[master]: cosmetic: log prim operation as text In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I91f739cea9f518a24fff6870f7dceab8175c9646 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:24 +0000 Subject: [MERGED] osmo-bsc[master]: cosmetic: log prim operation as text In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: log prim operation as text ...................................................................... cosmetic: log prim operation as text When logging SCCP error, log failed primitive operation as text. Change-Id: I91f739cea9f518a24fff6870f7dceab8175c9646 Related: OS#2851 --- M src/osmo-bsc/osmo_bsc_sigtran.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_sigtran.c b/src/osmo-bsc/osmo_bsc_sigtran.c index 19a36da..5b06510 100644 --- a/src/osmo-bsc/osmo_bsc_sigtran.c +++ b/src/osmo-bsc/osmo_bsc_sigtran.c @@ -230,7 +230,8 @@ break; default: - LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN primitive: %u:%u\n", oph->primitive, oph->operation); + LOGP(DMSC, LOGL_ERROR, "Unhandled SIGTRAN operation %s on primitive %u\n", + get_value_string(osmo_prim_op_names, oph->operation), oph->primitive); break; } -- To view, visit https://gerrit.osmocom.org/6018 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I91f739cea9f518a24fff6870f7dceab8175c9646 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:41 +0000 Subject: osmo-msc[master]: Remove traces of meas_feed In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:46 +0000 Subject: [MERGED] osmo-msc[master]: Remove traces of meas_feed In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove traces of meas_feed ...................................................................... Remove traces of meas_feed Measurement reporting (and the relate feed) are functions of the BSC, not the MSC. This code should never have been inherited from OsmoNITB to OsmoMSC in the first place, let's remove it. Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64 --- M .gitignore M include/osmocom/msc/Makefile.am D include/osmocom/msc/meas_feed.h M src/libmsc/Makefile.am D src/libmsc/meas_feed.c M src/libmsc/vty_interface_layer3.c M tests/vty_test_runner.py 7 files changed, 0 insertions(+), 276 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 4873bbe..a502ad4 100644 --- a/.gitignore +++ b/.gitignore @@ -40,10 +40,6 @@ # apps and app data src/osmo-msc/osmo-msc src/libcommon/gsup_test_client -src/utils/meas_vis -src/utils/meas_json -src/utils/osmo-meas-pcap2db -src/utils/osmo-meas-udp2db src/utils/smpp_mirror sms.db src/osmo-msc/*.cfg* diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 1419e8e..61c915a 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -33,7 +33,6 @@ iucs.h \ iucs_ranap.h \ iu_dummy.h \ - meas_feed.h \ meas_rep.h \ misdn.h \ mncc.h \ diff --git a/include/osmocom/msc/meas_feed.h b/include/osmocom/msc/meas_feed.h deleted file mode 100644 index 02b7d95..0000000 --- a/include/osmocom/msc/meas_feed.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_MEAS_FEED_H -#define _OPENBSC_MEAS_FEED_H - -#include - -#include - -struct meas_feed_hdr { - uint8_t msg_type; - uint8_t reserved; - uint16_t version; -}; - -struct meas_feed_meas { - struct meas_feed_hdr hdr; - char imsi[15+1]; - char name[31+1]; - char scenario[31+1]; - struct gsm_meas_rep mr; - /* The logical channel type, enum gsm_chan_t */ - uint8_t lchan_type; - /* The physical channel type, enum gsm_phys_chan_config */ - uint8_t pchan_type; - /* number of ths BTS in network */ - uint8_t bts_nr; - /* number of this TRX in the BTS */ - uint8_t trx_nr; - /* number of this timeslot at the TRX */ - uint8_t ts_nr; - /* The logical subslot number in the TS */ - uint8_t ss_nr; -}; - -enum meas_feed_msgtype { - MEAS_FEED_MEAS = 0, -}; - -#define MEAS_FEED_VERSION 1 - - -#endif diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 3ff97a3..6449948 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -19,7 +19,6 @@ $(NULL) noinst_HEADERS = \ - meas_feed.h \ $(NULL) noinst_LIBRARIES = \ @@ -49,7 +48,6 @@ transaction.c \ osmo_msc.c \ ctrl_commands.c \ - meas_feed.c \ subscr_conn.c \ $(NULL) if BUILD_IU diff --git a/src/libmsc/meas_feed.c b/src/libmsc/meas_feed.c deleted file mode 100644 index 3daebee..0000000 --- a/src/libmsc/meas_feed.c +++ /dev/null @@ -1,168 +0,0 @@ -/* UDP-Feed of measurement reports */ - -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "meas_feed.h" - -struct meas_feed_state { - struct osmo_wqueue wqueue; - char scenario[31+1]; - char *dst_host; - uint16_t dst_port; -}; - - -static struct meas_feed_state g_mfs; - -static int process_meas_rep(struct gsm_meas_rep *mr) -{ - struct msgb *msg; - struct meas_feed_meas *mfm; - struct vlr_subscr *vsub; - - /* ignore measurements as long as we don't know who it is */ - if (!mr->lchan || !mr->lchan->conn || !mr->lchan->conn->vsub) - return 0; - - vsub = mr->lchan->conn->vsub; - - msg = msgb_alloc(sizeof(struct meas_feed_meas), "Meas. Feed"); - if (!msg) - return 0; - - /* fill in the header */ - mfm = (struct meas_feed_meas *) msgb_put(msg, sizeof(*mfm)); - mfm->hdr.msg_type = MEAS_FEED_MEAS; - mfm->hdr.version = MEAS_FEED_VERSION; - - /* fill in MEAS_FEED_MEAS specific header */ - osmo_strlcpy(mfm->imsi, vsub->imsi, sizeof(mfm->imsi)); - osmo_strlcpy(mfm->name, vsub->name, sizeof(mfm->name)); - osmo_strlcpy(mfm->scenario, g_mfs.scenario, sizeof(mfm->scenario)); - - /* copy the entire measurement report */ - memcpy(&mfm->mr, mr, sizeof(mfm->mr)); - - /* copy channel information */ - /* we assume that the measurement report always belong to some timeslot */ - mfm->lchan_type = (uint8_t)mr->lchan->type; - mfm->pchan_type = (uint8_t)mr->lchan->ts->pchan; - mfm->bts_nr = mr->lchan->ts->trx->bts->nr; - mfm->trx_nr = mr->lchan->ts->trx->nr; - mfm->ts_nr = mr->lchan->ts->nr; - mfm->ss_nr = mr->lchan->nr; - - /* and send it to the socket */ - if (osmo_wqueue_enqueue(&g_mfs.wqueue, msg) != 0) - msgb_free(msg); - - return 0; -} - -static int meas_feed_sig_cb(unsigned int subsys, unsigned int signal, - void *handler_data, void *signal_data) -{ - struct lchan_signal_data *sdata = signal_data; - - if (subsys != SS_LCHAN) - return 0; - - if (signal == S_LCHAN_MEAS_REP) - process_meas_rep(sdata->mr); - - return 0; -} - -static int feed_write_cb(struct osmo_fd *ofd, struct msgb *msg) -{ - return write(ofd->fd, msgb_data(msg), msgb_length(msg)); -} - -static int feed_read_cb(struct osmo_fd *ofd) -{ - int rc; - char buf[256]; - - rc = read(ofd->fd, buf, sizeof(buf)); - ofd->fd &= ~BSC_FD_READ; - - return rc; -} - -int meas_feed_cfg_set(const char *dst_host, uint16_t dst_port) -{ - int rc; - int already_initialized = 0; - - if (g_mfs.wqueue.bfd.fd) - already_initialized = 1; - - - if (already_initialized && - !strcmp(dst_host, g_mfs.dst_host) && - dst_port == g_mfs.dst_port) - return 0; - - if (!already_initialized) { - osmo_wqueue_init(&g_mfs.wqueue, 10); - g_mfs.wqueue.write_cb = feed_write_cb; - g_mfs.wqueue.read_cb = feed_read_cb; - osmo_signal_register_handler(SS_LCHAN, meas_feed_sig_cb, NULL); - } - - if (already_initialized) { - osmo_wqueue_clear(&g_mfs.wqueue); - osmo_fd_unregister(&g_mfs.wqueue.bfd); - close(g_mfs.wqueue.bfd.fd); - /* don't set to zero, as that would mean 'not yet initialized' */ - g_mfs.wqueue.bfd.fd = -1; - } - rc = osmo_sock_init_ofd(&g_mfs.wqueue.bfd, AF_UNSPEC, SOCK_DGRAM, - IPPROTO_UDP, dst_host, dst_port, - OSMO_SOCK_F_CONNECT); - if (rc < 0) - return rc; - - g_mfs.wqueue.bfd.when &= ~BSC_FD_READ; - - if (g_mfs.dst_host) - talloc_free(g_mfs.dst_host); - g_mfs.dst_host = talloc_strdup(NULL, dst_host); - g_mfs.dst_port = dst_port; - - return 0; -} - -void meas_feed_cfg_get(char **host, uint16_t *port) -{ - *port = g_mfs.dst_port; - *host = g_mfs.dst_host; -} - -void meas_feed_scenario_set(const char *name) -{ - osmo_strlcpy(g_mfs.scenario, name, sizeof(g_mfs.scenario)); -} - -const char *meas_feed_scenario_get(void) -{ - return g_mfs.scenario; -} diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index c7ec586..dbd826d 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -56,8 +56,6 @@ #include -#include "meas_feed.h" - extern struct gsm_network *gsmnet_from_vty(struct vty *v); static void subscr_dump_full_vty(struct vty *vty, struct vlr_subscr *vsub) @@ -754,13 +752,6 @@ static int config_write_mncc_int(struct vty *vty) { - uint16_t meas_port; - char *meas_host; - const char *meas_scenario; - - meas_feed_cfg_get(&meas_host, &meas_port); - meas_scenario = meas_feed_scenario_get(); - vty_out(vty, "mncc-int%s", VTY_NEWLINE); vty_out(vty, " default-codec tch-f %s%s", get_value_string(tchf_codec_names, mncc_int.def_codec[0]), @@ -768,13 +759,6 @@ vty_out(vty, " default-codec tch-h %s%s", get_value_string(tchh_codec_names, mncc_int.def_codec[1]), VTY_NEWLINE); - if (meas_port) - vty_out(vty, " meas-feed destination %s %u%s", - meas_host, meas_port, VTY_NEWLINE); - if (strlen(meas_scenario) > 0) - vty_out(vty, " meas-feed scenario %s%s", - meas_scenario, VTY_NEWLINE); - return CMD_SUCCESS; } @@ -797,29 +781,6 @@ "Half-Rate\n" "Adaptive Multi-Rate\n") { mncc_int.def_codec[1] = get_string_value(tchh_codec_names, argv[0]); - - return CMD_SUCCESS; -} - -#define MEAS_STR "Measurement export related\n" -DEFUN(mnccint_meas_feed, mnccint_meas_feed_cmd, - "meas-feed destination ADDR <0-65535>", - MEAS_STR "destination\n" "address or hostname\n" "port number\n") -{ - int rc; - - rc = meas_feed_cfg_set(argv[0], atoi(argv[1])); - if (rc < 0) - return CMD_WARNING; - - return CMD_SUCCESS; -} - -DEFUN(meas_feed_scenario, meas_feed_scenario_cmd, - "meas-feed scenario NAME", - MEAS_STR "scenario\n" "Name up to 31 characters included in report\n") -{ - meas_feed_scenario_set(argv[0]); return CMD_SUCCESS; } @@ -924,14 +885,11 @@ install_element(ENABLE_NODE, &smsqueue_clear_cmd); install_element(ENABLE_NODE, &smsqueue_fail_cmd); install_element(ENABLE_NODE, &subscriber_send_pending_sms_cmd); - install_element(ENABLE_NODE, &meas_feed_scenario_cmd); install_element(CONFIG_NODE, &cfg_mncc_int_cmd); install_node(&mncc_int_node, config_write_mncc_int); install_element(MNCC_INT_NODE, &mnccint_def_codec_f_cmd); install_element(MNCC_INT_NODE, &mnccint_def_codec_h_cmd); - install_element(MNCC_INT_NODE, &mnccint_meas_feed_cmd); - install_element(MNCC_INT_NODE, &meas_feed_scenario_cmd); install_element(CFG_LOG_NODE, &logging_fltr_imsi_cmd); diff --git a/tests/vty_test_runner.py b/tests/vty_test_runner.py index de1997c..707fc5c 100644 --- a/tests/vty_test_runner.py +++ b/tests/vty_test_runner.py @@ -225,24 +225,6 @@ res = self.vty.command("show network") self.assert_(res.startswith('BSC is on Country Code') >= 0) - def testMeasurementFeed(self): - self.vty.enable() - self.vty.command("configure terminal") - self.vty.command("mncc-int") - - res = self.vty.command("write terminal") - self.assertEquals(res.find('meas-feed scenario'), -1) - - self.vty.command("meas-feed scenario bla") - res = self.vty.command("write terminal") - self.assert_(res.find('meas-feed scenario bla') > 0) - - self.vty.command("meas-feed scenario abcdefghijklmnopqrstuvwxyz01234567890") - res = self.vty.command("write terminal") - self.assertEquals(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz01234567890'), -1) - self.assertEquals(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz012345'), -1) - self.assert_(res.find('meas-feed scenario abcdefghijklmnopqrstuvwxyz01234') > 0) - def ipa_handle_small(x, verbose = False): s = data2str(x.recv(4)) if len(s) != 4*2: -- To view, visit https://gerrit.osmocom.org/6019 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d57ac214e574e267fa9752daf76566197b9aa64 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:46 +0000 Subject: [MERGED] osmo-msc[master]: Reject any CM SERVICE we don't support In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Reject any CM SERVICE we don't support ...................................................................... Reject any CM SERVICE we don't support When we receive a CM Service Request, OsmoMSC should eventually verify what kind of service it is the phone requests, and whether we support that service. Change-Id: I499730d760dc9ac7f599e09959c6eac4452f2eab Closes: OS#2668 --- M src/libmsc/gsm_04_08.c 1 file changed, 11 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 90669e1..ea40a96 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -693,6 +693,17 @@ GSM48_REJECT_INCORRECT_MESSAGE); } + switch (req->cm_service_type) { + case GSM48_CMSERV_MO_CALL_PACKET: + case GSM48_CMSERV_EMERGENCY: + case GSM48_CMSERV_SMS: + case GSM48_CMSERV_SUP_SERV: + /* continue below */ + break; + default: + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED); + } + osmo_signal_dispatch(SS_SUBSCR, S_SUBSCR_IDENTITY, (classmark2 + classmark2_len)); memcpy(conn->classmark.classmark2, classmark2, classmark2_len); conn->classmark.classmark2_len = classmark2_len; -- To view, visit https://gerrit.osmocom.org/6011 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I499730d760dc9ac7f599e09959c6eac4452f2eab Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:46 +0000 Subject: [MERGED] osmo-msc[master]: Log difference between SETUP and EMERGENCY_SETUP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Log difference between SETUP and EMERGENCY_SETUP ...................................................................... Log difference between SETUP and EMERGENCY_SETUP An emergency call should be logged different from a normal call, and we also increase the log level from INFO to NOTICE in such a situation. Change-Id: I83f3b8bd0aeda70f03aa7b8d264a9008d10d5687 --- M src/libmsc/gsm_04_08.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3045f71..848650c 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1605,8 +1605,8 @@ new_cc_state(trans, GSM_CSTATE_INITIATED); - LOGP(DCC, LOGL_INFO, "Subscriber %s (%s) sends SETUP to %s\n", - vlr_subscr_name(trans->vsub), trans->vsub->msisdn, + LOGP(DCC, setup.emergency ? LOGL_NOTICE : LOGL_INFO, "Subscriber %s (%s) sends %sSETUP to %s\n", + vlr_subscr_name(trans->vsub), trans->vsub->msisdn, setup.emergency ? "EMERGENCY_" : "", setup.called.number); rate_ctr_inc(&trans->net->msc_ctrs->ctr[MSC_CTR_CALL_MO_SETUP]); -- To view, visit https://gerrit.osmocom.org/6003 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83f3b8bd0aeda70f03aa7b8d264a9008d10d5687 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:47 +0000 Subject: [MERGED] osmo-msc[master]: Emergency Call: Set MNCC_F_EMERGENCY flag In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Emergency Call: Set MNCC_F_EMERGENCY flag ...................................................................... Emergency Call: Set MNCC_F_EMERGENCY flag MNCC has a MNCC_F_EMERGENCY flag to indicate that the mncc.emergency field is present. However, OsmoMSC never sets this flag. Change-Id: I0ebd8f88e483172988f4a0cb0636b4160688d8ad Closes: OS#2865 --- M src/libmsc/gsm_04_08.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 848650c..54e8bee 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -1546,8 +1546,10 @@ tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); /* emergency setup is identified by msg_type */ - if (msg_type == GSM48_MT_CC_EMERG_SETUP) + if (msg_type == GSM48_MT_CC_EMERG_SETUP) { + setup.fields |= MNCC_F_EMERGENCY; setup.emergency = 1; + } /* use subscriber as calling party number */ setup.fields |= MNCC_F_CALLING; -- To view, visit https://gerrit.osmocom.org/6004 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ebd8f88e483172988f4a0cb0636b4160688d8ad Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 14:04:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 14:04:47 +0000 Subject: [MERGED] osmo-msc[master]: Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT Cause ...................................................................... Refuse Emergency Calls by IMEI with proper CM SERVICE REJECT Cause OsmoMSC rejects an Emergency Call with IMEI as mobile identity with "semantically incorrect message" which is clearly wrong. According to TS 24.008 4.5.1.5 we should reject with cause 5 "IMEI not accepted" Found with TTCN-3 test case MSC_Tests.TC_emerg_call_imei Change-Id: I2f7ab0e32b914a112c0b17c523d149ccd0299099 Closes: #2866 --- M src/libmsc/gsm_04_08.c 1 file changed, 15 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 54e8bee..90669e1 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -672,16 +672,22 @@ gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); mi_type = mi[0] & GSM_MI_TYPE_MASK; + DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n", + req->cm_service_type, gsm48_mi_type_name(mi_type), mi_string); - if (mi_type == GSM_MI_TYPE_IMSI) { - DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n", - req->cm_service_type, gsm48_mi_type_name(mi_type), - mi_string); - } else if (mi_type == GSM_MI_TYPE_TMSI) { - DEBUGPC(DMM, "serv_type=0x%02x MI(%s)=%s\n", - req->cm_service_type, gsm48_mi_type_name(mi_type), - mi_string); - } else { + switch (mi_type) { + case GSM_MI_TYPE_IMSI: + case GSM_MI_TYPE_TMSI: + /* continue below */ + break; + case GSM_MI_TYPE_IMEI: + if (req->cm_service_type == GSM48_CMSERV_EMERGENCY) { + /* We don't do emergency calls by IMEI */ + LOGP(DMM, LOGL_NOTICE, "<- CM SERVICE REQUEST(IMEI=%s) rejected\n", mi_string); + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_IMEI_NOT_ACCEPTED); + } + /* fall-through for non-emergency setup */ + default: DEBUGPC(DMM, "mi_type is not expected: %d\n", mi_type); return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_INCORRECT_MESSAGE); -- To view, visit https://gerrit.osmocom.org/6005 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2f7ab0e32b914a112c0b17c523d149ccd0299099 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 15:51:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 15:51:29 +0000 Subject: [PATCH] libosmocore[master]: gsm48_pdisc_names: Use conscise, short names Message-ID: Review at https://gerrit.osmocom.org/6020 gsm48_pdisc_names: Use conscise, short names Some times I *really* regret ever having merged OSMO_VALUE_STRING, as it generates completely unusable and way too long strings :( Change-Id: I8de7c01f9ea1d66c384e57449c4140186f5ce6c5 --- M src/gsm/gsm48.c 1 file changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/6020/1 diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 8876059..4570802 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -740,21 +740,21 @@ /*! 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), - OSMO_VALUE_STRING(GSM48_PDISC_PDSS1), - OSMO_VALUE_STRING(GSM48_PDISC_CC), - OSMO_VALUE_STRING(GSM48_PDISC_PDSS2), - OSMO_VALUE_STRING(GSM48_PDISC_MM), - OSMO_VALUE_STRING(GSM48_PDISC_RR), - OSMO_VALUE_STRING(GSM48_PDISC_MM_GPRS), - OSMO_VALUE_STRING(GSM48_PDISC_SMS), - OSMO_VALUE_STRING(GSM48_PDISC_SM_GPRS), - OSMO_VALUE_STRING(GSM48_PDISC_NC_SS), - OSMO_VALUE_STRING(GSM48_PDISC_LOC), - OSMO_VALUE_STRING(GSM48_PDISC_EXTEND), - OSMO_VALUE_STRING(GSM48_PDISC_MASK), - OSMO_VALUE_STRING(GSM48_PDISC_USSD), + { GSM48_PDISC_GROUP_CC, "VGCC" }, + { GSM48_PDISC_BCAST_CC, "VBCC" }, + { GSM48_PDISC_PDSS1, "PDSS1" }, + { GSM48_PDISC_CC, "CC" }, + { GSM48_PDISC_PDSS2, "PDSS2" }, + { GSM48_PDISC_MM, "MM" }, + { GSM48_PDISC_RR, "RR" }, + { GSM48_PDISC_MM_GPRS, "GMM" }, + { GSM48_PDISC_SMS, "SMS" }, + { GSM48_PDISC_SM_GPRS, "SM" }, + { GSM48_PDISC_NC_SS, "NCSS" }, + { GSM48_PDISC_LOC, "LCS" }, + { GSM48_PDISC_EXTEND, "EXTD" }, + { GSM48_PDISC_MASK, "MASK" }, + { GSM48_PDISC_USSD, "USSD" }, { 0, NULL } }; -- To view, visit https://gerrit.osmocom.org/6020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8de7c01f9ea1d66c384e57449c4140186f5ce6c5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 15:51:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 15:51:36 +0000 Subject: [PATCH] libosmocore[master]: SMS: Add value_string for TS 04.11 CP and RP state Message-ID: Review at https://gerrit.osmocom.org/6021 SMS: Add value_string for TS 04.11 CP and RP state Change-Id: I1b2f6fc6f455b0ba2a5732c567a4867bca97c3b0 --- M include/osmocom/gsm/gsm0411_smc.h M include/osmocom/gsm/gsm0411_smr.h M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/libosmogsm.map 5 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/21/6021/1 diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 7dfaa15..d05c018 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -64,4 +64,9 @@ int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type); +extern const struct value_string gsm411_cp_state_names[]; + +static inline const char *gsm411_cp_state_name(enum gsm411_cp_state cp_state) { + return get_value_string(gsm411_cp_state_names, cp_state); +} /*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index 28f43de..75102f8 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -45,4 +45,10 @@ int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg); +extern const struct value_string gsm411_rp_state_names[]; + +static inline const char *gsm411_rp_state_name(enum gsm411_rp_state rp_state) { + return get_value_string(gsm411_rp_state_names, rp_state); +} + /*! @} */ diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 28287e4..50d0f3e 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -578,4 +578,11 @@ return rc; } +const struct value_string gsm411_cp_state_names[] = { + { GSM411_CPS_IDLE, "IDLE" }, + { GSM411_CPS_MM_CONN_PENDING, "MM_CONN_PENDING" }, + { GSM411_CPS_WAIT_CP_ACK, "WAIT_CP_ACK" }, + { GSM411_CPS_MM_ESTABLISHED, "ESTABLISHD" }, + { 0, NULL } +}; /*! @} */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index 892b7f0..21d28c5 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -492,4 +492,11 @@ return rc; } +const struct value_string gsm411_rp_state_names[] = { + { GSM411_RPS_IDLE, "IDLE" }, + { GSM411_RPS_WAIT_FOR_RP_ACK, "WAIT_FOR_RP_ACK" }, + { GSM411_RPS_WAIT_TO_TX_RP_ACK, "WAIT_TO_TX_RP_ACK" }, + { GSM411_RPS_WAIT_FOR_RETRANS_T,"WAIT_FOR_RETRANS_T" }, + { 0, NULL } +}; /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9a7073d..53b6f6e 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -197,7 +197,9 @@ gsm411_smr_send; gsm411_unbcdify; gsm411_cp_cause_strs; +gsm411_cp_state_names; gsm411_rp_cause_strs; +gsm411_rp_state_names; gsm414_msgt_names; -- To view, visit https://gerrit.osmocom.org/6021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b2f6fc6f455b0ba2a5732c567a4867bca97c3b0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:24:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:24:29 +0000 Subject: libosmocore[master]: SMS: Add value_string for TS 04.11 CP and RP state In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b2f6fc6f455b0ba2a5732c567a4867bca97c3b0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:24:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:24:45 +0000 Subject: libosmocore[master]: gsm48_pdisc_names: Use conscise, short names In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8de7c01f9ea1d66c384e57449c4140186f5ce6c5 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:25:05 +0000 Subject: [MERGED] libosmocore[master]: gsm48_pdisc_names: Use conscise, short names In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm48_pdisc_names: Use conscise, short names ...................................................................... gsm48_pdisc_names: Use conscise, short names Some times I *really* regret ever having merged OSMO_VALUE_STRING, as it generates completely unusable and way too long strings :( Change-Id: I8de7c01f9ea1d66c384e57449c4140186f5ce6c5 --- M src/gsm/gsm48.c 1 file changed, 15 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsm48.c b/src/gsm/gsm48.c index 8876059..4570802 100644 --- a/src/gsm/gsm48.c +++ b/src/gsm/gsm48.c @@ -740,21 +740,21 @@ /*! 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), - OSMO_VALUE_STRING(GSM48_PDISC_PDSS1), - OSMO_VALUE_STRING(GSM48_PDISC_CC), - OSMO_VALUE_STRING(GSM48_PDISC_PDSS2), - OSMO_VALUE_STRING(GSM48_PDISC_MM), - OSMO_VALUE_STRING(GSM48_PDISC_RR), - OSMO_VALUE_STRING(GSM48_PDISC_MM_GPRS), - OSMO_VALUE_STRING(GSM48_PDISC_SMS), - OSMO_VALUE_STRING(GSM48_PDISC_SM_GPRS), - OSMO_VALUE_STRING(GSM48_PDISC_NC_SS), - OSMO_VALUE_STRING(GSM48_PDISC_LOC), - OSMO_VALUE_STRING(GSM48_PDISC_EXTEND), - OSMO_VALUE_STRING(GSM48_PDISC_MASK), - OSMO_VALUE_STRING(GSM48_PDISC_USSD), + { GSM48_PDISC_GROUP_CC, "VGCC" }, + { GSM48_PDISC_BCAST_CC, "VBCC" }, + { GSM48_PDISC_PDSS1, "PDSS1" }, + { GSM48_PDISC_CC, "CC" }, + { GSM48_PDISC_PDSS2, "PDSS2" }, + { GSM48_PDISC_MM, "MM" }, + { GSM48_PDISC_RR, "RR" }, + { GSM48_PDISC_MM_GPRS, "GMM" }, + { GSM48_PDISC_SMS, "SMS" }, + { GSM48_PDISC_SM_GPRS, "SM" }, + { GSM48_PDISC_NC_SS, "NCSS" }, + { GSM48_PDISC_LOC, "LCS" }, + { GSM48_PDISC_EXTEND, "EXTD" }, + { GSM48_PDISC_MASK, "MASK" }, + { GSM48_PDISC_USSD, "USSD" }, { 0, NULL } }; -- To view, visit https://gerrit.osmocom.org/6020 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8de7c01f9ea1d66c384e57449c4140186f5ce6c5 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 Wed Jan 24 16:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:25:05 +0000 Subject: [MERGED] libosmocore[master]: SMS: Add value_string for TS 04.11 CP and RP state In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SMS: Add value_string for TS 04.11 CP and RP state ...................................................................... SMS: Add value_string for TS 04.11 CP and RP state Change-Id: I1b2f6fc6f455b0ba2a5732c567a4867bca97c3b0 --- M include/osmocom/gsm/gsm0411_smc.h M include/osmocom/gsm/gsm0411_smr.h M src/gsm/gsm0411_smc.c M src/gsm/gsm0411_smr.c M src/gsm/libosmogsm.map 5 files changed, 27 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/gsm0411_smc.h b/include/osmocom/gsm/gsm0411_smc.h index 7dfaa15..d05c018 100644 --- a/include/osmocom/gsm/gsm0411_smc.h +++ b/include/osmocom/gsm/gsm0411_smc.h @@ -64,4 +64,9 @@ int gsm411_smc_recv(struct gsm411_smc_inst *inst, int msg_type, struct msgb *msg, int cp_msg_type); +extern const struct value_string gsm411_cp_state_names[]; + +static inline const char *gsm411_cp_state_name(enum gsm411_cp_state cp_state) { + return get_value_string(gsm411_cp_state_names, cp_state); +} /*! @} */ diff --git a/include/osmocom/gsm/gsm0411_smr.h b/include/osmocom/gsm/gsm0411_smr.h index 28f43de..75102f8 100644 --- a/include/osmocom/gsm/gsm0411_smr.h +++ b/include/osmocom/gsm/gsm0411_smr.h @@ -45,4 +45,10 @@ int gsm411_smr_recv(struct gsm411_smr_inst *inst, int msg_type, struct msgb *msg); +extern const struct value_string gsm411_rp_state_names[]; + +static inline const char *gsm411_rp_state_name(enum gsm411_rp_state rp_state) { + return get_value_string(gsm411_rp_state_names, rp_state); +} + /*! @} */ diff --git a/src/gsm/gsm0411_smc.c b/src/gsm/gsm0411_smc.c index 28287e4..50d0f3e 100644 --- a/src/gsm/gsm0411_smc.c +++ b/src/gsm/gsm0411_smc.c @@ -578,4 +578,11 @@ return rc; } +const struct value_string gsm411_cp_state_names[] = { + { GSM411_CPS_IDLE, "IDLE" }, + { GSM411_CPS_MM_CONN_PENDING, "MM_CONN_PENDING" }, + { GSM411_CPS_WAIT_CP_ACK, "WAIT_CP_ACK" }, + { GSM411_CPS_MM_ESTABLISHED, "ESTABLISHD" }, + { 0, NULL } +}; /*! @} */ diff --git a/src/gsm/gsm0411_smr.c b/src/gsm/gsm0411_smr.c index 892b7f0..21d28c5 100644 --- a/src/gsm/gsm0411_smr.c +++ b/src/gsm/gsm0411_smr.c @@ -492,4 +492,11 @@ return rc; } +const struct value_string gsm411_rp_state_names[] = { + { GSM411_RPS_IDLE, "IDLE" }, + { GSM411_RPS_WAIT_FOR_RP_ACK, "WAIT_FOR_RP_ACK" }, + { GSM411_RPS_WAIT_TO_TX_RP_ACK, "WAIT_TO_TX_RP_ACK" }, + { GSM411_RPS_WAIT_FOR_RETRANS_T,"WAIT_FOR_RETRANS_T" }, + { 0, NULL } +}; /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 9a7073d..53b6f6e 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -197,7 +197,9 @@ gsm411_smr_send; gsm411_unbcdify; gsm411_cp_cause_strs; +gsm411_cp_state_names; gsm411_rp_cause_strs; +gsm411_rp_state_names; gsm414_msgt_names; -- To view, visit https://gerrit.osmocom.org/6021 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1b2f6fc6f455b0ba2a5732c567a4867bca97c3b0 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 Wed Jan 24 16:29:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:26 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: WIP: MSC: Add MO call testing Message-ID: Review at https://gerrit.osmocom.org/6022 WIP: MSC: Add MO call testing Change-Id: If32cb359b3cf732c4752856538552595dbbf2a8a --- M library/L3_Templates.ttcn M library/MNCC_Types.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 110 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/22/6022/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 0da4706..be9386a 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -427,6 +427,52 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + disconnect_NW_MS := { + messageType := '100101'B, + nsd := '00'B, + cause := ?, + facility := *, + progressIndicator := *, + user_user := *, + allowedActions := * + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + release_NW_MS := { + messageType := '101101'B, + nsd := '00'B, + cause := ?, + secondCause := *, + facility := *, + user_user := * + } + } + } +} diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index e5d6af9..46159b7 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -274,6 +274,18 @@ variant (coding) "FIELDLENGTH(32)"; } +template MNCC_cause ts_MNCC_cause(int val, + GSM48_cause_loc loc := GSM48_CAUSE_LOC_PUN_S_LU, + GSM48_cause_coding coding := GSM48_CAUSE_CS_GSM, + octetstring diag := ''O) := { + location := loc, + coding := coding, + rec := 0, + rec_val := 0, + val := val, + diag := diag +} + type record MNCC_useruser { int proto, charstring info diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 68e0bef..dea27a7 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -21,6 +21,7 @@ import from Osmocom_CTRL_Adapter all; import from MNCC_Emulation all; +import from MNCC_Types all; import from GSUP_Emulation all; import from GSUP_Types all; @@ -458,6 +459,56 @@ vc_conn.done; } +private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, true, true); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false); + + var hexstring called := '12345'H; + var integer tid := 0; + var MNCC_PDU mncc; + f_create_mncc_expect(hex2str(called)); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(tid, called))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc; + /* FIXME: extract call_id */ + + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); + + /* Answer. This causes TCH assignment in case of "late assignment" */ + MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + + f_sleep(3.0); + + /* Hangup by "B" side */ + MNCC.send(ts_MNCC_DISC_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(23)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(tid))); + + /* Release of call */ + MNCC.send(ts_MNCC_REL_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); + + /* clearing of radio channel */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + + f_sleep(5.0); +} +testcase TC_lu_and_mo_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 1); + vc_conn.done; +} @@ -467,6 +518,7 @@ //execute( TC_lu_imsi_noauth_notmsi() ); execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); + execute( TC_lu_and_mo_call() ); } -- To view, visit https://gerrit.osmocom.org/6022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If32cb359b3cf732c4752856538552595dbbf2a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:26 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP/L3: Add templates related to authentication Message-ID: Review at https://gerrit.osmocom.org/6023 GSUP/L3: Add templates related to authentication Change-Id: Id9566e3e075a8837e2e77a7c2b9d8f0f6e9b7554 --- M library/GSUP_Types.ttcn M library/L3_Templates.ttcn 2 files changed, 152 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/23/6023/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 7455085..bc54510 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -88,8 +88,15 @@ variant (val) "CROSSTAG(imsi, tag = OSMO_GSUP_IMSI_IE; cause, tag = OSMO_GSUP_CAUSE_IE; cancel_type, tag = OSMO_GSUP_CANCEL_TYPE_IE; + auth_tuple, tag = OSMO_GSUP_AUTH_TUPLE_IE; auts, tag = OSMO_GSUP_AUTS_IE; rand, tag = OSMO_GSUP_RAND_IE; + sres, tag = OSMO_GSUP_SRES_IE; + kc, tag = OSMO_GSUP_KC_IE; + ik, tag = OSMO_GSUP_IK_IE; + ck, tag = OSMO_GSUP_CK_IE; + autn, tag = OSMO_GSUP_AUTN_IE; + res, tag = OSMO_GSUP_RES_IE; msisdn, tag = OSMO_GSUP_MSISDN_IE; hlr_number, tag = OSMO_GSUP_HLR_NUMBER_IE; cn_domain, tag = OSMO_GSUP_CN_DOMAIN_IE; @@ -108,6 +115,12 @@ GSUP_IEs auth_tuple, octetstring auts, octetstring rand, + octetstring sres, + octetstring kc, + octetstring ik, + octetstring ck, + octetstring autn, + octetstring res, hexstring msisdn, octetstring hlr_number, GSUP_CnDomain cn_domain, @@ -126,6 +139,38 @@ with { extension "prototype(convert) decode(RAW)" }; +template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, + octetstring kc) := { + tag := OSMO_GSUP_AUTH_TUPLE_IE, + len := 0, /* overwritten */ + val := { + auth_tuple := { + valueof(ts_GSUP_IE_RAND(rand)), + valueof(ts_GSUP_IE_SRES(sres)), + valueof(ts_GSUP_IE_Kc(kc)) + } + } +} + +template GSUP_IE ts_GSUP_IE_AuthTuple2G3G(octetstring rand, octetstring sres, + octetstring kc, octetstring ik, + octetstring ck, octetstring autn, + octetstring res) := { + tag := OSMO_GSUP_AUTH_TUPLE_IE, + len := 0, /* overwritten */ + val := { + auth_tuple := { + valueof(ts_GSUP_IE_RAND(rand)), + valueof(ts_GSUP_IE_SRES(sres)), + valueof(ts_GSUP_IE_Kc(kc)), + valueof(ts_GSUP_IE_IK(ik)), + valueof(ts_GSUP_IE_CK(ck)), + valueof(ts_GSUP_IE_AUTN(autn)), + valueof(ts_GSUP_IE_RES(res)) + } + } +} + template GSUP_PDU tr_GSUP(template GSUP_MessageType msgt := ?, template GSUP_IEs ies := *) := { msg_type := msgt, ies := ies @@ -141,6 +186,10 @@ template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); + +template (value) GSUP_PDU ts_GSUP_SAI_RES(hexstring imsi, GSUP_IE auth_tuple) := + ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT, { + valueof(ts_GSUP_IE_IMSI(imsi)), auth_tuple }); template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { @@ -241,6 +290,53 @@ } } +template (value) GSUP_IE ts_GSUP_IE_SRES(octetstring sres) := { + tag := OSMO_GSUP_SRES_IE, + len := 0, /* overwritten */ + val := { + sres := sres + } +} + +template (value) GSUP_IE ts_GSUP_IE_Kc(octetstring kc) := { + tag := OSMO_GSUP_KC_IE, + len := 0, /* overwritten */ + val := { + kc := kc + } +} + +template (value) GSUP_IE ts_GSUP_IE_IK(octetstring ik) := { + tag := OSMO_GSUP_IK_IE, + len := 0, /* overwritten */ + val := { + ik := ik + } +} + +template (value) GSUP_IE ts_GSUP_IE_CK(octetstring ck) := { + tag := OSMO_GSUP_CK_IE, + len := 0, /* overwritten */ + val := { + ck := ck + } +} + +template (value) GSUP_IE ts_GSUP_IE_AUTN(octetstring autn) := { + tag := OSMO_GSUP_AUTN_IE, + len := 0, /* overwritten */ + val := { + autn := autn + } +} + +template (value) GSUP_IE ts_GSUP_IE_RES(octetstring res) := { + tag := OSMO_GSUP_RES_IE, + len := 0, /* overwritten */ + val := { + res := res + } +} diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index be9386a..d652873 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -474,6 +474,62 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + authenticationRequest := { + messageType := '010010'B, + nsd := '00'B, + cipheringKeySequenceNumber := ?, + spare2_4 := ?, + authenticationParRAND := rand, + authenticationParAUTN := * + } + } + } +} + +template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + authenticationResponse := { + messageType := '010100'B, + nsd := '00'B, + authenticationParSRES := sres, + authenticationParSRESext := omit + } + } + } +} + +template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + authenticationResponse := { + messageType := '010100'B, + nsd := '00'B, + authenticationParSRES := sres, + authenticationParSRESext := { + elementIdentifier := '21'O, + lengthIndicator := 0, /* overwritten */ + valueField := res + } + } + } + } +} } -- To view, visit https://gerrit.osmocom.org/6023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9566e3e075a8837e2e77a7c2b9d8f0f6e9b7554 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:26 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC: Add test for LU with 2G authentication Message-ID: Review at https://gerrit.osmocom.org/6024 MSC: Add test for LU with 2G authentication Change-Id: I5ea201bd603e581f199cd29056e7e7ebc9bd0923 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 20 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/24/6024/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 39acfb7..ee0e0ae 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -149,9 +149,15 @@ } if (expect_auth) { + var OCT16 rand := 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'O; + var OCT4 sres := 'bbbbbbbb'O; + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(rand, sres, + 'cccccccccccccccc'O)); GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); - /* FIXME */ - //GSUP.send(tr_GSUP_SAI_RES()); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(sres))); } /* Expect MSC to perform LU with HLR */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index dea27a7..15ffc20 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -418,6 +418,18 @@ vc_conn.done; } +private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(true, true, true); +} +testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi), testcasename(), 5); + vc_conn.done; +} + /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) -- To view, visit https://gerrit.osmocom.org/6024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5ea201bd603e581f199cd29056e7e7ebc9bd0923 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:26 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc_tests: Randomly generate Auth Vector (rather than hard-c... Message-ID: Review at https://gerrit.osmocom.org/6025 msc_tests: Randomly generate Auth Vector (rather than hard-coded value) Change-Id: I2dc0570a8ae5003d26368b09d223db8e44a5c4ff --- M msc_tests/BSC_ConnectionHandler.ttcn 1 file changed, 28 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/25/6025/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index ee0e0ae..f9b4d3e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -133,6 +133,30 @@ return l3_info; } +type record AuthVector { + OCT16 rand, + OCT4 sres, + OCT8 kc + /* FIXME: 3G elements */ +} + +private function f_rnd_oct(integer len) return octetstring { + var integer i; + var octetstring res; + for (i := 0; i < len; i := i + 1) { + res[i] := int2oct(float2int(rnd()*256.0), 1); + } + return res; +} + +function f_gen_auth_vec_2g() return AuthVector { + var AuthVector vec; + vec.rand := f_rnd_oct(16); + vec.sres := f_rnd_oct(4); + vec.kc := f_rnd_oct(8); + return vec; +} + function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -149,15 +173,13 @@ } if (expect_auth) { - var OCT16 rand := 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'O; - var OCT4 sres := 'bbbbbbbb'O; - var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(rand, sres, - 'cccccccccccccccc'O)); + var AuthVector vec := f_gen_auth_vec_2g(); + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(rand))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(sres))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(vec.sres))); } /* Expect MSC to perform LU with HLR */ -- To view, visit https://gerrit.osmocom.org/6025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dc0570a8ae5003d26368b09d223db8e44a5c4ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:27 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add tests for HLR SAI timeout and HLR SAI error Message-ID: Review at https://gerrit.osmocom.org/6026 msc: Add tests for HLR SAI timeout and HLR SAI error Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367 --- M library/GSUP_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 75 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/26/6026/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index bc54510..15560c7 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -192,9 +192,14 @@ valueof(ts_GSUP_IE_IMSI(imsi)), auth_tuple }); template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := - tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { + tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); +template GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := + tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { + ts_GSUP_IE_IMSI(imsi), ts_GSUP_IE_Cause(cause) }); + + template GSUP_PDU tr_GSUP_SAI_RES(template hexstring imsi) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 15ffc20..9f8dd69 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -518,7 +518,73 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 1); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6); + vc_conn.done; +} + +/* Test LU (with authentication enabled), where HLR times out sending SAI response */ +private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + /* The HLR would normally return an auth vector here, but we fail to do so. */ + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_auth_sai_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7); + vc_conn.done; +} + +/* Test LU (with authentication enabled), where HLR rejects sending SAI error */ +private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_auth_sai_err() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8); vc_conn.done; } @@ -531,6 +597,8 @@ execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); execute( TC_lu_and_mo_call() ); + execute( TC_lu_auth_sai_timeout() ); + execute( TC_lu_auth_sai_err() ); } -- To view, visit https://gerrit.osmocom.org/6026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:27 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Test closing BSSAP connection of LU by ClearCommand Message-ID: Review at https://gerrit.osmocom.org/6027 msc: Test closing BSSAP connection of LU by ClearCommand Change-Id: I9194da2f9324ee17c920458cb920a6fa718ac739 --- M library/BSSMAP_Templates.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/27/6027/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 925a8e6..5331505 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -609,6 +609,18 @@ } } +template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + clearRequest := { + messageType := '22'O, /* overwritten */ + cause := ts_BSSMAP_IE_Cause(cause) + } + } + } +} + template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9f8dd69..a21ad50 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -588,6 +588,38 @@ vc_conn.done; } +/* Test LU but BSC will send a clear request in the middle */ +private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + f_sleep(1.0); + /* send clear request in the middle of the LU */ + BSSAP.send(ts_BSSMAP_ClearRequest(0)); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_clear_request() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_clear_request), testcasename(), 8); + vc_conn.done; +} + control { -- To view, visit https://gerrit.osmocom.org/6027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9194da2f9324ee17c920458cb920a6fa718ac739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:27 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add test case for LU with MI=IMEI (which is illegal) Message-ID: Review at https://gerrit.osmocom.org/6028 msc: Add test case for LU with MI=IMEI (which is illegal) Change-Id: Ie3c91a0ff212a70a8e03e0579f240a10bc4356f4 --- M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 163 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/6028/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index d652873..ca81b72 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -56,6 +56,18 @@ return l3; } +private function f_enc_IMEI_L3(hexstring digits) return IMEI_L3 { + var IMEI_L3 l3; + var integer len := lengthof(digits); + if (len rem 2 == 1) { /* modulo remainder */ + l3.oddevenIndicator := '1'B; + } else { + l3.oddevenIndicator := '0'B; + } + l3.digits := digits; + return l3; +} + /* send template fro Mobile Identity (IMSI) */ template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := { lengthIndicator := 0, /* overwritten */ @@ -66,6 +78,18 @@ } } } + +/* send template fro Mobile Identity (IMEI) */ +template (value) MobileIdentityLV ts_MI_IMEI_LV(hexstring imei_digits) := { + lengthIndicator := 0, /* overwritten */ + mobileIdentityV := { + typeOfIdentity := '000'B, /* overwritten */ + oddEvenInd_identity := { + imei := f_enc_IMEI_L3(imei_digits) + } + } +} + /* Send template for Classmark 2 */ template (value) MobileStationClassmark2_LV ts_CM2 := { @@ -300,6 +324,43 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template BIT3 id_type := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + identityRequest := { + messageType := '011000'B, + nsd := '00'B, + identityType := id_type, + spare1_5 := ? + } + } + } +} + +template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := { + msgs := { + mm := { + identityResponse := { + messageType := '011001'B, + nsd := '00'B, + mobileIdentityLV := mi, + p_TMSI_TypeTV := omit, + routingAreaIdentification2TLV := omit, + p_TMSISignature2TLV := omit + } + } + } +} +template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) := + ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi))); +template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) := + ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); + + template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { discriminator := '0011'B, tiOrSkip := { diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index f9b4d3e..0fb1702 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -125,6 +125,16 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); return f_build_lu(mi); } +function f_build_lu_imei(hexstring imei) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(imei)); + return f_build_lu(mi); +} +function f_build_lu_tmsi(OCT4 tmsi) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV(tmsi)); + return f_build_lu(mi); +} private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW { var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index a21ad50..c2d1771 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -620,6 +620,98 @@ vc_conn.done; } +/* Test LU but with illegal mobile identity type = IMEI */ +private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + /* wait for LU reject, ignore any ID REQ */ + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req)) { repeat; } + } + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9); + vc_conn.done; +} + +/* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ +private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_tmsi('01020304'O); /* FIXME: Random */ + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* Wait for + respond to ID REQ (IMSI) */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req('001'B))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_MM_ID_Rsp_IMSI(g_pars.imsi))); + + /* Expect MSC to do UpdateLocation to HLR; respond to it */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { + setverdict(fail, "Expected LU ACK, but received REJ"); + } + } + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1); + vc_conn.done; +} + + +/* TODO: + * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? + * malformed messages (missing IE, invalid message type): properly rejected? + * MT call while LU or is ongoing: Do we use existing lchan or page while lchan active? + * 3G/2G auth permutations + * encryption algorithms vs. classmark vs. vty config + * emergency call + * IMSI DETACH + * send new transaction after/during clear (like SMS, ...) + */ control { -- To view, visit https://gerrit.osmocom.org/6028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3c91a0ff212a70a8e03e0579f240a10bc4356f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:27 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests Message-ID: Review at https://gerrit.osmocom.org/6029 MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests Change-Id: I04ca21824f66ad90d9dac2c25000ecd724aa4528 --- M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 272 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/29/6029/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ca81b72..db514a4 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -361,6 +361,29 @@ ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); +template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { + rf_PowerCapability := '010'B, + a5_1 := a5_1_unavail, + esind := '1'B, + revisionLevel := rev, + spare1_1 := '0'B +} + +template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi, + template MobileStationClassmark1_V cm1 := ts_CM1) +modifies ts_ML3_MO := { + msgs := { + mm := { + imsiDetachIndication := { + messageType := '000001'B, + nsd := '00'B, + mobileStationClassmark1 := cm1, + mobileIdentityLV := mi + } + } + } +} + template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { discriminator := '0011'B, tiOrSkip := { @@ -440,6 +463,30 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + emergencySetup := { + messageType := '001110'B, + nsd := '00'B, + bearerCapability := bcap, + streamIdentifier := omit, + supportedCodecs := omit, + emergencyCategory := omit + } + } + } +} + + template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { discriminator := '0011'B, tiOrSkip := { diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 0fb1702..69854e3 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -80,14 +80,6 @@ bssap := bssap }; -template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { - rf_PowerCapability := '010'B, - a5_1 := a5_1_unavail, - esind := '1'B, - revisionLevel := rev, - spare1_1 := '0'B -} - /* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ function f_bssap_compl_l3(PDU_ML3_MS_NW l3) runs on BSC_ConnHdlr { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c2d1771..0fad797 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -702,6 +702,228 @@ } +/* Test IMSI DETACH (MI=IMSI) */ +private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + + /* Send Early Classmark, just for the fun of it? */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_imsi_detach_by_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), testcasename(), 2); + vc_conn.done; +} + +/* Test IMSI DETACH (MI=TMSI) */ +private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + + /* Send Early Classmark, just for the fun of it? */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_imsi_detach_by_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), testcasename(), 3); + vc_conn.done; +} + +/* Test IMSI DETACH (MI=IMEI), which is illegal */ +private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + + /* Send Early Classmark, just for the fun of it? */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_imsi_detach_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), testcasename(), 4); + vc_conn.done; +} + + +/* helper function for an emergency call. caller passes in mobile identity to use */ +private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { + + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); + + var hexstring called := '112'H; + var integer tid := 0; + var MNCC_PDU mncc; + f_create_mncc_expect(hex2str(called)); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_EMERG_SETUP(tid))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc; + /* FIXME: extract call_id */ + + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); + + /* Answer. This causes TCH assignment in case of "late assignment" */ + MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + + f_sleep(3.0); + + /* Hangup by "B" side */ + MNCC.send(ts_MNCC_DISC_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(23)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(tid))); + + /* Release of call */ + MNCC.send(ts_MNCC_REL_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); + + /* clearing of radio channel */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + + f_sleep(5.0); +} + +/* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ +private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); + setverdict(pass); +} +testcase TC_emerg_call_imei_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), testcasename(), 5); + vc_conn.done; +} + +/* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ +private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + /* Then issue emergency call identified by IMSI */ + f_emerg_call(valueof(ts_MI_IMSI_LV(g_pars.imsi))); +} +testcase TC_emerg_call_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6); + vc_conn.done; +} + +/* CM Service Request for VGCS -> reject */ +private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1001'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + setverdict(pass); +} +testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 7); + vc_conn.done; +} + +/* CM Service Request for VBS -> reject */ +private function f_tc_cm_serv_req_vbs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1010'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + setverdict(pass); +} +testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 8); + vc_conn.done; +} + +/* CM Service Request for LCS -> reject */ +private function f_tc_cm_serv_req_lcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1011'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + setverdict(pass); +} +testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 9); + vc_conn.done; +} + + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? * malformed messages (missing IE, invalid message type): properly rejected? @@ -711,6 +933,9 @@ * emergency call * IMSI DETACH * send new transaction after/during clear (like SMS, ...) + * too long L3 INFO in DTAP + * too long / padded BSSAP + * too long / short TLV values */ -- To view, visit https://gerrit.osmocom.org/6029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04ca21824f66ad90d9dac2c25000ecd724aa4528 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:28 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_lu_disconnect: Start LU, then do a hard SCCP dis... Message-ID: Review at https://gerrit.osmocom.org/6030 msc: Add TC_lu_disconnect: Start LU, then do a hard SCCP disconnect Change-Id: I04d0b09350c6a1c9b8fb9aac87158a142d80f18f --- M msc_tests/MSC_Tests.ttcn 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/30/6030/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 0fad797..9cf6ce5 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -620,6 +620,36 @@ vc_conn.done; } +/* Test LU but BSC will send a clear request in the middle */ +private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + f_sleep(1.0); + /* send clear request in the middle of the LU */ + BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + setverdict(pass); +} +testcase TC_lu_disconnect() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_disconnect), testcasename(), 9); + vc_conn.done; +} + + /* Test LU but with illegal mobile identity type = IMEI */ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; -- To view, visit https://gerrit.osmocom.org/6030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04d0b09350c6a1c9b8fb9aac87158a142d80f18f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 16:29:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 16:29:28 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add all test cases to control section Message-ID: Review at https://gerrit.osmocom.org/6031 msc: Add all test cases to control section Change-Id: I79abcbe5638a02c1d6d94ba31ce72bfbc372fd21 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/31/6031/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9cf6ce5..4bacc1d 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -978,6 +978,18 @@ execute( TC_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); execute( TC_lu_auth_sai_err() ); + execute( TC_lu_clear_request() ); + execute( TC_lu_disconnect() ); + execute( TC_lu_by_imei() ); + execute( TC_lu_by_tmsi_noauth_unknown() ); + execute( TC_imsi_detach_by_imsi() ); + execute( TC_imsi_detach_by_tmsi() ); + execute( TC_imsi_detach_by_imei() ); + execute( TC_emerg_call_imei_reject() ); + execute( TC_emerg_call_imsi() ); + execute( TC_cm_serv_req_vgcs_reject() ); + execute( TC_cm_serv_req_vbs_reject() ); + execute( TC_cm_serv_req_lcs_reject() ); } -- To view, visit https://gerrit.osmocom.org/6031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79abcbe5638a02c1d6d94ba31ce72bfbc372fd21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Wed Jan 24 20:10:35 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:10:35 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_8.0/x86_64 In-Reply-To: References: Message-ID: <5a68e83e759f9_5f7a692f587492d2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_8.0/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in Debian_8.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 115s] DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) [ 115s] @@ -1613,8 +1613,8 @@ [ 115s] DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 [ 115s] DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) [ 115s] DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 [ 115s] -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) [ 115s] -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 [ 115s] +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) [ 115s] +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 [ 115s] - even though the TMSI is not acked, we can already find the subscr with it [ 115s] DREF VLR subscr MSISDN:46071 usage increases to: 2 [ 115s] vsub != NULL == 1 [ 115s] 5. testsuite.at:33: 5. msc_vlr_test_gsm_ciph (testsuite.at:33): FAILED (testsuite.at:37) [ 115s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 115s] make[1]: *** [override_dh_auto_test] Error 1 [ 115s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 115s] debian/rules:45: recipe for target 'build' failed [ 115s] make: *** [build] Error 2 [ 115s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 115s] [ 115s] lamb06 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:10:17 UTC 2018. [ 115s] [ 115s] ### VM INTERACTION START ### [ 116s] Powering off. [ 116s] [ 108.612697] reboot: Power down [ 116s] ### VM INTERACTION END ### [ 116s] [ 116s] lamb06 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:10:18 UTC 2018. [ 116s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:12:17 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:12:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.10/x86_64 In-Reply-To: References: Message-ID: <5a68e8a569ed8_5f7a692f58749646@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.10/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 111s] DREF VLR subscr MSISDN:42342 usage increases to: 2 [ 111s] vsub != NULL == 1 [ 111s] @@ -1331,8 +1331,8 @@ [ 111s] DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 [ 111s] DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) [ 111s] DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 [ 111s] -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) [ 111s] -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 [ 111s] +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) [ 111s] +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 [ 111s] - even though the TMSI is not acked, we can already find the subscr with it [ 111s] DREF VLR subscr MSISDN:42342 usage increases to: 2 [ 111s] vsub != NULL == 1 [ 111s] 6. testsuite.at:40: 6. msc_vlr_test_umts_authen (testsuite.at:40): FAILED (testsuite.at:44) [ 111s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 111s] make[1]: *** [override_dh_auto_test] Error 1 [ 111s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 111s] debian/rules:45: recipe for target 'build' failed [ 111s] make: *** [build] Error 2 [ 111s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 111s] [ 111s] lamb20 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:12:00 UTC 2018. [ 111s] [ 111s] ### VM INTERACTION START ### [ 114s] [ 106.349483] reboot: Power down [ 114s] ### VM INTERACTION END ### [ 114s] [ 114s] lamb20 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:12:02 UTC 2018. [ 114s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:13:43 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:13:43 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_17.10/x86_64 In-Reply-To: References: Message-ID: <5a68e8fb54ad8_5f7a692f58750756@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_17.10/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_17.10/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 72s] | #define HAVE_STRINGS_H 1 [ 72s] | #define HAVE_INTTYPES_H 1 [ 72s] | #define HAVE_STDINT_H 1 [ 72s] | #define HAVE_UNISTD_H 1 [ 72s] | #define HAVE_DLFCN_H 1 [ 72s] | #define LT_OBJDIR ".libs/" [ 72s] | #define BUILD_SMPP 1 [ 72s] | #define BUILD_IU 1 [ 72s] | #define STDC_HEADERS 1 [ 72s] | #define HAVE_DBI_DBD_H 1 [ 72s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 72s] | [ 72s] | configure: exit 0 [ 72s] [ 72s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 72s] make[1]: *** [override_dh_auto_test] Error 1 [ 72s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 72s] debian/rules:45: recipe for target 'build' failed [ 72s] make: *** [build] Error 2 [ 72s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 72s] [ 72s] build79 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:13:30 UTC 2018. [ 72s] [ 72s] ### VM INTERACTION START ### [ 75s] [ 69.070510] reboot: Power down [ 75s] ### VM INTERACTION END ### [ 75s] [ 75s] build79 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:13:34 UTC 2018. [ 75s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:14:17 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:14:17 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_17.04/i586 In-Reply-To: References: Message-ID: <5a68e91dea6f8_5f7a692f58750964@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_17.04/i586 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_17.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 109s] - MS also sends RP-ACK, MSC in turn sends CP-ACK for that [ 109s] - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 [ 109s] + MSC <--RAN_GERAN_A-- MS: SMS:0x01 [ 109s] DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) [ 109s] -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) [ 109s] +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) [ 109s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING [ 109s] DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A [ 109s] -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 [ 109s] +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 [ 109s] - DTAP matches expected message [ 109s] DREF VLR subscr MSISDN:42342 usage decreases to: 3 [ 109s] DREF VLR subscr MSISDN:42342 usage decreases to: 2 [ 109s] 4. testsuite.at:26: 4. msc_vlr_test_gsm_authen (testsuite.at:26): FAILED (testsuite.at:30) [ 109s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 109s] make[1]: *** [override_dh_auto_test] Error 1 [ 109s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 109s] debian/rules:45: recipe for target 'build' failed [ 109s] make: *** [build] Error 2 [ 109s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 109s] [ 109s] lamb16 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:14:05 UTC 2018. [ 109s] [ 109s] ### VM INTERACTION START ### [ 112s] [ 104.671006] reboot: Power down [ 112s] ### VM INTERACTION END ### [ 112s] [ 112s] lamb16 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:14:08 UTC 2018. [ 112s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:14:34 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:14:34 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.04/x86_64 In-Reply-To: References: Message-ID: <5a68e92f2f8a0_5f7a692f587510b7@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.04/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 85s] +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC [ 85s] DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) [ 85s] DMNCC receive message MNCC_SETUP_COMPL_REQ [ 85s] DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU [ 85s] @@ -663,7 +663,7 @@ [ 85s] MSC --> MNCC: callref 0x423: MNCC_DISC_IND [ 85s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING [ 85s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP [ 85s] -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC [ 85s] +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC [ 85s] DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) [ 85s] DMNCC receive message MNCC_REL_REQ [ 85s] DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU [ 85s] 12. testsuite.at:82: 12. msc_vlr_test_call (testsuite.at:82): FAILED (testsuite.at:86) [ 85s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 85s] make[1]: *** [override_dh_auto_test] Error 1 [ 85s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 85s] debian/rules:45: recipe for target 'build' failed [ 85s] make: *** [build] Error 2 [ 85s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 85s] [ 85s] build81 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:14:15 UTC 2018. [ 85s] [ 85s] ### VM INTERACTION START ### [ 88s] [ 82.232842] reboot: Power down [ 89s] ### VM INTERACTION END ### [ 89s] [ 89s] build81 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:14:19 UTC 2018. [ 89s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:16:01 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:16:01 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_17.04/x86_64 In-Reply-To: References: Message-ID: <5a68e98826472_5f7a692f58751424@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_17.04/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_17.04/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 108s] | #define HAVE_STRINGS_H 1 [ 108s] | #define HAVE_INTTYPES_H 1 [ 108s] | #define HAVE_STDINT_H 1 [ 108s] | #define HAVE_UNISTD_H 1 [ 108s] | #define HAVE_DLFCN_H 1 [ 108s] | #define LT_OBJDIR ".libs/" [ 108s] | #define BUILD_SMPP 1 [ 108s] | #define BUILD_IU 1 [ 108s] | #define STDC_HEADERS 1 [ 108s] | #define HAVE_DBI_DBD_H 1 [ 108s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 108s] | [ 108s] | configure: exit 0 [ 108s] [ 108s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 108s] make[1]: *** [override_dh_auto_test] Error 1 [ 108s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 108s] debian/rules:45: recipe for target 'build' failed [ 108s] make: *** [build] Error 2 [ 108s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 108s] [ 108s] lamb12 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:15:46 UTC 2018. [ 108s] [ 108s] ### VM INTERACTION START ### [ 111s] [ 102.814053] reboot: Power down [ 111s] ### VM INTERACTION END ### [ 111s] [ 111s] lamb12 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:15:50 UTC 2018. [ 111s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:16:18 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:16:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5a68e993b5a1b_5f7a692f587515c9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_9.0/x86_64 Package network:osmocom:nightly/osmo-msc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 119s] MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP [ 119s] DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) [ 119s] @@ -1613,8 +1613,8 @@ [ 119s] DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 [ 119s] DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) [ 119s] DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 [ 119s] -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) [ 119s] -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 [ 119s] +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) [ 119s] +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 [ 119s] - even though the TMSI is not acked, we can already find the subscr with it [ 119s] DREF VLR subscr MSISDN:46071 usage increases to: 2 [ 119s] vsub != NULL == 1 [ 119s] 5. testsuite.at:33: 5. msc_vlr_test_gsm_ciph (testsuite.at:33): FAILED (testsuite.at:37) [ 119s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 119s] make[1]: *** [override_dh_auto_test] Error 1 [ 119s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 119s] debian/rules:45: recipe for target 'build' failed [ 119s] make: *** [build] Error 2 [ 119s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 119s] [ 119s] lamb06 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:16:12 UTC 2018. [ 119s] [ 119s] ### VM INTERACTION START ### [ 122s] [ 113.789857] reboot: Power down [ 122s] ### VM INTERACTION END ### [ 122s] [ 122s] lamb06 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:16:15 UTC 2018. [ 122s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:16:52 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:16:52 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.04/i586 In-Reply-To: References: Message-ID: <5a68e9b5744ee_5f7a692f587516a2@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.04/i586 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.04/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 134s] MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP [ 134s] DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) [ 134s] @@ -1613,8 +1613,8 @@ [ 134s] DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 [ 134s] DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) [ 134s] DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 [ 134s] -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) [ 134s] -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 [ 134s] +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) [ 134s] +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 [ 134s] - even though the TMSI is not acked, we can already find the subscr with it [ 134s] DREF VLR subscr MSISDN:46071 usage increases to: 2 [ 134s] vsub != NULL == 1 [ 134s] 5. testsuite.at:33: 5. msc_vlr_test_gsm_ciph (testsuite.at:33): FAILED (testsuite.at:37) [ 134s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 134s] make[1]: *** [override_dh_auto_test] Error 1 [ 134s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 134s] debian/rules:45: recipe for target 'build' failed [ 134s] make: *** [build] Error 2 [ 134s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 134s] [ 134s] lamb28 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:16:35 UTC 2018. [ 134s] [ 134s] ### VM INTERACTION START ### [ 137s] [ 129.782554] reboot: Power down [ 137s] ### VM INTERACTION END ### [ 137s] [ 137s] lamb28 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:16:39 UTC 2018. [ 137s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:17:44 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:17:44 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in xUbuntu_16.10/i586 In-Reply-To: References: Message-ID: <5a68e9ece1542_5f7a692f587518be@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/xUbuntu_16.10/i586 Package network:osmocom:nightly/osmo-msc failed to build in xUbuntu_16.10/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 148s] | #define HAVE_STRINGS_H 1 [ 148s] | #define HAVE_INTTYPES_H 1 [ 148s] | #define HAVE_STDINT_H 1 [ 148s] | #define HAVE_UNISTD_H 1 [ 148s] | #define HAVE_DLFCN_H 1 [ 148s] | #define LT_OBJDIR ".libs/" [ 148s] | #define BUILD_SMPP 1 [ 148s] | #define BUILD_IU 1 [ 148s] | #define STDC_HEADERS 1 [ 148s] | #define HAVE_DBI_DBD_H 1 [ 148s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 148s] | [ 148s] | configure: exit 0 [ 148s] [ 148s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 148s] make[1]: *** [override_dh_auto_test] Error 1 [ 148s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 148s] debian/rules:45: recipe for target 'build' failed [ 148s] make: *** [build] Error 2 [ 148s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 148s] [ 148s] cloud135 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:17:22 UTC 2018. [ 148s] [ 148s] ### VM INTERACTION START ### [ 150s] [ 138.357997] reboot: Power down [ 151s] ### VM INTERACTION END ### [ 151s] [ 151s] cloud135 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:17:27 UTC 2018. [ 151s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:18:35 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:18:35 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_9.0/i586 In-Reply-To: References: Message-ID: <5a68ea1e32a7_5f7a692f5875201e@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_9.0/i586 Package network:osmocom:nightly/osmo-msc failed to build in Debian_9.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 82s] | #define HAVE_STRINGS_H 1 [ 82s] | #define HAVE_INTTYPES_H 1 [ 82s] | #define HAVE_STDINT_H 1 [ 82s] | #define HAVE_UNISTD_H 1 [ 82s] | #define HAVE_DLFCN_H 1 [ 82s] | #define LT_OBJDIR ".libs/" [ 82s] | #define BUILD_SMPP 1 [ 82s] | #define BUILD_IU 1 [ 82s] | #define STDC_HEADERS 1 [ 82s] | #define HAVE_DBI_DBD_H 1 [ 82s] | #define HAVE_TM_GMTOFF_IN_TM 1 [ 82s] | [ 82s] | configure: exit 0 [ 82s] [ 82s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 82s] make[1]: *** [override_dh_auto_test] Error 1 [ 82s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 82s] debian/rules:45: recipe for target 'build' failed [ 82s] make: *** [build] Error 2 [ 82s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 82s] [ 82s] build79 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:18:15 UTC 2018. [ 82s] [ 82s] ### VM INTERACTION START ### [ 85s] [ 79.616867] reboot: Power down [ 85s] ### VM INTERACTION END ### [ 85s] [ 85s] build79 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:18:18 UTC 2018. [ 85s] -- Configure notifications at https://build.opensuse.org/user/notifications openSUSE Build Service (https://build.opensuse.org/) From admin at opensuse.org Wed Jan 24 20:20:18 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 20:20:18 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_8.0/i586 In-Reply-To: References: Message-ID: <5a68ea862ce02_5f7a692f587524f6@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_8.0/i586 Package network:osmocom:nightly/osmo-msc failed to build in Debian_8.0/i586 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 118s] vsub != NULL == 1 [ 118s] @@ -1331,8 +1331,8 @@ [ 118s] DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 [ 118s] DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) [ 118s] DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 [ 118s] -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) [ 118s] -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 [ 118s] +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) [ 118s] +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 [ 118s] - even though the TMSI is not acked, we can already find the subscr with it [ 118s] DREF VLR subscr MSISDN:42342 usage increases to: 2 [ 118s] vsub != NULL == 1 [ 118s] 6. testsuite.at:40: 6. msc_vlr_test_umts_authen (testsuite.at:40): FAILED (testsuite.at:44) [ 118s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 118s] make[1]: *** [override_dh_auto_test] Error 1 [ 118s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 118s] debian/rules:45: recipe for target 'build' failed [ 118s] make: *** [build] Error 2 [ 118s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 118s] [ 118s] lamb62 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:20:03 UTC 2018. [ 118s] [ 118s] ### VM INTERACTION START ### [ 119s] Powering off. [ 119s] [ 110.802272] reboot: Power down [ 119s] ### VM INTERACTION END ### [ 119s] [ 119s] lamb62 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 20:20:05 UTC 2018. [ 119s] -- 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 Jan 24 20:40:25 2018 From: gerrit-no-reply at lists.osmocom.org (roox) Date: Wed, 24 Jan 2018 20:40:25 +0000 Subject: libusrp[master]: build: Link libusrp_la also to boost_system In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/6002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I184214c37251dde0ea9bd05f4a4cebfed35a8d9f Gerrit-PatchSet: 1 Gerrit-Project: libusrp Gerrit-Branch: master Gerrit-Owner: roox Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: roox Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 20:41:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 20:41:50 +0000 Subject: [PATCH] osmo-msc[master]: remove traces of bsc_subscriber Message-ID: Review at https://gerrit.osmocom.org/6032 remove traces of bsc_subscriber Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 --- M include/osmocom/msc/gsm_data.h M src/libcommon-cs/common_cs.c 2 files changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/6032/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index cb6b3c0..a122bc6 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -26,7 +26,6 @@ struct mncc_sock_state; struct gsm_subscriber_group; -struct bsc_subscr; struct vlr_instance; struct vlr_subscr; struct ranap_ue_conn_ctx; @@ -144,9 +143,6 @@ /* The MS has opened the conn with a CM Service Request, and we shall * keep it open for an actual request (or until timeout). */ bool received_cm_service_request; - - /* libbsc subscriber information (if available) */ - struct bsc_subscr *bsub; /* libmsc/libvlr subscriber information (if available) */ struct vlr_subscr *vsub; @@ -446,14 +442,6 @@ * OsmoMSC, this should be tied to the location area code (LAC). */ struct gsm_tz tz; - /* List of all struct bsc_subscr used in libbsc. This llist_head is - * allocated so that the llist_head pointer itself can serve as a - * talloc context (useful to not have to pass the entire gsm_network - * struct to the bsc_subscr_* API, and for bsc_susbscr unit tests to - * not require gsm_data.h). In an MSC-without-BSC environment, this - * pointer is NULL to indicate absence of a bsc_subscribers list. */ - struct llist_head *bsc_subscribers; - /* MSC: GSUP server address of the HLR */ const char *gsup_server_addr_str; uint16_t gsup_server_port; @@ -557,9 +545,6 @@ int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); -void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 9edf7c5..170b62a 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -68,9 +68,6 @@ INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); - net->bsc_subscribers = talloc_zero(net, struct llist_head); - INIT_LLIST_HEAD(net->bsc_subscribers); - /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); if (!net->msc_ctrs) { -- To view, visit https://gerrit.osmocom.org/6032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 20:41:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 20:41:50 +0000 Subject: [PATCH] osmo-msc[master]: Properly reject CM Re-Establishment Request Message-ID: Review at https://gerrit.osmocom.org/6033 Properly reject CM Re-Establishment Request Even if we're not implementing CM re-establishment, we should give the MS a clear indication that we don't do and follow the related procedures of TS 24.008 by sending CM SERVICE REJECT. Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e --- M src/libmsc/gsm_04_08.c 1 file changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/6033/1 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 2a70ef4..2400fa8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -794,6 +794,26 @@ return 0; } +/* Receive a CM Re-establish Request */ +static int gsm48_rx_cm_reest_req(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + uint8_t mi_type; + char mi_string[GSM48_MI_SIZE]; + struct gsm48_hdr *gh = msgb_l3(msg); + + uint8_t classmark2_len = gh->data[1]; + uint8_t *classmark2 = gh->data+2; + uint8_t mi_len = *(classmark2 + classmark2_len); + uint8_t *mi = (classmark2 + classmark2_len + 1); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + mi_type = mi[0] & GSM_MI_TYPE_MASK; + DEBUGP(DMM, "<- CM RE-ESTABLISH REQUEST MI(%s)=%s\n", gsm48_mi_type_name(mi_type), mi_string); + + /* we don't support CM call re-establishment */ + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED); +} + static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg) { struct gsm_network *network = conn->network; @@ -1093,7 +1113,7 @@ rc = gsm48_rx_mm_imsi_detach_ind(conn, msg); break; case GSM48_MT_MM_CM_REEST_REQ: - DEBUGP(DMM, "CM REESTABLISH REQUEST: Not implemented\n"); + rc = gsm48_rx_cm_reest_req(conn, msg); break; case GSM48_MT_MM_AUTH_RESP: rc = gsm48_rx_mm_auth_resp(conn, msg); @@ -3240,6 +3260,7 @@ switch (msg_type) { case GSM48_MT_MM_LOC_UPD_REQUEST: case GSM48_MT_MM_CM_SERV_REQ: + case GSM48_MT_MM_CM_REEST_REQ: case GSM48_MT_MM_AUTH_RESP: case GSM48_MT_MM_AUTH_FAIL: case GSM48_MT_MM_ID_RESP: -- To view, visit https://gerrit.osmocom.org/6033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 20:42:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 20:42:38 +0000 Subject: [PATCH] osmo-msc[master]: Properly reject CM Re-Establishment Request In-Reply-To: References: Message-ID: Properly reject CM Re-Establishment Request Even if we're not implementing CM re-establishment, we should give the MS a clear indication that we don't do and follow the related procedures of TS 24.008 by sending CM SERVICE REJECT. Closes: OS#2869 Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e --- M src/libmsc/gsm_04_08.c 1 file changed, 22 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/33/6033/2 diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 2a70ef4..2400fa8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -794,6 +794,26 @@ return 0; } +/* Receive a CM Re-establish Request */ +static int gsm48_rx_cm_reest_req(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + uint8_t mi_type; + char mi_string[GSM48_MI_SIZE]; + struct gsm48_hdr *gh = msgb_l3(msg); + + uint8_t classmark2_len = gh->data[1]; + uint8_t *classmark2 = gh->data+2; + uint8_t mi_len = *(classmark2 + classmark2_len); + uint8_t *mi = (classmark2 + classmark2_len + 1); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + mi_type = mi[0] & GSM_MI_TYPE_MASK; + DEBUGP(DMM, "<- CM RE-ESTABLISH REQUEST MI(%s)=%s\n", gsm48_mi_type_name(mi_type), mi_string); + + /* we don't support CM call re-establishment */ + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED); +} + static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg) { struct gsm_network *network = conn->network; @@ -1093,7 +1113,7 @@ rc = gsm48_rx_mm_imsi_detach_ind(conn, msg); break; case GSM48_MT_MM_CM_REEST_REQ: - DEBUGP(DMM, "CM REESTABLISH REQUEST: Not implemented\n"); + rc = gsm48_rx_cm_reest_req(conn, msg); break; case GSM48_MT_MM_AUTH_RESP: rc = gsm48_rx_mm_auth_resp(conn, msg); @@ -3240,6 +3260,7 @@ switch (msg_type) { case GSM48_MT_MM_LOC_UPD_REQUEST: case GSM48_MT_MM_CM_SERV_REQ: + case GSM48_MT_MM_CM_REEST_REQ: case GSM48_MT_MM_AUTH_RESP: case GSM48_MT_MM_AUTH_FAIL: case GSM48_MT_MM_ID_RESP: -- To view, visit https://gerrit.osmocom.org/6033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Wed Jan 24 21:09:25 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 21:09:25 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_9.0/armv7l In-Reply-To: References: Message-ID: <5a68f6063cb8c_5f7a692f587681c9@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_9.0/armv7l Package network:osmocom:nightly/osmo-msc failed to build in Debian_9.0/armv7l Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 213s] DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) [ 213s] DMNCC receive message MNCC_SETUP_COMPL_REQ [ 213s] DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU [ 213s] @@ -663,7 +663,7 @@ [ 213s] MSC --> MNCC: callref 0x423: MNCC_DISC_IND [ 213s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING [ 213s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP [ 213s] -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC [ 213s] +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC [ 213s] DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) [ 213s] DMNCC receive message MNCC_REL_REQ [ 213s] DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU [ 213s] 12. testsuite.at:82: 12. msc_vlr_test_call (testsuite.at:82): FAILED (testsuite.at:86) [ 213s] debian/rules:63: recipe for target 'override_dh_auto_test' failed [ 213s] make[1]: *** [override_dh_auto_test] Error 1 [ 213s] make[1]: Leaving directory '/usr/src/packages/BUILD' [ 213s] debian/rules:45: recipe for target 'build' failed [ 213s] make: *** [build] Error 2 [ 213s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 213s] [ 213s] armbuild21 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 21:09:12 UTC 2018. [ 213s] [ 213s] ### VM INTERACTION START ### [ 216s] [ 204.294174] SysRq : Power Off [ 216s] [ 204.303424] reboot: Power down [ 216s] ### VM INTERACTION END ### [ 216s] [ 216s] armbuild21 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 21:09:15 UTC 2018. [ 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 Wed Jan 24 21:40:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:40:27 +0000 Subject: [PATCH] osmo-msc[master]: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message Message-ID: Review at https://gerrit.osmocom.org/6034 msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message According to TS 44.008 Section 3.2.1.31, the "Layer 3 Message Contents" IE of the BSSMAP Cipher Mode Complete is optional. The BSC may hence inlcude that IE or not include it. Without this patch, OsmoMSC is crashing if that IE was missing: <000a> a_iface_bssap.c:699 Rx BSC DT: 00 03 55 2c 02 <000a> a_iface_bssap.c:629 Rx MSC DT1 BSSMAP CIPHER MODE COMPLETE <001f> a_iface_bssap.c:91 Found A subscriber for conn_id 1 <000a> a_iface_bssap.c:415 BSC sends cipher mode complete (conn_id=1) ==5611== Invalid read of size 8 ==5611== at 0x128D0F: msc_cipher_mode_compl (osmo_msc.c:159) ==5611== by 0x114F62: bssmap_rx_ciph_compl.isra.8 (a_iface_bssap.c:432) ==5611== by 0x113267: sccp_sap_up (a_iface.c:520) Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Closes: OS#2871 --- M include/osmocom/msc/gsup_client.h M src/libmsc/osmo_msc.c 2 files changed, 27 insertions(+), 27 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/34/6034/1 diff --git a/include/osmocom/msc/gsup_client.h b/include/osmocom/msc/gsup_client.h index 3d1dce0..0199a72 100644 --- a/include/osmocom/msc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -25,7 +25,7 @@ #include -#define GSUP_CLIENT_RECONNECT_INTERVAL 10 +#define GSUP_CLIENT_RECONNECT_INTERVAL 1 #define GSUP_CLIENT_PING_INTERVAL 20 struct msgb; diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 2a868a8..755f8aa 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -156,43 +156,43 @@ void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t alg_id) { - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - uint8_t mi_type; - char imeisv[GSM48_MI_SIZE] = ""; struct vlr_ciph_result ciph_res = { .cause = VLR_CIPH_REJECT }; - if (!gh) { - LOGP(DRR, LOGL_ERROR, "invalid: msgb without l3 header\n"); - return; - } - if (!conn) { - LOGP(DRR, LOGL_ERROR, - "invalid: rx Ciphering Mode Complete on NULL conn\n"); + LOGP(DRR, LOGL_ERROR, "invalid: rx Ciphering Mode Complete on NULL conn\n"); return; } if (!conn->vsub) { - LOGP(DRR, LOGL_ERROR, - "invalid: rx Ciphering Mode Complete for NULL subscr\n"); + LOGP(DRR, LOGL_ERROR, "invalid: rx Ciphering Mode Complete for NULL subscr\n"); return; } - DEBUGP(DRR, "%s: CIPHERING MODE COMPLETE\n", - vlr_subscr_name(conn->vsub)); + DEBUGP(DRR, "%s: CIPHERING MODE COMPLETE\n", vlr_subscr_name(conn->vsub)); - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + if (msg) { + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + uint8_t mi_type; + char imeisv[GSM48_MI_SIZE] = ""; - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { - mi_type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & GSM_MI_TYPE_MASK; - if (mi_type == GSM_MI_TYPE_IMEISV - && TLVP_LEN(&tp, GSM48_IE_MOBILE_ID) > 0) { - gsm48_mi_to_string(imeisv, sizeof(imeisv), - TLVP_VAL(&tp, GSM48_IE_MOBILE_ID), - TLVP_LEN(&tp, GSM48_IE_MOBILE_ID)); - ciph_res.imeisv = imeisv; + if (!gh) { + LOGP(DRR, LOGL_ERROR, "invalid: msgb without l3 header\n"); + return; + } + + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { + mi_type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & GSM_MI_TYPE_MASK; + if (mi_type == GSM_MI_TYPE_IMEISV + && TLVP_LEN(&tp, GSM48_IE_MOBILE_ID) > 0) { + gsm48_mi_to_string(imeisv, sizeof(imeisv), + TLVP_VAL(&tp, GSM48_IE_MOBILE_ID), + TLVP_LEN(&tp, GSM48_IE_MOBILE_ID)); + ciph_res.imeisv = imeisv; + } } } -- To view, visit https://gerrit.osmocom.org/6034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:44 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Proper treatment of IMEI + TMSI Message-ID: Review at https://gerrit.osmocom.org/6035 MSC_Tests: Proper treatment of IMEI + TMSI * don't use IMSI as IMEI * store the TMSI (after it is allocated) in the g_pars variable for later use Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 14 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/6035/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 69854e3..25f8daf 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -28,8 +28,10 @@ SCCP_PAR_Address sccp_addr_own, SCCP_PAR_Address sccp_addr_peer, BSSMAP_IE_CellIdentifier cell_id, + hexstring imei, hexstring imsi, hexstring msisdn, + OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional }; @@ -199,6 +201,7 @@ setverdict(fail, "Expected TMSI but no TMSI was allocated"); self.stop; } else { + g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets; BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); } } else { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 4bacc1d..959cd37 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -290,6 +290,12 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; +function f_gen_imei(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 15 - lengthof(prefix); + suffix_len := suffix_len; + return prefix & int2hex(suffix, suffix_len); +} + function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { var integer suffix_len := 15 - lengthof(prefix); suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ @@ -308,8 +314,10 @@ sccp_addr_own := g_sccp_addr_own, sccp_addr_peer := g_sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), + imei := f_gen_imei('49999'H, imsi_suffix), imsi := f_gen_imsi('26242'H, imsi_suffix), msisdn := f_gen_msisdn('491239999'H, imsi_suffix), + tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit }; @@ -654,7 +662,7 @@ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imsi) + var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei) var PDU_DTAP_MT dtap_mt; /* tell GSUP dispatcher to send this IMSI to us */ @@ -788,7 +796,7 @@ private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); @@ -860,7 +868,7 @@ private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); -- To view, visit https://gerrit.osmocom.org/6035 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:44 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Cosmetic (fix comment) Message-ID: Review at https://gerrit.osmocom.org/6036 msc: Cosmetic (fix comment) Change-Id: I20c65454f606a5c3bc3c5a127ae02b6c204ca06e --- M msc_tests/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/6036/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 959cd37..3c0a460 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -882,7 +882,7 @@ vc_conn.done; } -/* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ +/* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; /* First perform location update to ensure subscriber is known */ -- To view, visit https://gerrit.osmocom.org/6036 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I20c65454f606a5c3bc3c5a127ae02b6c204ca06e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:44 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Osmocom_VTY_Functions: Make prompt configurable Message-ID: Review at https://gerrit.osmocom.org/6037 Osmocom_VTY_Functions: Make prompt configurable We want to use this code also for OsmoMSC testing, so let's make the prefix configurable as module parameter. Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee --- M library/Osmocom_VTY_Functions.ttcn 1 file changed, 42 insertions(+), 33 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/6037/1 diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index 1215e0d..eb51a03 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -1,58 +1,67 @@ module Osmocom_VTY_Functions { import from TELNETasp_PortType all; - /* permitted prompts on VTY */ - const charstring NORMAL_PROMPT := "OpenBSC> "; - const charstring ENABLE_PROMPT := "OpenBSC# "; - const charstring CONFIG_PROMPT := "OpenBSC(*)\#"; - template charstring t_vty_unknown := pattern "*% Unknown command."; + modulepar { + charstring mp_prompt_prefix := "OpenBSC"; + } - const ASP_TelnetDynamicConfig vty_prompt[3] := { - { - prompt := { - id := 1, - prompt := NORMAL_PROMPT, - has_wildcards := false - } - }, { - prompt := { - id := 2, - prompt := ENABLE_PROMPT, - has_wildcards := false - } - }, { - prompt := { - id := 3, - prompt := CONFIG_PROMPT, - has_wildcards := true - } - } - }; + const charstring VTY_VIEW_SUFFIX := "> "; + const charstring VTY_ENABLE_SUFFIX := "# "; + const charstring VTY_CFG_SUFFIX := "(*)"; + + template charstring t_vty_unknown := pattern "*% Unknown command."; /* configure prompts in TELNETasp module */ function f_vty_set_prompts(TELNETasp_PT pt) { + var ASP_TelnetDynamicConfig vty_prompt[3] := { + { + prompt := { + id := 1, + prompt := mp_prompt_prefix & VTY_VIEW_SUFFIX, + has_wildcards := false + } + }, { + prompt := { + id := 2, + prompt := mp_prompt_prefix & VTY_ENABLE_SUFFIX, + has_wildcards := false + } + }, { + prompt := { + id := 3, + prompt := mp_prompt_prefix & VTY_CFG_SUFFIX, + has_wildcards := true + } + } + }; + /* set some configuration that isn't possible to express * in the config file due to syntactic restrictions (Who invents config * files that don't permit regular expressions? */ for (var integer i := 0; i < sizeof(vty_prompt); i:= i + 1) { - pt.send(vty_prompt[i]) + log(vty_prompt[i]); + pt.send(vty_prompt[i]); } } /* wait for any of the permitted prompts; buffer + return all intermediate output */ function f_vty_wait_for_prompt(TELNETasp_PT pt) return charstring { - template charstring config_pattern := pattern CONFIG_PROMPT; var charstring rx, buf := ""; timer T := 2.0; T.start; alt { - [] pt.receive(NORMAL_PROMPT) { }; - [] pt.receive(ENABLE_PROMPT) { }; - [] pt.receive(config_pattern) { }; - [] pt.receive(t_vty_unknown) { testcase.stop(fail, "VTY: Unknown Command") }; + [] pt.receive(mp_prompt_prefix & VTY_VIEW_SUFFIX) { }; + [] pt.receive(mp_prompt_prefix & VTY_ENABLE_SUFFIX) { }; + [] pt.receive(pattern mp_prompt_prefix & VTY_CFG_SUFFIX) { }; + [] pt.receive(t_vty_unknown) { + testcase.stop(fail, "VTY: Unknown Command"); + }; [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; - [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); return ""}; + [] T.timeout { + setverdict(fail, "VTY Timeout for prompt"); + self.stop; + }; } T.stop; return buf; -- To view, visit https://gerrit.osmocom.org/6037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC: Use VTY to enable/disable authentication + TMSI allocation Message-ID: Review at https://gerrit.osmocom.org/6038 MSC: Use VTY to enable/disable authentication + TMSI allocation Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617 --- M msc_tests/MSC_Tests.cfg M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 4 files changed, 50 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/6038/1 diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg index 2bd9dd2..ab8a2ff 100644 --- a/msc_tests/MSC_Tests.cfg +++ b/msc_tests/MSC_Tests.cfg @@ -10,16 +10,27 @@ "MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING; "MSC_Test-GSUP".FileMask := ERROR | WARNING; "IPA-CTRL-IPA".FileMask := ERROR | WARNING; +mtc.FileMask := ERROR | WARNING; [TESTPORT_PARAMETERS] #*.*.udpReuseAddress := "yes"; "MSC_Test-MNCC".MNCC.socket_type := "SEQPACKET"; +*.MSCVTY.CTRL_MODE := "client" +*.MSCVTY.CTRL_HOSTNAME := "127.0.0.1" +*.MSCVTY.CTRL_PORTNUM := "4254" +*.MSCVTY.CTRL_LOGIN_SKIPPED := "yes" +*.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" +*.MSCVTY.CTRL_READMODE := "buffered" +*.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.MSCVTY.PROMPT1 := "OsmoMSC> " + [MODULE_PARAMETERS] M3UA_Emulation.tsp_logVerbose := true; BSSAP_Adapter.mp_own_pc := 193; /* 0.23.3 */ BSSAP_Adapter.mp_peer_pc := 185; /* 0.23.1 */ BSSAP_Adapter.mp_sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" }; +Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoMSC"; [MAIN_CONTROLLER] diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 3c0a460..e0ee84c 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -20,6 +20,9 @@ import from Osmocom_CTRL_Types all; import from Osmocom_CTRL_Adapter all; +import from TELNETasp_PortType all; +import from Osmocom_VTY_Functions all; + import from MNCC_Emulation all; import from MNCC_Types all; @@ -49,6 +52,8 @@ /* only to get events from IPA underneath GSUP */ port IPA_CTRL_PT GSUP_IPA_EVENT; + /* VTY to MSC */ + port TELNETasp_PT MSCVTY; } modulepar { @@ -117,6 +122,10 @@ f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); f_init_gsup("MSC_Test"); + + map(self:MSCVTY, system:MSCVTY); + f_vty_set_prompts(MSCVTY); + f_vty_transceive(MSCVTY, "enable"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -343,6 +352,17 @@ T.timeout; } +function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd) +{ + /* enter config mode; enter node */ + f_vty_enter_config(pt); + f_vty_transceive(pt, config_node); + /* execute command */ + f_vty_transceive(pt, cmd); + /* leave config mode */ + f_vty_transceive(pt, "end"); +} + private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; f_perform_lu(false, true, true); @@ -350,6 +370,8 @@ testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); vc_conn.done; @@ -362,6 +384,8 @@ testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "no assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); vc_conn.done; @@ -391,6 +415,7 @@ testcase TC_lu_imsi_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); vc_conn.done; @@ -421,6 +446,7 @@ testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); vc_conn.done; @@ -433,6 +459,7 @@ testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi), testcasename(), 5); vc_conn.done; @@ -475,6 +502,7 @@ testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); vc_conn.done; } @@ -525,6 +553,7 @@ testcase TC_lu_and_mo_call() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6); vc_conn.done; @@ -558,6 +587,7 @@ testcase TC_lu_auth_sai_timeout() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7); vc_conn.done; @@ -591,6 +621,7 @@ testcase TC_lu_auth_sai_err() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8); vc_conn.done; @@ -687,6 +718,7 @@ testcase TC_lu_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9); vc_conn.done; @@ -734,6 +766,7 @@ testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1); vc_conn.done; @@ -893,6 +926,7 @@ testcase TC_emerg_call_imsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6); vc_conn.done; diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index cfef012..30ebed1 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -70,9 +70,12 @@ FILES="RTP_EncDec.cc RTP_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.TELNETasp/src +FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn" +gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn " FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index ce33695..10ec38f 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Fix generation of IMSI/IMEI/MSISDN Message-ID: Review at https://gerrit.osmocom.org/6039 msc: Fix generation of IMSI/IMEI/MSISDN Now each test case uses unique IMSI/IMEI/MSISDN numbers, which helps to identify test cases from traces or from VTY introspection Change-Id: I54d05e8ec7aeecc48666d3b369351212a6a0ea6f --- M msc_tests/MSC_Tests.ttcn 1 file changed, 33 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/39/6039/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index e0ee84c..5976b45 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -299,21 +299,24 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; -function f_gen_imei(hexstring prefix, integer suffix) return hexstring { - var integer suffix_len := 15 - lengthof(prefix); - suffix_len := suffix_len; - return prefix & int2hex(suffix, suffix_len); +private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := tot_len - lengthof(prefix); + var charstring suffix_ch := int2str(suffix); + var integer pad_len := suffix_len - lengthof(suffix_ch); + + return prefix & int2hex(0, pad_len) & str2hex(suffix_ch); } -function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { - var integer suffix_len := 15 - lengthof(prefix); - suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ - return prefix & int2hex(suffix, suffix_len); +function f_gen_imei(integer suffix) return hexstring { + return f_concat_pad(15, '49999'H, suffix); } -function f_gen_msisdn(hexstring prefix, integer suffix) return hexstring { - var integer suffix_len := 12 - lengthof(prefix); - return prefix & int2hex(suffix, suffix_len); +function f_gen_imsi(integer suffix) return hexstring { + return f_concat_pad(15, '26242'H, suffix); +} + +function f_gen_msisdn(integer suffix) return hexstring { + return f_concat_pad(12, '49123'H, suffix); } /* FIXME: move into BSC_ConnectionHandler? */ @@ -323,9 +326,9 @@ sccp_addr_own := g_sccp_addr_own, sccp_addr_peer := g_sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), - imei := f_gen_imei('49999'H, imsi_suffix), - imsi := f_gen_imsi('26242'H, imsi_suffix), - msisdn := f_gen_msisdn('491239999'H, imsi_suffix), + imei := f_gen_imei(imsi_suffix), + imsi := f_gen_imsi(imsi_suffix), + msisdn := f_gen_msisdn(imsi_suffix), tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit @@ -503,7 +506,7 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 6); vc_conn.done; } @@ -555,7 +558,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 7); vc_conn.done; } @@ -589,7 +592,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7); + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 8); vc_conn.done; } @@ -623,7 +626,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8); + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 9); vc_conn.done; } @@ -655,7 +658,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_lu_clear_request), testcasename(), 8); + vc_conn := f_start_handler(refers(f_tc_lu_clear_request), testcasename(), 10); vc_conn.done; } @@ -684,7 +687,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_lu_disconnect), testcasename(), 9); + vc_conn := f_start_handler(refers(f_tc_lu_disconnect), testcasename(), 11); vc_conn.done; } @@ -720,7 +723,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9); + vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 12); vc_conn.done; } @@ -768,7 +771,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1); + vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 13); vc_conn.done; } @@ -795,7 +798,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), testcasename(), 2); + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), testcasename(), 14); vc_conn.done; } @@ -821,7 +824,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), testcasename(), 3); + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), testcasename(), 15); vc_conn.done; } @@ -847,7 +850,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), testcasename(), 4); + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), testcasename(), 16); vc_conn.done; } @@ -911,7 +914,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), testcasename(), 5); + vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), testcasename(), 17); vc_conn.done; } @@ -928,7 +931,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6); + vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 18); vc_conn.done; } @@ -949,7 +952,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 7); + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 19); vc_conn.done; } @@ -970,7 +973,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 8); + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 20); vc_conn.done; } @@ -991,7 +994,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 9); + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 21); vc_conn.done; } -- To view, visit https://gerrit.osmocom.org/6039 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54d05e8ec7aeecc48666d3b369351212a6a0ea6f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP: Fix handling of odd-length IMSI and 0xF filler digit Message-ID: Review at https://gerrit.osmocom.org/6040 GSUP: Fix handling of odd-length IMSI and 0xF filler digit Change-Id: I4e0a9f1236504ce6026c6e34fd97fda6fefa832c --- M library/GSUP_Types.ttcn M library/IPA_Emulation.ttcn 2 files changed, 24 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/40/6040/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 15560c7..a8134eb 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -138,6 +138,26 @@ external function dec_GSUP_PDU(in octetstring msg) return GSUP_PDU with { extension "prototype(convert) decode(RAW)" }; +function f_gsup_postprocess_decoded(inout GSUP_PDU gsup) { + if (gsup.ies[0].tag == OSMO_GSUP_IMSI_IE) { + /* if last digit is 'F', then there's an odd number of digits and we must strip the F */ + var integer num_digits := lengthof(gsup.ies[0].val.imsi); + if (gsup.ies[0].val.imsi[num_digits-1] == 'F'H) { + gsup.ies[0].val.imsi := substr(gsup.ies[0].val.imsi, 0, num_digits-1); + } + } +} + +function f_gsup_preprocess_encoded(inout GSUP_PDU gsup) { + if (ischosen(gsup.ies[0].val.imsi)) { + /* if number of digits is odd, add a 'F' as padding at the end */ + var integer num_digits := lengthof(gsup.ies[0].val.imsi); + if (num_digits rem 2 == 1) { + gsup.ies[0].val.imsi := gsup.ies[0].val.imsi & 'F'H; + } + } +} + template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, octetstring kc) := { diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn index b40818f..b3e28e9 100644 --- a/library/IPA_Emulation.ttcn +++ b/library/IPA_Emulation.ttcn @@ -370,7 +370,9 @@ } private function f_gsup_to_user(octetstring msg) runs on IPA_Emulation_CT { - IPA_GSUP_PORT.send(dec_GSUP_PDU(msg)); + var GSUP_PDU gsup := dec_GSUP_PDU(msg); + f_gsup_postprocess_decoded(gsup); + IPA_GSUP_PORT.send(gsup); } private function f_mgcp_to_ud(octetstring payload) runs on IPA_Emulation_CT return ASP_IPA_Unitdata { @@ -480,6 +482,7 @@ } [] IPA_GSUP_PORT.receive(GSUP_PDU:?) -> value gsup_msg { + f_gsup_preprocess_encoded(gsup_msg); payload := enc_GSUP_PDU(gsup_msg); ipa_ud := valueof(t_ASP_IPA_UD(IPAC_PROTO_OSMO, payload, IPAC_PROTO_EXT_GSUP)); IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud)); -- To view, visit https://gerrit.osmocom.org/6040 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4e0a9f1236504ce6026c6e34fd97fda6fefa832c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: f_enc_IMSI_L3: Fix filler digit in *even* case Message-ID: Review at https://gerrit.osmocom.org/6041 f_enc_IMSI_L3: Fix filler digit in *even* case We actually need to add the filler digit 'F' if the number of digits is even. It is absent when the number of digits is odd. Change-Id: Ic1353f4ea09bba3151636b94a99c8559e0289ffd --- M library/L3_Templates.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/6041/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index db514a4..c603b7b 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -47,10 +47,10 @@ var integer len := lengthof(digits); if (len rem 2 == 1) { /* modulo remainder */ l3.oddevenIndicator := '1'B; - l3.fillerDigit := '1111'B; + l3.fillerDigit := omit; } else { l3.oddevenIndicator := '0'B; - l3.fillerDigit := omit; + l3.fillerDigit := '1111'B; } l3.digits := digits; return l3; -- To view, visit https://gerrit.osmocom.org/6041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1353f4ea09bba3151636b94a99c8559e0289ffd Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_... Message-ID: Review at https://gerrit.osmocom.org/6042 MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_TYPE Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 --- M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 13 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/6042/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index c603b7b..f23c8fa 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -23,7 +23,10 @@ CM_TYPE_MO_CALL ('0001'B), CM_TYPE_EMERG_CALL ('0010'B), CM_TYPE_MO_SMS ('0100'B), - CM_TYPE_SS_ACT ('1000'B) + CM_TYPE_SS_ACT ('1000'B), + CM_TYPE_VGCS ('1001'B), + CM_TYPE_VBS ('1010'B), + CM_TYPE_LCS ('1011'B) } @@ -104,7 +107,7 @@ }; /* Send template for CM SERVICE REQUEST */ -template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(BIT4 serv_type, MobileIdentityLV mi_lv) := { +template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, MobileIdentityLV mi_lv) := { discriminator := '0000'B, /* overwritten */ tiOrSkip := { skipIndicator := '0000'B @@ -114,7 +117,7 @@ cMServiceRequest := { messageType := '000000'B, /* overwritten */ nsd := '00'B, - cm_ServiceType := serv_type, + cm_ServiceType := int2bit(enum2int(serv_type), 4), cipheringKeySequenceNumber := { '000'B, '0'B }, mobileStationClassmark2 := ts_CM2, mobileIdentity := mi_lv, diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 25f8daf..330f25a 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -101,7 +101,7 @@ /* helper function to fully establish a dedicated channel */ function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) runs on BSC_ConnHdlr { - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5976b45..566999b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -475,7 +475,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -858,7 +858,7 @@ /* helper function for an emergency call. caller passes in mobile identity to use */ private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); @@ -905,7 +905,7 @@ g_pars := pars; var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); setverdict(pass); @@ -943,7 +943,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); @@ -964,7 +964,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); @@ -985,7 +985,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1011'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Wait for proper BSSAP connection clear after CM SERV REJ Message-ID: Review at https://gerrit.osmocom.org/6043 msc: Wait for proper BSSAP connection clear after CM SERV REJ Change-Id: Ia8fc0e61c7f8f31ca4dd21a243e00ef688ff38c6 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/43/6043/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 566999b..b318aa9 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -908,6 +908,9 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_emerg_call_imei_reject() runs on MTC_CT { @@ -930,6 +933,7 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 18); vc_conn.done; @@ -946,11 +950,16 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 19); vc_conn.done; @@ -967,11 +976,16 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 20); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/6043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8fc0e61c7f8f31ca4dd21a243e00ef688ff38c6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be ... Message-ID: Review at https://gerrit.osmocom.org/6044 msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be rejected Change-Id: I7d15b935caed2dacf39d66a33ff933a9b8c443d9 --- M library/L3_Templates.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 60 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/44/6044/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index f23c8fa..7836555 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -129,6 +129,34 @@ } } +template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := { + keySequence := int2bit(key_seq, 3), + spare := '0'B +} + +/* Send template for CM RE-ESTABLISH REQUEST */ +template (value) PDU_ML3_MS_NW ts_CM_REEST_REQ(integer cksn, MobileIdentityLV mi_lv) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + cMReEstablReq := { + messageType := '101000'B, /* overwritten */ + nsd := '00'B, + cipheringKeySequenceNumber := ts_CKSN(cksn), + spare := '0000'B, + mobileStationClassmark2 := ts_CM2, + mobileIdentityLV := mi_lv, + locationAreaIdentification := omit, + deviceProperties := omit + } + } + } +} + + template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { discriminator := discr, tiOrSkip := { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index b318aa9..b1a7d1b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1002,13 +1002,44 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 21); + vc_conn.done; +} + +/* CM Re-Establishment Request */ +private function f_tc_cm_reest_req_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_cm_reest_req_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + + vc_conn := f_start_handler(refers(f_tc_cm_reest_req_reject), testcasename(), 22); vc_conn.done; } @@ -1049,6 +1080,7 @@ execute( TC_cm_serv_req_vgcs_reject() ); execute( TC_cm_serv_req_vbs_reject() ); execute( TC_cm_serv_req_lcs_reject() ); + execute( TC_cm_reest_req_reject() ); } -- To view, visit https://gerrit.osmocom.org/6044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7d15b935caed2dacf39d66a33ff933a9b8c443d9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth Message-ID: Review at https://gerrit.osmocom.org/6045 msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth Change-Id: I54ef4137c0b95658b1e844ac1bb13729f27fd0d1 --- M library/GSUP_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/6045/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index a8134eb..7f239ca 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -243,6 +243,9 @@ tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { tr_GSUP_IE_IMSI(imsi), * }); +template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, { + tr_GSUP_IE_IMSI(imsi), * }); template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index b1a7d1b..367cd79 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1043,6 +1043,50 @@ vc_conn.done; } +/* Test LU (with authentication enabled), with wrong response from MS */ +private function f_tc_lu_auth_2G_fail(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + var AuthVector vec := f_gen_auth_vec_2g(); + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); + /* Send back wrong auth response */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G('00000000'O))); + + /* Expect GSUP AUTH FAIL REP to HLR */ + GSUP.receive(tr_GSUP_AUTH_FAIL_IND(g_pars.imsi)); + + /* Expect LU REJECT with Cause == Illegal MS */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej('03'O))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_auth_2G_fail() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_2G_fail), testcasename(), 23); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54ef4137c0b95658b1e844ac1bb13729f27fd0d1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:42:46 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: TC_lu_imsi_auth_tmsi_encr_13_13 Message-ID: Review at https://gerrit.osmocom.org/6046 msc: TC_lu_imsi_auth_tmsi_encr_13_13 Add a first test for encryption (cipher mode command/complete) Change-Id: I8a8a5c55d87bb251896664679920b96f678673a0 --- M library/BSSMAP_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 68 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/46/6046/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 5331505..33c370e 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -367,6 +367,14 @@ key := kc } +template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { + elementIdentifier := '0A'O, + lengthIndicator := ?, /* overwritten */ + permittedAlgorithms := algs, + key := kc +} + + template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { elementIdentifier := '01'O, /* overwritten */ @@ -748,6 +756,37 @@ } } +template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key) +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + cipherModeCommand := { + messageType := '53'O, + layer3HeaderInfo := *, + encryptionInformation := tr_BSSMAP_IE_EncrInfo(key, alg), + cipherResponseMode := *, + kC128 := * + } + } + } +} + +template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + cipherModeComplete := { + messageType := '55'O, + layer3MessageContents := omit, + chosenEncryptionAlgorithm := { + elementIdentifier := '2C'O, + algorithmIdentifier := alg + } + } + } + } +} + template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 330f25a..656fb4e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -33,7 +33,8 @@ hexstring msisdn, OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, - BSSMAP_IE_ClassmarkInformationType3 cm3 optional + BSSMAP_IE_ClassmarkInformationType3 cm3 optional, + octetstring kc optional }; @@ -161,10 +162,12 @@ return vec; } -function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm) +function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm, + boolean expect_ciph := false) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; + var AuthVector vec; /* tell GSUP dispatcher to send this IMSI to us */ f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -177,7 +180,7 @@ } if (expect_auth) { - var AuthVector vec := f_gen_auth_vec_2g(); + vec := f_gen_auth_vec_2g(); var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); @@ -186,6 +189,12 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(vec.sres))); } + if (expect_ciph) { + BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, vec.kc)); + g_pars.kc := vec.kc; + BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); + } + /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 367cd79..74d1b93 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -331,7 +331,8 @@ msisdn := f_gen_msisdn(imsi_suffix), tmsi := omit, cm2 := valueof(ts_CM2_default), - cm3 := omit + cm3 := omit, + kc := omit }; vc_conn := BSC_ConnHdlr.create(id); @@ -1087,6 +1088,21 @@ vc_conn.done; } +private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(true, true, true, true); +} +testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + f_vty_config(MSCVTY, "network", "encryption a5 1 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_13), testcasename(), 24); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8a8a5c55d87bb251896664679920b96f678673a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From admin at opensuse.org Wed Jan 24 21:47:30 2018 From: admin at opensuse.org (OBS Notification) Date: Wed, 24 Jan 2018 21:47:30 +0000 Subject: Build failure of network:osmocom:nightly/osmo-msc in Debian_9.0/aarch64 In-Reply-To: References: Message-ID: <5a68fef3abf1b_5f7a692f58776618@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:nightly/osmo-msc/Debian_9.0/aarch64 Package network:osmocom:nightly/osmo-msc failed to build in Debian_9.0/aarch64 Check out the package for editing: osc checkout network:osmocom:nightly osmo-msc Last lines of build log: [ 656s] - Total time passed: 1.000023 s [ 656s] MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_ALERTING [ 656s] @@ -635,7 +635,7 @@ [ 656s] MSC --> MNCC: callref 0x423: MNCC_ALERT_IND [ 656s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING [ 656s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP [ 656s] -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC [ 656s] +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC [ 656s] DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) [ 656s] - Total time passed: 2.000046 s [ 656s] MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_CONNECT [ 656s] @@ -645,7 +645,7 @@ [ 656s] MSC --> MNCC: callref 0x423: MNCC_SETUP_CNF [ 656s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING [ 656s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP [ 656s] -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC [ 656s] +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC [ 656s] DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) [ 656s] DMNCC receive message MNCC_SETUP_COMPL_REQ [ 656s] DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU [ 656s] @@ -663,7 +663,7 @@ [ 656s] MSC --> MNCC: callref 0x423: MNCC_DISC_IND [ 656s] DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING [ 658s] DMM Subscr[ 636.623665] sysrq: SysRq : Power Off [ 658s] [ 636.635534] reboot: Power down [ 658s] ### VM INTERACTION END ### [ 658s] [ 658s] obs-arm-2 failed "build osmo-msc_1.1.2.20180124.dsc" at Wed Jan 24 21:47:21 UTC 2018. [ 658s] -- 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 Jan 24 21:57:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:57:40 +0000 Subject: [PATCH] osmo-msc[master]: Fix msc_vlr test results (.err) for new libosmocore GSM48_PD... Message-ID: Review at https://gerrit.osmocom.org/6047 Fix msc_vlr test results (.err) for new libosmocore GSM48_PDISC names In I8de7c01f9ea1d66c384e57449c4140186f5ce6c5, libosmocore introduced shorter names in gsm48_pdisc_names, which has implications on the expected test output Change-Id: I4421872a0d609dd50a6b911b928aa5e111d1ad24 --- M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.err 8 files changed, 346 insertions(+), 346 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/47/6047/1 diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index fac9623..f6eef60 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -128,8 +128,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -252,16 +252,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -373,16 +373,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -566,8 +566,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -698,16 +698,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -827,16 +827,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1010,8 +1010,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1134,16 +1134,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1241,16 +1241,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1348,16 +1348,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1541,8 +1541,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1673,16 +1673,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1788,16 +1788,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1903,16 +1903,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -2086,8 +2086,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -2224,16 +2224,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -2417,8 +2417,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -2563,16 +2563,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index d17d44b..625ae61 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -269,7 +269,7 @@ DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) - MNCC says that's fine DMNCC receive message MNCC_CALL_PROC_REQ @@ -295,7 +295,7 @@ MSC --> MNCC: callref 0x80000001: MNCC_SETUP_COMPL_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) --- - RTP stream goes ahead, not shown here. @@ -309,7 +309,7 @@ MSC --> MNCC: callref 0x80000001: MNCC_DISC_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) DMNCC receive message MNCC_REL_REQ DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU @@ -614,7 +614,7 @@ - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: CC paging_stopped == 1 MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_CALL_CONF DREF MSISDN:42342: MSC conn use + dtap == 3 (0xe) @@ -625,7 +625,7 @@ DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) - Total time passed: 1.000023 s MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_ALERTING @@ -635,7 +635,7 @@ MSC --> MNCC: callref 0x423: MNCC_ALERT_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) - Total time passed: 2.000046 s MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_CONNECT @@ -645,7 +645,7 @@ MSC --> MNCC: callref 0x423: MNCC_SETUP_CNF DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) DMNCC receive message MNCC_SETUP_COMPL_REQ DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU @@ -663,7 +663,7 @@ MSC --> MNCC: callref 0x423: MNCC_DISC_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) DMNCC receive message MNCC_REL_REQ DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index bee4646..4db427f 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -61,8 +61,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -204,8 +204,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -245,16 +245,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -331,8 +331,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -366,13 +366,13 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -383,22 +383,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -509,8 +509,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -593,8 +593,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -688,8 +688,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -729,16 +729,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -815,8 +815,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -850,13 +850,13 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -867,22 +867,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1022,8 +1022,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -1161,8 +1161,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -1248,8 +1248,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1381,8 +1381,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -1468,8 +1468,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1494,8 +1494,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1756,8 +1756,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -1797,16 +1797,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1883,8 +1883,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -1918,13 +1918,13 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1935,22 +1935,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index d17f5ea..da4e0b7 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -76,8 +76,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -205,8 +205,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -240,8 +240,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -264,16 +264,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -350,8 +350,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -384,8 +384,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -406,11 +406,11 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 2 (0x14) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS dtap_tx_confirmed == 1 paging_stopped == 1 - SMS was delivered, no requests pending for subscr @@ -420,22 +420,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -562,8 +562,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -632,8 +632,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -727,8 +727,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -762,8 +762,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -786,16 +786,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -872,8 +872,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -906,8 +906,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -928,11 +928,11 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 2 (0x14) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS dtap_tx_confirmed == 1 paging_stopped == 1 - SMS was delivered, no requests pending for subscr @@ -942,22 +942,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1083,8 +1083,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -1156,8 +1156,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1306,8 +1306,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 vsub->imeisv[0] == 0 @@ -1340,8 +1340,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 - HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT <-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 DVLR GSUP rx 17: 10010809710000004026f00804036470f1 @@ -1514,8 +1514,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -1587,8 +1587,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1613,8 +1613,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 0132461..9c66a36 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -53,8 +53,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -159,16 +159,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -241,14 +241,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -259,22 +259,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -377,8 +377,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -422,8 +422,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -519,16 +519,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -600,14 +600,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -618,22 +618,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -712,8 +712,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -757,8 +757,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -888,8 +888,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -936,8 +936,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1061,8 +1061,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1109,8 +1109,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1135,8 +1135,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends TMSI Realloc Complete MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1276,8 +1276,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1434,8 +1434,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1482,8 +1482,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1624,8 +1624,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1669,8 +1669,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1787,8 +1787,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1832,8 +1832,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -1980,8 +1980,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -2028,8 +2028,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -2054,8 +2054,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends TMSI Realloc Complete MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 229cabe..16854d2 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1089,16 +1089,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1281,14 +1281,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1301,27 +1301,27 @@ DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1508,14 +1508,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1536,9 +1536,9 @@ llist_count(&net->subscr_conns) == 1 g_conn->received_cm_service_request == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1546,12 +1546,12 @@ DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1752,14 +1752,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1773,25 +1773,25 @@ DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index f4e5f0e..8c8d26d 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -16,8 +16,8 @@ DRLL subscr unknown: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr unknown: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr unknown: Message not permitted for initial conn: SMS:0x01 - fake: acceptance DREF VLR subscr unknown usage increases to: 1 DMM Subscr_Conn(test){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED @@ -140,8 +140,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -257,8 +257,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -378,8 +378,8 @@ DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: SMS:0x01 - MS tells us the IMSI, causes a GSUP LU request to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF TMSI:0x23422342: MSC conn use + dtap == 2 (0x6) @@ -422,8 +422,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index 2c1741d..f519c2f 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -128,8 +128,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -217,8 +217,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -258,16 +258,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -345,8 +345,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -380,13 +380,13 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -397,22 +397,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -600,8 +600,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -689,8 +689,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -738,16 +738,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -825,8 +825,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -872,11 +872,11 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + trans_sms == 2 (0x14) DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_UTRAN_IU--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS paging_stopped == 1 - SMS was delivered, no requests pending for subscr DREF VLR subscr MSISDN:42342 usage increases to: 5 @@ -885,22 +885,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_UTRAN_IU-- MS: SMS:0x04 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_UTRAN_IU-- MS: SMS:0x01 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_UTRAN_IU--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1108,8 +1108,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1331,8 +1331,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 -- To view, visit https://gerrit.osmocom.org/6047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4421872a0d609dd50a6b911b928aa5e111d1ad24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:34 +0000 Subject: osmo-ttcn3-hacks[master]: MSC_Tests: Proper treatment of IMEI + TMSI In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6035 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:36 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add test case for LU with MI=IMEI (which is illegal) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3c91a0ff212a70a8e03e0579f240a10bc4356f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:38 +0000 Subject: osmo-ttcn3-hacks[master]: msc_tests: Randomly generate Auth Vector (rather than hard-c... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2dc0570a8ae5003d26368b09d223db8e44a5c4ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:40 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add tests for HLR SAI timeout and HLR SAI error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:42 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Test closing BSSAP connection of LU by ClearCommand In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9194da2f9324ee17c920458cb920a6fa718ac739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:47 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP/L3: Add templates related to authentication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id9566e3e075a8837e2e77a7c2b9d8f0f6e9b7554 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:58:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:58:49 +0000 Subject: osmo-ttcn3-hacks[master]: WIP: MSC: Add MO call testing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If32cb359b3cf732c4752856538552595dbbf2a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:02 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP: Fix handling of odd-length IMSI and 0xF filler digit In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6040 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4e0a9f1236504ce6026c6e34fd97fda6fefa832c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:04 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Fix generation of IMSI/IMEI/MSISDN In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6039 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I54d05e8ec7aeecc48666d3b369351212a6a0ea6f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:07 +0000 Subject: osmo-ttcn3-hacks[master]: Osmocom_VTY_Functions: Make prompt configurable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:10 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Cosmetic (fix comment) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6036 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I20c65454f606a5c3bc3c5a127ae02b6c204ca06e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:14 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_lu_disconnect: Start LU, then do a hard SCCP dis... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04d0b09350c6a1c9b8fb9aac87158a142d80f18f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:26 +0000 Subject: osmo-ttcn3-hacks[master]: MSC: Add test for LU with 2G authentication In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ea201bd603e581f199cd29056e7e7ebc9bd0923 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:34 +0000 Subject: osmo-ttcn3-hacks[master]: MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04ca21824f66ad90d9dac2c25000ecd724aa4528 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:47 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests ...................................................................... MSC_Tests: More CM SERVICE REQ and EMERGENCY CALL related tests Change-Id: I04ca21824f66ad90d9dac2c25000ecd724aa4528 --- M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 272 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ca81b72..db514a4 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -361,6 +361,29 @@ ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); +template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { + rf_PowerCapability := '010'B, + a5_1 := a5_1_unavail, + esind := '1'B, + revisionLevel := rev, + spare1_1 := '0'B +} + +template PDU_ML3_MS_NW ts_ML3_MO_MM_IMSI_DET_Ind(MobileIdentityLV mi, + template MobileStationClassmark1_V cm1 := ts_CM1) +modifies ts_ML3_MO := { + msgs := { + mm := { + imsiDetachIndication := { + messageType := '000001'B, + nsd := '00'B, + mobileStationClassmark1 := cm1, + mobileIdentityLV := mi + } + } + } +} + template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { discriminator := '0011'B, tiOrSkip := { @@ -440,6 +463,30 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_CC_EMERG_SETUP(integer tid, template BearerCapability_TLV bcap := ts_Bcap_voice) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + emergencySetup := { + messageType := '001110'B, + nsd := '00'B, + bearerCapability := bcap, + streamIdentifier := omit, + supportedCodecs := omit, + emergencyCategory := omit + } + } + } +} + + template PDU_ML3_NW_MS tr_ML3_MT_CC_CALL_PROC(integer tid) := { discriminator := '0011'B, tiOrSkip := { diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 0fb1702..69854e3 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -80,14 +80,6 @@ bssap := bssap }; -template (value) MobileStationClassmark1_V ts_CM1(BIT1 a5_1_unavail := '0'B, BIT2 rev := '10'B) := { - rf_PowerCapability := '010'B, - a5_1 := a5_1_unavail, - esind := '1'B, - revisionLevel := rev, - spare1_1 := '0'B -} - /* Encode 'l3' and ask BSSMAP_Emulation to create new connection with COMPL L3 INFO */ function f_bssap_compl_l3(PDU_ML3_MS_NW l3) runs on BSC_ConnHdlr { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c2d1771..0fad797 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -702,6 +702,228 @@ } +/* Test IMSI DETACH (MI=IMSI) */ +private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + + /* Send Early Classmark, just for the fun of it? */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_imsi_detach_by_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), testcasename(), 2); + vc_conn.done; +} + +/* Test IMSI DETACH (MI=TMSI) */ +private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + + /* Send Early Classmark, just for the fun of it? */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_imsi_detach_by_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), testcasename(), 3); + vc_conn.done; +} + +/* Test IMSI DETACH (MI=IMEI), which is illegal */ +private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); + + /* Send Early Classmark, just for the fun of it? */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_imsi_detach_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), testcasename(), 4); + vc_conn.done; +} + + +/* helper function for an emergency call. caller passes in mobile identity to use */ +private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { + + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); + + var hexstring called := '112'H; + var integer tid := 0; + var MNCC_PDU mncc; + f_create_mncc_expect(hex2str(called)); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_EMERG_SETUP(tid))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc; + /* FIXME: extract call_id */ + + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); + + /* Answer. This causes TCH assignment in case of "late assignment" */ + MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + + f_sleep(3.0); + + /* Hangup by "B" side */ + MNCC.send(ts_MNCC_DISC_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(23)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(tid))); + + /* Release of call */ + MNCC.send(ts_MNCC_REL_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); + + /* clearing of radio channel */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + + f_sleep(5.0); +} + +/* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ +private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); + setverdict(pass); +} +testcase TC_emerg_call_imei_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), testcasename(), 5); + vc_conn.done; +} + +/* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ +private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + /* Then issue emergency call identified by IMSI */ + f_emerg_call(valueof(ts_MI_IMSI_LV(g_pars.imsi))); +} +testcase TC_emerg_call_imsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6); + vc_conn.done; +} + +/* CM Service Request for VGCS -> reject */ +private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1001'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + setverdict(pass); +} +testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 7); + vc_conn.done; +} + +/* CM Service Request for VBS -> reject */ +private function f_tc_cm_serv_req_vbs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1010'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + setverdict(pass); +} +testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 8); + vc_conn.done; +} + +/* CM Service Request for LCS -> reject */ +private function f_tc_cm_serv_req_lcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1011'B, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + setverdict(pass); +} +testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 9); + vc_conn.done; +} + + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? * malformed messages (missing IE, invalid message type): properly rejected? @@ -711,6 +933,9 @@ * emergency call * IMSI DETACH * send new transaction after/during clear (like SMS, ...) + * too long L3 INFO in DTAP + * too long / padded BSSAP + * too long / short TLV values */ -- To view, visit https://gerrit.osmocom.org/6029 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04ca21824f66ad90d9dac2c25000ecd724aa4528 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:47 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC: Add test for LU with 2G authentication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC: Add test for LU with 2G authentication ...................................................................... MSC: Add test for LU with 2G authentication Change-Id: I5ea201bd603e581f199cd29056e7e7ebc9bd0923 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 20 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 39acfb7..ee0e0ae 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -149,9 +149,15 @@ } if (expect_auth) { + var OCT16 rand := 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'O; + var OCT4 sres := 'bbbbbbbb'O; + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(rand, sres, + 'cccccccccccccccc'O)); GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); - /* FIXME */ - //GSUP.send(tr_GSUP_SAI_RES()); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(sres))); } /* Expect MSC to perform LU with HLR */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index dea27a7..15ffc20 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -418,6 +418,18 @@ vc_conn.done; } +private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(true, true, true); +} +testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi), testcasename(), 5); + vc_conn.done; +} + /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) -- To view, visit https://gerrit.osmocom.org/6024 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ea201bd603e581f199cd29056e7e7ebc9bd0923 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:47 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: WIP: MSC: Add MO call testing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: WIP: MSC: Add MO call testing ...................................................................... WIP: MSC: Add MO call testing Change-Id: If32cb359b3cf732c4752856538552595dbbf2a8a --- M library/L3_Templates.ttcn M library/MNCC_Types.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 110 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 0da4706..be9386a 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -427,6 +427,52 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + disconnect_NW_MS := { + messageType := '100101'B, + nsd := '00'B, + cause := ?, + facility := *, + progressIndicator := *, + user_user := *, + allowedActions := * + } + } + } +} + +template PDU_ML3_NW_MS tr_ML3_MT_CC_RELEASE(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := ?, + tIExtension := omit + } + }, + msgs := { + cc := { + release_NW_MS := { + messageType := '101101'B, + nsd := '00'B, + cause := ?, + secondCause := *, + facility := *, + user_user := * + } + } + } +} diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index e5d6af9..46159b7 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -274,6 +274,18 @@ variant (coding) "FIELDLENGTH(32)"; } +template MNCC_cause ts_MNCC_cause(int val, + GSM48_cause_loc loc := GSM48_CAUSE_LOC_PUN_S_LU, + GSM48_cause_coding coding := GSM48_CAUSE_CS_GSM, + octetstring diag := ''O) := { + location := loc, + coding := coding, + rec := 0, + rec_val := 0, + val := val, + diag := diag +} + type record MNCC_useruser { int proto, charstring info diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 68e0bef..dea27a7 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -21,6 +21,7 @@ import from Osmocom_CTRL_Adapter all; import from MNCC_Emulation all; +import from MNCC_Types all; import from GSUP_Emulation all; import from GSUP_Types all; @@ -458,6 +459,56 @@ vc_conn.done; } +private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(false, true, true); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false); + + var hexstring called := '12345'H; + var integer tid := 0; + var MNCC_PDU mncc; + f_create_mncc_expect(hex2str(called)); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(tid, called))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc; + /* FIXME: extract call_id */ + + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); + + /* Answer. This causes TCH assignment in case of "late assignment" */ + MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + + f_sleep(3.0); + + /* Hangup by "B" side */ + MNCC.send(ts_MNCC_DISC_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(23)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(tid))); + + /* Release of call */ + MNCC.send(ts_MNCC_REL_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); + + /* clearing of radio channel */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + + f_sleep(5.0); +} +testcase TC_lu_and_mo_call() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 1); + vc_conn.done; +} @@ -467,6 +518,7 @@ //execute( TC_lu_imsi_noauth_notmsi() ); execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); + execute( TC_lu_and_mo_call() ); } -- To view, visit https://gerrit.osmocom.org/6022 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If32cb359b3cf732c4752856538552595dbbf2a8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:48 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP/L3: Add templates related to authentication In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP/L3: Add templates related to authentication ...................................................................... GSUP/L3: Add templates related to authentication Change-Id: Id9566e3e075a8837e2e77a7c2b9d8f0f6e9b7554 --- M library/GSUP_Types.ttcn M library/L3_Templates.ttcn 2 files changed, 152 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 7455085..bc54510 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -88,8 +88,15 @@ variant (val) "CROSSTAG(imsi, tag = OSMO_GSUP_IMSI_IE; cause, tag = OSMO_GSUP_CAUSE_IE; cancel_type, tag = OSMO_GSUP_CANCEL_TYPE_IE; + auth_tuple, tag = OSMO_GSUP_AUTH_TUPLE_IE; auts, tag = OSMO_GSUP_AUTS_IE; rand, tag = OSMO_GSUP_RAND_IE; + sres, tag = OSMO_GSUP_SRES_IE; + kc, tag = OSMO_GSUP_KC_IE; + ik, tag = OSMO_GSUP_IK_IE; + ck, tag = OSMO_GSUP_CK_IE; + autn, tag = OSMO_GSUP_AUTN_IE; + res, tag = OSMO_GSUP_RES_IE; msisdn, tag = OSMO_GSUP_MSISDN_IE; hlr_number, tag = OSMO_GSUP_HLR_NUMBER_IE; cn_domain, tag = OSMO_GSUP_CN_DOMAIN_IE; @@ -108,6 +115,12 @@ GSUP_IEs auth_tuple, octetstring auts, octetstring rand, + octetstring sres, + octetstring kc, + octetstring ik, + octetstring ck, + octetstring autn, + octetstring res, hexstring msisdn, octetstring hlr_number, GSUP_CnDomain cn_domain, @@ -126,6 +139,38 @@ with { extension "prototype(convert) decode(RAW)" }; +template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, + octetstring kc) := { + tag := OSMO_GSUP_AUTH_TUPLE_IE, + len := 0, /* overwritten */ + val := { + auth_tuple := { + valueof(ts_GSUP_IE_RAND(rand)), + valueof(ts_GSUP_IE_SRES(sres)), + valueof(ts_GSUP_IE_Kc(kc)) + } + } +} + +template GSUP_IE ts_GSUP_IE_AuthTuple2G3G(octetstring rand, octetstring sres, + octetstring kc, octetstring ik, + octetstring ck, octetstring autn, + octetstring res) := { + tag := OSMO_GSUP_AUTH_TUPLE_IE, + len := 0, /* overwritten */ + val := { + auth_tuple := { + valueof(ts_GSUP_IE_RAND(rand)), + valueof(ts_GSUP_IE_SRES(sres)), + valueof(ts_GSUP_IE_Kc(kc)), + valueof(ts_GSUP_IE_IK(ik)), + valueof(ts_GSUP_IE_CK(ck)), + valueof(ts_GSUP_IE_AUTN(autn)), + valueof(ts_GSUP_IE_RES(res)) + } + } +} + template GSUP_PDU tr_GSUP(template GSUP_MessageType msgt := ?, template GSUP_IEs ies := *) := { msg_type := msgt, ies := ies @@ -141,6 +186,10 @@ template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); + +template (value) GSUP_PDU ts_GSUP_SAI_RES(hexstring imsi, GSUP_IE auth_tuple) := + ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT, { + valueof(ts_GSUP_IE_IMSI(imsi)), auth_tuple }); template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { @@ -241,6 +290,53 @@ } } +template (value) GSUP_IE ts_GSUP_IE_SRES(octetstring sres) := { + tag := OSMO_GSUP_SRES_IE, + len := 0, /* overwritten */ + val := { + sres := sres + } +} + +template (value) GSUP_IE ts_GSUP_IE_Kc(octetstring kc) := { + tag := OSMO_GSUP_KC_IE, + len := 0, /* overwritten */ + val := { + kc := kc + } +} + +template (value) GSUP_IE ts_GSUP_IE_IK(octetstring ik) := { + tag := OSMO_GSUP_IK_IE, + len := 0, /* overwritten */ + val := { + ik := ik + } +} + +template (value) GSUP_IE ts_GSUP_IE_CK(octetstring ck) := { + tag := OSMO_GSUP_CK_IE, + len := 0, /* overwritten */ + val := { + ck := ck + } +} + +template (value) GSUP_IE ts_GSUP_IE_AUTN(octetstring autn) := { + tag := OSMO_GSUP_AUTN_IE, + len := 0, /* overwritten */ + val := { + autn := autn + } +} + +template (value) GSUP_IE ts_GSUP_IE_RES(octetstring res) := { + tag := OSMO_GSUP_RES_IE, + len := 0, /* overwritten */ + val := { + res := res + } +} diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index be9386a..d652873 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -474,6 +474,62 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + authenticationRequest := { + messageType := '010010'B, + nsd := '00'B, + cipheringKeySequenceNumber := ?, + spare2_4 := ?, + authenticationParRAND := rand, + authenticationParAUTN := * + } + } + } +} + +template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_2G(OCT4 sres) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + authenticationResponse := { + messageType := '010100'B, + nsd := '00'B, + authenticationParSRES := sres, + authenticationParSRESext := omit + } + } + } +} + +template (value) PDU_ML3_MS_NW ts_ML3_MT_MM_AUTH_RESP_3G(OCT4 sres, octetstring res) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + authenticationResponse := { + messageType := '010100'B, + nsd := '00'B, + authenticationParSRES := sres, + authenticationParSRESext := { + elementIdentifier := '21'O, + lengthIndicator := 0, /* overwritten */ + valueField := res + } + } + } + } +} } -- To view, visit https://gerrit.osmocom.org/6023 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id9566e3e075a8837e2e77a7c2b9d8f0f6e9b7554 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:48 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Test closing BSSAP connection of LU by ClearCommand In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Test closing BSSAP connection of LU by ClearCommand ...................................................................... msc: Test closing BSSAP connection of LU by ClearCommand Change-Id: I9194da2f9324ee17c920458cb920a6fa718ac739 --- M library/BSSMAP_Templates.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 44 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 925a8e6..5331505 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -609,6 +609,18 @@ } } +template (value) PDU_BSSAP ts_BSSMAP_ClearRequest(BssmapCause cause) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + clearRequest := { + messageType := '22'O, /* overwritten */ + cause := ts_BSSMAP_IE_Cause(cause) + } + } + } +} + template PDU_BSSAP tr_BSSMAP_ClearRequest modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9f8dd69..a21ad50 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -588,6 +588,38 @@ vc_conn.done; } +/* Test LU but BSC will send a clear request in the middle */ +private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + f_sleep(1.0); + /* send clear request in the middle of the LU */ + BSSAP.send(ts_BSSMAP_ClearRequest(0)); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_clear_request() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_clear_request), testcasename(), 8); + vc_conn.done; +} + control { -- To view, visit https://gerrit.osmocom.org/6027 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9194da2f9324ee17c920458cb920a6fa718ac739 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:48 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add tests for HLR SAI timeout and HLR SAI error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add tests for HLR SAI timeout and HLR SAI error ...................................................................... msc: Add tests for HLR SAI timeout and HLR SAI error Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367 --- M library/GSUP_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 75 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index bc54510..15560c7 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -192,9 +192,14 @@ valueof(ts_GSUP_IE_IMSI(imsi)), auth_tuple }); template GSUP_PDU tr_GSUP_SAI_ERR(template hexstring imsi, template integer cause) := - tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { + tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); +template GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := + tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { + ts_GSUP_IE_IMSI(imsi), ts_GSUP_IE_Cause(cause) }); + + template GSUP_PDU tr_GSUP_SAI_RES(template hexstring imsi) := tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 15ffc20..9f8dd69 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -518,7 +518,73 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 1); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6); + vc_conn.done; +} + +/* Test LU (with authentication enabled), where HLR times out sending SAI response */ +private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + /* The HLR would normally return an auth vector here, but we fail to do so. */ + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_auth_sai_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7); + vc_conn.done; +} + +/* Test LU (with authentication enabled), where HLR rejects sending SAI error */ +private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_auth_sai_err() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8); vc_conn.done; } @@ -531,6 +597,8 @@ execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); execute( TC_lu_and_mo_call() ); + execute( TC_lu_auth_sai_timeout() ); + execute( TC_lu_auth_sai_err() ); } -- To view, visit https://gerrit.osmocom.org/6026 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7f8c8ff9ccadd7b7b14cba12a34cebe6855a5367 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:48 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc_tests: Randomly generate Auth Vector (rather than hard-c... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc_tests: Randomly generate Auth Vector (rather than hard-coded value) ...................................................................... msc_tests: Randomly generate Auth Vector (rather than hard-coded value) Change-Id: I2dc0570a8ae5003d26368b09d223db8e44a5c4ff --- M msc_tests/BSC_ConnectionHandler.ttcn 1 file changed, 28 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index ee0e0ae..f9b4d3e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -133,6 +133,30 @@ return l3_info; } +type record AuthVector { + OCT16 rand, + OCT4 sres, + OCT8 kc + /* FIXME: 3G elements */ +} + +private function f_rnd_oct(integer len) return octetstring { + var integer i; + var octetstring res; + for (i := 0; i < len; i := i + 1) { + res[i] := int2oct(float2int(rnd()*256.0), 1); + } + return res; +} + +function f_gen_auth_vec_2g() return AuthVector { + var AuthVector vec; + vec.rand := f_rnd_oct(16); + vec.sres := f_rnd_oct(4); + vec.kc := f_rnd_oct(8); + return vec; +} + function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -149,15 +173,13 @@ } if (expect_auth) { - var OCT16 rand := 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'O; - var OCT4 sres := 'bbbbbbbb'O; - var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(rand, sres, - 'cccccccccccccccc'O)); + var AuthVector vec := f_gen_auth_vec_2g(); + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(rand))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(sres))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(vec.sres))); } /* Expect MSC to perform LU with HLR */ -- To view, visit https://gerrit.osmocom.org/6025 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2dc0570a8ae5003d26368b09d223db8e44a5c4ff Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:49 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add test case for LU with MI=IMEI (which is illegal) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add test case for LU with MI=IMEI (which is illegal) ...................................................................... msc: Add test case for LU with MI=IMEI (which is illegal) Change-Id: Ie3c91a0ff212a70a8e03e0579f240a10bc4356f4 --- M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 163 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index d652873..ca81b72 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -56,6 +56,18 @@ return l3; } +private function f_enc_IMEI_L3(hexstring digits) return IMEI_L3 { + var IMEI_L3 l3; + var integer len := lengthof(digits); + if (len rem 2 == 1) { /* modulo remainder */ + l3.oddevenIndicator := '1'B; + } else { + l3.oddevenIndicator := '0'B; + } + l3.digits := digits; + return l3; +} + /* send template fro Mobile Identity (IMSI) */ template (value) MobileIdentityLV ts_MI_IMSI_LV(hexstring imsi_digits) := { lengthIndicator := 0, /* overwritten */ @@ -66,6 +78,18 @@ } } } + +/* send template fro Mobile Identity (IMEI) */ +template (value) MobileIdentityLV ts_MI_IMEI_LV(hexstring imei_digits) := { + lengthIndicator := 0, /* overwritten */ + mobileIdentityV := { + typeOfIdentity := '000'B, /* overwritten */ + oddEvenInd_identity := { + imei := f_enc_IMEI_L3(imei_digits) + } + } +} + /* Send template for Classmark 2 */ template (value) MobileStationClassmark2_LV ts_CM2 := { @@ -300,6 +324,43 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_MM_ID_Req(template BIT3 id_type := ?) := { + discriminator := '0101'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + identityRequest := { + messageType := '011000'B, + nsd := '00'B, + identityType := id_type, + spare1_5 := ? + } + } + } +} + +template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp(MobileIdentityLV mi) modifies ts_ML3_MO := { + msgs := { + mm := { + identityResponse := { + messageType := '011001'B, + nsd := '00'B, + mobileIdentityLV := mi, + p_TMSI_TypeTV := omit, + routingAreaIdentification2TLV := omit, + p_TMSISignature2TLV := omit + } + } + } +} +template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMSI(hexstring imsi) := + ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMSI_LV(imsi))); +template PDU_ML3_MS_NW ts_ML3_MO_MM_ID_Rsp_IMEI(hexstring imei) := + ts_ML3_MO_MM_ID_Rsp(valueof(ts_MI_IMEI_LV(imei))); + + template PDU_ML3_MS_NW ts_ML3_MO_CC(integer tid) := { discriminator := '0011'B, tiOrSkip := { diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index f9b4d3e..0fb1702 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -125,6 +125,16 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); return f_build_lu(mi); } +function f_build_lu_imei(hexstring imei) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(imei)); + return f_build_lu(mi); +} +function f_build_lu_tmsi(OCT4 tmsi) return PDU_ML3_MS_NW +{ + var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV(tmsi)); + return f_build_lu(mi); +} private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW { var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index a21ad50..c2d1771 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -620,6 +620,98 @@ vc_conn.done; } +/* Test LU but with illegal mobile identity type = IMEI */ +private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + /* wait for LU reject, ignore any ID REQ */ + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req)) { repeat; } + } + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_by_imei() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9); + vc_conn.done; +} + +/* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ +private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_tmsi('01020304'O); /* FIXME: Random */ + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + /* Wait for + respond to ID REQ (IMSI) */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req('001'B))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_MM_ID_Rsp_IMSI(g_pars.imsi))); + + /* Expect MSC to do UpdateLocation to HLR; respond to it */ + GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); + GSUP.receive(tr_GSUP_ISD_RES(g_pars.imsi)); + GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); + + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { + setverdict(fail, "Expected LU ACK, but received REJ"); + } + } + + /* wait for normal teardown */ + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1); + vc_conn.done; +} + + +/* TODO: + * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? + * malformed messages (missing IE, invalid message type): properly rejected? + * MT call while LU or is ongoing: Do we use existing lchan or page while lchan active? + * 3G/2G auth permutations + * encryption algorithms vs. classmark vs. vty config + * emergency call + * IMSI DETACH + * send new transaction after/during clear (like SMS, ...) + */ control { -- To view, visit https://gerrit.osmocom.org/6028 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3c91a0ff212a70a8e03e0579f240a10bc4356f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:49 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_lu_disconnect: Start LU, then do a hard SCCP dis... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_lu_disconnect: Start LU, then do a hard SCCP disconnect ...................................................................... msc: Add TC_lu_disconnect: Start LU, then do a hard SCCP disconnect Change-Id: I04d0b09350c6a1c9b8fb9aac87158a142d80f18f --- M msc_tests/MSC_Tests.ttcn 1 file changed, 30 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 0fad797..9cf6ce5 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -620,6 +620,36 @@ vc_conn.done; } +/* Test LU but BSC will send a clear request in the middle */ +private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + var PDU_DTAP_MT dtap_mt; + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + f_sleep(1.0); + /* send clear request in the middle of the LU */ + BSSAP.send(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_REQ); + setverdict(pass); +} +testcase TC_lu_disconnect() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_lu_disconnect), testcasename(), 9); + vc_conn.done; +} + + /* Test LU but with illegal mobile identity type = IMEI */ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; -- To view, visit https://gerrit.osmocom.org/6030 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04d0b09350c6a1c9b8fb9aac87158a142d80f18f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 21:59:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 21:59:53 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add all test cases to control section In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79abcbe5638a02c1d6d94ba31ce72bfbc372fd21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:05 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add all test cases to control section In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add all test cases to control section ...................................................................... msc: Add all test cases to control section Change-Id: I79abcbe5638a02c1d6d94ba31ce72bfbc372fd21 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9cf6ce5..4bacc1d 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -978,6 +978,18 @@ execute( TC_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); execute( TC_lu_auth_sai_err() ); + execute( TC_lu_clear_request() ); + execute( TC_lu_disconnect() ); + execute( TC_lu_by_imei() ); + execute( TC_lu_by_tmsi_noauth_unknown() ); + execute( TC_imsi_detach_by_imsi() ); + execute( TC_imsi_detach_by_tmsi() ); + execute( TC_imsi_detach_by_imei() ); + execute( TC_emerg_call_imei_reject() ); + execute( TC_emerg_call_imsi() ); + execute( TC_cm_serv_req_vgcs_reject() ); + execute( TC_cm_serv_req_vbs_reject() ); + execute( TC_cm_serv_req_lcs_reject() ); } -- To view, visit https://gerrit.osmocom.org/6031 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79abcbe5638a02c1d6d94ba31ce72bfbc372fd21 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:06 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Cosmetic (fix comment) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Cosmetic (fix comment) ...................................................................... msc: Cosmetic (fix comment) Change-Id: I20c65454f606a5c3bc3c5a127ae02b6c204ca06e --- M msc_tests/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 959cd37..3c0a460 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -882,7 +882,7 @@ vc_conn.done; } -/* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ +/* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; /* First perform location update to ensure subscriber is known */ -- To view, visit https://gerrit.osmocom.org/6036 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I20c65454f606a5c3bc3c5a127ae02b6c204ca06e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:06 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Osmocom_VTY_Functions: Make prompt configurable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Osmocom_VTY_Functions: Make prompt configurable ...................................................................... Osmocom_VTY_Functions: Make prompt configurable We want to use this code also for OsmoMSC testing, so let's make the prefix configurable as module parameter. Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee --- M library/Osmocom_VTY_Functions.ttcn 1 file changed, 42 insertions(+), 33 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/Osmocom_VTY_Functions.ttcn b/library/Osmocom_VTY_Functions.ttcn index 1215e0d..eb51a03 100644 --- a/library/Osmocom_VTY_Functions.ttcn +++ b/library/Osmocom_VTY_Functions.ttcn @@ -1,58 +1,67 @@ module Osmocom_VTY_Functions { import from TELNETasp_PortType all; - /* permitted prompts on VTY */ - const charstring NORMAL_PROMPT := "OpenBSC> "; - const charstring ENABLE_PROMPT := "OpenBSC# "; - const charstring CONFIG_PROMPT := "OpenBSC(*)\#"; - template charstring t_vty_unknown := pattern "*% Unknown command."; + modulepar { + charstring mp_prompt_prefix := "OpenBSC"; + } - const ASP_TelnetDynamicConfig vty_prompt[3] := { - { - prompt := { - id := 1, - prompt := NORMAL_PROMPT, - has_wildcards := false - } - }, { - prompt := { - id := 2, - prompt := ENABLE_PROMPT, - has_wildcards := false - } - }, { - prompt := { - id := 3, - prompt := CONFIG_PROMPT, - has_wildcards := true - } - } - }; + const charstring VTY_VIEW_SUFFIX := "> "; + const charstring VTY_ENABLE_SUFFIX := "# "; + const charstring VTY_CFG_SUFFIX := "(*)"; + + template charstring t_vty_unknown := pattern "*% Unknown command."; /* configure prompts in TELNETasp module */ function f_vty_set_prompts(TELNETasp_PT pt) { + var ASP_TelnetDynamicConfig vty_prompt[3] := { + { + prompt := { + id := 1, + prompt := mp_prompt_prefix & VTY_VIEW_SUFFIX, + has_wildcards := false + } + }, { + prompt := { + id := 2, + prompt := mp_prompt_prefix & VTY_ENABLE_SUFFIX, + has_wildcards := false + } + }, { + prompt := { + id := 3, + prompt := mp_prompt_prefix & VTY_CFG_SUFFIX, + has_wildcards := true + } + } + }; + /* set some configuration that isn't possible to express * in the config file due to syntactic restrictions (Who invents config * files that don't permit regular expressions? */ for (var integer i := 0; i < sizeof(vty_prompt); i:= i + 1) { - pt.send(vty_prompt[i]) + log(vty_prompt[i]); + pt.send(vty_prompt[i]); } } /* wait for any of the permitted prompts; buffer + return all intermediate output */ function f_vty_wait_for_prompt(TELNETasp_PT pt) return charstring { - template charstring config_pattern := pattern CONFIG_PROMPT; var charstring rx, buf := ""; timer T := 2.0; T.start; alt { - [] pt.receive(NORMAL_PROMPT) { }; - [] pt.receive(ENABLE_PROMPT) { }; - [] pt.receive(config_pattern) { }; - [] pt.receive(t_vty_unknown) { testcase.stop(fail, "VTY: Unknown Command") }; + [] pt.receive(mp_prompt_prefix & VTY_VIEW_SUFFIX) { }; + [] pt.receive(mp_prompt_prefix & VTY_ENABLE_SUFFIX) { }; + [] pt.receive(pattern mp_prompt_prefix & VTY_CFG_SUFFIX) { }; + [] pt.receive(t_vty_unknown) { + testcase.stop(fail, "VTY: Unknown Command"); + }; [] pt.receive(charstring:?) -> value rx { buf := buf & rx; repeat }; - [] T.timeout { setverdict(fail, "VTY Timeout for prompt"); return ""}; + [] T.timeout { + setverdict(fail, "VTY Timeout for prompt"); + self.stop; + }; } T.stop; return buf; -- To view, visit https://gerrit.osmocom.org/6037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iec846227e88b3dc0d3be9474b8b926719161c9ee Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:06 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC_Tests: Proper treatment of IMEI + TMSI In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC_Tests: Proper treatment of IMEI + TMSI ...................................................................... MSC_Tests: Proper treatment of IMEI + TMSI * don't use IMSI as IMEI * store the TMSI (after it is allocated) in the g_pars variable for later use Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 14 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 69854e3..25f8daf 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -28,8 +28,10 @@ SCCP_PAR_Address sccp_addr_own, SCCP_PAR_Address sccp_addr_peer, BSSMAP_IE_CellIdentifier cell_id, + hexstring imei, hexstring imsi, hexstring msisdn, + OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional }; @@ -199,6 +201,7 @@ setverdict(fail, "Expected TMSI but no TMSI was allocated"); self.stop; } else { + g_pars.tmsi := lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi.octets; BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); } } else { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 4bacc1d..959cd37 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -290,6 +290,12 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; +function f_gen_imei(hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := 15 - lengthof(prefix); + suffix_len := suffix_len; + return prefix & int2hex(suffix, suffix_len); +} + function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { var integer suffix_len := 15 - lengthof(prefix); suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ @@ -308,8 +314,10 @@ sccp_addr_own := g_sccp_addr_own, sccp_addr_peer := g_sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), + imei := f_gen_imei('49999'H, imsi_suffix), imsi := f_gen_imsi('26242'H, imsi_suffix), msisdn := f_gen_msisdn('491239999'H, imsi_suffix), + tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit }; @@ -654,7 +662,7 @@ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imsi) + var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei) var PDU_DTAP_MT dtap_mt; /* tell GSUP dispatcher to send this IMSI to us */ @@ -788,7 +796,7 @@ private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(valueof(ts_ML3_MO_MM_IMSI_DET_Ind(mi))); @@ -860,7 +868,7 @@ private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imsi)); + var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); -- To view, visit https://gerrit.osmocom.org/6035 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I717f1c9ab21e5be8b88f10ce4e8c583b385f3664 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:18 +0000 Subject: osmo-ttcn3-hacks[master]: MSC: Use VTY to enable/disable authentication + TMSI allocation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:25 +0000 Subject: osmo-ttcn3-hacks[master]: f_enc_IMSI_L3: Fix filler digit in *even* case In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1353f4ea09bba3151636b94a99c8559e0289ffd Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:31 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: f_enc_IMSI_L3: Fix filler digit in *even* case In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: f_enc_IMSI_L3: Fix filler digit in *even* case ...................................................................... f_enc_IMSI_L3: Fix filler digit in *even* case We actually need to add the filler digit 'F' if the number of digits is even. It is absent when the number of digits is odd. Change-Id: Ic1353f4ea09bba3151636b94a99c8559e0289ffd --- M library/L3_Templates.ttcn 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index db514a4..c603b7b 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -47,10 +47,10 @@ var integer len := lengthof(digits); if (len rem 2 == 1) { /* modulo remainder */ l3.oddevenIndicator := '1'B; - l3.fillerDigit := '1111'B; + l3.fillerDigit := omit; } else { l3.oddevenIndicator := '0'B; - l3.fillerDigit := omit; + l3.fillerDigit := '1111'B; } l3.digits := digits; return l3; -- To view, visit https://gerrit.osmocom.org/6041 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic1353f4ea09bba3151636b94a99c8559e0289ffd Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:32 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC: Use VTY to enable/disable authentication + TMSI allocation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC: Use VTY to enable/disable authentication + TMSI allocation ...................................................................... MSC: Use VTY to enable/disable authentication + TMSI allocation Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617 --- M msc_tests/MSC_Tests.cfg M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 4 files changed, 50 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.cfg b/msc_tests/MSC_Tests.cfg index 2bd9dd2..ab8a2ff 100644 --- a/msc_tests/MSC_Tests.cfg +++ b/msc_tests/MSC_Tests.cfg @@ -10,16 +10,27 @@ "MSC_Test-GSUP-IPA".FileMask := ERROR | WARNING; "MSC_Test-GSUP".FileMask := ERROR | WARNING; "IPA-CTRL-IPA".FileMask := ERROR | WARNING; +mtc.FileMask := ERROR | WARNING; [TESTPORT_PARAMETERS] #*.*.udpReuseAddress := "yes"; "MSC_Test-MNCC".MNCC.socket_type := "SEQPACKET"; +*.MSCVTY.CTRL_MODE := "client" +*.MSCVTY.CTRL_HOSTNAME := "127.0.0.1" +*.MSCVTY.CTRL_PORTNUM := "4254" +*.MSCVTY.CTRL_LOGIN_SKIPPED := "yes" +*.MSCVTY.CTRL_DETECT_SERVER_DISCONNECTED := "yes" +*.MSCVTY.CTRL_READMODE := "buffered" +*.MSCVTY.CTRL_CLIENT_CLEANUP_LINEFEED := "yes" +*.MSCVTY.PROMPT1 := "OsmoMSC> " + [MODULE_PARAMETERS] M3UA_Emulation.tsp_logVerbose := true; BSSAP_Adapter.mp_own_pc := 193; /* 0.23.3 */ BSSAP_Adapter.mp_peer_pc := 185; /* 0.23.1 */ BSSAP_Adapter.mp_sctp_addr := { 23906, "127.0.0.1", 2905, "127.0.0.1" }; +Osmocom_VTY_Functions.mp_prompt_prefix := "OsmoMSC"; [MAIN_CONTROLLER] diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 3c0a460..e0ee84c 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -20,6 +20,9 @@ import from Osmocom_CTRL_Types all; import from Osmocom_CTRL_Adapter all; +import from TELNETasp_PortType all; +import from Osmocom_VTY_Functions all; + import from MNCC_Emulation all; import from MNCC_Types all; @@ -49,6 +52,8 @@ /* only to get events from IPA underneath GSUP */ port IPA_CTRL_PT GSUP_IPA_EVENT; + /* VTY to MSC */ + port TELNETasp_PT MSCVTY; } modulepar { @@ -117,6 +122,10 @@ f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); f_init_gsup("MSC_Test"); + + map(self:MSCVTY, system:MSCVTY); + f_vty_set_prompts(MSCVTY); + f_vty_transceive(MSCVTY, "enable"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -343,6 +352,17 @@ T.timeout; } +function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd) +{ + /* enter config mode; enter node */ + f_vty_enter_config(pt); + f_vty_transceive(pt, config_node); + /* execute command */ + f_vty_transceive(pt, cmd); + /* leave config mode */ + f_vty_transceive(pt, "end"); +} + private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; f_perform_lu(false, true, true); @@ -350,6 +370,8 @@ testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); vc_conn.done; @@ -362,6 +384,8 @@ testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "no assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); vc_conn.done; @@ -391,6 +415,7 @@ testcase TC_lu_imsi_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); vc_conn.done; @@ -421,6 +446,7 @@ testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); vc_conn.done; @@ -433,6 +459,7 @@ testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi), testcasename(), 5); vc_conn.done; @@ -475,6 +502,7 @@ testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); vc_conn.done; } @@ -525,6 +553,7 @@ testcase TC_lu_and_mo_call() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6); vc_conn.done; @@ -558,6 +587,7 @@ testcase TC_lu_auth_sai_timeout() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7); vc_conn.done; @@ -591,6 +621,7 @@ testcase TC_lu_auth_sai_err() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8); vc_conn.done; @@ -687,6 +718,7 @@ testcase TC_lu_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9); vc_conn.done; @@ -734,6 +766,7 @@ testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1); vc_conn.done; @@ -893,6 +926,7 @@ testcase TC_emerg_call_imsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6); vc_conn.done; diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index cfef012..30ebed1 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -70,9 +70,12 @@ FILES="RTP_EncDec.cc RTP_Types.ttcn" gen_links $DIR $FILES +DIR=$BASEDIR/titan.TestPorts.TELNETasp/src +FILES="TELNETasp_PT.cc TELNETasp_PT.hh TELNETasp_PortType.ttcn" +gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn " +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn " FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index ce33695..10ec38f 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc *.c" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6038 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifaa0f119d37b18b804c563c045755cc23d509617 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:32 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Fix generation of IMSI/IMEI/MSISDN In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Fix generation of IMSI/IMEI/MSISDN ...................................................................... msc: Fix generation of IMSI/IMEI/MSISDN Now each test case uses unique IMSI/IMEI/MSISDN numbers, which helps to identify test cases from traces or from VTY introspection Change-Id: I54d05e8ec7aeecc48666d3b369351212a6a0ea6f --- M msc_tests/MSC_Tests.ttcn 1 file changed, 33 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index e0ee84c..5976b45 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -299,21 +299,24 @@ type function void_fn(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr; -function f_gen_imei(hexstring prefix, integer suffix) return hexstring { - var integer suffix_len := 15 - lengthof(prefix); - suffix_len := suffix_len; - return prefix & int2hex(suffix, suffix_len); +private function f_concat_pad(integer tot_len, hexstring prefix, integer suffix) return hexstring { + var integer suffix_len := tot_len - lengthof(prefix); + var charstring suffix_ch := int2str(suffix); + var integer pad_len := suffix_len - lengthof(suffix_ch); + + return prefix & int2hex(0, pad_len) & str2hex(suffix_ch); } -function f_gen_imsi(hexstring prefix, integer suffix) return hexstring { - var integer suffix_len := 15 - lengthof(prefix); - suffix_len := suffix_len-1; /* FIXME: fix odd IMSI length */ - return prefix & int2hex(suffix, suffix_len); +function f_gen_imei(integer suffix) return hexstring { + return f_concat_pad(15, '49999'H, suffix); } -function f_gen_msisdn(hexstring prefix, integer suffix) return hexstring { - var integer suffix_len := 12 - lengthof(prefix); - return prefix & int2hex(suffix, suffix_len); +function f_gen_imsi(integer suffix) return hexstring { + return f_concat_pad(15, '26242'H, suffix); +} + +function f_gen_msisdn(integer suffix) return hexstring { + return f_concat_pad(12, '49123'H, suffix); } /* FIXME: move into BSC_ConnectionHandler? */ @@ -323,9 +326,9 @@ sccp_addr_own := g_sccp_addr_own, sccp_addr_peer := g_sccp_addr_peer, cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)), - imei := f_gen_imei('49999'H, imsi_suffix), - imsi := f_gen_imsi('26242'H, imsi_suffix), - msisdn := f_gen_msisdn('491239999'H, imsi_suffix), + imei := f_gen_imei(imsi_suffix), + imsi := f_gen_imsi(imsi_suffix), + msisdn := f_gen_msisdn(imsi_suffix), tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit @@ -503,7 +506,7 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 5); + vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 6); vc_conn.done; } @@ -555,7 +558,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 6); + vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 7); vc_conn.done; } @@ -589,7 +592,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 7); + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_timeout), testcasename(), 8); vc_conn.done; } @@ -623,7 +626,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 8); + vc_conn := f_start_handler(refers(f_tc_lu_auth_sai_err), testcasename(), 9); vc_conn.done; } @@ -655,7 +658,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_lu_clear_request), testcasename(), 8); + vc_conn := f_start_handler(refers(f_tc_lu_clear_request), testcasename(), 10); vc_conn.done; } @@ -684,7 +687,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_lu_disconnect), testcasename(), 9); + vc_conn := f_start_handler(refers(f_tc_lu_disconnect), testcasename(), 11); vc_conn.done; } @@ -720,7 +723,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 9); + vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 12); vc_conn.done; } @@ -768,7 +771,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 1); + vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 13); vc_conn.done; } @@ -795,7 +798,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), testcasename(), 2); + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imsi), testcasename(), 14); vc_conn.done; } @@ -821,7 +824,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), testcasename(), 3); + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_tmsi), testcasename(), 15); vc_conn.done; } @@ -847,7 +850,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), testcasename(), 4); + vc_conn := f_start_handler(refers(f_tc_imsi_detach_by_imei), testcasename(), 16); vc_conn.done; } @@ -911,7 +914,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), testcasename(), 5); + vc_conn := f_start_handler(refers(f_tc_emerg_call_imei_reject), testcasename(), 17); vc_conn.done; } @@ -928,7 +931,7 @@ f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); - vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 6); + vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 18); vc_conn.done; } @@ -949,7 +952,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 7); + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 19); vc_conn.done; } @@ -970,7 +973,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 8); + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 20); vc_conn.done; } @@ -991,7 +994,7 @@ var BSC_ConnHdlr vc_conn; f_init(); - vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 9); + vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 21); vc_conn.done; } -- To view, visit https://gerrit.osmocom.org/6039 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54d05e8ec7aeecc48666d3b369351212a6a0ea6f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:00:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:00:32 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP: Fix handling of odd-length IMSI and 0xF filler digit In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP: Fix handling of odd-length IMSI and 0xF filler digit ...................................................................... GSUP: Fix handling of odd-length IMSI and 0xF filler digit Change-Id: I4e0a9f1236504ce6026c6e34fd97fda6fefa832c --- M library/GSUP_Types.ttcn M library/IPA_Emulation.ttcn 2 files changed, 24 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 15560c7..a8134eb 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -138,6 +138,26 @@ external function dec_GSUP_PDU(in octetstring msg) return GSUP_PDU with { extension "prototype(convert) decode(RAW)" }; +function f_gsup_postprocess_decoded(inout GSUP_PDU gsup) { + if (gsup.ies[0].tag == OSMO_GSUP_IMSI_IE) { + /* if last digit is 'F', then there's an odd number of digits and we must strip the F */ + var integer num_digits := lengthof(gsup.ies[0].val.imsi); + if (gsup.ies[0].val.imsi[num_digits-1] == 'F'H) { + gsup.ies[0].val.imsi := substr(gsup.ies[0].val.imsi, 0, num_digits-1); + } + } +} + +function f_gsup_preprocess_encoded(inout GSUP_PDU gsup) { + if (ischosen(gsup.ies[0].val.imsi)) { + /* if number of digits is odd, add a 'F' as padding at the end */ + var integer num_digits := lengthof(gsup.ies[0].val.imsi); + if (num_digits rem 2 == 1) { + gsup.ies[0].val.imsi := gsup.ies[0].val.imsi & 'F'H; + } + } +} + template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, octetstring kc) := { diff --git a/library/IPA_Emulation.ttcn b/library/IPA_Emulation.ttcn index b40818f..b3e28e9 100644 --- a/library/IPA_Emulation.ttcn +++ b/library/IPA_Emulation.ttcn @@ -370,7 +370,9 @@ } private function f_gsup_to_user(octetstring msg) runs on IPA_Emulation_CT { - IPA_GSUP_PORT.send(dec_GSUP_PDU(msg)); + var GSUP_PDU gsup := dec_GSUP_PDU(msg); + f_gsup_postprocess_decoded(gsup); + IPA_GSUP_PORT.send(gsup); } private function f_mgcp_to_ud(octetstring payload) runs on IPA_Emulation_CT return ASP_IPA_Unitdata { @@ -480,6 +482,7 @@ } [] IPA_GSUP_PORT.receive(GSUP_PDU:?) -> value gsup_msg { + f_gsup_preprocess_encoded(gsup_msg); payload := enc_GSUP_PDU(gsup_msg); ipa_ud := valueof(t_ASP_IPA_UD(IPAC_PROTO_OSMO, payload, IPAC_PROTO_EXT_GSUP)); IPA_PORT.send(f_from_asp(g_ipa_conn_id, ipa_ud)); -- To view, visit https://gerrit.osmocom.org/6040 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4e0a9f1236504ce6026c6e34fd97fda6fefa832c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:01:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:01:33 +0000 Subject: osmo-msc[master]: Fix msc_vlr test results (.err) for new libosmocore GSM48_PD... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4421872a0d609dd50a6b911b928aa5e111d1ad24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:01:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:01:37 +0000 Subject: osmo-msc[master]: Properly reject CM Re-Establishment Request In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:01:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:01:42 +0000 Subject: osmo-msc[master]: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:01:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:01:58 +0000 Subject: osmo-msc[master]: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-2 unrelated gsup_client change -- To view, visit https://gerrit.osmocom.org/6034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:06:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:06:16 +0000 Subject: [MERGED] osmo-msc[master]: Fix msc_vlr test results (.err) for new libosmocore GSM48_PD... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix msc_vlr test results (.err) for new libosmocore GSM48_PDISC names ...................................................................... Fix msc_vlr test results (.err) for new libosmocore GSM48_PDISC names In I8de7c01f9ea1d66c384e57449c4140186f5ce6c5, libosmocore introduced shorter names in gsm48_pdisc_names, which has implications on the expected test output Change-Id: I4421872a0d609dd50a6b911b928aa5e111d1ad24 --- M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.err 8 files changed, 346 insertions(+), 346 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index fac9623..f6eef60 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -128,8 +128,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -252,16 +252,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -373,16 +373,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -566,8 +566,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -698,16 +698,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -827,16 +827,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1010,8 +1010,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1134,16 +1134,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1241,16 +1241,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1348,16 +1348,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1541,8 +1541,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1673,16 +1673,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1788,16 +1788,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1903,16 +1903,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -2086,8 +2086,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -2224,16 +2224,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -2417,8 +2417,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -2563,16 +2563,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index d17d44b..625ae61 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -269,7 +269,7 @@ DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) - MNCC says that's fine DMNCC receive message MNCC_CALL_PROC_REQ @@ -295,7 +295,7 @@ MSC --> MNCC: callref 0x80000001: MNCC_SETUP_COMPL_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) --- - RTP stream goes ahead, not shown here. @@ -309,7 +309,7 @@ MSC --> MNCC: callref 0x80000001: MNCC_DISC_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) DMNCC receive message MNCC_REL_REQ DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU @@ -614,7 +614,7 @@ - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: CC paging_stopped == 1 MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_CALL_CONF DREF MSISDN:42342: MSC conn use + dtap == 3 (0xe) @@ -625,7 +625,7 @@ DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) - Total time passed: 1.000023 s MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_ALERTING @@ -635,7 +635,7 @@ MSC --> MNCC: callref 0x423: MNCC_ALERT_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) - Total time passed: 2.000046 s MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_CC_CONNECT @@ -645,7 +645,7 @@ MSC --> MNCC: callref 0x423: MNCC_SETUP_CNF DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) DMNCC receive message MNCC_SETUP_COMPL_REQ DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU @@ -663,7 +663,7 @@ MSC --> MNCC: callref 0x423: MNCC_DISC_IND DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_CC +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: CC DREF MSISDN:42342: MSC conn use - dtap == 2 (0xc) DMNCC receive message MNCC_REL_REQ DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index bee4646..4db427f 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -61,8 +61,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -204,8 +204,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -245,16 +245,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -331,8 +331,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -366,13 +366,13 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -383,22 +383,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -509,8 +509,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -593,8 +593,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -688,8 +688,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -729,16 +729,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -815,8 +815,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -850,13 +850,13 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -867,22 +867,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1022,8 +1022,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -1161,8 +1161,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -1248,8 +1248,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1381,8 +1381,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Authen Response, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP @@ -1468,8 +1468,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1494,8 +1494,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1756,8 +1756,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -1797,16 +1797,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1883,8 +1883,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -1918,13 +1918,13 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1935,22 +1935,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index d17f5ea..da4e0b7 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -76,8 +76,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -205,8 +205,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -240,8 +240,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -264,16 +264,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -350,8 +350,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -384,8 +384,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -406,11 +406,11 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 2 (0x14) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS dtap_tx_confirmed == 1 paging_stopped == 1 - SMS was delivered, no requests pending for subscr @@ -420,22 +420,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -562,8 +562,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -632,8 +632,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -727,8 +727,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -762,8 +762,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts; above Ciphering is an implicit CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -786,16 +786,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -872,8 +872,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and requests Ciphering MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -906,8 +906,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends Ciphering Mode Complete, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL DRR MSISDN:46071: CIPHERING MODE COMPLETE @@ -928,11 +928,11 @@ DREF VLR subscr MSISDN:46071 usage increases to: 5 DREF MSISDN:46071: MSC conn use + trans_sms == 2 (0x14) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS dtap_tx_confirmed == 1 paging_stopped == 1 - SMS was delivered, no requests pending for subscr @@ -942,22 +942,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1083,8 +1083,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -1156,8 +1156,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1306,8 +1306,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 DREF VLR subscr IMSI:901700000004620 usage increases to: 2 vsub->imeisv[0] == 0 @@ -1340,8 +1340,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 - HLR sends _INSERT_DATA_REQUEST, VLR responds with _INSERT_DATA_RESULT <-- GSUP rx OSMO_GSUP_MSGT_INSERT_DATA_REQUEST: 10010809710000004026f00804036470f1 DVLR GSUP rx 17: 10010809710000004026f00804036470f1 @@ -1514,8 +1514,8 @@ DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr IMSI:901700000004620: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - MS sends Ciphering Mode Complete, VLR accepts and sends GSUP LU Req to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_RR_CIPH_M_COMPL @@ -1587,8 +1587,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1613,8 +1613,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 0132461..9c66a36 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -53,8 +53,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -159,16 +159,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -241,14 +241,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -259,22 +259,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -377,8 +377,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -422,8 +422,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -519,16 +519,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -600,14 +600,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -618,22 +618,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(50462976){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -712,8 +712,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -757,8 +757,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -888,8 +888,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -936,8 +936,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1061,8 +1061,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1109,8 +1109,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1135,8 +1135,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends TMSI Realloc Complete MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1276,8 +1276,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1434,8 +1434,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1482,8 +1482,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -1624,8 +1624,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1669,8 +1669,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 2 vsub != NULL == 1 @@ -1787,8 +1787,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -1832,8 +1832,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:46071 usage increases to: 3 vsub != NULL == 1 @@ -1980,8 +1980,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT, and we send an ID Request for the IMEI to the MS <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -2028,8 +2028,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS replies with an Identity Response MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) @@ -2054,8 +2054,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 - MS sends TMSI Realloc Complete MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_TMSI_REALL_COMPL DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 229cabe..16854d2 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -1089,16 +1089,16 @@ - a USSD request is serviced expecting USSD: Your extension is 46071 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:46071: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:46071: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:46071: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:46071: MSISDN = 46071 DMSC msc_tx 43 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d27310cd06bbc51a0d - DTAP matches expected message DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -1281,14 +1281,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1301,27 +1301,27 @@ DRLL Dispatching 04.08 message GSM48_MT_MM_LOC_UPD_REQUEST (0x5:0x8) DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) lu_result_sent == 0 llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1508,14 +1508,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1536,9 +1536,9 @@ llist_count(&net->subscr_conns) == 1 g_conn->received_cm_service_request == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP @@ -1546,12 +1546,12 @@ DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 @@ -1752,14 +1752,14 @@ DREF VLR subscr MSISDN:46071 usage increases to: 6 DREF MSISDN:46071: MSC conn use + trans_sms == 3 (0x15) DMSC msc_tx 91 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005806470f1000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 5 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF VLR subscr MSISDN:46071 usage decreases to: 4 DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - compl_l3 == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -1773,25 +1773,25 @@ DRR PAGING RESPONSE: MI(IMSI)=901700000004620 DMM 901700000004620: Error: connection already in use DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:46071: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:46071: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000004620){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:46071 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:46071 usage decreases to: 3 DREF VLR subscr MSISDN:46071 usage decreases to: 2 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index f4e5f0e..8c8d26d 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -16,8 +16,8 @@ DRLL subscr unknown: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr unknown: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr unknown: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr unknown: Message not permitted for initial conn: SMS:0x01 - fake: acceptance DREF VLR subscr unknown usage increases to: 1 DMM Subscr_Conn(test){SUBSCR_CONN_S_NEW}: state_chg to SUBSCR_CONN_S_ACCEPTED @@ -140,8 +140,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -257,8 +257,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 @@ -378,8 +378,8 @@ DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr TMSI:0x23422342: Message not permitted for initial conn: SMS:0x01 - MS tells us the IMSI, causes a GSUP LU request to HLR MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_ID_RESP DREF TMSI:0x23422342: MSC conn use + dtap == 2 (0x6) @@ -422,8 +422,8 @@ DRLL subscr MSISDN:46071: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:46071: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:46071: Message not permitted for initial conn: SMS:0x01 lu_result_sent == 0 - HLR also sends GSUP _UPDATE_LOCATION_RESULT <-- GSUP rx OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT: 06010809710000004026f0 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index 2c1741d..f519c2f 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -128,8 +128,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -217,8 +217,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts with a CM Service Accept MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -258,16 +258,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_GERAN_A-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_GERAN_A--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -345,8 +345,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends pending SMS MSC <--RAN_GERAN_A-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -380,13 +380,13 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + trans_sms == 3 (0x16) DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_GERAN_A--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) dtap_tx_confirmed == 1 paging_stopped == 1 @@ -397,22 +397,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_GERAN_A-- MS: SMS:0x04 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_GERAN_A-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_GERAN_A-- MS: SMS:0x01 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_GERAN_A -- DTAP --RAN_GERAN_A--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_GERAN_A--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -600,8 +600,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -689,8 +689,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -738,16 +738,16 @@ - a USSD request is serviced expecting USSD: Your extension is 42342 - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_NC_SS:0x3b + MSC <--RAN_UTRAN_IU-- MS: NCSS:0x3b DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) -DRLL Dispatching 04.08 message GSM48_PDISC_NC_SS:0x3b (0xb:0x3b) -DMM MSISDN:42342: rx msg GSM48_PDISC_NC_SS:0x3b: received_cm_service_request changes to false +DRLL Dispatching 04.08 message NCSS:0x3b (0xb:0x3b) +DMM MSISDN:42342: rx msg NCSS:0x3b: received_cm_service_request changes to false DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM USSD: Own number requested DMM MSISDN:42342: MSISDN = 42342 DMSC msc_tx 43 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_NC_SS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d +- DTAP --RAN_UTRAN_IU--> MS: NCSS:0x2a: 8b2a1c27a225020100302002013b301b04010f0416d9775d0e2ae3e965f73cfd7683d273104d36a3c91a0d - DTAP matches expected message DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: releasing conn @@ -825,8 +825,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - MS sends Authen Response, VLR accepts and sends SecurityModeControl MSC <--RAN_UTRAN_IU-- MS: GSM48_MT_MM_AUTH_RESP DREF MSISDN:42342: MSC conn use + dtap == 2 (0x6) @@ -872,11 +872,11 @@ DREF VLR subscr MSISDN:42342 usage increases to: 5 DREF MSISDN:42342: MSC conn use + trans_sms == 2 (0x14) DMSC msc_tx 91 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 +- DTAP --RAN_UTRAN_IU--> MS: SMS:0x01: 09015801000791447758100650004c0005802443f2000007101000000000445079da1e1ee7416937485e9ea7c965373d1d6683c270383b3d0ed3d36ff71c949e83c22072799e9687c5ec32a81d96afcbf4b4fb0c7ac3e9e9b7db05 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 4 DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: bump: connection still has active transaction: SMS paging_stopped == 1 - SMS was delivered, no requests pending for subscr DREF VLR subscr MSISDN:42342 usage increases to: 5 @@ -885,22 +885,22 @@ - conn is still open to wait for SMS ack dance llist_count(&net->subscr_conns) == 1 - MS replies with CP-ACK for received SMS - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x04 + MSC <--RAN_UTRAN_IU-- MS: SMS:0x04 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x04 (0x9:0x4) +DRLL Dispatching 04.08 message SMS:0x04 (0x9:0x4) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: Received Event SUBSCR_CONN_E_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_ACCEPTED}: state_chg to SUBSCR_CONN_S_COMMUNICATING DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_BUMP -DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: GSM48_PDISC_SMS +DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: bump: connection still has active transaction: SMS DREF MSISDN:42342: MSC conn use - dtap == 2 (0x14) llist_count(&net->subscr_conns) == 1 - MS also sends RP-ACK, MSC in turn sends CP-ACK for that - MSC <--RAN_UTRAN_IU-- MS: GSM48_PDISC_SMS:0x01 + MSC <--RAN_UTRAN_IU-- MS: SMS:0x01 DREF MSISDN:42342: MSC conn use + dtap == 3 (0x16) -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) DMM Subscr_Conn(901700000010650){SUBSCR_CONN_S_COMMUNICATING}: Received Event SUBSCR_CONN_E_COMMUNICATING DMSC msc_tx 2 bytes to MSISDN:42342 via RAN_UTRAN_IU -- DTAP --RAN_UTRAN_IU--> MS: GSM48_PDISC_SMS:0x04: 0904 +- DTAP --RAN_UTRAN_IU--> MS: SMS:0x04: 0904 - DTAP matches expected message DREF VLR subscr MSISDN:42342 usage decreases to: 3 DREF VLR subscr MSISDN:42342 usage decreases to: 2 @@ -1108,8 +1108,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 @@ -1331,8 +1331,8 @@ DRLL subscr MSISDN:42342: Message not permitted for initial conn: unknown 0x33 DRLL Dispatching 04.08 message GSM48_MT_RR_SYSINFO_1 (0x6:0x19) DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_MT_RR_SYSINFO_1 -DRLL Dispatching 04.08 message GSM48_PDISC_SMS:0x01 (0x9:0x1) -DRLL subscr MSISDN:42342: Message not permitted for initial conn: GSM48_PDISC_SMS:0x01 +DRLL Dispatching 04.08 message SMS:0x01 (0x9:0x1) +DRLL subscr MSISDN:42342: Message not permitted for initial conn: SMS:0x01 - even though the TMSI is not acked, we can already find the subscr with it DREF VLR subscr MSISDN:42342 usage increases to: 2 vsub != NULL == 1 -- To view, visit https://gerrit.osmocom.org/6047 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4421872a0d609dd50a6b911b928aa5e111d1ad24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:06:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:06:35 +0000 Subject: [MERGED] osmo-msc[master]: Properly reject CM Re-Establishment Request In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Properly reject CM Re-Establishment Request ...................................................................... Properly reject CM Re-Establishment Request Even if we're not implementing CM re-establishment, we should give the MS a clear indication that we don't do and follow the related procedures of TS 24.008 by sending CM SERVICE REJECT. Closes: OS#2869 Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e --- M src/libmsc/gsm_04_08.c 1 file changed, 22 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index ea40a96..51eb1c0 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -740,6 +740,26 @@ return 0; } +/* Receive a CM Re-establish Request */ +static int gsm48_rx_cm_reest_req(struct gsm_subscriber_connection *conn, struct msgb *msg) +{ + uint8_t mi_type; + char mi_string[GSM48_MI_SIZE]; + struct gsm48_hdr *gh = msgb_l3(msg); + + uint8_t classmark2_len = gh->data[1]; + uint8_t *classmark2 = gh->data+2; + uint8_t mi_len = *(classmark2 + classmark2_len); + uint8_t *mi = (classmark2 + classmark2_len + 1); + + gsm48_mi_to_string(mi_string, sizeof(mi_string), mi, mi_len); + mi_type = mi[0] & GSM_MI_TYPE_MASK; + DEBUGP(DMM, "<- CM RE-ESTABLISH REQUEST MI(%s)=%s\n", gsm48_mi_type_name(mi_type), mi_string); + + /* we don't support CM call re-establishment */ + return msc_gsm48_tx_mm_serv_rej(conn, GSM48_REJECT_SRV_OPT_NOT_SUPPORTED); +} + static int gsm48_rx_mm_imsi_detach_ind(struct gsm_subscriber_connection *conn, struct msgb *msg) { struct gsm_network *network = conn->network; @@ -1039,7 +1059,7 @@ rc = gsm48_rx_mm_imsi_detach_ind(conn, msg); break; case GSM48_MT_MM_CM_REEST_REQ: - DEBUGP(DMM, "CM REESTABLISH REQUEST: Not implemented\n"); + rc = gsm48_rx_cm_reest_req(conn, msg); break; case GSM48_MT_MM_AUTH_RESP: rc = gsm48_rx_mm_auth_resp(conn, msg); @@ -3187,6 +3207,7 @@ switch (msg_type) { case GSM48_MT_MM_LOC_UPD_REQUEST: case GSM48_MT_MM_CM_SERV_REQ: + case GSM48_MT_MM_CM_REEST_REQ: case GSM48_MT_MM_AUTH_RESP: case GSM48_MT_MM_AUTH_FAIL: case GSM48_MT_MM_ID_RESP: -- To view, visit https://gerrit.osmocom.org/6033 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1c0473647295456fd635b8df6079ee48695dcf2e Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:10:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:10:42 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6042 to look at the new patch set (#2). MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_TYPE Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc/MSC_ConnectionHandler.ttcn M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 5 files changed, 15 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/6042/2 diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 6efb15b..1f41434 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -58,7 +58,7 @@ function f_gen_cl3(hexstring imsi) return PDU_BSSAP { var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); - var PDU_ML3_MS_NW l3 := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3 := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellID_LAC_CI(23, 42)); var PDU_BSSAP bssap := valueof(ts_BSSMAP_ComplL3(cell_id, enc_PDU_ML3_MS_NW(l3))); return bssap; diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 39b09f6..d1be0ef 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -87,7 +87,7 @@ function f_create_chan_and_exp(TestHdlrParams pars) runs on MSC_ConnHdlr { var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info); /* call helper function for CHAN_RQD -> IMM ASS ->EST_IND */ diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index c603b7b..f23c8fa 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -23,7 +23,10 @@ CM_TYPE_MO_CALL ('0001'B), CM_TYPE_EMERG_CALL ('0010'B), CM_TYPE_MO_SMS ('0100'B), - CM_TYPE_SS_ACT ('1000'B) + CM_TYPE_SS_ACT ('1000'B), + CM_TYPE_VGCS ('1001'B), + CM_TYPE_VBS ('1010'B), + CM_TYPE_LCS ('1011'B) } @@ -104,7 +107,7 @@ }; /* Send template for CM SERVICE REQUEST */ -template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(BIT4 serv_type, MobileIdentityLV mi_lv) := { +template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, MobileIdentityLV mi_lv) := { discriminator := '0000'B, /* overwritten */ tiOrSkip := { skipIndicator := '0000'B @@ -114,7 +117,7 @@ cMServiceRequest := { messageType := '000000'B, /* overwritten */ nsd := '00'B, - cm_ServiceType := serv_type, + cm_ServiceType := int2bit(enum2int(serv_type), 4), cipheringKeySequenceNumber := { '000'B, '0'B }, mobileStationClassmark2 := ts_CM2, mobileIdentity := mi_lv, diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 25f8daf..330f25a 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -101,7 +101,7 @@ /* helper function to fully establish a dedicated channel */ function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) runs on BSC_ConnHdlr { - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5976b45..566999b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -475,7 +475,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -858,7 +858,7 @@ /* helper function for an emergency call. caller passes in mobile identity to use */ private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); @@ -905,7 +905,7 @@ g_pars := pars; var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); setverdict(pass); @@ -943,7 +943,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); @@ -964,7 +964,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); @@ -985,7 +985,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1011'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:18 +0000 Subject: osmo-ttcn3-hacks[master]: msc: TC_lu_imsi_auth_tmsi_encr_13_13 In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8a8a5c55d87bb251896664679920b96f678673a0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:20 +0000 Subject: osmo-ttcn3-hacks[master]: msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I54ef4137c0b95658b1e844ac1bb13729f27fd0d1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:21 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7d15b935caed2dacf39d66a33ff933a9b8c443d9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:23 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Wait for proper BSSAP connection clear after CM SERV REJ In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8fc0e61c7f8f31ca4dd21a243e00ef688ff38c6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:24 +0000 Subject: osmo-ttcn3-hacks[master]: MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:26 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_TYPE ...................................................................... MSC_Tests: Use enum instead of magic numbers for CM_SERVICE_TYPE Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 --- M bsc-nat/BSC_MS_ConnectionHandler.ttcn M bsc/MSC_ConnectionHandler.ttcn M library/L3_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 5 files changed, 15 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc-nat/BSC_MS_ConnectionHandler.ttcn b/bsc-nat/BSC_MS_ConnectionHandler.ttcn index 6efb15b..1f41434 100644 --- a/bsc-nat/BSC_MS_ConnectionHandler.ttcn +++ b/bsc-nat/BSC_MS_ConnectionHandler.ttcn @@ -58,7 +58,7 @@ function f_gen_cl3(hexstring imsi) return PDU_BSSAP { var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); - var PDU_ML3_MS_NW l3 := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3 := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellID_LAC_CI(23, 42)); var PDU_BSSAP bssap := valueof(ts_BSSMAP_ComplL3(cell_id, enc_PDU_ML3_MS_NW(l3))); return bssap; diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 39b09f6..d1be0ef 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -87,7 +87,7 @@ function f_create_chan_and_exp(TestHdlrParams pars) runs on MSC_ConnHdlr { var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var octetstring l3_enc := enc_PDU_ML3_MS_NW(l3_info); /* call helper function for CHAN_RQD -> IMM ASS ->EST_IND */ diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index c603b7b..f23c8fa 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -23,7 +23,10 @@ CM_TYPE_MO_CALL ('0001'B), CM_TYPE_EMERG_CALL ('0010'B), CM_TYPE_MO_SMS ('0100'B), - CM_TYPE_SS_ACT ('1000'B) + CM_TYPE_SS_ACT ('1000'B), + CM_TYPE_VGCS ('1001'B), + CM_TYPE_VBS ('1010'B), + CM_TYPE_LCS ('1011'B) } @@ -104,7 +107,7 @@ }; /* Send template for CM SERVICE REQUEST */ -template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(BIT4 serv_type, MobileIdentityLV mi_lv) := { +template (value) PDU_ML3_MS_NW ts_CM_SERV_REQ(CmServiceType serv_type, MobileIdentityLV mi_lv) := { discriminator := '0000'B, /* overwritten */ tiOrSkip := { skipIndicator := '0000'B @@ -114,7 +117,7 @@ cMServiceRequest := { messageType := '000000'B, /* overwritten */ nsd := '00'B, - cm_ServiceType := serv_type, + cm_ServiceType := int2bit(enum2int(serv_type), 4), cipheringKeySequenceNumber := { '000'B, '0'B }, mobileStationClassmark2 := ts_CM2, mobileIdentity := mi_lv, diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 25f8daf..330f25a 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -101,7 +101,7 @@ /* helper function to fully establish a dedicated channel */ function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) runs on BSC_ConnHdlr { - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5976b45..566999b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -475,7 +475,7 @@ var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -858,7 +858,7 @@ /* helper function for an emergency call. caller passes in mobile identity to use */ private function f_emerg_call(MobileIdentityLV mi) runs on BSC_ConnHdlr { - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); @@ -905,7 +905,7 @@ g_pars := pars; var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('0010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); setverdict(pass); @@ -943,7 +943,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1001'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); @@ -964,7 +964,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1010'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); @@ -985,7 +985,7 @@ f_perform_lu(false, true, true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); - var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ('1011'B, mi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6042 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic90b4a0aa47821877a2d3566606b9c9dd5919968 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:27 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Wait for proper BSSAP connection clear after CM SERV REJ In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Wait for proper BSSAP connection clear after CM SERV REJ ...................................................................... msc: Wait for proper BSSAP connection clear after CM SERV REJ Change-Id: Ia8fc0e61c7f8f31ca4dd21a243e00ef688ff38c6 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 566999b..b318aa9 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -908,6 +908,9 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_emerg_call_imei_reject() runs on MTC_CT { @@ -930,6 +933,7 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 18); vc_conn.done; @@ -946,11 +950,16 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 19); vc_conn.done; @@ -967,11 +976,16 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 20); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/6043 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8fc0e61c7f8f31ca4dd21a243e00ef688ff38c6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:27 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be rejected ...................................................................... msc: Add TC_cm_reest_req_reject: Expect CM RE-EST REQ to be rejected Change-Id: I7d15b935caed2dacf39d66a33ff933a9b8c443d9 --- M library/L3_Templates.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 60 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index f23c8fa..7836555 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -129,6 +129,34 @@ } } +template (value) CipheringKeySequenceNumberV ts_CKSN(integer key_seq) := { + keySequence := int2bit(key_seq, 3), + spare := '0'B +} + +/* Send template for CM RE-ESTABLISH REQUEST */ +template (value) PDU_ML3_MS_NW ts_CM_REEST_REQ(integer cksn, MobileIdentityLV mi_lv) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + mm := { + cMReEstablReq := { + messageType := '101000'B, /* overwritten */ + nsd := '00'B, + cipheringKeySequenceNumber := ts_CKSN(cksn), + spare := '0000'B, + mobileStationClassmark2 := ts_CM2, + mobileIdentityLV := mi_lv, + locationAreaIdentification := omit, + deviceProperties := omit + } + } + } +} + + template PDU_ML3_NW_MS tr_MT_simple(template BIT4 discr := ?) := { discriminator := discr, tiOrSkip := { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index b318aa9..b1a7d1b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1002,13 +1002,44 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); setverdict(pass); } testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 21); + vc_conn.done; +} + +/* CM Re-Establishment Request */ +private function f_tc_cm_reest_req_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* First perform location update to ensure subscriber is known */ + f_perform_lu(false, true, true); + + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); + f_bssap_compl_l3(l3_info); + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_cm_reest_req_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + + vc_conn := f_start_handler(refers(f_tc_cm_reest_req_reject), testcasename(), 22); vc_conn.done; } @@ -1049,6 +1080,7 @@ execute( TC_cm_serv_req_vgcs_reject() ); execute( TC_cm_serv_req_vbs_reject() ); execute( TC_cm_serv_req_lcs_reject() ); + execute( TC_cm_reest_req_reject() ); } -- To view, visit https://gerrit.osmocom.org/6044 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7d15b935caed2dacf39d66a33ff933a9b8c443d9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:27 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth ...................................................................... msc: TC_lu_auth_2G_fail: Test auth failure in 2G auth Change-Id: I54ef4137c0b95658b1e844ac1bb13729f27fd0d1 --- M library/GSUP_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 47 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index a8134eb..7f239ca 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -243,6 +243,9 @@ tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { tr_GSUP_IE_IMSI(imsi), * }); +template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := + tr_GSUP(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, { + tr_GSUP_IE_IMSI(imsi), * }); template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index b1a7d1b..367cd79 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1043,6 +1043,50 @@ vc_conn.done; } +/* Test LU (with authentication enabled), with wrong response from MS */ +private function f_tc_lu_auth_2G_fail(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) + + /* tell GSUP dispatcher to send this IMSI to us */ + f_create_gsup_expect(hex2str(g_pars.imsi)); + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_lu); + + /* Send Early Classmark, just for the fun of it */ + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + + var AuthVector vec := f_gen_auth_vec_2g(); + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); + /* Send back wrong auth response */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G('00000000'O))); + + /* Expect GSUP AUTH FAIL REP to HLR */ + GSUP.receive(tr_GSUP_AUTH_FAIL_IND(g_pars.imsi)); + + /* Expect LU REJECT with Cause == Illegal MS */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej('03'O))); + BSSAP.receive(tr_BSSMAP_ClearCommand); + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); +} +testcase TC_lu_auth_2G_fail() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + + vc_conn := f_start_handler(refers(f_tc_lu_auth_2G_fail), testcasename(), 23); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6045 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54ef4137c0b95658b1e844ac1bb13729f27fd0d1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:11:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:11:28 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: TC_lu_imsi_auth_tmsi_encr_13_13 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: TC_lu_imsi_auth_tmsi_encr_13_13 ...................................................................... msc: TC_lu_imsi_auth_tmsi_encr_13_13 Add a first test for encryption (cipher mode command/complete) Change-Id: I8a8a5c55d87bb251896664679920b96f678673a0 --- M library/BSSMAP_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 3 files changed, 68 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 5331505..33c370e 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -367,6 +367,14 @@ key := kc } +template BSSMAP_IE_EncryptionInformation tr_BSSMAP_IE_EncrInfo(template OCT8 kc := ?, template OCT1 algs := ?) := { + elementIdentifier := '0A'O, + lengthIndicator := ?, /* overwritten */ + permittedAlgorithms := algs, + key := kc +} + + template (value) BSSMAP_IE_CircuitIdentityCode ts_BSSMAP_IE_CIC(uint11_t span, uint5_t ts) := { elementIdentifier := '01'O, /* overwritten */ @@ -748,6 +756,37 @@ } } +template PDU_BSSAP tr_BSSMAP_CipherModeCmd(template OCT1 alg, template OCT8 key) +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + cipherModeCommand := { + messageType := '53'O, + layer3HeaderInfo := *, + encryptionInformation := tr_BSSMAP_IE_EncrInfo(key, alg), + cipherResponseMode := *, + kC128 := * + } + } + } +} + +template PDU_BSSAP ts_BSSMAP_CipherModeCompl(OCT1 alg) +modifies ts_BSSAP_BSSMAP := { + pdu := { + bssmap := { + cipherModeComplete := { + messageType := '55'O, + layer3MessageContents := omit, + chosenEncryptionAlgorithm := { + elementIdentifier := '2C'O, + algorithmIdentifier := alg + } + } + } + } +} + template PDU_BSSAP tr_BSSMAP_CipherModeCompl(template OCT1 alg := ?) modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 330f25a..656fb4e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -33,7 +33,8 @@ hexstring msisdn, OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, - BSSMAP_IE_ClassmarkInformationType3 cm3 optional + BSSMAP_IE_ClassmarkInformationType3 cm3 optional, + octetstring kc optional }; @@ -161,10 +162,12 @@ return vec; } -function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm) +function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm, + boolean expect_ciph := false) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; + var AuthVector vec; /* tell GSUP dispatcher to send this IMSI to us */ f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -177,7 +180,7 @@ } if (expect_auth) { - var AuthVector vec := f_gen_auth_vec_2g(); + vec := f_gen_auth_vec_2g(); var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); @@ -186,6 +189,12 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(vec.sres))); } + if (expect_ciph) { + BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, vec.kc)); + g_pars.kc := vec.kc; + BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); + } + /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); GSUP.send(ts_GSUP_ISD_REQ(g_pars.imsi, g_pars.msisdn)); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 367cd79..74d1b93 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -331,7 +331,8 @@ msisdn := f_gen_msisdn(imsi_suffix), tmsi := omit, cm2 := valueof(ts_CM2_default), - cm3 := omit + cm3 := omit, + kc := omit }; vc_conn := BSC_ConnHdlr.create(id); @@ -1087,6 +1088,21 @@ vc_conn.done; } +private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + f_perform_lu(true, true, true, true); +} +testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + f_vty_config(MSCVTY, "network", "encryption a5 1 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_13), testcasename(), 24); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8a8a5c55d87bb251896664679920b96f678673a0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:12:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:12:46 +0000 Subject: [PATCH] osmo-msc[master]: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6034 to look at the new patch set (#3). msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message According to TS 44.008 Section 3.2.1.31, the "Layer 3 Message Contents" IE of the BSSMAP Cipher Mode Complete is optional. The BSC may hence inlcude that IE or not include it. Without this patch, OsmoMSC is crashing if that IE was missing: <000a> a_iface_bssap.c:699 Rx BSC DT: 00 03 55 2c 02 <000a> a_iface_bssap.c:629 Rx MSC DT1 BSSMAP CIPHER MODE COMPLETE <001f> a_iface_bssap.c:91 Found A subscriber for conn_id 1 <000a> a_iface_bssap.c:415 BSC sends cipher mode complete (conn_id=1) ==5611== Invalid read of size 8 ==5611== at 0x128D0F: msc_cipher_mode_compl (osmo_msc.c:159) ==5611== by 0x114F62: bssmap_rx_ciph_compl.isra.8 (a_iface_bssap.c:432) ==5611== by 0x113267: sccp_sap_up (a_iface.c:520) Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Closes: OS#2871 --- M src/libmsc/osmo_msc.c 1 file changed, 26 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/34/6034/3 diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 2a868a8..755f8aa 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -156,43 +156,43 @@ void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t alg_id) { - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - uint8_t mi_type; - char imeisv[GSM48_MI_SIZE] = ""; struct vlr_ciph_result ciph_res = { .cause = VLR_CIPH_REJECT }; - if (!gh) { - LOGP(DRR, LOGL_ERROR, "invalid: msgb without l3 header\n"); - return; - } - if (!conn) { - LOGP(DRR, LOGL_ERROR, - "invalid: rx Ciphering Mode Complete on NULL conn\n"); + LOGP(DRR, LOGL_ERROR, "invalid: rx Ciphering Mode Complete on NULL conn\n"); return; } if (!conn->vsub) { - LOGP(DRR, LOGL_ERROR, - "invalid: rx Ciphering Mode Complete for NULL subscr\n"); + LOGP(DRR, LOGL_ERROR, "invalid: rx Ciphering Mode Complete for NULL subscr\n"); return; } - DEBUGP(DRR, "%s: CIPHERING MODE COMPLETE\n", - vlr_subscr_name(conn->vsub)); + DEBUGP(DRR, "%s: CIPHERING MODE COMPLETE\n", vlr_subscr_name(conn->vsub)); - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + if (msg) { + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + uint8_t mi_type; + char imeisv[GSM48_MI_SIZE] = ""; - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { - mi_type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & GSM_MI_TYPE_MASK; - if (mi_type == GSM_MI_TYPE_IMEISV - && TLVP_LEN(&tp, GSM48_IE_MOBILE_ID) > 0) { - gsm48_mi_to_string(imeisv, sizeof(imeisv), - TLVP_VAL(&tp, GSM48_IE_MOBILE_ID), - TLVP_LEN(&tp, GSM48_IE_MOBILE_ID)); - ciph_res.imeisv = imeisv; + if (!gh) { + LOGP(DRR, LOGL_ERROR, "invalid: msgb without l3 header\n"); + return; + } + + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { + mi_type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & GSM_MI_TYPE_MASK; + if (mi_type == GSM_MI_TYPE_IMEISV + && TLVP_LEN(&tp, GSM48_IE_MOBILE_ID) > 0) { + gsm48_mi_to_string(imeisv, sizeof(imeisv), + TLVP_VAL(&tp, GSM48_IE_MOBILE_ID), + TLVP_LEN(&tp, GSM48_IE_MOBILE_ID)); + ciph_res.imeisv = imeisv; + } } } -- To view, visit https://gerrit.osmocom.org/6034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:13:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:13:02 +0000 Subject: osmo-msc[master]: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:30:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:30:12 +0000 Subject: [MERGED] osmo-msc[master]: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message ...................................................................... msc_cipher_mode_compl: Handle CIPH MOD COMPL without L3 message According to TS 44.008 Section 3.2.1.31, the "Layer 3 Message Contents" IE of the BSSMAP Cipher Mode Complete is optional. The BSC may hence inlcude that IE or not include it. Without this patch, OsmoMSC is crashing if that IE was missing: <000a> a_iface_bssap.c:699 Rx BSC DT: 00 03 55 2c 02 <000a> a_iface_bssap.c:629 Rx MSC DT1 BSSMAP CIPHER MODE COMPLETE <001f> a_iface_bssap.c:91 Found A subscriber for conn_id 1 <000a> a_iface_bssap.c:415 BSC sends cipher mode complete (conn_id=1) ==5611== Invalid read of size 8 ==5611== at 0x128D0F: msc_cipher_mode_compl (osmo_msc.c:159) ==5611== by 0x114F62: bssmap_rx_ciph_compl.isra.8 (a_iface_bssap.c:432) ==5611== by 0x113267: sccp_sap_up (a_iface.c:520) Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Closes: OS#2871 --- M src/libmsc/osmo_msc.c 1 file changed, 26 insertions(+), 26 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/osmo_msc.c b/src/libmsc/osmo_msc.c index 2a868a8..755f8aa 100644 --- a/src/libmsc/osmo_msc.c +++ b/src/libmsc/osmo_msc.c @@ -156,43 +156,43 @@ void msc_cipher_mode_compl(struct gsm_subscriber_connection *conn, struct msgb *msg, uint8_t alg_id) { - struct gsm48_hdr *gh = msgb_l3(msg); - unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); - struct tlv_parsed tp; - uint8_t mi_type; - char imeisv[GSM48_MI_SIZE] = ""; struct vlr_ciph_result ciph_res = { .cause = VLR_CIPH_REJECT }; - if (!gh) { - LOGP(DRR, LOGL_ERROR, "invalid: msgb without l3 header\n"); - return; - } - if (!conn) { - LOGP(DRR, LOGL_ERROR, - "invalid: rx Ciphering Mode Complete on NULL conn\n"); + LOGP(DRR, LOGL_ERROR, "invalid: rx Ciphering Mode Complete on NULL conn\n"); return; } if (!conn->vsub) { - LOGP(DRR, LOGL_ERROR, - "invalid: rx Ciphering Mode Complete for NULL subscr\n"); + LOGP(DRR, LOGL_ERROR, "invalid: rx Ciphering Mode Complete for NULL subscr\n"); return; } - DEBUGP(DRR, "%s: CIPHERING MODE COMPLETE\n", - vlr_subscr_name(conn->vsub)); + DEBUGP(DRR, "%s: CIPHERING MODE COMPLETE\n", vlr_subscr_name(conn->vsub)); - tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + if (msg) { + struct gsm48_hdr *gh = msgb_l3(msg); + unsigned int payload_len = msgb_l3len(msg) - sizeof(*gh); + struct tlv_parsed tp; + uint8_t mi_type; + char imeisv[GSM48_MI_SIZE] = ""; - /* bearer capability */ - if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { - mi_type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & GSM_MI_TYPE_MASK; - if (mi_type == GSM_MI_TYPE_IMEISV - && TLVP_LEN(&tp, GSM48_IE_MOBILE_ID) > 0) { - gsm48_mi_to_string(imeisv, sizeof(imeisv), - TLVP_VAL(&tp, GSM48_IE_MOBILE_ID), - TLVP_LEN(&tp, GSM48_IE_MOBILE_ID)); - ciph_res.imeisv = imeisv; + if (!gh) { + LOGP(DRR, LOGL_ERROR, "invalid: msgb without l3 header\n"); + return; + } + + tlv_parse(&tp, &gsm48_att_tlvdef, gh->data, payload_len, 0, 0); + + /* bearer capability */ + if (TLVP_PRESENT(&tp, GSM48_IE_MOBILE_ID)) { + mi_type = TLVP_VAL(&tp, GSM48_IE_MOBILE_ID)[0] & GSM_MI_TYPE_MASK; + if (mi_type == GSM_MI_TYPE_IMEISV + && TLVP_LEN(&tp, GSM48_IE_MOBILE_ID) > 0) { + gsm48_mi_to_string(imeisv, sizeof(imeisv), + TLVP_VAL(&tp, GSM48_IE_MOBILE_ID), + TLVP_LEN(&tp, GSM48_IE_MOBILE_ID)); + ciph_res.imeisv = imeisv; + } } } -- To view, visit https://gerrit.osmocom.org/6034 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I722f9b468b157b3736918f090daaa9489a6028ee Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:31:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:31:23 +0000 Subject: [PATCH] osmo-msc[master]: remove traces of bsc_subscriber In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6032 to look at the new patch set (#3). remove traces of bsc_subscriber Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 --- M include/osmocom/msc/gsm_data.h M src/libcommon-cs/common_cs.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 14 files changed, 72 insertions(+), 91 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/32/6032/3 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1b0bff9..2b01a34 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -26,7 +26,6 @@ struct mncc_sock_state; struct gsm_subscriber_group; -struct bsc_subscr; struct vlr_instance; struct vlr_subscr; struct ranap_ue_conn_ctx; @@ -144,9 +143,6 @@ /* The MS has opened the conn with a CM Service Request, and we shall * keep it open for an actual request (or until timeout). */ bool received_cm_service_request; - - /* libbsc subscriber information (if available) */ - struct bsc_subscr *bsub; /* libmsc/libvlr subscriber information (if available) */ struct vlr_subscr *vsub; @@ -445,14 +441,6 @@ * OsmoMSC, this should be tied to the location area code (LAC). */ struct gsm_tz tz; - /* List of all struct bsc_subscr used in libbsc. This llist_head is - * allocated so that the llist_head pointer itself can serve as a - * talloc context (useful to not have to pass the entire gsm_network - * struct to the bsc_subscr_* API, and for bsc_susbscr unit tests to - * not require gsm_data.h). In an MSC-without-BSC environment, this - * pointer is NULL to indicate absence of a bsc_subscribers list. */ - struct llist_head *bsc_subscribers; - /* MSC: GSUP server address of the HLR */ const char *gsup_server_addr_str; uint16_t gsup_server_port; @@ -556,9 +544,6 @@ int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); -void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 4748865..41c456e 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -66,9 +66,6 @@ INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); - net->bsc_subscribers = talloc_zero(net, struct llist_head); - INIT_LLIST_HEAD(net->bsc_subscribers); - /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); if (!net->msc_ctrs) { diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index f6eef60..a161e3a 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -424,7 +424,7 @@ ===== test_auth_use_twice_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_auth_use_twice_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -878,7 +878,7 @@ ===== test_auth_use_twice_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_auth_use_infinitely_geran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1399,7 +1399,7 @@ ===== test_auth_use_infinitely_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_auth_use_infinitely_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1954,7 +1954,7 @@ ===== test_auth_use_infinitely_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_auth_reuse_geran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -2275,7 +2275,7 @@ ===== test_no_auth_reuse_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_auth_reuse_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -2614,8 +2614,8 @@ ===== test_no_auth_reuse_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index 625ae61..7b4c72e 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -345,7 +345,7 @@ ===== test_call_mo: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_call_mt - Total time passed: 0.000000 s @@ -699,8 +699,8 @@ ===== test_call_mt: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 4db427f..885d799 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -444,7 +444,7 @@ ===== test_gsm_authen: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_authen_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1096,7 +1096,7 @@ ===== test_gsm_authen_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_authen_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1316,7 +1316,7 @@ ===== test_gsm_authen_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_authen_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1567,7 +1567,7 @@ ===== test_gsm_authen_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_milenage_authen - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1996,8 +1996,8 @@ ===== test_gsm_milenage_authen: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index da4e0b7..53273e3 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -481,7 +481,7 @@ ===== test_ciph: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1003,7 +1003,7 @@ ===== test_ciph_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1224,7 +1224,7 @@ ===== test_ciph_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_imeisv - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1434,7 +1434,7 @@ ===== test_ciph_imeisv: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1686,8 +1686,8 @@ ===== test_ciph_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index 812eb3b..0d189e8 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -72,7 +72,7 @@ ===== test_hlr_rej_auth_info_unknown_imsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_net_fail - Location Update request causes a GSUP Send Auth Info request to HLR @@ -148,7 +148,7 @@ ===== test_hlr_rej_auth_info_net_fail: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_net_fail_reuse_tuples --- @@ -451,7 +451,7 @@ ===== test_hlr_rej_auth_info_net_fail_reuse_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples --- @@ -679,7 +679,7 @@ ===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples --- @@ -908,7 +908,7 @@ ===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_acc_but_no_auth_tuples - Location Update request causes a GSUP Send Auth Info request to HLR @@ -983,7 +983,7 @@ ===== test_hlr_acc_but_no_auth_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_lu - Location Update request causes a GSUP LU request to HLR @@ -1061,7 +1061,7 @@ ===== test_hlr_rej_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_no_insert_data - Location Update request causes a GSUP LU request to HLR @@ -1162,8 +1162,8 @@ ===== test_hlr_no_insert_data: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index 439dc72..79eecf4 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -80,7 +80,7 @@ ===== test_hlr_timeout_lu_auth_info: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_timeout_lu_upd_loc_result - Total time passed: 0.000000 s @@ -183,8 +183,8 @@ ===== test_hlr_timeout_lu_upd_loc_result: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 4abcc18..7731bcb 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -100,7 +100,7 @@ ===== test_ms_timeout_lu_auth_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ms_timeout_cm_auth_resp - Total time passed: 0.000000 s @@ -336,7 +336,7 @@ ===== test_ms_timeout_cm_auth_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ms_timeout_paging - Total time passed: 0.000000 s @@ -519,8 +519,8 @@ ===== test_ms_timeout_paging: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 9c66a36..c12e8ec 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -320,7 +320,7 @@ ===== test_no_authen: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_tmsi - Location Update request causes a GSUP LU request to HLR @@ -831,7 +831,7 @@ ===== test_no_authen_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imei - Location Update request causes a GSUP LU request to HLR @@ -1004,7 +1004,7 @@ ===== test_no_authen_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_tmsi_imei - Location Update request causes a GSUP LU request to HLR @@ -1202,7 +1202,7 @@ ===== test_no_authen_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv - Location Update request causes an IMEISV ID request back to the MS @@ -1360,7 +1360,7 @@ ===== test_no_authen_imeisv: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv_imei - Location Update request causes an IMEISV ID request back to the MS @@ -1550,7 +1550,7 @@ ===== test_no_authen_imeisv_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv_tmsi - Location Update request causes an IMEISV ID request back to the MS @@ -1906,7 +1906,7 @@ ===== test_no_authen_imeisv_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv_tmsi_imei - Location Update request causes an IMEISV ID request back to the MS @@ -2122,8 +2122,8 @@ ===== test_no_authen_imeisv_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 16854d2..aef8f72 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -152,7 +152,7 @@ ===== test_reject_2nd_conn: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_lu_during_lu - Location Update Request @@ -277,7 +277,7 @@ ===== test_reject_lu_during_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_cm_during_lu - Location Update Request @@ -408,7 +408,7 @@ ===== test_reject_cm_during_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_paging_resp_during_lu - Location Update Request @@ -534,7 +534,7 @@ ===== test_reject_paging_resp_during_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_lu_during_cm --- @@ -727,7 +727,7 @@ ===== test_reject_lu_during_cm: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_cm_during_cm --- @@ -922,7 +922,7 @@ ===== test_reject_cm_during_cm: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_paging_resp_during_cm --- @@ -1123,7 +1123,7 @@ ===== test_reject_paging_resp_during_cm: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_lu_during_paging_resp --- @@ -1350,7 +1350,7 @@ ===== test_reject_lu_during_paging_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_accept_cm_during_paging_resp --- @@ -1594,7 +1594,7 @@ ===== test_accept_cm_during_paging_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_paging_resp_during_paging_resp --- @@ -1820,8 +1820,8 @@ ===== test_reject_paging_resp_during_paging_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index 8c8d26d..31e3cfe 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -40,7 +40,7 @@ ===== test_early_stage: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_cm_service_without_lu - CM Service Request without a prior Location Updating @@ -83,7 +83,7 @@ ===== test_cm_service_without_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_two_lu - Location Update request causes a GSUP LU request to HLR @@ -340,7 +340,7 @@ ===== test_two_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_lu_unknown_tmsi - Location Update request with unknown TMSI sends ID Request for IMSI @@ -489,8 +489,8 @@ ===== test_lu_unknown_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index f519c2f..a503822 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -458,7 +458,7 @@ ===== test_umts_authen_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_umts_authen_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -946,7 +946,7 @@ ===== test_umts_authen_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_umts_authen_resync_geran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1159,7 +1159,7 @@ ===== test_umts_authen_resync_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_umts_authen_resync_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1382,8 +1382,8 @@ ===== test_umts_authen_resync_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index ac850b3..cf9122b 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -717,14 +717,13 @@ talloc_report_full(msgb_ctx, stderr); /* Expecting these to stick around in tall_bsc_ctx: full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 -full talloc report on 'subscr_conn_test_ctx' (total 2658 bytes in 9 blocks) +talloc_total_blocks(tall_bsc_ctx) == 8 +full talloc report on 'subscr_conn_test_ctx' (total 2642 bytes in 8 blocks) struct gsup_client contains 248 bytes in 1 blocks (ref 0) 0x61300000dee0 struct gsm_network contains 2410 bytes in 6 blocks (ref 0) 0x61700000fce0 struct vlr_instance contains 160 bytes in 1 blocks (ref 0) 0x611000009a60 no_gsup_server contains 15 bytes in 1 blocks (ref 0) 0x60b00000ade0 ../../../src/libosmocore/src/rate_ctr.c:199 contains 1552 bytes in 1 blocks (ref 0) 0x61b00001eae0 - struct llist_head contains 16 bytes in 1 blocks (ref 0) 0x60b00000ae90 .* contains 3 bytes in 1 blocks (ref 0) 0x60b00000af40 msgb contains 0 bytes in 1 blocks (ref 0) 0x60800000bf80 */ @@ -804,7 +803,7 @@ if (cmdline_opts.verbose) fprintf(stderr, "(test nr %d)\n", test_nr + 1); - check_talloc(msgb_ctx, tall_bsc_ctx, 9); + check_talloc(msgb_ctx, tall_bsc_ctx, 8); } while(0); } @@ -870,6 +869,6 @@ talloc_free(the_bts); - check_talloc(msgb_ctx, tall_bsc_ctx, 9); + check_talloc(msgb_ctx, tall_bsc_ctx, 8); return 0; } -- To view, visit https://gerrit.osmocom.org/6032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:31:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:31:24 +0000 Subject: [PATCH] osmo-msc[master]: remove unused paging.h and osmo_bsc_grace.h Message-ID: Review at https://gerrit.osmocom.org/6048 remove unused paging.h and osmo_bsc_grace.h Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/osmo_bsc_grace.h D include/osmocom/msc/paging.h M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/silent_call.c M src/libmsc/transaction.c 8 files changed, 0 insertions(+), 118 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/48/6048/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 61c915a..82e8207 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -42,13 +42,11 @@ oap_client.h \ openbscdefines.h \ osmo_bsc.h \ - osmo_bsc_grace.h \ a_reset.h \ osmo_msc.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ osmux.h \ - paging.h \ rrlp.h \ rs232.h \ rtp_proxy.h \ diff --git a/include/osmocom/msc/osmo_bsc_grace.h b/include/osmocom/msc/osmo_bsc_grace.h deleted file mode 100644 index 6232ffd..0000000 --- a/include/osmocom/msc/osmo_bsc_grace.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) 2010-2013 by Holger Hans Peter Freyther - * (C) 2010-2013 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef OSMO_BSC_GRACE_H -#define OSMO_BSC_GRACE_H - -#include -#include - -struct bsc_msc_data; - -int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts); -int bsc_grace_paging_request(enum signal_rf rf_policy, - struct bsc_subscr *subscr, - int chan_needed, - struct bsc_msc_data *msc); - -#endif diff --git a/include/osmocom/msc/paging.h b/include/osmocom/msc/paging.h deleted file mode 100644 index b856dcd..0000000 --- a/include/osmocom/msc/paging.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Paging helper and manager.... */ -/* (C) 2009 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - */ - -#ifndef PAGING_H -#define PAGING_H - -#include -#include - -#include -#include - -#include - -/** - * A pending paging request - */ -struct gsm_paging_request { - /* list_head for list of all paging requests */ - struct llist_head entry; - /* the subscriber which we're paging. Later gsm_paging_request - * should probably become a part of the bsc_subsrc struct? */ - struct bsc_subscr *bsub; - /* back-pointer to the BTS on which we are paging */ - struct gsm_bts *bts; - /* what kind of channel type do we ask the MS to establish */ - int chan_type; - - /* Timer 3113: how long do we try to page? */ - struct osmo_timer_list T3113; - - /* How often did we ask the BTS to page? */ - int attempts; - - /* callback to be called in case paging completes */ - gsm_cbfn *cbfn; - void *cbfn_param; -}; - -/* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, - int type, gsm_cbfn *cbfn, void *data); -int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, - int type, gsm_cbfn *cbfn, void *data); - -/* stop paging requests */ -void paging_request_stop(struct llist_head *bts_list, - struct gsm_bts *_bts, struct bsc_subscr *bsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg); - -/* update paging load */ -void paging_update_buffer_space(struct gsm_bts *bts, uint16_t); - -/* pending paging requests */ -unsigned int paging_pending_requests_nr(struct gsm_bts *bts); - -void *paging_get_data(struct gsm_bts *bts, struct bsc_subscr *bsub); - -#endif diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 51eb1c0..956bc44 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 50242a6..d8d77e9 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 1a7bf59..4838027 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index a99f218..d715d5c 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 4dcd24d..f500326 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/6048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 22:31:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 22:31:24 +0000 Subject: [PATCH] osmo-msc[master]: debug: Remove code for filters that don't exist in OsmoMSC Message-ID: Review at https://gerrit.osmocom.org/6049 debug: Remove code for filters that don't exist in OsmoMSC We don't have BSC or GPRS related logging filters here. This is a leftover from the NITB->MSC split Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094 --- M include/osmocom/msc/gsm_04_08.h M src/libcommon/debug.c 2 files changed, 0 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/49/6049/1 diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h index c99fc86..914b3e9 100644 --- a/include/osmocom/msc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -14,7 +14,6 @@ struct gsm_subscriber_connection; struct amr_multirate_conf; struct amr_mode; -struct bsc_subscr; #define GSM48_ALLOC_SIZE 2048 #define GSM48_ALLOC_HEADROOM 256 diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 612e215..661eb66 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -200,26 +200,9 @@ static int filter_fn(const struct log_context *ctx, struct log_target *tar) { const struct vlr_subscr *vsub = ctx->ctx[LOG_CTX_VLR_SUBSCR]; - const struct bsc_subscr *bsub = ctx->ctx[LOG_CTX_BSC_SUBSCR]; - const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC]; - const struct gprs_nsvc *bvc = ctx->ctx[LOG_CTX_GB_BVC]; if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0 && vsub && vsub == tar->filter_data[LOG_FLT_VLR_SUBSCR]) - return 1; - - if ((tar->filter_map & (1 << LOG_FLT_BSC_SUBSCR)) != 0 - && bsub && bsub == tar->filter_data[LOG_FLT_BSC_SUBSCR]) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0 - && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC])) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0 - && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC])) return 1; return 0; -- To view, visit https://gerrit.osmocom.org/6049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:09:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:09:17 +0000 Subject: osmo-msc[master]: remove traces of bsc_subscriber In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:09:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:09:20 +0000 Subject: osmo-msc[master]: debug: Remove code for filters that don't exist in OsmoMSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:09:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:09:30 +0000 Subject: osmo-msc[master]: remove unused paging.h and osmo_bsc_grace.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:09:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:09:35 +0000 Subject: [MERGED] osmo-msc[master]: remove unused paging.h and osmo_bsc_grace.h In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove unused paging.h and osmo_bsc_grace.h ...................................................................... remove unused paging.h and osmo_bsc_grace.h Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/osmo_bsc_grace.h D include/osmocom/msc/paging.h M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_subscriber.c M src/libmsc/silent_call.c M src/libmsc/transaction.c 8 files changed, 0 insertions(+), 118 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 61c915a..82e8207 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -42,13 +42,11 @@ oap_client.h \ openbscdefines.h \ osmo_bsc.h \ - osmo_bsc_grace.h \ a_reset.h \ osmo_msc.h \ osmo_bsc_sigtran.h \ bsc_msc_data.h \ osmux.h \ - paging.h \ rrlp.h \ rs232.h \ rtp_proxy.h \ diff --git a/include/osmocom/msc/osmo_bsc_grace.h b/include/osmocom/msc/osmo_bsc_grace.h deleted file mode 100644 index 6232ffd..0000000 --- a/include/osmocom/msc/osmo_bsc_grace.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * (C) 2010-2013 by Holger Hans Peter Freyther - * (C) 2010-2013 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef OSMO_BSC_GRACE_H -#define OSMO_BSC_GRACE_H - -#include -#include - -struct bsc_msc_data; - -int bsc_grace_allow_new_connection(struct gsm_network *net, struct gsm_bts *bts); -int bsc_grace_paging_request(enum signal_rf rf_policy, - struct bsc_subscr *subscr, - int chan_needed, - struct bsc_msc_data *msc); - -#endif diff --git a/include/osmocom/msc/paging.h b/include/osmocom/msc/paging.h deleted file mode 100644 index b856dcd..0000000 --- a/include/osmocom/msc/paging.h +++ /dev/null @@ -1,76 +0,0 @@ -/* Paging helper and manager.... */ -/* (C) 2009 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - */ - -#ifndef PAGING_H -#define PAGING_H - -#include -#include - -#include -#include - -#include - -/** - * A pending paging request - */ -struct gsm_paging_request { - /* list_head for list of all paging requests */ - struct llist_head entry; - /* the subscriber which we're paging. Later gsm_paging_request - * should probably become a part of the bsc_subsrc struct? */ - struct bsc_subscr *bsub; - /* back-pointer to the BTS on which we are paging */ - struct gsm_bts *bts; - /* what kind of channel type do we ask the MS to establish */ - int chan_type; - - /* Timer 3113: how long do we try to page? */ - struct osmo_timer_list T3113; - - /* How often did we ask the BTS to page? */ - int attempts; - - /* callback to be called in case paging completes */ - gsm_cbfn *cbfn; - void *cbfn_param; -}; - -/* schedule paging request */ -int paging_request(struct gsm_network *network, struct bsc_subscr *bsub, - int type, gsm_cbfn *cbfn, void *data); -int paging_request_bts(struct gsm_bts *bts, struct bsc_subscr *bsub, - int type, gsm_cbfn *cbfn, void *data); - -/* stop paging requests */ -void paging_request_stop(struct llist_head *bts_list, - struct gsm_bts *_bts, struct bsc_subscr *bsub, - struct gsm_subscriber_connection *conn, - struct msgb *msg); - -/* update paging load */ -void paging_update_buffer_space(struct gsm_bts *bts, uint16_t); - -/* pending paging requests */ -unsigned int paging_pending_requests_nr(struct gsm_bts *bts); - -void *paging_get_data(struct gsm_bts *bts, struct bsc_subscr *bsub); - -#endif diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 51eb1c0..956bc44 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index 50242a6..d8d77e9 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -52,7 +52,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 1a7bf59..4838027 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index a99f218..d715d5c 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/transaction.c b/src/libmsc/transaction.c index 4dcd24d..f500326 100644 --- a/src/libmsc/transaction.c +++ b/src/libmsc/transaction.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include -- To view, visit https://gerrit.osmocom.org/6048 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6af40f65f0634e49939906a3e50a41e0be246794 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:09:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:09:36 +0000 Subject: [MERGED] osmo-msc[master]: debug: Remove code for filters that don't exist in OsmoMSC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debug: Remove code for filters that don't exist in OsmoMSC ...................................................................... debug: Remove code for filters that don't exist in OsmoMSC We don't have BSC or GPRS related logging filters here. This is a leftover from the NITB->MSC split Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094 --- M include/osmocom/msc/gsm_04_08.h M src/libcommon/debug.c 2 files changed, 0 insertions(+), 18 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h index c99fc86..914b3e9 100644 --- a/include/osmocom/msc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -14,7 +14,6 @@ struct gsm_subscriber_connection; struct amr_multirate_conf; struct amr_mode; -struct bsc_subscr; #define GSM48_ALLOC_SIZE 2048 #define GSM48_ALLOC_HEADROOM 256 diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 612e215..661eb66 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -200,26 +200,9 @@ static int filter_fn(const struct log_context *ctx, struct log_target *tar) { const struct vlr_subscr *vsub = ctx->ctx[LOG_CTX_VLR_SUBSCR]; - const struct bsc_subscr *bsub = ctx->ctx[LOG_CTX_BSC_SUBSCR]; - const struct gprs_nsvc *nsvc = ctx->ctx[LOG_CTX_GB_NSVC]; - const struct gprs_nsvc *bvc = ctx->ctx[LOG_CTX_GB_BVC]; if ((tar->filter_map & (1 << LOG_FLT_VLR_SUBSCR)) != 0 && vsub && vsub == tar->filter_data[LOG_FLT_VLR_SUBSCR]) - return 1; - - if ((tar->filter_map & (1 << LOG_FLT_BSC_SUBSCR)) != 0 - && bsub && bsub == tar->filter_data[LOG_FLT_BSC_SUBSCR]) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_NSVC)) != 0 - && nsvc && (nsvc == tar->filter_data[LOG_FLT_GB_NSVC])) - return 1; - - /* Filter on the NS Virtual Connection */ - if ((tar->filter_map & (1 << LOG_FLT_GB_BVC)) != 0 - && bvc && (bvc == tar->filter_data[LOG_FLT_GB_BVC])) return 1; return 0; -- To view, visit https://gerrit.osmocom.org/6049 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I05f991d1f5b7f89545521a73d79619bee4111094 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:09:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:09:36 +0000 Subject: [MERGED] osmo-msc[master]: remove traces of bsc_subscriber In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove traces of bsc_subscriber ...................................................................... remove traces of bsc_subscriber Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 --- M include/osmocom/msc/gsm_data.h M src/libcommon-cs/common_cs.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_authen.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_hlr_reject.err M tests/msc_vlr/msc_vlr_test_hlr_timeout.err M tests/msc_vlr/msc_vlr_test_ms_timeout.err M tests/msc_vlr/msc_vlr_test_no_authen.err M tests/msc_vlr/msc_vlr_test_reject_concurrency.err M tests/msc_vlr/msc_vlr_test_rest.err M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 14 files changed, 72 insertions(+), 91 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 1b0bff9..2b01a34 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -26,7 +26,6 @@ struct mncc_sock_state; struct gsm_subscriber_group; -struct bsc_subscr; struct vlr_instance; struct vlr_subscr; struct ranap_ue_conn_ctx; @@ -144,9 +143,6 @@ /* The MS has opened the conn with a CM Service Request, and we shall * keep it open for an actual request (or until timeout). */ bool received_cm_service_request; - - /* libbsc subscriber information (if available) */ - struct bsc_subscr *bsub; /* libmsc/libvlr subscriber information (if available) */ struct vlr_subscr *vsub; @@ -445,14 +441,6 @@ * OsmoMSC, this should be tied to the location area code (LAC). */ struct gsm_tz tz; - /* List of all struct bsc_subscr used in libbsc. This llist_head is - * allocated so that the llist_head pointer itself can serve as a - * talloc context (useful to not have to pass the entire gsm_network - * struct to the bsc_subscr_* API, and for bsc_susbscr unit tests to - * not require gsm_data.h). In an MSC-without-BSC environment, this - * pointer is NULL to indicate absence of a bsc_subscribers list. */ - struct llist_head *bsc_subscribers; - /* MSC: GSUP server address of the HLR */ const char *gsup_server_addr_str; uint16_t gsup_server_port; @@ -556,9 +544,6 @@ int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - -struct gsm_subscriber_connection *bsc_subscr_con_allocate(struct gsm_lchan *lchan); -void bsc_subscr_con_free(struct gsm_subscriber_connection *conn); struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 4748865..41c456e 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -66,9 +66,6 @@ INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->subscr_conns); - net->bsc_subscribers = talloc_zero(net, struct llist_head); - INIT_LLIST_HEAD(net->bsc_subscribers); - /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); if (!net->msc_ctrs) { diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index f6eef60..a161e3a 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -424,7 +424,7 @@ ===== test_auth_use_twice_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_auth_use_twice_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -878,7 +878,7 @@ ===== test_auth_use_twice_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_auth_use_infinitely_geran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1399,7 +1399,7 @@ ===== test_auth_use_infinitely_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_auth_use_infinitely_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1954,7 +1954,7 @@ ===== test_auth_use_infinitely_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_auth_reuse_geran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -2275,7 +2275,7 @@ ===== test_no_auth_reuse_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_auth_reuse_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -2614,8 +2614,8 @@ ===== test_no_auth_reuse_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index 625ae61..7b4c72e 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -345,7 +345,7 @@ ===== test_call_mo: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_call_mt - Total time passed: 0.000000 s @@ -699,8 +699,8 @@ ===== test_call_mt: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_authen.err b/tests/msc_vlr/msc_vlr_test_gsm_authen.err index 4db427f..885d799 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_authen.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_authen.err @@ -444,7 +444,7 @@ ===== test_gsm_authen: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_authen_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1096,7 +1096,7 @@ ===== test_gsm_authen_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_authen_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1316,7 +1316,7 @@ ===== test_gsm_authen_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_authen_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1567,7 +1567,7 @@ ===== test_gsm_authen_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_gsm_milenage_authen - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1996,8 +1996,8 @@ ===== test_gsm_milenage_authen: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index da4e0b7..53273e3 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -481,7 +481,7 @@ ===== test_ciph: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_tmsi - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1003,7 +1003,7 @@ ===== test_ciph_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1224,7 +1224,7 @@ ===== test_ciph_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_imeisv - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1434,7 +1434,7 @@ ===== test_ciph_imeisv: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ciph_tmsi_imei - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1686,8 +1686,8 @@ ===== test_ciph_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_reject.err b/tests/msc_vlr/msc_vlr_test_hlr_reject.err index 812eb3b..0d189e8 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_reject.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_reject.err @@ -72,7 +72,7 @@ ===== test_hlr_rej_auth_info_unknown_imsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_net_fail - Location Update request causes a GSUP Send Auth Info request to HLR @@ -148,7 +148,7 @@ ===== test_hlr_rej_auth_info_net_fail: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_net_fail_reuse_tuples --- @@ -451,7 +451,7 @@ ===== test_hlr_rej_auth_info_net_fail_reuse_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples --- @@ -679,7 +679,7 @@ ===== test_hlr_rej_auth_info_net_fail_no_reuse_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples --- @@ -908,7 +908,7 @@ ===== test_hlr_rej_auth_info_unkown_imsi_no_reuse_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_acc_but_no_auth_tuples - Location Update request causes a GSUP Send Auth Info request to HLR @@ -983,7 +983,7 @@ ===== test_hlr_acc_but_no_auth_tuples: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_rej_lu - Location Update request causes a GSUP LU request to HLR @@ -1061,7 +1061,7 @@ ===== test_hlr_rej_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_no_insert_data - Location Update request causes a GSUP LU request to HLR @@ -1162,8 +1162,8 @@ ===== test_hlr_no_insert_data: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err index 439dc72..79eecf4 100644 --- a/tests/msc_vlr/msc_vlr_test_hlr_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_hlr_timeout.err @@ -80,7 +80,7 @@ ===== test_hlr_timeout_lu_auth_info: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_hlr_timeout_lu_upd_loc_result - Total time passed: 0.000000 s @@ -183,8 +183,8 @@ ===== test_hlr_timeout_lu_upd_loc_result: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_ms_timeout.err b/tests/msc_vlr/msc_vlr_test_ms_timeout.err index 4abcc18..7731bcb 100644 --- a/tests/msc_vlr/msc_vlr_test_ms_timeout.err +++ b/tests/msc_vlr/msc_vlr_test_ms_timeout.err @@ -100,7 +100,7 @@ ===== test_ms_timeout_lu_auth_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ms_timeout_cm_auth_resp - Total time passed: 0.000000 s @@ -336,7 +336,7 @@ ===== test_ms_timeout_cm_auth_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_ms_timeout_paging - Total time passed: 0.000000 s @@ -519,8 +519,8 @@ ===== test_ms_timeout_paging: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_no_authen.err b/tests/msc_vlr/msc_vlr_test_no_authen.err index 9c66a36..c12e8ec 100644 --- a/tests/msc_vlr/msc_vlr_test_no_authen.err +++ b/tests/msc_vlr/msc_vlr_test_no_authen.err @@ -320,7 +320,7 @@ ===== test_no_authen: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_tmsi - Location Update request causes a GSUP LU request to HLR @@ -831,7 +831,7 @@ ===== test_no_authen_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imei - Location Update request causes a GSUP LU request to HLR @@ -1004,7 +1004,7 @@ ===== test_no_authen_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_tmsi_imei - Location Update request causes a GSUP LU request to HLR @@ -1202,7 +1202,7 @@ ===== test_no_authen_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv - Location Update request causes an IMEISV ID request back to the MS @@ -1360,7 +1360,7 @@ ===== test_no_authen_imeisv: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv_imei - Location Update request causes an IMEISV ID request back to the MS @@ -1550,7 +1550,7 @@ ===== test_no_authen_imeisv_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv_tmsi - Location Update request causes an IMEISV ID request back to the MS @@ -1906,7 +1906,7 @@ ===== test_no_authen_imeisv_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_no_authen_imeisv_tmsi_imei - Location Update request causes an IMEISV ID request back to the MS @@ -2122,8 +2122,8 @@ ===== test_no_authen_imeisv_tmsi_imei: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err index 16854d2..aef8f72 100644 --- a/tests/msc_vlr/msc_vlr_test_reject_concurrency.err +++ b/tests/msc_vlr/msc_vlr_test_reject_concurrency.err @@ -152,7 +152,7 @@ ===== test_reject_2nd_conn: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_lu_during_lu - Location Update Request @@ -277,7 +277,7 @@ ===== test_reject_lu_during_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_cm_during_lu - Location Update Request @@ -408,7 +408,7 @@ ===== test_reject_cm_during_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_paging_resp_during_lu - Location Update Request @@ -534,7 +534,7 @@ ===== test_reject_paging_resp_during_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_lu_during_cm --- @@ -727,7 +727,7 @@ ===== test_reject_lu_during_cm: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_cm_during_cm --- @@ -922,7 +922,7 @@ ===== test_reject_cm_during_cm: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_paging_resp_during_cm --- @@ -1123,7 +1123,7 @@ ===== test_reject_paging_resp_during_cm: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_lu_during_paging_resp --- @@ -1350,7 +1350,7 @@ ===== test_reject_lu_during_paging_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_accept_cm_during_paging_resp --- @@ -1594,7 +1594,7 @@ ===== test_accept_cm_during_paging_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_reject_paging_resp_during_paging_resp --- @@ -1820,8 +1820,8 @@ ===== test_reject_paging_resp_during_paging_resp: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_rest.err b/tests/msc_vlr/msc_vlr_test_rest.err index 8c8d26d..31e3cfe 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.err +++ b/tests/msc_vlr/msc_vlr_test_rest.err @@ -40,7 +40,7 @@ ===== test_early_stage: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_cm_service_without_lu - CM Service Request without a prior Location Updating @@ -83,7 +83,7 @@ ===== test_cm_service_without_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_two_lu - Location Update request causes a GSUP LU request to HLR @@ -340,7 +340,7 @@ ===== test_two_lu: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_lu_unknown_tmsi - Location Update request with unknown TMSI sends ID Request for IMSI @@ -489,8 +489,8 @@ ===== test_lu_unknown_tmsi: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index f519c2f..a503822 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -458,7 +458,7 @@ ===== test_umts_authen_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_umts_authen_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -946,7 +946,7 @@ ===== test_umts_authen_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_umts_authen_resync_geran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1159,7 +1159,7 @@ ===== test_umts_authen_resync_geran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 ===== test_umts_authen_resync_utran - Location Update request causes a GSUP Send Auth Info request to HLR @@ -1382,8 +1382,8 @@ ===== test_umts_authen_resync_utran: SUCCESS full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 +talloc_total_blocks(tall_bsc_ctx) == 8 diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index ac850b3..cf9122b 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -717,14 +717,13 @@ talloc_report_full(msgb_ctx, stderr); /* Expecting these to stick around in tall_bsc_ctx: full talloc report on 'msgb' (total 0 bytes in 1 blocks) -talloc_total_blocks(tall_bsc_ctx) == 9 -full talloc report on 'subscr_conn_test_ctx' (total 2658 bytes in 9 blocks) +talloc_total_blocks(tall_bsc_ctx) == 8 +full talloc report on 'subscr_conn_test_ctx' (total 2642 bytes in 8 blocks) struct gsup_client contains 248 bytes in 1 blocks (ref 0) 0x61300000dee0 struct gsm_network contains 2410 bytes in 6 blocks (ref 0) 0x61700000fce0 struct vlr_instance contains 160 bytes in 1 blocks (ref 0) 0x611000009a60 no_gsup_server contains 15 bytes in 1 blocks (ref 0) 0x60b00000ade0 ../../../src/libosmocore/src/rate_ctr.c:199 contains 1552 bytes in 1 blocks (ref 0) 0x61b00001eae0 - struct llist_head contains 16 bytes in 1 blocks (ref 0) 0x60b00000ae90 .* contains 3 bytes in 1 blocks (ref 0) 0x60b00000af40 msgb contains 0 bytes in 1 blocks (ref 0) 0x60800000bf80 */ @@ -804,7 +803,7 @@ if (cmdline_opts.verbose) fprintf(stderr, "(test nr %d)\n", test_nr + 1); - check_talloc(msgb_ctx, tall_bsc_ctx, 9); + check_talloc(msgb_ctx, tall_bsc_ctx, 8); } while(0); } @@ -870,6 +869,6 @@ talloc_free(the_bts); - check_talloc(msgb_ctx, tall_bsc_ctx, 9); + check_talloc(msgb_ctx, tall_bsc_ctx, 8); return 0; } -- To view, visit https://gerrit.osmocom.org/6032 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8672f0a76cb47595444a7ddbc4f34fc4ddaeb375 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:10:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:10:09 +0000 Subject: [PATCH] osmo-msc[master]: WIP: VTY: Add 'show connections' and 'show transactions' com... Message-ID: Review at https://gerrit.osmocom.org/6050 WIP: VTY: Add 'show connections' and 'show transactions' commands It is quite important to have some way of runtime state introspection about the major objects inside osmo-msc. This patch adds some basic capabilities to dump the most important information about subscriber_connections and transactions (like calls/sms). OsmoMSC> show connection --ConnId ------------Subscriber RAN --LAC Use --Tokens CSA A5 State 00000001 IMSI:26242000000006 A 23 1 00000004 --- /0 SUBSCR_CONN_S_COMMUNICATING Change-Id: I1c457c1eac20188f67b8379a36cfda3a085fcef4 --- M src/libmsc/vty_interface_layer3.c 1 file changed, 112 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/50/6050/1 diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index dbd826d..4f59554 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -51,6 +51,7 @@ #include #include #include +#include #include @@ -58,8 +59,102 @@ extern struct gsm_network *gsmnet_from_vty(struct vty *v); +static void vty_conn_hdr(struct vty *vty) +{ + vty_out(vty, "--ConnId ------------Subscriber RAN --LAC Use --Tokens CSA A5 State%s", + VTY_NEWLINE); +} + +static void vty_dump_one_conn(struct vty *vty, const struct gsm_subscriber_connection *conn) +{ + vty_out(vty, "%08x %22s %3s %5u %3u %08x %c%c%c /%1u %27s %s", + conn->a.conn_id, + conn->vsub ? vlr_subscr_name(conn->vsub) : "-", + conn->via_ran == RAN_UTRAN_IU ? "Iu" : "A", + conn->lac, + conn->use_count, + conn->use_tokens, + conn->received_cm_service_request ? 'C' : '-', + conn->sec_operation ? 'S' : '-', + conn->anch_operation ? 'A' : '-', + conn->encr.alg_id, + conn->conn_fsm ? osmo_fsm_inst_state_name(conn->conn_fsm) : "-", + VTY_NEWLINE); +} + +DEFUN(show_msc_conn, show_msc_conn_cmd, + "show connection", SHOW_STR "Subscriber Connections\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_subscriber_connection *conn; + + vty_conn_hdr(vty); + llist_for_each_entry(conn, &gsmnet->subscr_conns, entry) + vty_dump_one_conn(vty, conn); + + return CMD_SUCCESS; +} + +static void vty_trans_hdr(struct vty *vty) +{ + vty_out(vty, "------------Subscriber --ConnId -P TI -CallRef Proto%s", + VTY_NEWLINE); +} + +static const char *get_trans_proto_str(const struct gsm_trans *trans) +{ + static char buf[256]; + + switch (trans->protocol) { + case GSM48_PDISC_CC: + snprintf(buf, sizeof(buf), "%s %4u %4u", + gsm48_cc_state_name(trans->cc.state), + trans->cc.Tcurrent, + trans->cc.T308_second); + break; + case GSM48_PDISC_SMS: + snprintf(buf, sizeof(buf), "%s %s", + gsm411_cp_state_name(trans->sms.smc_inst.cp_state), + gsm411_rp_state_name(trans->sms.smr_inst.rp_state)); + break; + default: + buf[0] = '\0'; + break; + } + + return buf; +} + +static void vty_dump_one_trans(struct vty *vty, const struct gsm_trans *trans) +{ + vty_out(vty, "%22s %08x %s %02u %08x %s%s", + trans->vsub ? vlr_subscr_name(trans->vsub) : "-", + trans->conn ? trans->conn->a.conn_id : 0, + gsm48_pdisc_name(trans->protocol), + trans->transaction_id, + trans->callref, + get_trans_proto_str(trans), VTY_NEWLINE); +} + +DEFUN(show_msc_transaction, show_msc_transaction_cmd, + "show transaction", SHOW_STR "Transactions\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_trans *trans; + + vty_trans_hdr(vty); + llist_for_each_entry(trans, &gsmnet->trans_list, entry) + vty_dump_one_trans(vty, trans); + + return CMD_SUCCESS; +} + + + static void subscr_dump_full_vty(struct vty *vty, struct vlr_subscr *vsub) { + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_trans *trans; int reqs; struct llist_head *entry; @@ -113,6 +208,21 @@ vty_out(vty, " Paging: %s paging for %d requests%s", vsub->cs.is_paging ? "is" : "not", reqs, VTY_NEWLINE); vty_out(vty, " Use count: %u%s", vsub->use_count, VTY_NEWLINE); + + /* Connection */ + if (vsub->msc_conn_ref) { + struct gsm_subscriber_connection *conn = vsub->msc_conn_ref; + vty_conn_hdr(vty); + vty_dump_one_conn(vty, conn); + } + + /* Transactions */ + vty_trans_hdr(vty); + llist_for_each_entry(trans, &gsmnet->trans_list, entry) { + if (trans->vsub != vsub) + continue; + vty_dump_one_trans(vty, trans); + } } @@ -862,6 +972,8 @@ install_element_ve(&show_subscr_cmd); install_element_ve(&show_subscr_cache_cmd); + install_element_ve(&show_msc_conn_cmd); + install_element_ve(&show_msc_transaction_cmd); install_element_ve(&sms_send_pend_cmd); -- To view, visit https://gerrit.osmocom.org/6050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1c457c1eac20188f67b8379a36cfda3a085fcef4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:10:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:10:10 +0000 Subject: [PATCH] osmo-msc[master]: Massive removal of unused code/structs/headers Message-ID: Review at https://gerrit.osmocom.org/6051 Massive removal of unused code/structs/headers osmo-msc still had large amounts of dead code that came along from openbsc.git. This commit removes a lot of it, mostly stuff relevant only to the BSC side of things (or even GPRS). Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/abis_nm.h D include/osmocom/msc/abis_om2000.h D include/osmocom/msc/abis_rsl.h D include/osmocom/msc/arfcn_range_encode.h M include/osmocom/msc/bsc_api.h D include/osmocom/msc/bsc_msg_filter.h D include/osmocom/msc/chan_alloc.h D include/osmocom/msc/common_bsc.h D include/osmocom/msc/crc24.h D include/osmocom/msc/e1_config.h M include/osmocom/msc/gsm_04_08.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/gsm_subscriber.h D include/osmocom/msc/handover.h D include/osmocom/msc/handover_decision.h D include/osmocom/msc/meas_rep.h D include/osmocom/msc/misdn.h D include/osmocom/msc/network_listen.h D include/osmocom/msc/osmo_bsc.h D include/osmocom/msc/osmo_bsc_reset.h D include/osmocom/msc/osmo_bsc_sigtran.h D include/osmocom/msc/osmux.h D include/osmocom/msc/rs232.h D include/osmocom/msc/rtp_proxy.h M include/osmocom/msc/signal.h D include/osmocom/msc/slhc.h D include/osmocom/msc/system_information.h D include/osmocom/msc/trau_mux.h D include/osmocom/msc/trau_upqueue.h M include/osmocom/msc/vty.h M src/libcommon-cs/a_reset.c M src/libcommon/Makefile.am M src/libcommon/common_vty.c M src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c M src/libcommon/talloc_ctx.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_subscriber.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/sms_queue.c M src/libmsc/vty_interface_layer3.c M src/osmo-msc/msc_main.c M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_tests.c 52 files changed, 7 insertions(+), 3,550 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/51/6051/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 82e8207..cb19186 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -1,24 +1,15 @@ noinst_HEADERS = \ - abis_nm.h \ - abis_om2000.h \ - abis_rsl.h \ a_iface.h \ a_iface_bssap.h \ - arfcn_range_encode.h \ auth.h \ bsc_api.h \ bsc_msc.h \ - bsc_msg_filter.h \ bsc_rll.h \ - chan_alloc.h \ common.h \ - common_bsc.h \ common_cs.h \ - crc24.h \ ctrl.h \ db.h \ debug.h \ - e1_config.h \ gsm_04_08.h \ gsm_04_11.h \ gsm_04_14.h \ @@ -27,39 +18,25 @@ gsm_data_shared.h \ gsm_subscriber.h \ gsup_client.h \ - handover.h \ - handover_decision.h \ ipaccess.h \ iucs.h \ iucs_ranap.h \ iu_dummy.h \ - meas_rep.h \ - misdn.h \ mncc.h \ mncc_int.h \ msc_ifaces.h \ - network_listen.h \ oap_client.h \ openbscdefines.h \ - osmo_bsc.h \ a_reset.h \ osmo_msc.h \ - osmo_bsc_sigtran.h \ bsc_msc_data.h \ - osmux.h \ rrlp.h \ - rs232.h \ - rtp_proxy.h \ signal.h \ silent_call.h \ - slhc.h \ smpp.h \ sms_queue.h \ socket.h \ - system_information.h \ transaction.h \ - trau_mux.h \ - trau_upqueue.h \ ussd.h \ vlr.h \ vty.h \ diff --git a/include/osmocom/msc/abis_nm.h b/include/osmocom/msc/abis_nm.h deleted file mode 100644 index 2581962..0000000 --- a/include/osmocom/msc/abis_nm.h +++ /dev/null @@ -1,180 +0,0 @@ -/* 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 - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef _NM_H -#define _NM_H - -#include -#include -#include - -#include - -/* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ -#define MAX_BTS_ATTR 5 - -struct cell_global_id { - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint16_t ci; -}; - -/* The BCCH info from an ip.access test, in host byte order - * and already parsed... */ -struct ipac_bcch_info { - struct llist_head list; - - uint16_t info_type; - uint8_t freq_qual; - uint16_t arfcn; - uint8_t rx_lev; - uint8_t rx_qual; - int16_t freq_err; - uint16_t frame_offset; - uint32_t frame_nr_offset; - uint8_t bsic; - struct cell_global_id cgi; - uint8_t ba_list_si2[16]; - uint8_t ba_list_si2bis[16]; - uint8_t ba_list_si2ter[16]; - uint8_t ca_list_si1[16]; -}; - -/* PUBLIC */ - -struct msgb; - -struct abis_nm_cfg { - /* callback for unidirectional reports */ - int (*report_cb)(struct msgb *, - struct abis_om_fom_hdr *); - /* callback for software activate requests from BTS */ - int (*sw_act_req)(struct msgb *); -}; - -extern int abis_nm_rcvmsg(struct msgb *msg); - -int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len); -int abis_nm_rx(struct msgb *msg); -int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2); -int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, - uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state); -int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr, - uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot, - uint8_t tei); -int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx, - uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot); -int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts, - uint8_t e1_port, uint8_t e1_timeslot, - uint8_t e1_subslot); -int abis_nm_get_attr(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - const uint8_t *attr, uint8_t attr_len); -int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len); -int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len); -int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb); -int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1, - uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len); -int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg); -int abis_nm_event_reports(struct gsm_bts *bts, int on); -int abis_nm_reset_resource(struct gsm_bts *bts); -int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname, - uint8_t win_size, int forced, - gsm_cbfn *cbfn, void *cb_data); -int abis_nm_software_load_status(struct gsm_bts *bts); -int abis_nm_software_activate(struct gsm_bts *bts, const char *fname, - gsm_cbfn *cbfn, void *cb_data); - -int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0, - uint8_t e1_port1, uint8_t ts1); - -int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - uint8_t test_nr, uint8_t auton_report, struct msgb *msg); - -/* Siemens / BS-11 specific */ -int abis_nm_bs11_reset_resource(struct gsm_bts *bts); -int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin); -int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type, - uint8_t idx, uint8_t attr_len, const uint8_t *attr); -int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_delete_object(struct gsm_bts *bts, - enum abis_bs11_objtype type, uint8_t idx); -int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port, - uint8_t e1_timeslot, uint8_t e1_subslot, uint8_t tei); -int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts); -int abis_nm_bs11_get_serno(struct gsm_bts *bts); -int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level); -int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx); -int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on); -int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on); -int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on); -int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password); -int abis_nm_bs11_set_pll_locked(struct gsm_bts *bts, int locked); -int abis_nm_bs11_get_pll_mode(struct gsm_bts *bts); -int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value); -int abis_nm_bs11_get_cclk(struct gsm_bts *bts); -int abis_nm_bs11_get_state(struct gsm_bts *bts); -int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname, - uint8_t win_size, int forced, gsm_cbfn *cbfn); -int abis_nm_bs11_set_ext_time(struct gsm_bts *bts); -int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport); -int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg); -int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect); -int abis_nm_bs11_restart(struct gsm_bts *bts); - -/* ip.access nanoBTS specific commands */ -int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type, - uint8_t obj_class, uint8_t bts_nr, - uint8_t trx_nr, uint8_t ts_nr, - uint8_t *attr, int attr_len); -int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr, - int attr_len); -int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx); -int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - uint8_t *attr, uint8_t attr_len); -int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, - uint32_t ip, uint16_t port, uint8_t stream); -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts); -int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf); -const char *ipacc_testres_name(uint8_t res); - -/* Functions calling into other code parts */ -int nm_is_running(struct gsm_nm_state *s); - -int abis_nm_vty_init(void); - -void abis_nm_clear_queue(struct gsm_bts *bts); - -int _abis_nm_sendmsg(struct msgb *msg); - -void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */ - -int abis_nm_select_newest_sw(const struct abis_nm_sw_desc *sw, const size_t len); - -/* Helper functions for updating attributes */ -int abis_nm_update_max_power_red(struct gsm_bts_trx *trx); - -#endif /* _NM_H */ diff --git a/include/osmocom/msc/abis_om2000.h b/include/osmocom/msc/abis_om2000.h deleted file mode 100644 index b093a03..0000000 --- a/include/osmocom/msc/abis_om2000.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef OPENBSC_ABIS_OM2K_H -#define OPENBSC_ABIS_OM2K_H -/* Ericsson RBS 2xxx GSM O&M (OM2000) messages on the A-bis interface - * implemented based on protocol trace analysis, no formal documentation */ - -/* (C) 2010-2011 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -enum abis_om2k_mo_cls { - OM2K_MO_CLS_TRXC = 0x01, - OM2K_MO_CLS_TS = 0x03, - OM2K_MO_CLS_TF = 0x04, - OM2K_MO_CLS_IS = 0x05, - OM2K_MO_CLS_CON = 0x06, - OM2K_MO_CLS_DP = 0x07, - OM2K_MO_CLS_CF = 0x0a, - OM2K_MO_CLS_TX = 0x0b, - OM2K_MO_CLS_RX = 0x0c, -}; - -enum om2k_mo_state { - OM2K_MO_S_RESET = 0, - OM2K_MO_S_STARTED, - OM2K_MO_S_ENABLED, - OM2K_MO_S_DISABLED, -}; - -/* on-wire format for IS conn group */ -struct om2k_is_conn_grp { - uint16_t icp1; - uint16_t icp2; - uint8_t cont_idx; -} __attribute__ ((packed)); - -/* internal data formant for IS conn group */ -struct is_conn_group { - struct llist_head list; - uint16_t icp1; - uint16_t icp2; - uint8_t ci; -}; - -/* on-wire format for CON Path */ -struct om2k_con_path { - uint16_t ccp; - uint8_t ci; - uint8_t tag; - uint8_t tei; -} __attribute__ ((packed)); - -/* internal data format for CON group */ -struct con_group { - /* links list of CON groups in BTS */ - struct llist_head list; - struct gsm_bts *bts; - /* CON Group ID */ - uint8_t cg; - /* list of CON paths in this group */ - struct llist_head paths; -}; - -/* internal data format for CON path */ -struct con_path { - /* links with con_group.paths */ - struct llist_head list; - /* CON Connection Point */ - uint16_t ccp; - /* Contiguity Index */ - uint8_t ci; - /* Tag */ - uint8_t tag; - /* TEI */ - uint8_t tei; -}; - -extern const struct abis_om2k_mo om2k_mo_cf; -extern const struct abis_om2k_mo om2k_mo_is; -extern const struct abis_om2k_mo om2k_mo_con; -extern const struct abis_om2k_mo om2k_mo_tf; - -extern const struct value_string om2k_mo_class_short_vals[]; - -int abis_om2k_rcvmsg(struct msgb *msg); - -extern const struct abis_om2k_mo om2k_mo_cf; - -int abis_om2k_tx_reset_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_start_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_status_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, - uint8_t operational); -int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_is_conf_req(struct gsm_bts *bts); -int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts); -int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx); -int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx); -int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts); - -struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts); -void abis_om2k_bts_init(struct gsm_bts *bts); -void abis_om2k_trx_init(struct gsm_bts_trx *trx); - -int abis_om2k_vty_init(void); - -struct vty; -void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts); - -#endif /* OPENBCS_ABIS_OM2K_H */ diff --git a/include/osmocom/msc/abis_rsl.h b/include/osmocom/msc/abis_rsl.h deleted file mode 100644 index f983fce..0000000 --- a/include/osmocom/msc/abis_rsl.h +++ /dev/null @@ -1,117 +0,0 @@ -/* 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 - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef _RSL_H -#define _RSL_H - -#include -#include -#include -#include -#include - -struct gsm_bts; -struct gsm_lchan; -struct gsm_bts_trx_ts; - -#define GSM48_LEN2PLEN(a) (((a) << 2) | 1) - -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, - uint8_t act_type, - struct rsl_ie_chan_mode *chan_mode, - struct rsl_ie_chan_ident *chan_ident, - uint8_t bs_power, uint8_t ms_power, - uint8_t ta); -int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type, - uint8_t ho_ref); -int rsl_chan_mode_modify_req(struct gsm_lchan *ts); -int rsl_encryption_cmd(struct msgb *msg); -int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len, - uint8_t *ms_ident, uint8_t chan_needed, bool is_gprs); -int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val); - -int rsl_data_request(struct msgb *msg, uint8_t link_id); -int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id); -int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id); - -/* Ericcson vendor specific RSL extensions */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val); - -/* Siemens vendor-specific RSL extensions */ -int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); - -/* ip.access specfic RSL extensions */ -int rsl_ipacc_crcx(struct gsm_lchan *lchan); -int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip, - uint16_t port, uint8_t rtp_payload2); -int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan); -int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act); - -int abis_rsl_rcvmsg(struct msgb *msg); - -uint64_t str_to_imsi(const char *imsi_str); -int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, - enum rsl_rel_mode release_mode); - -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); -int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); - -/* to be provided by external code */ -int rsl_deact_sacch(struct gsm_lchan *lchan); - -/* BCCH related code */ -int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); -int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf); - -int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type, - const uint8_t *data, int len); - -int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db); -int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm); - -/* SMSCB functionality */ -int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number, - struct rsl_ie_cb_cmd_type cb_command, - const uint8_t *data, int len); - -/* some Nokia specific stuff */ -int rsl_nokia_si_begin(struct gsm_bts_trx *trx); -int rsl_nokia_si_end(struct gsm_bts_trx *trx); - -/* required for Nokia BTS power control */ -int rsl_bs_power_control(struct gsm_bts_trx *trx, uint8_t channel, uint8_t reduction); - - -int rsl_release_sapis_from(struct gsm_lchan *lchan, int start, - enum rsl_rel_mode release_mode); -int rsl_start_t3109(struct gsm_lchan *lchan); - -int rsl_direct_rf_release(struct gsm_lchan *lchan); - -void dyn_ts_init(struct gsm_bts_trx_ts *ts); -int dyn_ts_switchover_start(struct gsm_bts_trx_ts *ts, - enum gsm_phys_chan_config to_pchan); - -#endif /* RSL_MT_H */ - diff --git a/include/osmocom/msc/arfcn_range_encode.h b/include/osmocom/msc/arfcn_range_encode.h deleted file mode 100644 index 7ec710c..0000000 --- a/include/osmocom/msc/arfcn_range_encode.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ARFCN_RANGE_ENCODE_H -#define ARFCN_RANGE_ENCODE_H - -#include - -enum gsm48_range { - ARFCN_RANGE_INVALID = -1, - ARFCN_RANGE_128 = 127, - ARFCN_RANGE_256 = 255, - ARFCN_RANGE_512 = 511, - ARFCN_RANGE_1024 = 1023, -}; - -#define RANGE_ENC_MAX_ARFCNS 29 - -int range_enc_determine_range(const int *arfcns, int size, int *f0_out); -int range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, int *out, int idx); -int range_enc_find_index(enum gsm48_range rng, const int *arfcns, int size); -int range_enc_filter_arfcns(int *arfcns, const int sze, const int f0, int *f0_included); - -int range_enc_range128(uint8_t *chan_list, int f0, int *w); -int range_enc_range256(uint8_t *chan_list, int f0, int *w); -int range_enc_range512(uint8_t *chan_list, int f0, int *w); -int range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w); - -#endif diff --git a/include/osmocom/msc/bsc_api.h b/include/osmocom/msc/bsc_api.h index 40068d6..4936f53 100644 --- a/include/osmocom/msc/bsc_api.h +++ b/include/osmocom/msc/bsc_api.h @@ -46,13 +46,4 @@ void (*conn_cleanup)(struct gsm_subscriber_connection *conn); }; -int bsc_api_init(struct gsm_network *network, struct bsc_api *api); -int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id, int allow_sacch); -int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv); -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, - unsigned int mi_len, uint8_t *mi, int chan_type); -int gsm0808_clear(struct gsm_subscriber_connection *conn); - #endif diff --git a/include/osmocom/msc/bsc_msg_filter.h b/include/osmocom/msc/bsc_msg_filter.h deleted file mode 100644 index a9dedf4..0000000 --- a/include/osmocom/msc/bsc_msg_filter.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include - -struct vty; -struct gsm48_hdr; - -struct bsc_filter_reject_cause { - int lu_reject_cause; - int cm_reject_cause; -}; - -struct bsc_filter_barr_entry { - struct rb_node node; - - char *imsi; - int cm_reject_cause; - int lu_reject_cause; -}; - -enum bsc_filter_acc_ctr { - ACC_LIST_LOCAL_FILTER, - ACC_LIST_GLOBAL_FILTER, -}; - -struct bsc_msg_acc_lst { - struct llist_head list; - - /* counter */ - struct rate_ctr_group *stats; - - /* the name of the list */ - const char *name; - struct llist_head fltr_list; -}; - -struct bsc_msg_acc_lst_entry { - struct llist_head list; - - /* the filter */ - char *imsi_allow; - regex_t imsi_allow_re; - char *imsi_deny; - regex_t imsi_deny_re; - - /* reject reasons for the access lists */ - int cm_reject_cause; - int lu_reject_cause; -}; - -enum { - FLT_CON_TYPE_NONE, - FLT_CON_TYPE_LU, - FLT_CON_TYPE_CM_SERV_REQ, - FLT_CON_TYPE_PAG_RESP, - FLT_CON_TYPE_SSA, - FLT_CON_TYPE_LOCAL_REJECT, - FLT_CON_TYPE_OTHER, -}; - - -struct bsc_filter_state { - char *imsi; - int imsi_checked; - int con_type; -}; - -struct bsc_filter_request { - void *ctx; - struct rb_root *black_list; - struct llist_head *access_lists; - const char *local_lst_name; - const char *global_lst_name; - int bsc_nr; -}; - - -int bsc_filter_barr_adapt(void *ctx, struct rb_root *rbtree, const struct osmo_config_list *); -int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu); - -/** - * Content filtering. - */ -int bsc_msg_filter_initial(struct gsm48_hdr *hdr, size_t size, - struct bsc_filter_request *req, - int *con_type, char **imsi, - struct bsc_filter_reject_cause *cause); -int bsc_msg_filter_data(struct gsm48_hdr *hdr, size_t size, - struct bsc_filter_request *req, - struct bsc_filter_state *state, - struct bsc_filter_reject_cause *cause); - -/* IMSI allow/deny handling */ -struct bsc_msg_acc_lst *bsc_msg_acc_lst_find(struct llist_head *lst, const char *name); -struct bsc_msg_acc_lst *bsc_msg_acc_lst_get(void *ctx, struct llist_head *lst, const char *name); -void bsc_msg_acc_lst_delete(struct bsc_msg_acc_lst *lst); - -struct bsc_msg_acc_lst_entry *bsc_msg_acc_lst_entry_create(struct bsc_msg_acc_lst *); -int bsc_msg_acc_lst_check_allow(struct bsc_msg_acc_lst *lst, const char *imsi); - -void bsc_msg_lst_vty_init(void *ctx, struct llist_head *lst, int node); -void bsc_msg_acc_lst_write(struct vty *vty, struct bsc_msg_acc_lst *lst); diff --git a/include/osmocom/msc/chan_alloc.h b/include/osmocom/msc/chan_alloc.h deleted file mode 100644 index 7388e14..0000000 --- a/include/osmocom/msc/chan_alloc.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Management functions to allocate/release struct gsm_lchan */ -/* (C) 2008 by Harald Welte - * (C) 2009 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - */ -#ifndef _CHAN_ALLOC_H -#define _CHAN_ALLOC_H - -#include "gsm_data.h" - -struct gsm_subscriber_connection; - -/* Find an allocated channel for a specified subscriber */ -struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub); - -/* Allocate a logical channel (SDCCH, TCH, ...) */ -struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); - -/* Free a logical channel (SDCCH, TCH, ...) */ -void lchan_free(struct gsm_lchan *lchan); -void lchan_reset(struct gsm_lchan *lchan); - -/* Release the given lchan */ -int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode release_mode); - -struct load_counter { - unsigned int total; - unsigned int used; -}; - -struct pchan_load { - struct load_counter pchan[_GSM_PCHAN_MAX]; -}; - -void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts); -void network_chan_load(struct pchan_load *pl, struct gsm_network *net); - -int trx_is_usable(struct gsm_bts_trx *trx); - -#endif /* _CHAN_ALLOC_H */ diff --git a/include/osmocom/msc/common_bsc.h b/include/osmocom/msc/common_bsc.h deleted file mode 100644 index 821298c..0000000 --- a/include/osmocom/msc/common_bsc.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include -#include - -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code, - mncc_recv_cb_t mncc_recv); diff --git a/include/osmocom/msc/crc24.h b/include/osmocom/msc/crc24.h deleted file mode 100644 index 756638c..0000000 --- a/include/osmocom/msc/crc24.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _CRC24_H -#define _CRC24_H - -#include - -#define INIT_CRC24 0xffffff - -uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len); - -#endif diff --git a/include/osmocom/msc/e1_config.h b/include/osmocom/msc/e1_config.h deleted file mode 100644 index ac5fbb1..0000000 --- a/include/osmocom/msc/e1_config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _E1_CONFIG_H -#define _E1_CONFIG_H - -#include - -int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); -int e1_reconfig_trx(struct gsm_bts_trx *trx); -int e1_reconfig_bts(struct gsm_bts *bts); - -#endif /* _E1_CONFIG_H */ - diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h index 914b3e9..58cb7ae 100644 --- a/include/osmocom/msc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -5,8 +5,6 @@ #include #include -#include - struct msgb; struct gsm_bts; struct gsm_network; @@ -67,7 +65,6 @@ int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode); int gsm48_rx_rr_modif_ack(struct msgb *msg); -int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg); struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value); struct msgb *gsm48_create_loc_upd_rej(uint8_t cause); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 2b01a34..e987136 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -18,6 +18,9 @@ #include #include +#include "gsm_data_shared.h" + + /** annotations for msgb ownership */ #define __uses @@ -168,20 +171,10 @@ int mncc_rtp_create_pending; int mncc_rtp_connect_pending; - /* bsc structures */ - struct osmo_bsc_sccp_con *sccp_con; /* BSC */ - /* back pointers */ struct gsm_network *network; bool in_release; - struct gsm_lchan *lchan; /* BSC */ - struct gsm_lchan *ho_lchan; /* BSC */ - struct gsm_bts *bts; /* BSC */ - - /* for assignment handling */ - struct osmo_timer_list T10; /* BSC */ - struct gsm_lchan *secondary_lchan; /* BSC */ /* connected via 2G or 3G? */ enum ran_type via_ran; @@ -220,56 +213,6 @@ } a; }; - -#define ROLE_BSC -#include "gsm_data_shared.h" - - -enum { - BSC_CTR_CHREQ_TOTAL, - BSC_CTR_CHREQ_NO_CHANNEL, - BSC_CTR_HANDOVER_ATTEMPTED, - BSC_CTR_HANDOVER_NO_CHANNEL, - BSC_CTR_HANDOVER_TIMEOUT, - BSC_CTR_HANDOVER_COMPLETED, - BSC_CTR_HANDOVER_FAILED, - BSC_CTR_PAGING_ATTEMPTED, - BSC_CTR_PAGING_DETACHED, - BSC_CTR_PAGING_COMPLETED, - BSC_CTR_PAGING_EXPIRED, - BSC_CTR_CHAN_RF_FAIL, - BSC_CTR_CHAN_RLL_ERR, - BSC_CTR_BTS_OML_FAIL, - BSC_CTR_BTS_RSL_FAIL, - BSC_CTR_CODEC_AMR_F, - BSC_CTR_CODEC_AMR_H, - BSC_CTR_CODEC_EFR, - BSC_CTR_CODEC_V1_FR, - BSC_CTR_CODEC_V1_HR, -}; - -static const struct rate_ctr_desc bsc_ctr_description[] = { - [BSC_CTR_CHREQ_TOTAL] = {"chreq.total", "Received channel requests."}, - [BSC_CTR_CHREQ_NO_CHANNEL] = {"chreq.no_channel", "Sent to MS no channel available."}, - [BSC_CTR_HANDOVER_ATTEMPTED] = {"handover.attempted", "Received handover attempts."}, - [BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover.no_channel", "Sent no channel available responses."}, - [BSC_CTR_HANDOVER_TIMEOUT] = {"handover.timeout", "Count the amount of timeouts of timer T3103."}, - [BSC_CTR_HANDOVER_COMPLETED] = {"handover.completed", "Received handover completed."}, - [BSC_CTR_HANDOVER_FAILED] = {"handover.failed", "Receive HO FAIL messages."}, - [BSC_CTR_PAGING_ATTEMPTED] = {"paging.attempted", "Paging attempts for a MS."}, - [BSC_CTR_PAGING_DETACHED] = {"paging.detached", "Counts the amount of paging attempts which couldn't sent out any paging request because no responsible bts found."}, - [BSC_CTR_PAGING_COMPLETED] = {"paging.completed", "Paging successful completed."}, - [BSC_CTR_PAGING_EXPIRED] = {"paging.expired", "Paging Request expired because of timeout T3113."}, - [BSC_CTR_CHAN_RF_FAIL] = {"chan.rf_fail", "Received a RF failure indication from BTS."}, - [BSC_CTR_CHAN_RLL_ERR] = {"chan.rll_err", "Received a RLL failure with T200 cause from BTS."}, - [BSC_CTR_BTS_OML_FAIL] = {"bts.oml_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_BTS_RSL_FAIL] = {"bts.rsl_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_CODEC_AMR_F] = {"bts.codec_amr_f", "Count the usage of AMR/F codec by channel mode requested."}, - [BSC_CTR_CODEC_AMR_H] = {"bts.codec_amr_h", "Count the usage of AMR/H codec by channel mode requested."}, - [BSC_CTR_CODEC_EFR] = {"bts.codec_efr", "Count the usage of EFR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_FR] = {"bts.codec_fr", "Count the usage of FR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_HR] = {"bts.codec_hr", "Count the usage of HR codec by channel mode requested."}, -}; enum { MSC_CTR_LOC_UPDATE_TYPE_ATTACH, @@ -314,15 +257,6 @@ [MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total amount of calls that ever reached active state."}, [MSC_CTR_CALL_COMPLETE] = {"call:complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."}, [MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."}, -}; - - -static const struct rate_ctr_group_desc bsc_ctrg_desc = { - "bsc", - "base station controller", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bsc_ctr_description), - bsc_ctr_description, }; static const struct rate_ctr_group_desc msc_ctrg_desc = { @@ -401,9 +335,6 @@ */ struct llist_head trans_list; struct bsc_api *bsc_api; - - unsigned int num_bts; - struct llist_head bts_list; unsigned int paging_response_timer; @@ -525,11 +456,6 @@ extern void talloc_ctx_init(void *ctx_root); -enum gsm_bts_type parse_btstype(const char *arg); -const char *btstype2str(enum gsm_bts_type type); -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts); - extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; @@ -539,29 +465,8 @@ enum rrlp_mode rrlp_mode_parse(const char *arg); const char *rrlp_mode_name(enum rrlp_mode mode); -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); -const char *bts_gprs_mode_name(enum bts_gprs_mode mode); - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss); - -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); - -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); - -/* generic E1 line operations for all ISDN-based BTS. */ -extern struct e1inp_line_ops bts_isdn_e1inp_line_ops; - -extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1]; -extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 63f4d33..68b36ab 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -11,18 +11,7 @@ #include #include #include -#include -#include -#include #include -#include -#include -#include -#include - -#ifndef ROLE_BSC -#include -#endif #include @@ -39,35 +28,6 @@ RRLP_MODE_ASS_PREF, }; -/* Channel Request reason */ -enum gsm_chreq_reason_t { - GSM_CHREQ_REASON_EMERG, - GSM_CHREQ_REASON_PAG, - GSM_CHREQ_REASON_CALL, - GSM_CHREQ_REASON_LOCATION_UPD, - GSM_CHREQ_REASON_OTHER, - GSM_CHREQ_REASON_PDCH, -}; - -/* lchans 0..3 are SDCCH in combined channel configuration, - use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ -#define CCCH_LCHAN 4 - -#define TRX_NR_TS 8 -#define TS_MAX_LCHAN 8 - -#define HARDCODED_ARFCN 123 -#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ - -/* for multi-drop config */ -#define HARDCODED_BTS0_TS 1 -#define HARDCODED_BTS1_TS 6 -#define HARDCODED_BTS2_TS 11 - -#define MAX_VERSION_LENGTH 64 - -#define MAX_BTS_FEATURES 128 - enum gsm_hooks { GSM_HOOK_NM_SWLOAD, GSM_HOOK_RR_PAGING, @@ -81,852 +41,15 @@ GSM_PAGING_BUSY, }; -enum bts_gprs_mode { - BTS_GPRS_NONE = 0, - BTS_GPRS_GPRS = 1, - BTS_GPRS_EGPRS = 2, -}; - -struct gsm_lchan; struct gsm_mncc; struct osmo_rtp_socket; struct rtp_socket; struct bsc_api; - -/* Network Management State */ -struct gsm_nm_state { - uint8_t operational; - uint8_t administrative; - uint8_t availability; -}; - -struct gsm_abis_mo { - uint8_t obj_class; - uint8_t procedure_pending; - struct abis_om_obj_inst obj_inst; - const char *name; - struct gsm_nm_state nm_state; - struct tlv_parsed *nm_attr; - struct gsm_bts *bts; -}; - -/* Ericsson OM2000 Managed Object */ -struct abis_om2k_mo { - uint8_t class; - uint8_t bts; - uint8_t assoc_so; - uint8_t inst; -} __attribute__ ((packed)); - -struct om2k_mo { - struct abis_om2k_mo addr; - struct osmo_fsm_inst *fsm; -}; - -#define A38_XOR_MIN_KEY_LEN 12 -#define A38_XOR_MAX_KEY_LEN 16 -#define A38_COMP128_KEY_LEN 16 -#define RSL_ENC_ALG_A5(x) (x+1) -#define MAX_EARFCN_LIST 32 - -/* is the data link established? who established it? */ -#define LCHAN_SAPI_UNUSED 0 -#define LCHAN_SAPI_MS 1 -#define LCHAN_SAPI_NET 2 -#define LCHAN_SAPI_REL 3 - -/* state of a logical channel */ -enum gsm_lchan_state { - LCHAN_S_NONE, /* channel is not active */ - LCHAN_S_ACT_REQ, /* channel activation requested */ - LCHAN_S_ACTIVE, /* channel is active and operational */ - LCHAN_S_REL_REQ, /* channel release has been requested */ - LCHAN_S_REL_ERR, /* channel is in an error state */ - LCHAN_S_BROKEN, /* channel is somehow unusable */ - LCHAN_S_INACTIVE, /* channel is set inactive */ -}; - -/* BTS ONLY */ -#define MAX_NUM_UL_MEAS 104 -#define LC_UL_M_F_L1_VALID (1 << 0) -#define LC_UL_M_F_RES_VALID (1 << 1) - -struct bts_ul_meas { - /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ - uint16_t ber10k; - /* timing advance offset (in quarter bits) */ - int16_t ta_offs_qbits; - /* C/I ratio in dB */ - float c_i; - /* flags */ - uint8_t is_sub:1; - /* RSSI in dBm * -1 */ - uint8_t inv_rssi; -}; - -struct bts_codec_conf { - uint8_t hr; - uint8_t efr; - uint8_t amr; -}; - -struct amr_mode { - uint8_t mode; - uint8_t threshold; - uint8_t hysteresis; -}; - -struct amr_multirate_conf { - uint8_t gsm48_ie[2]; - struct amr_mode ms_mode[4]; - struct amr_mode bts_mode[4]; - uint8_t num_modes; -}; -/* /BTS ONLY */ - -enum lchan_csd_mode { - LCHAN_CSD_M_NT, - LCHAN_CSD_M_T_1200_75, - LCHAN_CSD_M_T_600, - LCHAN_CSD_M_T_1200, - LCHAN_CSD_M_T_2400, - LCHAN_CSD_M_T_9600, - LCHAN_CSD_M_T_14400, - LCHAN_CSD_M_T_29000, - LCHAN_CSD_M_T_32000, -}; - -/* State of the SAPIs in the lchan */ -enum lchan_sapi_state { - LCHAN_SAPI_S_NONE, - LCHAN_SAPI_S_REQ, - LCHAN_SAPI_S_ASSIGNED, - LCHAN_SAPI_S_REL, - LCHAN_SAPI_S_ERROR, -}; - -struct gsm_lchan { - /* The TS that we're part of */ - struct gsm_bts_trx_ts *ts; - /* The logical subslot number in the TS */ - uint8_t nr; - /* The logical channel type */ - enum gsm_chan_t type; - /* RSL channel mode */ - enum rsl_cmod_spd rsl_cmode; - /* If TCH, traffic channel mode */ - enum gsm48_chan_mode tch_mode; - enum lchan_csd_mode csd_mode; - /* State */ - enum gsm_lchan_state state; - const char *broken_reason; - /* Power levels for MS and BTS */ - uint8_t bs_power; - uint8_t ms_power; - /* Encryption information */ - struct gsm_encr encr; - - /* AMR bits */ - uint8_t mr_ms_lv[7]; - uint8_t mr_bts_lv[7]; - - /* Established data link layer services */ - uint8_t sapis[8]; - int sacch_deact; - - struct { - uint32_t bound_ip; - uint32_t connect_ip; - uint16_t bound_port; - uint16_t connect_port; - uint16_t conn_id; - uint8_t rtp_payload; - uint8_t rtp_payload2; - uint8_t speech_mode; -#ifdef ROLE_BSC - struct rtp_socket *rtp_socket; - - /* info we need to postpone the AoIP - * assignment completed message */ - struct { - uint8_t rr_cause; - uint8_t chosen_channel; - uint8_t encr_alg_id; - uint8_t speech_mode; - bool valid; - } ass_compl; -#else - struct osmo_rtp_socket *rtp_socket; -#endif - } abis_ip; - - uint8_t rqd_ta; - - char *name; - -#ifdef ROLE_BSC - struct osmo_timer_list T3101; - struct osmo_timer_list T3109; - struct osmo_timer_list T3111; - struct osmo_timer_list error_timer; - struct osmo_timer_list act_timer; - struct osmo_timer_list rel_work; - uint8_t error_cause; - - /* table of neighbor cell measurements */ - struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; - - /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; - int meas_rep_idx; - - /* GSM Random Access data */ - struct gsm48_req_ref *rqd_ref; - - struct gsm_subscriber_connection *conn; - - struct { - /* channel activation type and handover ref */ - uint8_t act_type; - uint8_t ho_ref; - struct gsm48_req_ref *rqd_ref; - uint8_t rqd_ta; - } dyn; -#else - /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. - * Currently we don't share these headers so this is a magic number. */ - struct llist_head sapi_cmds; - uint8_t sapis_dl[23]; - uint8_t sapis_ul[23]; - struct lapdm_channel lapdm_ch; - struct llist_head dl_tch_queue; - struct { - /* bitmask of all SI that are present/valid in si_buf */ - uint32_t valid; - uint32_t last; - /* buffers where we put the pre-computed SI: - SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ - sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; - } si; - struct { - uint8_t flags; - /* RSL measurment result number, 0 at lchan_act */ - uint8_t res_nr; - /* current Tx power level of the BTS */ - uint8_t bts_tx_pwr; - /* number of measurements stored in array below */ - uint8_t num_ul_meas; - struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; - /* last L1 header from the MS */ - uint8_t l1_info[2]; - struct gsm_meas_rep_unidir ul_res; - } meas; - struct { - struct amr_multirate_conf amr_mr; - struct { - struct osmo_fsm_inst *dl_amr_fsm; - /* TCH cache */ - uint8_t cache[20]; - /* FACCH cache */ - uint8_t facch[GSM_MACBLOCK_LEN]; - uint8_t len; - uint32_t fn; - bool is_update; - /* set for each SID frame to detect talkspurt for codecs - without explicit ONSET event */ - bool ul_sid; - /* indicates if DTXd was active during DL measurement - period */ - bool dl_active; - } dtx; - uint8_t last_cmr; - uint32_t last_fn; - } tch; - - /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ - int16_t ms_t_offs; - /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ - int16_t p_offs; - - /* BTS-side ciphering state (rx only, bi-directional, ...) */ - uint8_t ciph_state; - uint8_t ciph_ns; - uint8_t loopback; - struct { - uint8_t active; - uint8_t ref; - /* T3105: PHYS INF retransmission */ - struct osmo_timer_list t3105; - /* counts up to Ny1 */ - unsigned int phys_info_count; - } ho; - /* S counter for link loss */ - int s; - /* Kind of the release/activation. E.g. RSL or PCU */ - int rel_act_kind; - /* RTP header Marker bit to indicate beginning of speech after pause */ - bool rtp_tx_marker; - /* power handling */ - struct { - uint8_t current; - uint8_t fixed; - } ms_power_ctrl; - - struct msgb *pending_rel_ind_msg; -#endif -}; - -enum { - TS_F_PDCH_ACTIVE = 0x1000, - TS_F_PDCH_ACT_PENDING = 0x2000, - TS_F_PDCH_DEACT_PENDING = 0x4000, - TS_F_PDCH_PENDING_MASK = 0x6000 /*< - TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ -} gsm_bts_trx_ts_flags; - -/* One Timeslot in a TRX */ -struct gsm_bts_trx_ts { - struct gsm_bts_trx *trx; - /* number of this timeslot at the TRX */ - uint8_t nr; - - enum gsm_phys_chan_config pchan; - - struct { - enum gsm_phys_chan_config pchan_is; - enum gsm_phys_chan_config pchan_want; - struct msgb *pending_chan_activ; - } dyn; - - unsigned int flags; - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - uint8_t nm_chan_comb; - int tsc; /* -1 == use BTS TSC */ - - struct { - /* Parameters below are configured by VTY */ - int enabled; - uint8_t maio; - uint8_t hsn; - struct bitvec arfcns; - uint8_t arfcns_data[1024/8]; - /* This is the pre-computed MA for channel assignments */ - struct bitvec ma; - uint8_t ma_len; /* part of ma_data that is used */ - uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ - } hopping; - - /* To which E1 subslot are we connected */ - struct gsm_e1_subslot e1_link; - - union { - struct { - struct om2k_mo om2k_mo; - } rbs2000; - }; - - struct gsm_lchan lchan[TS_MAX_LCHAN]; -}; - -/* One TRX in a BTS */ -struct gsm_bts_trx { - /* list header in bts->trx_list */ - struct llist_head list; - - struct gsm_bts *bts; - /* number of this TRX in the BTS */ - uint8_t nr; - /* human readable name / description */ - char *description; - /* how do we talk RSL with this TRX? */ - struct gsm_e1_subslot rsl_e1_link; - uint8_t rsl_tei; - struct e1inp_sign_link *rsl_link; - - /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ - struct e1inp_sign_link *oml_link; - - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - struct { - struct gsm_abis_mo mo; - } bb_transc; - - uint16_t arfcn; - int nominal_power; /* in dBm */ - unsigned int max_power_red; /* in actual dB */ - -#ifndef ROLE_BSC - struct trx_power_params power_params; - int ms_power_control; - - struct { - void *l1h; - } role_bts; -#endif - - union { - struct { - struct { - struct gsm_abis_mo mo; - } bbsig; - struct { - struct gsm_abis_mo mo; - } pa; - } bs11; - struct { - unsigned int test_state; - uint8_t test_nr; - struct rxlev_stats rxlev_stat; - } ipaccess; - struct { - struct { - struct om2k_mo om2k_mo; - } trxc; - struct { - struct om2k_mo om2k_mo; - } rx; - struct { - struct om2k_mo om2k_mo; - } tx; - } rbs2000; - }; - struct gsm_bts_trx_ts ts[TRX_NR_TS]; -}; - -enum gsm_bts_type { - GSM_BTS_TYPE_UNKNOWN, - GSM_BTS_TYPE_BS11, - GSM_BTS_TYPE_NANOBTS, - GSM_BTS_TYPE_RBS2000, - GSM_BTS_TYPE_NOKIA_SITE, - GSM_BTS_TYPE_OSMOBTS, - _NUM_GSM_BTS_TYPE -}; - -enum gsm_bts_type_variant { - BTS_UNKNOWN, - BTS_OSMO_LITECELL15, - BTS_OSMO_OCTPHY, - BTS_OSMO_SYSMO, - BTS_OSMO_TRX, - _NUM_BTS_VARIANT -}; - -/* Used by OML layer for BTS Attribute reporting */ -enum bts_attribute { - BTS_TYPE_VARIANT, - BTS_SUB_MODEL, - TRX_PHY_VERSION, -}; - -struct vty; - -/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility - with BTS compiled against earlier version of this header */ -enum gsm_bts_features { - BTS_FEAT_HSCSD, - BTS_FEAT_GPRS, - BTS_FEAT_EGPRS, - BTS_FEAT_ECSD, - BTS_FEAT_HOPPING, - BTS_FEAT_MULTI_TSC, - BTS_FEAT_OML_ALERTS, - BTS_FEAT_AGCH_PCH_PROP, - BTS_FEAT_CBCH, - _NUM_BTS_FEAT -}; - -extern const struct value_string gsm_bts_features_descs[]; - -/* - * This keeps track of the paging status of one BTS. It - * includes a number of pending requests, a back pointer - * to the gsm_bts, a timer and some more state. - */ -struct gsm_bts_paging_state { - /* pending requests */ - struct llist_head pending_requests; - struct gsm_bts *bts; - - struct osmo_timer_list work_timer; - struct osmo_timer_list credit_timer; - - /* free chans needed */ - int free_chans_need; - - /* load */ - uint16_t available_slots; -}; - -struct gsm_envabtse { - struct gsm_abis_mo mo; -}; - -struct gsm_bts_gprs_nsvc { - struct gsm_bts *bts; - /* data read via VTY config file, to configure the BTS - * via OML from BSC */ - int id; - uint16_t nsvci; - uint16_t local_port; /* on the BTS */ - uint16_t remote_port; /* on the SGSN */ - uint32_t remote_ip; /* on the SGSN */ - - struct gsm_abis_mo mo; -}; - -enum gprs_rlc_par { - RLC_T3142, - RLC_T3169, - RLC_T3191, - RLC_T3193, - RLC_T3195, - RLC_N3101, - RLC_N3103, - RLC_N3105, - CV_COUNTDOWN, - T_DL_TBF_EXT, /* ms */ - T_UL_TBF_EXT, /* ms */ - _NUM_RLC_PAR -}; - -enum gprs_cs { - GPRS_CS1, - GPRS_CS2, - GPRS_CS3, - GPRS_CS4, - GPRS_MCS1, - GPRS_MCS2, - GPRS_MCS3, - GPRS_MCS4, - GPRS_MCS5, - GPRS_MCS6, - GPRS_MCS7, - GPRS_MCS8, - GPRS_MCS9, - _NUM_GRPS_CS -}; - -struct gprs_rlc_cfg { - uint16_t parameter[_NUM_RLC_PAR]; - struct { - uint16_t repeat_time; /* ms */ - uint8_t repeat_count; - } paging; - uint32_t cs_mask; /* bitmask of gprs_cs */ - uint8_t initial_cs; - uint8_t initial_mcs; -}; - - -enum neigh_list_manual_mode { - NL_MODE_AUTOMATIC = 0, - NL_MODE_MANUAL = 1, - NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ -}; - -enum bts_loc_fix { - BTS_LOC_FIX_INVALID = 0, - BTS_LOC_FIX_2D = 1, - BTS_LOC_FIX_3D = 2, -}; - -extern const struct value_string bts_loc_fix_names[]; - -struct bts_location { - struct llist_head list; - time_t tstamp; - enum bts_loc_fix valid; - double lat; - double lon; - double height; -}; - -/* One BTS */ -struct gsm_bts { - /* list header in net->bts_list */ - struct llist_head list; - - /* Geographical location of the BTS */ - struct llist_head loc_list; - - /* number of ths BTS in network */ - uint8_t nr; - /* human readable name / description */ - char *description; - /* Cell Identity */ - uint16_t cell_identity; - /* location area code of this BTS */ - uint16_t location_area_code; - /* Base Station Identification Code (BSIC), lower 3 bits is BCC, - * which is used as TSC for the CCCH */ - uint8_t bsic; - /* type of BTS */ - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - - enum gsm_band band; - char version[MAX_VERSION_LENGTH]; - char sub_model[MAX_VERSION_LENGTH]; - - /* features of a given BTS set/reported via OML */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; - - /* Connected PCU version (if any) */ - char pcu_version[MAX_VERSION_LENGTH]; - - /* maximum Tx power that the MS is permitted to use in this cell */ - int ms_max_power; - - /* how do we talk OML with this TRX? */ - struct gsm_e1_subslot oml_e1_link; - uint8_t oml_tei; - struct e1inp_sign_link *oml_link; - - /* Abis network management O&M handle */ - struct abis_nm_h *nmh; - - struct gsm_abis_mo mo; - - /* number of this BTS on given E1 link */ - uint8_t bts_nr; - - /* DTX features of this BTS */ - enum gsm48_dtx_mode dtxu; - bool dtxd; - - /* paging state and control */ - struct gsm_bts_paging_state paging; - - /* CCCH is on C0 */ - struct gsm_bts_trx *c0; - - struct { - struct gsm_abis_mo mo; - } site_mgr; - - /* ip.accesss Unit ID's have Site/BTS/TRX layout */ - union { - struct { - uint16_t site_id; - uint16_t bts_id; - uint32_t flags; - uint32_t rsl_ip; - } ip_access; - struct { - struct { - struct gsm_abis_mo mo; - } cclk; - struct { - struct gsm_abis_mo mo; - } rack; - struct gsm_envabtse envabtse[4]; - } bs11; - struct { - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } cf; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } is; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } con; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - } dp; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - } tf; - uint32_t use_superchannel:1; - } rbs2000; - struct { - uint8_t bts_type; - unsigned int configured:1, - skip_reset:1, - no_loc_rel_cnf:1, - bts_reset_timer_cnf, - did_reset:1, - wait_reset:1; - struct osmo_timer_list reset_timer; - } nokia; - }; - - /* Not entirely sure how ip.access specific this is */ - struct { - uint8_t supports_egprs_11bit_rach; - enum bts_gprs_mode mode; - struct { - struct gsm_abis_mo mo; - uint16_t nsei; - uint8_t timer[7]; - } nse; - struct { - struct gsm_abis_mo mo; - uint16_t bvci; - uint8_t timer[11]; - struct gprs_rlc_cfg rlc_cfg; - } cell; - struct gsm_bts_gprs_nsvc nsvc[2]; - uint8_t rac; - uint8_t net_ctrl_ord; - bool ctrl_ack_type_use_block; - } gprs; - - /* RACH NM values */ - int rach_b_thresh; - int rach_ldavg_slots; - - /* transceivers */ - int num_trx; - struct llist_head trx_list; - - /* SI related items */ - int force_combined_si; - int bcch_change_mark; - -#ifdef ROLE_BSC - /* Abis NM queue */ - struct llist_head abis_queue; - int abis_nm_pend; - - struct gsm_network *network; - - /* should the channel allocator allocate channels from high TRX to TRX0, - * rather than starting from TRX0 and go upwards? */ - int chan_alloc_reverse; - - enum neigh_list_manual_mode neigh_list_manual_mode; - - bool early_classmark_allowed; - /* for testing only: Have an infinitely long radio link timeout */ - bool infinite_radio_link_timeout; - - /* do we use static (user-defined) system information messages? (bitmask) */ - uint32_t si_mode_static; - - /* exclude the BTS from the global RF Lock handling */ - int excl_from_rf_lock; - - /* supported codecs beside FR */ - struct bts_codec_conf codec; - - /* BTS dependencies bit field */ - uint32_t depends_on[256/(8*4)]; - - /* full and half rate multirate config */ - struct amr_multirate_conf mr_full; - struct amr_multirate_conf mr_half; - - /* PCU socket state */ - char *pcu_sock_path; - struct pcu_sock_state *pcu_state; - -#endif /* ROLE_BSC */ - void *role; -}; - - -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); - -enum gsm_bts_type str2btstype(const char *arg); -const char *btstype2str(enum gsm_bts_type type); - -enum bts_attribute str2btsattr(const char *s); -const char *btsatttr2str(enum bts_attribute v); - -enum gsm_bts_type_variant str2btsvariant(const char *arg); -const char *btsvariant2str(enum gsm_bts_type_variant v); - -extern const struct value_string gsm_chreq_descs[]; -const struct value_string gsm_pchant_names[13]; -const struct value_string gsm_pchant_descs[13]; -const char *gsm_pchan_name(enum gsm_phys_chan_config c); -enum gsm_phys_chan_config gsm_pchan_parse(const char *name); -const char *gsm_lchant_name(enum gsm_chan_t c); -const char *gsm_chreq_name(enum gsm_chreq_reason_t c); -char *gsm_trx_name(const struct gsm_bts_trx *trx); -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); -const char *gsm_lchans_name(enum gsm_lchan_state s); - -static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) -{ - return lchan->name; -} - -static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&bts->features, feat, 1); -} - -static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&bts->features, feat); -} - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo); - -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); - -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts); - -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr); -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan); - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); /* * help with parsing regexps */ int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) __attribute__ ((warn_unused_result)); - -static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) -{ - if (ts->tsc != -1) - return ts->tsc; - else - return ts->trx->bts->bsic & 7; -} - -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc); - -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); -bool ts_is_tch(struct gsm_bts_trx_ts *ts); #endif diff --git a/include/osmocom/msc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h index 4adfd41..16e1037 100644 --- a/include/osmocom/msc/gsm_subscriber.h +++ b/include/osmocom/msc/gsm_subscriber.h @@ -66,4 +66,7 @@ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); +/* Find an allocated channel for a specified subscriber */ +struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/osmocom/msc/handover.h b/include/osmocom/msc/handover.h deleted file mode 100644 index 3fe71a2..0000000 --- a/include/osmocom/msc/handover.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _HANDOVER_H -#define _HANDOVER_H - -struct gsm_subscriber_connection; - -int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); - -/* clear any operation for this connection */ -void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); - -/* Return the old lchan or NULL. This is meant for audio handling */ -struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); - -#endif /* _HANDOVER_H */ diff --git a/include/osmocom/msc/handover_decision.h b/include/osmocom/msc/handover_decision.h deleted file mode 100644 index 81078b0..0000000 --- a/include/osmocom/msc/handover_decision.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _HANDOVER_DECISION_H -#define _HANDOVER_DECISION_H - -void on_dso_load_ho_dec(void); - -#endif /* _HANDOVER_DECISION_H */ - diff --git a/include/osmocom/msc/meas_rep.h b/include/osmocom/msc/meas_rep.h deleted file mode 100644 index b0c03f0..0000000 --- a/include/osmocom/msc/meas_rep.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef _MEAS_REP_H -#define _MEAS_REP_H - -#include - -#include - -#define MRC_F_PROCESSED 0x0001 - -/* extracted from a L3 measurement report IE */ -struct gsm_meas_rep_cell { - uint8_t rxlev; - uint8_t bsic; - uint8_t neigh_idx; - uint16_t arfcn; - unsigned int flags; -}; - -#define MEAS_REP_F_UL_DTX 0x01 -#define MEAS_REP_F_DL_VALID 0x02 -#define MEAS_REP_F_BA1 0x04 -#define MEAS_REP_F_DL_DTX 0x08 -#define MEAS_REP_F_MS_TO 0x10 -#define MEAS_REP_F_MS_L1 0x20 -#define MEAS_REP_F_FPC 0x40 - -/* parsed uplink and downlink measurement result */ -struct gsm_meas_rep { - /* back-pointer to the logical channel */ - struct gsm_lchan *lchan; - - /* number of the measurement report */ - uint8_t nr; - /* flags, see MEAS_REP_F_* */ - unsigned int flags; - - /* uplink and downlink rxlev, rxqual; full and sub */ - struct gsm_meas_rep_unidir ul; - struct gsm_meas_rep_unidir dl; - - uint8_t bs_power; - /* according to 3GPP TS 48.058 ? MS Timing Offset [-63; 192] */ - int16_t ms_timing_offset; - struct { - int8_t pwr; /* MS power in dBm */ - uint8_t ta; /* MS timing advance */ - } ms_l1; - - /* neighbor measurement reports for up to 6 cells */ - int num_cell; - struct gsm_meas_rep_cell cell[6]; -}; - -/* obtain an average over the last 'num' fields in the meas reps */ -int get_meas_rep_avg(const struct gsm_lchan *lchan, - enum meas_rep_field field, unsigned int num); - -/* Check if N out of M last values for FIELD are >= bd */ -int meas_rep_n_out_of_m_be(const struct gsm_lchan *lchan, - enum meas_rep_field field, - unsigned int n, unsigned int m, int be); - -unsigned int calc_initial_idx(unsigned int array_size, - unsigned int meas_rep_idx, - unsigned int num_values); - -#endif /* _MEAS_REP_H */ diff --git a/include/osmocom/msc/misdn.h b/include/osmocom/msc/misdn.h deleted file mode 100644 index 9851ad3..0000000 --- a/include/osmocom/msc/misdn.h +++ /dev/null @@ -1,27 +0,0 @@ -/* (C) 2008 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef MISDN_H -#define MISDN_H - -#include - -int mi_setup(int cardnr, struct e1inp_line *line, int release_l2); -int mi_e1_line_update(struct e1inp_line *line); - -#endif diff --git a/include/osmocom/msc/network_listen.h b/include/osmocom/msc/network_listen.h deleted file mode 100644 index 05fbb2f..0000000 --- a/include/osmocom/msc/network_listen.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _OPENBSC_NWL_H -#define _OPENBSC_NWL_H - -#include -#include - -void ipac_nwl_init(void); - -/* Start a NWL test. It will raise the S_IPAC_TEST_COMPLETE signal. */ -int ipac_nwl_test_start(struct gsm_bts_trx *trx, uint8_t testnr, - const uint8_t *phys_conf, unsigned int phys_conf_len); - -int ipac_rxlevstat2whitelist(uint16_t *buf, const struct rxlev_stats *st, uint8_t min_rxlev, - uint16_t max_num_arfcns); - -#endif /* _OPENBSC_NWL_H */ diff --git a/include/osmocom/msc/osmo_bsc.h b/include/osmocom/msc/osmo_bsc.h deleted file mode 100644 index 5ebea50..0000000 --- a/include/osmocom/msc/osmo_bsc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* OpenBSC BSC code */ - -#ifndef OSMO_BSC_H -#define OSMO_BSC_H - -#include "bsc_api.h" -#include "bsc_msg_filter.h" - -#define BSS_SEND_USSD 1 - -enum bsc_con { - BSC_CON_SUCCESS, - BSC_CON_REJECT_NO_LINK, - BSC_CON_REJECT_RF_GRACE, - BSC_CON_NO_MEM, -}; - -struct sccp_connection; -struct bsc_msc_data; -struct bsc_msc_connection; - -struct osmo_bsc_sccp_con { - struct llist_head entry; - - int ciphering_handled; - - /* for audio handling */ - uint16_t cic; - uint32_t rtp_ip; - int rtp_port; - - /* for advanced ping/pong */ - int send_ping; - - /* SCCP connection realted */ - struct sccp_connection *sccp; - struct bsc_msc_data *msc; - struct osmo_timer_list sccp_it_timeout; - struct osmo_timer_list sccp_cc_timeout; - - struct llist_head sccp_queue; - unsigned int sccp_queue_size; - - struct gsm_subscriber_connection *conn; - uint8_t new_subscriber; - - struct bsc_filter_state filter_state; - - /* Sigtran connection ID */ - int conn_id; -}; - -struct bsc_api *osmo_bsc_api(); - -int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg); -int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg); -enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, - struct bsc_msc_data *msc, int send_ping); -int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp); - -struct bsc_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *); -int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn); - -int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length); -int bsc_handle_dt(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len); - -int bsc_ctrl_cmds_install(); - -void bsc_gen_location_state_trap(struct gsm_bts *bts); - -struct llist_head *bsc_access_lists(void); - -#endif diff --git a/include/osmocom/msc/osmo_bsc_reset.h b/include/osmocom/msc/osmo_bsc_reset.h deleted file mode 100644 index 578f763..0000000 --- a/include/osmocom/msc/osmo_bsc_reset.h +++ /dev/null @@ -1,34 +0,0 @@ -/* (C) 2017 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* Create and start state machine which handles the reset/reset-ack procedure */ -void start_reset_fsm(struct bsc_msc_data *msc); - -/* Confirm that we sucessfully received a reset acknowlege message */ -void reset_ack_confirm(struct bsc_msc_data *msc); - -/* Report a failed connection */ -void report_conn_fail(struct bsc_msc_data *msc); - -/* Report a successful connection */ -void report_conn_success(struct bsc_msc_data *msc); - -/* Check if we have a connection to a specified msc */ -bool sccp_conn_ready(struct bsc_msc_data *msc); diff --git a/include/osmocom/msc/osmo_bsc_sigtran.h b/include/osmocom/msc/osmo_bsc_sigtran.h deleted file mode 100644 index 7015edb..0000000 --- a/include/osmocom/msc/osmo_bsc_sigtran.h +++ /dev/null @@ -1,48 +0,0 @@ -/* (C) 2017 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include -#include - -/* Allocate resources to make a new connection oriented sigtran connection - * (not the connection ittself!) */ -enum bsc_con osmo_bsc_sigtran_new_conn(struct gsm_subscriber_connection *conn, struct bsc_msc_data *msc); - -/* Open a new connection oriented sigtran connection */ -int osmo_bsc_sigtran_open_conn(const struct osmo_bsc_sccp_con *conn, struct msgb *msg); - -/* Send data to MSC */ -int osmo_bsc_sigtran_send(const struct osmo_bsc_sccp_con *conn, struct msgb *msg); - -/* Delete a connection from the list with open connections - * (called by osmo_bsc_api.c on failing open connections and - * locally, when a connection is closed by the MSC */ -int osmo_bsc_sigtran_del_conn(struct osmo_bsc_sccp_con *sccp); - -/* Initalize osmo sigtran backhaul */ -int osmo_bsc_sigtran_init(struct llist_head *mscs); - -/* Close all open sigtran connections and channels */ -void osmo_bsc_sigtran_reset(const struct bsc_msc_data *msc); - -/* Send reset-ack to MSC */ -void osmo_bsc_sigtran_tx_reset_ack(const struct bsc_msc_data *msc); diff --git a/include/osmocom/msc/osmux.h b/include/osmocom/msc/osmux.h deleted file mode 100644 index f3ea72a..0000000 --- a/include/osmocom/msc/osmux.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_OSMUX_H_ -#define _OPENBSC_OSMUX_H_ - -#include - -#define OSMUX_PORT 1984 - -enum { - OSMUX_ROLE_BSC = 0, - OSMUX_ROLE_BSC_NAT, -}; - -int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); -void osmux_disable_endpoint(struct mgcp_endpoint *endp); -void osmux_allocate_cid(struct mgcp_endpoint *endp); -void osmux_release_cid(struct mgcp_endpoint *endp); - -int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc); -int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp); - -int osmux_send_dummy(struct mgcp_endpoint *endp); - -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); - -enum osmux_state { - OSMUX_STATE_DISABLED = 0, - OSMUX_STATE_NEGOTIATING, - OSMUX_STATE_ACTIVATING, - OSMUX_STATE_ENABLED, -}; - -enum osmux_usage { - OSMUX_USAGE_OFF = 0, - OSMUX_USAGE_ON = 1, - OSMUX_USAGE_ONLY = 2, -}; - -#endif diff --git a/include/osmocom/msc/rs232.h b/include/osmocom/msc/rs232.h deleted file mode 100644 index 61187ca..0000000 --- a/include/osmocom/msc/rs232.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _RS232_H -#define _RS232_H - -int rs232_setup(const char *serial_port, unsigned int delay_ms, - struct gsm_bts *bts); - -int handle_serial_msg(struct msgb *msg); - -#endif /* _RS232_H */ diff --git a/include/osmocom/msc/rtp_proxy.h b/include/osmocom/msc/rtp_proxy.h deleted file mode 100644 index 3cd8cac..0000000 --- a/include/osmocom/msc/rtp_proxy.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _RTP_PROXY_H -#define _RTP_PROXY_H - -/* RTP proxy handling for ip.access nanoBTS */ - -/* (C) 2009 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include - -#include -#include - -#include - -#define RTP_PT_GSM_FULL 3 -#define RTP_PT_GSM_HALF 96 -#define RTP_PT_GSM_EFR 97 -#define RTP_PT_AMR 98 -#define RTP_LEN_GSM_FULL 33 -#define RTP_LEN_GSM_HALF 15 -#define RTP_LEN_GSM_EFR 31 -#define RTP_GSM_DURATION 160 - -enum rtp_rx_action { - RTP_NONE, - RTP_PROXY, - RTP_RECV_UPSTREAM, -}; - -enum rtp_tx_action { - RTP_SEND_NONE, - RTP_SEND_DOWNSTREAM, -}; - -struct rtp_sub_socket { - struct sockaddr_in sin_local; - struct sockaddr_in sin_remote; - - struct osmo_fd bfd; - /* linked list of to-be-transmitted msgb's */ - struct llist_head tx_queue; -}; - -struct rtp_socket { - struct llist_head list; - - struct rtp_sub_socket rtp; - struct rtp_sub_socket rtcp; - - /* what should we do on receive? */ - enum rtp_rx_action rx_action; - union { - struct { - struct rtp_socket *other_sock; - } proxy; - struct { - struct gsm_network *net; - uint32_t callref; - } receive; - }; - enum rtp_tx_action tx_action; - struct { - uint16_t sequence; - uint32_t timestamp; - uint32_t ssrc; - struct timeval last_tv; - } transmit; -}; - -struct rtp_socket *rtp_socket_create(void); -int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip); -int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port); -int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other); -int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, uint32_t callref); -int rtp_socket_free(struct rtp_socket *rs); -int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame); - -#endif /* _RTP_PROXY_H */ diff --git a/include/osmocom/msc/signal.h b/include/osmocom/msc/signal.h index 14c76f8..29b6a59 100644 --- a/include/osmocom/msc/signal.h +++ b/include/osmocom/msc/signal.h @@ -35,18 +35,10 @@ enum signal_subsystems { SS_PAGING, SS_SMS, - SS_ABISIP, - SS_NM, - SS_LCHAN, SS_SUBSCR, SS_SCALL, - SS_CHALLOC, - SS_IPAC_NWL, - SS_RF, SS_MSC, - SS_HO, SS_CCCH, - SS_SGSN, }; /* SS_PAGING signals */ @@ -62,50 +54,6 @@ S_SMS_SMMA, /* A MS tells us it has more space available */ S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */ S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */ -}; - -/* SS_ABISIP signals */ -enum signal_abisip { - S_ABISIP_CRCX_ACK, - S_ABISIP_MDCX_ACK, - S_ABISIP_DLCX_IND, -}; - -/* SS_NM signals */ -enum signal_nm { - S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */ - S_NM_FAIL_REP, /* GSM 12.21 failure event report */ - S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */ - S_NM_IPACC_NACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_NACK happened */ - S_NM_IPACC_ACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_ACK happened */ - S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */ - S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */ - S_NM_TEST_REP, /* GSM 12.21 Test Report */ - S_NM_STATECHG_OPER, /* Operational State changed*/ - S_NM_STATECHG_ADM, /* Administrative State changed */ - S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */ -}; - -/* SS_LCHAN signals */ -enum signal_lchan { - /* - * The lchan got freed with an use_count != 0 and error - * recovery needs to be carried out from within the - * signal handler. - */ - S_LCHAN_UNEXPECTED_RELEASE, - S_LCHAN_ACTIVATE_ACK, /* 08.58 Channel Activate ACK */ - S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */ - S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */ - S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */ - S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */ - S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */ -}; - -/* SS_CHALLOC signals */ -enum signal_challoc { - S_CHALLOC_ALLOC_FAIL, /* allocation of lchan has failed */ - S_CHALLOC_FREED, /* lchan has been successfully freed */ }; /* SS_SUBSCR signals */ @@ -131,13 +79,6 @@ S_GLOBAL_BTS_CLOSE_OM, }; -/* SS_RF signals */ -enum signal_rf { - S_RF_OFF, - S_RF_ON, - S_RF_GRACE, -}; - struct paging_signal_data { struct vlr_subscr *vsub; struct gsm_bts *bts; @@ -152,51 +93,6 @@ struct gsm_subscriber_connection *conn; void *data; }; - -struct ipacc_ack_signal_data { - struct gsm_bts_trx *trx; - uint8_t msg_type; -}; - -struct abis_om2k_mo; - -struct nm_statechg_signal_data { - struct gsm_bts *bts; - uint8_t obj_class; - void *obj; - struct gsm_nm_state *old_state; - struct gsm_nm_state *new_state; - - /* This pointer is vaold for TS 12.21 MO */ - struct abis_om_obj_inst *obj_inst; - /* This pointer is vaold for RBS2000 MO */ - struct abis_om2k_mo *om2k_mo; -}; - -struct nm_om2k_signal_data { - struct gsm_bts *bts; - void *obj; - struct abis_om2k_mo *om2k_mo; - - uint8_t accordance_ind; -}; - -struct nm_nack_signal_data { - struct msgb *msg; - struct gsm_bts *bts; - uint8_t mt; -}; - -struct challoc_signal_data { - struct gsm_bts *bts; - struct gsm_lchan *lchan; - enum gsm_chan_t type; -}; - -struct rf_signal_data { - struct gsm_network *net; -}; - struct sms_signal_data { /* The transaction where this occured */ struct gsm_trans *trans; @@ -204,13 +100,6 @@ struct gsm_sms *sms; /* int paging result. Only the ones with > 0 */ int paging_result; -}; - -struct lchan_signal_data { - /* The lchan the signal happened on */ - struct gsm_lchan *lchan; - /* Measurement reports on this lchan */ - struct gsm_meas_rep *mr; }; /* MSC signals */ @@ -223,38 +112,6 @@ struct bsc_msc_data; struct msc_signal_data { struct bsc_msc_data *data; -}; - -/* SS_CCCH signals */ -enum signal_ccch { - S_CCCH_PAGING_LOAD, - S_CCCH_RACH_LOAD, -}; - -struct ccch_signal_data { - struct gsm_bts *bts; - uint16_t pg_buf_space; - uint16_t rach_slot_count; - uint16_t rach_busy_count; - uint16_t rach_access_count; -}; - -/* GPRS SGSN signals SS_SGSN */ -enum signal_sgsn { - S_SGSN_ATTACH, - S_SGSN_DETACH, - S_SGSN_UPDATE, - S_SGSN_PDP_ACT, - S_SGSN_PDP_DEACT, - S_SGSN_PDP_TERMINATE, - S_SGSN_PDP_FREE, - S_SGSN_MM_FREE, -}; - -struct sgsn_mm_ctx; -struct sgsn_signal_data { - struct sgsn_mm_ctx *mm; - struct sgsn_pdp_ctx *pdp; /* non-NULL for PDP_ACT, PDP_DEACT, PDP_FREE */ }; #endif diff --git a/include/osmocom/msc/slhc.h b/include/osmocom/msc/slhc.h deleted file mode 100644 index cd5a47c..0000000 --- a/include/osmocom/msc/slhc.h +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef _SLHC_H -#define _SLHC_H -/* - * Definitions for tcp compression routines. - * - * $Header: slcompress.h,v 1.10 89/12/31 08:53:02 van Exp $ - * - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: - * - Initial distribution. - * - * - * modified for KA9Q Internet Software Package by - * Katie Stevens (dkstevens at ucdavis.edu) - * University of California, Davis - * Computing Services - * - 01-31-90 initial adaptation - * - * - Feb 1991 Bill_Simpson at um.cc.umich.edu - * variable number of conversation slots - * allow zero or one slots - * separate routines - * status display - */ - -/* - * Compressed packet format: - * - * The first octet contains the packet type (top 3 bits), TCP - * 'push' bit, and flags that indicate which of the 4 TCP sequence - * numbers have changed (bottom 5 bits). The next octet is a - * conversation number that associates a saved IP/TCP header with - * the compressed packet. The next two octets are the TCP checksum - * from the original datagram. The next 0 to 15 octets are - * sequence number changes, one change per bit set in the header - * (there may be no changes and there are two special cases where - * the receiver implicitly knows what changed -- see below). - * - * There are 5 numbers which can change (they are always inserted - * in the following order): TCP urgent pointer, window, - * acknowledgment, sequence number and IP ID. (The urgent pointer - * is different from the others in that its value is sent, not the - * change in value.) Since typical use of SLIP links is biased - * toward small packets (see comments on MTU/MSS below), changes - * use a variable length coding with one octet for numbers in the - * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the - * range 256 - 65535 or 0. (If the change in sequence number or - * ack is more than 65535, an uncompressed packet is sent.) - */ - -/* - * Packet types (must not conflict with IP protocol version) - * - * The top nibble of the first octet is the packet type. There are - * three possible types: IP (not proto TCP or tcp with one of the - * control flags set); uncompressed TCP (a normal IP/TCP packet but - * with the 8-bit protocol field replaced by an 8-bit connection id -- - * this type of packet syncs the sender & receiver); and compressed - * TCP (described above). - * - * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and - * is logically part of the 4-bit "changes" field that follows. Top - * three bits are actual packet type. For backward compatibility - * and in the interest of conserving bits, numbers are chosen so the - * IP protocol version number (4) which normally appears in this nibble - * means "IP packet". - */ - - -#include -#include - -/* SLIP compression masks for len/vers byte */ -#define SL_TYPE_IP 0x40 -#define SL_TYPE_UNCOMPRESSED_TCP 0x70 -#define SL_TYPE_COMPRESSED_TCP 0x80 -#define SL_TYPE_ERROR 0x00 - -/* Bits in first octet of compressed packet */ -#define NEW_C 0x40 /* flag bits for what changed in a packet */ -#define NEW_I 0x20 -#define NEW_S 0x08 -#define NEW_A 0x04 -#define NEW_W 0x02 -#define NEW_U 0x01 - -/* reserved, special-case values of above */ -#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */ -#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */ -#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U) - -#define TCP_PUSH_BIT 0x10 - -/* - * data type and sizes conversion assumptions: - * - * VJ code KA9Q style generic - * u_char byte_t unsigned char 8 bits - * u_short int16 unsigned short 16 bits - * u_int int16 unsigned short 16 bits - * u_long unsigned long unsigned long 32 bits - * int int32 long 32 bits - */ - -typedef __u8 byte_t; -typedef __u32 int32; - -/* - * "state" data for each active tcp conversation on the wire. This is - * basically a copy of the entire IP/TCP header from the last packet - * we saw from the conversation together with a small identifier - * the transmit & receive ends of the line use to locate saved header. - */ -struct cstate { - byte_t cs_this; /* connection id number (xmit) */ - struct cstate *next; /* next in ring (xmit) */ - struct iphdr cs_ip; /* ip/tcp hdr from most recent packet */ - struct tcphdr cs_tcp; - unsigned char cs_ipopt[64]; - unsigned char cs_tcpopt[64]; - int cs_hsize; -}; -#define NULLSLSTATE (struct cstate *)0 - -/* - * all the state data for one serial line (we need one of these per line). - */ -struct slcompress { - struct cstate *tstate; /* transmit connection states (array)*/ - struct cstate *rstate; /* receive connection states (array)*/ - - byte_t tslot_limit; /* highest transmit slot id (0-l)*/ - byte_t rslot_limit; /* highest receive slot id (0-l)*/ - - byte_t xmit_oldest; /* oldest xmit in ring */ - byte_t xmit_current; /* most recent xmit id */ - byte_t recv_current; /* most recent rcvd id */ - - byte_t flags; -#define SLF_TOSS 0x01 /* tossing rcvd frames until id received */ - - int32 sls_o_nontcp; /* outbound non-TCP packets */ - int32 sls_o_tcp; /* outbound TCP packets */ - int32 sls_o_uncompressed; /* outbound uncompressed packets */ - int32 sls_o_compressed; /* outbound compressed packets */ - int32 sls_o_searches; /* searches for connection state */ - int32 sls_o_misses; /* times couldn't find conn. state */ - - int32 sls_i_uncompressed; /* inbound uncompressed packets */ - int32 sls_i_compressed; /* inbound compressed packets */ - int32 sls_i_error; /* inbound error packets */ - int32 sls_i_tossed; /* inbound packets tossed because of error */ - - int32 sls_i_runt; - int32 sls_i_badcheck; -}; -#define NULLSLCOMPR (struct slcompress *)0 - -/* In slhc.c: */ -struct slcompress *slhc_init(const void *ctx, int rslots, int tslots); - -void slhc_free(struct slcompress *comp); - -int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, - unsigned char *ocp, unsigned char **cpp, int compress_cid); -int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize); -int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize); -int slhc_toss(struct slcompress *comp); - -void slhc_i_status(struct slcompress *comp); -void slhc_o_status(struct slcompress *comp); - -#endif /* _SLHC_H */ diff --git a/include/osmocom/msc/system_information.h b/include/osmocom/msc/system_information.h deleted file mode 100644 index 854b7e3..0000000 --- a/include/osmocom/msc/system_information.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SYSTEM_INFO_H -#define _SYSTEM_INFO_H - -#include - -#include - -struct gsm_bts; - -int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type); -size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e); -unsigned range1024_p(unsigned n); -unsigned range512_q(unsigned m); -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); -#endif diff --git a/include/osmocom/msc/trau_mux.h b/include/osmocom/msc/trau_mux.h deleted file mode 100644 index 08863bf..0000000 --- a/include/osmocom/msc/trau_mux.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Simple TRAU frame reflector to route voice calls */ - -/* (C) 2009 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* The "TRAU mux map" defines which particular 16kbit sub-slot (in which E1 - * timeslot on which E1 interface) should be directly muxed to which other - * sub-slot. Entries in the mux map are always bi-directional. - * - * The idea of all this is to directly switch voice channels in the BSC - * from one phone to another. We do this right now since we don't support - * any external interface for voice channels, and in the future as an - * optimization to routing them externally. - */ - -#include -#include -#include - -struct decoded_trau_frame; - -/* map a TRAU mux map entry */ -int trau_mux_map(const struct gsm_e1_subslot *src, - const struct gsm_e1_subslot *dst); -int trau_mux_map_lchan(const struct gsm_lchan *src, - const struct gsm_lchan *dst); - -/* unmap a TRAU mux map entry */ -int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref); - -/* we get called by subchan_demux */ -int trau_mux_input(struct gsm_e1_subslot *src_e1_ss, - const uint8_t *trau_bits, int num_bits); - -/* add a trau receiver */ -int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref); - -/* send trau from application */ -int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame); - -/* switch trau muxer to new lchan */ -int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan); - -/* callback invoked if we receive TRAU frames */ -int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, void *_priv); - -/* TRAU frame transcoding */ -struct msgb *trau_decode_fr(uint32_t callref, - const struct decoded_trau_frame *tf); -struct msgb *trau_decode_efr(uint32_t callref, - const struct decoded_trau_frame *tf); -void trau_encode_fr(struct decoded_trau_frame *tf, - const unsigned char *data); -void trau_encode_efr(struct decoded_trau_frame *tf, - const unsigned char *data); diff --git a/include/osmocom/msc/trau_upqueue.h b/include/osmocom/msc/trau_upqueue.h deleted file mode 100644 index ecc7658..0000000 --- a/include/osmocom/msc/trau_upqueue.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _TRAU_UPQUEUE_H -#define _TRAU_UPQUEUE_H - -void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg); - -#endif /* _TRAU_UPQUEUE_H */ - diff --git a/include/osmocom/msc/vty.h b/include/osmocom/msc/vty.h index f705601..ff85fa0 100644 --- a/include/osmocom/msc/vty.h +++ b/include/osmocom/msc/vty.h @@ -17,27 +17,11 @@ enum bsc_vty_node { GSMNET_NODE = _LAST_OSMOVTY_NODE + 1, - BTS_NODE, - TRX_NODE, - TS_NODE, SUBSCR_NODE, - MGCP_NODE, - GBPROXY_NODE, - SGSN_NODE, - OML_NODE, - NAT_NODE, - NAT_BSC_NODE, MSC_NODE, - OM2K_NODE, - OM2K_CON_GROUP_NODE, - TRUNK_NODE, - PGROUP_NODE, MNCC_INT_NODE, - NITB_NODE, - BSC_NODE, SMPP_NODE, SMPP_ESME_NODE, - GTPHUB_NODE, HLR_NODE, }; diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index 3ee0058..d2f4f59 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -27,7 +27,6 @@ #include #include #include -#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 18272c5..8f70da7 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -24,7 +24,6 @@ common_vty.c \ debug.c \ gsm_data.c \ - gsm_data_shared.c \ gsup_client.c \ oap_client.c \ socket.c \ diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 6037dda..71c607e 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -42,25 +42,11 @@ vty->node = CONFIG_NODE; vty->index = NULL; break; - case TS_NODE: - vty->node = TRX_NODE; - { - /* set vty->index correctly ! */ - struct gsm_bts_trx_ts *ts = vty->index; - vty->index = ts->trx; - vty->index_sub = &ts->trx->description; - } - break; - case TRUNK_NODE: - vty->node = MGCP_NODE; - vty->index = NULL; - break; case SMPP_ESME_NODE: vty->node = SMPP_NODE; vty->index = NULL; break; case SMPP_NODE: - case MGCP_NODE: case MSC_NODE: case MNCC_INT_NODE: vty->node = CONFIG_NODE; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 4ab8a20..bdcdf02 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -29,73 +29,13 @@ #include #include #include -#include #include #include #include #include -#include void *tall_bsc_ctx; - -static LLIST_HEAD(bts_models); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss) -{ - ts->e1_link.e1_nr = e1_nr; - ts->e1_link.e1_ts = e1_ts; - ts->e1_link.e1_ts_ss = e1_ts_ss; -} - -const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { - { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, - { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, - { GSM_BTS_TYPE_NANOBTS, "ip.access nanoBTS or compatible" }, - { GSM_BTS_TYPE_RBS2000, "Ericsson RBS2000 Series" }, - { GSM_BTS_TYPE_NOKIA_SITE, "Nokia {Metro,Ultra,In}Site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" }, - { 0, NULL } -}; - -struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr) -{ - struct gsm_bts_trx *trx; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == nr) - return trx; - } - return NULL; -} - -/* Search for a BTS in the given Location Area; optionally start searching - * with start_bts (for continuing to search after the first result) */ -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts) -{ - int i; - struct gsm_bts *bts; - int skip = 0; - - if (start_bts) - skip = 1; - - for (i = 0; i < net->num_bts; i++) { - bts = gsm_bts_num(net, i); - - if (skip) { - if (start_bts == bts) - skip = 0; - continue; - } - - if (lac == GSM_LAC_RESERVED_ALL_BTS || bts->location_area_code == lac) - return bts; - } - return NULL; -} static const struct value_string auth_policy_names[] = { { GSM_AUTH_POLICY_CLOSED, "closed" }, @@ -133,45 +73,6 @@ return get_value_string(rrlp_mode_names, mode); } -static const struct value_string bts_gprs_mode_names[] = { - { BTS_GPRS_NONE, "none" }, - { BTS_GPRS_GPRS, "gprs" }, - { BTS_GPRS_EGPRS, "egprs" }, - { 0, NULL } -}; - -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid) -{ - int rc; - - rc = get_string_value(bts_gprs_mode_names, arg); - if (valid) - *valid = rc != -EINVAL; - return rc; -} - -const char *bts_gprs_mode_name(enum bts_gprs_mode mode) -{ - return get_value_string(bts_gprs_mode_names, mode); -} - -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; @@ -196,9 +97,6 @@ return ret; } - -/* Assume there are only 256 possible bts */ -osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); bool classmark_is_r99(struct gsm_classmark *cm) { diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c deleted file mode 100644 index 9382889..0000000 --- a/src/libcommon/gsm_data_shared.c +++ /dev/null @@ -1,853 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo) -{ - mo->nm_state.operational = NM_OPSTATE_NULL; - mo->nm_state.availability = NM_AVSTATE_POWER_OFF; -} - -static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, - uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) -{ - mo->bts = bts; - mo->obj_class = obj_class; - mo->obj_inst.bts_nr = p1; - mo->obj_inst.trx_nr = p2; - mo->obj_inst.ts_nr = p3; - gsm_abis_mo_reset(mo); -} - -const struct value_string bts_attribute_names[] = { - OSMO_VALUE_STRING(BTS_TYPE_VARIANT), - OSMO_VALUE_STRING(BTS_SUB_MODEL), - OSMO_VALUE_STRING(TRX_PHY_VERSION), - { 0, NULL } -}; - -enum bts_attribute str2btsattr(const char *s) -{ - return get_string_value(bts_attribute_names, s); -} - -const char *btsatttr2str(enum bts_attribute v) -{ - return get_value_string(bts_attribute_names, v); -} - -const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { - { BTS_UNKNOWN, "unknown" }, - { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, - { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, - { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, - { 0, NULL } -}; - -enum gsm_bts_type_variant str2btsvariant(const char *arg) -{ - return get_string_value(osmo_bts_variant_names, arg); -} - -const char *btsvariant2str(enum gsm_bts_type_variant v) -{ - return get_value_string(osmo_bts_variant_names, v); -} - -const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { - { GSM_BTS_TYPE_UNKNOWN, "unknown" }, - { GSM_BTS_TYPE_BS11, "bs11" }, - { GSM_BTS_TYPE_NANOBTS, "nanobts" }, - { GSM_BTS_TYPE_RBS2000, "rbs2000" }, - { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, - { 0, NULL } -}; - -enum gsm_bts_type str2btstype(const char *arg) -{ - return get_string_value(bts_type_names, arg); -} - -const char *btstype2str(enum gsm_bts_type type) -{ - return get_value_string(bts_type_names, type); -} - -const struct value_string gsm_bts_features_descs[] = { - { BTS_FEAT_HSCSD, "HSCSD" }, - { BTS_FEAT_GPRS, "GPRS" }, - { BTS_FEAT_EGPRS, "EGPRS" }, - { BTS_FEAT_ECSD, "ECSD" }, - { BTS_FEAT_HOPPING, "Frequency Hopping" }, - { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, - { BTS_FEAT_OML_ALERTS, "OML Alerts" }, - { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, - { BTS_FEAT_CBCH, "CBCH" }, - { 0, NULL } -}; - -const struct value_string gsm_chreq_descs[] = { - { GSM_CHREQ_REASON_EMERG, "emergency call" }, - { GSM_CHREQ_REASON_PAG, "answer to paging" }, - { GSM_CHREQ_REASON_CALL, "call re-establishment" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, - { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, - { GSM_CHREQ_REASON_OTHER, "other" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_names[13] = { - { GSM_PCHAN_NONE, "NONE" }, - { GSM_PCHAN_CCCH, "CCCH" }, - { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, - { GSM_PCHAN_TCH_F, "TCH/F" }, - { GSM_PCHAN_TCH_H, "TCH/H" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, - { GSM_PCHAN_PDCH, "PDCH" }, - { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, - { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_descs[13] = { - { GSM_PCHAN_NONE, "Physical Channel not configured" }, - { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, - { GSM_PCHAN_CCCH_SDCCH4, - "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, - { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, - { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, - { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, - { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, - { 0, NULL } -}; - -const char *gsm_pchan_name(enum gsm_phys_chan_config c) -{ - return get_value_string(gsm_pchant_names, c); -} - -enum gsm_phys_chan_config gsm_pchan_parse(const char *name) -{ - return get_string_value(gsm_pchant_names, name); -} - -/* TODO: move to libosmocore, next to gsm_chan_t_names? */ -const char *gsm_lchant_name(enum gsm_chan_t c) -{ - return get_value_string(gsm_chan_t_names, c); -} - -static const struct value_string lchan_s_names[] = { - { LCHAN_S_NONE, "NONE" }, - { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, - { LCHAN_S_ACTIVE, "ACTIVE" }, - { LCHAN_S_INACTIVE, "INACTIVE" }, - { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, - { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, - { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, - { 0, NULL } -}; - -const char *gsm_lchans_name(enum gsm_lchan_state s) -{ - return get_value_string(lchan_s_names, s); -} - -static const struct value_string chreq_names[] = { - { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, - { GSM_CHREQ_REASON_PAG, "PAGING" }, - { GSM_CHREQ_REASON_CALL, "CALL" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, - { GSM_CHREQ_REASON_OTHER, "OTHER" }, - { 0, NULL } -}; - -const char *gsm_chreq_name(enum gsm_chreq_reason_t c) -{ - return get_value_string(chreq_names, c); -} - -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) -{ - struct gsm_bts *bts; - - if (num >= net->num_bts) - return NULL; - - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == num) - return bts; - } - - return NULL; -} - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); - int k; - - if (!trx) - return NULL; - - trx->bts = bts; - trx->nr = bts->num_trx++; - trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; - - gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, - bts->nr, trx->nr, 0xff); - gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, - bts->nr, trx->nr, 0xff); - - for (k = 0; k < TRX_NR_TS; k++) { - struct gsm_bts_trx_ts *ts = &trx->ts[k]; - int l; - - ts->trx = trx; - ts->nr = k; - ts->pchan = GSM_PCHAN_NONE; - ts->dyn.pchan_is = GSM_PCHAN_NONE; - ts->dyn.pchan_want = GSM_PCHAN_NONE; - ts->tsc = -1; - - gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, - bts->nr, trx->nr, ts->nr); - - ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); - ts->hopping.arfcns.data = ts->hopping.arfcns_data; - ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); - ts->hopping.ma.data = ts->hopping.ma_data; - - for (l = 0; l < TS_MAX_LCHAN; l++) { - struct gsm_lchan *lchan; - char *name; - lchan = &ts->lchan[l]; - - lchan->ts = ts; - lchan->nr = l; - lchan->type = GSM_LCHAN_NONE; - - name = gsm_lchan_name_compute(lchan); - lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC - INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif - } - } - - if (trx->nr != 0) - trx->nominal_power = bts->c0->nominal_power; - - llist_add_tail(&trx->list, &bts->trx_list); - - return trx; -} - - -static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; -static const uint8_t bts_cell_timer_default[] = - { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; -static const struct gprs_rlc_cfg rlc_cfg_default = { - .parameter = { - [RLC_T3142] = 20, - [RLC_T3169] = 5, - [RLC_T3191] = 5, - [RLC_T3193] = 160, /* 10ms */ - [RLC_T3195] = 5, - [RLC_N3101] = 10, - [RLC_N3103] = 4, - [RLC_N3105] = 8, - [CV_COUNTDOWN] = 15, - [T_DL_TBF_EXT] = 250 * 10, /* ms */ - [T_UL_TBF_EXT] = 250 * 10, /* ms */ - }, - .paging = { - .repeat_time = 5 * 50, /* ms */ - .repeat_count = 3, - }, - .cs_mask = 0x1fff, - .initial_cs = 2, - .initial_mcs = 6, -}; - -struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) -{ - struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); - int i; - - if (!bts) - return NULL; - - bts->nr = bts_num; - bts->num_trx = 0; - INIT_LLIST_HEAD(&bts->trx_list); - bts->ms_max_power = 15; /* dBm */ - - gsm_mo_init(&bts->mo, bts, NM_OC_BTS, - bts->nr, 0xff, 0xff); - gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { - bts->gprs.nsvc[i].bts = bts; - bts->gprs.nsvc[i].id = i; - gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, - bts->nr, i, 0xff); - } - memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, - sizeof(bts->gprs.nse.timer)); - gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, - sizeof(bts->gprs.cell.timer)); - gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, - sizeof(bts->gprs.cell.rlc_cfg)); - - /* create our primary TRX */ - bts->c0 = gsm_bts_trx_alloc(bts); - if (!bts->c0) { - talloc_free(bts); - return NULL; - } - bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; - - bts->rach_b_thresh = -1; - bts->rach_ldavg_slots = -1; - bts->paging.free_chans_need = -1; - bts->features.data = &bts->_features_data[0]; - bts->features.data_len = sizeof(bts->_features_data); - - /* si handling */ - bts->bcch_change_mark = 1; - - return bts; -} - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx; - unsigned int i; - - gsm_abis_mo_reset(&bts->mo); - gsm_abis_mo_reset(&bts->site_mgr.mo); - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) - gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); - gsm_abis_mo_reset(&bts->gprs.nse.mo); - gsm_abis_mo_reset(&bts->gprs.cell.mo); - - llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_abis_mo_reset(&trx->mo); - gsm_abis_mo_reset(&trx->bb_transc.mo); - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - gsm_abis_mo_reset(&ts->mo); - } - } -} - -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) -{ - struct gsm_bts_trx *trx; - - if (num >= bts->num_trx) - return NULL; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == num) - return trx; - } - - return NULL; -} - -static char ts2str[255]; - -char *gsm_trx_name(const struct gsm_bts_trx *trx) -{ - if (!trx) - snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); - else - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", - trx->bts->nr, trx->nr); - - return ts2str; -} - - -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) -{ - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr); - - return ts2str; -} - -/*! Log timeslot number with full pchan information */ -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - if (ts->dyn.pchan_is == ts->dyn.pchan_want) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is)); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is), - gsm_pchan_name(ts->dyn.pchan_want)); - break; - case GSM_PCHAN_TCH_F_PDCH: - if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F"); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F", - (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" - : "TCH/F"); - break; - default: - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan)); - break; - } - - return ts2str; -} - -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) -{ - struct gsm_bts_trx_ts *ts = lchan->ts; - - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); - - return ts2str; -} - -/* obtain the MO structure for a given object instance */ -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - struct gsm_abis_mo *mo = NULL; - - switch (obj_class) { - case NM_OC_BTS: - mo = &bts->mo; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->mo; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bb_transc.mo; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - mo = &trx->ts[obj_inst->ts_nr].mo; - break; - case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr.mo; - break; - case NM_OC_BS11: - switch (obj_inst->bts_nr) { - case BS11_OBJ_CCLK: - mo = &bts->bs11.cclk.mo; - break; - case BS11_OBJ_BBSIG: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.bbsig.mo; - break; - case BS11_OBJ_PA: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.pa.mo; - break; - default: - return NULL; - } - break; - case NM_OC_BS11_RACK: - mo = &bts->bs11.rack.mo; - break; - case NM_OC_BS11_ENVABTSE: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) - return NULL; - mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; - break; - case NM_OC_GPRS_NSE: - mo = &bts->gprs.nse.mo; - break; - case NM_OC_GPRS_CELL: - mo = &bts->gprs.cell.mo; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; - break; - } - return mo; -} - -/* obtain the gsm_nm_state data structure for a given object instance */ -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_abis_mo *mo; - - mo = gsm_objclass2mo(bts, obj_class, obj_inst); - if (!mo) - return NULL; - - return &mo->nm_state; -} - -/* obtain the in-memory data structure of a given object instance */ -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - void *obj = NULL; - - switch (obj_class) { - case NM_OC_BTS: - obj = bts; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = trx; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = &trx->bb_transc; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - obj = &trx->ts[obj_inst->ts_nr]; - break; - case NM_OC_SITE_MANAGER: - obj = &bts->site_mgr; - break; - case NM_OC_GPRS_NSE: - obj = &bts->gprs.nse; - break; - case NM_OC_GPRS_CELL: - obj = &bts->gprs.cell; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - obj = &bts->gprs.nsvc[obj_inst->trx_nr]; - break; - } - return obj; -} - -/* See Table 10.5.25 of GSM04.08 */ -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr) -{ - uint8_t cbits, chan_nr; - - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_F_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = 0x01; - break; - case GSM_PCHAN_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = RSL_CHAN_OSMO_PDCH >> 3; - break; - case GSM_PCHAN_TCH_H: - OSMO_ASSERT(lchan_nr < 2); - cbits = 0x02; - cbits += lchan_nr; - break; - case GSM_PCHAN_CCCH_SDCCH4: - case GSM_PCHAN_CCCH_SDCCH4_CBCH: - /* - * As a special hack for BCCH, lchan_nr == 4 may be passed - * here. This should never be sent in an RSL message. - * See osmo-bts-xxx/oml.c:opstart_compl(). - */ - if (lchan_nr == CCCH_LCHAN) - chan_nr = 0; - else - OSMO_ASSERT(lchan_nr < 4); - cbits = 0x04; - cbits += lchan_nr; - break; - case GSM_PCHAN_SDCCH8_SACCH8C: - case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: - OSMO_ASSERT(lchan_nr < 8); - cbits = 0x08; - cbits += lchan_nr; - break; - default: - case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* - * FIXME: On octphy and litecell, we hit above assertion (see - * Max's comment at https://gerrit.osmocom.org/589 ); disabled - * for BTS until this is clarified; remove the #ifdef when it - * is fixed. - */ -#warning "fix caller that passes lchan_nr != 0" -#endif - cbits = 0x10; - break; - } - - chan_nr = (cbits << 3) | (ts_nr & 0x7); - - return chan_nr; -} - -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) -{ - enum gsm_phys_chan_config pchan = lchan->ts->pchan; - if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) - return gsm_lchan_as_pchan2chan_nr(lchan, - lchan->ts->dyn.pchan_is); - return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); -} - -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan) -{ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && as_pchan == GSM_PCHAN_PDCH) - return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); - return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); -} - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) -{ - struct gsm_lchan *lchan = NULL; - struct gsm_bts_trx *trx = bts->c0; - - if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) - lchan = &trx->ts[0].lchan[2]; - else { - int i; - for (i = 0; i < 8; i++) { - if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { - lchan = &trx->ts[i].lchan[2]; - break; - } - } - } - - return lchan; -} - -/* determine logical channel based on TRX and channel number IE */ -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc) -{ - uint8_t ts_nr = chan_nr & 0x07; - uint8_t cbits = chan_nr >> 3; - uint8_t lch_idx; - struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; - bool ok = true; - - if (rc) - *rc = -EINVAL; - - if (cbits == 0x01) { - lch_idx = 0; /* TCH/F */ - if (ts->pchan != GSM_PCHAN_TCH_F && - ts->pchan != GSM_PCHAN_PDCH && - ts->pchan != GSM_PCHAN_TCH_F_PDCH - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F - || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) - ok = false; - } else if ((cbits & 0x1e) == 0x02) { - lch_idx = cbits & 0x1; /* TCH/H */ - if (ts->pchan != GSM_PCHAN_TCH_H - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H - || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) - ok = false; - } else if ((cbits & 0x1c) == 0x04) { - lch_idx = cbits & 0x3; /* SDCCH/4 */ - if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - } else if ((cbits & 0x18) == 0x08) { - lch_idx = cbits & 0x7; /* SDCCH/8 */ - if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && - ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) - ok = false; - } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_CCCH && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - /* FIXME: we should not return first sdcch4 !!! */ - } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) - ok = false; - } else - return NULL; - - if (rc && ok) - *rc = 0; - - return &ts->lchan[lch_idx]; -} - -static const uint8_t subslots_per_pchan[] = { - [GSM_PCHAN_NONE] = 0, - [GSM_PCHAN_CCCH] = 0, - [GSM_PCHAN_PDCH] = 0, - [GSM_PCHAN_CCCH_SDCCH4] = 4, - [GSM_PCHAN_TCH_F] = 1, - [GSM_PCHAN_TCH_H] = 2, - [GSM_PCHAN_SDCCH8_SACCH8C] = 8, - [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, - [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, - /* - * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be - * part of this, those TS are handled according to their dynamic state. - */ -}; - -/*! Return the actual pchan type, also heeding dynamic TS. */ -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return ts->dyn.pchan_is; - case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return GSM_PCHAN_PDCH; - else - return GSM_PCHAN_TCH_F; - default: - return ts->pchan; - } -} - -/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of - * logical channels available in the timeslot. */ -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) -{ - return subslots_per_pchan[ts_pchan(ts)]; -} - -static bool pchan_is_tch(enum gsm_phys_chan_config pchan) -{ - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_H: - return true; - default: - return false; - } -} - -bool ts_is_tch(struct gsm_bts_trx_ts *ts) -{ - return pchan_is_tch(ts_pchan(ts)); -} diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c index c8e9cd3..ccda0d0 100644 --- a/src/libcommon/talloc_ctx.c +++ b/src/libcommon/talloc_ctx.c @@ -21,35 +21,18 @@ #include extern void *tall_bsc_ctx; -extern void *tall_fle_ctx; -extern void *tall_locop_ctx; -extern void *tall_authciphop_ctx; extern void *tall_gsms_ctx; extern void *tall_subscr_ctx; -extern void *tall_sub_req_ctx; extern void *tall_call_ctx; -extern void *tall_paging_ctx; extern void *tall_sigh_ctx; -extern void *tall_tqe_ctx; extern void *tall_trans_ctx; -extern void *tall_map_ctx; -extern void *tall_upq_ctx; -extern void *tall_ctr_ctx; void talloc_ctx_init(void *ctx_root) { msgb_talloc_ctx_init(ctx_root, 0); - tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); - tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); - tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); } diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 956bc44..7afd0c7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -43,18 +43,12 @@ #include #include #include -#include -#include #include -#include -#include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index d8d77e9..ed1b384 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -48,12 +48,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c index 5f49574..6d75bba 100644 --- a/src/libmsc/gsm_04_14.c +++ b/src/libmsc/gsm_04_14.c @@ -75,7 +75,6 @@ subch = (loop_mode << 1); msgb_put_u8(msg, subch); - msg->lchan = conn->lchan; return gsm0414_conn_sendmsg(conn, msg); } diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 4838027..fb61209 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 3b4c41d..d2cd170 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -34,7 +34,6 @@ #include #include #include -#include static const struct value_string mncc_names[] = { diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index 84623df..d6f3e3d 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -34,7 +34,6 @@ #include #include #include -#include void *tall_call_ctx; diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c index 7428893..9cc6b04 100644 --- a/src/libmsc/rrlp.c +++ b/src/libmsc/rrlp.c @@ -24,7 +24,6 @@ #include #include #include -#include /* RRLP msPositionReq, nsBased, * Accuracy=60, Method=gps, ResponseTime=2, oneSet */ diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index d715d5c..f3291d7 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -29,8 +29,6 @@ #include #include #include -#include -#include #include /* paging of the requested subscriber has completed */ diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 3ea5ddd..4e2fb55 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include "smpp_smsc.h" diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 1372a2c..3d39a0e 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index 4f59554..f6083b6 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include #include #include @@ -46,10 +44,9 @@ #include #include #include -#include +#include #include #include -#include #include #include diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 0d23697..f41df01 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -89,10 +88,7 @@ /* satisfy deps from libbsc legacy. TODO double check these */ -void *tall_fle_ctx = NULL; -void *tall_paging_ctx = NULL; void *tall_map_ctx = NULL; -void *tall_upq_ctx = NULL; /* end deps from libbsc legacy. */ static struct { diff --git a/tests/msc_vlr/msc_vlr_test_rest.c b/tests/msc_vlr/msc_vlr_test_rest.c index c5f7fcf..c19c4c6 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.c +++ b/tests/msc_vlr/msc_vlr_test_rest.c @@ -32,7 +32,6 @@ btw("freshly allocated conn"); g_conn = msc_subscr_con_allocate(net); - g_conn->bts = the_bts; EXPECT_ACCEPTED(false); btw("conn_fsm present, in state NEW"); diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index cf9122b..2152fe4 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -49,8 +49,6 @@ struct gsm_network *net = NULL; -struct gsm_bts *the_bts; - const char *gsup_tx_expected = NULL; bool gsup_tx_confirmed; @@ -160,7 +158,6 @@ { struct gsm_subscriber_connection *conn; conn = msc_subscr_con_allocate(net); - conn->bts = the_bts; conn->via_ran = rx_from_ran; conn->lac = 23; if (conn->via_ran == RAN_UTRAN_IU) { @@ -866,8 +863,6 @@ } printf("Done\n"); - - talloc_free(the_bts); check_talloc(msgb_ctx, tall_bsc_ctx, 8); return 0; -- To view, visit https://gerrit.osmocom.org/6051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:15:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:15:00 +0000 Subject: [PATCH] osmo-msc[master]: jenkins.sh: Don't depend on osmo-ggsn Message-ID: Review at https://gerrit.osmocom.org/6052 jenkins.sh: Don't depend on osmo-ggsn There's nothing GPRS related left in osmo-msc, and hence no reason why we should build osmo-ggsn as a build dependency. Change-Id: I096f63e471dc8fdbd42a78f67d433f61b830615b --- M contrib/jenkins.sh 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/52/6052/1 diff --git a/contrib/jenkins.sh b/contrib/jenkins.sh index e4f90e6..d80422d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,6 @@ osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh osmo-ggsn osmo-build-dep.sh osmo-mgw if [ "x$IU" = "x--enable-iu" ]; then -- To view, visit https://gerrit.osmocom.org/6052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I096f63e471dc8fdbd42a78f67d433f61b830615b Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:18:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:18:21 +0000 Subject: [PATCH] osmo-msc[master]: Massive removal of unused code/structs/headers In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6051 to look at the new patch set (#3). Massive removal of unused code/structs/headers osmo-msc still had large amounts of dead code that came along from openbsc.git. This commit removes a lot of it, mostly stuff relevant only to the BSC side of things (or even GPRS). Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/abis_nm.h D include/osmocom/msc/abis_om2000.h D include/osmocom/msc/abis_rsl.h D include/osmocom/msc/arfcn_range_encode.h M include/osmocom/msc/bsc_api.h D include/osmocom/msc/bsc_msg_filter.h D include/osmocom/msc/chan_alloc.h D include/osmocom/msc/common_bsc.h D include/osmocom/msc/crc24.h D include/osmocom/msc/e1_config.h M include/osmocom/msc/gsm_04_08.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/gsm_subscriber.h D include/osmocom/msc/handover.h D include/osmocom/msc/handover_decision.h D include/osmocom/msc/meas_rep.h D include/osmocom/msc/misdn.h D include/osmocom/msc/network_listen.h D include/osmocom/msc/osmo_bsc.h D include/osmocom/msc/osmo_bsc_reset.h D include/osmocom/msc/osmo_bsc_sigtran.h D include/osmocom/msc/osmux.h D include/osmocom/msc/rs232.h D include/osmocom/msc/rtp_proxy.h M include/osmocom/msc/signal.h D include/osmocom/msc/slhc.h D include/osmocom/msc/system_information.h D include/osmocom/msc/trau_mux.h D include/osmocom/msc/trau_upqueue.h M include/osmocom/msc/vty.h M src/libcommon-cs/a_reset.c M src/libcommon/Makefile.am M src/libcommon/common_vty.c M src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c M src/libcommon/talloc_ctx.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_subscriber.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/sms_queue.c M src/libmsc/vty_interface_layer3.c M src/osmo-msc/msc_main.c M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_tests.c 52 files changed, 9 insertions(+), 3,552 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/51/6051/3 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 82e8207..cb19186 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -1,24 +1,15 @@ noinst_HEADERS = \ - abis_nm.h \ - abis_om2000.h \ - abis_rsl.h \ a_iface.h \ a_iface_bssap.h \ - arfcn_range_encode.h \ auth.h \ bsc_api.h \ bsc_msc.h \ - bsc_msg_filter.h \ bsc_rll.h \ - chan_alloc.h \ common.h \ - common_bsc.h \ common_cs.h \ - crc24.h \ ctrl.h \ db.h \ debug.h \ - e1_config.h \ gsm_04_08.h \ gsm_04_11.h \ gsm_04_14.h \ @@ -27,39 +18,25 @@ gsm_data_shared.h \ gsm_subscriber.h \ gsup_client.h \ - handover.h \ - handover_decision.h \ ipaccess.h \ iucs.h \ iucs_ranap.h \ iu_dummy.h \ - meas_rep.h \ - misdn.h \ mncc.h \ mncc_int.h \ msc_ifaces.h \ - network_listen.h \ oap_client.h \ openbscdefines.h \ - osmo_bsc.h \ a_reset.h \ osmo_msc.h \ - osmo_bsc_sigtran.h \ bsc_msc_data.h \ - osmux.h \ rrlp.h \ - rs232.h \ - rtp_proxy.h \ signal.h \ silent_call.h \ - slhc.h \ smpp.h \ sms_queue.h \ socket.h \ - system_information.h \ transaction.h \ - trau_mux.h \ - trau_upqueue.h \ ussd.h \ vlr.h \ vty.h \ diff --git a/include/osmocom/msc/abis_nm.h b/include/osmocom/msc/abis_nm.h deleted file mode 100644 index 2581962..0000000 --- a/include/osmocom/msc/abis_nm.h +++ /dev/null @@ -1,180 +0,0 @@ -/* 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 - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef _NM_H -#define _NM_H - -#include -#include -#include - -#include - -/* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ -#define MAX_BTS_ATTR 5 - -struct cell_global_id { - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint16_t ci; -}; - -/* The BCCH info from an ip.access test, in host byte order - * and already parsed... */ -struct ipac_bcch_info { - struct llist_head list; - - uint16_t info_type; - uint8_t freq_qual; - uint16_t arfcn; - uint8_t rx_lev; - uint8_t rx_qual; - int16_t freq_err; - uint16_t frame_offset; - uint32_t frame_nr_offset; - uint8_t bsic; - struct cell_global_id cgi; - uint8_t ba_list_si2[16]; - uint8_t ba_list_si2bis[16]; - uint8_t ba_list_si2ter[16]; - uint8_t ca_list_si1[16]; -}; - -/* PUBLIC */ - -struct msgb; - -struct abis_nm_cfg { - /* callback for unidirectional reports */ - int (*report_cb)(struct msgb *, - struct abis_om_fom_hdr *); - /* callback for software activate requests from BTS */ - int (*sw_act_req)(struct msgb *); -}; - -extern int abis_nm_rcvmsg(struct msgb *msg); - -int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len); -int abis_nm_rx(struct msgb *msg); -int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2); -int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, - uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state); -int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr, - uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot, - uint8_t tei); -int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx, - uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot); -int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts, - uint8_t e1_port, uint8_t e1_timeslot, - uint8_t e1_subslot); -int abis_nm_get_attr(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - const uint8_t *attr, uint8_t attr_len); -int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len); -int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len); -int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb); -int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1, - uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len); -int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg); -int abis_nm_event_reports(struct gsm_bts *bts, int on); -int abis_nm_reset_resource(struct gsm_bts *bts); -int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname, - uint8_t win_size, int forced, - gsm_cbfn *cbfn, void *cb_data); -int abis_nm_software_load_status(struct gsm_bts *bts); -int abis_nm_software_activate(struct gsm_bts *bts, const char *fname, - gsm_cbfn *cbfn, void *cb_data); - -int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0, - uint8_t e1_port1, uint8_t ts1); - -int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - uint8_t test_nr, uint8_t auton_report, struct msgb *msg); - -/* Siemens / BS-11 specific */ -int abis_nm_bs11_reset_resource(struct gsm_bts *bts); -int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin); -int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type, - uint8_t idx, uint8_t attr_len, const uint8_t *attr); -int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_delete_object(struct gsm_bts *bts, - enum abis_bs11_objtype type, uint8_t idx); -int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port, - uint8_t e1_timeslot, uint8_t e1_subslot, uint8_t tei); -int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts); -int abis_nm_bs11_get_serno(struct gsm_bts *bts); -int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level); -int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx); -int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on); -int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on); -int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on); -int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password); -int abis_nm_bs11_set_pll_locked(struct gsm_bts *bts, int locked); -int abis_nm_bs11_get_pll_mode(struct gsm_bts *bts); -int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value); -int abis_nm_bs11_get_cclk(struct gsm_bts *bts); -int abis_nm_bs11_get_state(struct gsm_bts *bts); -int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname, - uint8_t win_size, int forced, gsm_cbfn *cbfn); -int abis_nm_bs11_set_ext_time(struct gsm_bts *bts); -int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport); -int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg); -int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect); -int abis_nm_bs11_restart(struct gsm_bts *bts); - -/* ip.access nanoBTS specific commands */ -int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type, - uint8_t obj_class, uint8_t bts_nr, - uint8_t trx_nr, uint8_t ts_nr, - uint8_t *attr, int attr_len); -int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr, - int attr_len); -int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx); -int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - uint8_t *attr, uint8_t attr_len); -int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, - uint32_t ip, uint16_t port, uint8_t stream); -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts); -int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf); -const char *ipacc_testres_name(uint8_t res); - -/* Functions calling into other code parts */ -int nm_is_running(struct gsm_nm_state *s); - -int abis_nm_vty_init(void); - -void abis_nm_clear_queue(struct gsm_bts *bts); - -int _abis_nm_sendmsg(struct msgb *msg); - -void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */ - -int abis_nm_select_newest_sw(const struct abis_nm_sw_desc *sw, const size_t len); - -/* Helper functions for updating attributes */ -int abis_nm_update_max_power_red(struct gsm_bts_trx *trx); - -#endif /* _NM_H */ diff --git a/include/osmocom/msc/abis_om2000.h b/include/osmocom/msc/abis_om2000.h deleted file mode 100644 index b093a03..0000000 --- a/include/osmocom/msc/abis_om2000.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef OPENBSC_ABIS_OM2K_H -#define OPENBSC_ABIS_OM2K_H -/* Ericsson RBS 2xxx GSM O&M (OM2000) messages on the A-bis interface - * implemented based on protocol trace analysis, no formal documentation */ - -/* (C) 2010-2011 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -enum abis_om2k_mo_cls { - OM2K_MO_CLS_TRXC = 0x01, - OM2K_MO_CLS_TS = 0x03, - OM2K_MO_CLS_TF = 0x04, - OM2K_MO_CLS_IS = 0x05, - OM2K_MO_CLS_CON = 0x06, - OM2K_MO_CLS_DP = 0x07, - OM2K_MO_CLS_CF = 0x0a, - OM2K_MO_CLS_TX = 0x0b, - OM2K_MO_CLS_RX = 0x0c, -}; - -enum om2k_mo_state { - OM2K_MO_S_RESET = 0, - OM2K_MO_S_STARTED, - OM2K_MO_S_ENABLED, - OM2K_MO_S_DISABLED, -}; - -/* on-wire format for IS conn group */ -struct om2k_is_conn_grp { - uint16_t icp1; - uint16_t icp2; - uint8_t cont_idx; -} __attribute__ ((packed)); - -/* internal data formant for IS conn group */ -struct is_conn_group { - struct llist_head list; - uint16_t icp1; - uint16_t icp2; - uint8_t ci; -}; - -/* on-wire format for CON Path */ -struct om2k_con_path { - uint16_t ccp; - uint8_t ci; - uint8_t tag; - uint8_t tei; -} __attribute__ ((packed)); - -/* internal data format for CON group */ -struct con_group { - /* links list of CON groups in BTS */ - struct llist_head list; - struct gsm_bts *bts; - /* CON Group ID */ - uint8_t cg; - /* list of CON paths in this group */ - struct llist_head paths; -}; - -/* internal data format for CON path */ -struct con_path { - /* links with con_group.paths */ - struct llist_head list; - /* CON Connection Point */ - uint16_t ccp; - /* Contiguity Index */ - uint8_t ci; - /* Tag */ - uint8_t tag; - /* TEI */ - uint8_t tei; -}; - -extern const struct abis_om2k_mo om2k_mo_cf; -extern const struct abis_om2k_mo om2k_mo_is; -extern const struct abis_om2k_mo om2k_mo_con; -extern const struct abis_om2k_mo om2k_mo_tf; - -extern const struct value_string om2k_mo_class_short_vals[]; - -int abis_om2k_rcvmsg(struct msgb *msg); - -extern const struct abis_om2k_mo om2k_mo_cf; - -int abis_om2k_tx_reset_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_start_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_status_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, - uint8_t operational); -int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_is_conf_req(struct gsm_bts *bts); -int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts); -int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx); -int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx); -int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts); - -struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts); -void abis_om2k_bts_init(struct gsm_bts *bts); -void abis_om2k_trx_init(struct gsm_bts_trx *trx); - -int abis_om2k_vty_init(void); - -struct vty; -void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts); - -#endif /* OPENBCS_ABIS_OM2K_H */ diff --git a/include/osmocom/msc/abis_rsl.h b/include/osmocom/msc/abis_rsl.h deleted file mode 100644 index f983fce..0000000 --- a/include/osmocom/msc/abis_rsl.h +++ /dev/null @@ -1,117 +0,0 @@ -/* 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 - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef _RSL_H -#define _RSL_H - -#include -#include -#include -#include -#include - -struct gsm_bts; -struct gsm_lchan; -struct gsm_bts_trx_ts; - -#define GSM48_LEN2PLEN(a) (((a) << 2) | 1) - -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, - uint8_t act_type, - struct rsl_ie_chan_mode *chan_mode, - struct rsl_ie_chan_ident *chan_ident, - uint8_t bs_power, uint8_t ms_power, - uint8_t ta); -int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type, - uint8_t ho_ref); -int rsl_chan_mode_modify_req(struct gsm_lchan *ts); -int rsl_encryption_cmd(struct msgb *msg); -int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len, - uint8_t *ms_ident, uint8_t chan_needed, bool is_gprs); -int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val); - -int rsl_data_request(struct msgb *msg, uint8_t link_id); -int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id); -int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id); - -/* Ericcson vendor specific RSL extensions */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val); - -/* Siemens vendor-specific RSL extensions */ -int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); - -/* ip.access specfic RSL extensions */ -int rsl_ipacc_crcx(struct gsm_lchan *lchan); -int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip, - uint16_t port, uint8_t rtp_payload2); -int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan); -int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act); - -int abis_rsl_rcvmsg(struct msgb *msg); - -uint64_t str_to_imsi(const char *imsi_str); -int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, - enum rsl_rel_mode release_mode); - -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); -int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); - -/* to be provided by external code */ -int rsl_deact_sacch(struct gsm_lchan *lchan); - -/* BCCH related code */ -int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); -int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf); - -int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type, - const uint8_t *data, int len); - -int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db); -int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm); - -/* SMSCB functionality */ -int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number, - struct rsl_ie_cb_cmd_type cb_command, - const uint8_t *data, int len); - -/* some Nokia specific stuff */ -int rsl_nokia_si_begin(struct gsm_bts_trx *trx); -int rsl_nokia_si_end(struct gsm_bts_trx *trx); - -/* required for Nokia BTS power control */ -int rsl_bs_power_control(struct gsm_bts_trx *trx, uint8_t channel, uint8_t reduction); - - -int rsl_release_sapis_from(struct gsm_lchan *lchan, int start, - enum rsl_rel_mode release_mode); -int rsl_start_t3109(struct gsm_lchan *lchan); - -int rsl_direct_rf_release(struct gsm_lchan *lchan); - -void dyn_ts_init(struct gsm_bts_trx_ts *ts); -int dyn_ts_switchover_start(struct gsm_bts_trx_ts *ts, - enum gsm_phys_chan_config to_pchan); - -#endif /* RSL_MT_H */ - diff --git a/include/osmocom/msc/arfcn_range_encode.h b/include/osmocom/msc/arfcn_range_encode.h deleted file mode 100644 index 7ec710c..0000000 --- a/include/osmocom/msc/arfcn_range_encode.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ARFCN_RANGE_ENCODE_H -#define ARFCN_RANGE_ENCODE_H - -#include - -enum gsm48_range { - ARFCN_RANGE_INVALID = -1, - ARFCN_RANGE_128 = 127, - ARFCN_RANGE_256 = 255, - ARFCN_RANGE_512 = 511, - ARFCN_RANGE_1024 = 1023, -}; - -#define RANGE_ENC_MAX_ARFCNS 29 - -int range_enc_determine_range(const int *arfcns, int size, int *f0_out); -int range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, int *out, int idx); -int range_enc_find_index(enum gsm48_range rng, const int *arfcns, int size); -int range_enc_filter_arfcns(int *arfcns, const int sze, const int f0, int *f0_included); - -int range_enc_range128(uint8_t *chan_list, int f0, int *w); -int range_enc_range256(uint8_t *chan_list, int f0, int *w); -int range_enc_range512(uint8_t *chan_list, int f0, int *w); -int range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w); - -#endif diff --git a/include/osmocom/msc/bsc_api.h b/include/osmocom/msc/bsc_api.h index 40068d6..4936f53 100644 --- a/include/osmocom/msc/bsc_api.h +++ b/include/osmocom/msc/bsc_api.h @@ -46,13 +46,4 @@ void (*conn_cleanup)(struct gsm_subscriber_connection *conn); }; -int bsc_api_init(struct gsm_network *network, struct bsc_api *api); -int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id, int allow_sacch); -int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv); -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, - unsigned int mi_len, uint8_t *mi, int chan_type); -int gsm0808_clear(struct gsm_subscriber_connection *conn); - #endif diff --git a/include/osmocom/msc/bsc_msg_filter.h b/include/osmocom/msc/bsc_msg_filter.h deleted file mode 100644 index a9dedf4..0000000 --- a/include/osmocom/msc/bsc_msg_filter.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include - -struct vty; -struct gsm48_hdr; - -struct bsc_filter_reject_cause { - int lu_reject_cause; - int cm_reject_cause; -}; - -struct bsc_filter_barr_entry { - struct rb_node node; - - char *imsi; - int cm_reject_cause; - int lu_reject_cause; -}; - -enum bsc_filter_acc_ctr { - ACC_LIST_LOCAL_FILTER, - ACC_LIST_GLOBAL_FILTER, -}; - -struct bsc_msg_acc_lst { - struct llist_head list; - - /* counter */ - struct rate_ctr_group *stats; - - /* the name of the list */ - const char *name; - struct llist_head fltr_list; -}; - -struct bsc_msg_acc_lst_entry { - struct llist_head list; - - /* the filter */ - char *imsi_allow; - regex_t imsi_allow_re; - char *imsi_deny; - regex_t imsi_deny_re; - - /* reject reasons for the access lists */ - int cm_reject_cause; - int lu_reject_cause; -}; - -enum { - FLT_CON_TYPE_NONE, - FLT_CON_TYPE_LU, - FLT_CON_TYPE_CM_SERV_REQ, - FLT_CON_TYPE_PAG_RESP, - FLT_CON_TYPE_SSA, - FLT_CON_TYPE_LOCAL_REJECT, - FLT_CON_TYPE_OTHER, -}; - - -struct bsc_filter_state { - char *imsi; - int imsi_checked; - int con_type; -}; - -struct bsc_filter_request { - void *ctx; - struct rb_root *black_list; - struct llist_head *access_lists; - const char *local_lst_name; - const char *global_lst_name; - int bsc_nr; -}; - - -int bsc_filter_barr_adapt(void *ctx, struct rb_root *rbtree, const struct osmo_config_list *); -int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu); - -/** - * Content filtering. - */ -int bsc_msg_filter_initial(struct gsm48_hdr *hdr, size_t size, - struct bsc_filter_request *req, - int *con_type, char **imsi, - struct bsc_filter_reject_cause *cause); -int bsc_msg_filter_data(struct gsm48_hdr *hdr, size_t size, - struct bsc_filter_request *req, - struct bsc_filter_state *state, - struct bsc_filter_reject_cause *cause); - -/* IMSI allow/deny handling */ -struct bsc_msg_acc_lst *bsc_msg_acc_lst_find(struct llist_head *lst, const char *name); -struct bsc_msg_acc_lst *bsc_msg_acc_lst_get(void *ctx, struct llist_head *lst, const char *name); -void bsc_msg_acc_lst_delete(struct bsc_msg_acc_lst *lst); - -struct bsc_msg_acc_lst_entry *bsc_msg_acc_lst_entry_create(struct bsc_msg_acc_lst *); -int bsc_msg_acc_lst_check_allow(struct bsc_msg_acc_lst *lst, const char *imsi); - -void bsc_msg_lst_vty_init(void *ctx, struct llist_head *lst, int node); -void bsc_msg_acc_lst_write(struct vty *vty, struct bsc_msg_acc_lst *lst); diff --git a/include/osmocom/msc/chan_alloc.h b/include/osmocom/msc/chan_alloc.h deleted file mode 100644 index 7388e14..0000000 --- a/include/osmocom/msc/chan_alloc.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Management functions to allocate/release struct gsm_lchan */ -/* (C) 2008 by Harald Welte - * (C) 2009 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - */ -#ifndef _CHAN_ALLOC_H -#define _CHAN_ALLOC_H - -#include "gsm_data.h" - -struct gsm_subscriber_connection; - -/* Find an allocated channel for a specified subscriber */ -struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub); - -/* Allocate a logical channel (SDCCH, TCH, ...) */ -struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); - -/* Free a logical channel (SDCCH, TCH, ...) */ -void lchan_free(struct gsm_lchan *lchan); -void lchan_reset(struct gsm_lchan *lchan); - -/* Release the given lchan */ -int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode release_mode); - -struct load_counter { - unsigned int total; - unsigned int used; -}; - -struct pchan_load { - struct load_counter pchan[_GSM_PCHAN_MAX]; -}; - -void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts); -void network_chan_load(struct pchan_load *pl, struct gsm_network *net); - -int trx_is_usable(struct gsm_bts_trx *trx); - -#endif /* _CHAN_ALLOC_H */ diff --git a/include/osmocom/msc/common_bsc.h b/include/osmocom/msc/common_bsc.h deleted file mode 100644 index 821298c..0000000 --- a/include/osmocom/msc/common_bsc.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include -#include - -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code, - mncc_recv_cb_t mncc_recv); diff --git a/include/osmocom/msc/crc24.h b/include/osmocom/msc/crc24.h deleted file mode 100644 index 756638c..0000000 --- a/include/osmocom/msc/crc24.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _CRC24_H -#define _CRC24_H - -#include - -#define INIT_CRC24 0xffffff - -uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len); - -#endif diff --git a/include/osmocom/msc/e1_config.h b/include/osmocom/msc/e1_config.h deleted file mode 100644 index ac5fbb1..0000000 --- a/include/osmocom/msc/e1_config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _E1_CONFIG_H -#define _E1_CONFIG_H - -#include - -int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); -int e1_reconfig_trx(struct gsm_bts_trx *trx); -int e1_reconfig_bts(struct gsm_bts *bts); - -#endif /* _E1_CONFIG_H */ - diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h index 914b3e9..58cb7ae 100644 --- a/include/osmocom/msc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -5,8 +5,6 @@ #include #include -#include - struct msgb; struct gsm_bts; struct gsm_network; @@ -67,7 +65,6 @@ int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode); int gsm48_rx_rr_modif_ack(struct msgb *msg); -int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg); struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value); struct msgb *gsm48_create_loc_upd_rej(uint8_t cause); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 2b01a34..e987136 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -18,6 +18,9 @@ #include #include +#include "gsm_data_shared.h" + + /** annotations for msgb ownership */ #define __uses @@ -168,20 +171,10 @@ int mncc_rtp_create_pending; int mncc_rtp_connect_pending; - /* bsc structures */ - struct osmo_bsc_sccp_con *sccp_con; /* BSC */ - /* back pointers */ struct gsm_network *network; bool in_release; - struct gsm_lchan *lchan; /* BSC */ - struct gsm_lchan *ho_lchan; /* BSC */ - struct gsm_bts *bts; /* BSC */ - - /* for assignment handling */ - struct osmo_timer_list T10; /* BSC */ - struct gsm_lchan *secondary_lchan; /* BSC */ /* connected via 2G or 3G? */ enum ran_type via_ran; @@ -220,56 +213,6 @@ } a; }; - -#define ROLE_BSC -#include "gsm_data_shared.h" - - -enum { - BSC_CTR_CHREQ_TOTAL, - BSC_CTR_CHREQ_NO_CHANNEL, - BSC_CTR_HANDOVER_ATTEMPTED, - BSC_CTR_HANDOVER_NO_CHANNEL, - BSC_CTR_HANDOVER_TIMEOUT, - BSC_CTR_HANDOVER_COMPLETED, - BSC_CTR_HANDOVER_FAILED, - BSC_CTR_PAGING_ATTEMPTED, - BSC_CTR_PAGING_DETACHED, - BSC_CTR_PAGING_COMPLETED, - BSC_CTR_PAGING_EXPIRED, - BSC_CTR_CHAN_RF_FAIL, - BSC_CTR_CHAN_RLL_ERR, - BSC_CTR_BTS_OML_FAIL, - BSC_CTR_BTS_RSL_FAIL, - BSC_CTR_CODEC_AMR_F, - BSC_CTR_CODEC_AMR_H, - BSC_CTR_CODEC_EFR, - BSC_CTR_CODEC_V1_FR, - BSC_CTR_CODEC_V1_HR, -}; - -static const struct rate_ctr_desc bsc_ctr_description[] = { - [BSC_CTR_CHREQ_TOTAL] = {"chreq.total", "Received channel requests."}, - [BSC_CTR_CHREQ_NO_CHANNEL] = {"chreq.no_channel", "Sent to MS no channel available."}, - [BSC_CTR_HANDOVER_ATTEMPTED] = {"handover.attempted", "Received handover attempts."}, - [BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover.no_channel", "Sent no channel available responses."}, - [BSC_CTR_HANDOVER_TIMEOUT] = {"handover.timeout", "Count the amount of timeouts of timer T3103."}, - [BSC_CTR_HANDOVER_COMPLETED] = {"handover.completed", "Received handover completed."}, - [BSC_CTR_HANDOVER_FAILED] = {"handover.failed", "Receive HO FAIL messages."}, - [BSC_CTR_PAGING_ATTEMPTED] = {"paging.attempted", "Paging attempts for a MS."}, - [BSC_CTR_PAGING_DETACHED] = {"paging.detached", "Counts the amount of paging attempts which couldn't sent out any paging request because no responsible bts found."}, - [BSC_CTR_PAGING_COMPLETED] = {"paging.completed", "Paging successful completed."}, - [BSC_CTR_PAGING_EXPIRED] = {"paging.expired", "Paging Request expired because of timeout T3113."}, - [BSC_CTR_CHAN_RF_FAIL] = {"chan.rf_fail", "Received a RF failure indication from BTS."}, - [BSC_CTR_CHAN_RLL_ERR] = {"chan.rll_err", "Received a RLL failure with T200 cause from BTS."}, - [BSC_CTR_BTS_OML_FAIL] = {"bts.oml_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_BTS_RSL_FAIL] = {"bts.rsl_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_CODEC_AMR_F] = {"bts.codec_amr_f", "Count the usage of AMR/F codec by channel mode requested."}, - [BSC_CTR_CODEC_AMR_H] = {"bts.codec_amr_h", "Count the usage of AMR/H codec by channel mode requested."}, - [BSC_CTR_CODEC_EFR] = {"bts.codec_efr", "Count the usage of EFR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_FR] = {"bts.codec_fr", "Count the usage of FR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_HR] = {"bts.codec_hr", "Count the usage of HR codec by channel mode requested."}, -}; enum { MSC_CTR_LOC_UPDATE_TYPE_ATTACH, @@ -314,15 +257,6 @@ [MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total amount of calls that ever reached active state."}, [MSC_CTR_CALL_COMPLETE] = {"call:complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."}, [MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."}, -}; - - -static const struct rate_ctr_group_desc bsc_ctrg_desc = { - "bsc", - "base station controller", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bsc_ctr_description), - bsc_ctr_description, }; static const struct rate_ctr_group_desc msc_ctrg_desc = { @@ -401,9 +335,6 @@ */ struct llist_head trans_list; struct bsc_api *bsc_api; - - unsigned int num_bts; - struct llist_head bts_list; unsigned int paging_response_timer; @@ -525,11 +456,6 @@ extern void talloc_ctx_init(void *ctx_root); -enum gsm_bts_type parse_btstype(const char *arg); -const char *btstype2str(enum gsm_bts_type type); -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts); - extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; @@ -539,29 +465,8 @@ enum rrlp_mode rrlp_mode_parse(const char *arg); const char *rrlp_mode_name(enum rrlp_mode mode); -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); -const char *bts_gprs_mode_name(enum bts_gprs_mode mode); - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss); - -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); - -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); - -/* generic E1 line operations for all ISDN-based BTS. */ -extern struct e1inp_line_ops bts_isdn_e1inp_line_ops; - -extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1]; -extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 63f4d33..68b36ab 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -11,18 +11,7 @@ #include #include #include -#include -#include -#include #include -#include -#include -#include -#include - -#ifndef ROLE_BSC -#include -#endif #include @@ -39,35 +28,6 @@ RRLP_MODE_ASS_PREF, }; -/* Channel Request reason */ -enum gsm_chreq_reason_t { - GSM_CHREQ_REASON_EMERG, - GSM_CHREQ_REASON_PAG, - GSM_CHREQ_REASON_CALL, - GSM_CHREQ_REASON_LOCATION_UPD, - GSM_CHREQ_REASON_OTHER, - GSM_CHREQ_REASON_PDCH, -}; - -/* lchans 0..3 are SDCCH in combined channel configuration, - use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ -#define CCCH_LCHAN 4 - -#define TRX_NR_TS 8 -#define TS_MAX_LCHAN 8 - -#define HARDCODED_ARFCN 123 -#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ - -/* for multi-drop config */ -#define HARDCODED_BTS0_TS 1 -#define HARDCODED_BTS1_TS 6 -#define HARDCODED_BTS2_TS 11 - -#define MAX_VERSION_LENGTH 64 - -#define MAX_BTS_FEATURES 128 - enum gsm_hooks { GSM_HOOK_NM_SWLOAD, GSM_HOOK_RR_PAGING, @@ -81,852 +41,15 @@ GSM_PAGING_BUSY, }; -enum bts_gprs_mode { - BTS_GPRS_NONE = 0, - BTS_GPRS_GPRS = 1, - BTS_GPRS_EGPRS = 2, -}; - -struct gsm_lchan; struct gsm_mncc; struct osmo_rtp_socket; struct rtp_socket; struct bsc_api; - -/* Network Management State */ -struct gsm_nm_state { - uint8_t operational; - uint8_t administrative; - uint8_t availability; -}; - -struct gsm_abis_mo { - uint8_t obj_class; - uint8_t procedure_pending; - struct abis_om_obj_inst obj_inst; - const char *name; - struct gsm_nm_state nm_state; - struct tlv_parsed *nm_attr; - struct gsm_bts *bts; -}; - -/* Ericsson OM2000 Managed Object */ -struct abis_om2k_mo { - uint8_t class; - uint8_t bts; - uint8_t assoc_so; - uint8_t inst; -} __attribute__ ((packed)); - -struct om2k_mo { - struct abis_om2k_mo addr; - struct osmo_fsm_inst *fsm; -}; - -#define A38_XOR_MIN_KEY_LEN 12 -#define A38_XOR_MAX_KEY_LEN 16 -#define A38_COMP128_KEY_LEN 16 -#define RSL_ENC_ALG_A5(x) (x+1) -#define MAX_EARFCN_LIST 32 - -/* is the data link established? who established it? */ -#define LCHAN_SAPI_UNUSED 0 -#define LCHAN_SAPI_MS 1 -#define LCHAN_SAPI_NET 2 -#define LCHAN_SAPI_REL 3 - -/* state of a logical channel */ -enum gsm_lchan_state { - LCHAN_S_NONE, /* channel is not active */ - LCHAN_S_ACT_REQ, /* channel activation requested */ - LCHAN_S_ACTIVE, /* channel is active and operational */ - LCHAN_S_REL_REQ, /* channel release has been requested */ - LCHAN_S_REL_ERR, /* channel is in an error state */ - LCHAN_S_BROKEN, /* channel is somehow unusable */ - LCHAN_S_INACTIVE, /* channel is set inactive */ -}; - -/* BTS ONLY */ -#define MAX_NUM_UL_MEAS 104 -#define LC_UL_M_F_L1_VALID (1 << 0) -#define LC_UL_M_F_RES_VALID (1 << 1) - -struct bts_ul_meas { - /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ - uint16_t ber10k; - /* timing advance offset (in quarter bits) */ - int16_t ta_offs_qbits; - /* C/I ratio in dB */ - float c_i; - /* flags */ - uint8_t is_sub:1; - /* RSSI in dBm * -1 */ - uint8_t inv_rssi; -}; - -struct bts_codec_conf { - uint8_t hr; - uint8_t efr; - uint8_t amr; -}; - -struct amr_mode { - uint8_t mode; - uint8_t threshold; - uint8_t hysteresis; -}; - -struct amr_multirate_conf { - uint8_t gsm48_ie[2]; - struct amr_mode ms_mode[4]; - struct amr_mode bts_mode[4]; - uint8_t num_modes; -}; -/* /BTS ONLY */ - -enum lchan_csd_mode { - LCHAN_CSD_M_NT, - LCHAN_CSD_M_T_1200_75, - LCHAN_CSD_M_T_600, - LCHAN_CSD_M_T_1200, - LCHAN_CSD_M_T_2400, - LCHAN_CSD_M_T_9600, - LCHAN_CSD_M_T_14400, - LCHAN_CSD_M_T_29000, - LCHAN_CSD_M_T_32000, -}; - -/* State of the SAPIs in the lchan */ -enum lchan_sapi_state { - LCHAN_SAPI_S_NONE, - LCHAN_SAPI_S_REQ, - LCHAN_SAPI_S_ASSIGNED, - LCHAN_SAPI_S_REL, - LCHAN_SAPI_S_ERROR, -}; - -struct gsm_lchan { - /* The TS that we're part of */ - struct gsm_bts_trx_ts *ts; - /* The logical subslot number in the TS */ - uint8_t nr; - /* The logical channel type */ - enum gsm_chan_t type; - /* RSL channel mode */ - enum rsl_cmod_spd rsl_cmode; - /* If TCH, traffic channel mode */ - enum gsm48_chan_mode tch_mode; - enum lchan_csd_mode csd_mode; - /* State */ - enum gsm_lchan_state state; - const char *broken_reason; - /* Power levels for MS and BTS */ - uint8_t bs_power; - uint8_t ms_power; - /* Encryption information */ - struct gsm_encr encr; - - /* AMR bits */ - uint8_t mr_ms_lv[7]; - uint8_t mr_bts_lv[7]; - - /* Established data link layer services */ - uint8_t sapis[8]; - int sacch_deact; - - struct { - uint32_t bound_ip; - uint32_t connect_ip; - uint16_t bound_port; - uint16_t connect_port; - uint16_t conn_id; - uint8_t rtp_payload; - uint8_t rtp_payload2; - uint8_t speech_mode; -#ifdef ROLE_BSC - struct rtp_socket *rtp_socket; - - /* info we need to postpone the AoIP - * assignment completed message */ - struct { - uint8_t rr_cause; - uint8_t chosen_channel; - uint8_t encr_alg_id; - uint8_t speech_mode; - bool valid; - } ass_compl; -#else - struct osmo_rtp_socket *rtp_socket; -#endif - } abis_ip; - - uint8_t rqd_ta; - - char *name; - -#ifdef ROLE_BSC - struct osmo_timer_list T3101; - struct osmo_timer_list T3109; - struct osmo_timer_list T3111; - struct osmo_timer_list error_timer; - struct osmo_timer_list act_timer; - struct osmo_timer_list rel_work; - uint8_t error_cause; - - /* table of neighbor cell measurements */ - struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; - - /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; - int meas_rep_idx; - - /* GSM Random Access data */ - struct gsm48_req_ref *rqd_ref; - - struct gsm_subscriber_connection *conn; - - struct { - /* channel activation type and handover ref */ - uint8_t act_type; - uint8_t ho_ref; - struct gsm48_req_ref *rqd_ref; - uint8_t rqd_ta; - } dyn; -#else - /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. - * Currently we don't share these headers so this is a magic number. */ - struct llist_head sapi_cmds; - uint8_t sapis_dl[23]; - uint8_t sapis_ul[23]; - struct lapdm_channel lapdm_ch; - struct llist_head dl_tch_queue; - struct { - /* bitmask of all SI that are present/valid in si_buf */ - uint32_t valid; - uint32_t last; - /* buffers where we put the pre-computed SI: - SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ - sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; - } si; - struct { - uint8_t flags; - /* RSL measurment result number, 0 at lchan_act */ - uint8_t res_nr; - /* current Tx power level of the BTS */ - uint8_t bts_tx_pwr; - /* number of measurements stored in array below */ - uint8_t num_ul_meas; - struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; - /* last L1 header from the MS */ - uint8_t l1_info[2]; - struct gsm_meas_rep_unidir ul_res; - } meas; - struct { - struct amr_multirate_conf amr_mr; - struct { - struct osmo_fsm_inst *dl_amr_fsm; - /* TCH cache */ - uint8_t cache[20]; - /* FACCH cache */ - uint8_t facch[GSM_MACBLOCK_LEN]; - uint8_t len; - uint32_t fn; - bool is_update; - /* set for each SID frame to detect talkspurt for codecs - without explicit ONSET event */ - bool ul_sid; - /* indicates if DTXd was active during DL measurement - period */ - bool dl_active; - } dtx; - uint8_t last_cmr; - uint32_t last_fn; - } tch; - - /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ - int16_t ms_t_offs; - /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ - int16_t p_offs; - - /* BTS-side ciphering state (rx only, bi-directional, ...) */ - uint8_t ciph_state; - uint8_t ciph_ns; - uint8_t loopback; - struct { - uint8_t active; - uint8_t ref; - /* T3105: PHYS INF retransmission */ - struct osmo_timer_list t3105; - /* counts up to Ny1 */ - unsigned int phys_info_count; - } ho; - /* S counter for link loss */ - int s; - /* Kind of the release/activation. E.g. RSL or PCU */ - int rel_act_kind; - /* RTP header Marker bit to indicate beginning of speech after pause */ - bool rtp_tx_marker; - /* power handling */ - struct { - uint8_t current; - uint8_t fixed; - } ms_power_ctrl; - - struct msgb *pending_rel_ind_msg; -#endif -}; - -enum { - TS_F_PDCH_ACTIVE = 0x1000, - TS_F_PDCH_ACT_PENDING = 0x2000, - TS_F_PDCH_DEACT_PENDING = 0x4000, - TS_F_PDCH_PENDING_MASK = 0x6000 /*< - TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ -} gsm_bts_trx_ts_flags; - -/* One Timeslot in a TRX */ -struct gsm_bts_trx_ts { - struct gsm_bts_trx *trx; - /* number of this timeslot at the TRX */ - uint8_t nr; - - enum gsm_phys_chan_config pchan; - - struct { - enum gsm_phys_chan_config pchan_is; - enum gsm_phys_chan_config pchan_want; - struct msgb *pending_chan_activ; - } dyn; - - unsigned int flags; - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - uint8_t nm_chan_comb; - int tsc; /* -1 == use BTS TSC */ - - struct { - /* Parameters below are configured by VTY */ - int enabled; - uint8_t maio; - uint8_t hsn; - struct bitvec arfcns; - uint8_t arfcns_data[1024/8]; - /* This is the pre-computed MA for channel assignments */ - struct bitvec ma; - uint8_t ma_len; /* part of ma_data that is used */ - uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ - } hopping; - - /* To which E1 subslot are we connected */ - struct gsm_e1_subslot e1_link; - - union { - struct { - struct om2k_mo om2k_mo; - } rbs2000; - }; - - struct gsm_lchan lchan[TS_MAX_LCHAN]; -}; - -/* One TRX in a BTS */ -struct gsm_bts_trx { - /* list header in bts->trx_list */ - struct llist_head list; - - struct gsm_bts *bts; - /* number of this TRX in the BTS */ - uint8_t nr; - /* human readable name / description */ - char *description; - /* how do we talk RSL with this TRX? */ - struct gsm_e1_subslot rsl_e1_link; - uint8_t rsl_tei; - struct e1inp_sign_link *rsl_link; - - /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ - struct e1inp_sign_link *oml_link; - - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - struct { - struct gsm_abis_mo mo; - } bb_transc; - - uint16_t arfcn; - int nominal_power; /* in dBm */ - unsigned int max_power_red; /* in actual dB */ - -#ifndef ROLE_BSC - struct trx_power_params power_params; - int ms_power_control; - - struct { - void *l1h; - } role_bts; -#endif - - union { - struct { - struct { - struct gsm_abis_mo mo; - } bbsig; - struct { - struct gsm_abis_mo mo; - } pa; - } bs11; - struct { - unsigned int test_state; - uint8_t test_nr; - struct rxlev_stats rxlev_stat; - } ipaccess; - struct { - struct { - struct om2k_mo om2k_mo; - } trxc; - struct { - struct om2k_mo om2k_mo; - } rx; - struct { - struct om2k_mo om2k_mo; - } tx; - } rbs2000; - }; - struct gsm_bts_trx_ts ts[TRX_NR_TS]; -}; - -enum gsm_bts_type { - GSM_BTS_TYPE_UNKNOWN, - GSM_BTS_TYPE_BS11, - GSM_BTS_TYPE_NANOBTS, - GSM_BTS_TYPE_RBS2000, - GSM_BTS_TYPE_NOKIA_SITE, - GSM_BTS_TYPE_OSMOBTS, - _NUM_GSM_BTS_TYPE -}; - -enum gsm_bts_type_variant { - BTS_UNKNOWN, - BTS_OSMO_LITECELL15, - BTS_OSMO_OCTPHY, - BTS_OSMO_SYSMO, - BTS_OSMO_TRX, - _NUM_BTS_VARIANT -}; - -/* Used by OML layer for BTS Attribute reporting */ -enum bts_attribute { - BTS_TYPE_VARIANT, - BTS_SUB_MODEL, - TRX_PHY_VERSION, -}; - -struct vty; - -/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility - with BTS compiled against earlier version of this header */ -enum gsm_bts_features { - BTS_FEAT_HSCSD, - BTS_FEAT_GPRS, - BTS_FEAT_EGPRS, - BTS_FEAT_ECSD, - BTS_FEAT_HOPPING, - BTS_FEAT_MULTI_TSC, - BTS_FEAT_OML_ALERTS, - BTS_FEAT_AGCH_PCH_PROP, - BTS_FEAT_CBCH, - _NUM_BTS_FEAT -}; - -extern const struct value_string gsm_bts_features_descs[]; - -/* - * This keeps track of the paging status of one BTS. It - * includes a number of pending requests, a back pointer - * to the gsm_bts, a timer and some more state. - */ -struct gsm_bts_paging_state { - /* pending requests */ - struct llist_head pending_requests; - struct gsm_bts *bts; - - struct osmo_timer_list work_timer; - struct osmo_timer_list credit_timer; - - /* free chans needed */ - int free_chans_need; - - /* load */ - uint16_t available_slots; -}; - -struct gsm_envabtse { - struct gsm_abis_mo mo; -}; - -struct gsm_bts_gprs_nsvc { - struct gsm_bts *bts; - /* data read via VTY config file, to configure the BTS - * via OML from BSC */ - int id; - uint16_t nsvci; - uint16_t local_port; /* on the BTS */ - uint16_t remote_port; /* on the SGSN */ - uint32_t remote_ip; /* on the SGSN */ - - struct gsm_abis_mo mo; -}; - -enum gprs_rlc_par { - RLC_T3142, - RLC_T3169, - RLC_T3191, - RLC_T3193, - RLC_T3195, - RLC_N3101, - RLC_N3103, - RLC_N3105, - CV_COUNTDOWN, - T_DL_TBF_EXT, /* ms */ - T_UL_TBF_EXT, /* ms */ - _NUM_RLC_PAR -}; - -enum gprs_cs { - GPRS_CS1, - GPRS_CS2, - GPRS_CS3, - GPRS_CS4, - GPRS_MCS1, - GPRS_MCS2, - GPRS_MCS3, - GPRS_MCS4, - GPRS_MCS5, - GPRS_MCS6, - GPRS_MCS7, - GPRS_MCS8, - GPRS_MCS9, - _NUM_GRPS_CS -}; - -struct gprs_rlc_cfg { - uint16_t parameter[_NUM_RLC_PAR]; - struct { - uint16_t repeat_time; /* ms */ - uint8_t repeat_count; - } paging; - uint32_t cs_mask; /* bitmask of gprs_cs */ - uint8_t initial_cs; - uint8_t initial_mcs; -}; - - -enum neigh_list_manual_mode { - NL_MODE_AUTOMATIC = 0, - NL_MODE_MANUAL = 1, - NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ -}; - -enum bts_loc_fix { - BTS_LOC_FIX_INVALID = 0, - BTS_LOC_FIX_2D = 1, - BTS_LOC_FIX_3D = 2, -}; - -extern const struct value_string bts_loc_fix_names[]; - -struct bts_location { - struct llist_head list; - time_t tstamp; - enum bts_loc_fix valid; - double lat; - double lon; - double height; -}; - -/* One BTS */ -struct gsm_bts { - /* list header in net->bts_list */ - struct llist_head list; - - /* Geographical location of the BTS */ - struct llist_head loc_list; - - /* number of ths BTS in network */ - uint8_t nr; - /* human readable name / description */ - char *description; - /* Cell Identity */ - uint16_t cell_identity; - /* location area code of this BTS */ - uint16_t location_area_code; - /* Base Station Identification Code (BSIC), lower 3 bits is BCC, - * which is used as TSC for the CCCH */ - uint8_t bsic; - /* type of BTS */ - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - - enum gsm_band band; - char version[MAX_VERSION_LENGTH]; - char sub_model[MAX_VERSION_LENGTH]; - - /* features of a given BTS set/reported via OML */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; - - /* Connected PCU version (if any) */ - char pcu_version[MAX_VERSION_LENGTH]; - - /* maximum Tx power that the MS is permitted to use in this cell */ - int ms_max_power; - - /* how do we talk OML with this TRX? */ - struct gsm_e1_subslot oml_e1_link; - uint8_t oml_tei; - struct e1inp_sign_link *oml_link; - - /* Abis network management O&M handle */ - struct abis_nm_h *nmh; - - struct gsm_abis_mo mo; - - /* number of this BTS on given E1 link */ - uint8_t bts_nr; - - /* DTX features of this BTS */ - enum gsm48_dtx_mode dtxu; - bool dtxd; - - /* paging state and control */ - struct gsm_bts_paging_state paging; - - /* CCCH is on C0 */ - struct gsm_bts_trx *c0; - - struct { - struct gsm_abis_mo mo; - } site_mgr; - - /* ip.accesss Unit ID's have Site/BTS/TRX layout */ - union { - struct { - uint16_t site_id; - uint16_t bts_id; - uint32_t flags; - uint32_t rsl_ip; - } ip_access; - struct { - struct { - struct gsm_abis_mo mo; - } cclk; - struct { - struct gsm_abis_mo mo; - } rack; - struct gsm_envabtse envabtse[4]; - } bs11; - struct { - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } cf; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } is; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } con; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - } dp; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - } tf; - uint32_t use_superchannel:1; - } rbs2000; - struct { - uint8_t bts_type; - unsigned int configured:1, - skip_reset:1, - no_loc_rel_cnf:1, - bts_reset_timer_cnf, - did_reset:1, - wait_reset:1; - struct osmo_timer_list reset_timer; - } nokia; - }; - - /* Not entirely sure how ip.access specific this is */ - struct { - uint8_t supports_egprs_11bit_rach; - enum bts_gprs_mode mode; - struct { - struct gsm_abis_mo mo; - uint16_t nsei; - uint8_t timer[7]; - } nse; - struct { - struct gsm_abis_mo mo; - uint16_t bvci; - uint8_t timer[11]; - struct gprs_rlc_cfg rlc_cfg; - } cell; - struct gsm_bts_gprs_nsvc nsvc[2]; - uint8_t rac; - uint8_t net_ctrl_ord; - bool ctrl_ack_type_use_block; - } gprs; - - /* RACH NM values */ - int rach_b_thresh; - int rach_ldavg_slots; - - /* transceivers */ - int num_trx; - struct llist_head trx_list; - - /* SI related items */ - int force_combined_si; - int bcch_change_mark; - -#ifdef ROLE_BSC - /* Abis NM queue */ - struct llist_head abis_queue; - int abis_nm_pend; - - struct gsm_network *network; - - /* should the channel allocator allocate channels from high TRX to TRX0, - * rather than starting from TRX0 and go upwards? */ - int chan_alloc_reverse; - - enum neigh_list_manual_mode neigh_list_manual_mode; - - bool early_classmark_allowed; - /* for testing only: Have an infinitely long radio link timeout */ - bool infinite_radio_link_timeout; - - /* do we use static (user-defined) system information messages? (bitmask) */ - uint32_t si_mode_static; - - /* exclude the BTS from the global RF Lock handling */ - int excl_from_rf_lock; - - /* supported codecs beside FR */ - struct bts_codec_conf codec; - - /* BTS dependencies bit field */ - uint32_t depends_on[256/(8*4)]; - - /* full and half rate multirate config */ - struct amr_multirate_conf mr_full; - struct amr_multirate_conf mr_half; - - /* PCU socket state */ - char *pcu_sock_path; - struct pcu_sock_state *pcu_state; - -#endif /* ROLE_BSC */ - void *role; -}; - - -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); - -enum gsm_bts_type str2btstype(const char *arg); -const char *btstype2str(enum gsm_bts_type type); - -enum bts_attribute str2btsattr(const char *s); -const char *btsatttr2str(enum bts_attribute v); - -enum gsm_bts_type_variant str2btsvariant(const char *arg); -const char *btsvariant2str(enum gsm_bts_type_variant v); - -extern const struct value_string gsm_chreq_descs[]; -const struct value_string gsm_pchant_names[13]; -const struct value_string gsm_pchant_descs[13]; -const char *gsm_pchan_name(enum gsm_phys_chan_config c); -enum gsm_phys_chan_config gsm_pchan_parse(const char *name); -const char *gsm_lchant_name(enum gsm_chan_t c); -const char *gsm_chreq_name(enum gsm_chreq_reason_t c); -char *gsm_trx_name(const struct gsm_bts_trx *trx); -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); -const char *gsm_lchans_name(enum gsm_lchan_state s); - -static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) -{ - return lchan->name; -} - -static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&bts->features, feat, 1); -} - -static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&bts->features, feat); -} - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo); - -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); - -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts); - -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr); -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan); - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); /* * help with parsing regexps */ int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) __attribute__ ((warn_unused_result)); - -static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) -{ - if (ts->tsc != -1) - return ts->tsc; - else - return ts->trx->bts->bsic & 7; -} - -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc); - -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); -bool ts_is_tch(struct gsm_bts_trx_ts *ts); #endif diff --git a/include/osmocom/msc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h index 4adfd41..16e1037 100644 --- a/include/osmocom/msc/gsm_subscriber.h +++ b/include/osmocom/msc/gsm_subscriber.h @@ -66,4 +66,7 @@ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); +/* Find an allocated channel for a specified subscriber */ +struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/osmocom/msc/handover.h b/include/osmocom/msc/handover.h deleted file mode 100644 index 3fe71a2..0000000 --- a/include/osmocom/msc/handover.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _HANDOVER_H -#define _HANDOVER_H - -struct gsm_subscriber_connection; - -int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); - -/* clear any operation for this connection */ -void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); - -/* Return the old lchan or NULL. This is meant for audio handling */ -struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); - -#endif /* _HANDOVER_H */ diff --git a/include/osmocom/msc/handover_decision.h b/include/osmocom/msc/handover_decision.h deleted file mode 100644 index 81078b0..0000000 --- a/include/osmocom/msc/handover_decision.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _HANDOVER_DECISION_H -#define _HANDOVER_DECISION_H - -void on_dso_load_ho_dec(void); - -#endif /* _HANDOVER_DECISION_H */ - diff --git a/include/osmocom/msc/meas_rep.h b/include/osmocom/msc/meas_rep.h deleted file mode 100644 index b0c03f0..0000000 --- a/include/osmocom/msc/meas_rep.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef _MEAS_REP_H -#define _MEAS_REP_H - -#include - -#include - -#define MRC_F_PROCESSED 0x0001 - -/* extracted from a L3 measurement report IE */ -struct gsm_meas_rep_cell { - uint8_t rxlev; - uint8_t bsic; - uint8_t neigh_idx; - uint16_t arfcn; - unsigned int flags; -}; - -#define MEAS_REP_F_UL_DTX 0x01 -#define MEAS_REP_F_DL_VALID 0x02 -#define MEAS_REP_F_BA1 0x04 -#define MEAS_REP_F_DL_DTX 0x08 -#define MEAS_REP_F_MS_TO 0x10 -#define MEAS_REP_F_MS_L1 0x20 -#define MEAS_REP_F_FPC 0x40 - -/* parsed uplink and downlink measurement result */ -struct gsm_meas_rep { - /* back-pointer to the logical channel */ - struct gsm_lchan *lchan; - - /* number of the measurement report */ - uint8_t nr; - /* flags, see MEAS_REP_F_* */ - unsigned int flags; - - /* uplink and downlink rxlev, rxqual; full and sub */ - struct gsm_meas_rep_unidir ul; - struct gsm_meas_rep_unidir dl; - - uint8_t bs_power; - /* according to 3GPP TS 48.058 ? MS Timing Offset [-63; 192] */ - int16_t ms_timing_offset; - struct { - int8_t pwr; /* MS power in dBm */ - uint8_t ta; /* MS timing advance */ - } ms_l1; - - /* neighbor measurement reports for up to 6 cells */ - int num_cell; - struct gsm_meas_rep_cell cell[6]; -}; - -/* obtain an average over the last 'num' fields in the meas reps */ -int get_meas_rep_avg(const struct gsm_lchan *lchan, - enum meas_rep_field field, unsigned int num); - -/* Check if N out of M last values for FIELD are >= bd */ -int meas_rep_n_out_of_m_be(const struct gsm_lchan *lchan, - enum meas_rep_field field, - unsigned int n, unsigned int m, int be); - -unsigned int calc_initial_idx(unsigned int array_size, - unsigned int meas_rep_idx, - unsigned int num_values); - -#endif /* _MEAS_REP_H */ diff --git a/include/osmocom/msc/misdn.h b/include/osmocom/msc/misdn.h deleted file mode 100644 index 9851ad3..0000000 --- a/include/osmocom/msc/misdn.h +++ /dev/null @@ -1,27 +0,0 @@ -/* (C) 2008 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef MISDN_H -#define MISDN_H - -#include - -int mi_setup(int cardnr, struct e1inp_line *line, int release_l2); -int mi_e1_line_update(struct e1inp_line *line); - -#endif diff --git a/include/osmocom/msc/network_listen.h b/include/osmocom/msc/network_listen.h deleted file mode 100644 index 05fbb2f..0000000 --- a/include/osmocom/msc/network_listen.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _OPENBSC_NWL_H -#define _OPENBSC_NWL_H - -#include -#include - -void ipac_nwl_init(void); - -/* Start a NWL test. It will raise the S_IPAC_TEST_COMPLETE signal. */ -int ipac_nwl_test_start(struct gsm_bts_trx *trx, uint8_t testnr, - const uint8_t *phys_conf, unsigned int phys_conf_len); - -int ipac_rxlevstat2whitelist(uint16_t *buf, const struct rxlev_stats *st, uint8_t min_rxlev, - uint16_t max_num_arfcns); - -#endif /* _OPENBSC_NWL_H */ diff --git a/include/osmocom/msc/osmo_bsc.h b/include/osmocom/msc/osmo_bsc.h deleted file mode 100644 index 5ebea50..0000000 --- a/include/osmocom/msc/osmo_bsc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* OpenBSC BSC code */ - -#ifndef OSMO_BSC_H -#define OSMO_BSC_H - -#include "bsc_api.h" -#include "bsc_msg_filter.h" - -#define BSS_SEND_USSD 1 - -enum bsc_con { - BSC_CON_SUCCESS, - BSC_CON_REJECT_NO_LINK, - BSC_CON_REJECT_RF_GRACE, - BSC_CON_NO_MEM, -}; - -struct sccp_connection; -struct bsc_msc_data; -struct bsc_msc_connection; - -struct osmo_bsc_sccp_con { - struct llist_head entry; - - int ciphering_handled; - - /* for audio handling */ - uint16_t cic; - uint32_t rtp_ip; - int rtp_port; - - /* for advanced ping/pong */ - int send_ping; - - /* SCCP connection realted */ - struct sccp_connection *sccp; - struct bsc_msc_data *msc; - struct osmo_timer_list sccp_it_timeout; - struct osmo_timer_list sccp_cc_timeout; - - struct llist_head sccp_queue; - unsigned int sccp_queue_size; - - struct gsm_subscriber_connection *conn; - uint8_t new_subscriber; - - struct bsc_filter_state filter_state; - - /* Sigtran connection ID */ - int conn_id; -}; - -struct bsc_api *osmo_bsc_api(); - -int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg); -int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg); -enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, - struct bsc_msc_data *msc, int send_ping); -int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp); - -struct bsc_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *); -int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn); - -int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length); -int bsc_handle_dt(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len); - -int bsc_ctrl_cmds_install(); - -void bsc_gen_location_state_trap(struct gsm_bts *bts); - -struct llist_head *bsc_access_lists(void); - -#endif diff --git a/include/osmocom/msc/osmo_bsc_reset.h b/include/osmocom/msc/osmo_bsc_reset.h deleted file mode 100644 index 578f763..0000000 --- a/include/osmocom/msc/osmo_bsc_reset.h +++ /dev/null @@ -1,34 +0,0 @@ -/* (C) 2017 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* Create and start state machine which handles the reset/reset-ack procedure */ -void start_reset_fsm(struct bsc_msc_data *msc); - -/* Confirm that we sucessfully received a reset acknowlege message */ -void reset_ack_confirm(struct bsc_msc_data *msc); - -/* Report a failed connection */ -void report_conn_fail(struct bsc_msc_data *msc); - -/* Report a successful connection */ -void report_conn_success(struct bsc_msc_data *msc); - -/* Check if we have a connection to a specified msc */ -bool sccp_conn_ready(struct bsc_msc_data *msc); diff --git a/include/osmocom/msc/osmo_bsc_sigtran.h b/include/osmocom/msc/osmo_bsc_sigtran.h deleted file mode 100644 index 7015edb..0000000 --- a/include/osmocom/msc/osmo_bsc_sigtran.h +++ /dev/null @@ -1,48 +0,0 @@ -/* (C) 2017 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include -#include - -/* Allocate resources to make a new connection oriented sigtran connection - * (not the connection ittself!) */ -enum bsc_con osmo_bsc_sigtran_new_conn(struct gsm_subscriber_connection *conn, struct bsc_msc_data *msc); - -/* Open a new connection oriented sigtran connection */ -int osmo_bsc_sigtran_open_conn(const struct osmo_bsc_sccp_con *conn, struct msgb *msg); - -/* Send data to MSC */ -int osmo_bsc_sigtran_send(const struct osmo_bsc_sccp_con *conn, struct msgb *msg); - -/* Delete a connection from the list with open connections - * (called by osmo_bsc_api.c on failing open connections and - * locally, when a connection is closed by the MSC */ -int osmo_bsc_sigtran_del_conn(struct osmo_bsc_sccp_con *sccp); - -/* Initalize osmo sigtran backhaul */ -int osmo_bsc_sigtran_init(struct llist_head *mscs); - -/* Close all open sigtran connections and channels */ -void osmo_bsc_sigtran_reset(const struct bsc_msc_data *msc); - -/* Send reset-ack to MSC */ -void osmo_bsc_sigtran_tx_reset_ack(const struct bsc_msc_data *msc); diff --git a/include/osmocom/msc/osmux.h b/include/osmocom/msc/osmux.h deleted file mode 100644 index f3ea72a..0000000 --- a/include/osmocom/msc/osmux.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_OSMUX_H_ -#define _OPENBSC_OSMUX_H_ - -#include - -#define OSMUX_PORT 1984 - -enum { - OSMUX_ROLE_BSC = 0, - OSMUX_ROLE_BSC_NAT, -}; - -int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); -void osmux_disable_endpoint(struct mgcp_endpoint *endp); -void osmux_allocate_cid(struct mgcp_endpoint *endp); -void osmux_release_cid(struct mgcp_endpoint *endp); - -int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc); -int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp); - -int osmux_send_dummy(struct mgcp_endpoint *endp); - -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); - -enum osmux_state { - OSMUX_STATE_DISABLED = 0, - OSMUX_STATE_NEGOTIATING, - OSMUX_STATE_ACTIVATING, - OSMUX_STATE_ENABLED, -}; - -enum osmux_usage { - OSMUX_USAGE_OFF = 0, - OSMUX_USAGE_ON = 1, - OSMUX_USAGE_ONLY = 2, -}; - -#endif diff --git a/include/osmocom/msc/rs232.h b/include/osmocom/msc/rs232.h deleted file mode 100644 index 61187ca..0000000 --- a/include/osmocom/msc/rs232.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _RS232_H -#define _RS232_H - -int rs232_setup(const char *serial_port, unsigned int delay_ms, - struct gsm_bts *bts); - -int handle_serial_msg(struct msgb *msg); - -#endif /* _RS232_H */ diff --git a/include/osmocom/msc/rtp_proxy.h b/include/osmocom/msc/rtp_proxy.h deleted file mode 100644 index 3cd8cac..0000000 --- a/include/osmocom/msc/rtp_proxy.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _RTP_PROXY_H -#define _RTP_PROXY_H - -/* RTP proxy handling for ip.access nanoBTS */ - -/* (C) 2009 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include - -#include -#include - -#include - -#define RTP_PT_GSM_FULL 3 -#define RTP_PT_GSM_HALF 96 -#define RTP_PT_GSM_EFR 97 -#define RTP_PT_AMR 98 -#define RTP_LEN_GSM_FULL 33 -#define RTP_LEN_GSM_HALF 15 -#define RTP_LEN_GSM_EFR 31 -#define RTP_GSM_DURATION 160 - -enum rtp_rx_action { - RTP_NONE, - RTP_PROXY, - RTP_RECV_UPSTREAM, -}; - -enum rtp_tx_action { - RTP_SEND_NONE, - RTP_SEND_DOWNSTREAM, -}; - -struct rtp_sub_socket { - struct sockaddr_in sin_local; - struct sockaddr_in sin_remote; - - struct osmo_fd bfd; - /* linked list of to-be-transmitted msgb's */ - struct llist_head tx_queue; -}; - -struct rtp_socket { - struct llist_head list; - - struct rtp_sub_socket rtp; - struct rtp_sub_socket rtcp; - - /* what should we do on receive? */ - enum rtp_rx_action rx_action; - union { - struct { - struct rtp_socket *other_sock; - } proxy; - struct { - struct gsm_network *net; - uint32_t callref; - } receive; - }; - enum rtp_tx_action tx_action; - struct { - uint16_t sequence; - uint32_t timestamp; - uint32_t ssrc; - struct timeval last_tv; - } transmit; -}; - -struct rtp_socket *rtp_socket_create(void); -int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip); -int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port); -int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other); -int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, uint32_t callref); -int rtp_socket_free(struct rtp_socket *rs); -int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame); - -#endif /* _RTP_PROXY_H */ diff --git a/include/osmocom/msc/signal.h b/include/osmocom/msc/signal.h index 14c76f8..29b6a59 100644 --- a/include/osmocom/msc/signal.h +++ b/include/osmocom/msc/signal.h @@ -35,18 +35,10 @@ enum signal_subsystems { SS_PAGING, SS_SMS, - SS_ABISIP, - SS_NM, - SS_LCHAN, SS_SUBSCR, SS_SCALL, - SS_CHALLOC, - SS_IPAC_NWL, - SS_RF, SS_MSC, - SS_HO, SS_CCCH, - SS_SGSN, }; /* SS_PAGING signals */ @@ -62,50 +54,6 @@ S_SMS_SMMA, /* A MS tells us it has more space available */ S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */ S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */ -}; - -/* SS_ABISIP signals */ -enum signal_abisip { - S_ABISIP_CRCX_ACK, - S_ABISIP_MDCX_ACK, - S_ABISIP_DLCX_IND, -}; - -/* SS_NM signals */ -enum signal_nm { - S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */ - S_NM_FAIL_REP, /* GSM 12.21 failure event report */ - S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */ - S_NM_IPACC_NACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_NACK happened */ - S_NM_IPACC_ACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_ACK happened */ - S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */ - S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */ - S_NM_TEST_REP, /* GSM 12.21 Test Report */ - S_NM_STATECHG_OPER, /* Operational State changed*/ - S_NM_STATECHG_ADM, /* Administrative State changed */ - S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */ -}; - -/* SS_LCHAN signals */ -enum signal_lchan { - /* - * The lchan got freed with an use_count != 0 and error - * recovery needs to be carried out from within the - * signal handler. - */ - S_LCHAN_UNEXPECTED_RELEASE, - S_LCHAN_ACTIVATE_ACK, /* 08.58 Channel Activate ACK */ - S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */ - S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */ - S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */ - S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */ - S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */ -}; - -/* SS_CHALLOC signals */ -enum signal_challoc { - S_CHALLOC_ALLOC_FAIL, /* allocation of lchan has failed */ - S_CHALLOC_FREED, /* lchan has been successfully freed */ }; /* SS_SUBSCR signals */ @@ -131,13 +79,6 @@ S_GLOBAL_BTS_CLOSE_OM, }; -/* SS_RF signals */ -enum signal_rf { - S_RF_OFF, - S_RF_ON, - S_RF_GRACE, -}; - struct paging_signal_data { struct vlr_subscr *vsub; struct gsm_bts *bts; @@ -152,51 +93,6 @@ struct gsm_subscriber_connection *conn; void *data; }; - -struct ipacc_ack_signal_data { - struct gsm_bts_trx *trx; - uint8_t msg_type; -}; - -struct abis_om2k_mo; - -struct nm_statechg_signal_data { - struct gsm_bts *bts; - uint8_t obj_class; - void *obj; - struct gsm_nm_state *old_state; - struct gsm_nm_state *new_state; - - /* This pointer is vaold for TS 12.21 MO */ - struct abis_om_obj_inst *obj_inst; - /* This pointer is vaold for RBS2000 MO */ - struct abis_om2k_mo *om2k_mo; -}; - -struct nm_om2k_signal_data { - struct gsm_bts *bts; - void *obj; - struct abis_om2k_mo *om2k_mo; - - uint8_t accordance_ind; -}; - -struct nm_nack_signal_data { - struct msgb *msg; - struct gsm_bts *bts; - uint8_t mt; -}; - -struct challoc_signal_data { - struct gsm_bts *bts; - struct gsm_lchan *lchan; - enum gsm_chan_t type; -}; - -struct rf_signal_data { - struct gsm_network *net; -}; - struct sms_signal_data { /* The transaction where this occured */ struct gsm_trans *trans; @@ -204,13 +100,6 @@ struct gsm_sms *sms; /* int paging result. Only the ones with > 0 */ int paging_result; -}; - -struct lchan_signal_data { - /* The lchan the signal happened on */ - struct gsm_lchan *lchan; - /* Measurement reports on this lchan */ - struct gsm_meas_rep *mr; }; /* MSC signals */ @@ -223,38 +112,6 @@ struct bsc_msc_data; struct msc_signal_data { struct bsc_msc_data *data; -}; - -/* SS_CCCH signals */ -enum signal_ccch { - S_CCCH_PAGING_LOAD, - S_CCCH_RACH_LOAD, -}; - -struct ccch_signal_data { - struct gsm_bts *bts; - uint16_t pg_buf_space; - uint16_t rach_slot_count; - uint16_t rach_busy_count; - uint16_t rach_access_count; -}; - -/* GPRS SGSN signals SS_SGSN */ -enum signal_sgsn { - S_SGSN_ATTACH, - S_SGSN_DETACH, - S_SGSN_UPDATE, - S_SGSN_PDP_ACT, - S_SGSN_PDP_DEACT, - S_SGSN_PDP_TERMINATE, - S_SGSN_PDP_FREE, - S_SGSN_MM_FREE, -}; - -struct sgsn_mm_ctx; -struct sgsn_signal_data { - struct sgsn_mm_ctx *mm; - struct sgsn_pdp_ctx *pdp; /* non-NULL for PDP_ACT, PDP_DEACT, PDP_FREE */ }; #endif diff --git a/include/osmocom/msc/slhc.h b/include/osmocom/msc/slhc.h deleted file mode 100644 index cd5a47c..0000000 --- a/include/osmocom/msc/slhc.h +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef _SLHC_H -#define _SLHC_H -/* - * Definitions for tcp compression routines. - * - * $Header: slcompress.h,v 1.10 89/12/31 08:53:02 van Exp $ - * - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: - * - Initial distribution. - * - * - * modified for KA9Q Internet Software Package by - * Katie Stevens (dkstevens at ucdavis.edu) - * University of California, Davis - * Computing Services - * - 01-31-90 initial adaptation - * - * - Feb 1991 Bill_Simpson at um.cc.umich.edu - * variable number of conversation slots - * allow zero or one slots - * separate routines - * status display - */ - -/* - * Compressed packet format: - * - * The first octet contains the packet type (top 3 bits), TCP - * 'push' bit, and flags that indicate which of the 4 TCP sequence - * numbers have changed (bottom 5 bits). The next octet is a - * conversation number that associates a saved IP/TCP header with - * the compressed packet. The next two octets are the TCP checksum - * from the original datagram. The next 0 to 15 octets are - * sequence number changes, one change per bit set in the header - * (there may be no changes and there are two special cases where - * the receiver implicitly knows what changed -- see below). - * - * There are 5 numbers which can change (they are always inserted - * in the following order): TCP urgent pointer, window, - * acknowledgment, sequence number and IP ID. (The urgent pointer - * is different from the others in that its value is sent, not the - * change in value.) Since typical use of SLIP links is biased - * toward small packets (see comments on MTU/MSS below), changes - * use a variable length coding with one octet for numbers in the - * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the - * range 256 - 65535 or 0. (If the change in sequence number or - * ack is more than 65535, an uncompressed packet is sent.) - */ - -/* - * Packet types (must not conflict with IP protocol version) - * - * The top nibble of the first octet is the packet type. There are - * three possible types: IP (not proto TCP or tcp with one of the - * control flags set); uncompressed TCP (a normal IP/TCP packet but - * with the 8-bit protocol field replaced by an 8-bit connection id -- - * this type of packet syncs the sender & receiver); and compressed - * TCP (described above). - * - * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and - * is logically part of the 4-bit "changes" field that follows. Top - * three bits are actual packet type. For backward compatibility - * and in the interest of conserving bits, numbers are chosen so the - * IP protocol version number (4) which normally appears in this nibble - * means "IP packet". - */ - - -#include -#include - -/* SLIP compression masks for len/vers byte */ -#define SL_TYPE_IP 0x40 -#define SL_TYPE_UNCOMPRESSED_TCP 0x70 -#define SL_TYPE_COMPRESSED_TCP 0x80 -#define SL_TYPE_ERROR 0x00 - -/* Bits in first octet of compressed packet */ -#define NEW_C 0x40 /* flag bits for what changed in a packet */ -#define NEW_I 0x20 -#define NEW_S 0x08 -#define NEW_A 0x04 -#define NEW_W 0x02 -#define NEW_U 0x01 - -/* reserved, special-case values of above */ -#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */ -#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */ -#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U) - -#define TCP_PUSH_BIT 0x10 - -/* - * data type and sizes conversion assumptions: - * - * VJ code KA9Q style generic - * u_char byte_t unsigned char 8 bits - * u_short int16 unsigned short 16 bits - * u_int int16 unsigned short 16 bits - * u_long unsigned long unsigned long 32 bits - * int int32 long 32 bits - */ - -typedef __u8 byte_t; -typedef __u32 int32; - -/* - * "state" data for each active tcp conversation on the wire. This is - * basically a copy of the entire IP/TCP header from the last packet - * we saw from the conversation together with a small identifier - * the transmit & receive ends of the line use to locate saved header. - */ -struct cstate { - byte_t cs_this; /* connection id number (xmit) */ - struct cstate *next; /* next in ring (xmit) */ - struct iphdr cs_ip; /* ip/tcp hdr from most recent packet */ - struct tcphdr cs_tcp; - unsigned char cs_ipopt[64]; - unsigned char cs_tcpopt[64]; - int cs_hsize; -}; -#define NULLSLSTATE (struct cstate *)0 - -/* - * all the state data for one serial line (we need one of these per line). - */ -struct slcompress { - struct cstate *tstate; /* transmit connection states (array)*/ - struct cstate *rstate; /* receive connection states (array)*/ - - byte_t tslot_limit; /* highest transmit slot id (0-l)*/ - byte_t rslot_limit; /* highest receive slot id (0-l)*/ - - byte_t xmit_oldest; /* oldest xmit in ring */ - byte_t xmit_current; /* most recent xmit id */ - byte_t recv_current; /* most recent rcvd id */ - - byte_t flags; -#define SLF_TOSS 0x01 /* tossing rcvd frames until id received */ - - int32 sls_o_nontcp; /* outbound non-TCP packets */ - int32 sls_o_tcp; /* outbound TCP packets */ - int32 sls_o_uncompressed; /* outbound uncompressed packets */ - int32 sls_o_compressed; /* outbound compressed packets */ - int32 sls_o_searches; /* searches for connection state */ - int32 sls_o_misses; /* times couldn't find conn. state */ - - int32 sls_i_uncompressed; /* inbound uncompressed packets */ - int32 sls_i_compressed; /* inbound compressed packets */ - int32 sls_i_error; /* inbound error packets */ - int32 sls_i_tossed; /* inbound packets tossed because of error */ - - int32 sls_i_runt; - int32 sls_i_badcheck; -}; -#define NULLSLCOMPR (struct slcompress *)0 - -/* In slhc.c: */ -struct slcompress *slhc_init(const void *ctx, int rslots, int tslots); - -void slhc_free(struct slcompress *comp); - -int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, - unsigned char *ocp, unsigned char **cpp, int compress_cid); -int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize); -int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize); -int slhc_toss(struct slcompress *comp); - -void slhc_i_status(struct slcompress *comp); -void slhc_o_status(struct slcompress *comp); - -#endif /* _SLHC_H */ diff --git a/include/osmocom/msc/system_information.h b/include/osmocom/msc/system_information.h deleted file mode 100644 index 854b7e3..0000000 --- a/include/osmocom/msc/system_information.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SYSTEM_INFO_H -#define _SYSTEM_INFO_H - -#include - -#include - -struct gsm_bts; - -int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type); -size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e); -unsigned range1024_p(unsigned n); -unsigned range512_q(unsigned m); -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); -#endif diff --git a/include/osmocom/msc/trau_mux.h b/include/osmocom/msc/trau_mux.h deleted file mode 100644 index 08863bf..0000000 --- a/include/osmocom/msc/trau_mux.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Simple TRAU frame reflector to route voice calls */ - -/* (C) 2009 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* The "TRAU mux map" defines which particular 16kbit sub-slot (in which E1 - * timeslot on which E1 interface) should be directly muxed to which other - * sub-slot. Entries in the mux map are always bi-directional. - * - * The idea of all this is to directly switch voice channels in the BSC - * from one phone to another. We do this right now since we don't support - * any external interface for voice channels, and in the future as an - * optimization to routing them externally. - */ - -#include -#include -#include - -struct decoded_trau_frame; - -/* map a TRAU mux map entry */ -int trau_mux_map(const struct gsm_e1_subslot *src, - const struct gsm_e1_subslot *dst); -int trau_mux_map_lchan(const struct gsm_lchan *src, - const struct gsm_lchan *dst); - -/* unmap a TRAU mux map entry */ -int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref); - -/* we get called by subchan_demux */ -int trau_mux_input(struct gsm_e1_subslot *src_e1_ss, - const uint8_t *trau_bits, int num_bits); - -/* add a trau receiver */ -int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref); - -/* send trau from application */ -int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame); - -/* switch trau muxer to new lchan */ -int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan); - -/* callback invoked if we receive TRAU frames */ -int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, void *_priv); - -/* TRAU frame transcoding */ -struct msgb *trau_decode_fr(uint32_t callref, - const struct decoded_trau_frame *tf); -struct msgb *trau_decode_efr(uint32_t callref, - const struct decoded_trau_frame *tf); -void trau_encode_fr(struct decoded_trau_frame *tf, - const unsigned char *data); -void trau_encode_efr(struct decoded_trau_frame *tf, - const unsigned char *data); diff --git a/include/osmocom/msc/trau_upqueue.h b/include/osmocom/msc/trau_upqueue.h deleted file mode 100644 index ecc7658..0000000 --- a/include/osmocom/msc/trau_upqueue.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _TRAU_UPQUEUE_H -#define _TRAU_UPQUEUE_H - -void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg); - -#endif /* _TRAU_UPQUEUE_H */ - diff --git a/include/osmocom/msc/vty.h b/include/osmocom/msc/vty.h index f705601..ff85fa0 100644 --- a/include/osmocom/msc/vty.h +++ b/include/osmocom/msc/vty.h @@ -17,27 +17,11 @@ enum bsc_vty_node { GSMNET_NODE = _LAST_OSMOVTY_NODE + 1, - BTS_NODE, - TRX_NODE, - TS_NODE, SUBSCR_NODE, - MGCP_NODE, - GBPROXY_NODE, - SGSN_NODE, - OML_NODE, - NAT_NODE, - NAT_BSC_NODE, MSC_NODE, - OM2K_NODE, - OM2K_CON_GROUP_NODE, - TRUNK_NODE, - PGROUP_NODE, MNCC_INT_NODE, - NITB_NODE, - BSC_NODE, SMPP_NODE, SMPP_ESME_NODE, - GTPHUB_NODE, HLR_NODE, }; diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index 3ee0058..d2f4f59 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -27,7 +27,6 @@ #include #include #include -#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 18272c5..8f70da7 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -24,7 +24,6 @@ common_vty.c \ debug.c \ gsm_data.c \ - gsm_data_shared.c \ gsup_client.c \ oap_client.c \ socket.c \ diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 6037dda..71c607e 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -42,25 +42,11 @@ vty->node = CONFIG_NODE; vty->index = NULL; break; - case TS_NODE: - vty->node = TRX_NODE; - { - /* set vty->index correctly ! */ - struct gsm_bts_trx_ts *ts = vty->index; - vty->index = ts->trx; - vty->index_sub = &ts->trx->description; - } - break; - case TRUNK_NODE: - vty->node = MGCP_NODE; - vty->index = NULL; - break; case SMPP_ESME_NODE: vty->node = SMPP_NODE; vty->index = NULL; break; case SMPP_NODE: - case MGCP_NODE: case MSC_NODE: case MNCC_INT_NODE: vty->node = CONFIG_NODE; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 4ab8a20..bdcdf02 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -29,73 +29,13 @@ #include #include #include -#include #include #include #include #include -#include void *tall_bsc_ctx; - -static LLIST_HEAD(bts_models); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss) -{ - ts->e1_link.e1_nr = e1_nr; - ts->e1_link.e1_ts = e1_ts; - ts->e1_link.e1_ts_ss = e1_ts_ss; -} - -const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { - { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, - { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, - { GSM_BTS_TYPE_NANOBTS, "ip.access nanoBTS or compatible" }, - { GSM_BTS_TYPE_RBS2000, "Ericsson RBS2000 Series" }, - { GSM_BTS_TYPE_NOKIA_SITE, "Nokia {Metro,Ultra,In}Site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" }, - { 0, NULL } -}; - -struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr) -{ - struct gsm_bts_trx *trx; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == nr) - return trx; - } - return NULL; -} - -/* Search for a BTS in the given Location Area; optionally start searching - * with start_bts (for continuing to search after the first result) */ -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts) -{ - int i; - struct gsm_bts *bts; - int skip = 0; - - if (start_bts) - skip = 1; - - for (i = 0; i < net->num_bts; i++) { - bts = gsm_bts_num(net, i); - - if (skip) { - if (start_bts == bts) - skip = 0; - continue; - } - - if (lac == GSM_LAC_RESERVED_ALL_BTS || bts->location_area_code == lac) - return bts; - } - return NULL; -} static const struct value_string auth_policy_names[] = { { GSM_AUTH_POLICY_CLOSED, "closed" }, @@ -133,45 +73,6 @@ return get_value_string(rrlp_mode_names, mode); } -static const struct value_string bts_gprs_mode_names[] = { - { BTS_GPRS_NONE, "none" }, - { BTS_GPRS_GPRS, "gprs" }, - { BTS_GPRS_EGPRS, "egprs" }, - { 0, NULL } -}; - -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid) -{ - int rc; - - rc = get_string_value(bts_gprs_mode_names, arg); - if (valid) - *valid = rc != -EINVAL; - return rc; -} - -const char *bts_gprs_mode_name(enum bts_gprs_mode mode) -{ - return get_value_string(bts_gprs_mode_names, mode); -} - -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; @@ -196,9 +97,6 @@ return ret; } - -/* Assume there are only 256 possible bts */ -osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); bool classmark_is_r99(struct gsm_classmark *cm) { diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c deleted file mode 100644 index 9382889..0000000 --- a/src/libcommon/gsm_data_shared.c +++ /dev/null @@ -1,853 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo) -{ - mo->nm_state.operational = NM_OPSTATE_NULL; - mo->nm_state.availability = NM_AVSTATE_POWER_OFF; -} - -static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, - uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) -{ - mo->bts = bts; - mo->obj_class = obj_class; - mo->obj_inst.bts_nr = p1; - mo->obj_inst.trx_nr = p2; - mo->obj_inst.ts_nr = p3; - gsm_abis_mo_reset(mo); -} - -const struct value_string bts_attribute_names[] = { - OSMO_VALUE_STRING(BTS_TYPE_VARIANT), - OSMO_VALUE_STRING(BTS_SUB_MODEL), - OSMO_VALUE_STRING(TRX_PHY_VERSION), - { 0, NULL } -}; - -enum bts_attribute str2btsattr(const char *s) -{ - return get_string_value(bts_attribute_names, s); -} - -const char *btsatttr2str(enum bts_attribute v) -{ - return get_value_string(bts_attribute_names, v); -} - -const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { - { BTS_UNKNOWN, "unknown" }, - { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, - { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, - { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, - { 0, NULL } -}; - -enum gsm_bts_type_variant str2btsvariant(const char *arg) -{ - return get_string_value(osmo_bts_variant_names, arg); -} - -const char *btsvariant2str(enum gsm_bts_type_variant v) -{ - return get_value_string(osmo_bts_variant_names, v); -} - -const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { - { GSM_BTS_TYPE_UNKNOWN, "unknown" }, - { GSM_BTS_TYPE_BS11, "bs11" }, - { GSM_BTS_TYPE_NANOBTS, "nanobts" }, - { GSM_BTS_TYPE_RBS2000, "rbs2000" }, - { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, - { 0, NULL } -}; - -enum gsm_bts_type str2btstype(const char *arg) -{ - return get_string_value(bts_type_names, arg); -} - -const char *btstype2str(enum gsm_bts_type type) -{ - return get_value_string(bts_type_names, type); -} - -const struct value_string gsm_bts_features_descs[] = { - { BTS_FEAT_HSCSD, "HSCSD" }, - { BTS_FEAT_GPRS, "GPRS" }, - { BTS_FEAT_EGPRS, "EGPRS" }, - { BTS_FEAT_ECSD, "ECSD" }, - { BTS_FEAT_HOPPING, "Frequency Hopping" }, - { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, - { BTS_FEAT_OML_ALERTS, "OML Alerts" }, - { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, - { BTS_FEAT_CBCH, "CBCH" }, - { 0, NULL } -}; - -const struct value_string gsm_chreq_descs[] = { - { GSM_CHREQ_REASON_EMERG, "emergency call" }, - { GSM_CHREQ_REASON_PAG, "answer to paging" }, - { GSM_CHREQ_REASON_CALL, "call re-establishment" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, - { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, - { GSM_CHREQ_REASON_OTHER, "other" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_names[13] = { - { GSM_PCHAN_NONE, "NONE" }, - { GSM_PCHAN_CCCH, "CCCH" }, - { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, - { GSM_PCHAN_TCH_F, "TCH/F" }, - { GSM_PCHAN_TCH_H, "TCH/H" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, - { GSM_PCHAN_PDCH, "PDCH" }, - { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, - { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_descs[13] = { - { GSM_PCHAN_NONE, "Physical Channel not configured" }, - { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, - { GSM_PCHAN_CCCH_SDCCH4, - "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, - { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, - { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, - { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, - { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, - { 0, NULL } -}; - -const char *gsm_pchan_name(enum gsm_phys_chan_config c) -{ - return get_value_string(gsm_pchant_names, c); -} - -enum gsm_phys_chan_config gsm_pchan_parse(const char *name) -{ - return get_string_value(gsm_pchant_names, name); -} - -/* TODO: move to libosmocore, next to gsm_chan_t_names? */ -const char *gsm_lchant_name(enum gsm_chan_t c) -{ - return get_value_string(gsm_chan_t_names, c); -} - -static const struct value_string lchan_s_names[] = { - { LCHAN_S_NONE, "NONE" }, - { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, - { LCHAN_S_ACTIVE, "ACTIVE" }, - { LCHAN_S_INACTIVE, "INACTIVE" }, - { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, - { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, - { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, - { 0, NULL } -}; - -const char *gsm_lchans_name(enum gsm_lchan_state s) -{ - return get_value_string(lchan_s_names, s); -} - -static const struct value_string chreq_names[] = { - { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, - { GSM_CHREQ_REASON_PAG, "PAGING" }, - { GSM_CHREQ_REASON_CALL, "CALL" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, - { GSM_CHREQ_REASON_OTHER, "OTHER" }, - { 0, NULL } -}; - -const char *gsm_chreq_name(enum gsm_chreq_reason_t c) -{ - return get_value_string(chreq_names, c); -} - -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) -{ - struct gsm_bts *bts; - - if (num >= net->num_bts) - return NULL; - - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == num) - return bts; - } - - return NULL; -} - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); - int k; - - if (!trx) - return NULL; - - trx->bts = bts; - trx->nr = bts->num_trx++; - trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; - - gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, - bts->nr, trx->nr, 0xff); - gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, - bts->nr, trx->nr, 0xff); - - for (k = 0; k < TRX_NR_TS; k++) { - struct gsm_bts_trx_ts *ts = &trx->ts[k]; - int l; - - ts->trx = trx; - ts->nr = k; - ts->pchan = GSM_PCHAN_NONE; - ts->dyn.pchan_is = GSM_PCHAN_NONE; - ts->dyn.pchan_want = GSM_PCHAN_NONE; - ts->tsc = -1; - - gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, - bts->nr, trx->nr, ts->nr); - - ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); - ts->hopping.arfcns.data = ts->hopping.arfcns_data; - ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); - ts->hopping.ma.data = ts->hopping.ma_data; - - for (l = 0; l < TS_MAX_LCHAN; l++) { - struct gsm_lchan *lchan; - char *name; - lchan = &ts->lchan[l]; - - lchan->ts = ts; - lchan->nr = l; - lchan->type = GSM_LCHAN_NONE; - - name = gsm_lchan_name_compute(lchan); - lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC - INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif - } - } - - if (trx->nr != 0) - trx->nominal_power = bts->c0->nominal_power; - - llist_add_tail(&trx->list, &bts->trx_list); - - return trx; -} - - -static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; -static const uint8_t bts_cell_timer_default[] = - { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; -static const struct gprs_rlc_cfg rlc_cfg_default = { - .parameter = { - [RLC_T3142] = 20, - [RLC_T3169] = 5, - [RLC_T3191] = 5, - [RLC_T3193] = 160, /* 10ms */ - [RLC_T3195] = 5, - [RLC_N3101] = 10, - [RLC_N3103] = 4, - [RLC_N3105] = 8, - [CV_COUNTDOWN] = 15, - [T_DL_TBF_EXT] = 250 * 10, /* ms */ - [T_UL_TBF_EXT] = 250 * 10, /* ms */ - }, - .paging = { - .repeat_time = 5 * 50, /* ms */ - .repeat_count = 3, - }, - .cs_mask = 0x1fff, - .initial_cs = 2, - .initial_mcs = 6, -}; - -struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) -{ - struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); - int i; - - if (!bts) - return NULL; - - bts->nr = bts_num; - bts->num_trx = 0; - INIT_LLIST_HEAD(&bts->trx_list); - bts->ms_max_power = 15; /* dBm */ - - gsm_mo_init(&bts->mo, bts, NM_OC_BTS, - bts->nr, 0xff, 0xff); - gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { - bts->gprs.nsvc[i].bts = bts; - bts->gprs.nsvc[i].id = i; - gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, - bts->nr, i, 0xff); - } - memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, - sizeof(bts->gprs.nse.timer)); - gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, - sizeof(bts->gprs.cell.timer)); - gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, - sizeof(bts->gprs.cell.rlc_cfg)); - - /* create our primary TRX */ - bts->c0 = gsm_bts_trx_alloc(bts); - if (!bts->c0) { - talloc_free(bts); - return NULL; - } - bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; - - bts->rach_b_thresh = -1; - bts->rach_ldavg_slots = -1; - bts->paging.free_chans_need = -1; - bts->features.data = &bts->_features_data[0]; - bts->features.data_len = sizeof(bts->_features_data); - - /* si handling */ - bts->bcch_change_mark = 1; - - return bts; -} - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx; - unsigned int i; - - gsm_abis_mo_reset(&bts->mo); - gsm_abis_mo_reset(&bts->site_mgr.mo); - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) - gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); - gsm_abis_mo_reset(&bts->gprs.nse.mo); - gsm_abis_mo_reset(&bts->gprs.cell.mo); - - llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_abis_mo_reset(&trx->mo); - gsm_abis_mo_reset(&trx->bb_transc.mo); - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - gsm_abis_mo_reset(&ts->mo); - } - } -} - -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) -{ - struct gsm_bts_trx *trx; - - if (num >= bts->num_trx) - return NULL; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == num) - return trx; - } - - return NULL; -} - -static char ts2str[255]; - -char *gsm_trx_name(const struct gsm_bts_trx *trx) -{ - if (!trx) - snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); - else - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", - trx->bts->nr, trx->nr); - - return ts2str; -} - - -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) -{ - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr); - - return ts2str; -} - -/*! Log timeslot number with full pchan information */ -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - if (ts->dyn.pchan_is == ts->dyn.pchan_want) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is)); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is), - gsm_pchan_name(ts->dyn.pchan_want)); - break; - case GSM_PCHAN_TCH_F_PDCH: - if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F"); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F", - (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" - : "TCH/F"); - break; - default: - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan)); - break; - } - - return ts2str; -} - -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) -{ - struct gsm_bts_trx_ts *ts = lchan->ts; - - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); - - return ts2str; -} - -/* obtain the MO structure for a given object instance */ -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - struct gsm_abis_mo *mo = NULL; - - switch (obj_class) { - case NM_OC_BTS: - mo = &bts->mo; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->mo; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bb_transc.mo; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - mo = &trx->ts[obj_inst->ts_nr].mo; - break; - case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr.mo; - break; - case NM_OC_BS11: - switch (obj_inst->bts_nr) { - case BS11_OBJ_CCLK: - mo = &bts->bs11.cclk.mo; - break; - case BS11_OBJ_BBSIG: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.bbsig.mo; - break; - case BS11_OBJ_PA: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.pa.mo; - break; - default: - return NULL; - } - break; - case NM_OC_BS11_RACK: - mo = &bts->bs11.rack.mo; - break; - case NM_OC_BS11_ENVABTSE: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) - return NULL; - mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; - break; - case NM_OC_GPRS_NSE: - mo = &bts->gprs.nse.mo; - break; - case NM_OC_GPRS_CELL: - mo = &bts->gprs.cell.mo; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; - break; - } - return mo; -} - -/* obtain the gsm_nm_state data structure for a given object instance */ -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_abis_mo *mo; - - mo = gsm_objclass2mo(bts, obj_class, obj_inst); - if (!mo) - return NULL; - - return &mo->nm_state; -} - -/* obtain the in-memory data structure of a given object instance */ -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - void *obj = NULL; - - switch (obj_class) { - case NM_OC_BTS: - obj = bts; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = trx; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = &trx->bb_transc; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - obj = &trx->ts[obj_inst->ts_nr]; - break; - case NM_OC_SITE_MANAGER: - obj = &bts->site_mgr; - break; - case NM_OC_GPRS_NSE: - obj = &bts->gprs.nse; - break; - case NM_OC_GPRS_CELL: - obj = &bts->gprs.cell; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - obj = &bts->gprs.nsvc[obj_inst->trx_nr]; - break; - } - return obj; -} - -/* See Table 10.5.25 of GSM04.08 */ -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr) -{ - uint8_t cbits, chan_nr; - - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_F_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = 0x01; - break; - case GSM_PCHAN_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = RSL_CHAN_OSMO_PDCH >> 3; - break; - case GSM_PCHAN_TCH_H: - OSMO_ASSERT(lchan_nr < 2); - cbits = 0x02; - cbits += lchan_nr; - break; - case GSM_PCHAN_CCCH_SDCCH4: - case GSM_PCHAN_CCCH_SDCCH4_CBCH: - /* - * As a special hack for BCCH, lchan_nr == 4 may be passed - * here. This should never be sent in an RSL message. - * See osmo-bts-xxx/oml.c:opstart_compl(). - */ - if (lchan_nr == CCCH_LCHAN) - chan_nr = 0; - else - OSMO_ASSERT(lchan_nr < 4); - cbits = 0x04; - cbits += lchan_nr; - break; - case GSM_PCHAN_SDCCH8_SACCH8C: - case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: - OSMO_ASSERT(lchan_nr < 8); - cbits = 0x08; - cbits += lchan_nr; - break; - default: - case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* - * FIXME: On octphy and litecell, we hit above assertion (see - * Max's comment at https://gerrit.osmocom.org/589 ); disabled - * for BTS until this is clarified; remove the #ifdef when it - * is fixed. - */ -#warning "fix caller that passes lchan_nr != 0" -#endif - cbits = 0x10; - break; - } - - chan_nr = (cbits << 3) | (ts_nr & 0x7); - - return chan_nr; -} - -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) -{ - enum gsm_phys_chan_config pchan = lchan->ts->pchan; - if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) - return gsm_lchan_as_pchan2chan_nr(lchan, - lchan->ts->dyn.pchan_is); - return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); -} - -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan) -{ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && as_pchan == GSM_PCHAN_PDCH) - return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); - return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); -} - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) -{ - struct gsm_lchan *lchan = NULL; - struct gsm_bts_trx *trx = bts->c0; - - if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) - lchan = &trx->ts[0].lchan[2]; - else { - int i; - for (i = 0; i < 8; i++) { - if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { - lchan = &trx->ts[i].lchan[2]; - break; - } - } - } - - return lchan; -} - -/* determine logical channel based on TRX and channel number IE */ -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc) -{ - uint8_t ts_nr = chan_nr & 0x07; - uint8_t cbits = chan_nr >> 3; - uint8_t lch_idx; - struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; - bool ok = true; - - if (rc) - *rc = -EINVAL; - - if (cbits == 0x01) { - lch_idx = 0; /* TCH/F */ - if (ts->pchan != GSM_PCHAN_TCH_F && - ts->pchan != GSM_PCHAN_PDCH && - ts->pchan != GSM_PCHAN_TCH_F_PDCH - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F - || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) - ok = false; - } else if ((cbits & 0x1e) == 0x02) { - lch_idx = cbits & 0x1; /* TCH/H */ - if (ts->pchan != GSM_PCHAN_TCH_H - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H - || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) - ok = false; - } else if ((cbits & 0x1c) == 0x04) { - lch_idx = cbits & 0x3; /* SDCCH/4 */ - if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - } else if ((cbits & 0x18) == 0x08) { - lch_idx = cbits & 0x7; /* SDCCH/8 */ - if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && - ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) - ok = false; - } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_CCCH && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - /* FIXME: we should not return first sdcch4 !!! */ - } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) - ok = false; - } else - return NULL; - - if (rc && ok) - *rc = 0; - - return &ts->lchan[lch_idx]; -} - -static const uint8_t subslots_per_pchan[] = { - [GSM_PCHAN_NONE] = 0, - [GSM_PCHAN_CCCH] = 0, - [GSM_PCHAN_PDCH] = 0, - [GSM_PCHAN_CCCH_SDCCH4] = 4, - [GSM_PCHAN_TCH_F] = 1, - [GSM_PCHAN_TCH_H] = 2, - [GSM_PCHAN_SDCCH8_SACCH8C] = 8, - [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, - [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, - /* - * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be - * part of this, those TS are handled according to their dynamic state. - */ -}; - -/*! Return the actual pchan type, also heeding dynamic TS. */ -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return ts->dyn.pchan_is; - case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return GSM_PCHAN_PDCH; - else - return GSM_PCHAN_TCH_F; - default: - return ts->pchan; - } -} - -/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of - * logical channels available in the timeslot. */ -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) -{ - return subslots_per_pchan[ts_pchan(ts)]; -} - -static bool pchan_is_tch(enum gsm_phys_chan_config pchan) -{ - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_H: - return true; - default: - return false; - } -} - -bool ts_is_tch(struct gsm_bts_trx_ts *ts) -{ - return pchan_is_tch(ts_pchan(ts)); -} diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c index c8e9cd3..ccda0d0 100644 --- a/src/libcommon/talloc_ctx.c +++ b/src/libcommon/talloc_ctx.c @@ -21,35 +21,18 @@ #include extern void *tall_bsc_ctx; -extern void *tall_fle_ctx; -extern void *tall_locop_ctx; -extern void *tall_authciphop_ctx; extern void *tall_gsms_ctx; extern void *tall_subscr_ctx; -extern void *tall_sub_req_ctx; extern void *tall_call_ctx; -extern void *tall_paging_ctx; extern void *tall_sigh_ctx; -extern void *tall_tqe_ctx; extern void *tall_trans_ctx; -extern void *tall_map_ctx; -extern void *tall_upq_ctx; -extern void *tall_ctr_ctx; void talloc_ctx_init(void *ctx_root) { msgb_talloc_ctx_init(ctx_root, 0); - tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); - tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); - tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); } diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 956bc44..7afd0c7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -43,18 +43,12 @@ #include #include #include -#include -#include #include -#include -#include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index d8d77e9..e67531e 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -48,12 +48,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -352,7 +350,7 @@ vlr_subscr_name(conn->vsub), rc); rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + rate_ctr_inc(&conn->network->msc_ctrs->ctr[ MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); } return rc; @@ -380,7 +378,7 @@ vlr_subscr_name(conn->vsub), rc); rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + rate_ctr_inc(&conn->network->msc_ctrs->ctr[ MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); } #else diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c index 5f49574..6d75bba 100644 --- a/src/libmsc/gsm_04_14.c +++ b/src/libmsc/gsm_04_14.c @@ -75,7 +75,6 @@ subch = (loop_mode << 1); msgb_put_u8(msg, subch); - msg->lchan = conn->lchan; return gsm0414_conn_sendmsg(conn, msg); } diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 4838027..fb61209 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 3b4c41d..d2cd170 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -34,7 +34,6 @@ #include #include #include -#include static const struct value_string mncc_names[] = { diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index 84623df..d6f3e3d 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -34,7 +34,6 @@ #include #include #include -#include void *tall_call_ctx; diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c index 7428893..9cc6b04 100644 --- a/src/libmsc/rrlp.c +++ b/src/libmsc/rrlp.c @@ -24,7 +24,6 @@ #include #include #include -#include /* RRLP msPositionReq, nsBased, * Accuracy=60, Method=gps, ResponseTime=2, oneSet */ diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index d715d5c..f3291d7 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -29,8 +29,6 @@ #include #include #include -#include -#include #include /* paging of the requested subscriber has completed */ diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 3ea5ddd..4e2fb55 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include "smpp_smsc.h" diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 1372a2c..3d39a0e 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index dbd826d..f8fc098 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include #include #include @@ -46,10 +44,9 @@ #include #include #include -#include +#include #include #include -#include #include #include diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 0d23697..f41df01 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -89,10 +88,7 @@ /* satisfy deps from libbsc legacy. TODO double check these */ -void *tall_fle_ctx = NULL; -void *tall_paging_ctx = NULL; void *tall_map_ctx = NULL; -void *tall_upq_ctx = NULL; /* end deps from libbsc legacy. */ static struct { diff --git a/tests/msc_vlr/msc_vlr_test_rest.c b/tests/msc_vlr/msc_vlr_test_rest.c index c5f7fcf..c19c4c6 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.c +++ b/tests/msc_vlr/msc_vlr_test_rest.c @@ -32,7 +32,6 @@ btw("freshly allocated conn"); g_conn = msc_subscr_con_allocate(net); - g_conn->bts = the_bts; EXPECT_ACCEPTED(false); btw("conn_fsm present, in state NEW"); diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index cf9122b..2152fe4 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -49,8 +49,6 @@ struct gsm_network *net = NULL; -struct gsm_bts *the_bts; - const char *gsup_tx_expected = NULL; bool gsup_tx_confirmed; @@ -160,7 +158,6 @@ { struct gsm_subscriber_connection *conn; conn = msc_subscr_con_allocate(net); - conn->bts = the_bts; conn->via_ran = rx_from_ran; conn->lac = 23; if (conn->via_ran == RAN_UTRAN_IU) { @@ -866,8 +863,6 @@ } printf("Done\n"); - - talloc_free(the_bts); check_talloc(msgb_ctx, tall_bsc_ctx, 8); return 0; -- To view, visit https://gerrit.osmocom.org/6051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:18:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:18:53 +0000 Subject: osmo-msc[master]: WIP: VTY: Add 'show connections' and 'show transactions' com... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-2 WIP -- To view, visit https://gerrit.osmocom.org/6050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c457c1eac20188f67b8379a36cfda3a085fcef4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:19:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:19:09 +0000 Subject: [MERGED] libusrp[master]: build: Link libusrp_la also to boost_system In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: build: Link libusrp_la also to boost_system ...................................................................... build: Link libusrp_la also to boost_system Change-Id: I184214c37251dde0ea9bd05f4a4cebfed35a8d9f --- M host/lib/Makefile.am 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified roox: Verified diff --git a/host/lib/Makefile.am b/host/lib/Makefile.am index 40c59f2..a0de559 100644 --- a/host/lib/Makefile.am +++ b/host/lib/Makefile.am @@ -29,6 +29,7 @@ libusrp_la_common_LIBADD = \ $(USB_LIBS) \ $(BOOST_THREAD_LIB) \ + $(BOOST_SYSTEM_LIB) \ ../misc/libmisc.la AM_CPPFLAGS = $(common_INCLUDES) $(BOOST_CPPFLAGS) $(WITH_INCLUDES) -- To view, visit https://gerrit.osmocom.org/6002 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I184214c37251dde0ea9bd05f4a4cebfed35a8d9f Gerrit-PatchSet: 1 Gerrit-Project: libusrp Gerrit-Branch: master Gerrit-Owner: roox Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: roox From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:28:27 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 24 Jan 2018 23:28:27 +0000 Subject: [PATCH] osmo-pcu[master]: Move PDCH-related functions into separate file Message-ID: Review at https://gerrit.osmocom.org/6053 Move PDCH-related functions into separate file The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539 --- M src/Makefile.am M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_bssgp_pcu.h M src/gprs_ms.h M src/gprs_rlcmac.cpp M src/gprs_rlcmac_meas.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/pcu_l1_if.cpp M src/pcu_vty_functions.cpp A src/pdch.cpp A src/pdch.h M src/sba.cpp M src/sba.h 16 files changed, 1,123 insertions(+), 1,026 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/6053/1 diff --git a/src/Makefile.am b/src/Makefile.am index 7d2a62e..b2f64f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,6 +54,7 @@ tbf_ul.cpp \ tbf_dl.cpp \ bts.cpp \ + pdch.cpp \ poll_controller.cpp \ encoding.cpp \ sba.cpp \ @@ -85,6 +86,7 @@ mslot_class.h \ tbf.h \ bts.h \ + pdch.h \ poll_controller.h \ encoding.h \ sba.h \ diff --git a/src/bts.cpp b/src/bts.cpp index 94354f2..3de9509 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include @@ -846,792 +846,6 @@ return ms; } -/* - * PDCH code below. TODO: move to a separate file - */ - -void gprs_rlcmac_pdch::enable() -{ - /* TODO: Check if there are still allocated resources.. */ - INIT_LLIST_HEAD(&paging_list); - m_is_enabled = 1; -} - -void gprs_rlcmac_pdch::disable() -{ - /* TODO.. kick free_resources once we know the TRX/TS we are on */ - m_is_enabled = 0; -} - -void gprs_rlcmac_pdch::free_resources() -{ - struct gprs_rlcmac_paging *pag; - - /* we are not enabled. there should be no resources */ - if (!is_enabled()) - return; - - /* kick all TBF on slot */ - gprs_rlcmac_tbf::free_all(this); - - /* flush all pending paging messages */ - while ((pag = dequeue_paging())) - talloc_free(pag); - - trx->bts->sba()->free_resources(this); -} - -struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() -{ - struct gprs_rlcmac_paging *pag; - - if (llist_empty(&paging_list)) - return NULL; - pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); - llist_del(&pag->list); - - return pag; -} - -struct msgb *gprs_rlcmac_pdch::packet_paging_request() -{ - struct gprs_rlcmac_paging *pag; - struct msgb *msg; - unsigned wp = 0, len; - - /* no paging, no message */ - pag = dequeue_paging(); - if (!pag) - return NULL; - - LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); - - /* alloc message */ - msg = msgb_alloc(23, "pag ctrl block"); - if (!msg) { - talloc_free(pag); - return NULL; - } - bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); - if (!pag_vec) { - msgb_free(msg); - talloc_free(pag); - return NULL; - } - wp = Encoding::write_packet_paging_request(pag_vec); - - /* loop until message is full */ - while (pag) { - /* try to add paging */ - if ((pag->identity_lv[1] & 0x07) == 4) { - /* TMSI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", - ntohl(*((uint32_t *)(pag->identity_lv + 1)))); - len = 1 + 1 + 1 + 32 + 2 + 1; - if (pag->identity_lv[0] != 5) { - LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " - "MI != 5 octets!\n"); - goto continue_next; - } - } else { - /* MI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", - osmo_hexdump(pag->identity_lv + 1, - pag->identity_lv[0])); - len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; - if (pag->identity_lv[0] > 8) { - LOGP(DRLCMAC, LOGL_ERROR, "Paging with " - "MI > 8 octets!\n"); - goto continue_next; - } - } - if (wp + len > 184) { - LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " - "next time\n"); - /* put back paging record, because does not fit */ - llist_add_tail(&pag->list, &paging_list); - break; - } - Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], - pag->identity_lv + 1, pag->chan_needed); - -continue_next: - talloc_free(pag); - pag = dequeue_paging(); - } - - bitvec_pack(pag_vec, msgb_put(msg, 23)); - RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); - bitvec_free(pag_vec); - talloc_free(mac_control_block); - - return msg; -} - -void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag) -{ - llist_add(&pag->list, &paging_list); -} - -void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) -{ - struct gprs_rlcmac_tbf *tbf, *new_tbf; - uint32_t tlli = packet->TLLI; - GprsMs *ms = bts()->ms_by_tlli(tlli); - gprs_rlcmac_ul_tbf *ul_tbf; - - tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", - fn, tlli, trx_no(), ts_no); - if (ms) - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown TBF corresponds to MS with IMSI %s, TA %d, " - "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", - ms->imsi(), ms->ta(), - ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, - ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", - ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, - ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - TBF_POLL_SCHED_UNSET(tbf); - - /* check if this control ack belongs to packet uplink ack */ - ul_tbf = as_ul_tbf(tbf); - if (ul_tbf && ul_tbf->handle_ctrl_ack()) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); - if (ul_tbf->ctrl_ack_to_toggle()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); - - tbf_free(tbf); - return; - } - if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { - /* We now know that the PACCH really existed */ - LOGPTBF(new_tbf, LOGL_INFO, - "The TBF has been confirmed on the PACCH, " - "changed type from CCCH to PACCH\n"); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - } - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - /* stop pending assignment timer */ - new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - - tbf_assign_control_ts(new_tbf); - return; - } - if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - - tbf_assign_control_ts(new_tbf); - /* there might be LLC packets waiting in the queue, but the DL - * TBF might have been released while the UL TBF has been - * established */ - if (new_tbf->ms()->need_dl_tbf()) - new_tbf->establish_dl_tbf_on_pacch(); - - return; - } - LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " - "at no request\n"); -} - -static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) -{ - static const int16_t rx_qual_map[] = { - 0, /* 0,14 % */ - 0, /* 0,28 % */ - 1, /* 0,57 % */ - 1, /* 1,13 % */ - 2, /* 2,26 % */ - 5, /* 4,53 % */ - 9, /* 9,05 % */ - 18, /* 18,10 % */ - }; - - meas->set_ms_rx_qual(rx_qual_map[ - OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) - ]); -} - -static void get_meas(struct pcu_l1_meas *meas, - const Packet_Resource_Request_t *qr) -{ - unsigned i; - - meas->set_ms_c_value(qr->C_VALUE); - if (qr->Exist_SIGN_VAR) - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_INFO, - "Packet resource request: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); - } - } -} - -static void get_meas(struct pcu_l1_meas *meas, - const Channel_Quality_Report_t *qr) -{ - unsigned i; - - get_rx_qual_meas(meas, qr->RXQUAL); - meas->set_ms_c_value(qr->C_VALUE); - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_DEBUG, - "Channel quality report: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL_TN); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); - } - } -} - -static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) -{ - bts->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), - tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject */ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); - } -} - -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 */ - struct gprs_rlcmac_dl_tbf *tbf; - int rc; - struct pcu_l1_meas meas; - int num_blocks; - uint8_t bits_data[RLC_GPRS_WS/8]; - bitvec bits; - int bsn_begin, bsn_end; - char show_bits[RLC_GPRS_WS + 1]; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_gprs_acknack_bits( - &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits)); - - rc = tbf->rcvd_dl_ack( - ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - } -} - -void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) -{ - int8_t tfi = 0; /* must be signed */ - struct gprs_rlcmac_dl_tbf *tbf; - struct pcu_l1_meas meas; - int rc; - int num_blocks; - uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; - char show_bits[RLC_EGPRS_MAX_WS + 1]; - bitvec bits; - int bsn_begin, bsn_end; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, - "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); - - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " - "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " - "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", - (int)ack_nack->EGPRS_AckNack.UnionType, - (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, - (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, - (void *)&ack_nack->EGPRS_AckNack.UnionType, - (void *)&ack_nack->EGPRS_AckNack.Desc, - (int)offsetof(EGPRS_AckNack_t, Desc), - (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->window()->v_a(), - tbf->window()->v_s(), - osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, - sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_egprs_acknack_bits( - &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits) - ); - - rc = tbf->rcvd_dl_ack( - ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - - /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - /* TODO: Implement Measurements parsing for EGPRS */ - /* - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - */ - } -} - -void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - if (request->ID.UnionType) { - struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; - uint32_t tlli = request->ID.u.TLLI; - uint8_t ms_class = 0; - uint8_t egprs_ms_class = 0; - uint8_t ta = GSM48_TA_INVALID; - struct pcu_l1_meas meas; - - GprsMs *ms = bts()->ms_by_tlli(tlli); - /* Keep the ms, even if it gets idle temporarily */ - GprsMs::Guard guard(ms); - - if (ms) { - ul_tbf = ms->ul_tbf(); - dl_tbf = ms->dl_tbf(); - ta = ms->ta(); - } - - /* We got a RACH so the MS was in packet idle mode and thus - * didn't have any active TBFs */ - if (ul_tbf) { - LOGPTBFUL(ul_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", - tlli); - tbf_free(ul_tbf); - ul_tbf = NULL; - } - - if (dl_tbf) { - LOGPTBFUL(dl_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", - tlli); - tbf_free(dl_tbf); - dl_tbf = NULL; - } - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " - "in packet resource request of single " - "block, so we provide one:\n"); - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled!\n"); - } else { - ta = sba->ta; - bts()->sba()->free_sba(sba); - } - if (request->Exist_MS_Radio_Access_capability) { - ms_class = Decoding::get_ms_class_by_capability( - &request->MS_Radio_Access_capability); - egprs_ms_class = - Decoding::get_egprs_ms_class_by_capability( - &request->MS_Radio_Access_capability); - } - if (!ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); - if (egprs_ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, - "MS supports EGPRS multislot class %d.\n", - egprs_ms_class); - ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, - egprs_ms_class, tlli, ta, ms); - - if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); - return; - } - - /* set control ts to current MS's TS, until assignment complete */ - LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", - ul_tbf->control_ts, ts_no); - - ul_tbf->control_ts = ts_no; - /* schedule uplink assignment */ - TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - - /* get capabilities */ - if (ul_tbf->ms()) - ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); - - /* get measurements */ - if (ul_tbf->ms()) { - get_meas(&meas, request); - ul_tbf->ms()->update_l1_meas(&meas); - } - return; - } - - if (request->ID.u.Global_TFI.UnionType) { - struct gprs_rlcmac_dl_tbf *dl_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; - dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!dl_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); - return; - } - LOGPTBFDL(dl_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - dl_tbf->m_n3101 = 0; - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; - ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!ul_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); - return; - } - LOGPTBFUL(ul_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - ul_tbf->m_n3101 = 0; - } -} - -void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled! TLLI=0x%08x\n", report->TLLI); - } else { - GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); - if (!ms) - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "but TLLI 0x%08x is unknown\n", report->TLLI); - else - ms->set_ta(sba->ta); - - bts()->sba()->free_sba(sba); - } - gprs_rlcmac_meas_rep(report); -} - -/* Received Uplink RLC control block. */ -int gprs_rlcmac_pdch::rcv_control_block( - const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) -{ - RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); - - if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - else - bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - - bts()->rlc_rcvd_control(); - switch (ul_control_block->u.MESSAGE_TYPE) { - case MT_PACKET_CONTROL_ACK: - rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); - break; - case MT_PACKET_DOWNLINK_ACK_NACK: - rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); - break; - case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: - rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); - break; - case MT_PACKET_RESOURCE_REQUEST: - rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); - break; - case MT_PACKET_MEASUREMENT_REPORT: - rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); - break; - case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: - /* ignoring it. change the SI to not force sending these? */ - break; - default: - bts()->decode_error(); - LOGP(DRLCMAC, LOGL_NOTICE, - "RX: [PCU <- BTS] unknown control block(%d) received\n", - ul_control_block->u.MESSAGE_TYPE); - } - talloc_free(ul_control_block); - return 1; -} - - -/* received RLC/MAC block from L1 */ -int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas) -{ - GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); - if (!cs) { - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" - "length: %d)\n", len); - return -EINVAL; - } - - bts()->rlc_ul_bytes(len); - - LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " - "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); - - if (cs.isGprs()) - return rcv_block_gprs(data, len, fn, meas, cs); - - if (cs.isEgprs()) - return rcv_data_block(data, len, fn, meas, cs); - - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", - cs.name()); - return -EINVAL; -} - -/*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - int rc; - struct gprs_rlc_data_info rlc_dec; - struct gprs_rlcmac_ul_tbf *tbf; - unsigned len = cs.sizeUL(); - - /* These are always data blocks, since EGPRS still uses CS-1 for - * control blocks (see 44.060, section 10.3, 1st par.) - */ - if (cs.isEgprs()) { - if (!bts()->bts_data()->egprs_enabled) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not enabled\n", - cs.name()); - return -EINVAL; - } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } else { - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } - - LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); - - rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); - if (rc < 0) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but header parsing has failed\n", - cs.name()); - bts()->decode_error(); - return rc; - } - - LOGP(DRLCMACUL, LOGL_INFO, - "Got %s RLC block: " - "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " - "rc=%d\n", - cs.name(), - rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, - rc); - - /* find TBF inst from given TFI */ - tbf = ul_tbf_by_tfi(rlc_dec.tfi); - if (!tbf) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", - rlc_dec.tfi); - return 0; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); -} - -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - unsigned payload = data[0] >> 6; - bitvec *block; - int rc = 0; - unsigned len = cs.maxBytesUL(); - - switch (payload) { - case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, data_len, fn, meas, cs); - break; - case GPRS_RLCMAC_CONTROL_BLOCK: - block = bitvec_alloc(len, tall_pcu_ctx); - if (!block) - return -ENOMEM; - bitvec_unpack(block, data); - rc = rcv_control_block(data, data_len, block, fn); - bitvec_free(block); - break; - case GPRS_RLCMAC_CONTROL_BLOCK_OPT: - LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); - break; - default: - LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); - rc = -EINVAL; - } - - return rc; -} - /* update TA based on TA provided by PH-DATA-IND */ void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta) { @@ -1689,110 +903,6 @@ update_tbf_ta(tbf, ta); } -} - -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - gprs_rlcmac_tbf *tbf; - LListHead *pos; - - llist_for_each(pos, tbf_list) { - tbf = pos->entry(); - if (tbf->tfi() != tfi) - continue; - if (!tbf->pdch[ts_no]) - continue; - return tbf; - } - return NULL; -} - -gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) -{ - return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); -} - -gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) -{ - return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); -} - -/* lookup TBF Entity (by TFI) */ -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - struct gprs_rlcmac_tbf *tbf; - - if (tfi >= 32) - return NULL; - - tbf = m_tbfs[dir][tfi]; - - if (!tbf) - return NULL; - - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { - return tbf; - } - - return NULL; -} - -void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - if (m_tbfs[tbf->direction][tbf->tfi()]) - LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " - "%s has not been detached, overwriting it\n", - ts_no, trx_no(), - m_tbfs[tbf->direction][tbf->tfi()]->name()); - - m_num_tbfs[tbf->direction] += 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; - } - m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); - m_tbfs[tbf->direction][tbf->tfi()] = tbf; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); - - m_num_tbfs[tbf->direction] -= 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); - } - m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); - m_tbfs[tbf->direction][tbf->tfi()] = NULL; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) -{ - m_num_reserved[dir] += 1; -} - -void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) -{ - OSMO_ASSERT(m_num_reserved[dir] > 0); - m_num_reserved[dir] -= 1; } void gprs_rlcmac_trx::reserve_slots(enum gprs_rlcmac_tbf_direction dir, diff --git a/src/bts.h b/src/bts.h index b1724c9..14221cb 100644 --- a/src/bts.h +++ b/src/bts.h @@ -35,6 +35,7 @@ #include "poll_controller.h" #include "sba.h" #include "tbf.h" +#include "pdch.h" #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" #endif @@ -64,96 +65,16 @@ struct BTS; struct GprsMs; -/* - * PDCH instance - */ -struct gprs_rlcmac_pdch { -#ifdef __cplusplus - struct gprs_rlcmac_paging *dequeue_paging(); - struct msgb *packet_paging_request(); - - void add_paging(struct gprs_rlcmac_paging *pag); - - void free_resources(); - - bool is_enabled() const; - - void enable(); - void disable(); - - /* dispatching of messages */ - int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas); - int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - - gprs_rlcmac_bts *bts_data() const; - BTS *bts() const; - uint8_t trx_no() const; - - struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); - struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); - - void attach_tbf(gprs_rlcmac_tbf *tbf); - void detach_tbf(gprs_rlcmac_tbf *tbf); - - unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; - - void reserve(enum gprs_rlcmac_tbf_direction dir); - void unreserve(enum gprs_rlcmac_tbf_direction dir); - unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; - - uint8_t assigned_usf() const; - uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; -#endif - - uint8_t m_is_enabled; /* TS is enabled */ - uint8_t tsc; /* TSC of this slot */ - uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ - uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ - uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ - struct llist_head paging_list; /* list of paging messages */ - uint32_t last_rts_fn; /* store last frame number of RTS */ - - /* back pointers */ - struct gprs_rlcmac_trx *trx; - uint8_t ts_no; - -#ifdef __cplusplus -private: - int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); - - void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); - void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); - void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); - void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); - void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); - gprs_rlcmac_tbf *tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); - gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); -#endif - - uint8_t m_num_tbfs[2]; - uint8_t m_num_reserved[2]; - uint8_t m_assigned_usf; /* bit set */ - uint32_t m_assigned_tfi[2]; /* bit set */ - struct gprs_rlcmac_tbf *m_tbfs[2][32]; -}; - struct gprs_rlcmac_trx { void *fl1h; uint16_t arfcn; - struct gprs_rlcmac_pdch pdch[8]; /* back pointers */ struct BTS *bts; uint8_t trx_no; #ifdef __cplusplus + struct gprs_rlcmac_pdch pdch[8]; void reserve_slots(enum gprs_rlcmac_tbf_direction dir, uint8_t slots); void unreserve_slots(enum gprs_rlcmac_tbf_direction dir, uint8_t slots); #endif @@ -540,33 +461,6 @@ return m_dl_tbfs; } -inline BTS *gprs_rlcmac_pdch::bts() const -{ - return trx->bts; -} - -inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const -{ - return m_num_tbfs[dir]; -} - -inline unsigned gprs_rlcmac_pdch::num_reserved( - enum gprs_rlcmac_tbf_direction dir) const -{ - return gprs_rlcmac_pdch::m_num_reserved[dir]; -} - -inline uint8_t gprs_rlcmac_pdch::assigned_usf() const -{ - return m_assigned_usf; -} - -inline uint32_t gprs_rlcmac_pdch::assigned_tfi( - enum gprs_rlcmac_tbf_direction dir) const -{ - return m_assigned_tfi[dir]; -} - inline struct rate_ctr_group *BTS::rate_counters() const { return m_ratectrs; @@ -687,15 +581,6 @@ #undef CREATE_STAT_INLINE -inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const -{ - return trx->bts->bts_data(); -} - -inline uint8_t gprs_rlcmac_pdch::trx_no() const -{ - return trx->trx_no; -} #endif #ifdef __cplusplus @@ -707,8 +592,4 @@ #ifdef __cplusplus } -inline bool gprs_rlcmac_pdch::is_enabled() const -{ - return m_is_enabled; -} #endif diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index a86e09d..70a1b35 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -18,11 +18,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include -#include +#include +#include #include #include +#include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h index bb44903..4eda57d 100644 --- a/src/gprs_bssgp_pcu.h +++ b/src/gprs_bssgp_pcu.h @@ -42,8 +42,6 @@ #define NS_HDR_LEN 4 #define IE_LLC_PDU 14 -struct gprs_rlcmac_bts; - struct gprs_bssgp_pcu { struct gprs_nsvc *nsvc; struct bssgp_bvc_ctx *bctx; diff --git a/src/gprs_ms.h b/src/gprs_ms.h index f094e96..4751f63 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -22,6 +22,7 @@ struct gprs_codel; +#include #include "cxx_linuxlist.h" #include "llc.h" #include "tbf.h" diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index 06c5479..04b90f2 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -21,10 +21,8 @@ #include #include -#include +#include #include -#include - extern void *tall_pcu_ctx; diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index 41a7531..5b35381 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index ebf4714..877056a 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -18,11 +18,14 @@ */ #include -#include #include #include #include - +#include +#include +#include +#include +#include #include "pcu_utils.h" static uint32_t sched_poll(BTS *bts, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5e670d7..5a7ed80 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -19,10 +19,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include +#include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b04..a692084 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 001164c..f7ab5d0 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -27,6 +27,11 @@ #include "gprs_ms_storage.h" #include "gprs_ms.h" #include "cxx_linuxlist.h" +#include +#include +#include +#include +#include extern "C" { # include diff --git a/src/pdch.cpp b/src/pdch.cpp new file mode 100644 index 0000000..19d7c4a --- /dev/null +++ b/src/pdch.cpp @@ -0,0 +1,941 @@ +/* + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include + +extern "C" { + #include + #include + #include + #include + #include + #include + #include +} + +#include + +extern void *tall_pcu_ctx; + +static void get_meas(struct pcu_l1_meas *meas, const Packet_Resource_Request_t *qr) +{ + unsigned i; + + meas->set_ms_c_value(qr->C_VALUE); + if (qr->Exist_SIGN_VAR) + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_INFO, + "Packet resource request: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); + } + } +} + +static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) +{ + static const int16_t rx_qual_map[] = { + 0, /* 0,14 % */ + 0, /* 0,28 % */ + 1, /* 0,57 % */ + 1, /* 1,13 % */ + 2, /* 2,26 % */ + 5, /* 4,53 % */ + 9, /* 9,05 % */ + 18, /* 18,10 % */ + }; + + meas->set_ms_rx_qual(rx_qual_map[ + OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) + ]); +} + +static void get_meas(struct pcu_l1_meas *meas, const Channel_Quality_Report_t *qr) +{ + unsigned i; + + get_rx_qual_meas(meas, qr->RXQUAL); + meas->set_ms_c_value(qr->C_VALUE); + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_DEBUG, + "Channel quality report: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL_TN); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); + } + } +} + +void gprs_rlcmac_pdch::enable() +{ + /* TODO: Check if there are still allocated resources.. */ + INIT_LLIST_HEAD(&paging_list); + m_is_enabled = 1; +} + +void gprs_rlcmac_pdch::disable() +{ + /* TODO.. kick free_resources once we know the TRX/TS we are on */ + m_is_enabled = 0; +} + +void gprs_rlcmac_pdch::free_resources() +{ + struct gprs_rlcmac_paging *pag; + + /* we are not enabled. there should be no resources */ + if (!is_enabled()) + return; + + /* kick all TBF on slot */ + gprs_rlcmac_tbf::free_all(this); + + /* flush all pending paging messages */ + while ((pag = dequeue_paging())) + talloc_free(pag); + + trx->bts->sba()->free_resources(this); +} + +struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() +{ + struct gprs_rlcmac_paging *pag; + + if (llist_empty(&paging_list)) + return NULL; + pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); + llist_del(&pag->list); + + return pag; +} + +struct msgb *gprs_rlcmac_pdch::packet_paging_request() +{ + struct gprs_rlcmac_paging *pag; + struct msgb *msg; + unsigned wp = 0, len; + + /* no paging, no message */ + pag = dequeue_paging(); + if (!pag) + return NULL; + + LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); + + /* alloc message */ + msg = msgb_alloc(23, "pag ctrl block"); + if (!msg) { + talloc_free(pag); + return NULL; + } + bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); + if (!pag_vec) { + msgb_free(msg); + talloc_free(pag); + return NULL; + } + wp = Encoding::write_packet_paging_request(pag_vec); + + /* loop until message is full */ + while (pag) { + /* try to add paging */ + if ((pag->identity_lv[1] & 0x07) == 4) { + /* TMSI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", + ntohl(*((uint32_t *)(pag->identity_lv + 1)))); + len = 1 + 1 + 1 + 32 + 2 + 1; + if (pag->identity_lv[0] != 5) { + LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " + "MI != 5 octets!\n"); + goto continue_next; + } + } else { + /* MI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", + osmo_hexdump(pag->identity_lv + 1, + pag->identity_lv[0])); + len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; + if (pag->identity_lv[0] > 8) { + LOGP(DRLCMAC, LOGL_ERROR, "Paging with " + "MI > 8 octets!\n"); + goto continue_next; + } + } + if (wp + len > 184) { + LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " + "next time\n"); + /* put back paging record, because does not fit */ + llist_add_tail(&pag->list, &paging_list); + break; + } + Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], + pag->identity_lv + 1, pag->chan_needed); + +continue_next: + talloc_free(pag); + pag = dequeue_paging(); + } + + bitvec_pack(pag_vec, msgb_put(msg, 23)); + RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); + bitvec_free(pag_vec); + talloc_free(mac_control_block); + + return msg; +} + +void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag) +{ + llist_add(&pag->list, &paging_list); +} + +void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) +{ + struct gprs_rlcmac_tbf *tbf, *new_tbf; + uint32_t tlli = packet->TLLI; + GprsMs *ms = bts()->ms_by_tlli(tlli); + gprs_rlcmac_ul_tbf *ul_tbf; + + tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", + fn, tlli, trx_no(), ts_no); + if (ms) + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown TBF corresponds to MS with IMSI %s, TA %d, " + "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", + ms->imsi(), ms->ta(), + ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, + ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", + ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, + ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); + TBF_POLL_SCHED_UNSET(tbf); + + /* check if this control ack belongs to packet uplink ack */ + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); + if (ul_tbf->ctrl_ack_to_toggle()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); + + tbf_free(tbf); + return; + } + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { + /* We now know that the PACCH really existed */ + LOGPTBF(new_tbf, LOGL_INFO, + "The TBF has been confirmed on the PACCH, " + "changed type from CCCH to PACCH\n"); + new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + } + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + /* stop pending assignment timer */ + new_tbf->t_stop(T0, "control acked (DL-TBF)"); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); + + tbf_assign_control_ts(new_tbf); + return; + } + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); + + tbf_assign_control_ts(new_tbf); + /* there might be LLC packets waiting in the queue, but the DL + * TBF might have been released while the UL TBF has been + * established */ + if (new_tbf->ms()->need_dl_tbf()) + new_tbf->establish_dl_tbf_on_pacch(); + + return; + } + LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " + "at no request\n"); +} + +void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled! TLLI=0x%08x\n", report->TLLI); + } else { + GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); + if (!ms) + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "but TLLI 0x%08x is unknown\n", report->TLLI); + else + ms->set_ta(sba->ta); + + bts()->sba()->free_sba(sba); + } + gprs_rlcmac_meas_rep(report); +} + +/* Received Uplink RLC control block. */ +int gprs_rlcmac_pdch::rcv_control_block( + const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) +{ + RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + + if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + else + bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + + bts()->rlc_rcvd_control(); + switch (ul_control_block->u.MESSAGE_TYPE) { + case MT_PACKET_CONTROL_ACK: + rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); + break; + case MT_PACKET_DOWNLINK_ACK_NACK: + rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); + break; + case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: + rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); + break; + case MT_PACKET_RESOURCE_REQUEST: + rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); + break; + case MT_PACKET_MEASUREMENT_REPORT: + rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); + break; + case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: + /* ignoring it. change the SI to not force sending these? */ + break; + default: + bts()->decode_error(); + LOGP(DRLCMAC, LOGL_NOTICE, + "RX: [PCU <- BTS] unknown control block(%d) received\n", + ul_control_block->u.MESSAGE_TYPE); + } + talloc_free(ul_control_block); + return 1; +} + +/* received RLC/MAC block from L1 */ +int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas) +{ + GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); + if (!cs) { + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" + "length: %d)\n", len); + return -EINVAL; + } + + bts()->rlc_ul_bytes(len); + + LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " + "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); + + if (cs.isGprs()) + return rcv_block_gprs(data, len, fn, meas, cs); + + if (cs.isEgprs()) + return rcv_data_block(data, len, fn, meas, cs); + + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", + cs.name()); + return -EINVAL; +} + +/*! \brief process egprs and gprs data blocks */ +int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + int rc; + struct gprs_rlc_data_info rlc_dec; + struct gprs_rlcmac_ul_tbf *tbf; + unsigned len = cs.sizeUL(); + + /* These are always data blocks, since EGPRS still uses CS-1 for + * control blocks (see 44.060, section 10.3, 1st par.) + */ + if (cs.isEgprs()) { + if (!bts()->bts_data()->egprs_enabled) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but EGPRS is not enabled\n", + cs.name()); + return -EINVAL; + } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } + + LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); + + rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); + if (rc < 0) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but header parsing has failed\n", + cs.name()); + bts()->decode_error(); + return rc; + } + + LOGP(DRLCMACUL, LOGL_INFO, + "Got %s RLC block: " + "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " + "rc=%d\n", + cs.name(), + rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, + rc); + + /* find TBF inst from given TFI */ + tbf = ul_tbf_by_tfi(rlc_dec.tfi); + if (!tbf) { + LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", + rlc_dec.tfi); + return 0; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); +} + +int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + unsigned payload = data[0] >> 6; + bitvec *block; + int rc = 0; + unsigned len = cs.maxBytesUL(); + + switch (payload) { + case GPRS_RLCMAC_DATA_BLOCK: + rc = rcv_data_block(data, data_len, fn, meas, cs); + break; + case GPRS_RLCMAC_CONTROL_BLOCK: + block = bitvec_alloc(len, tall_pcu_ctx); + if (!block) + return -ENOMEM; + bitvec_unpack(block, data); + rc = rcv_control_block(data, data_len, block, fn); + bitvec_free(block); + break; + case GPRS_RLCMAC_CONTROL_BLOCK_OPT: + LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); + break; + default: + LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); + rc = -EINVAL; + } + + return rc; +} + +void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + if (request->ID.UnionType) { + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + uint32_t tlli = request->ID.u.TLLI; + uint8_t ms_class = 0; + uint8_t egprs_ms_class = 0; + uint8_t ta = GSM48_TA_INVALID; + struct pcu_l1_meas meas; + + GprsMs *ms = bts()->ms_by_tlli(tlli); + /* Keep the ms, even if it gets idle temporarily */ + GprsMs::Guard guard(ms); + + if (ms) { + ul_tbf = ms->ul_tbf(); + dl_tbf = ms->dl_tbf(); + ta = ms->ta(); + } + + /* We got a RACH so the MS was in packet idle mode and thus + * didn't have any active TBFs */ + if (ul_tbf) { + LOGPTBFUL(ul_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", + tlli); + tbf_free(ul_tbf); + ul_tbf = NULL; + } + + if (dl_tbf) { + LOGPTBFUL(dl_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", + tlli); + tbf_free(dl_tbf); + dl_tbf = NULL; + } + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " + "in packet resource request of single " + "block, so we provide one:\n"); + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled!\n"); + } else { + ta = sba->ta; + bts()->sba()->free_sba(sba); + } + if (request->Exist_MS_Radio_Access_capability) { + ms_class = Decoding::get_ms_class_by_capability( + &request->MS_Radio_Access_capability); + egprs_ms_class = + Decoding::get_egprs_ms_class_by_capability( + &request->MS_Radio_Access_capability); + } + if (!ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); + if (egprs_ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, + "MS supports EGPRS multislot class %d.\n", + egprs_ms_class); + ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, + egprs_ms_class, tlli, ta, ms); + + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); + return; + } + + /* set control ts to current MS's TS, until assignment complete */ + LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", + ul_tbf->control_ts, ts_no); + + ul_tbf->control_ts = ts_no; + /* schedule uplink assignment */ + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + + /* get capabilities */ + if (ul_tbf->ms()) + ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); + + /* get measurements */ + if (ul_tbf->ms()) { + get_meas(&meas, request); + ul_tbf->ms()->update_l1_meas(&meas); + } + return; + } + + if (request->ID.u.Global_TFI.UnionType) { + struct gprs_rlcmac_dl_tbf *dl_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; + dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!dl_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); + return; + } + LOGPTBFDL(dl_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + dl_tbf->m_n3101 = 0; + } else { + struct gprs_rlcmac_ul_tbf *ul_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; + ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!ul_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); + return; + } + LOGPTBFUL(ul_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + ul_tbf->m_n3101 = 0; + } +} + +static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) +{ + bts->channel_request_description(); + + /* This call will register the new TBF with the MS on success */ + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), + tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + + /* schedule uplink assignment or reject */ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); + } +} + +void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) +{ + int8_t tfi = 0; /* must be signed */ + struct gprs_rlcmac_dl_tbf *tbf; + struct pcu_l1_meas meas; + int rc; + int num_blocks; + uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; + char show_bits[RLC_EGPRS_MAX_WS + 1]; + bitvec bits; + int bsn_begin, bsn_end; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, + "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); + + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " + "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " + "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", + (int)ack_nack->EGPRS_AckNack.UnionType, + (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, + (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, + (void *)&ack_nack->EGPRS_AckNack.UnionType, + (void *)&ack_nack->EGPRS_AckNack.Desc, + (int)offsetof(EGPRS_AckNack_t, Desc), + (int)offsetof(EGPRS_AckNack_w_len_t, Desc), + tbf->window()->v_a(), + tbf->window()->v_s(), + osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, + sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_egprs_acknack_bits( + &ack_nack->EGPRS_AckNack.Desc, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits) + ); + + rc = tbf->rcvd_dl_ack( + ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + + /* check for channel request */ + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + /* TODO: Implement Measurements parsing for EGPRS */ + /* + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + */ + } +} + +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + gprs_rlcmac_tbf *tbf; + LListHead *pos; + + llist_for_each(pos, tbf_list) { + tbf = pos->entry(); + if (tbf->tfi() != tfi) + continue; + if (!tbf->pdch[ts_no]) + continue; + return tbf; + } + return NULL; +} + +gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) +{ + return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); +} + +gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) +{ + return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); +} + +/* lookup TBF Entity (by TFI) */ +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + struct gprs_rlcmac_tbf *tbf; + + if (tfi >= 32) + return NULL; + + tbf = m_tbfs[dir][tfi]; + + if (!tbf) + return NULL; + + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { + return tbf; + } + + return NULL; +} + +void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + if (m_tbfs[tbf->direction][tbf->tfi()]) + LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " + "%s has not been detached, overwriting it\n", + ts_no, trx_no(), + m_tbfs[tbf->direction][tbf->tfi()]->name()); + + m_num_tbfs[tbf->direction] += 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; + } + m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); + m_tbfs[tbf->direction][tbf->tfi()] = tbf; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); + + m_num_tbfs[tbf->direction] -= 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); + } + m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); + m_tbfs[tbf->direction][tbf->tfi()] = NULL; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) +{ + m_num_reserved[dir] += 1; +} + +void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) +{ + OSMO_ASSERT(m_num_reserved[dir] > 0); + m_num_reserved[dir] -= 1; +} + +inline BTS *gprs_rlcmac_pdch::bts() const +{ + return trx->bts; +} + +uint8_t gprs_rlcmac_pdch::trx_no() const +{ + return trx->trx_no; +} + +inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const +{ + return trx->bts->bts_data(); +} + +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 */ + struct gprs_rlcmac_dl_tbf *tbf; + int rc; + struct pcu_l1_meas meas; + int num_blocks; + uint8_t bits_data[RLC_GPRS_WS/8]; + bitvec bits; + int bsn_begin, bsn_end; + char show_bits[RLC_GPRS_WS + 1]; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_gprs_acknack_bits( + &ack_nack->Ack_Nack_Description, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits)); + + rc = tbf->rcvd_dl_ack( + ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + /* check for channel request */ + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + } +} diff --git a/src/pdch.h b/src/pdch.h new file mode 100644 index 0000000..d242a2d --- /dev/null +++ b/src/pdch.h @@ -0,0 +1,155 @@ +/* pdch.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#include +#include +#include +#include +#include +#include +#include +} + +#endif + +#include +#include + +#include + +#ifdef __cplusplus +#include +#endif + +/* + * PDCH instance + */ +struct gprs_rlcmac_pdch { +#ifdef __cplusplus + struct gprs_rlcmac_paging *dequeue_paging(); + struct msgb *packet_paging_request(); + + void add_paging(struct gprs_rlcmac_paging *pag); + + void free_resources(); + + bool is_enabled() const; + + void enable(); + void disable(); + + /* dispatching of messages */ + int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas); + int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + + gprs_rlcmac_bts *bts_data() const; + BTS *bts() const; + uint8_t trx_no() const; + + struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); + + void attach_tbf(gprs_rlcmac_tbf *tbf); + void detach_tbf(gprs_rlcmac_tbf *tbf); + + unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; + + void reserve(enum gprs_rlcmac_tbf_direction dir); + void unreserve(enum gprs_rlcmac_tbf_direction dir); + unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; + + uint8_t assigned_usf() const; + uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; +#endif + + uint8_t m_is_enabled; /* TS is enabled */ + uint8_t tsc; /* TSC of this slot */ + uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ + uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ + uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ + struct llist_head paging_list; /* list of paging messages */ + uint32_t last_rts_fn; /* store last frame number of RTS */ + + /* back pointers */ + struct gprs_rlcmac_trx *trx; + uint8_t ts_no; + +#ifdef __cplusplus +private: + int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); + + void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); + void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); + void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); + void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); + void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); + gprs_rlcmac_tbf *tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); + gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); +#endif + + uint8_t m_num_tbfs[2]; + uint8_t m_num_reserved[2]; + uint8_t m_assigned_usf; /* bit set */ + uint32_t m_assigned_tfi[2]; /* bit set */ + struct gprs_rlcmac_tbf *m_tbfs[2][32]; +}; + +#ifdef __cplusplus + +inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const +{ + return m_num_tbfs[dir]; +} + +inline unsigned gprs_rlcmac_pdch::num_reserved( + enum gprs_rlcmac_tbf_direction dir) const +{ + return gprs_rlcmac_pdch::m_num_reserved[dir]; +} + +inline uint8_t gprs_rlcmac_pdch::assigned_usf() const +{ + return m_assigned_usf; +} + +inline uint32_t gprs_rlcmac_pdch::assigned_tfi( + enum gprs_rlcmac_tbf_direction dir) const +{ + return m_assigned_tfi[dir]; +} + +inline bool gprs_rlcmac_pdch::is_enabled() const +{ + return m_is_enabled; +} + +#endif /* __cplusplus */ diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..26b0c33 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -19,10 +19,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include +#include +#include #include extern "C" { diff --git a/src/sba.h b/src/sba.h index d2d3106..1571127 100644 --- a/src/sba.h +++ b/src/sba.h @@ -26,9 +26,10 @@ #include } +#include + struct BTS; class PollController; -struct gprs_rlcmac_pdch; /* * single block allocation entry -- To view, visit https://gerrit.osmocom.org/6053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:38:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:38:34 +0000 Subject: [PATCH] osmo-msc[master]: remove unused ipaccess.h Message-ID: Review at https://gerrit.osmocom.org/6054 remove unused ipaccess.h Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95 Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/ipaccess.h 2 files changed, 0 insertions(+), 53 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/54/6054/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index cb19186..0adc746 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -18,7 +18,6 @@ gsm_data_shared.h \ gsm_subscriber.h \ gsup_client.h \ - ipaccess.h \ iucs.h \ iucs_ranap.h \ iu_dummy.h \ diff --git a/include/osmocom/msc/ipaccess.h b/include/osmocom/msc/ipaccess.h deleted file mode 100644 index 82e89c2..0000000 --- a/include/osmocom/msc/ipaccess.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _IPACCESS_H -#define _IPACCESS_H - -#include -#include "gsm_subscriber.h" -#include -#include -#include - -struct ipac_msgt_sccp_state { - uint8_t src_ref[3]; - uint8_t dst_ref[3]; - uint8_t trans_id; - uint8_t invoke_id; - char imsi[GSM23003_IMSI_MAX_DIGITS+1]; - uint8_t data[0]; -} __attribute__((packed)); - -/* - * @add_remove 0 for remove, 1 for add, 3 to asK - * @nr_lacs Number of extra lacs inside this package - * @lac One lac entry - */ -struct ipac_ext_lac_cmd { - uint8_t add_remove; - uint8_t nr_extra_lacs; - uint16_t lac; - uint8_t data[0]; -} __attribute__((packed)); - -void ipaccess_drop_oml(struct gsm_bts *bts); -void ipaccess_drop_rsl(struct gsm_bts_trx *trx); - -struct sdp_header_item { - struct sdp_header_entry header_entry; - struct llist_head entry; - off_t absolute_offset; -}; - -struct sdp_header { - struct sdp_firmware firmware_info; - - /* for more_magic a list of sdp_header_entry_list */ - struct llist_head header_list; - - /* the entry of the sdp_header */ - struct llist_head entry; -}; - -int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned base_offset, struct llist_head *list); - -#endif /* _IPACCESS_H */ -- To view, visit https://gerrit.osmocom.org/6054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:38:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:38:34 +0000 Subject: [PATCH] osmo-msc[master]: remove dead code in auth.h / auth.c Message-ID: Review at https://gerrit.osmocom.org/6055 remove dead code in auth.h / auth.c Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/auth.h M src/libmsc/Makefile.am D src/libmsc/auth.c M src/libmsc/gsm_04_08.c 5 files changed, 0 insertions(+), 65 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/55/6055/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 0adc746..9c82d2f 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -1,7 +1,6 @@ noinst_HEADERS = \ a_iface.h \ a_iface_bssap.h \ - auth.h \ bsc_api.h \ bsc_msc.h \ bsc_rll.h \ diff --git a/include/osmocom/msc/auth.h b/include/osmocom/msc/auth.h deleted file mode 100644 index b314bbf..0000000 --- a/include/osmocom/msc/auth.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _AUTH_H -#define _AUTH_H - -#include - -struct gsm_auth_tuple; - -enum auth_action { - AUTH_ERROR = -1, /* Internal error */ - AUTH_NOT_AVAIL = 0, /* No auth tuple available */ - AUTH_DO_AUTH_THEN_CIPH = 1, /* Firsth authenticate, then cipher */ - AUTH_DO_CIPH = 2, /* Only ciphering */ - AUTH_DO_AUTH = 3, /* Only authentication, no ciphering */ -}; - -extern const struct value_string auth_action_names[]; -static inline const char *auth_action_str(enum auth_action a) -{ - return get_value_string(auth_action_names, a); -} - -#endif /* _AUTH_H */ diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 6449948..8ae0e18 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -28,7 +28,6 @@ libmsc_a_SOURCES = \ a_iface.c \ a_iface_bssap.c \ - auth.c \ msc_vty.c \ db.c \ gsm_04_08.c \ diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c deleted file mode 100644 index 7c78c6e..0000000 --- a/src/libmsc/auth.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Authentication related functions */ - -/* - * (C) 2010 by Sylvain Munaut - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include - -#include -#include - -#include - -const struct value_string auth_action_names[] = { - OSMO_VALUE_STRING(AUTH_ERROR), - OSMO_VALUE_STRING(AUTH_NOT_AVAIL), - OSMO_VALUE_STRING(AUTH_DO_AUTH_THEN_CIPH), - OSMO_VALUE_STRING(AUTH_DO_CIPH), - OSMO_VALUE_STRING(AUTH_DO_AUTH), - { 0, NULL } -}; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 7afd0c7..126a216 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -34,7 +34,6 @@ #include "bscconfig.h" -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/6055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:38:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:38:35 +0000 Subject: [PATCH] osmo-msc[master]: remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_r... Message-ID: Review at https://gerrit.osmocom.org/6056 remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_rll.h Related: OS#2528 Change-Id: I13cc4513689af1d594952dd628738b1240560bb7 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/bsc_msc.h D include/osmocom/msc/bsc_msc_data.h D include/osmocom/msc/bsc_rll.h M src/libcommon-cs/a_reset.c M src/libcommon/gsm_data.c M src/libmsc/gsm_04_11.c M src/osmo-msc/msc_main.c 8 files changed, 1 insertion(+), 277 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/56/6056/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 9c82d2f..7e86b12 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -2,8 +2,6 @@ a_iface.h \ a_iface_bssap.h \ bsc_api.h \ - bsc_msc.h \ - bsc_rll.h \ common.h \ common_cs.h \ ctrl.h \ @@ -27,7 +25,6 @@ openbscdefines.h \ a_reset.h \ osmo_msc.h \ - bsc_msc_data.h \ rrlp.h \ signal.h \ silent_call.h \ diff --git a/include/osmocom/msc/bsc_msc.h b/include/osmocom/msc/bsc_msc.h deleted file mode 100644 index d649f76..0000000 --- a/include/osmocom/msc/bsc_msc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Routines to talk to the MSC using the IPA Protocol */ -/* - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef BSC_MSC_H -#define BSC_MSC_H - -#include -#include -#include -#include - -#include - -struct bsc_msc_dest { - struct llist_head list; - - char *ip; - int port; - int dscp; -}; - - -struct bsc_msc_connection { - /* FIXME: Remove stuff that is no longer needed! */ - struct osmo_wqueue write_queue; - int is_connected; - int is_authenticated; - int first_contact; - - struct llist_head *dests; - - const char *name; - - void (*connection_loss) (struct bsc_msc_connection *); - void (*connected) (struct bsc_msc_connection *); - struct osmo_timer_list reconnect_timer; - struct osmo_timer_list timeout_timer; - - struct msgb *pending_msg; - - /* Sigtran connection data */ - struct osmo_sccp_instance *sccp; - struct osmo_sccp_user *sccp_user; - struct osmo_sccp_addr g_calling_addr; - struct osmo_sccp_addr g_called_addr; - struct a_reset_ctx *reset; - - int conn_id_counter; -}; - -struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest); -int bsc_msc_connect(struct bsc_msc_connection *); -void bsc_msc_schedule_connect(struct bsc_msc_connection *); - -void bsc_msc_lost(struct bsc_msc_connection *); - -struct msgb *bsc_msc_id_get_resp(int fixed, const char *token, const uint8_t *res, int len); - -#endif diff --git a/include/osmocom/msc/bsc_msc_data.h b/include/osmocom/msc/bsc_msc_data.h deleted file mode 100644 index 4a283d1..0000000 --- a/include/osmocom/msc/bsc_msc_data.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Data for the true BSC - * - * (C) 2010-2015 by Holger Hans Peter Freyther - * (C) 2010-2015 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* - * NOTE: This is about a *remote* MSC for OsmoBSC and is not part of libmsc. - */ - -#ifndef _OSMO_MSC_DATA_H -#define _OSMO_MSC_DATA_H - -#include "bsc_msc.h" - -#include -#include - - -#include -#include -#include -#include -#include -#include - -#include - -struct osmo_bsc_rf; -struct gsm_network; - -struct gsm_audio_support { - uint8_t hr : 1, - ver : 7; -}; - -enum { - MSC_CON_TYPE_NORMAL, - MSC_CON_TYPE_LOCAL, -}; - -/*! /brief Information on a remote MSC for libbsc. - */ -struct bsc_msc_data { - struct llist_head entry; - - /* Back pointer */ - struct gsm_network *network; - - int allow_emerg; - int type; - - /* local call routing */ - char *local_pref; - regex_t local_pref_reg; - - - /* Connection data */ - char *bsc_token; - uint8_t bsc_key[16]; - uint8_t bsc_key_present; - - int ping_timeout; - int pong_timeout; - struct osmo_timer_list ping_timer; - struct osmo_timer_list pong_timer; - int advanced_ping; - struct bsc_msc_connection *msc_con; - int core_mnc; - int core_mcc; - int core_lac; - int core_ci; - int rtp_base; - - /* audio codecs */ - struct gsm48_multi_rate_conf amr_conf; - struct gsm_audio_support **audio_support; - int audio_length; - - /* destinations */ - struct llist_head dests; - - /* ussd welcome text */ - char *ussd_welcome_txt; - - /* mgcp agent */ - struct osmo_wqueue mgcp_agent; - - int nr; - - /* ussd msc connection lost text */ - char *ussd_msc_lost_txt; - - /* ussd text when MSC has entered the grace period */ - char *ussd_grace_txt; - - char *acc_lst_name; - - /* Sigtran connection data */ - struct { - uint32_t cs7_instance; - bool cs7_instance_valid; - struct osmo_sccp_instance *sccp; - struct osmo_sccp_user *sccp_user; - - /* Holds a copy of the our local MSC address, - * this will be the sccp-address that is associated - * with the A interface of this particular BSC, - * this address is filled up by the VTY interface */ - struct osmo_sccp_addr bsc_addr; - char *bsc_addr_name; - - /* Holds a copy of the MSC address. This is the - * address of the MSC that handles the calls of - * this BSC. The address is configured via the - * VTY interface */ - struct osmo_sccp_addr msc_addr; - char *msc_addr_name; - - struct a_reset_ctx *reset; - } a; -}; - -/* - * Per BSC data. - */ -struct osmo_bsc_data { - struct gsm_network *network; - - /* msc configuration */ - struct llist_head mscs; - - /* rf ctl related bits */ - char *mid_call_txt; - int mid_call_timeout; - char *rf_ctrl_name; - struct osmo_bsc_rf *rf_ctrl; - int auto_off_timeout; - - /* ussd text when there is no MSC available */ - char *ussd_no_msc_txt; - - char *acc_lst_name; -}; - - -int osmo_bsc_msc_init(struct bsc_msc_data *msc); -int osmo_bsc_sccp_init(struct gsm_network *gsmnet); -int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto); -int msc_queue_write_with_ping(struct bsc_msc_connection *, struct msgb *msg, int proto); - -int osmo_bsc_audio_init(struct gsm_network *network); - -struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *, int); -struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *, int); - - -#endif diff --git a/include/osmocom/msc/bsc_rll.h b/include/osmocom/msc/bsc_rll.h deleted file mode 100644 index 93c80e7..0000000 --- a/include/osmocom/msc/bsc_rll.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _BSC_RLL_H -#define _BSC_RLL_H - -#include - -enum bsc_rllr_ind { - BSC_RLLR_IND_EST_CONF, - BSC_RLLR_IND_REL_IND, - BSC_RLLR_IND_ERR_IND, - BSC_RLLR_IND_TIMEOUT, -}; - -int rll_establish(struct gsm_lchan *lchan, uint8_t link_id, - void (*cb)(struct gsm_lchan *, uint8_t, void *, - enum bsc_rllr_ind), - void *data); -void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type); - -#endif /* _BSC_RLL_H */ diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index d2f4f59..072181d 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index bdcdf02..66b6e29 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,7 +33,6 @@ #include #include -#include void *tall_bsc_ctx; diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index e67531e..a6e8bf7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index f41df01..9fa98f3 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/6056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13cc4513689af1d594952dd628738b1240560bb7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:38:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:38:35 +0000 Subject: [PATCH] osmo-msc[master]: signal.h: Remove unused/dead signal definitions Message-ID: Review at https://gerrit.osmocom.org/6057 signal.h: Remove unused/dead signal definitions Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9 Related: OS#2528 --- M include/osmocom/msc/signal.h 1 file changed, 0 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/57/6057/1 diff --git a/include/osmocom/msc/signal.h b/include/osmocom/msc/signal.h index 29b6a59..e854a64 100644 --- a/include/osmocom/msc/signal.h +++ b/include/osmocom/msc/signal.h @@ -37,8 +37,6 @@ SS_SMS, SS_SUBSCR, SS_SCALL, - SS_MSC, - SS_CCCH, }; /* SS_PAGING signals */ @@ -100,18 +98,6 @@ struct gsm_sms *sms; /* int paging result. Only the ones with > 0 */ int paging_result; -}; - -/* MSC signals */ -enum signal_msc { - S_MSC_LOST, - S_MSC_CONNECTED, - S_MSC_AUTHENTICATED, -}; - -struct bsc_msc_data; -struct msc_signal_data { - struct bsc_msc_data *data; }; #endif -- To view, visit https://gerrit.osmocom.org/6057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:38:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:38:35 +0000 Subject: [PATCH] osmo-msc[master]: remove dead ctrl.h header file Message-ID: Review at https://gerrit.osmocom.org/6058 remove dead ctrl.h header file Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419 Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/ctrl.h M src/osmo-msc/msc_main.c 3 files changed, 0 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/58/6058/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 7e86b12..ec231d0 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -4,7 +4,6 @@ bsc_api.h \ common.h \ common_cs.h \ - ctrl.h \ db.h \ debug.h \ gsm_04_08.h \ diff --git a/include/osmocom/msc/ctrl.h b/include/osmocom/msc/ctrl.h deleted file mode 100644 index c5ac210..0000000 --- a/include/osmocom/msc/ctrl.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, - const char *bind_addr, uint16_t port); diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 9fa98f3..a4b833e 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/6058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:38:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:38:35 +0000 Subject: [PATCH] osmo-msc[master]: debug: Remove dead log categories Message-ID: Review at https://gerrit.osmocom.org/6059 debug: Remove dead log categories Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Related: OS#2528 --- M include/osmocom/msc/debug.h M src/libcommon/debug.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/osmo-msc/msc_main.c 5 files changed, 4 insertions(+), 94 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/59/6059/1 diff --git a/include/osmocom/msc/debug.h b/include/osmocom/msc/debug.h index 65e197d..f99dba5 100644 --- a/include/osmocom/msc/debug.h +++ b/include/osmocom/msc/debug.h @@ -12,35 +12,18 @@ DCC, DMM, DRR, - DRSL, - DNM, DMNCC, DPAG, - DMEAS, - DSCCP, DMSC, DMGCP, DHO, DDB, DREF, - DGPRS, - DNS, - DBSSGP, - DLLC, - DSNDCP, - DSLHC, - DNAT, DCTRL, DSMPP, - DFILTER, - DGTPHUB, DRANAP, - DSUA, - DV42BIS, - DPCU, DVLR, DIUCS, - DSIGTRAN, Debug_LastEntry, }; diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 661eb66..8c0e787 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -60,18 +60,6 @@ .color = "\033[1;34m", .enabled = 1, .loglevel = LOGL_NOTICE, }, - [DRSL] = { - .name = "DRSL", - .description = "A-bis Radio Siganlling Link (RSL)", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DNM] = { - .name = "DNM", - .description = "A-bis Network Management / O&M (NM/OML)", - .color = "\033[1;36m", - .enabled = 1, .loglevel = LOGL_INFO, - }, [DMNCC] = { .name = "DMNCC", .description = "MNCC API for Call Control application", @@ -82,16 +70,6 @@ .name = "DPAG", .description = "Paging Subsystem", .color = "\033[1;38m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMEAS] = { - .name = "DMEAS", - .description = "Radio Measurement Processing", - .enabled = 0, .loglevel = LOGL_NOTICE, - }, - [DSCCP] = { - .name = "DSCCP", - .description = "SCCP Protocol", .enabled = 1, .loglevel = LOGL_NOTICE, }, [DMSC] = { @@ -119,36 +97,6 @@ .description = "Reference Counting", .enabled = 0, .loglevel = LOGL_NOTICE, }, - [DGPRS] = { - .name = "DGPRS", - .description = "GPRS Packet Service", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNS] = { - .name = "DNS", - .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, - }, - [DBSSGP] = { - .name = "DBSSGP", - .description = "GPRS BSS Gateway Protocol (BSSGP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DLLC] = { - .name = "DLLC", - .description = "GPRS Logical Link Control Protocol (LLC)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSNDCP] = { - .name = "DSNDCP", - .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNAT] = { - .name = "DNAT", - .description = "GSM 08.08 NAT/Multiplexer", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, [DCTRL] = { .name = "DCTRL", .description = "Control interface", @@ -159,24 +107,9 @@ .description = "SMPP interface for external SMS apps", .enabled = 1, .loglevel = LOGL_DEBUG, }, - [DFILTER] = { - .name = "DFILTER", - .description = "BSC/NAT IMSI based filtering", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, [DRANAP] = { .name = "DRANAP", .description = "Radio Access Network Application Part Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSUA] = { - .name = "DSUA", - .description = "SCCP User Adaptation Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DPCU] = { - .name = "DPCU", - .description = "PCU Interface", .enabled = 1, .loglevel = LOGL_DEBUG, }, [DVLR] = { @@ -187,12 +120,6 @@ [DIUCS] = { .name = "DIUCS", .description = "Iu-CS Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSIGTRAN] = { - .name = "DSIGTRAN", - .description = "SIGTRAN Signalling Transport", - .color = "\033[1;29m", .enabled = 1, .loglevel = LOGL_DEBUG, }, }; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index b5f2e68..0335e21 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -331,7 +331,7 @@ int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) { if (!gsupc || !gsupc->is_connected) { - LOGP(DGPRS, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); + LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); msgb_free(msg); return -ENOTCONN; } diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index 5576292..8605040 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -201,7 +201,7 @@ struct imsi_op *io; int rc; - DEBUGP(DGPRS, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); + DEBUGP(DLGSUP, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); if (rc < 0) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index a4b833e..98f1920 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -118,7 +118,7 @@ { printf(" Some useful help...\n"); printf(" -h --help This text.\n"); - printf(" -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM Enable debugging.\n"); + printf(" -d option --debug=DCC:DMM:DRR: Enable debugging.\n"); printf(" -D --daemonize Fork the process into a background daemon.\n"); printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); @@ -420,7 +420,7 @@ rc = vty_read_config_file(msc_cmdline_config.config_file, NULL); if (rc < 0) { - LOGP(DNM, LOGL_FATAL, "Failed to parse the config file: '%s'\n", + LOGP(DMSC, LOGL_FATAL, "Failed to parse the config file: '%s'\n", msc_cmdline_config.config_file); return 1; } -- To view, visit https://gerrit.osmocom.org/6059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:39:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:39:11 +0000 Subject: osmo-msc[master]: jenkins.sh: Don't depend on osmo-ggsn In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096f63e471dc8fdbd42a78f67d433f61b830615b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:39:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:39:13 +0000 Subject: osmo-msc[master]: Massive removal of unused code/structs/headers In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:39:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:39:22 +0000 Subject: [MERGED] osmo-msc[master]: Massive removal of unused code/structs/headers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Massive removal of unused code/structs/headers ...................................................................... Massive removal of unused code/structs/headers osmo-msc still had large amounts of dead code that came along from openbsc.git. This commit removes a lot of it, mostly stuff relevant only to the BSC side of things (or even GPRS). Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/abis_nm.h D include/osmocom/msc/abis_om2000.h D include/osmocom/msc/abis_rsl.h D include/osmocom/msc/arfcn_range_encode.h M include/osmocom/msc/bsc_api.h D include/osmocom/msc/bsc_msg_filter.h D include/osmocom/msc/chan_alloc.h D include/osmocom/msc/common_bsc.h D include/osmocom/msc/crc24.h D include/osmocom/msc/e1_config.h M include/osmocom/msc/gsm_04_08.h M include/osmocom/msc/gsm_data.h M include/osmocom/msc/gsm_data_shared.h M include/osmocom/msc/gsm_subscriber.h D include/osmocom/msc/handover.h D include/osmocom/msc/handover_decision.h D include/osmocom/msc/meas_rep.h D include/osmocom/msc/misdn.h D include/osmocom/msc/network_listen.h D include/osmocom/msc/osmo_bsc.h D include/osmocom/msc/osmo_bsc_reset.h D include/osmocom/msc/osmo_bsc_sigtran.h D include/osmocom/msc/osmux.h D include/osmocom/msc/rs232.h D include/osmocom/msc/rtp_proxy.h M include/osmocom/msc/signal.h D include/osmocom/msc/slhc.h D include/osmocom/msc/system_information.h D include/osmocom/msc/trau_mux.h D include/osmocom/msc/trau_upqueue.h M include/osmocom/msc/vty.h M src/libcommon-cs/a_reset.c M src/libcommon/Makefile.am M src/libcommon/common_vty.c M src/libcommon/gsm_data.c D src/libcommon/gsm_data_shared.c M src/libcommon/talloc_ctx.c M src/libmsc/gsm_04_08.c M src/libmsc/gsm_04_11.c M src/libmsc/gsm_04_14.c M src/libmsc/gsm_subscriber.c M src/libmsc/mncc.c M src/libmsc/mncc_builtin.c M src/libmsc/rrlp.c M src/libmsc/silent_call.c M src/libmsc/smpp_openbsc.c M src/libmsc/sms_queue.c M src/libmsc/vty_interface_layer3.c M src/osmo-msc/msc_main.c M tests/msc_vlr/msc_vlr_test_rest.c M tests/msc_vlr/msc_vlr_tests.c 52 files changed, 9 insertions(+), 3,552 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 82e8207..cb19186 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -1,24 +1,15 @@ noinst_HEADERS = \ - abis_nm.h \ - abis_om2000.h \ - abis_rsl.h \ a_iface.h \ a_iface_bssap.h \ - arfcn_range_encode.h \ auth.h \ bsc_api.h \ bsc_msc.h \ - bsc_msg_filter.h \ bsc_rll.h \ - chan_alloc.h \ common.h \ - common_bsc.h \ common_cs.h \ - crc24.h \ ctrl.h \ db.h \ debug.h \ - e1_config.h \ gsm_04_08.h \ gsm_04_11.h \ gsm_04_14.h \ @@ -27,39 +18,25 @@ gsm_data_shared.h \ gsm_subscriber.h \ gsup_client.h \ - handover.h \ - handover_decision.h \ ipaccess.h \ iucs.h \ iucs_ranap.h \ iu_dummy.h \ - meas_rep.h \ - misdn.h \ mncc.h \ mncc_int.h \ msc_ifaces.h \ - network_listen.h \ oap_client.h \ openbscdefines.h \ - osmo_bsc.h \ a_reset.h \ osmo_msc.h \ - osmo_bsc_sigtran.h \ bsc_msc_data.h \ - osmux.h \ rrlp.h \ - rs232.h \ - rtp_proxy.h \ signal.h \ silent_call.h \ - slhc.h \ smpp.h \ sms_queue.h \ socket.h \ - system_information.h \ transaction.h \ - trau_mux.h \ - trau_upqueue.h \ ussd.h \ vlr.h \ vty.h \ diff --git a/include/osmocom/msc/abis_nm.h b/include/osmocom/msc/abis_nm.h deleted file mode 100644 index 2581962..0000000 --- a/include/osmocom/msc/abis_nm.h +++ /dev/null @@ -1,180 +0,0 @@ -/* 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 - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef _NM_H -#define _NM_H - -#include -#include -#include - -#include - -/* max number of attributes represented as 3GPP TS 52.021 ?9.4.62 SW Description array */ -#define MAX_BTS_ATTR 5 - -struct cell_global_id { - uint16_t mcc; - uint16_t mnc; - uint16_t lac; - uint16_t ci; -}; - -/* The BCCH info from an ip.access test, in host byte order - * and already parsed... */ -struct ipac_bcch_info { - struct llist_head list; - - uint16_t info_type; - uint8_t freq_qual; - uint16_t arfcn; - uint8_t rx_lev; - uint8_t rx_qual; - int16_t freq_err; - uint16_t frame_offset; - uint32_t frame_nr_offset; - uint8_t bsic; - struct cell_global_id cgi; - uint8_t ba_list_si2[16]; - uint8_t ba_list_si2bis[16]; - uint8_t ba_list_si2ter[16]; - uint8_t ca_list_si1[16]; -}; - -/* PUBLIC */ - -struct msgb; - -struct abis_nm_cfg { - /* callback for unidirectional reports */ - int (*report_cb)(struct msgb *, - struct abis_om_fom_hdr *); - /* callback for software activate requests from BTS */ - int (*sw_act_req)(struct msgb *); -}; - -extern int abis_nm_rcvmsg(struct msgb *msg); - -int abis_nm_tlv_parse(struct tlv_parsed *tp, struct gsm_bts *bts, const uint8_t *buf, int len); -int abis_nm_rx(struct msgb *msg); -int abis_nm_opstart(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, uint8_t i1, uint8_t i2); -int abis_nm_chg_adm_state(struct gsm_bts *bts, uint8_t obj_class, uint8_t i0, - uint8_t i1, uint8_t i2, enum abis_nm_adm_state adm_state); -int abis_nm_establish_tei(struct gsm_bts *bts, uint8_t trx_nr, - uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot, - uint8_t tei); -int abis_nm_conn_terr_sign(struct gsm_bts_trx *trx, - uint8_t e1_port, uint8_t e1_timeslot, uint8_t e1_subslot); -int abis_nm_conn_terr_traf(struct gsm_bts_trx_ts *ts, - uint8_t e1_port, uint8_t e1_timeslot, - uint8_t e1_subslot); -int abis_nm_get_attr(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - const uint8_t *attr, uint8_t attr_len); -int abis_nm_set_bts_attr(struct gsm_bts *bts, uint8_t *attr, int attr_len); -int abis_nm_set_radio_attr(struct gsm_bts_trx *trx, uint8_t *attr, int attr_len); -int abis_nm_set_channel_attr(struct gsm_bts_trx_ts *ts, uint8_t chan_comb); -int abis_nm_sw_act_req_ack(struct gsm_bts *bts, uint8_t obj_class, uint8_t i1, - uint8_t i2, uint8_t i3, int nack, uint8_t *attr, int att_len); -int abis_nm_raw_msg(struct gsm_bts *bts, int len, uint8_t *msg); -int abis_nm_event_reports(struct gsm_bts *bts, int on); -int abis_nm_reset_resource(struct gsm_bts *bts); -int abis_nm_software_load(struct gsm_bts *bts, int trx_nr, const char *fname, - uint8_t win_size, int forced, - gsm_cbfn *cbfn, void *cb_data); -int abis_nm_software_load_status(struct gsm_bts *bts); -int abis_nm_software_activate(struct gsm_bts *bts, const char *fname, - gsm_cbfn *cbfn, void *cb_data); - -int abis_nm_conn_mdrop_link(struct gsm_bts *bts, uint8_t e1_port0, uint8_t ts0, - uint8_t e1_port1, uint8_t ts1); - -int abis_nm_perform_test(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - uint8_t test_nr, uint8_t auton_report, struct msgb *msg); - -/* Siemens / BS-11 specific */ -int abis_nm_bs11_reset_resource(struct gsm_bts *bts); -int abis_nm_bs11_db_transmission(struct gsm_bts *bts, int begin); -int abis_nm_bs11_create_object(struct gsm_bts *bts, enum abis_bs11_objtype type, - uint8_t idx, uint8_t attr_len, const uint8_t *attr); -int abis_nm_bs11_create_envaBTSE(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_create_bport(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_delete_object(struct gsm_bts *bts, - enum abis_bs11_objtype type, uint8_t idx); -int abis_nm_bs11_delete_bport(struct gsm_bts *bts, uint8_t idx); -int abis_nm_bs11_conn_oml_tei(struct gsm_bts *bts, uint8_t e1_port, - uint8_t e1_timeslot, uint8_t e1_subslot, uint8_t tei); -int abis_nm_bs11_get_oml_tei_ts(struct gsm_bts *bts); -int abis_nm_bs11_get_serno(struct gsm_bts *bts); -int abis_nm_bs11_set_trx_power(struct gsm_bts_trx *trx, uint8_t level); -int abis_nm_bs11_get_trx_power(struct gsm_bts_trx *trx); -int abis_nm_bs11_logon(struct gsm_bts *bts, uint8_t level, const char *name, int on); -int abis_nm_bs11_factory_logon(struct gsm_bts *bts, int on); -int abis_nm_bs11_infield_logon(struct gsm_bts *bts, int on); -int abis_nm_bs11_set_trx1_pw(struct gsm_bts *bts, const char *password); -int abis_nm_bs11_set_pll_locked(struct gsm_bts *bts, int locked); -int abis_nm_bs11_get_pll_mode(struct gsm_bts *bts); -int abis_nm_bs11_set_pll(struct gsm_bts *bts, int value); -int abis_nm_bs11_get_cclk(struct gsm_bts *bts); -int abis_nm_bs11_get_state(struct gsm_bts *bts); -int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname, - uint8_t win_size, int forced, gsm_cbfn *cbfn); -int abis_nm_bs11_set_ext_time(struct gsm_bts *bts); -int abis_nm_bs11_get_bport_line_cfg(struct gsm_bts *bts, uint8_t bport); -int abis_nm_bs11_set_bport_line_cfg(struct gsm_bts *bts, uint8_t bport, enum abis_bs11_line_cfg line_cfg); -int abis_nm_bs11_bsc_disconnect(struct gsm_bts *bts, int reconnect); -int abis_nm_bs11_restart(struct gsm_bts *bts); - -/* ip.access nanoBTS specific commands */ -int abis_nm_ipaccess_msg(struct gsm_bts *bts, uint8_t msg_type, - uint8_t obj_class, uint8_t bts_nr, - uint8_t trx_nr, uint8_t ts_nr, - uint8_t *attr, int attr_len); -int abis_nm_ipaccess_set_nvattr(struct gsm_bts_trx *trx, uint8_t *attr, - int attr_len); -int abis_nm_ipaccess_restart(struct gsm_bts_trx *trx); -int abis_nm_ipaccess_set_attr(struct gsm_bts *bts, uint8_t obj_class, - uint8_t bts_nr, uint8_t trx_nr, uint8_t ts_nr, - uint8_t *attr, uint8_t attr_len); -int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, - uint32_t ip, uint16_t port, uint8_t stream); -void abis_nm_ipaccess_cgi(uint8_t *buf, struct gsm_bts *bts); -int ipac_parse_bcch_info(struct ipac_bcch_info *binf, uint8_t *buf); -const char *ipacc_testres_name(uint8_t res); - -/* Functions calling into other code parts */ -int nm_is_running(struct gsm_nm_state *s); - -int abis_nm_vty_init(void); - -void abis_nm_clear_queue(struct gsm_bts *bts); - -int _abis_nm_sendmsg(struct msgb *msg); - -void abis_nm_queue_send_next(struct gsm_bts *bts); /* for bs11_config. */ - -int abis_nm_select_newest_sw(const struct abis_nm_sw_desc *sw, const size_t len); - -/* Helper functions for updating attributes */ -int abis_nm_update_max_power_red(struct gsm_bts_trx *trx); - -#endif /* _NM_H */ diff --git a/include/osmocom/msc/abis_om2000.h b/include/osmocom/msc/abis_om2000.h deleted file mode 100644 index b093a03..0000000 --- a/include/osmocom/msc/abis_om2000.h +++ /dev/null @@ -1,129 +0,0 @@ -#ifndef OPENBSC_ABIS_OM2K_H -#define OPENBSC_ABIS_OM2K_H -/* Ericsson RBS 2xxx GSM O&M (OM2000) messages on the A-bis interface - * implemented based on protocol trace analysis, no formal documentation */ - -/* (C) 2010-2011 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -enum abis_om2k_mo_cls { - OM2K_MO_CLS_TRXC = 0x01, - OM2K_MO_CLS_TS = 0x03, - OM2K_MO_CLS_TF = 0x04, - OM2K_MO_CLS_IS = 0x05, - OM2K_MO_CLS_CON = 0x06, - OM2K_MO_CLS_DP = 0x07, - OM2K_MO_CLS_CF = 0x0a, - OM2K_MO_CLS_TX = 0x0b, - OM2K_MO_CLS_RX = 0x0c, -}; - -enum om2k_mo_state { - OM2K_MO_S_RESET = 0, - OM2K_MO_S_STARTED, - OM2K_MO_S_ENABLED, - OM2K_MO_S_DISABLED, -}; - -/* on-wire format for IS conn group */ -struct om2k_is_conn_grp { - uint16_t icp1; - uint16_t icp2; - uint8_t cont_idx; -} __attribute__ ((packed)); - -/* internal data formant for IS conn group */ -struct is_conn_group { - struct llist_head list; - uint16_t icp1; - uint16_t icp2; - uint8_t ci; -}; - -/* on-wire format for CON Path */ -struct om2k_con_path { - uint16_t ccp; - uint8_t ci; - uint8_t tag; - uint8_t tei; -} __attribute__ ((packed)); - -/* internal data format for CON group */ -struct con_group { - /* links list of CON groups in BTS */ - struct llist_head list; - struct gsm_bts *bts; - /* CON Group ID */ - uint8_t cg; - /* list of CON paths in this group */ - struct llist_head paths; -}; - -/* internal data format for CON path */ -struct con_path { - /* links with con_group.paths */ - struct llist_head list; - /* CON Connection Point */ - uint16_t ccp; - /* Contiguity Index */ - uint8_t ci; - /* Tag */ - uint8_t tag; - /* TEI */ - uint8_t tei; -}; - -extern const struct abis_om2k_mo om2k_mo_cf; -extern const struct abis_om2k_mo om2k_mo_is; -extern const struct abis_om2k_mo om2k_mo_con; -extern const struct abis_om2k_mo om2k_mo_tf; - -extern const struct value_string om2k_mo_class_short_vals[]; - -int abis_om2k_rcvmsg(struct msgb *msg); - -extern const struct abis_om2k_mo om2k_mo_cf; - -int abis_om2k_tx_reset_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_start_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_status_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_connect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_disconnect_cmd(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_enable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_disable_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, - uint8_t operational); -int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); -int abis_om2k_tx_is_conf_req(struct gsm_bts *bts); -int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts); -int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx); -int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx); -int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts); - -struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts); -void abis_om2k_bts_init(struct gsm_bts *bts); -void abis_om2k_trx_init(struct gsm_bts_trx *trx); - -int abis_om2k_vty_init(void); - -struct vty; -void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts); - -#endif /* OPENBCS_ABIS_OM2K_H */ diff --git a/include/osmocom/msc/abis_rsl.h b/include/osmocom/msc/abis_rsl.h deleted file mode 100644 index f983fce..0000000 --- a/include/osmocom/msc/abis_rsl.h +++ /dev/null @@ -1,117 +0,0 @@ -/* 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 - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef _RSL_H -#define _RSL_H - -#include -#include -#include -#include -#include - -struct gsm_bts; -struct gsm_lchan; -struct gsm_bts_trx_ts; - -#define GSM48_LEN2PLEN(a) (((a) << 2) | 1) - -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, - uint8_t act_type, - struct rsl_ie_chan_mode *chan_mode, - struct rsl_ie_chan_ident *chan_ident, - uint8_t bs_power, uint8_t ms_power, - uint8_t ta); -int rsl_chan_activate_lchan(struct gsm_lchan *lchan, uint8_t act_type, - uint8_t ho_ref); -int rsl_chan_mode_modify_req(struct gsm_lchan *ts); -int rsl_encryption_cmd(struct msgb *msg); -int rsl_paging_cmd(struct gsm_bts *bts, uint8_t paging_group, uint8_t len, - uint8_t *ms_ident, uint8_t chan_needed, bool is_gprs); -int rsl_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val); - -int rsl_data_request(struct msgb *msg, uint8_t link_id); -int rsl_establish_request(struct gsm_lchan *lchan, uint8_t link_id); -int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id); - -/* Ericcson vendor specific RSL extensions */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val); - -/* Siemens vendor-specific RSL extensions */ -int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); - -/* ip.access specfic RSL extensions */ -int rsl_ipacc_crcx(struct gsm_lchan *lchan); -int rsl_ipacc_mdcx(struct gsm_lchan *lchan, uint32_t ip, - uint16_t port, uint8_t rtp_payload2); -int rsl_ipacc_mdcx_to_rtpsock(struct gsm_lchan *lchan); -int rsl_ipacc_pdch_activate(struct gsm_bts_trx_ts *ts, int act); - -int abis_rsl_rcvmsg(struct msgb *msg); - -uint64_t str_to_imsi(const char *imsi_str); -int rsl_release_request(struct gsm_lchan *lchan, uint8_t link_id, - enum rsl_rel_mode release_mode); - -int rsl_lchan_set_state(struct gsm_lchan *lchan, int); -int rsl_lchan_mark_broken(struct gsm_lchan *lchan, const char *broken); - -/* to be provided by external code */ -int rsl_deact_sacch(struct gsm_lchan *lchan); - -/* BCCH related code */ -int rsl_ccch_conf_to_bs_cc_chans(int ccch_conf); -int rsl_ccch_conf_to_bs_ccch_sdcch_comb(int ccch_conf); - -int rsl_sacch_info_modify(struct gsm_lchan *lchan, uint8_t type, - const uint8_t *data, int len); - -int rsl_chan_bs_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int db); -int rsl_chan_ms_power_ctrl(struct gsm_lchan *lchan, unsigned int fpc, int dbm); - -/* SMSCB functionality */ -int rsl_sms_cb_command(struct gsm_bts *bts, uint8_t chan_number, - struct rsl_ie_cb_cmd_type cb_command, - const uint8_t *data, int len); - -/* some Nokia specific stuff */ -int rsl_nokia_si_begin(struct gsm_bts_trx *trx); -int rsl_nokia_si_end(struct gsm_bts_trx *trx); - -/* required for Nokia BTS power control */ -int rsl_bs_power_control(struct gsm_bts_trx *trx, uint8_t channel, uint8_t reduction); - - -int rsl_release_sapis_from(struct gsm_lchan *lchan, int start, - enum rsl_rel_mode release_mode); -int rsl_start_t3109(struct gsm_lchan *lchan); - -int rsl_direct_rf_release(struct gsm_lchan *lchan); - -void dyn_ts_init(struct gsm_bts_trx_ts *ts); -int dyn_ts_switchover_start(struct gsm_bts_trx_ts *ts, - enum gsm_phys_chan_config to_pchan); - -#endif /* RSL_MT_H */ - diff --git a/include/osmocom/msc/arfcn_range_encode.h b/include/osmocom/msc/arfcn_range_encode.h deleted file mode 100644 index 7ec710c..0000000 --- a/include/osmocom/msc/arfcn_range_encode.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef ARFCN_RANGE_ENCODE_H -#define ARFCN_RANGE_ENCODE_H - -#include - -enum gsm48_range { - ARFCN_RANGE_INVALID = -1, - ARFCN_RANGE_128 = 127, - ARFCN_RANGE_256 = 255, - ARFCN_RANGE_512 = 511, - ARFCN_RANGE_1024 = 1023, -}; - -#define RANGE_ENC_MAX_ARFCNS 29 - -int range_enc_determine_range(const int *arfcns, int size, int *f0_out); -int range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, int *out, int idx); -int range_enc_find_index(enum gsm48_range rng, const int *arfcns, int size); -int range_enc_filter_arfcns(int *arfcns, const int sze, const int f0, int *f0_included); - -int range_enc_range128(uint8_t *chan_list, int f0, int *w); -int range_enc_range256(uint8_t *chan_list, int f0, int *w); -int range_enc_range512(uint8_t *chan_list, int f0, int *w); -int range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w); - -#endif diff --git a/include/osmocom/msc/bsc_api.h b/include/osmocom/msc/bsc_api.h index 40068d6..4936f53 100644 --- a/include/osmocom/msc/bsc_api.h +++ b/include/osmocom/msc/bsc_api.h @@ -46,13 +46,4 @@ void (*conn_cleanup)(struct gsm_subscriber_connection *conn); }; -int bsc_api_init(struct gsm_network *network, struct bsc_api *api); -int gsm0808_submit_dtap(struct gsm_subscriber_connection *conn, struct msgb *msg, int link_id, int allow_sacch); -int gsm0808_assign_req(struct gsm_subscriber_connection *conn, int chan_mode, int full_rate); -int gsm0808_cipher_mode(struct gsm_subscriber_connection *conn, int cipher, - const uint8_t *key, int len, int include_imeisv); -int gsm0808_page(struct gsm_bts *bts, unsigned int page_group, - unsigned int mi_len, uint8_t *mi, int chan_type); -int gsm0808_clear(struct gsm_subscriber_connection *conn); - #endif diff --git a/include/osmocom/msc/bsc_msg_filter.h b/include/osmocom/msc/bsc_msg_filter.h deleted file mode 100644 index a9dedf4..0000000 --- a/include/osmocom/msc/bsc_msg_filter.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - -#include -#include -#include -#include - -#include - -struct vty; -struct gsm48_hdr; - -struct bsc_filter_reject_cause { - int lu_reject_cause; - int cm_reject_cause; -}; - -struct bsc_filter_barr_entry { - struct rb_node node; - - char *imsi; - int cm_reject_cause; - int lu_reject_cause; -}; - -enum bsc_filter_acc_ctr { - ACC_LIST_LOCAL_FILTER, - ACC_LIST_GLOBAL_FILTER, -}; - -struct bsc_msg_acc_lst { - struct llist_head list; - - /* counter */ - struct rate_ctr_group *stats; - - /* the name of the list */ - const char *name; - struct llist_head fltr_list; -}; - -struct bsc_msg_acc_lst_entry { - struct llist_head list; - - /* the filter */ - char *imsi_allow; - regex_t imsi_allow_re; - char *imsi_deny; - regex_t imsi_deny_re; - - /* reject reasons for the access lists */ - int cm_reject_cause; - int lu_reject_cause; -}; - -enum { - FLT_CON_TYPE_NONE, - FLT_CON_TYPE_LU, - FLT_CON_TYPE_CM_SERV_REQ, - FLT_CON_TYPE_PAG_RESP, - FLT_CON_TYPE_SSA, - FLT_CON_TYPE_LOCAL_REJECT, - FLT_CON_TYPE_OTHER, -}; - - -struct bsc_filter_state { - char *imsi; - int imsi_checked; - int con_type; -}; - -struct bsc_filter_request { - void *ctx; - struct rb_root *black_list; - struct llist_head *access_lists; - const char *local_lst_name; - const char *global_lst_name; - int bsc_nr; -}; - - -int bsc_filter_barr_adapt(void *ctx, struct rb_root *rbtree, const struct osmo_config_list *); -int bsc_filter_barr_find(struct rb_root *root, const char *imsi, int *cm, int *lu); - -/** - * Content filtering. - */ -int bsc_msg_filter_initial(struct gsm48_hdr *hdr, size_t size, - struct bsc_filter_request *req, - int *con_type, char **imsi, - struct bsc_filter_reject_cause *cause); -int bsc_msg_filter_data(struct gsm48_hdr *hdr, size_t size, - struct bsc_filter_request *req, - struct bsc_filter_state *state, - struct bsc_filter_reject_cause *cause); - -/* IMSI allow/deny handling */ -struct bsc_msg_acc_lst *bsc_msg_acc_lst_find(struct llist_head *lst, const char *name); -struct bsc_msg_acc_lst *bsc_msg_acc_lst_get(void *ctx, struct llist_head *lst, const char *name); -void bsc_msg_acc_lst_delete(struct bsc_msg_acc_lst *lst); - -struct bsc_msg_acc_lst_entry *bsc_msg_acc_lst_entry_create(struct bsc_msg_acc_lst *); -int bsc_msg_acc_lst_check_allow(struct bsc_msg_acc_lst *lst, const char *imsi); - -void bsc_msg_lst_vty_init(void *ctx, struct llist_head *lst, int node); -void bsc_msg_acc_lst_write(struct vty *vty, struct bsc_msg_acc_lst *lst); diff --git a/include/osmocom/msc/chan_alloc.h b/include/osmocom/msc/chan_alloc.h deleted file mode 100644 index 7388e14..0000000 --- a/include/osmocom/msc/chan_alloc.h +++ /dev/null @@ -1,54 +0,0 @@ -/* Management functions to allocate/release struct gsm_lchan */ -/* (C) 2008 by Harald Welte - * (C) 2009 by Holger Hans Peter Freyther - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU 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 . - * - */ -#ifndef _CHAN_ALLOC_H -#define _CHAN_ALLOC_H - -#include "gsm_data.h" - -struct gsm_subscriber_connection; - -/* Find an allocated channel for a specified subscriber */ -struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub); - -/* Allocate a logical channel (SDCCH, TCH, ...) */ -struct gsm_lchan *lchan_alloc(struct gsm_bts *bts, enum gsm_chan_t type, int allow_bigger); - -/* Free a logical channel (SDCCH, TCH, ...) */ -void lchan_free(struct gsm_lchan *lchan); -void lchan_reset(struct gsm_lchan *lchan); - -/* Release the given lchan */ -int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode release_mode); - -struct load_counter { - unsigned int total; - unsigned int used; -}; - -struct pchan_load { - struct load_counter pchan[_GSM_PCHAN_MAX]; -}; - -void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts); -void network_chan_load(struct pchan_load *pl, struct gsm_network *net); - -int trx_is_usable(struct gsm_bts_trx *trx); - -#endif /* _CHAN_ALLOC_H */ diff --git a/include/osmocom/msc/common_bsc.h b/include/osmocom/msc/common_bsc.h deleted file mode 100644 index 821298c..0000000 --- a/include/osmocom/msc/common_bsc.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -#include -#include - -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code, - mncc_recv_cb_t mncc_recv); diff --git a/include/osmocom/msc/crc24.h b/include/osmocom/msc/crc24.h deleted file mode 100644 index 756638c..0000000 --- a/include/osmocom/msc/crc24.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef _CRC24_H -#define _CRC24_H - -#include - -#define INIT_CRC24 0xffffff - -uint32_t crc24_calc(uint32_t fcs, uint8_t *cp, unsigned int len); - -#endif diff --git a/include/osmocom/msc/e1_config.h b/include/osmocom/msc/e1_config.h deleted file mode 100644 index ac5fbb1..0000000 --- a/include/osmocom/msc/e1_config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef _E1_CONFIG_H -#define _E1_CONFIG_H - -#include - -int e1_reconfig_ts(struct gsm_bts_trx_ts *ts); -int e1_reconfig_trx(struct gsm_bts_trx *trx); -int e1_reconfig_bts(struct gsm_bts *bts); - -#endif /* _E1_CONFIG_H */ - diff --git a/include/osmocom/msc/gsm_04_08.h b/include/osmocom/msc/gsm_04_08.h index 914b3e9..58cb7ae 100644 --- a/include/osmocom/msc/gsm_04_08.h +++ b/include/osmocom/msc/gsm_04_08.h @@ -5,8 +5,6 @@ #include #include -#include - struct msgb; struct gsm_bts; struct gsm_network; @@ -67,7 +65,6 @@ int gsm48_lchan_modify(struct gsm_lchan *lchan, uint8_t lchan_mode); int gsm48_rx_rr_modif_ack(struct msgb *msg); -int gsm48_parse_meas_rep(struct gsm_meas_rep *rep, struct msgb *msg); struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value); struct msgb *gsm48_create_loc_upd_rej(uint8_t cause); diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 2b01a34..e987136 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -18,6 +18,9 @@ #include #include +#include "gsm_data_shared.h" + + /** annotations for msgb ownership */ #define __uses @@ -168,20 +171,10 @@ int mncc_rtp_create_pending; int mncc_rtp_connect_pending; - /* bsc structures */ - struct osmo_bsc_sccp_con *sccp_con; /* BSC */ - /* back pointers */ struct gsm_network *network; bool in_release; - struct gsm_lchan *lchan; /* BSC */ - struct gsm_lchan *ho_lchan; /* BSC */ - struct gsm_bts *bts; /* BSC */ - - /* for assignment handling */ - struct osmo_timer_list T10; /* BSC */ - struct gsm_lchan *secondary_lchan; /* BSC */ /* connected via 2G or 3G? */ enum ran_type via_ran; @@ -220,56 +213,6 @@ } a; }; - -#define ROLE_BSC -#include "gsm_data_shared.h" - - -enum { - BSC_CTR_CHREQ_TOTAL, - BSC_CTR_CHREQ_NO_CHANNEL, - BSC_CTR_HANDOVER_ATTEMPTED, - BSC_CTR_HANDOVER_NO_CHANNEL, - BSC_CTR_HANDOVER_TIMEOUT, - BSC_CTR_HANDOVER_COMPLETED, - BSC_CTR_HANDOVER_FAILED, - BSC_CTR_PAGING_ATTEMPTED, - BSC_CTR_PAGING_DETACHED, - BSC_CTR_PAGING_COMPLETED, - BSC_CTR_PAGING_EXPIRED, - BSC_CTR_CHAN_RF_FAIL, - BSC_CTR_CHAN_RLL_ERR, - BSC_CTR_BTS_OML_FAIL, - BSC_CTR_BTS_RSL_FAIL, - BSC_CTR_CODEC_AMR_F, - BSC_CTR_CODEC_AMR_H, - BSC_CTR_CODEC_EFR, - BSC_CTR_CODEC_V1_FR, - BSC_CTR_CODEC_V1_HR, -}; - -static const struct rate_ctr_desc bsc_ctr_description[] = { - [BSC_CTR_CHREQ_TOTAL] = {"chreq.total", "Received channel requests."}, - [BSC_CTR_CHREQ_NO_CHANNEL] = {"chreq.no_channel", "Sent to MS no channel available."}, - [BSC_CTR_HANDOVER_ATTEMPTED] = {"handover.attempted", "Received handover attempts."}, - [BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover.no_channel", "Sent no channel available responses."}, - [BSC_CTR_HANDOVER_TIMEOUT] = {"handover.timeout", "Count the amount of timeouts of timer T3103."}, - [BSC_CTR_HANDOVER_COMPLETED] = {"handover.completed", "Received handover completed."}, - [BSC_CTR_HANDOVER_FAILED] = {"handover.failed", "Receive HO FAIL messages."}, - [BSC_CTR_PAGING_ATTEMPTED] = {"paging.attempted", "Paging attempts for a MS."}, - [BSC_CTR_PAGING_DETACHED] = {"paging.detached", "Counts the amount of paging attempts which couldn't sent out any paging request because no responsible bts found."}, - [BSC_CTR_PAGING_COMPLETED] = {"paging.completed", "Paging successful completed."}, - [BSC_CTR_PAGING_EXPIRED] = {"paging.expired", "Paging Request expired because of timeout T3113."}, - [BSC_CTR_CHAN_RF_FAIL] = {"chan.rf_fail", "Received a RF failure indication from BTS."}, - [BSC_CTR_CHAN_RLL_ERR] = {"chan.rll_err", "Received a RLL failure with T200 cause from BTS."}, - [BSC_CTR_BTS_OML_FAIL] = {"bts.oml_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_BTS_RSL_FAIL] = {"bts.rsl_fail", "Received a TEI down on a OML link."}, - [BSC_CTR_CODEC_AMR_F] = {"bts.codec_amr_f", "Count the usage of AMR/F codec by channel mode requested."}, - [BSC_CTR_CODEC_AMR_H] = {"bts.codec_amr_h", "Count the usage of AMR/H codec by channel mode requested."}, - [BSC_CTR_CODEC_EFR] = {"bts.codec_efr", "Count the usage of EFR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_FR] = {"bts.codec_fr", "Count the usage of FR codec by channel mode requested."}, - [BSC_CTR_CODEC_V1_HR] = {"bts.codec_hr", "Count the usage of HR codec by channel mode requested."}, -}; enum { MSC_CTR_LOC_UPDATE_TYPE_ATTACH, @@ -314,15 +257,6 @@ [MSC_CTR_CALL_ACTIVE] = {"call:active", "Count total amount of calls that ever reached active state."}, [MSC_CTR_CALL_COMPLETE] = {"call:complete", "Count total amount of calls which got terminated by disconnect req or ind after reaching active state."}, [MSC_CTR_CALL_INCOMPLETE] = {"call:incomplete", "Count total amount of call which got terminated by any other reason after reaching active state."}, -}; - - -static const struct rate_ctr_group_desc bsc_ctrg_desc = { - "bsc", - "base station controller", - OSMO_STATS_CLASS_GLOBAL, - ARRAY_SIZE(bsc_ctr_description), - bsc_ctr_description, }; static const struct rate_ctr_group_desc msc_ctrg_desc = { @@ -401,9 +335,6 @@ */ struct llist_head trans_list; struct bsc_api *bsc_api; - - unsigned int num_bts; - struct llist_head bts_list; unsigned int paging_response_timer; @@ -525,11 +456,6 @@ extern void talloc_ctx_init(void *ctx_root); -enum gsm_bts_type parse_btstype(const char *arg); -const char *btstype2str(enum gsm_bts_type type); -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts); - extern void *tall_bsc_ctx; extern int ipacc_rtp_direct; @@ -539,29 +465,8 @@ enum rrlp_mode rrlp_mode_parse(const char *arg); const char *rrlp_mode_name(enum rrlp_mode mode); -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid); -const char *bts_gprs_mode_name(enum bts_gprs_mode mode); - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts); -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts); - struct gsm_subscriber_connection *msc_subscr_con_allocate(struct gsm_network *network); void msc_subscr_con_free(struct gsm_subscriber_connection *conn); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss); - -void gsm_trx_lock_rf(struct gsm_bts_trx *trx, int locked); - -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); - -/* generic E1 line operations for all ISDN-based BTS. */ -extern struct e1inp_line_ops bts_isdn_e1inp_line_ops; - -extern const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE+1]; -extern const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1]; /* control interface handling */ int bsc_base_ctrl_cmds_install(void); diff --git a/include/osmocom/msc/gsm_data_shared.h b/include/osmocom/msc/gsm_data_shared.h index 63f4d33..68b36ab 100644 --- a/include/osmocom/msc/gsm_data_shared.h +++ b/include/osmocom/msc/gsm_data_shared.h @@ -11,18 +11,7 @@ #include #include #include -#include -#include -#include #include -#include -#include -#include -#include - -#ifndef ROLE_BSC -#include -#endif #include @@ -39,35 +28,6 @@ RRLP_MODE_ASS_PREF, }; -/* Channel Request reason */ -enum gsm_chreq_reason_t { - GSM_CHREQ_REASON_EMERG, - GSM_CHREQ_REASON_PAG, - GSM_CHREQ_REASON_CALL, - GSM_CHREQ_REASON_LOCATION_UPD, - GSM_CHREQ_REASON_OTHER, - GSM_CHREQ_REASON_PDCH, -}; - -/* lchans 0..3 are SDCCH in combined channel configuration, - use 4 as magic number for BCCH hack - see osmo-bts-../oml.c:opstart_compl() */ -#define CCCH_LCHAN 4 - -#define TRX_NR_TS 8 -#define TS_MAX_LCHAN 8 - -#define HARDCODED_ARFCN 123 -#define HARDCODED_BSIC 0x3f /* NCC = 7 / BCC = 7 */ - -/* for multi-drop config */ -#define HARDCODED_BTS0_TS 1 -#define HARDCODED_BTS1_TS 6 -#define HARDCODED_BTS2_TS 11 - -#define MAX_VERSION_LENGTH 64 - -#define MAX_BTS_FEATURES 128 - enum gsm_hooks { GSM_HOOK_NM_SWLOAD, GSM_HOOK_RR_PAGING, @@ -81,852 +41,15 @@ GSM_PAGING_BUSY, }; -enum bts_gprs_mode { - BTS_GPRS_NONE = 0, - BTS_GPRS_GPRS = 1, - BTS_GPRS_EGPRS = 2, -}; - -struct gsm_lchan; struct gsm_mncc; struct osmo_rtp_socket; struct rtp_socket; struct bsc_api; - -/* Network Management State */ -struct gsm_nm_state { - uint8_t operational; - uint8_t administrative; - uint8_t availability; -}; - -struct gsm_abis_mo { - uint8_t obj_class; - uint8_t procedure_pending; - struct abis_om_obj_inst obj_inst; - const char *name; - struct gsm_nm_state nm_state; - struct tlv_parsed *nm_attr; - struct gsm_bts *bts; -}; - -/* Ericsson OM2000 Managed Object */ -struct abis_om2k_mo { - uint8_t class; - uint8_t bts; - uint8_t assoc_so; - uint8_t inst; -} __attribute__ ((packed)); - -struct om2k_mo { - struct abis_om2k_mo addr; - struct osmo_fsm_inst *fsm; -}; - -#define A38_XOR_MIN_KEY_LEN 12 -#define A38_XOR_MAX_KEY_LEN 16 -#define A38_COMP128_KEY_LEN 16 -#define RSL_ENC_ALG_A5(x) (x+1) -#define MAX_EARFCN_LIST 32 - -/* is the data link established? who established it? */ -#define LCHAN_SAPI_UNUSED 0 -#define LCHAN_SAPI_MS 1 -#define LCHAN_SAPI_NET 2 -#define LCHAN_SAPI_REL 3 - -/* state of a logical channel */ -enum gsm_lchan_state { - LCHAN_S_NONE, /* channel is not active */ - LCHAN_S_ACT_REQ, /* channel activation requested */ - LCHAN_S_ACTIVE, /* channel is active and operational */ - LCHAN_S_REL_REQ, /* channel release has been requested */ - LCHAN_S_REL_ERR, /* channel is in an error state */ - LCHAN_S_BROKEN, /* channel is somehow unusable */ - LCHAN_S_INACTIVE, /* channel is set inactive */ -}; - -/* BTS ONLY */ -#define MAX_NUM_UL_MEAS 104 -#define LC_UL_M_F_L1_VALID (1 << 0) -#define LC_UL_M_F_RES_VALID (1 << 1) - -struct bts_ul_meas { - /* BER in units of 0.01%: 10.000 == 100% ber, 0 == 0% ber */ - uint16_t ber10k; - /* timing advance offset (in quarter bits) */ - int16_t ta_offs_qbits; - /* C/I ratio in dB */ - float c_i; - /* flags */ - uint8_t is_sub:1; - /* RSSI in dBm * -1 */ - uint8_t inv_rssi; -}; - -struct bts_codec_conf { - uint8_t hr; - uint8_t efr; - uint8_t amr; -}; - -struct amr_mode { - uint8_t mode; - uint8_t threshold; - uint8_t hysteresis; -}; - -struct amr_multirate_conf { - uint8_t gsm48_ie[2]; - struct amr_mode ms_mode[4]; - struct amr_mode bts_mode[4]; - uint8_t num_modes; -}; -/* /BTS ONLY */ - -enum lchan_csd_mode { - LCHAN_CSD_M_NT, - LCHAN_CSD_M_T_1200_75, - LCHAN_CSD_M_T_600, - LCHAN_CSD_M_T_1200, - LCHAN_CSD_M_T_2400, - LCHAN_CSD_M_T_9600, - LCHAN_CSD_M_T_14400, - LCHAN_CSD_M_T_29000, - LCHAN_CSD_M_T_32000, -}; - -/* State of the SAPIs in the lchan */ -enum lchan_sapi_state { - LCHAN_SAPI_S_NONE, - LCHAN_SAPI_S_REQ, - LCHAN_SAPI_S_ASSIGNED, - LCHAN_SAPI_S_REL, - LCHAN_SAPI_S_ERROR, -}; - -struct gsm_lchan { - /* The TS that we're part of */ - struct gsm_bts_trx_ts *ts; - /* The logical subslot number in the TS */ - uint8_t nr; - /* The logical channel type */ - enum gsm_chan_t type; - /* RSL channel mode */ - enum rsl_cmod_spd rsl_cmode; - /* If TCH, traffic channel mode */ - enum gsm48_chan_mode tch_mode; - enum lchan_csd_mode csd_mode; - /* State */ - enum gsm_lchan_state state; - const char *broken_reason; - /* Power levels for MS and BTS */ - uint8_t bs_power; - uint8_t ms_power; - /* Encryption information */ - struct gsm_encr encr; - - /* AMR bits */ - uint8_t mr_ms_lv[7]; - uint8_t mr_bts_lv[7]; - - /* Established data link layer services */ - uint8_t sapis[8]; - int sacch_deact; - - struct { - uint32_t bound_ip; - uint32_t connect_ip; - uint16_t bound_port; - uint16_t connect_port; - uint16_t conn_id; - uint8_t rtp_payload; - uint8_t rtp_payload2; - uint8_t speech_mode; -#ifdef ROLE_BSC - struct rtp_socket *rtp_socket; - - /* info we need to postpone the AoIP - * assignment completed message */ - struct { - uint8_t rr_cause; - uint8_t chosen_channel; - uint8_t encr_alg_id; - uint8_t speech_mode; - bool valid; - } ass_compl; -#else - struct osmo_rtp_socket *rtp_socket; -#endif - } abis_ip; - - uint8_t rqd_ta; - - char *name; - -#ifdef ROLE_BSC - struct osmo_timer_list T3101; - struct osmo_timer_list T3109; - struct osmo_timer_list T3111; - struct osmo_timer_list error_timer; - struct osmo_timer_list act_timer; - struct osmo_timer_list rel_work; - uint8_t error_cause; - - /* table of neighbor cell measurements */ - struct neigh_meas_proc neigh_meas[MAX_NEIGH_MEAS]; - - /* cache of last measurement reports on this lchan */ - struct gsm_meas_rep meas_rep[6]; - int meas_rep_idx; - - /* GSM Random Access data */ - struct gsm48_req_ref *rqd_ref; - - struct gsm_subscriber_connection *conn; - - struct { - /* channel activation type and handover ref */ - uint8_t act_type; - uint8_t ho_ref; - struct gsm48_req_ref *rqd_ref; - uint8_t rqd_ta; - } dyn; -#else - /* Number of different GsmL1_Sapi_t used in osmo_bts_sysmo is 23. - * Currently we don't share these headers so this is a magic number. */ - struct llist_head sapi_cmds; - uint8_t sapis_dl[23]; - uint8_t sapis_ul[23]; - struct lapdm_channel lapdm_ch; - struct llist_head dl_tch_queue; - struct { - /* bitmask of all SI that are present/valid in si_buf */ - uint32_t valid; - uint32_t last; - /* buffers where we put the pre-computed SI: - SI2Q_MAX_NUM is the max number of SI2quater messages (see 3GPP TS 44.018) */ - sysinfo_buf_t buf[_MAX_SYSINFO_TYPE][SI2Q_MAX_NUM]; - } si; - struct { - uint8_t flags; - /* RSL measurment result number, 0 at lchan_act */ - uint8_t res_nr; - /* current Tx power level of the BTS */ - uint8_t bts_tx_pwr; - /* number of measurements stored in array below */ - uint8_t num_ul_meas; - struct bts_ul_meas uplink[MAX_NUM_UL_MEAS]; - /* last L1 header from the MS */ - uint8_t l1_info[2]; - struct gsm_meas_rep_unidir ul_res; - } meas; - struct { - struct amr_multirate_conf amr_mr; - struct { - struct osmo_fsm_inst *dl_amr_fsm; - /* TCH cache */ - uint8_t cache[20]; - /* FACCH cache */ - uint8_t facch[GSM_MACBLOCK_LEN]; - uint8_t len; - uint32_t fn; - bool is_update; - /* set for each SID frame to detect talkspurt for codecs - without explicit ONSET event */ - bool ul_sid; - /* indicates if DTXd was active during DL measurement - period */ - bool dl_active; - } dtx; - uint8_t last_cmr; - uint32_t last_fn; - } tch; - - /* 3GPP TS 48.058 ? 9.3.37: [0; 255] ok, -1 means invalid*/ - int16_t ms_t_offs; - /* 3GPP TS 45.010 ? 1.2 round trip propagation delay (in symbols) or -1 */ - int16_t p_offs; - - /* BTS-side ciphering state (rx only, bi-directional, ...) */ - uint8_t ciph_state; - uint8_t ciph_ns; - uint8_t loopback; - struct { - uint8_t active; - uint8_t ref; - /* T3105: PHYS INF retransmission */ - struct osmo_timer_list t3105; - /* counts up to Ny1 */ - unsigned int phys_info_count; - } ho; - /* S counter for link loss */ - int s; - /* Kind of the release/activation. E.g. RSL or PCU */ - int rel_act_kind; - /* RTP header Marker bit to indicate beginning of speech after pause */ - bool rtp_tx_marker; - /* power handling */ - struct { - uint8_t current; - uint8_t fixed; - } ms_power_ctrl; - - struct msgb *pending_rel_ind_msg; -#endif -}; - -enum { - TS_F_PDCH_ACTIVE = 0x1000, - TS_F_PDCH_ACT_PENDING = 0x2000, - TS_F_PDCH_DEACT_PENDING = 0x4000, - TS_F_PDCH_PENDING_MASK = 0x6000 /*< - TS_F_PDCH_ACT_PENDING | TS_F_PDCH_DEACT_PENDING */ -} gsm_bts_trx_ts_flags; - -/* One Timeslot in a TRX */ -struct gsm_bts_trx_ts { - struct gsm_bts_trx *trx; - /* number of this timeslot at the TRX */ - uint8_t nr; - - enum gsm_phys_chan_config pchan; - - struct { - enum gsm_phys_chan_config pchan_is; - enum gsm_phys_chan_config pchan_want; - struct msgb *pending_chan_activ; - } dyn; - - unsigned int flags; - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - uint8_t nm_chan_comb; - int tsc; /* -1 == use BTS TSC */ - - struct { - /* Parameters below are configured by VTY */ - int enabled; - uint8_t maio; - uint8_t hsn; - struct bitvec arfcns; - uint8_t arfcns_data[1024/8]; - /* This is the pre-computed MA for channel assignments */ - struct bitvec ma; - uint8_t ma_len; /* part of ma_data that is used */ - uint8_t ma_data[8]; /* 10.5.2.21: max 8 bytes value part */ - } hopping; - - /* To which E1 subslot are we connected */ - struct gsm_e1_subslot e1_link; - - union { - struct { - struct om2k_mo om2k_mo; - } rbs2000; - }; - - struct gsm_lchan lchan[TS_MAX_LCHAN]; -}; - -/* One TRX in a BTS */ -struct gsm_bts_trx { - /* list header in bts->trx_list */ - struct llist_head list; - - struct gsm_bts *bts; - /* number of this TRX in the BTS */ - uint8_t nr; - /* human readable name / description */ - char *description; - /* how do we talk RSL with this TRX? */ - struct gsm_e1_subslot rsl_e1_link; - uint8_t rsl_tei; - struct e1inp_sign_link *rsl_link; - - /* Some BTS (specifically Ericsson RBS) have a per-TRX OML Link */ - struct e1inp_sign_link *oml_link; - - struct gsm_abis_mo mo; - struct tlv_parsed nm_attr; - struct { - struct gsm_abis_mo mo; - } bb_transc; - - uint16_t arfcn; - int nominal_power; /* in dBm */ - unsigned int max_power_red; /* in actual dB */ - -#ifndef ROLE_BSC - struct trx_power_params power_params; - int ms_power_control; - - struct { - void *l1h; - } role_bts; -#endif - - union { - struct { - struct { - struct gsm_abis_mo mo; - } bbsig; - struct { - struct gsm_abis_mo mo; - } pa; - } bs11; - struct { - unsigned int test_state; - uint8_t test_nr; - struct rxlev_stats rxlev_stat; - } ipaccess; - struct { - struct { - struct om2k_mo om2k_mo; - } trxc; - struct { - struct om2k_mo om2k_mo; - } rx; - struct { - struct om2k_mo om2k_mo; - } tx; - } rbs2000; - }; - struct gsm_bts_trx_ts ts[TRX_NR_TS]; -}; - -enum gsm_bts_type { - GSM_BTS_TYPE_UNKNOWN, - GSM_BTS_TYPE_BS11, - GSM_BTS_TYPE_NANOBTS, - GSM_BTS_TYPE_RBS2000, - GSM_BTS_TYPE_NOKIA_SITE, - GSM_BTS_TYPE_OSMOBTS, - _NUM_GSM_BTS_TYPE -}; - -enum gsm_bts_type_variant { - BTS_UNKNOWN, - BTS_OSMO_LITECELL15, - BTS_OSMO_OCTPHY, - BTS_OSMO_SYSMO, - BTS_OSMO_TRX, - _NUM_BTS_VARIANT -}; - -/* Used by OML layer for BTS Attribute reporting */ -enum bts_attribute { - BTS_TYPE_VARIANT, - BTS_SUB_MODEL, - TRX_PHY_VERSION, -}; - -struct vty; - -/* N. B: always add new features to the end of the list (right before _NUM_BTS_FEAT) to avoid breaking compatibility - with BTS compiled against earlier version of this header */ -enum gsm_bts_features { - BTS_FEAT_HSCSD, - BTS_FEAT_GPRS, - BTS_FEAT_EGPRS, - BTS_FEAT_ECSD, - BTS_FEAT_HOPPING, - BTS_FEAT_MULTI_TSC, - BTS_FEAT_OML_ALERTS, - BTS_FEAT_AGCH_PCH_PROP, - BTS_FEAT_CBCH, - _NUM_BTS_FEAT -}; - -extern const struct value_string gsm_bts_features_descs[]; - -/* - * This keeps track of the paging status of one BTS. It - * includes a number of pending requests, a back pointer - * to the gsm_bts, a timer and some more state. - */ -struct gsm_bts_paging_state { - /* pending requests */ - struct llist_head pending_requests; - struct gsm_bts *bts; - - struct osmo_timer_list work_timer; - struct osmo_timer_list credit_timer; - - /* free chans needed */ - int free_chans_need; - - /* load */ - uint16_t available_slots; -}; - -struct gsm_envabtse { - struct gsm_abis_mo mo; -}; - -struct gsm_bts_gprs_nsvc { - struct gsm_bts *bts; - /* data read via VTY config file, to configure the BTS - * via OML from BSC */ - int id; - uint16_t nsvci; - uint16_t local_port; /* on the BTS */ - uint16_t remote_port; /* on the SGSN */ - uint32_t remote_ip; /* on the SGSN */ - - struct gsm_abis_mo mo; -}; - -enum gprs_rlc_par { - RLC_T3142, - RLC_T3169, - RLC_T3191, - RLC_T3193, - RLC_T3195, - RLC_N3101, - RLC_N3103, - RLC_N3105, - CV_COUNTDOWN, - T_DL_TBF_EXT, /* ms */ - T_UL_TBF_EXT, /* ms */ - _NUM_RLC_PAR -}; - -enum gprs_cs { - GPRS_CS1, - GPRS_CS2, - GPRS_CS3, - GPRS_CS4, - GPRS_MCS1, - GPRS_MCS2, - GPRS_MCS3, - GPRS_MCS4, - GPRS_MCS5, - GPRS_MCS6, - GPRS_MCS7, - GPRS_MCS8, - GPRS_MCS9, - _NUM_GRPS_CS -}; - -struct gprs_rlc_cfg { - uint16_t parameter[_NUM_RLC_PAR]; - struct { - uint16_t repeat_time; /* ms */ - uint8_t repeat_count; - } paging; - uint32_t cs_mask; /* bitmask of gprs_cs */ - uint8_t initial_cs; - uint8_t initial_mcs; -}; - - -enum neigh_list_manual_mode { - NL_MODE_AUTOMATIC = 0, - NL_MODE_MANUAL = 1, - NL_MODE_MANUAL_SI5SEP = 2, /* SI2 and SI5 have separate neighbor lists */ -}; - -enum bts_loc_fix { - BTS_LOC_FIX_INVALID = 0, - BTS_LOC_FIX_2D = 1, - BTS_LOC_FIX_3D = 2, -}; - -extern const struct value_string bts_loc_fix_names[]; - -struct bts_location { - struct llist_head list; - time_t tstamp; - enum bts_loc_fix valid; - double lat; - double lon; - double height; -}; - -/* One BTS */ -struct gsm_bts { - /* list header in net->bts_list */ - struct llist_head list; - - /* Geographical location of the BTS */ - struct llist_head loc_list; - - /* number of ths BTS in network */ - uint8_t nr; - /* human readable name / description */ - char *description; - /* Cell Identity */ - uint16_t cell_identity; - /* location area code of this BTS */ - uint16_t location_area_code; - /* Base Station Identification Code (BSIC), lower 3 bits is BCC, - * which is used as TSC for the CCCH */ - uint8_t bsic; - /* type of BTS */ - enum gsm_bts_type type; - enum gsm_bts_type_variant variant; - - enum gsm_band band; - char version[MAX_VERSION_LENGTH]; - char sub_model[MAX_VERSION_LENGTH]; - - /* features of a given BTS set/reported via OML */ - struct bitvec features; - uint8_t _features_data[MAX_BTS_FEATURES/8]; - - /* Connected PCU version (if any) */ - char pcu_version[MAX_VERSION_LENGTH]; - - /* maximum Tx power that the MS is permitted to use in this cell */ - int ms_max_power; - - /* how do we talk OML with this TRX? */ - struct gsm_e1_subslot oml_e1_link; - uint8_t oml_tei; - struct e1inp_sign_link *oml_link; - - /* Abis network management O&M handle */ - struct abis_nm_h *nmh; - - struct gsm_abis_mo mo; - - /* number of this BTS on given E1 link */ - uint8_t bts_nr; - - /* DTX features of this BTS */ - enum gsm48_dtx_mode dtxu; - bool dtxd; - - /* paging state and control */ - struct gsm_bts_paging_state paging; - - /* CCCH is on C0 */ - struct gsm_bts_trx *c0; - - struct { - struct gsm_abis_mo mo; - } site_mgr; - - /* ip.accesss Unit ID's have Site/BTS/TRX layout */ - union { - struct { - uint16_t site_id; - uint16_t bts_id; - uint32_t flags; - uint32_t rsl_ip; - } ip_access; - struct { - struct { - struct gsm_abis_mo mo; - } cclk; - struct { - struct gsm_abis_mo mo; - } rack; - struct gsm_envabtse envabtse[4]; - } bs11; - struct { - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } cf; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } is; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - struct llist_head conn_groups; - } con; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - } dp; - struct { - struct om2k_mo om2k_mo; - struct gsm_abis_mo mo; - } tf; - uint32_t use_superchannel:1; - } rbs2000; - struct { - uint8_t bts_type; - unsigned int configured:1, - skip_reset:1, - no_loc_rel_cnf:1, - bts_reset_timer_cnf, - did_reset:1, - wait_reset:1; - struct osmo_timer_list reset_timer; - } nokia; - }; - - /* Not entirely sure how ip.access specific this is */ - struct { - uint8_t supports_egprs_11bit_rach; - enum bts_gprs_mode mode; - struct { - struct gsm_abis_mo mo; - uint16_t nsei; - uint8_t timer[7]; - } nse; - struct { - struct gsm_abis_mo mo; - uint16_t bvci; - uint8_t timer[11]; - struct gprs_rlc_cfg rlc_cfg; - } cell; - struct gsm_bts_gprs_nsvc nsvc[2]; - uint8_t rac; - uint8_t net_ctrl_ord; - bool ctrl_ack_type_use_block; - } gprs; - - /* RACH NM values */ - int rach_b_thresh; - int rach_ldavg_slots; - - /* transceivers */ - int num_trx; - struct llist_head trx_list; - - /* SI related items */ - int force_combined_si; - int bcch_change_mark; - -#ifdef ROLE_BSC - /* Abis NM queue */ - struct llist_head abis_queue; - int abis_nm_pend; - - struct gsm_network *network; - - /* should the channel allocator allocate channels from high TRX to TRX0, - * rather than starting from TRX0 and go upwards? */ - int chan_alloc_reverse; - - enum neigh_list_manual_mode neigh_list_manual_mode; - - bool early_classmark_allowed; - /* for testing only: Have an infinitely long radio link timeout */ - bool infinite_radio_link_timeout; - - /* do we use static (user-defined) system information messages? (bitmask) */ - uint32_t si_mode_static; - - /* exclude the BTS from the global RF Lock handling */ - int excl_from_rf_lock; - - /* supported codecs beside FR */ - struct bts_codec_conf codec; - - /* BTS dependencies bit field */ - uint32_t depends_on[256/(8*4)]; - - /* full and half rate multirate config */ - struct amr_multirate_conf mr_full; - struct amr_multirate_conf mr_half; - - /* PCU socket state */ - char *pcu_sock_path; - struct pcu_sock_state *pcu_state; - -#endif /* ROLE_BSC */ - void *role; -}; - - -struct gsm_bts *gsm_bts_alloc(void *talloc_ctx, uint8_t bts_num); -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num); - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts); -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num); - -enum gsm_bts_type str2btstype(const char *arg); -const char *btstype2str(enum gsm_bts_type type); - -enum bts_attribute str2btsattr(const char *s); -const char *btsatttr2str(enum bts_attribute v); - -enum gsm_bts_type_variant str2btsvariant(const char *arg); -const char *btsvariant2str(enum gsm_bts_type_variant v); - -extern const struct value_string gsm_chreq_descs[]; -const struct value_string gsm_pchant_names[13]; -const struct value_string gsm_pchant_descs[13]; -const char *gsm_pchan_name(enum gsm_phys_chan_config c); -enum gsm_phys_chan_config gsm_pchan_parse(const char *name); -const char *gsm_lchant_name(enum gsm_chan_t c); -const char *gsm_chreq_name(enum gsm_chreq_reason_t c); -char *gsm_trx_name(const struct gsm_bts_trx *trx); -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts); -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts); -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan); -const char *gsm_lchans_name(enum gsm_lchan_state s); - -static inline char *gsm_lchan_name(const struct gsm_lchan *lchan) -{ - return lchan->name; -} - -static inline int gsm_bts_set_feature(struct gsm_bts *bts, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_set_bit_pos(&bts->features, feat, 1); -} - -static inline bool gsm_bts_has_feature(const struct gsm_bts *bts, enum gsm_bts_features feat) -{ - OSMO_ASSERT(_NUM_BTS_FEAT < MAX_BTS_FEATURES); - return bitvec_get_bit_pos(&bts->features, feat); -} - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo); - -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); - -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst); - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts); - -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr); -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan); -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan); - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts); /* * help with parsing regexps */ int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) __attribute__ ((warn_unused_result)); - -static inline uint8_t gsm_ts_tsc(const struct gsm_bts_trx_ts *ts) -{ - if (ts->tsc != -1) - return ts->tsc; - else - return ts->trx->bts->bsic & 7; -} - -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc); - -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts); -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts); -bool ts_is_tch(struct gsm_bts_trx_ts *ts); #endif diff --git a/include/osmocom/msc/gsm_subscriber.h b/include/osmocom/msc/gsm_subscriber.h index 4adfd41..16e1037 100644 --- a/include/osmocom/msc/gsm_subscriber.h +++ b/include/osmocom/msc/gsm_subscriber.h @@ -66,4 +66,7 @@ int subscr_paging_dispatch(unsigned int hooknum, unsigned int event, struct msgb *msg, void *data, void *param); +/* Find an allocated channel for a specified subscriber */ +struct gsm_subscriber_connection *connection_for_subscr(struct vlr_subscr *vsub); + #endif /* _GSM_SUBSCR_H */ diff --git a/include/osmocom/msc/handover.h b/include/osmocom/msc/handover.h deleted file mode 100644 index 3fe71a2..0000000 --- a/include/osmocom/msc/handover.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _HANDOVER_H -#define _HANDOVER_H - -struct gsm_subscriber_connection; - -int bsc_handover_start(struct gsm_lchan *old_lchan, struct gsm_bts *bts); - -/* clear any operation for this connection */ -void bsc_clear_handover(struct gsm_subscriber_connection *conn, int free_lchan); - -/* Return the old lchan or NULL. This is meant for audio handling */ -struct gsm_lchan *bsc_handover_pending(struct gsm_lchan *new_lchan); - -#endif /* _HANDOVER_H */ diff --git a/include/osmocom/msc/handover_decision.h b/include/osmocom/msc/handover_decision.h deleted file mode 100644 index 81078b0..0000000 --- a/include/osmocom/msc/handover_decision.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _HANDOVER_DECISION_H -#define _HANDOVER_DECISION_H - -void on_dso_load_ho_dec(void); - -#endif /* _HANDOVER_DECISION_H */ - diff --git a/include/osmocom/msc/meas_rep.h b/include/osmocom/msc/meas_rep.h deleted file mode 100644 index b0c03f0..0000000 --- a/include/osmocom/msc/meas_rep.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef _MEAS_REP_H -#define _MEAS_REP_H - -#include - -#include - -#define MRC_F_PROCESSED 0x0001 - -/* extracted from a L3 measurement report IE */ -struct gsm_meas_rep_cell { - uint8_t rxlev; - uint8_t bsic; - uint8_t neigh_idx; - uint16_t arfcn; - unsigned int flags; -}; - -#define MEAS_REP_F_UL_DTX 0x01 -#define MEAS_REP_F_DL_VALID 0x02 -#define MEAS_REP_F_BA1 0x04 -#define MEAS_REP_F_DL_DTX 0x08 -#define MEAS_REP_F_MS_TO 0x10 -#define MEAS_REP_F_MS_L1 0x20 -#define MEAS_REP_F_FPC 0x40 - -/* parsed uplink and downlink measurement result */ -struct gsm_meas_rep { - /* back-pointer to the logical channel */ - struct gsm_lchan *lchan; - - /* number of the measurement report */ - uint8_t nr; - /* flags, see MEAS_REP_F_* */ - unsigned int flags; - - /* uplink and downlink rxlev, rxqual; full and sub */ - struct gsm_meas_rep_unidir ul; - struct gsm_meas_rep_unidir dl; - - uint8_t bs_power; - /* according to 3GPP TS 48.058 ? MS Timing Offset [-63; 192] */ - int16_t ms_timing_offset; - struct { - int8_t pwr; /* MS power in dBm */ - uint8_t ta; /* MS timing advance */ - } ms_l1; - - /* neighbor measurement reports for up to 6 cells */ - int num_cell; - struct gsm_meas_rep_cell cell[6]; -}; - -/* obtain an average over the last 'num' fields in the meas reps */ -int get_meas_rep_avg(const struct gsm_lchan *lchan, - enum meas_rep_field field, unsigned int num); - -/* Check if N out of M last values for FIELD are >= bd */ -int meas_rep_n_out_of_m_be(const struct gsm_lchan *lchan, - enum meas_rep_field field, - unsigned int n, unsigned int m, int be); - -unsigned int calc_initial_idx(unsigned int array_size, - unsigned int meas_rep_idx, - unsigned int num_values); - -#endif /* _MEAS_REP_H */ diff --git a/include/osmocom/msc/misdn.h b/include/osmocom/msc/misdn.h deleted file mode 100644 index 9851ad3..0000000 --- a/include/osmocom/msc/misdn.h +++ /dev/null @@ -1,27 +0,0 @@ -/* (C) 2008 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef MISDN_H -#define MISDN_H - -#include - -int mi_setup(int cardnr, struct e1inp_line *line, int release_l2); -int mi_e1_line_update(struct e1inp_line *line); - -#endif diff --git a/include/osmocom/msc/network_listen.h b/include/osmocom/msc/network_listen.h deleted file mode 100644 index 05fbb2f..0000000 --- a/include/osmocom/msc/network_listen.h +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef _OPENBSC_NWL_H -#define _OPENBSC_NWL_H - -#include -#include - -void ipac_nwl_init(void); - -/* Start a NWL test. It will raise the S_IPAC_TEST_COMPLETE signal. */ -int ipac_nwl_test_start(struct gsm_bts_trx *trx, uint8_t testnr, - const uint8_t *phys_conf, unsigned int phys_conf_len); - -int ipac_rxlevstat2whitelist(uint16_t *buf, const struct rxlev_stats *st, uint8_t min_rxlev, - uint16_t max_num_arfcns); - -#endif /* _OPENBSC_NWL_H */ diff --git a/include/osmocom/msc/osmo_bsc.h b/include/osmocom/msc/osmo_bsc.h deleted file mode 100644 index 5ebea50..0000000 --- a/include/osmocom/msc/osmo_bsc.h +++ /dev/null @@ -1,75 +0,0 @@ -/* OpenBSC BSC code */ - -#ifndef OSMO_BSC_H -#define OSMO_BSC_H - -#include "bsc_api.h" -#include "bsc_msg_filter.h" - -#define BSS_SEND_USSD 1 - -enum bsc_con { - BSC_CON_SUCCESS, - BSC_CON_REJECT_NO_LINK, - BSC_CON_REJECT_RF_GRACE, - BSC_CON_NO_MEM, -}; - -struct sccp_connection; -struct bsc_msc_data; -struct bsc_msc_connection; - -struct osmo_bsc_sccp_con { - struct llist_head entry; - - int ciphering_handled; - - /* for audio handling */ - uint16_t cic; - uint32_t rtp_ip; - int rtp_port; - - /* for advanced ping/pong */ - int send_ping; - - /* SCCP connection realted */ - struct sccp_connection *sccp; - struct bsc_msc_data *msc; - struct osmo_timer_list sccp_it_timeout; - struct osmo_timer_list sccp_cc_timeout; - - struct llist_head sccp_queue; - unsigned int sccp_queue_size; - - struct gsm_subscriber_connection *conn; - uint8_t new_subscriber; - - struct bsc_filter_state filter_state; - - /* Sigtran connection ID */ - int conn_id; -}; - -struct bsc_api *osmo_bsc_api(); - -int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg); -int bsc_open_connection(struct osmo_bsc_sccp_con *sccp, struct msgb *msg); -enum bsc_con bsc_create_new_connection(struct gsm_subscriber_connection *conn, - struct bsc_msc_data *msc, int send_ping); -int bsc_delete_connection(struct osmo_bsc_sccp_con *sccp); - -struct bsc_msc_data *bsc_find_msc(struct gsm_subscriber_connection *conn, struct msgb *); -int bsc_scan_bts_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_scan_msc_msg(struct gsm_subscriber_connection *conn, struct msgb *msg); -int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn); - -int bsc_handle_udt(struct bsc_msc_data *msc, struct msgb *msg, unsigned int length); -int bsc_handle_dt(struct osmo_bsc_sccp_con *conn, struct msgb *msg, unsigned int len); - -int bsc_ctrl_cmds_install(); - -void bsc_gen_location_state_trap(struct gsm_bts *bts); - -struct llist_head *bsc_access_lists(void); - -#endif diff --git a/include/osmocom/msc/osmo_bsc_reset.h b/include/osmocom/msc/osmo_bsc_reset.h deleted file mode 100644 index 578f763..0000000 --- a/include/osmocom/msc/osmo_bsc_reset.h +++ /dev/null @@ -1,34 +0,0 @@ -/* (C) 2017 by sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* Create and start state machine which handles the reset/reset-ack procedure */ -void start_reset_fsm(struct bsc_msc_data *msc); - -/* Confirm that we sucessfully received a reset acknowlege message */ -void reset_ack_confirm(struct bsc_msc_data *msc); - -/* Report a failed connection */ -void report_conn_fail(struct bsc_msc_data *msc); - -/* Report a successful connection */ -void report_conn_success(struct bsc_msc_data *msc); - -/* Check if we have a connection to a specified msc */ -bool sccp_conn_ready(struct bsc_msc_data *msc); diff --git a/include/osmocom/msc/osmo_bsc_sigtran.h b/include/osmocom/msc/osmo_bsc_sigtran.h deleted file mode 100644 index 7015edb..0000000 --- a/include/osmocom/msc/osmo_bsc_sigtran.h +++ /dev/null @@ -1,48 +0,0 @@ -/* (C) 2017 by Sysmocom s.f.m.c. GmbH - * All Rights Reserved - * - * Author: Philipp Maier - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#pragma once - -#include -#include - -/* Allocate resources to make a new connection oriented sigtran connection - * (not the connection ittself!) */ -enum bsc_con osmo_bsc_sigtran_new_conn(struct gsm_subscriber_connection *conn, struct bsc_msc_data *msc); - -/* Open a new connection oriented sigtran connection */ -int osmo_bsc_sigtran_open_conn(const struct osmo_bsc_sccp_con *conn, struct msgb *msg); - -/* Send data to MSC */ -int osmo_bsc_sigtran_send(const struct osmo_bsc_sccp_con *conn, struct msgb *msg); - -/* Delete a connection from the list with open connections - * (called by osmo_bsc_api.c on failing open connections and - * locally, when a connection is closed by the MSC */ -int osmo_bsc_sigtran_del_conn(struct osmo_bsc_sccp_con *sccp); - -/* Initalize osmo sigtran backhaul */ -int osmo_bsc_sigtran_init(struct llist_head *mscs); - -/* Close all open sigtran connections and channels */ -void osmo_bsc_sigtran_reset(const struct bsc_msc_data *msc); - -/* Send reset-ack to MSC */ -void osmo_bsc_sigtran_tx_reset_ack(const struct bsc_msc_data *msc); diff --git a/include/osmocom/msc/osmux.h b/include/osmocom/msc/osmux.h deleted file mode 100644 index f3ea72a..0000000 --- a/include/osmocom/msc/osmux.h +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef _OPENBSC_OSMUX_H_ -#define _OPENBSC_OSMUX_H_ - -#include - -#define OSMUX_PORT 1984 - -enum { - OSMUX_ROLE_BSC = 0, - OSMUX_ROLE_BSC_NAT, -}; - -int osmux_init(int role, struct mgcp_config *cfg); -int osmux_enable_endpoint(struct mgcp_endpoint *endp, struct in_addr *addr, uint16_t port); -void osmux_disable_endpoint(struct mgcp_endpoint *endp); -void osmux_allocate_cid(struct mgcp_endpoint *endp); -void osmux_release_cid(struct mgcp_endpoint *endp); - -int osmux_xfrm_to_rtp(struct mgcp_endpoint *endp, int type, char *buf, int rc); -int osmux_xfrm_to_osmux(int type, char *buf, int rc, struct mgcp_endpoint *endp); - -int osmux_send_dummy(struct mgcp_endpoint *endp); - -int osmux_get_cid(void); -void osmux_put_cid(uint8_t osmux_cid); -int osmux_used_cid(void); - -enum osmux_state { - OSMUX_STATE_DISABLED = 0, - OSMUX_STATE_NEGOTIATING, - OSMUX_STATE_ACTIVATING, - OSMUX_STATE_ENABLED, -}; - -enum osmux_usage { - OSMUX_USAGE_OFF = 0, - OSMUX_USAGE_ON = 1, - OSMUX_USAGE_ONLY = 2, -}; - -#endif diff --git a/include/osmocom/msc/rs232.h b/include/osmocom/msc/rs232.h deleted file mode 100644 index 61187ca..0000000 --- a/include/osmocom/msc/rs232.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _RS232_H -#define _RS232_H - -int rs232_setup(const char *serial_port, unsigned int delay_ms, - struct gsm_bts *bts); - -int handle_serial_msg(struct msgb *msg); - -#endif /* _RS232_H */ diff --git a/include/osmocom/msc/rtp_proxy.h b/include/osmocom/msc/rtp_proxy.h deleted file mode 100644 index 3cd8cac..0000000 --- a/include/osmocom/msc/rtp_proxy.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef _RTP_PROXY_H -#define _RTP_PROXY_H - -/* RTP proxy handling for ip.access nanoBTS */ - -/* (C) 2009 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include - -#include -#include - -#include - -#define RTP_PT_GSM_FULL 3 -#define RTP_PT_GSM_HALF 96 -#define RTP_PT_GSM_EFR 97 -#define RTP_PT_AMR 98 -#define RTP_LEN_GSM_FULL 33 -#define RTP_LEN_GSM_HALF 15 -#define RTP_LEN_GSM_EFR 31 -#define RTP_GSM_DURATION 160 - -enum rtp_rx_action { - RTP_NONE, - RTP_PROXY, - RTP_RECV_UPSTREAM, -}; - -enum rtp_tx_action { - RTP_SEND_NONE, - RTP_SEND_DOWNSTREAM, -}; - -struct rtp_sub_socket { - struct sockaddr_in sin_local; - struct sockaddr_in sin_remote; - - struct osmo_fd bfd; - /* linked list of to-be-transmitted msgb's */ - struct llist_head tx_queue; -}; - -struct rtp_socket { - struct llist_head list; - - struct rtp_sub_socket rtp; - struct rtp_sub_socket rtcp; - - /* what should we do on receive? */ - enum rtp_rx_action rx_action; - union { - struct { - struct rtp_socket *other_sock; - } proxy; - struct { - struct gsm_network *net; - uint32_t callref; - } receive; - }; - enum rtp_tx_action tx_action; - struct { - uint16_t sequence; - uint32_t timestamp; - uint32_t ssrc; - struct timeval last_tv; - } transmit; -}; - -struct rtp_socket *rtp_socket_create(void); -int rtp_socket_bind(struct rtp_socket *rs, uint32_t ip); -int rtp_socket_connect(struct rtp_socket *rs, uint32_t ip, uint16_t port); -int rtp_socket_proxy(struct rtp_socket *this, struct rtp_socket *other); -int rtp_socket_upstream(struct rtp_socket *this, struct gsm_network *net, uint32_t callref); -int rtp_socket_free(struct rtp_socket *rs); -int rtp_send_frame(struct rtp_socket *rs, struct gsm_data_frame *frame); - -#endif /* _RTP_PROXY_H */ diff --git a/include/osmocom/msc/signal.h b/include/osmocom/msc/signal.h index 14c76f8..29b6a59 100644 --- a/include/osmocom/msc/signal.h +++ b/include/osmocom/msc/signal.h @@ -35,18 +35,10 @@ enum signal_subsystems { SS_PAGING, SS_SMS, - SS_ABISIP, - SS_NM, - SS_LCHAN, SS_SUBSCR, SS_SCALL, - SS_CHALLOC, - SS_IPAC_NWL, - SS_RF, SS_MSC, - SS_HO, SS_CCCH, - SS_SGSN, }; /* SS_PAGING signals */ @@ -62,50 +54,6 @@ S_SMS_SMMA, /* A MS tells us it has more space available */ S_SMS_MEM_EXCEEDED, /* A MS tells us it has no more space available */ S_SMS_UNKNOWN_ERROR, /* A MS tells us it has an error */ -}; - -/* SS_ABISIP signals */ -enum signal_abisip { - S_ABISIP_CRCX_ACK, - S_ABISIP_MDCX_ACK, - S_ABISIP_DLCX_IND, -}; - -/* SS_NM signals */ -enum signal_nm { - S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */ - S_NM_FAIL_REP, /* GSM 12.21 failure event report */ - S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */ - S_NM_IPACC_NACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_NACK happened */ - S_NM_IPACC_ACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_ACK happened */ - S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */ - S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */ - S_NM_TEST_REP, /* GSM 12.21 Test Report */ - S_NM_STATECHG_OPER, /* Operational State changed*/ - S_NM_STATECHG_ADM, /* Administrative State changed */ - S_NM_OM2K_CONF_RES, /* OM2K Configuration Result */ -}; - -/* SS_LCHAN signals */ -enum signal_lchan { - /* - * The lchan got freed with an use_count != 0 and error - * recovery needs to be carried out from within the - * signal handler. - */ - S_LCHAN_UNEXPECTED_RELEASE, - S_LCHAN_ACTIVATE_ACK, /* 08.58 Channel Activate ACK */ - S_LCHAN_ACTIVATE_NACK, /* 08.58 Channel Activate NACK */ - S_LCHAN_HANDOVER_COMPL, /* 04.08 Handover Completed */ - S_LCHAN_HANDOVER_FAIL, /* 04.08 Handover Failed */ - S_LCHAN_HANDOVER_DETECT, /* 08.58 Handover Detect */ - S_LCHAN_MEAS_REP, /* 08.58 Measurement Report */ -}; - -/* SS_CHALLOC signals */ -enum signal_challoc { - S_CHALLOC_ALLOC_FAIL, /* allocation of lchan has failed */ - S_CHALLOC_FREED, /* lchan has been successfully freed */ }; /* SS_SUBSCR signals */ @@ -131,13 +79,6 @@ S_GLOBAL_BTS_CLOSE_OM, }; -/* SS_RF signals */ -enum signal_rf { - S_RF_OFF, - S_RF_ON, - S_RF_GRACE, -}; - struct paging_signal_data { struct vlr_subscr *vsub; struct gsm_bts *bts; @@ -152,51 +93,6 @@ struct gsm_subscriber_connection *conn; void *data; }; - -struct ipacc_ack_signal_data { - struct gsm_bts_trx *trx; - uint8_t msg_type; -}; - -struct abis_om2k_mo; - -struct nm_statechg_signal_data { - struct gsm_bts *bts; - uint8_t obj_class; - void *obj; - struct gsm_nm_state *old_state; - struct gsm_nm_state *new_state; - - /* This pointer is vaold for TS 12.21 MO */ - struct abis_om_obj_inst *obj_inst; - /* This pointer is vaold for RBS2000 MO */ - struct abis_om2k_mo *om2k_mo; -}; - -struct nm_om2k_signal_data { - struct gsm_bts *bts; - void *obj; - struct abis_om2k_mo *om2k_mo; - - uint8_t accordance_ind; -}; - -struct nm_nack_signal_data { - struct msgb *msg; - struct gsm_bts *bts; - uint8_t mt; -}; - -struct challoc_signal_data { - struct gsm_bts *bts; - struct gsm_lchan *lchan; - enum gsm_chan_t type; -}; - -struct rf_signal_data { - struct gsm_network *net; -}; - struct sms_signal_data { /* The transaction where this occured */ struct gsm_trans *trans; @@ -204,13 +100,6 @@ struct gsm_sms *sms; /* int paging result. Only the ones with > 0 */ int paging_result; -}; - -struct lchan_signal_data { - /* The lchan the signal happened on */ - struct gsm_lchan *lchan; - /* Measurement reports on this lchan */ - struct gsm_meas_rep *mr; }; /* MSC signals */ @@ -223,38 +112,6 @@ struct bsc_msc_data; struct msc_signal_data { struct bsc_msc_data *data; -}; - -/* SS_CCCH signals */ -enum signal_ccch { - S_CCCH_PAGING_LOAD, - S_CCCH_RACH_LOAD, -}; - -struct ccch_signal_data { - struct gsm_bts *bts; - uint16_t pg_buf_space; - uint16_t rach_slot_count; - uint16_t rach_busy_count; - uint16_t rach_access_count; -}; - -/* GPRS SGSN signals SS_SGSN */ -enum signal_sgsn { - S_SGSN_ATTACH, - S_SGSN_DETACH, - S_SGSN_UPDATE, - S_SGSN_PDP_ACT, - S_SGSN_PDP_DEACT, - S_SGSN_PDP_TERMINATE, - S_SGSN_PDP_FREE, - S_SGSN_MM_FREE, -}; - -struct sgsn_mm_ctx; -struct sgsn_signal_data { - struct sgsn_mm_ctx *mm; - struct sgsn_pdp_ctx *pdp; /* non-NULL for PDP_ACT, PDP_DEACT, PDP_FREE */ }; #endif diff --git a/include/osmocom/msc/slhc.h b/include/osmocom/msc/slhc.h deleted file mode 100644 index cd5a47c..0000000 --- a/include/osmocom/msc/slhc.h +++ /dev/null @@ -1,187 +0,0 @@ -#ifndef _SLHC_H -#define _SLHC_H -/* - * Definitions for tcp compression routines. - * - * $Header: slcompress.h,v 1.10 89/12/31 08:53:02 van Exp $ - * - * Copyright (c) 1989 Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * Van Jacobson (van at helios.ee.lbl.gov), Dec 31, 1989: - * - Initial distribution. - * - * - * modified for KA9Q Internet Software Package by - * Katie Stevens (dkstevens at ucdavis.edu) - * University of California, Davis - * Computing Services - * - 01-31-90 initial adaptation - * - * - Feb 1991 Bill_Simpson at um.cc.umich.edu - * variable number of conversation slots - * allow zero or one slots - * separate routines - * status display - */ - -/* - * Compressed packet format: - * - * The first octet contains the packet type (top 3 bits), TCP - * 'push' bit, and flags that indicate which of the 4 TCP sequence - * numbers have changed (bottom 5 bits). The next octet is a - * conversation number that associates a saved IP/TCP header with - * the compressed packet. The next two octets are the TCP checksum - * from the original datagram. The next 0 to 15 octets are - * sequence number changes, one change per bit set in the header - * (there may be no changes and there are two special cases where - * the receiver implicitly knows what changed -- see below). - * - * There are 5 numbers which can change (they are always inserted - * in the following order): TCP urgent pointer, window, - * acknowledgment, sequence number and IP ID. (The urgent pointer - * is different from the others in that its value is sent, not the - * change in value.) Since typical use of SLIP links is biased - * toward small packets (see comments on MTU/MSS below), changes - * use a variable length coding with one octet for numbers in the - * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the - * range 256 - 65535 or 0. (If the change in sequence number or - * ack is more than 65535, an uncompressed packet is sent.) - */ - -/* - * Packet types (must not conflict with IP protocol version) - * - * The top nibble of the first octet is the packet type. There are - * three possible types: IP (not proto TCP or tcp with one of the - * control flags set); uncompressed TCP (a normal IP/TCP packet but - * with the 8-bit protocol field replaced by an 8-bit connection id -- - * this type of packet syncs the sender & receiver); and compressed - * TCP (described above). - * - * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and - * is logically part of the 4-bit "changes" field that follows. Top - * three bits are actual packet type. For backward compatibility - * and in the interest of conserving bits, numbers are chosen so the - * IP protocol version number (4) which normally appears in this nibble - * means "IP packet". - */ - - -#include -#include - -/* SLIP compression masks for len/vers byte */ -#define SL_TYPE_IP 0x40 -#define SL_TYPE_UNCOMPRESSED_TCP 0x70 -#define SL_TYPE_COMPRESSED_TCP 0x80 -#define SL_TYPE_ERROR 0x00 - -/* Bits in first octet of compressed packet */ -#define NEW_C 0x40 /* flag bits for what changed in a packet */ -#define NEW_I 0x20 -#define NEW_S 0x08 -#define NEW_A 0x04 -#define NEW_W 0x02 -#define NEW_U 0x01 - -/* reserved, special-case values of above */ -#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */ -#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */ -#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U) - -#define TCP_PUSH_BIT 0x10 - -/* - * data type and sizes conversion assumptions: - * - * VJ code KA9Q style generic - * u_char byte_t unsigned char 8 bits - * u_short int16 unsigned short 16 bits - * u_int int16 unsigned short 16 bits - * u_long unsigned long unsigned long 32 bits - * int int32 long 32 bits - */ - -typedef __u8 byte_t; -typedef __u32 int32; - -/* - * "state" data for each active tcp conversation on the wire. This is - * basically a copy of the entire IP/TCP header from the last packet - * we saw from the conversation together with a small identifier - * the transmit & receive ends of the line use to locate saved header. - */ -struct cstate { - byte_t cs_this; /* connection id number (xmit) */ - struct cstate *next; /* next in ring (xmit) */ - struct iphdr cs_ip; /* ip/tcp hdr from most recent packet */ - struct tcphdr cs_tcp; - unsigned char cs_ipopt[64]; - unsigned char cs_tcpopt[64]; - int cs_hsize; -}; -#define NULLSLSTATE (struct cstate *)0 - -/* - * all the state data for one serial line (we need one of these per line). - */ -struct slcompress { - struct cstate *tstate; /* transmit connection states (array)*/ - struct cstate *rstate; /* receive connection states (array)*/ - - byte_t tslot_limit; /* highest transmit slot id (0-l)*/ - byte_t rslot_limit; /* highest receive slot id (0-l)*/ - - byte_t xmit_oldest; /* oldest xmit in ring */ - byte_t xmit_current; /* most recent xmit id */ - byte_t recv_current; /* most recent rcvd id */ - - byte_t flags; -#define SLF_TOSS 0x01 /* tossing rcvd frames until id received */ - - int32 sls_o_nontcp; /* outbound non-TCP packets */ - int32 sls_o_tcp; /* outbound TCP packets */ - int32 sls_o_uncompressed; /* outbound uncompressed packets */ - int32 sls_o_compressed; /* outbound compressed packets */ - int32 sls_o_searches; /* searches for connection state */ - int32 sls_o_misses; /* times couldn't find conn. state */ - - int32 sls_i_uncompressed; /* inbound uncompressed packets */ - int32 sls_i_compressed; /* inbound compressed packets */ - int32 sls_i_error; /* inbound error packets */ - int32 sls_i_tossed; /* inbound packets tossed because of error */ - - int32 sls_i_runt; - int32 sls_i_badcheck; -}; -#define NULLSLCOMPR (struct slcompress *)0 - -/* In slhc.c: */ -struct slcompress *slhc_init(const void *ctx, int rslots, int tslots); - -void slhc_free(struct slcompress *comp); - -int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, - unsigned char *ocp, unsigned char **cpp, int compress_cid); -int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize); -int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize); -int slhc_toss(struct slcompress *comp); - -void slhc_i_status(struct slcompress *comp); -void slhc_o_status(struct slcompress *comp); - -#endif /* _SLHC_H */ diff --git a/include/osmocom/msc/system_information.h b/include/osmocom/msc/system_information.h deleted file mode 100644 index 854b7e3..0000000 --- a/include/osmocom/msc/system_information.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SYSTEM_INFO_H -#define _SYSTEM_INFO_H - -#include - -#include - -struct gsm_bts; - -int gsm_generate_si(struct gsm_bts *bts, enum osmo_sysinfo_type type); -size_t si2q_earfcn_count(const struct osmo_earfcn_si2q *e); -unsigned range1024_p(unsigned n); -unsigned range512_q(unsigned m); -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); -#endif diff --git a/include/osmocom/msc/trau_mux.h b/include/osmocom/msc/trau_mux.h deleted file mode 100644 index 08863bf..0000000 --- a/include/osmocom/msc/trau_mux.h +++ /dev/null @@ -1,70 +0,0 @@ -/* Simple TRAU frame reflector to route voice calls */ - -/* (C) 2009 by Harald Welte - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* The "TRAU mux map" defines which particular 16kbit sub-slot (in which E1 - * timeslot on which E1 interface) should be directly muxed to which other - * sub-slot. Entries in the mux map are always bi-directional. - * - * The idea of all this is to directly switch voice channels in the BSC - * from one phone to another. We do this right now since we don't support - * any external interface for voice channels, and in the future as an - * optimization to routing them externally. - */ - -#include -#include -#include - -struct decoded_trau_frame; - -/* map a TRAU mux map entry */ -int trau_mux_map(const struct gsm_e1_subslot *src, - const struct gsm_e1_subslot *dst); -int trau_mux_map_lchan(const struct gsm_lchan *src, - const struct gsm_lchan *dst); - -/* unmap a TRAU mux map entry */ -int trau_mux_unmap(const struct gsm_e1_subslot *ss, uint32_t callref); - -/* we get called by subchan_demux */ -int trau_mux_input(struct gsm_e1_subslot *src_e1_ss, - const uint8_t *trau_bits, int num_bits); - -/* add a trau receiver */ -int trau_recv_lchan(struct gsm_lchan *lchan, uint32_t callref); - -/* send trau from application */ -int trau_send_frame(struct gsm_lchan *lchan, struct gsm_data_frame *frame); - -/* switch trau muxer to new lchan */ -int switch_trau_mux(struct gsm_lchan *old_lchan, struct gsm_lchan *new_lchan); - -/* callback invoked if we receive TRAU frames */ -int subch_cb(struct subch_demux *dmx, int ch, uint8_t *data, int len, void *_priv); - -/* TRAU frame transcoding */ -struct msgb *trau_decode_fr(uint32_t callref, - const struct decoded_trau_frame *tf); -struct msgb *trau_decode_efr(uint32_t callref, - const struct decoded_trau_frame *tf); -void trau_encode_fr(struct decoded_trau_frame *tf, - const unsigned char *data); -void trau_encode_efr(struct decoded_trau_frame *tf, - const unsigned char *data); diff --git a/include/osmocom/msc/trau_upqueue.h b/include/osmocom/msc/trau_upqueue.h deleted file mode 100644 index ecc7658..0000000 --- a/include/osmocom/msc/trau_upqueue.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _TRAU_UPQUEUE_H -#define _TRAU_UPQUEUE_H - -void trau_tx_to_mncc(struct gsm_network *net, struct msgb *msg); - -#endif /* _TRAU_UPQUEUE_H */ - diff --git a/include/osmocom/msc/vty.h b/include/osmocom/msc/vty.h index f705601..ff85fa0 100644 --- a/include/osmocom/msc/vty.h +++ b/include/osmocom/msc/vty.h @@ -17,27 +17,11 @@ enum bsc_vty_node { GSMNET_NODE = _LAST_OSMOVTY_NODE + 1, - BTS_NODE, - TRX_NODE, - TS_NODE, SUBSCR_NODE, - MGCP_NODE, - GBPROXY_NODE, - SGSN_NODE, - OML_NODE, - NAT_NODE, - NAT_BSC_NODE, MSC_NODE, - OM2K_NODE, - OM2K_CON_GROUP_NODE, - TRUNK_NODE, - PGROUP_NODE, MNCC_INT_NODE, - NITB_NODE, - BSC_NODE, SMPP_NODE, SMPP_ESME_NODE, - GTPHUB_NODE, HLR_NODE, }; diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index 3ee0058..d2f4f59 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -27,7 +27,6 @@ #include #include #include -#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 18272c5..8f70da7 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -24,7 +24,6 @@ common_vty.c \ debug.c \ gsm_data.c \ - gsm_data_shared.c \ gsup_client.c \ oap_client.c \ socket.c \ diff --git a/src/libcommon/common_vty.c b/src/libcommon/common_vty.c index 6037dda..71c607e 100644 --- a/src/libcommon/common_vty.c +++ b/src/libcommon/common_vty.c @@ -42,25 +42,11 @@ vty->node = CONFIG_NODE; vty->index = NULL; break; - case TS_NODE: - vty->node = TRX_NODE; - { - /* set vty->index correctly ! */ - struct gsm_bts_trx_ts *ts = vty->index; - vty->index = ts->trx; - vty->index_sub = &ts->trx->description; - } - break; - case TRUNK_NODE: - vty->node = MGCP_NODE; - vty->index = NULL; - break; case SMPP_ESME_NODE: vty->node = SMPP_NODE; vty->index = NULL; break; case SMPP_NODE: - case MGCP_NODE: case MSC_NODE: case MNCC_INT_NODE: vty->node = CONFIG_NODE; diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index 4ab8a20..bdcdf02 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -29,73 +29,13 @@ #include #include #include -#include #include #include #include #include -#include void *tall_bsc_ctx; - -static LLIST_HEAD(bts_models); - -void set_ts_e1link(struct gsm_bts_trx_ts *ts, uint8_t e1_nr, - uint8_t e1_ts, uint8_t e1_ts_ss) -{ - ts->e1_link.e1_nr = e1_nr; - ts->e1_link.e1_ts = e1_ts; - ts->e1_link.e1_ts_ss = e1_ts_ss; -} - -const struct value_string bts_type_descs[_NUM_GSM_BTS_TYPE+1] = { - { GSM_BTS_TYPE_UNKNOWN, "Unknown BTS Type" }, - { GSM_BTS_TYPE_BS11, "Siemens BTS (BS-11 or compatible)" }, - { GSM_BTS_TYPE_NANOBTS, "ip.access nanoBTS or compatible" }, - { GSM_BTS_TYPE_RBS2000, "Ericsson RBS2000 Series" }, - { GSM_BTS_TYPE_NOKIA_SITE, "Nokia {Metro,Ultra,In}Site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmocom sysmoBTS" }, - { 0, NULL } -}; - -struct gsm_bts_trx *gsm_bts_trx_by_nr(struct gsm_bts *bts, int nr) -{ - struct gsm_bts_trx *trx; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == nr) - return trx; - } - return NULL; -} - -/* Search for a BTS in the given Location Area; optionally start searching - * with start_bts (for continuing to search after the first result) */ -struct gsm_bts *gsm_bts_by_lac(struct gsm_network *net, unsigned int lac, - struct gsm_bts *start_bts) -{ - int i; - struct gsm_bts *bts; - int skip = 0; - - if (start_bts) - skip = 1; - - for (i = 0; i < net->num_bts; i++) { - bts = gsm_bts_num(net, i); - - if (skip) { - if (start_bts == bts) - skip = 0; - continue; - } - - if (lac == GSM_LAC_RESERVED_ALL_BTS || bts->location_area_code == lac) - return bts; - } - return NULL; -} static const struct value_string auth_policy_names[] = { { GSM_AUTH_POLICY_CLOSED, "closed" }, @@ -133,45 +73,6 @@ return get_value_string(rrlp_mode_names, mode); } -static const struct value_string bts_gprs_mode_names[] = { - { BTS_GPRS_NONE, "none" }, - { BTS_GPRS_GPRS, "gprs" }, - { BTS_GPRS_EGPRS, "egprs" }, - { 0, NULL } -}; - -enum bts_gprs_mode bts_gprs_mode_parse(const char *arg, int *valid) -{ - int rc; - - rc = get_string_value(bts_gprs_mode_names, arg); - if (valid) - *valid = rc != -EINVAL; - return rc; -} - -const char *bts_gprs_mode_name(enum bts_gprs_mode mode) -{ - return get_value_string(bts_gprs_mode_names, mode); -} - -void gprs_ra_id_by_bts(struct gprs_ra_id *raid, struct gsm_bts *bts) -{ - raid->mcc = bts->network->country_code; - raid->mnc = bts->network->network_code; - raid->lac = bts->location_area_code; - raid->rac = bts->gprs.rac; -} - -int gsm48_ra_id_by_bts(uint8_t *buf, struct gsm_bts *bts) -{ - struct gprs_ra_id raid; - - gprs_ra_id_by_bts(&raid, bts); - - return gsm48_construct_ra(buf, &raid); -} - int gsm_parse_reg(void *ctx, regex_t *reg, char **str, int argc, const char **argv) { int ret; @@ -196,9 +97,6 @@ return ret; } - -/* Assume there are only 256 possible bts */ -osmo_static_assert(sizeof(((struct gsm_bts *) 0)->nr) == 1, _bts_nr_is_256); bool classmark_is_r99(struct gsm_classmark *cm) { diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c deleted file mode 100644 index 9382889..0000000 --- a/src/libcommon/gsm_data_shared.c +++ /dev/null @@ -1,853 +0,0 @@ -/* (C) 2008-2010 by Harald Welte - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include - -void gsm_abis_mo_reset(struct gsm_abis_mo *mo) -{ - mo->nm_state.operational = NM_OPSTATE_NULL; - mo->nm_state.availability = NM_AVSTATE_POWER_OFF; -} - -static void gsm_mo_init(struct gsm_abis_mo *mo, struct gsm_bts *bts, - uint8_t obj_class, uint8_t p1, uint8_t p2, uint8_t p3) -{ - mo->bts = bts; - mo->obj_class = obj_class; - mo->obj_inst.bts_nr = p1; - mo->obj_inst.trx_nr = p2; - mo->obj_inst.ts_nr = p3; - gsm_abis_mo_reset(mo); -} - -const struct value_string bts_attribute_names[] = { - OSMO_VALUE_STRING(BTS_TYPE_VARIANT), - OSMO_VALUE_STRING(BTS_SUB_MODEL), - OSMO_VALUE_STRING(TRX_PHY_VERSION), - { 0, NULL } -}; - -enum bts_attribute str2btsattr(const char *s) -{ - return get_string_value(bts_attribute_names, s); -} - -const char *btsatttr2str(enum bts_attribute v) -{ - return get_value_string(bts_attribute_names, v); -} - -const struct value_string osmo_bts_variant_names[_NUM_BTS_VARIANT + 1] = { - { BTS_UNKNOWN, "unknown" }, - { BTS_OSMO_LITECELL15, "osmo-bts-lc15" }, - { BTS_OSMO_OCTPHY, "osmo-bts-octphy" }, - { BTS_OSMO_SYSMO, "osmo-bts-sysmo" }, - { BTS_OSMO_TRX, "omso-bts-trx" }, - { 0, NULL } -}; - -enum gsm_bts_type_variant str2btsvariant(const char *arg) -{ - return get_string_value(osmo_bts_variant_names, arg); -} - -const char *btsvariant2str(enum gsm_bts_type_variant v) -{ - return get_value_string(osmo_bts_variant_names, v); -} - -const struct value_string bts_type_names[_NUM_GSM_BTS_TYPE + 1] = { - { GSM_BTS_TYPE_UNKNOWN, "unknown" }, - { GSM_BTS_TYPE_BS11, "bs11" }, - { GSM_BTS_TYPE_NANOBTS, "nanobts" }, - { GSM_BTS_TYPE_RBS2000, "rbs2000" }, - { GSM_BTS_TYPE_NOKIA_SITE, "nokia_site" }, - { GSM_BTS_TYPE_OSMOBTS, "sysmobts" }, - { 0, NULL } -}; - -enum gsm_bts_type str2btstype(const char *arg) -{ - return get_string_value(bts_type_names, arg); -} - -const char *btstype2str(enum gsm_bts_type type) -{ - return get_value_string(bts_type_names, type); -} - -const struct value_string gsm_bts_features_descs[] = { - { BTS_FEAT_HSCSD, "HSCSD" }, - { BTS_FEAT_GPRS, "GPRS" }, - { BTS_FEAT_EGPRS, "EGPRS" }, - { BTS_FEAT_ECSD, "ECSD" }, - { BTS_FEAT_HOPPING, "Frequency Hopping" }, - { BTS_FEAT_MULTI_TSC, "Multi-TSC" }, - { BTS_FEAT_OML_ALERTS, "OML Alerts" }, - { BTS_FEAT_AGCH_PCH_PROP, "AGCH/PCH proportional allocation" }, - { BTS_FEAT_CBCH, "CBCH" }, - { 0, NULL } -}; - -const struct value_string gsm_chreq_descs[] = { - { GSM_CHREQ_REASON_EMERG, "emergency call" }, - { GSM_CHREQ_REASON_PAG, "answer to paging" }, - { GSM_CHREQ_REASON_CALL, "call re-establishment" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"Location updating" }, - { GSM_CHREQ_REASON_PDCH, "one phase packet access" }, - { GSM_CHREQ_REASON_OTHER, "other" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_names[13] = { - { GSM_PCHAN_NONE, "NONE" }, - { GSM_PCHAN_CCCH, "CCCH" }, - { GSM_PCHAN_CCCH_SDCCH4,"CCCH+SDCCH4" }, - { GSM_PCHAN_TCH_F, "TCH/F" }, - { GSM_PCHAN_TCH_H, "TCH/H" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "SDCCH8" }, - { GSM_PCHAN_PDCH, "PDCH" }, - { GSM_PCHAN_TCH_F_PDCH, "TCH/F_PDCH" }, - { GSM_PCHAN_UNKNOWN, "UNKNOWN" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "CCCH+SDCCH4+CBCH" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "SDCCH8+CBCH" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "TCH/F_TCH/H_PDCH" }, - { 0, NULL } -}; - -const struct value_string gsm_pchant_descs[13] = { - { GSM_PCHAN_NONE, "Physical Channel not configured" }, - { GSM_PCHAN_CCCH, "FCCH + SCH + BCCH + CCCH (Comb. IV)" }, - { GSM_PCHAN_CCCH_SDCCH4, - "FCCH + SCH + BCCH + CCCH + 4 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_TCH_F, "TCH/F + FACCH/F + SACCH (Comb. I)" }, - { GSM_PCHAN_TCH_H, "2 TCH/H + 2 FACCH/H + 2 SACCH (Comb. II)" }, - { GSM_PCHAN_SDCCH8_SACCH8C, "8 SDCCH + 4 SACCH (Comb. VII)" }, - { GSM_PCHAN_PDCH, "Packet Data Channel for GPRS/EDGE" }, - { GSM_PCHAN_TCH_F_PDCH, "Dynamic TCH/F or GPRS PDCH" }, - { GSM_PCHAN_UNKNOWN, "Unknown / Unsupported channel combination" }, - { GSM_PCHAN_CCCH_SDCCH4_CBCH, "FCCH + SCH + BCCH + CCCH + CBCH + 3 SDCCH + 2 SACCH (Comb. V)" }, - { GSM_PCHAN_SDCCH8_SACCH8C_CBCH, "7 SDCCH + 4 SACCH + CBCH (Comb. VII)" }, - { GSM_PCHAN_TCH_F_TCH_H_PDCH, "Dynamic TCH/F or TCH/H or GPRS PDCH" }, - { 0, NULL } -}; - -const char *gsm_pchan_name(enum gsm_phys_chan_config c) -{ - return get_value_string(gsm_pchant_names, c); -} - -enum gsm_phys_chan_config gsm_pchan_parse(const char *name) -{ - return get_string_value(gsm_pchant_names, name); -} - -/* TODO: move to libosmocore, next to gsm_chan_t_names? */ -const char *gsm_lchant_name(enum gsm_chan_t c) -{ - return get_value_string(gsm_chan_t_names, c); -} - -static const struct value_string lchan_s_names[] = { - { LCHAN_S_NONE, "NONE" }, - { LCHAN_S_ACT_REQ, "ACTIVATION REQUESTED" }, - { LCHAN_S_ACTIVE, "ACTIVE" }, - { LCHAN_S_INACTIVE, "INACTIVE" }, - { LCHAN_S_REL_REQ, "RELEASE REQUESTED" }, - { LCHAN_S_REL_ERR, "RELEASE DUE ERROR" }, - { LCHAN_S_BROKEN, "BROKEN UNUSABLE" }, - { 0, NULL } -}; - -const char *gsm_lchans_name(enum gsm_lchan_state s) -{ - return get_value_string(lchan_s_names, s); -} - -static const struct value_string chreq_names[] = { - { GSM_CHREQ_REASON_EMERG, "EMERGENCY" }, - { GSM_CHREQ_REASON_PAG, "PAGING" }, - { GSM_CHREQ_REASON_CALL, "CALL" }, - { GSM_CHREQ_REASON_LOCATION_UPD,"LOCATION_UPDATE" }, - { GSM_CHREQ_REASON_OTHER, "OTHER" }, - { 0, NULL } -}; - -const char *gsm_chreq_name(enum gsm_chreq_reason_t c) -{ - return get_value_string(chreq_names, c); -} - -struct gsm_bts *gsm_bts_num(struct gsm_network *net, int num) -{ - struct gsm_bts *bts; - - if (num >= net->num_bts) - return NULL; - - llist_for_each_entry(bts, &net->bts_list, list) { - if (bts->nr == num) - return bts; - } - - return NULL; -} - -struct gsm_bts_trx *gsm_bts_trx_alloc(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx = talloc_zero(bts, struct gsm_bts_trx); - int k; - - if (!trx) - return NULL; - - trx->bts = bts; - trx->nr = bts->num_trx++; - trx->mo.nm_state.administrative = NM_STATE_UNLOCKED; - - gsm_mo_init(&trx->mo, bts, NM_OC_RADIO_CARRIER, - bts->nr, trx->nr, 0xff); - gsm_mo_init(&trx->bb_transc.mo, bts, NM_OC_BASEB_TRANSC, - bts->nr, trx->nr, 0xff); - - for (k = 0; k < TRX_NR_TS; k++) { - struct gsm_bts_trx_ts *ts = &trx->ts[k]; - int l; - - ts->trx = trx; - ts->nr = k; - ts->pchan = GSM_PCHAN_NONE; - ts->dyn.pchan_is = GSM_PCHAN_NONE; - ts->dyn.pchan_want = GSM_PCHAN_NONE; - ts->tsc = -1; - - gsm_mo_init(&ts->mo, bts, NM_OC_CHANNEL, - bts->nr, trx->nr, ts->nr); - - ts->hopping.arfcns.data_len = sizeof(ts->hopping.arfcns_data); - ts->hopping.arfcns.data = ts->hopping.arfcns_data; - ts->hopping.ma.data_len = sizeof(ts->hopping.ma_data); - ts->hopping.ma.data = ts->hopping.ma_data; - - for (l = 0; l < TS_MAX_LCHAN; l++) { - struct gsm_lchan *lchan; - char *name; - lchan = &ts->lchan[l]; - - lchan->ts = ts; - lchan->nr = l; - lchan->type = GSM_LCHAN_NONE; - - name = gsm_lchan_name_compute(lchan); - lchan->name = talloc_strdup(trx, name); -#ifndef ROLE_BSC - INIT_LLIST_HEAD(&lchan->sapi_cmds); -#endif - } - } - - if (trx->nr != 0) - trx->nominal_power = bts->c0->nominal_power; - - llist_add_tail(&trx->list, &bts->trx_list); - - return trx; -} - - -static const uint8_t bts_nse_timer_default[] = { 3, 3, 3, 3, 30, 3, 10 }; -static const uint8_t bts_cell_timer_default[] = - { 3, 3, 3, 3, 3, 10, 3, 10, 3, 10, 3 }; -static const struct gprs_rlc_cfg rlc_cfg_default = { - .parameter = { - [RLC_T3142] = 20, - [RLC_T3169] = 5, - [RLC_T3191] = 5, - [RLC_T3193] = 160, /* 10ms */ - [RLC_T3195] = 5, - [RLC_N3101] = 10, - [RLC_N3103] = 4, - [RLC_N3105] = 8, - [CV_COUNTDOWN] = 15, - [T_DL_TBF_EXT] = 250 * 10, /* ms */ - [T_UL_TBF_EXT] = 250 * 10, /* ms */ - }, - .paging = { - .repeat_time = 5 * 50, /* ms */ - .repeat_count = 3, - }, - .cs_mask = 0x1fff, - .initial_cs = 2, - .initial_mcs = 6, -}; - -struct gsm_bts *gsm_bts_alloc(void *ctx, uint8_t bts_num) -{ - struct gsm_bts *bts = talloc_zero(ctx, struct gsm_bts); - int i; - - if (!bts) - return NULL; - - bts->nr = bts_num; - bts->num_trx = 0; - INIT_LLIST_HEAD(&bts->trx_list); - bts->ms_max_power = 15; /* dBm */ - - gsm_mo_init(&bts->mo, bts, NM_OC_BTS, - bts->nr, 0xff, 0xff); - gsm_mo_init(&bts->site_mgr.mo, bts, NM_OC_SITE_MANAGER, - 0xff, 0xff, 0xff); - - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) { - bts->gprs.nsvc[i].bts = bts; - bts->gprs.nsvc[i].id = i; - gsm_mo_init(&bts->gprs.nsvc[i].mo, bts, NM_OC_GPRS_NSVC, - bts->nr, i, 0xff); - } - memcpy(&bts->gprs.nse.timer, bts_nse_timer_default, - sizeof(bts->gprs.nse.timer)); - gsm_mo_init(&bts->gprs.nse.mo, bts, NM_OC_GPRS_NSE, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.timer, bts_cell_timer_default, - sizeof(bts->gprs.cell.timer)); - gsm_mo_init(&bts->gprs.cell.mo, bts, NM_OC_GPRS_CELL, - bts->nr, 0xff, 0xff); - memcpy(&bts->gprs.cell.rlc_cfg, &rlc_cfg_default, - sizeof(bts->gprs.cell.rlc_cfg)); - - /* create our primary TRX */ - bts->c0 = gsm_bts_trx_alloc(bts); - if (!bts->c0) { - talloc_free(bts); - return NULL; - } - bts->c0->ts[0].pchan = GSM_PCHAN_CCCH_SDCCH4; - - bts->rach_b_thresh = -1; - bts->rach_ldavg_slots = -1; - bts->paging.free_chans_need = -1; - bts->features.data = &bts->_features_data[0]; - bts->features.data_len = sizeof(bts->_features_data); - - /* si handling */ - bts->bcch_change_mark = 1; - - return bts; -} - -/* reset the state of all MO in the BTS */ -void gsm_bts_mo_reset(struct gsm_bts *bts) -{ - struct gsm_bts_trx *trx; - unsigned int i; - - gsm_abis_mo_reset(&bts->mo); - gsm_abis_mo_reset(&bts->site_mgr.mo); - for (i = 0; i < ARRAY_SIZE(bts->gprs.nsvc); i++) - gsm_abis_mo_reset(&bts->gprs.nsvc[i].mo); - gsm_abis_mo_reset(&bts->gprs.nse.mo); - gsm_abis_mo_reset(&bts->gprs.cell.mo); - - llist_for_each_entry(trx, &bts->trx_list, list) { - gsm_abis_mo_reset(&trx->mo); - gsm_abis_mo_reset(&trx->bb_transc.mo); - - for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { - struct gsm_bts_trx_ts *ts = &trx->ts[i]; - gsm_abis_mo_reset(&ts->mo); - } - } -} - -struct gsm_bts_trx *gsm_bts_trx_num(const struct gsm_bts *bts, int num) -{ - struct gsm_bts_trx *trx; - - if (num >= bts->num_trx) - return NULL; - - llist_for_each_entry(trx, &bts->trx_list, list) { - if (trx->nr == num) - return trx; - } - - return NULL; -} - -static char ts2str[255]; - -char *gsm_trx_name(const struct gsm_bts_trx *trx) -{ - if (!trx) - snprintf(ts2str, sizeof(ts2str), "(trx=NULL)"); - else - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d)", - trx->bts->nr, trx->nr); - - return ts2str; -} - - -char *gsm_ts_name(const struct gsm_bts_trx_ts *ts) -{ - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr); - - return ts2str; -} - -/*! Log timeslot number with full pchan information */ -char *gsm_ts_and_pchan_name(const struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - if (ts->dyn.pchan_is == ts->dyn.pchan_want) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is)); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - gsm_pchan_name(ts->dyn.pchan_is), - gsm_pchan_name(ts->dyn.pchan_want)); - break; - case GSM_PCHAN_TCH_F_PDCH: - if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s as %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F"); - else - snprintf(ts2str, sizeof(ts2str), - "(bts=%d,trx=%d,ts=%d,pchan=%s" - " switching %s -> %s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan), - (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" - : "TCH/F", - (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" - : "TCH/F"); - break; - default: - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,pchan=%s)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, - gsm_pchan_name(ts->pchan)); - break; - } - - return ts2str; -} - -char *gsm_lchan_name_compute(const struct gsm_lchan *lchan) -{ - struct gsm_bts_trx_ts *ts = lchan->ts; - - snprintf(ts2str, sizeof(ts2str), "(bts=%d,trx=%d,ts=%d,ss=%d)", - ts->trx->bts->nr, ts->trx->nr, ts->nr, lchan->nr); - - return ts2str; -} - -/* obtain the MO structure for a given object instance */ -struct gsm_abis_mo * -gsm_objclass2mo(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - struct gsm_abis_mo *mo = NULL; - - switch (obj_class) { - case NM_OC_BTS: - mo = &bts->mo; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->mo; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bb_transc.mo; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - mo = &trx->ts[obj_inst->ts_nr].mo; - break; - case NM_OC_SITE_MANAGER: - mo = &bts->site_mgr.mo; - break; - case NM_OC_BS11: - switch (obj_inst->bts_nr) { - case BS11_OBJ_CCLK: - mo = &bts->bs11.cclk.mo; - break; - case BS11_OBJ_BBSIG: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.bbsig.mo; - break; - case BS11_OBJ_PA: - if (obj_inst->ts_nr > bts->num_trx) - return NULL; - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - mo = &trx->bs11.pa.mo; - break; - default: - return NULL; - } - break; - case NM_OC_BS11_RACK: - mo = &bts->bs11.rack.mo; - break; - case NM_OC_BS11_ENVABTSE: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->bs11.envabtse)) - return NULL; - mo = &bts->bs11.envabtse[obj_inst->trx_nr].mo; - break; - case NM_OC_GPRS_NSE: - mo = &bts->gprs.nse.mo; - break; - case NM_OC_GPRS_CELL: - mo = &bts->gprs.cell.mo; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - mo = &bts->gprs.nsvc[obj_inst->trx_nr].mo; - break; - } - return mo; -} - -/* obtain the gsm_nm_state data structure for a given object instance */ -struct gsm_nm_state * -gsm_objclass2nmstate(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_abis_mo *mo; - - mo = gsm_objclass2mo(bts, obj_class, obj_inst); - if (!mo) - return NULL; - - return &mo->nm_state; -} - -/* obtain the in-memory data structure of a given object instance */ -void * -gsm_objclass2obj(struct gsm_bts *bts, uint8_t obj_class, - const struct abis_om_obj_inst *obj_inst) -{ - struct gsm_bts_trx *trx; - void *obj = NULL; - - switch (obj_class) { - case NM_OC_BTS: - obj = bts; - break; - case NM_OC_RADIO_CARRIER: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = trx; - break; - case NM_OC_BASEB_TRANSC: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - obj = &trx->bb_transc; - break; - case NM_OC_CHANNEL: - if (obj_inst->trx_nr >= bts->num_trx) { - return NULL; - } - trx = gsm_bts_trx_num(bts, obj_inst->trx_nr); - if (obj_inst->ts_nr >= TRX_NR_TS) - return NULL; - obj = &trx->ts[obj_inst->ts_nr]; - break; - case NM_OC_SITE_MANAGER: - obj = &bts->site_mgr; - break; - case NM_OC_GPRS_NSE: - obj = &bts->gprs.nse; - break; - case NM_OC_GPRS_CELL: - obj = &bts->gprs.cell; - break; - case NM_OC_GPRS_NSVC: - if (obj_inst->trx_nr >= ARRAY_SIZE(bts->gprs.nsvc)) - return NULL; - obj = &bts->gprs.nsvc[obj_inst->trx_nr]; - break; - } - return obj; -} - -/* See Table 10.5.25 of GSM04.08 */ -uint8_t gsm_pchan2chan_nr(enum gsm_phys_chan_config pchan, - uint8_t ts_nr, uint8_t lchan_nr) -{ - uint8_t cbits, chan_nr; - - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_F_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = 0x01; - break; - case GSM_PCHAN_PDCH: - OSMO_ASSERT(lchan_nr == 0); - cbits = RSL_CHAN_OSMO_PDCH >> 3; - break; - case GSM_PCHAN_TCH_H: - OSMO_ASSERT(lchan_nr < 2); - cbits = 0x02; - cbits += lchan_nr; - break; - case GSM_PCHAN_CCCH_SDCCH4: - case GSM_PCHAN_CCCH_SDCCH4_CBCH: - /* - * As a special hack for BCCH, lchan_nr == 4 may be passed - * here. This should never be sent in an RSL message. - * See osmo-bts-xxx/oml.c:opstart_compl(). - */ - if (lchan_nr == CCCH_LCHAN) - chan_nr = 0; - else - OSMO_ASSERT(lchan_nr < 4); - cbits = 0x04; - cbits += lchan_nr; - break; - case GSM_PCHAN_SDCCH8_SACCH8C: - case GSM_PCHAN_SDCCH8_SACCH8C_CBCH: - OSMO_ASSERT(lchan_nr < 8); - cbits = 0x08; - cbits += lchan_nr; - break; - default: - case GSM_PCHAN_CCCH: -#ifdef ROLE_BSC - OSMO_ASSERT(lchan_nr == 0); -#else - /* - * FIXME: On octphy and litecell, we hit above assertion (see - * Max's comment at https://gerrit.osmocom.org/589 ); disabled - * for BTS until this is clarified; remove the #ifdef when it - * is fixed. - */ -#warning "fix caller that passes lchan_nr != 0" -#endif - cbits = 0x10; - break; - } - - chan_nr = (cbits << 3) | (ts_nr & 0x7); - - return chan_nr; -} - -uint8_t gsm_lchan2chan_nr(const struct gsm_lchan *lchan) -{ - enum gsm_phys_chan_config pchan = lchan->ts->pchan; - if (pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) - return gsm_lchan_as_pchan2chan_nr(lchan, - lchan->ts->dyn.pchan_is); - return gsm_pchan2chan_nr(lchan->ts->pchan, lchan->ts->nr, lchan->nr); -} - -uint8_t gsm_lchan_as_pchan2chan_nr(const struct gsm_lchan *lchan, - enum gsm_phys_chan_config as_pchan) -{ - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && as_pchan == GSM_PCHAN_PDCH) - return RSL_CHAN_OSMO_PDCH | (lchan->ts->nr & ~RSL_CHAN_NR_MASK); - return gsm_pchan2chan_nr(as_pchan, lchan->ts->nr, lchan->nr); -} - -/* return the gsm_lchan for the CBCH (if it exists at all) */ -struct gsm_lchan *gsm_bts_get_cbch(struct gsm_bts *bts) -{ - struct gsm_lchan *lchan = NULL; - struct gsm_bts_trx *trx = bts->c0; - - if (trx->ts[0].pchan == GSM_PCHAN_CCCH_SDCCH4_CBCH) - lchan = &trx->ts[0].lchan[2]; - else { - int i; - for (i = 0; i < 8; i++) { - if (trx->ts[i].pchan == GSM_PCHAN_SDCCH8_SACCH8C_CBCH) { - lchan = &trx->ts[i].lchan[2]; - break; - } - } - } - - return lchan; -} - -/* determine logical channel based on TRX and channel number IE */ -struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr, - int *rc) -{ - uint8_t ts_nr = chan_nr & 0x07; - uint8_t cbits = chan_nr >> 3; - uint8_t lch_idx; - struct gsm_bts_trx_ts *ts = &trx->ts[ts_nr]; - bool ok = true; - - if (rc) - *rc = -EINVAL; - - if (cbits == 0x01) { - lch_idx = 0; /* TCH/F */ - if (ts->pchan != GSM_PCHAN_TCH_F && - ts->pchan != GSM_PCHAN_PDCH && - ts->pchan != GSM_PCHAN_TCH_F_PDCH - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_F - || ts->dyn.pchan_want == GSM_PCHAN_TCH_F))) - ok = false; - } else if ((cbits & 0x1e) == 0x02) { - lch_idx = cbits & 0x1; /* TCH/H */ - if (ts->pchan != GSM_PCHAN_TCH_H - && !(ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH - && (ts->dyn.pchan_is == GSM_PCHAN_TCH_H - || ts->dyn.pchan_want == GSM_PCHAN_TCH_H))) - ok = false; - } else if ((cbits & 0x1c) == 0x04) { - lch_idx = cbits & 0x3; /* SDCCH/4 */ - if (ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - } else if ((cbits & 0x18) == 0x08) { - lch_idx = cbits & 0x7; /* SDCCH/8 */ - if (ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C && - ts->pchan != GSM_PCHAN_SDCCH8_SACCH8C_CBCH) - ok = false; - } else if (cbits == 0x10 || cbits == 0x11 || cbits == 0x12) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_CCCH && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4 && - ts->pchan != GSM_PCHAN_CCCH_SDCCH4_CBCH) - ok = false; - /* FIXME: we should not return first sdcch4 !!! */ - } else if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH) { - lch_idx = 0; - if (ts->pchan != GSM_PCHAN_TCH_F_TCH_H_PDCH) - ok = false; - } else - return NULL; - - if (rc && ok) - *rc = 0; - - return &ts->lchan[lch_idx]; -} - -static const uint8_t subslots_per_pchan[] = { - [GSM_PCHAN_NONE] = 0, - [GSM_PCHAN_CCCH] = 0, - [GSM_PCHAN_PDCH] = 0, - [GSM_PCHAN_CCCH_SDCCH4] = 4, - [GSM_PCHAN_TCH_F] = 1, - [GSM_PCHAN_TCH_H] = 2, - [GSM_PCHAN_SDCCH8_SACCH8C] = 8, - [GSM_PCHAN_CCCH_SDCCH4_CBCH] = 4, - [GSM_PCHAN_SDCCH8_SACCH8C_CBCH] = 8, - /* - * GSM_PCHAN_TCH_F_PDCH and GSM_PCHAN_TCH_F_TCH_H_PDCH should not be - * part of this, those TS are handled according to their dynamic state. - */ -}; - -/*! Return the actual pchan type, also heeding dynamic TS. */ -enum gsm_phys_chan_config ts_pchan(struct gsm_bts_trx_ts *ts) -{ - switch (ts->pchan) { - case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return ts->dyn.pchan_is; - case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return GSM_PCHAN_PDCH; - else - return GSM_PCHAN_TCH_F; - default: - return ts->pchan; - } -} - -/*! According to ts->pchan and possibly ts->dyn_pchan, return the number of - * logical channels available in the timeslot. */ -uint8_t ts_subslots(struct gsm_bts_trx_ts *ts) -{ - return subslots_per_pchan[ts_pchan(ts)]; -} - -static bool pchan_is_tch(enum gsm_phys_chan_config pchan) -{ - switch (pchan) { - case GSM_PCHAN_TCH_F: - case GSM_PCHAN_TCH_H: - return true; - default: - return false; - } -} - -bool ts_is_tch(struct gsm_bts_trx_ts *ts) -{ - return pchan_is_tch(ts_pchan(ts)); -} diff --git a/src/libcommon/talloc_ctx.c b/src/libcommon/talloc_ctx.c index c8e9cd3..ccda0d0 100644 --- a/src/libcommon/talloc_ctx.c +++ b/src/libcommon/talloc_ctx.c @@ -21,35 +21,18 @@ #include extern void *tall_bsc_ctx; -extern void *tall_fle_ctx; -extern void *tall_locop_ctx; -extern void *tall_authciphop_ctx; extern void *tall_gsms_ctx; extern void *tall_subscr_ctx; -extern void *tall_sub_req_ctx; extern void *tall_call_ctx; -extern void *tall_paging_ctx; extern void *tall_sigh_ctx; -extern void *tall_tqe_ctx; extern void *tall_trans_ctx; -extern void *tall_map_ctx; -extern void *tall_upq_ctx; -extern void *tall_ctr_ctx; void talloc_ctx_init(void *ctx_root) { msgb_talloc_ctx_init(ctx_root, 0); - tall_fle_ctx = talloc_named_const(ctx_root, 0, "bs11_file_list_entry"); - tall_locop_ctx = talloc_named_const(ctx_root, 0, "loc_updating_oper"); - tall_authciphop_ctx = talloc_named_const(ctx_root, 0, "auth_ciph_oper"); tall_gsms_ctx = talloc_named_const(ctx_root, 0, "sms"); tall_subscr_ctx = talloc_named_const(ctx_root, 0, "subscriber"); tall_call_ctx = talloc_named_const(ctx_root, 0, "gsm_call"); - tall_paging_ctx = talloc_named_const(ctx_root, 0, "paging_request"); tall_sigh_ctx = talloc_named_const(ctx_root, 0, "signal_handler"); - tall_tqe_ctx = talloc_named_const(ctx_root, 0, "subch_txq_entry"); tall_trans_ctx = talloc_named_const(ctx_root, 0, "transaction"); - tall_map_ctx = talloc_named_const(ctx_root, 0, "trau_map_entry"); - tall_upq_ctx = talloc_named_const(ctx_root, 0, "trau_upq_entry"); - tall_ctr_ctx = talloc_named_const(ctx_root, 0, "counter"); } diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 956bc44..7afd0c7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -43,18 +43,12 @@ #include #include #include -#include -#include #include -#include -#include -#include #include #include #include #include #include -#include #include #include #include diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index d8d77e9..e67531e 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -48,12 +48,10 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include @@ -352,7 +350,7 @@ vlr_subscr_name(conn->vsub), rc); rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + rate_ctr_inc(&conn->network->msc_ctrs->ctr[ MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); } return rc; @@ -380,7 +378,7 @@ vlr_subscr_name(conn->vsub), rc); rc = GSM411_RP_CAUSE_MO_TEMP_FAIL; /* rc will be logged by gsm411_send_rp_error() */ - rate_ctr_inc(&conn->bts->network->msc_ctrs->ctr[ + rate_ctr_inc(&conn->network->msc_ctrs->ctr[ MSC_CTR_SMS_DELIVER_UNKNOWN_ERROR]); } #else diff --git a/src/libmsc/gsm_04_14.c b/src/libmsc/gsm_04_14.c index 5f49574..6d75bba 100644 --- a/src/libmsc/gsm_04_14.c +++ b/src/libmsc/gsm_04_14.c @@ -75,7 +75,6 @@ subch = (loop_mode << 1); msgb_put_u8(msg, subch); - msg->lchan = conn->lchan; return gsm0414_conn_sendmsg(conn, msg); } diff --git a/src/libmsc/gsm_subscriber.c b/src/libmsc/gsm_subscriber.c index 4838027..fb61209 100644 --- a/src/libmsc/gsm_subscriber.c +++ b/src/libmsc/gsm_subscriber.c @@ -45,7 +45,6 @@ #include #include #include -#include #include #include #include diff --git a/src/libmsc/mncc.c b/src/libmsc/mncc.c index 3b4c41d..d2cd170 100644 --- a/src/libmsc/mncc.c +++ b/src/libmsc/mncc.c @@ -34,7 +34,6 @@ #include #include #include -#include static const struct value_string mncc_names[] = { diff --git a/src/libmsc/mncc_builtin.c b/src/libmsc/mncc_builtin.c index 84623df..d6f3e3d 100644 --- a/src/libmsc/mncc_builtin.c +++ b/src/libmsc/mncc_builtin.c @@ -34,7 +34,6 @@ #include #include #include -#include void *tall_call_ctx; diff --git a/src/libmsc/rrlp.c b/src/libmsc/rrlp.c index 7428893..9cc6b04 100644 --- a/src/libmsc/rrlp.c +++ b/src/libmsc/rrlp.c @@ -24,7 +24,6 @@ #include #include #include -#include /* RRLP msPositionReq, nsBased, * Accuracy=60, Method=gps, ResponseTime=2, oneSet */ diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c index d715d5c..f3291d7 100644 --- a/src/libmsc/silent_call.c +++ b/src/libmsc/silent_call.c @@ -29,8 +29,6 @@ #include #include #include -#include -#include #include /* paging of the requested subscriber has completed */ diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 3ea5ddd..4e2fb55 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -44,7 +44,6 @@ #include #include #include -#include #include #include "smpp_smsc.h" diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 1372a2c..3d39a0e 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -31,7 +31,6 @@ #include #include -#include #include #include #include diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index dbd826d..f8fc098 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -35,8 +35,6 @@ #include #include #include -#include -#include #include #include #include @@ -46,10 +44,9 @@ #include #include #include -#include +#include #include #include -#include #include #include diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 0d23697..f41df01 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -54,7 +54,6 @@ #include #include #include -#include #include #include #include @@ -89,10 +88,7 @@ /* satisfy deps from libbsc legacy. TODO double check these */ -void *tall_fle_ctx = NULL; -void *tall_paging_ctx = NULL; void *tall_map_ctx = NULL; -void *tall_upq_ctx = NULL; /* end deps from libbsc legacy. */ static struct { diff --git a/tests/msc_vlr/msc_vlr_test_rest.c b/tests/msc_vlr/msc_vlr_test_rest.c index c5f7fcf..c19c4c6 100644 --- a/tests/msc_vlr/msc_vlr_test_rest.c +++ b/tests/msc_vlr/msc_vlr_test_rest.c @@ -32,7 +32,6 @@ btw("freshly allocated conn"); g_conn = msc_subscr_con_allocate(net); - g_conn->bts = the_bts; EXPECT_ACCEPTED(false); btw("conn_fsm present, in state NEW"); diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index cf9122b..2152fe4 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -49,8 +49,6 @@ struct gsm_network *net = NULL; -struct gsm_bts *the_bts; - const char *gsup_tx_expected = NULL; bool gsup_tx_confirmed; @@ -160,7 +158,6 @@ { struct gsm_subscriber_connection *conn; conn = msc_subscr_con_allocate(net); - conn->bts = the_bts; conn->via_ran = rx_from_ran; conn->lac = 23; if (conn->via_ran == RAN_UTRAN_IU) { @@ -866,8 +863,6 @@ } printf("Done\n"); - - talloc_free(the_bts); check_talloc(msgb_ctx, tall_bsc_ctx, 8); return 0; -- To view, visit https://gerrit.osmocom.org/6051 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I247def85da2dc3ec461389fb74414a0d964e7e3c Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:39:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:39:23 +0000 Subject: [MERGED] osmo-msc[master]: jenkins.sh: Don't depend on osmo-ggsn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: jenkins.sh: Don't depend on osmo-ggsn ...................................................................... jenkins.sh: Don't depend on osmo-ggsn There's nothing GPRS related left in osmo-msc, and hence no reason why we should build osmo-ggsn as a build dependency. Change-Id: I096f63e471dc8fdbd42a78f67d433f61b830615b --- M contrib/jenkins.sh 1 file changed, 0 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 e4f90e6..d80422d 100755 --- a/contrib/jenkins.sh +++ b/contrib/jenkins.sh @@ -29,7 +29,6 @@ osmo-build-dep.sh libosmo-netif osmo-build-dep.sh libosmo-sccp PARALLEL_MAKE="" osmo-build-dep.sh libsmpp34 -osmo-build-dep.sh osmo-ggsn osmo-build-dep.sh osmo-mgw if [ "x$IU" = "x--enable-iu" ]; then -- To view, visit https://gerrit.osmocom.org/6052 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I096f63e471dc8fdbd42a78f67d433f61b830615b Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:43:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:43:21 +0000 Subject: osmo-msc[master]: remove unused ipaccess.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:43:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:43:24 +0000 Subject: osmo-msc[master]: remove dead code in auth.h / auth.c In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:43:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:43:27 +0000 Subject: osmo-msc[master]: remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_r... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I13cc4513689af1d594952dd628738b1240560bb7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:43:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:43:32 +0000 Subject: osmo-msc[master]: signal.h: Remove unused/dead signal definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:43:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:43:36 +0000 Subject: osmo-msc[master]: remove dead ctrl.h header file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 24 23:43:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 24 Jan 2018 23:43:41 +0000 Subject: osmo-msc[master]: debug: Remove dead log categories In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 00:51:55 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Thu, 25 Jan 2018 00:51:55 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: Makefile.am whitespace Message-ID: Review at https://gerrit.osmocom.org/6060 cosmetic: Makefile.am whitespace Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936 --- M tests/handover/Makefile.am M tests/meas/Makefile.am M tests/tx_power/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/60/6060/1 diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 8bff297..5757699 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = handover_test EXTRA_DIST = handover_test.ok diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am index 895d474..266f5e7 100644 --- a/tests/meas/Makefile.am +++ b/tests/meas/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = meas_test noinst_HEADERS = sysmobts_fr_samples.h diff --git a/tests/tx_power/Makefile.am b/tests/tx_power/Makefile.am index 349958c..5848c71 100644 --- a/tests/tx_power/Makefile.am +++ b/tests/tx_power/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = tx_power_test EXTRA_DIST = tx_power_test.ok tx_power_test.err -- To view, visit https://gerrit.osmocom.org/6060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer From gerrit-no-reply at lists.osmocom.org Thu Jan 25 00:51:57 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Thu, 25 Jan 2018 00:51:57 +0000 Subject: [PATCH] osmo-bts[master]: various Makefile.am: add missing CFLAGS Message-ID: Review at https://gerrit.osmocom.org/6061 various Makefile.am: add missing CFLAGS Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f --- M tests/handover/Makefile.am M tests/meas/Makefile.am M tests/tx_power/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/6061/1 diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 5757699..966ea46 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = handover_test EXTRA_DIST = handover_test.ok diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am index 266f5e7..3c83e52 100644 --- a/tests/meas/Makefile.am +++ b/tests/meas/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = meas_test noinst_HEADERS = sysmobts_fr_samples.h diff --git a/tests/tx_power/Makefile.am b/tests/tx_power/Makefile.am index 5848c71..cd7ccc2 100644 --- a/tests/tx_power/Makefile.am +++ b/tests/tx_power/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = tx_power_test EXTRA_DIST = tx_power_test.ok tx_power_test.err -- To view, visit https://gerrit.osmocom.org/6061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer From gerrit-no-reply at lists.osmocom.org Thu Jan 25 00:51:58 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Thu, 25 Jan 2018 00:51:58 +0000 Subject: [PATCH] osmo-bts[master]: gitignore: add missing entries Message-ID: Review at https://gerrit.osmocom.org/6062 gitignore: add missing entries Change-Id: I509e564a82b6632c0cdf052526e9f7f3397155ce --- M .gitignore 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/62/6062/1 diff --git a/.gitignore b/.gitignore index 1780e1c..69e2c36 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,14 @@ install-sh missing stamp-h1 +libtool +ltmain.sh core core.* + +# git-version-gen magic +.tarball-version +.version src/osmo-bts-sysmo/sysmobts-calib src/osmo-bts-sysmo/l1fwd-proxy @@ -46,6 +52,7 @@ tests/paging/paging_test tests/cipher/cipher_test tests/sysmobts/sysmobts_test +tests/meas/meas_test tests/misc/misc_test tests/handover/handover_test tests/tx_power/tx_power_test -- To view, visit https://gerrit.osmocom.org/6062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I509e564a82b6632c0cdf052526e9f7f3397155ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:50:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:50:21 +0000 Subject: osmo-bts[master]: gitignore: add missing entries In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I509e564a82b6632c0cdf052526e9f7f3397155ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:50:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:50:43 +0000 Subject: osmo-bts[master]: various Makefile.am: add missing CFLAGS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:50:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:50:54 +0000 Subject: osmo-bts[master]: cosmetic: Makefile.am whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:01 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: Makefile.am whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: Makefile.am whitespace ...................................................................... cosmetic: Makefile.am whitespace Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936 --- M tests/handover/Makefile.am M tests/meas/Makefile.am M tests/tx_power/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 8bff297..5757699 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = handover_test EXTRA_DIST = handover_test.ok diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am index 895d474..266f5e7 100644 --- a/tests/meas/Makefile.am +++ b/tests/meas/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = meas_test noinst_HEADERS = sysmobts_fr_samples.h diff --git a/tests/tx_power/Makefile.am b/tests/tx_power/Makefile.am index 349958c..5848c71 100644 --- a/tests/tx_power/Makefile.am +++ b/tests/tx_power/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS)$(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = tx_power_test EXTRA_DIST = tx_power_test.ok tx_power_test.err -- To view, visit https://gerrit.osmocom.org/6060 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:02 +0000 Subject: [MERGED] osmo-bts[master]: various Makefile.am: add missing CFLAGS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: various Makefile.am: add missing CFLAGS ...................................................................... various Makefile.am: add missing CFLAGS Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f --- M tests/handover/Makefile.am M tests/meas/Makefile.am M tests/tx_power/Makefile.am 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/handover/Makefile.am b/tests/handover/Makefile.am index 5757699..966ea46 100644 --- a/tests/handover/Makefile.am +++ b/tests/handover/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = handover_test EXTRA_DIST = handover_test.ok diff --git a/tests/meas/Makefile.am b/tests/meas/Makefile.am index 266f5e7..3c83e52 100644 --- a/tests/meas/Makefile.am +++ b/tests/meas/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = meas_test noinst_HEADERS = sysmobts_fr_samples.h diff --git a/tests/tx_power/Makefile.am b/tests/tx_power/Makefile.am index 5848c71..cd7ccc2 100644 --- a/tests/tx_power/Makefile.am +++ b/tests/tx_power/Makefile.am @@ -1,5 +1,5 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) noinst_PROGRAMS = tx_power_test EXTRA_DIST = tx_power_test.ok tx_power_test.err -- To view, visit https://gerrit.osmocom.org/6061 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:03 +0000 Subject: [MERGED] osmo-bts[master]: gitignore: add missing entries In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gitignore: add missing entries ...................................................................... gitignore: add missing entries Change-Id: I509e564a82b6632c0cdf052526e9f7f3397155ce --- M .gitignore 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 1780e1c..69e2c36 100644 --- a/.gitignore +++ b/.gitignore @@ -19,8 +19,14 @@ install-sh missing stamp-h1 +libtool +ltmain.sh core core.* + +# git-version-gen magic +.tarball-version +.version src/osmo-bts-sysmo/sysmobts-calib src/osmo-bts-sysmo/l1fwd-proxy @@ -46,6 +52,7 @@ tests/paging/paging_test tests/cipher/cipher_test tests/sysmobts/sysmobts_test +tests/meas/meas_test tests/misc/misc_test tests/handover/handover_test tests/tx_power/tx_power_test -- To view, visit https://gerrit.osmocom.org/6062 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I509e564a82b6632c0cdf052526e9f7f3397155ce Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:30 +0000 Subject: [MERGED] osmo-msc[master]: remove unused ipaccess.h In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove unused ipaccess.h ...................................................................... remove unused ipaccess.h Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95 Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/ipaccess.h 2 files changed, 0 insertions(+), 53 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index cb19186..0adc746 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -18,7 +18,6 @@ gsm_data_shared.h \ gsm_subscriber.h \ gsup_client.h \ - ipaccess.h \ iucs.h \ iucs_ranap.h \ iu_dummy.h \ diff --git a/include/osmocom/msc/ipaccess.h b/include/osmocom/msc/ipaccess.h deleted file mode 100644 index 82e89c2..0000000 --- a/include/osmocom/msc/ipaccess.h +++ /dev/null @@ -1,52 +0,0 @@ -#ifndef _IPACCESS_H -#define _IPACCESS_H - -#include -#include "gsm_subscriber.h" -#include -#include -#include - -struct ipac_msgt_sccp_state { - uint8_t src_ref[3]; - uint8_t dst_ref[3]; - uint8_t trans_id; - uint8_t invoke_id; - char imsi[GSM23003_IMSI_MAX_DIGITS+1]; - uint8_t data[0]; -} __attribute__((packed)); - -/* - * @add_remove 0 for remove, 1 for add, 3 to asK - * @nr_lacs Number of extra lacs inside this package - * @lac One lac entry - */ -struct ipac_ext_lac_cmd { - uint8_t add_remove; - uint8_t nr_extra_lacs; - uint16_t lac; - uint8_t data[0]; -} __attribute__((packed)); - -void ipaccess_drop_oml(struct gsm_bts *bts); -void ipaccess_drop_rsl(struct gsm_bts_trx *trx); - -struct sdp_header_item { - struct sdp_header_entry header_entry; - struct llist_head entry; - off_t absolute_offset; -}; - -struct sdp_header { - struct sdp_firmware firmware_info; - - /* for more_magic a list of sdp_header_entry_list */ - struct llist_head header_list; - - /* the entry of the sdp_header */ - struct llist_head entry; -}; - -int ipaccess_analyze_file(int fd, const unsigned int st_size, const unsigned base_offset, struct llist_head *list); - -#endif /* _IPACCESS_H */ -- To view, visit https://gerrit.osmocom.org/6054 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibee159a119a1cce2b3fcbdabf3491673aed4ea95 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:32 +0000 Subject: [MERGED] osmo-msc[master]: signal.h: Remove unused/dead signal definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: signal.h: Remove unused/dead signal definitions ...................................................................... signal.h: Remove unused/dead signal definitions Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9 Related: OS#2528 --- M include/osmocom/msc/signal.h 1 file changed, 0 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/signal.h b/include/osmocom/msc/signal.h index 29b6a59..e854a64 100644 --- a/include/osmocom/msc/signal.h +++ b/include/osmocom/msc/signal.h @@ -37,8 +37,6 @@ SS_SMS, SS_SUBSCR, SS_SCALL, - SS_MSC, - SS_CCCH, }; /* SS_PAGING signals */ @@ -100,18 +98,6 @@ struct gsm_sms *sms; /* int paging result. Only the ones with > 0 */ int paging_result; -}; - -/* MSC signals */ -enum signal_msc { - S_MSC_LOST, - S_MSC_CONNECTED, - S_MSC_AUTHENTICATED, -}; - -struct bsc_msc_data; -struct msc_signal_data { - struct bsc_msc_data *data; }; #endif -- To view, visit https://gerrit.osmocom.org/6057 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba5be82e11fa1d5e5514bc86d8ec23cda24ae4c9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:32 +0000 Subject: [MERGED] osmo-msc[master]: remove dead ctrl.h header file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove dead ctrl.h header file ...................................................................... remove dead ctrl.h header file Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419 Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/ctrl.h M src/osmo-msc/msc_main.c 3 files changed, 0 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 7e86b12..ec231d0 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -4,7 +4,6 @@ bsc_api.h \ common.h \ common_cs.h \ - ctrl.h \ db.h \ debug.h \ gsm_04_08.h \ diff --git a/include/osmocom/msc/ctrl.h b/include/osmocom/msc/ctrl.h deleted file mode 100644 index c5ac210..0000000 --- a/include/osmocom/msc/ctrl.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -struct ctrl_handle *bsc_controlif_setup(struct gsm_network *net, - const char *bind_addr, uint16_t port); diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index 9fa98f3..a4b833e 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -57,7 +57,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/6058 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ea0d98580085982ec0f20165c0ddcfd439e7419 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:32 +0000 Subject: [MERGED] osmo-msc[master]: remove dead code in auth.h / auth.c In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove dead code in auth.h / auth.c ...................................................................... remove dead code in auth.h / auth.c Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e Related: OS#2528 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/auth.h M src/libmsc/Makefile.am D src/libmsc/auth.c M src/libmsc/gsm_04_08.c 5 files changed, 0 insertions(+), 65 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 0adc746..9c82d2f 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -1,7 +1,6 @@ noinst_HEADERS = \ a_iface.h \ a_iface_bssap.h \ - auth.h \ bsc_api.h \ bsc_msc.h \ bsc_rll.h \ diff --git a/include/osmocom/msc/auth.h b/include/osmocom/msc/auth.h deleted file mode 100644 index b314bbf..0000000 --- a/include/osmocom/msc/auth.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _AUTH_H -#define _AUTH_H - -#include - -struct gsm_auth_tuple; - -enum auth_action { - AUTH_ERROR = -1, /* Internal error */ - AUTH_NOT_AVAIL = 0, /* No auth tuple available */ - AUTH_DO_AUTH_THEN_CIPH = 1, /* Firsth authenticate, then cipher */ - AUTH_DO_CIPH = 2, /* Only ciphering */ - AUTH_DO_AUTH = 3, /* Only authentication, no ciphering */ -}; - -extern const struct value_string auth_action_names[]; -static inline const char *auth_action_str(enum auth_action a) -{ - return get_value_string(auth_action_names, a); -} - -#endif /* _AUTH_H */ diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 6449948..8ae0e18 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -28,7 +28,6 @@ libmsc_a_SOURCES = \ a_iface.c \ a_iface_bssap.c \ - auth.c \ msc_vty.c \ db.c \ gsm_04_08.c \ diff --git a/src/libmsc/auth.c b/src/libmsc/auth.c deleted file mode 100644 index 7c78c6e..0000000 --- a/src/libmsc/auth.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Authentication related functions */ - -/* - * (C) 2010 by Sylvain Munaut - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include - -#include -#include - -#include - -const struct value_string auth_action_names[] = { - OSMO_VALUE_STRING(AUTH_ERROR), - OSMO_VALUE_STRING(AUTH_NOT_AVAIL), - OSMO_VALUE_STRING(AUTH_DO_AUTH_THEN_CIPH), - OSMO_VALUE_STRING(AUTH_DO_CIPH), - OSMO_VALUE_STRING(AUTH_DO_AUTH), - { 0, NULL } -}; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 7afd0c7..126a216 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -34,7 +34,6 @@ #include "bscconfig.h" -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/6055 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I57e3b79a95a35c4783dc3775a88d15f13cbec13e Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:33 +0000 Subject: [MERGED] osmo-msc[master]: remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_r... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_rll.h ...................................................................... remove dead header files bsc_msc.h, bsc_msc_data.h and bsc_rll.h Related: OS#2528 Change-Id: I13cc4513689af1d594952dd628738b1240560bb7 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/bsc_msc.h D include/osmocom/msc/bsc_msc_data.h D include/osmocom/msc/bsc_rll.h M src/libcommon-cs/a_reset.c M src/libcommon/gsm_data.c M src/libmsc/gsm_04_11.c M src/osmo-msc/msc_main.c 8 files changed, 1 insertion(+), 277 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index 9c82d2f..7e86b12 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -2,8 +2,6 @@ a_iface.h \ a_iface_bssap.h \ bsc_api.h \ - bsc_msc.h \ - bsc_rll.h \ common.h \ common_cs.h \ ctrl.h \ @@ -27,7 +25,6 @@ openbscdefines.h \ a_reset.h \ osmo_msc.h \ - bsc_msc_data.h \ rrlp.h \ signal.h \ silent_call.h \ diff --git a/include/osmocom/msc/bsc_msc.h b/include/osmocom/msc/bsc_msc.h deleted file mode 100644 index d649f76..0000000 --- a/include/osmocom/msc/bsc_msc.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Routines to talk to the MSC using the IPA Protocol */ -/* - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#ifndef BSC_MSC_H -#define BSC_MSC_H - -#include -#include -#include -#include - -#include - -struct bsc_msc_dest { - struct llist_head list; - - char *ip; - int port; - int dscp; -}; - - -struct bsc_msc_connection { - /* FIXME: Remove stuff that is no longer needed! */ - struct osmo_wqueue write_queue; - int is_connected; - int is_authenticated; - int first_contact; - - struct llist_head *dests; - - const char *name; - - void (*connection_loss) (struct bsc_msc_connection *); - void (*connected) (struct bsc_msc_connection *); - struct osmo_timer_list reconnect_timer; - struct osmo_timer_list timeout_timer; - - struct msgb *pending_msg; - - /* Sigtran connection data */ - struct osmo_sccp_instance *sccp; - struct osmo_sccp_user *sccp_user; - struct osmo_sccp_addr g_calling_addr; - struct osmo_sccp_addr g_called_addr; - struct a_reset_ctx *reset; - - int conn_id_counter; -}; - -struct bsc_msc_connection *bsc_msc_create(void *ctx, struct llist_head *dest); -int bsc_msc_connect(struct bsc_msc_connection *); -void bsc_msc_schedule_connect(struct bsc_msc_connection *); - -void bsc_msc_lost(struct bsc_msc_connection *); - -struct msgb *bsc_msc_id_get_resp(int fixed, const char *token, const uint8_t *res, int len); - -#endif diff --git a/include/osmocom/msc/bsc_msc_data.h b/include/osmocom/msc/bsc_msc_data.h deleted file mode 100644 index 4a283d1..0000000 --- a/include/osmocom/msc/bsc_msc_data.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Data for the true BSC - * - * (C) 2010-2015 by Holger Hans Peter Freyther - * (C) 2010-2015 by On-Waves - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -/* - * NOTE: This is about a *remote* MSC for OsmoBSC and is not part of libmsc. - */ - -#ifndef _OSMO_MSC_DATA_H -#define _OSMO_MSC_DATA_H - -#include "bsc_msc.h" - -#include -#include - - -#include -#include -#include -#include -#include -#include - -#include - -struct osmo_bsc_rf; -struct gsm_network; - -struct gsm_audio_support { - uint8_t hr : 1, - ver : 7; -}; - -enum { - MSC_CON_TYPE_NORMAL, - MSC_CON_TYPE_LOCAL, -}; - -/*! /brief Information on a remote MSC for libbsc. - */ -struct bsc_msc_data { - struct llist_head entry; - - /* Back pointer */ - struct gsm_network *network; - - int allow_emerg; - int type; - - /* local call routing */ - char *local_pref; - regex_t local_pref_reg; - - - /* Connection data */ - char *bsc_token; - uint8_t bsc_key[16]; - uint8_t bsc_key_present; - - int ping_timeout; - int pong_timeout; - struct osmo_timer_list ping_timer; - struct osmo_timer_list pong_timer; - int advanced_ping; - struct bsc_msc_connection *msc_con; - int core_mnc; - int core_mcc; - int core_lac; - int core_ci; - int rtp_base; - - /* audio codecs */ - struct gsm48_multi_rate_conf amr_conf; - struct gsm_audio_support **audio_support; - int audio_length; - - /* destinations */ - struct llist_head dests; - - /* ussd welcome text */ - char *ussd_welcome_txt; - - /* mgcp agent */ - struct osmo_wqueue mgcp_agent; - - int nr; - - /* ussd msc connection lost text */ - char *ussd_msc_lost_txt; - - /* ussd text when MSC has entered the grace period */ - char *ussd_grace_txt; - - char *acc_lst_name; - - /* Sigtran connection data */ - struct { - uint32_t cs7_instance; - bool cs7_instance_valid; - struct osmo_sccp_instance *sccp; - struct osmo_sccp_user *sccp_user; - - /* Holds a copy of the our local MSC address, - * this will be the sccp-address that is associated - * with the A interface of this particular BSC, - * this address is filled up by the VTY interface */ - struct osmo_sccp_addr bsc_addr; - char *bsc_addr_name; - - /* Holds a copy of the MSC address. This is the - * address of the MSC that handles the calls of - * this BSC. The address is configured via the - * VTY interface */ - struct osmo_sccp_addr msc_addr; - char *msc_addr_name; - - struct a_reset_ctx *reset; - } a; -}; - -/* - * Per BSC data. - */ -struct osmo_bsc_data { - struct gsm_network *network; - - /* msc configuration */ - struct llist_head mscs; - - /* rf ctl related bits */ - char *mid_call_txt; - int mid_call_timeout; - char *rf_ctrl_name; - struct osmo_bsc_rf *rf_ctrl; - int auto_off_timeout; - - /* ussd text when there is no MSC available */ - char *ussd_no_msc_txt; - - char *acc_lst_name; -}; - - -int osmo_bsc_msc_init(struct bsc_msc_data *msc); -int osmo_bsc_sccp_init(struct gsm_network *gsmnet); -int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int proto); -int msc_queue_write_with_ping(struct bsc_msc_connection *, struct msgb *msg, int proto); - -int osmo_bsc_audio_init(struct gsm_network *network); - -struct bsc_msc_data *osmo_msc_data_find(struct gsm_network *, int); -struct bsc_msc_data *osmo_msc_data_alloc(struct gsm_network *, int); - - -#endif diff --git a/include/osmocom/msc/bsc_rll.h b/include/osmocom/msc/bsc_rll.h deleted file mode 100644 index 93c80e7..0000000 --- a/include/osmocom/msc/bsc_rll.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _BSC_RLL_H -#define _BSC_RLL_H - -#include - -enum bsc_rllr_ind { - BSC_RLLR_IND_EST_CONF, - BSC_RLLR_IND_REL_IND, - BSC_RLLR_IND_ERR_IND, - BSC_RLLR_IND_TIMEOUT, -}; - -int rll_establish(struct gsm_lchan *lchan, uint8_t link_id, - void (*cb)(struct gsm_lchan *, uint8_t, void *, - enum bsc_rllr_ind), - void *data); -void rll_indication(struct gsm_lchan *lchan, uint8_t link_id, uint8_t type); - -#endif /* _BSC_RLL_H */ diff --git a/src/libcommon-cs/a_reset.c b/src/libcommon-cs/a_reset.c index d2f4f59..072181d 100644 --- a/src/libcommon-cs/a_reset.c +++ b/src/libcommon-cs/a_reset.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #define RESET_RESEND_INTERVAL 2 /* sec */ #define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number */ diff --git a/src/libcommon/gsm_data.c b/src/libcommon/gsm_data.c index bdcdf02..66b6e29 100644 --- a/src/libcommon/gsm_data.c +++ b/src/libcommon/gsm_data.c @@ -33,7 +33,6 @@ #include #include -#include void *tall_bsc_ctx; diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index e67531e..a6e8bf7 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index f41df01..9fa98f3 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include -- To view, visit https://gerrit.osmocom.org/6056 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13cc4513689af1d594952dd628738b1240560bb7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 07:51:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 07:51:34 +0000 Subject: [MERGED] osmo-msc[master]: debug: Remove dead log categories In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: debug: Remove dead log categories ...................................................................... debug: Remove dead log categories Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Related: OS#2528 --- M include/osmocom/msc/debug.h M src/libcommon/debug.c M src/libcommon/gsup_client.c M src/libcommon/gsup_test_client.c M src/osmo-msc/msc_main.c 5 files changed, 4 insertions(+), 94 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/debug.h b/include/osmocom/msc/debug.h index 65e197d..f99dba5 100644 --- a/include/osmocom/msc/debug.h +++ b/include/osmocom/msc/debug.h @@ -12,35 +12,18 @@ DCC, DMM, DRR, - DRSL, - DNM, DMNCC, DPAG, - DMEAS, - DSCCP, DMSC, DMGCP, DHO, DDB, DREF, - DGPRS, - DNS, - DBSSGP, - DLLC, - DSNDCP, - DSLHC, - DNAT, DCTRL, DSMPP, - DFILTER, - DGTPHUB, DRANAP, - DSUA, - DV42BIS, - DPCU, DVLR, DIUCS, - DSIGTRAN, Debug_LastEntry, }; diff --git a/src/libcommon/debug.c b/src/libcommon/debug.c index 661eb66..8c0e787 100644 --- a/src/libcommon/debug.c +++ b/src/libcommon/debug.c @@ -60,18 +60,6 @@ .color = "\033[1;34m", .enabled = 1, .loglevel = LOGL_NOTICE, }, - [DRSL] = { - .name = "DRSL", - .description = "A-bis Radio Siganlling Link (RSL)", - .color = "\033[1;35m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DNM] = { - .name = "DNM", - .description = "A-bis Network Management / O&M (NM/OML)", - .color = "\033[1;36m", - .enabled = 1, .loglevel = LOGL_INFO, - }, [DMNCC] = { .name = "DMNCC", .description = "MNCC API for Call Control application", @@ -82,16 +70,6 @@ .name = "DPAG", .description = "Paging Subsystem", .color = "\033[1;38m", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, - [DMEAS] = { - .name = "DMEAS", - .description = "Radio Measurement Processing", - .enabled = 0, .loglevel = LOGL_NOTICE, - }, - [DSCCP] = { - .name = "DSCCP", - .description = "SCCP Protocol", .enabled = 1, .loglevel = LOGL_NOTICE, }, [DMSC] = { @@ -119,36 +97,6 @@ .description = "Reference Counting", .enabled = 0, .loglevel = LOGL_NOTICE, }, - [DGPRS] = { - .name = "DGPRS", - .description = "GPRS Packet Service", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNS] = { - .name = "DNS", - .description = "GPRS Network Service (NS)", - .enabled = 1, .loglevel = LOGL_INFO, - }, - [DBSSGP] = { - .name = "DBSSGP", - .description = "GPRS BSS Gateway Protocol (BSSGP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DLLC] = { - .name = "DLLC", - .description = "GPRS Logical Link Control Protocol (LLC)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSNDCP] = { - .name = "DSNDCP", - .description = "GPRS Sub-Network Dependent Control Protocol (SNDCP)", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DNAT] = { - .name = "DNAT", - .description = "GSM 08.08 NAT/Multiplexer", - .enabled = 1, .loglevel = LOGL_NOTICE, - }, [DCTRL] = { .name = "DCTRL", .description = "Control interface", @@ -159,24 +107,9 @@ .description = "SMPP interface for external SMS apps", .enabled = 1, .loglevel = LOGL_DEBUG, }, - [DFILTER] = { - .name = "DFILTER", - .description = "BSC/NAT IMSI based filtering", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, [DRANAP] = { .name = "DRANAP", .description = "Radio Access Network Application Part Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSUA] = { - .name = "DSUA", - .description = "SCCP User Adaptation Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DPCU] = { - .name = "DPCU", - .description = "PCU Interface", .enabled = 1, .loglevel = LOGL_DEBUG, }, [DVLR] = { @@ -187,12 +120,6 @@ [DIUCS] = { .name = "DIUCS", .description = "Iu-CS Protocol", - .enabled = 1, .loglevel = LOGL_DEBUG, - }, - [DSIGTRAN] = { - .name = "DSIGTRAN", - .description = "SIGTRAN Signalling Transport", - .color = "\033[1;29m", .enabled = 1, .loglevel = LOGL_DEBUG, }, }; diff --git a/src/libcommon/gsup_client.c b/src/libcommon/gsup_client.c index b5f2e68..0335e21 100644 --- a/src/libcommon/gsup_client.c +++ b/src/libcommon/gsup_client.c @@ -331,7 +331,7 @@ int gsup_client_send(struct gsup_client *gsupc, struct msgb *msg) { if (!gsupc || !gsupc->is_connected) { - LOGP(DGPRS, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); + LOGP(DLGSUP, LOGL_ERROR, "GSUP not connected, unable to send %s\n", msgb_hexdump(msg)); msgb_free(msg); return -ENOTCONN; } diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index 5576292..8605040 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -201,7 +201,7 @@ struct imsi_op *io; int rc; - DEBUGP(DGPRS, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); + DEBUGP(DLGSUP, "Rx GSUP %s\n", osmo_hexdump(msgb_l2(msg), msgb_l2len(msg))); rc = osmo_gsup_decode(msgb_l2(msg), msgb_l2len(msg), &gsup_msg); if (rc < 0) diff --git a/src/osmo-msc/msc_main.c b/src/osmo-msc/msc_main.c index a4b833e..98f1920 100644 --- a/src/osmo-msc/msc_main.c +++ b/src/osmo-msc/msc_main.c @@ -118,7 +118,7 @@ { printf(" Some useful help...\n"); printf(" -h --help This text.\n"); - printf(" -d option --debug=DRLL:DCC:DMM:DRR:DRSL:DNM Enable debugging.\n"); + printf(" -d option --debug=DCC:DMM:DRR: Enable debugging.\n"); printf(" -D --daemonize Fork the process into a background daemon.\n"); printf(" -c --config-file filename The config file to use.\n"); printf(" -s --disable-color\n"); @@ -420,7 +420,7 @@ rc = vty_read_config_file(msc_cmdline_config.config_file, NULL); if (rc < 0) { - LOGP(DNM, LOGL_FATAL, "Failed to parse the config file: '%s'\n", + LOGP(DMSC, LOGL_FATAL, "Failed to parse the config file: '%s'\n", msc_cmdline_config.config_file); return 1; } -- To view, visit https://gerrit.osmocom.org/6059 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdfc39ead4f0c5e3a74321e9d2c9720ae1603541 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 10:30:34 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Thu, 25 Jan 2018 10:30:34 +0000 Subject: osmo-mgw[master]: client: make callid in MDCX mandatory In-Reply-To: References: Message-ID: Patch Set 1: This is related to #5994. My problem is that I need some unique number as session ID. I think the call-id serves this purpose. But since the session id in the "o" field of the SDP section is mandatory we need to have the session ID mandatory too. What do you think? In RFC3435 chapter 2.3.6 ModifyConnection i find "The CallId used when the connection was created MUST be included as well." So I think it is indeed manadtory. -- To view, visit https://gerrit.osmocom.org/5993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 10:56:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 25 Jan 2018 10:56:55 +0000 Subject: osmo-msc[master]: GSUP: check osmo_gsup_encode() result In-Reply-To: References: Message-ID: Patch Set 1: > The real problem is that somebody hands a too long IMSI to the encoder Sure, that's not a complete fix, it's just small part of it. We also need TTCN test, libosmocore test, fix for long imsi source etc. -- To view, visit https://gerrit.osmocom.org/6010 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4551212011fb0bd898c020a183756ed7a9afb9e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc 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 Jan 25 11:05:46 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 11:05:46 +0000 Subject: osmo-msc[master]: Delete expired SMS automatically. In-Reply-To: References: Message-ID: Patch Set 2: This cannot be merged yet because it depends on https://gerrit.osmocom.org/#/c/5989/ -- To view, visit https://gerrit.osmocom.org/5996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 11:06:07 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 11:06:07 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: This cannot be merged yet because it depends on https://gerrit.osmocom.org/#/c/5989/ -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 11:07:36 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 11:07:36 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: > Shouldn't we be checking if we can find the subscriber in the > VLR/HLR instead of blindly accepting? The VLR/HLR might not be reachable, and we need to immediately ack or reject the SMS. Harald suggested that it's easier to simply accept any message and deal with non-existing subscriber B when we're trying to forward the message. -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 11:21:25 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 11:21:25 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: This seems fine as a quick fix for now,but I'd guess in the long term we should asynchronously start a procedure to check if the subscriber exists and then send a response back to the MS. If we agree that's the best way we can perhaps create a task to not forget about it? -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 11:38:33 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 11:38:33 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: > This seems fine as a quick fix for now,but I'd guess in the long > term we should asynchronously start a procedure to check if the > subscriber exists and then send a response back to the MS. If we > agree that's the best way we can perhaps create a task to not > forget about it? One concern is that a transient failure of communication between MSC and HLR could lead to SMS being rejected even though it could be delivered just fine at some later point in time. Of course, the destination phone number could simply be incorrect, but we have no way of knowing whether this is the case if the VLR/HLR can't be reached. Should potentially transient errors be reported back to the MS? All the MS could do is try again later, which is what the MSC is now already doing on its behalf. Harald's argument was that SMS is unreliable anyway, and if the person sending the SMS wants feedback they should enable SMS delivery notifications. -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 12:05:18 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 12:05:18 +0000 Subject: [PATCH] osmo-bsc[master]: Improve an error message in page_lai_and_lac() Message-ID: Review at https://gerrit.osmocom.org/6063 Improve an error message in page_lai_and_lac() This error message is now contained in a loop, and the current iteration does not know whether paging will fail entirely or if later iterations will succeed. Update the error message accordingly. This also makes the error message consistent with the one in page_cgi(). Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/63/6063/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..67ff230 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -412,7 +412,7 @@ mi_string, lac); } } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + LOGP(DMSC, LOGL_DEBUG, "Paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); } -- To view, visit https://gerrit.osmocom.org/6063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 25 14:00:19 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 14:00:19 +0000 Subject: [PATCH] osmo-bsc[master]: Remove an unused variable. Message-ID: Review at https://gerrit.osmocom.org/6064 Remove an unused variable. Local variable is_lu in rsl_rx_chan_rqd() has been unused since cOmmit 6082a377f57901302816a2e57e75a3f262b7b7e6. Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 --- M src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/64/6064/1 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index b54fab8..eced0e2 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1860,7 +1860,6 @@ enum gsm_chreq_reason_t chreq_reason; struct gsm_lchan *lchan; uint8_t rqd_ta; - int is_lu; uint16_t arfcn; uint8_t subch; @@ -1892,12 +1891,6 @@ lctype = get_ctype_by_chreq(bts->network, rqd_ref->ra); rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_TOTAL]); - - /* - * We want LOCATION UPDATES to succeed and will assign a TCH - * if we have no SDCCH available. - */ - is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); /* check availability / allocate channel * -- To view, visit https://gerrit.osmocom.org/6064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 25 14:05:54 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 14:05:54 +0000 Subject: [PATCH] osmo-bsc[master]: Improve an error message in page_lai_and_lac() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6063 to look at the new patch set (#2). Improve an error message in page_lai_and_lac() This error message is now contained in a loop, and the current iteration does not know whether paging will fail entirely or if later iterations will succeed. Update the error message accordingly. This also makes the error message consistent with the one in page_cgi(). Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 --- M src/osmo-bsc/osmo_bsc_bssap.c M tests/bssap/bssap_test.err 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/63/6063/2 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..67ff230 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -412,7 +412,7 @@ mi_string, lac); } } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + LOGP(DMSC, LOGL_DEBUG, "Paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); } diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index abe1def..18bfbca 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -16,7 +16,7 @@ 2: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 15 f5 49 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Not paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) +DMSC Paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) bsc_handle_udt() returned 0 3: -- To view, visit https://gerrit.osmocom.org/6063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 14:59:25 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 14:59:25 +0000 Subject: osmo-bsc[master]: Remove an unused variable. In-Reply-To: References: Message-ID: Patch Set 1: I created a task realted to this one a few days ago: https://osmocom.org/issues/2859 You may want to reference it in the commit and update it acordingly. -- To view, visit https://gerrit.osmocom.org/6064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 15:06:44 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 25 Jan 2018 15:06:44 +0000 Subject: [PATCH] osmo-pcu[master]: Move PDCH-related functions into 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/6053 to look at the new patch set (#2). Move PDCH-related functions into separate file The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539 --- M src/Makefile.am M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_bssgp_pcu.h M src/gprs_ms.h M src/gprs_rlcmac.cpp M src/gprs_rlcmac_meas.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_vty_functions.cpp A src/pdch.cpp A src/pdch.h M src/sba.cpp M src/sba.h M src/tbf.cpp M src/tbf.h 19 files changed, 1,134 insertions(+), 1,028 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/6053/2 diff --git a/src/Makefile.am b/src/Makefile.am index 7d2a62e..b2f64f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,6 +54,7 @@ tbf_ul.cpp \ tbf_dl.cpp \ bts.cpp \ + pdch.cpp \ poll_controller.cpp \ encoding.cpp \ sba.cpp \ @@ -85,6 +86,7 @@ mslot_class.h \ tbf.h \ bts.h \ + pdch.h \ poll_controller.h \ encoding.h \ sba.h \ diff --git a/src/bts.cpp b/src/bts.cpp index 94354f2..3de9509 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -25,7 +25,7 @@ #include #include #include - +#include #include #include @@ -846,792 +846,6 @@ return ms; } -/* - * PDCH code below. TODO: move to a separate file - */ - -void gprs_rlcmac_pdch::enable() -{ - /* TODO: Check if there are still allocated resources.. */ - INIT_LLIST_HEAD(&paging_list); - m_is_enabled = 1; -} - -void gprs_rlcmac_pdch::disable() -{ - /* TODO.. kick free_resources once we know the TRX/TS we are on */ - m_is_enabled = 0; -} - -void gprs_rlcmac_pdch::free_resources() -{ - struct gprs_rlcmac_paging *pag; - - /* we are not enabled. there should be no resources */ - if (!is_enabled()) - return; - - /* kick all TBF on slot */ - gprs_rlcmac_tbf::free_all(this); - - /* flush all pending paging messages */ - while ((pag = dequeue_paging())) - talloc_free(pag); - - trx->bts->sba()->free_resources(this); -} - -struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() -{ - struct gprs_rlcmac_paging *pag; - - if (llist_empty(&paging_list)) - return NULL; - pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); - llist_del(&pag->list); - - return pag; -} - -struct msgb *gprs_rlcmac_pdch::packet_paging_request() -{ - struct gprs_rlcmac_paging *pag; - struct msgb *msg; - unsigned wp = 0, len; - - /* no paging, no message */ - pag = dequeue_paging(); - if (!pag) - return NULL; - - LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); - - /* alloc message */ - msg = msgb_alloc(23, "pag ctrl block"); - if (!msg) { - talloc_free(pag); - return NULL; - } - bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); - if (!pag_vec) { - msgb_free(msg); - talloc_free(pag); - return NULL; - } - wp = Encoding::write_packet_paging_request(pag_vec); - - /* loop until message is full */ - while (pag) { - /* try to add paging */ - if ((pag->identity_lv[1] & 0x07) == 4) { - /* TMSI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", - ntohl(*((uint32_t *)(pag->identity_lv + 1)))); - len = 1 + 1 + 1 + 32 + 2 + 1; - if (pag->identity_lv[0] != 5) { - LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " - "MI != 5 octets!\n"); - goto continue_next; - } - } else { - /* MI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", - osmo_hexdump(pag->identity_lv + 1, - pag->identity_lv[0])); - len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; - if (pag->identity_lv[0] > 8) { - LOGP(DRLCMAC, LOGL_ERROR, "Paging with " - "MI > 8 octets!\n"); - goto continue_next; - } - } - if (wp + len > 184) { - LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " - "next time\n"); - /* put back paging record, because does not fit */ - llist_add_tail(&pag->list, &paging_list); - break; - } - Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], - pag->identity_lv + 1, pag->chan_needed); - -continue_next: - talloc_free(pag); - pag = dequeue_paging(); - } - - bitvec_pack(pag_vec, msgb_put(msg, 23)); - RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); - bitvec_free(pag_vec); - talloc_free(mac_control_block); - - return msg; -} - -void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag) -{ - llist_add(&pag->list, &paging_list); -} - -void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) -{ - struct gprs_rlcmac_tbf *tbf, *new_tbf; - uint32_t tlli = packet->TLLI; - GprsMs *ms = bts()->ms_by_tlli(tlli); - gprs_rlcmac_ul_tbf *ul_tbf; - - tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", - fn, tlli, trx_no(), ts_no); - if (ms) - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown TBF corresponds to MS with IMSI %s, TA %d, " - "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", - ms->imsi(), ms->ta(), - ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, - ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", - ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, - ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - TBF_POLL_SCHED_UNSET(tbf); - - /* check if this control ack belongs to packet uplink ack */ - ul_tbf = as_ul_tbf(tbf); - if (ul_tbf && ul_tbf->handle_ctrl_ack()) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); - if (ul_tbf->ctrl_ack_to_toggle()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); - - tbf_free(tbf); - return; - } - if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { - /* We now know that the PACCH really existed */ - LOGPTBF(new_tbf, LOGL_INFO, - "The TBF has been confirmed on the PACCH, " - "changed type from CCCH to PACCH\n"); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - } - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - /* stop pending assignment timer */ - new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - - tbf_assign_control_ts(new_tbf); - return; - } - if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - - tbf_assign_control_ts(new_tbf); - /* there might be LLC packets waiting in the queue, but the DL - * TBF might have been released while the UL TBF has been - * established */ - if (new_tbf->ms()->need_dl_tbf()) - new_tbf->establish_dl_tbf_on_pacch(); - - return; - } - LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " - "at no request\n"); -} - -static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) -{ - static const int16_t rx_qual_map[] = { - 0, /* 0,14 % */ - 0, /* 0,28 % */ - 1, /* 0,57 % */ - 1, /* 1,13 % */ - 2, /* 2,26 % */ - 5, /* 4,53 % */ - 9, /* 9,05 % */ - 18, /* 18,10 % */ - }; - - meas->set_ms_rx_qual(rx_qual_map[ - OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) - ]); -} - -static void get_meas(struct pcu_l1_meas *meas, - const Packet_Resource_Request_t *qr) -{ - unsigned i; - - meas->set_ms_c_value(qr->C_VALUE); - if (qr->Exist_SIGN_VAR) - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_INFO, - "Packet resource request: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); - } - } -} - -static void get_meas(struct pcu_l1_meas *meas, - const Channel_Quality_Report_t *qr) -{ - unsigned i; - - get_rx_qual_meas(meas, qr->RXQUAL); - meas->set_ms_c_value(qr->C_VALUE); - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_DEBUG, - "Channel quality report: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL_TN); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); - } - } -} - -static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) -{ - bts->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), - tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject */ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); - } -} - -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 */ - struct gprs_rlcmac_dl_tbf *tbf; - int rc; - struct pcu_l1_meas meas; - int num_blocks; - uint8_t bits_data[RLC_GPRS_WS/8]; - bitvec bits; - int bsn_begin, bsn_end; - char show_bits[RLC_GPRS_WS + 1]; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_gprs_acknack_bits( - &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits)); - - rc = tbf->rcvd_dl_ack( - ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - } -} - -void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) -{ - int8_t tfi = 0; /* must be signed */ - struct gprs_rlcmac_dl_tbf *tbf; - struct pcu_l1_meas meas; - int rc; - int num_blocks; - uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; - char show_bits[RLC_EGPRS_MAX_WS + 1]; - bitvec bits; - int bsn_begin, bsn_end; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, - "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); - - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " - "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " - "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", - (int)ack_nack->EGPRS_AckNack.UnionType, - (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, - (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, - (void *)&ack_nack->EGPRS_AckNack.UnionType, - (void *)&ack_nack->EGPRS_AckNack.Desc, - (int)offsetof(EGPRS_AckNack_t, Desc), - (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->window()->v_a(), - tbf->window()->v_s(), - osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, - sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_egprs_acknack_bits( - &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits) - ); - - rc = tbf->rcvd_dl_ack( - ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - - /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - /* TODO: Implement Measurements parsing for EGPRS */ - /* - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - */ - } -} - -void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - if (request->ID.UnionType) { - struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; - uint32_t tlli = request->ID.u.TLLI; - uint8_t ms_class = 0; - uint8_t egprs_ms_class = 0; - uint8_t ta = GSM48_TA_INVALID; - struct pcu_l1_meas meas; - - GprsMs *ms = bts()->ms_by_tlli(tlli); - /* Keep the ms, even if it gets idle temporarily */ - GprsMs::Guard guard(ms); - - if (ms) { - ul_tbf = ms->ul_tbf(); - dl_tbf = ms->dl_tbf(); - ta = ms->ta(); - } - - /* We got a RACH so the MS was in packet idle mode and thus - * didn't have any active TBFs */ - if (ul_tbf) { - LOGPTBFUL(ul_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", - tlli); - tbf_free(ul_tbf); - ul_tbf = NULL; - } - - if (dl_tbf) { - LOGPTBFUL(dl_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", - tlli); - tbf_free(dl_tbf); - dl_tbf = NULL; - } - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " - "in packet resource request of single " - "block, so we provide one:\n"); - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled!\n"); - } else { - ta = sba->ta; - bts()->sba()->free_sba(sba); - } - if (request->Exist_MS_Radio_Access_capability) { - ms_class = Decoding::get_ms_class_by_capability( - &request->MS_Radio_Access_capability); - egprs_ms_class = - Decoding::get_egprs_ms_class_by_capability( - &request->MS_Radio_Access_capability); - } - if (!ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); - if (egprs_ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, - "MS supports EGPRS multislot class %d.\n", - egprs_ms_class); - ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, - egprs_ms_class, tlli, ta, ms); - - if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); - return; - } - - /* set control ts to current MS's TS, until assignment complete */ - LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", - ul_tbf->control_ts, ts_no); - - ul_tbf->control_ts = ts_no; - /* schedule uplink assignment */ - TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - - /* get capabilities */ - if (ul_tbf->ms()) - ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); - - /* get measurements */ - if (ul_tbf->ms()) { - get_meas(&meas, request); - ul_tbf->ms()->update_l1_meas(&meas); - } - return; - } - - if (request->ID.u.Global_TFI.UnionType) { - struct gprs_rlcmac_dl_tbf *dl_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; - dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!dl_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); - return; - } - LOGPTBFDL(dl_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - dl_tbf->m_n3101 = 0; - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; - ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!ul_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); - return; - } - LOGPTBFUL(ul_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - ul_tbf->m_n3101 = 0; - } -} - -void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled! TLLI=0x%08x\n", report->TLLI); - } else { - GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); - if (!ms) - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "but TLLI 0x%08x is unknown\n", report->TLLI); - else - ms->set_ta(sba->ta); - - bts()->sba()->free_sba(sba); - } - gprs_rlcmac_meas_rep(report); -} - -/* Received Uplink RLC control block. */ -int gprs_rlcmac_pdch::rcv_control_block( - const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) -{ - RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); - - if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - else - bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - - bts()->rlc_rcvd_control(); - switch (ul_control_block->u.MESSAGE_TYPE) { - case MT_PACKET_CONTROL_ACK: - rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); - break; - case MT_PACKET_DOWNLINK_ACK_NACK: - rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); - break; - case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: - rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); - break; - case MT_PACKET_RESOURCE_REQUEST: - rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); - break; - case MT_PACKET_MEASUREMENT_REPORT: - rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); - break; - case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: - /* ignoring it. change the SI to not force sending these? */ - break; - default: - bts()->decode_error(); - LOGP(DRLCMAC, LOGL_NOTICE, - "RX: [PCU <- BTS] unknown control block(%d) received\n", - ul_control_block->u.MESSAGE_TYPE); - } - talloc_free(ul_control_block); - return 1; -} - - -/* received RLC/MAC block from L1 */ -int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas) -{ - GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); - if (!cs) { - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" - "length: %d)\n", len); - return -EINVAL; - } - - bts()->rlc_ul_bytes(len); - - LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " - "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); - - if (cs.isGprs()) - return rcv_block_gprs(data, len, fn, meas, cs); - - if (cs.isEgprs()) - return rcv_data_block(data, len, fn, meas, cs); - - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", - cs.name()); - return -EINVAL; -} - -/*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - int rc; - struct gprs_rlc_data_info rlc_dec; - struct gprs_rlcmac_ul_tbf *tbf; - unsigned len = cs.sizeUL(); - - /* These are always data blocks, since EGPRS still uses CS-1 for - * control blocks (see 44.060, section 10.3, 1st par.) - */ - if (cs.isEgprs()) { - if (!bts()->bts_data()->egprs_enabled) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not enabled\n", - cs.name()); - return -EINVAL; - } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } else { - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } - - LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); - - rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); - if (rc < 0) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but header parsing has failed\n", - cs.name()); - bts()->decode_error(); - return rc; - } - - LOGP(DRLCMACUL, LOGL_INFO, - "Got %s RLC block: " - "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " - "rc=%d\n", - cs.name(), - rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, - rc); - - /* find TBF inst from given TFI */ - tbf = ul_tbf_by_tfi(rlc_dec.tfi); - if (!tbf) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", - rlc_dec.tfi); - return 0; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); -} - -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - unsigned payload = data[0] >> 6; - bitvec *block; - int rc = 0; - unsigned len = cs.maxBytesUL(); - - switch (payload) { - case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, data_len, fn, meas, cs); - break; - case GPRS_RLCMAC_CONTROL_BLOCK: - block = bitvec_alloc(len, tall_pcu_ctx); - if (!block) - return -ENOMEM; - bitvec_unpack(block, data); - rc = rcv_control_block(data, data_len, block, fn); - bitvec_free(block); - break; - case GPRS_RLCMAC_CONTROL_BLOCK_OPT: - LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); - break; - default: - LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); - rc = -EINVAL; - } - - return rc; -} - /* update TA based on TA provided by PH-DATA-IND */ void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta) { @@ -1689,110 +903,6 @@ update_tbf_ta(tbf, ta); } -} - -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - gprs_rlcmac_tbf *tbf; - LListHead *pos; - - llist_for_each(pos, tbf_list) { - tbf = pos->entry(); - if (tbf->tfi() != tfi) - continue; - if (!tbf->pdch[ts_no]) - continue; - return tbf; - } - return NULL; -} - -gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) -{ - return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); -} - -gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) -{ - return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); -} - -/* lookup TBF Entity (by TFI) */ -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - struct gprs_rlcmac_tbf *tbf; - - if (tfi >= 32) - return NULL; - - tbf = m_tbfs[dir][tfi]; - - if (!tbf) - return NULL; - - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { - return tbf; - } - - return NULL; -} - -void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - if (m_tbfs[tbf->direction][tbf->tfi()]) - LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " - "%s has not been detached, overwriting it\n", - ts_no, trx_no(), - m_tbfs[tbf->direction][tbf->tfi()]->name()); - - m_num_tbfs[tbf->direction] += 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; - } - m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); - m_tbfs[tbf->direction][tbf->tfi()] = tbf; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); - - m_num_tbfs[tbf->direction] -= 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); - } - m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); - m_tbfs[tbf->direction][tbf->tfi()] = NULL; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) -{ - m_num_reserved[dir] += 1; -} - -void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) -{ - OSMO_ASSERT(m_num_reserved[dir] > 0); - m_num_reserved[dir] -= 1; } void gprs_rlcmac_trx::reserve_slots(enum gprs_rlcmac_tbf_direction dir, diff --git a/src/bts.h b/src/bts.h index b1724c9..e11b4a5 100644 --- a/src/bts.h +++ b/src/bts.h @@ -35,6 +35,7 @@ #include "poll_controller.h" #include "sba.h" #include "tbf.h" +#include "pdch.h" #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" #endif @@ -63,97 +64,18 @@ struct BTS; struct GprsMs; - -/* - * PDCH instance - */ -struct gprs_rlcmac_pdch { -#ifdef __cplusplus - struct gprs_rlcmac_paging *dequeue_paging(); - struct msgb *packet_paging_request(); - - void add_paging(struct gprs_rlcmac_paging *pag); - - void free_resources(); - - bool is_enabled() const; - - void enable(); - void disable(); - - /* dispatching of messages */ - int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas); - int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - - gprs_rlcmac_bts *bts_data() const; - BTS *bts() const; - uint8_t trx_no() const; - - struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); - struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); - - void attach_tbf(gprs_rlcmac_tbf *tbf); - void detach_tbf(gprs_rlcmac_tbf *tbf); - - unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; - - void reserve(enum gprs_rlcmac_tbf_direction dir); - void unreserve(enum gprs_rlcmac_tbf_direction dir); - unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; - - uint8_t assigned_usf() const; - uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; -#endif - - uint8_t m_is_enabled; /* TS is enabled */ - uint8_t tsc; /* TSC of this slot */ - uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ - uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ - uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ - struct llist_head paging_list; /* list of paging messages */ - uint32_t last_rts_fn; /* store last frame number of RTS */ - - /* back pointers */ - struct gprs_rlcmac_trx *trx; - uint8_t ts_no; - -#ifdef __cplusplus -private: - int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); - - void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); - void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); - void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); - void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); - void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); - gprs_rlcmac_tbf *tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); - gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); -#endif - - uint8_t m_num_tbfs[2]; - uint8_t m_num_reserved[2]; - uint8_t m_assigned_usf; /* bit set */ - uint32_t m_assigned_tfi[2]; /* bit set */ - struct gprs_rlcmac_tbf *m_tbfs[2][32]; -}; +struct gprs_rlcmac_tbf; struct gprs_rlcmac_trx { void *fl1h; uint16_t arfcn; - struct gprs_rlcmac_pdch pdch[8]; /* back pointers */ struct BTS *bts; uint8_t trx_no; #ifdef __cplusplus + struct gprs_rlcmac_pdch pdch[8]; void reserve_slots(enum gprs_rlcmac_tbf_direction dir, uint8_t slots); void unreserve_slots(enum gprs_rlcmac_tbf_direction dir, uint8_t slots); #endif @@ -540,33 +462,6 @@ return m_dl_tbfs; } -inline BTS *gprs_rlcmac_pdch::bts() const -{ - return trx->bts; -} - -inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const -{ - return m_num_tbfs[dir]; -} - -inline unsigned gprs_rlcmac_pdch::num_reserved( - enum gprs_rlcmac_tbf_direction dir) const -{ - return gprs_rlcmac_pdch::m_num_reserved[dir]; -} - -inline uint8_t gprs_rlcmac_pdch::assigned_usf() const -{ - return m_assigned_usf; -} - -inline uint32_t gprs_rlcmac_pdch::assigned_tfi( - enum gprs_rlcmac_tbf_direction dir) const -{ - return m_assigned_tfi[dir]; -} - inline struct rate_ctr_group *BTS::rate_counters() const { return m_ratectrs; @@ -687,15 +582,6 @@ #undef CREATE_STAT_INLINE -inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const -{ - return trx->bts->bts_data(); -} - -inline uint8_t gprs_rlcmac_pdch::trx_no() const -{ - return trx->trx_no; -} #endif #ifdef __cplusplus @@ -707,8 +593,4 @@ #ifdef __cplusplus } -inline bool gprs_rlcmac_pdch::is_enabled() const -{ - return m_is_enabled; -} #endif diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index a86e09d..70a1b35 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -18,11 +18,13 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include -#include +#include +#include #include #include +#include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h index bb44903..4eda57d 100644 --- a/src/gprs_bssgp_pcu.h +++ b/src/gprs_bssgp_pcu.h @@ -42,8 +42,6 @@ #define NS_HDR_LEN 4 #define IE_LLC_PDU 14 -struct gprs_rlcmac_bts; - struct gprs_bssgp_pcu { struct gprs_nsvc *nsvc; struct bssgp_bvc_ctx *bctx; diff --git a/src/gprs_ms.h b/src/gprs_ms.h index f094e96..4751f63 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -22,6 +22,7 @@ struct gprs_codel; +#include #include "cxx_linuxlist.h" #include "llc.h" #include "tbf.h" diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index 06c5479..04b90f2 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -21,10 +21,8 @@ #include #include -#include +#include #include -#include - extern void *tall_pcu_ctx; diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index 41a7531..5b35381 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index ebf4714..877056a 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -18,11 +18,14 @@ */ #include -#include #include #include #include - +#include +#include +#include +#include +#include #include "pcu_utils.h" static uint32_t sched_poll(BTS *bts, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5e670d7..5a7ed80 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -19,10 +19,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include +#include #include #include diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 577d41e..332c649 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -31,13 +31,13 @@ #include } -#include #include #include #include #include #include #include +#include extern void *tall_pcu_ctx; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b04..a692084 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index eb15aa6..882d5d8 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -27,6 +27,11 @@ #include "gprs_ms_storage.h" #include "gprs_ms.h" #include "cxx_linuxlist.h" +#include +#include +#include +#include +#include extern "C" { #include diff --git a/src/pdch.cpp b/src/pdch.cpp new file mode 100644 index 0000000..f8a1c38 --- /dev/null +++ b/src/pdch.cpp @@ -0,0 +1,948 @@ +/* + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { + #include + #include + #include + #include + #include + #include + #include +} + +#include + +extern void *tall_pcu_ctx; + +static void get_meas(struct pcu_l1_meas *meas, const Packet_Resource_Request_t *qr) +{ + unsigned i; + + meas->set_ms_c_value(qr->C_VALUE); + if (qr->Exist_SIGN_VAR) + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_INFO, + "Packet resource request: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); + } + } +} + +static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) +{ + static const int16_t rx_qual_map[] = { + 0, /* 0,14 % */ + 0, /* 0,28 % */ + 1, /* 0,57 % */ + 1, /* 1,13 % */ + 2, /* 2,26 % */ + 5, /* 4,53 % */ + 9, /* 9,05 % */ + 18, /* 18,10 % */ + }; + + meas->set_ms_rx_qual(rx_qual_map[ + OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) + ]); +} + +static void get_meas(struct pcu_l1_meas *meas, const Channel_Quality_Report_t *qr) +{ + unsigned i; + + get_rx_qual_meas(meas, qr->RXQUAL); + meas->set_ms_c_value(qr->C_VALUE); + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_DEBUG, + "Channel quality report: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL_TN); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); + } + } +} + +void gprs_rlcmac_pdch::enable() +{ + /* TODO: Check if there are still allocated resources.. */ + INIT_LLIST_HEAD(&paging_list); + m_is_enabled = 1; +} + +void gprs_rlcmac_pdch::disable() +{ + /* TODO.. kick free_resources once we know the TRX/TS we are on */ + m_is_enabled = 0; +} + +void gprs_rlcmac_pdch::free_resources() +{ + struct gprs_rlcmac_paging *pag; + + /* we are not enabled. there should be no resources */ + if (!is_enabled()) + return; + + /* kick all TBF on slot */ + gprs_rlcmac_tbf::free_all(this); + + /* flush all pending paging messages */ + while ((pag = dequeue_paging())) + talloc_free(pag); + + trx->bts->sba()->free_resources(this); +} + +struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() +{ + struct gprs_rlcmac_paging *pag; + + if (llist_empty(&paging_list)) + return NULL; + pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); + llist_del(&pag->list); + + return pag; +} + +struct msgb *gprs_rlcmac_pdch::packet_paging_request() +{ + struct gprs_rlcmac_paging *pag; + struct msgb *msg; + unsigned wp = 0, len; + + /* no paging, no message */ + pag = dequeue_paging(); + if (!pag) + return NULL; + + LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); + + /* alloc message */ + msg = msgb_alloc(23, "pag ctrl block"); + if (!msg) { + talloc_free(pag); + return NULL; + } + bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); + if (!pag_vec) { + msgb_free(msg); + talloc_free(pag); + return NULL; + } + wp = Encoding::write_packet_paging_request(pag_vec); + + /* loop until message is full */ + while (pag) { + /* try to add paging */ + if ((pag->identity_lv[1] & 0x07) == 4) { + /* TMSI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", + ntohl(*((uint32_t *)(pag->identity_lv + 1)))); + len = 1 + 1 + 1 + 32 + 2 + 1; + if (pag->identity_lv[0] != 5) { + LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " + "MI != 5 octets!\n"); + goto continue_next; + } + } else { + /* MI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", + osmo_hexdump(pag->identity_lv + 1, + pag->identity_lv[0])); + len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; + if (pag->identity_lv[0] > 8) { + LOGP(DRLCMAC, LOGL_ERROR, "Paging with " + "MI > 8 octets!\n"); + goto continue_next; + } + } + if (wp + len > 184) { + LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " + "next time\n"); + /* put back paging record, because does not fit */ + llist_add_tail(&pag->list, &paging_list); + break; + } + Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], + pag->identity_lv + 1, pag->chan_needed); + +continue_next: + talloc_free(pag); + pag = dequeue_paging(); + } + + bitvec_pack(pag_vec, msgb_put(msg, 23)); + RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); + bitvec_free(pag_vec); + talloc_free(mac_control_block); + + return msg; +} + +void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag) +{ + llist_add(&pag->list, &paging_list); +} + +void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) +{ + struct gprs_rlcmac_tbf *tbf, *new_tbf; + uint32_t tlli = packet->TLLI; + GprsMs *ms = bts()->ms_by_tlli(tlli); + gprs_rlcmac_ul_tbf *ul_tbf; + + tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", + fn, tlli, trx_no(), ts_no); + if (ms) + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown TBF corresponds to MS with IMSI %s, TA %d, " + "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", + ms->imsi(), ms->ta(), + ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, + ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", + ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, + ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); + TBF_POLL_SCHED_UNSET(tbf); + + /* check if this control ack belongs to packet uplink ack */ + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); + if (ul_tbf->ctrl_ack_to_toggle()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); + + tbf_free(tbf); + return; + } + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { + /* We now know that the PACCH really existed */ + LOGPTBF(new_tbf, LOGL_INFO, + "The TBF has been confirmed on the PACCH, " + "changed type from CCCH to PACCH\n"); + new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + } + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + /* stop pending assignment timer */ + new_tbf->t_stop(T0, "control acked (DL-TBF)"); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); + + tbf_assign_control_ts(new_tbf); + return; + } + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); + + tbf_assign_control_ts(new_tbf); + /* there might be LLC packets waiting in the queue, but the DL + * TBF might have been released while the UL TBF has been + * established */ + if (new_tbf->ms()->need_dl_tbf()) + new_tbf->establish_dl_tbf_on_pacch(); + + return; + } + LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " + "at no request\n"); +} + +void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled! TLLI=0x%08x\n", report->TLLI); + } else { + GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); + if (!ms) + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "but TLLI 0x%08x is unknown\n", report->TLLI); + else + ms->set_ta(sba->ta); + + bts()->sba()->free_sba(sba); + } + gprs_rlcmac_meas_rep(report); +} + +/* Received Uplink RLC control block. */ +int gprs_rlcmac_pdch::rcv_control_block( + const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) +{ + RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + + if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + else + bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + + bts()->rlc_rcvd_control(); + switch (ul_control_block->u.MESSAGE_TYPE) { + case MT_PACKET_CONTROL_ACK: + rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); + break; + case MT_PACKET_DOWNLINK_ACK_NACK: + rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); + break; + case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: + rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); + break; + case MT_PACKET_RESOURCE_REQUEST: + rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); + break; + case MT_PACKET_MEASUREMENT_REPORT: + rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); + break; + case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: + /* ignoring it. change the SI to not force sending these? */ + break; + default: + bts()->decode_error(); + LOGP(DRLCMAC, LOGL_NOTICE, + "RX: [PCU <- BTS] unknown control block(%d) received\n", + ul_control_block->u.MESSAGE_TYPE); + } + talloc_free(ul_control_block); + return 1; +} + +/* received RLC/MAC block from L1 */ +int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas) +{ + GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); + if (!cs) { + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" + "length: %d)\n", len); + return -EINVAL; + } + + bts()->rlc_ul_bytes(len); + + LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " + "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); + + if (cs.isGprs()) + return rcv_block_gprs(data, len, fn, meas, cs); + + if (cs.isEgprs()) + return rcv_data_block(data, len, fn, meas, cs); + + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", + cs.name()); + return -EINVAL; +} + +/*! \brief process egprs and gprs data blocks */ +int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + int rc; + struct gprs_rlc_data_info rlc_dec; + struct gprs_rlcmac_ul_tbf *tbf; + unsigned len = cs.sizeUL(); + + /* These are always data blocks, since EGPRS still uses CS-1 for + * control blocks (see 44.060, section 10.3, 1st par.) + */ + if (cs.isEgprs()) { + if (!bts()->bts_data()->egprs_enabled) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but EGPRS is not enabled\n", + cs.name()); + return -EINVAL; + } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } + + LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); + + rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); + if (rc < 0) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but header parsing has failed\n", + cs.name()); + bts()->decode_error(); + return rc; + } + + LOGP(DRLCMACUL, LOGL_INFO, + "Got %s RLC block: " + "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " + "rc=%d\n", + cs.name(), + rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, + rc); + + /* find TBF inst from given TFI */ + tbf = ul_tbf_by_tfi(rlc_dec.tfi); + if (!tbf) { + LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", + rlc_dec.tfi); + return 0; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); +} + +int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + unsigned payload = data[0] >> 6; + bitvec *block; + int rc = 0; + unsigned len = cs.maxBytesUL(); + + switch (payload) { + case GPRS_RLCMAC_DATA_BLOCK: + rc = rcv_data_block(data, data_len, fn, meas, cs); + break; + case GPRS_RLCMAC_CONTROL_BLOCK: + block = bitvec_alloc(len, tall_pcu_ctx); + if (!block) + return -ENOMEM; + bitvec_unpack(block, data); + rc = rcv_control_block(data, data_len, block, fn); + bitvec_free(block); + break; + case GPRS_RLCMAC_CONTROL_BLOCK_OPT: + LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); + break; + default: + LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); + rc = -EINVAL; + } + + return rc; +} + +void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + if (request->ID.UnionType) { + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + uint32_t tlli = request->ID.u.TLLI; + uint8_t ms_class = 0; + uint8_t egprs_ms_class = 0; + uint8_t ta = GSM48_TA_INVALID; + struct pcu_l1_meas meas; + + GprsMs *ms = bts()->ms_by_tlli(tlli); + /* Keep the ms, even if it gets idle temporarily */ + GprsMs::Guard guard(ms); + + if (ms) { + ul_tbf = ms->ul_tbf(); + dl_tbf = ms->dl_tbf(); + ta = ms->ta(); + } + + /* We got a RACH so the MS was in packet idle mode and thus + * didn't have any active TBFs */ + if (ul_tbf) { + LOGPTBFUL(ul_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", + tlli); + tbf_free(ul_tbf); + ul_tbf = NULL; + } + + if (dl_tbf) { + LOGPTBFUL(dl_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", + tlli); + tbf_free(dl_tbf); + dl_tbf = NULL; + } + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " + "in packet resource request of single " + "block, so we provide one:\n"); + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled!\n"); + } else { + ta = sba->ta; + bts()->sba()->free_sba(sba); + } + if (request->Exist_MS_Radio_Access_capability) { + ms_class = Decoding::get_ms_class_by_capability( + &request->MS_Radio_Access_capability); + egprs_ms_class = + Decoding::get_egprs_ms_class_by_capability( + &request->MS_Radio_Access_capability); + } + if (!ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); + if (egprs_ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, + "MS supports EGPRS multislot class %d.\n", + egprs_ms_class); + ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, + egprs_ms_class, tlli, ta, ms); + + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); + return; + } + + /* set control ts to current MS's TS, until assignment complete */ + LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", + ul_tbf->control_ts, ts_no); + + ul_tbf->control_ts = ts_no; + /* schedule uplink assignment */ + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + + /* get capabilities */ + if (ul_tbf->ms()) + ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); + + /* get measurements */ + if (ul_tbf->ms()) { + get_meas(&meas, request); + ul_tbf->ms()->update_l1_meas(&meas); + } + return; + } + + if (request->ID.u.Global_TFI.UnionType) { + struct gprs_rlcmac_dl_tbf *dl_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; + dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!dl_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); + return; + } + LOGPTBFDL(dl_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + dl_tbf->m_n3101 = 0; + } else { + struct gprs_rlcmac_ul_tbf *ul_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; + ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!ul_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); + return; + } + LOGPTBFUL(ul_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + ul_tbf->m_n3101 = 0; + } +} + +static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) +{ + bts->channel_request_description(); + + /* This call will register the new TBF with the MS on success */ + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), + tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + + /* schedule uplink assignment or reject */ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); + } +} + +void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) +{ + int8_t tfi = 0; /* must be signed */ + struct gprs_rlcmac_dl_tbf *tbf; + struct pcu_l1_meas meas; + int rc; + int num_blocks; + uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; + char show_bits[RLC_EGPRS_MAX_WS + 1]; + bitvec bits; + int bsn_begin, bsn_end; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, + "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); + + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " + "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " + "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", + (int)ack_nack->EGPRS_AckNack.UnionType, + (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, + (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, + (void *)&ack_nack->EGPRS_AckNack.UnionType, + (void *)&ack_nack->EGPRS_AckNack.Desc, + (int)offsetof(EGPRS_AckNack_t, Desc), + (int)offsetof(EGPRS_AckNack_w_len_t, Desc), + tbf->window()->v_a(), + tbf->window()->v_s(), + osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, + sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_egprs_acknack_bits( + &ack_nack->EGPRS_AckNack.Desc, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits) + ); + + rc = tbf->rcvd_dl_ack( + ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + + /* check for channel request */ + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + /* TODO: Implement Measurements parsing for EGPRS */ + /* + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + */ + } +} + +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + gprs_rlcmac_tbf *tbf; + LListHead *pos; + + llist_for_each(pos, tbf_list) { + tbf = pos->entry(); + if (tbf->tfi() != tfi) + continue; + if (!tbf->pdch[ts_no]) + continue; + return tbf; + } + return NULL; +} + +gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) +{ + return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); +} + +gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) +{ + return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); +} + +/* lookup TBF Entity (by TFI) */ +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + struct gprs_rlcmac_tbf *tbf; + + if (tfi >= 32) + return NULL; + + tbf = m_tbfs[dir][tfi]; + + if (!tbf) + return NULL; + + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { + return tbf; + } + + return NULL; +} + +void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + if (m_tbfs[tbf->direction][tbf->tfi()]) + LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " + "%s has not been detached, overwriting it\n", + ts_no, trx_no(), + m_tbfs[tbf->direction][tbf->tfi()]->name()); + + m_num_tbfs[tbf->direction] += 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; + } + m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); + m_tbfs[tbf->direction][tbf->tfi()] = tbf; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); + + m_num_tbfs[tbf->direction] -= 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); + } + m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); + m_tbfs[tbf->direction][tbf->tfi()] = NULL; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) +{ + m_num_reserved[dir] += 1; +} + +void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) +{ + OSMO_ASSERT(m_num_reserved[dir] > 0); + m_num_reserved[dir] -= 1; +} + +inline BTS *gprs_rlcmac_pdch::bts() const +{ + return trx->bts; +} + +uint8_t gprs_rlcmac_pdch::trx_no() const +{ + return trx->trx_no; +} + +inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const +{ + return trx->bts->bts_data(); +} + +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 */ + struct gprs_rlcmac_dl_tbf *tbf; + int rc; + struct pcu_l1_meas meas; + int num_blocks; + uint8_t bits_data[RLC_GPRS_WS/8]; + bitvec bits; + int bsn_begin, bsn_end; + char show_bits[RLC_GPRS_WS + 1]; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_gprs_acknack_bits( + &ack_nack->Ack_Nack_Description, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits)); + + rc = tbf->rcvd_dl_ack( + ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + /* check for channel request */ + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + } +} diff --git a/src/pdch.h b/src/pdch.h new file mode 100644 index 0000000..99eed6f --- /dev/null +++ b/src/pdch.h @@ -0,0 +1,151 @@ +/* pdch.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#include +#include +#include +#include +#include +#include +#include +} +#include +#include +#include +#include +#endif + +#include + +/* + * PDCH instance + */ +struct gprs_rlcmac_pdch { +#ifdef __cplusplus + struct gprs_rlcmac_paging *dequeue_paging(); + struct msgb *packet_paging_request(); + + void add_paging(struct gprs_rlcmac_paging *pag); + + void free_resources(); + + bool is_enabled() const; + + void enable(); + void disable(); + + /* dispatching of messages */ + int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas); + int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + + gprs_rlcmac_bts *bts_data() const; + BTS *bts() const; + uint8_t trx_no() const; + + struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); + + void attach_tbf(gprs_rlcmac_tbf *tbf); + void detach_tbf(gprs_rlcmac_tbf *tbf); + + unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; + + void reserve(enum gprs_rlcmac_tbf_direction dir); + void unreserve(enum gprs_rlcmac_tbf_direction dir); + unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; + + uint8_t assigned_usf() const; + uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; +#endif + + uint8_t m_is_enabled; /* TS is enabled */ + uint8_t tsc; /* TSC of this slot */ + uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ + uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ + uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ + struct llist_head paging_list; /* list of paging messages */ + uint32_t last_rts_fn; /* store last frame number of RTS */ + + /* back pointers */ + struct gprs_rlcmac_trx *trx; + uint8_t ts_no; + +#ifdef __cplusplus +private: + int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); + + void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); + void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); + void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); + void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); + void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); + gprs_rlcmac_tbf *tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); + gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); +#endif + + uint8_t m_num_tbfs[2]; + uint8_t m_num_reserved[2]; + uint8_t m_assigned_usf; /* bit set */ + uint32_t m_assigned_tfi[2]; /* bit set */ + struct gprs_rlcmac_tbf *m_tbfs[2][32]; +}; + +#ifdef __cplusplus + +inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const +{ + return m_num_tbfs[dir]; +} + +inline unsigned gprs_rlcmac_pdch::num_reserved( + enum gprs_rlcmac_tbf_direction dir) const +{ + return gprs_rlcmac_pdch::m_num_reserved[dir]; +} + +inline uint8_t gprs_rlcmac_pdch::assigned_usf() const +{ + return m_assigned_usf; +} + +inline uint32_t gprs_rlcmac_pdch::assigned_tfi( + enum gprs_rlcmac_tbf_direction dir) const +{ + return m_assigned_tfi[dir]; +} + +inline bool gprs_rlcmac_pdch::is_enabled() const +{ + return m_is_enabled; +} + +#endif /* __cplusplus */ diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..26b0c33 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -19,10 +19,11 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include #include #include #include +#include +#include #include extern "C" { diff --git a/src/sba.h b/src/sba.h index d2d3106..1571127 100644 --- a/src/sba.h +++ b/src/sba.h @@ -26,9 +26,10 @@ #include } +#include + struct BTS; class PollController; -struct gprs_rlcmac_pdch; /* * single block allocation entry diff --git a/src/tbf.cpp b/src/tbf.cpp index 672c296..4028afc 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -29,6 +29,10 @@ #include #include #include +#include +#include +#include +#include extern "C" { #include diff --git a/src/tbf.h b/src/tbf.h index bb5fd0a..31756e3 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -25,6 +25,8 @@ #include "rlc.h" #include "cxx_linuxlist.h" #include +#include +#include #include extern "C" { @@ -32,7 +34,6 @@ } struct bssgp_bvc_ctx; -struct pcu_l1_meas; class GprsMs; /* -- To view, visit https://gerrit.osmocom.org/6053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 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 Jan 25 15:06:45 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 25 Jan 2018 15:06:45 +0000 Subject: [PATCH] osmo-pcu[master]: cosmetic: fix whitespace issue with include files Message-ID: Review at https://gerrit.osmocom.org/6065 cosmetic: fix whitespace issue with include files Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc --- M src/pcu_vty_functions.cpp 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/65/6065/1 diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 001164c..eb15aa6 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -29,9 +29,9 @@ #include "cxx_linuxlist.h" extern "C" { -# include -# include -# include +#include +#include +#include } int pcu_vty_config_write_pcu_ext(struct vty *vty) -- To view, visit https://gerrit.osmocom.org/6065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 25 15:09:58 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Thu, 25 Jan 2018 15:09:58 +0000 Subject: [PATCH] osmo-bsc[master]: Remove an unused variable. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6064 to look at the new patch set (#2). Remove an unused variable. Local variable is_lu in rsl_rx_chan_rqd() has been unused since commit 6082a377f57901302816a2e57e75a3f262b7b7e6. Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 --- M src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/64/6064/2 diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index b54fab8..eced0e2 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1860,7 +1860,6 @@ enum gsm_chreq_reason_t chreq_reason; struct gsm_lchan *lchan; uint8_t rqd_ta; - int is_lu; uint16_t arfcn; uint8_t subch; @@ -1892,12 +1891,6 @@ lctype = get_ctype_by_chreq(bts->network, rqd_ref->ra); rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_TOTAL]); - - /* - * We want LOCATION UPDATES to succeed and will assign a TCH - * if we have no SDCCH available. - */ - is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); /* check availability / allocate channel * -- To view, visit https://gerrit.osmocom.org/6064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 15:37:09 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 15:37:09 +0000 Subject: osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:09:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:09:36 +0000 Subject: osmo-pcu[master]: Add tests for find_multi_slots() In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4174703808335c19341cd5b5f4422496d958967f Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:10:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:10:21 +0000 Subject: osmo-pcu[master]: AllocTest: adjust test_alloc_b() In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7e03a85ce96e7d617cecee963759bae589a3a1a Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:11:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:11:26 +0000 Subject: osmo-pcu[master]: AllocTest: expand test output In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu 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 Jan 25 16:11:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:11:57 +0000 Subject: osmo-pcu[master]: AllocTest: remove assumption on max MS class In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu 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 Jan 25 16:12:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:12:55 +0000 Subject: osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Patch Set 11: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 11 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:13:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:13:09 +0000 Subject: [MERGED] osmo-pcu[master]: Add multislot classes from latest spec In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add multislot classes from latest spec ...................................................................... Add multislot classes from latest spec The table B.1 is copy-pasted from 3GPP TS 45.002 and reformatted via Emacs macros into C struct to avoid typos. The test output expanded accordingly. The allocation test expectations and output are adjusted accordingly. Note: classes 35-45 which need TA offset are not properly supported yet. This can be extended once we have such devices available for tests. Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok M tests/alloc/MslotTest.ok 7 files changed, 72,880 insertions(+), 3,439 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1ef2eb99c517f25e7d1e71b985a3e0eb3879eb2c Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:13:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:13:09 +0000 Subject: [MERGED] osmo-pcu[master]: AllocTest: remove assumption on max MS class In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: AllocTest: remove assumption on max MS class ...................................................................... AllocTest: remove assumption on max MS class So far the allocation was only tested up to hardcoded MS class 29. Drop that assumption and test for all supported MS classes. Adjust expected test output as necessary. Note: using mslot_class_max() forces allocation for MS classes 30 and 31 for which no actual data is available (will be added in follow-up patches) which current implementation treats differently depending on TX/RX direction - see gprs_alloc_max_dl_slots_per_ms(). Because of that we have to adjust the expected number of allocations in test_successive_allocation() as well. Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433 Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok 3 files changed, 4,536 insertions(+), 3,196 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/4958 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7737f303d97197ef159b14a19c3312a11f07b433 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:13:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:13:10 +0000 Subject: [MERGED] osmo-pcu[master]: AllocTest: expand test output In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: AllocTest: expand test output ...................................................................... AllocTest: expand test output * print MS classes * unify and print test mode description * print additional info on test completion This only changes meta info about test run but not the actual test output. Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2 Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.ok 2 files changed, 85 insertions(+), 101 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index f84ee69..bbc8c7e 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -432,6 +432,19 @@ TEST_MODE_UL_AFTER_DL, }; +static inline char *test_mode_descr(enum test_mode t) +{ + switch (t) { + case TEST_MODE_UL_ONLY: return (char*)"UL only"; + case TEST_MODE_DL_ONLY: return (char*)"DL only"; + case TEST_MODE_UL_AND_DL: return (char*)"UL and DL"; + case TEST_MODE_DL_AND_UL: return (char*)"DL and UL"; + case TEST_MODE_DL_AFTER_UL: return (char*)"DL after UL"; + case TEST_MODE_UL_AFTER_DL: return (char*)"UL after DL"; + default: return NULL; + } +} + static GprsMs *alloc_tbfs(BTS *the_bts, GprsMs *ms, unsigned ms_class, enum test_mode mode) { @@ -617,7 +630,8 @@ struct gprs_rlcmac_trx *trx; unsigned counter; - printf("Going to test assignment with many TBF, %s\n", text); + printf("Going to test assignment with many TBF, algorithm %s class %u..%u (%s)\n", + text, min_class, max_class, test_mode_descr(mode)); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -631,9 +645,11 @@ counter = alloc_many_tbfs(&the_bts, min_class, max_class, mode); - printf(" Successfully allocated %d UL TBFs\n", counter); + printf(" Successfully allocated %u UL TBFs, algorithm %s class %u..%u (%s)\n", + counter, text, min_class, max_class, test_mode_descr(mode)); if (counter != expect_num) - fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); + fprintf(stderr, " Expected %u TBFs (got %u), algorithm %s class %u..%u (%s)\n", + expect_num, counter, text, min_class, max_class, test_mode_descr(mode)); OSMO_ASSERT(counter == expect_num); @@ -655,7 +671,7 @@ TEST_MODE_DL_ONLY, }; - printf("Going to test assignment with many connections, %s\n", text); + printf("Going to test assignment with many connections, algorithm %s\n", text); bts = the_bts.bts_data(); bts->alloc_algorithm = algo; @@ -690,67 +706,33 @@ printf(" Successfully allocated %d TBFs\n", counter1); if (counter1 != (int)expect_num) - fprintf(stderr, " Expected %d TBFs for %s\n", expect_num, text); + fprintf(stderr, " Expected %d TBFs (got %d) for algorithm %s\n", expect_num, counter1, text); OSMO_ASSERT(expect_num == (unsigned)counter1); } -static void test_successive_allocation() +static inline void test_a_b_dyn(enum test_mode mode, uint8_t exp_A, uint8_t exp_B, uint8_t exp_dyn) { - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, - 35, "algorithm A (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 10 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-12 (UL and DL)"); - test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, - 32, "algorithm B class 1-29 (UL and DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, - 35, "algorithm dynamic class 1-29 (UL and DL)"); - - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AND_UL, - 35, "algorithm A (DL and UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm B class 10 (DL and UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AND_UL, - 32, "algorithm dynamic class 10 (DL and UL)"); - - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_AFTER_UL, - 160, "algorithm A (DL after UL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_AFTER_UL, - 32, "algorithm B class 10 (DL after UL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_AFTER_UL, - 95, "algorithm dynamic class 10 (DL after UL)"); - - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AFTER_DL, - 35, "algorithm A (UL after DL)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AFTER_DL, - 32, "algorithm B class 10 (UL after DL)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_AFTER_DL, - 35, "algorithm dynamic class 10 (UL after DL)"); - - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_ONLY, - 35, "algorithm A (UL only)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_ONLY, - 32, "algorithm B class 10 (UL only)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_UL_ONLY, - 35, "algorithm dynamic class 10 (UL only)"); - - test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_DL_ONLY, - 160, "algorithm A (DL ONLY)"); - test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_DL_ONLY, - 32, "algorithm B class 10 (DL ONLY)"); - test_successive_allocation(alloc_algorithm_dynamic, 10, 10, TEST_MODE_DL_ONLY, - 101, "algorithm dynamic class 10 (DL ONLY)"); + test_successive_allocation(alloc_algorithm_a, 1, 1, mode, exp_A, "A"); + test_successive_allocation(alloc_algorithm_b, 10, 10, mode, exp_B, "B"); + test_successive_allocation(alloc_algorithm_dynamic, 10, 10, mode, exp_dyn, "dynamic"); } -static void test_many_connections() +static void test_successive_allocations() { - test_many_connections(alloc_algorithm_a, 160, "algorithm A"); - test_many_connections(alloc_algorithm_b, 32, "algorithm B"); - test_many_connections(alloc_algorithm_dynamic, 160, "algorithm dynamic"); + test_successive_allocation(alloc_algorithm_a, 1, 1, TEST_MODE_UL_AND_DL, 35, "A"); + test_successive_allocation(alloc_algorithm_b, 10, 10, TEST_MODE_UL_AND_DL, 32, "B"); + test_successive_allocation(alloc_algorithm_b, 12, 12, TEST_MODE_UL_AND_DL, 32, "B"); + + test_successive_allocation(alloc_algorithm_b, 1, 12, TEST_MODE_UL_AND_DL, 32, "B"); + test_successive_allocation(alloc_algorithm_b, 1, 29, TEST_MODE_UL_AND_DL, 32, "B"); + test_successive_allocation(alloc_algorithm_dynamic, 1, 29, TEST_MODE_UL_AND_DL, 35, "dynamic"); + + test_a_b_dyn(TEST_MODE_DL_AND_UL, 35, 32, 32); + test_a_b_dyn(TEST_MODE_DL_AFTER_UL, 160, 32, 95); + test_a_b_dyn(TEST_MODE_UL_AFTER_DL, 35, 32, 35); + test_a_b_dyn(TEST_MODE_UL_ONLY, 35, 32, 35); + test_a_b_dyn(TEST_MODE_DL_ONLY, 160, 32, 101); } static void test_2_consecutive_dl_tbfs() @@ -818,8 +800,10 @@ test_alloc_a(); test_alloc_b(); - test_successive_allocation(); - test_many_connections(); + test_successive_allocations(); + test_many_connections(alloc_algorithm_a, 160, "A"); + test_many_connections(alloc_algorithm_b, 32, "B"); + test_many_connections(alloc_algorithm_dynamic, 160, "dynamic"); test_2_consecutive_dl_tbfs(); return EXIT_SUCCESS; } diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index cbb65aa..a46bedb 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -8588,7 +8588,7 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=27 Mass test: TS0(OOOOOOOO)TS7 MS_Class=28 Mass test: TS0(OOOOOOOO)TS7 MS_Class=29 -Going to test assignment with many TBF, algorithm A (UL and DL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) TBF[0] class 1 reserves ...C.... TBF[0] class 1 reserves ....C... TBF[0] class 1 reserves .....C.. @@ -8624,8 +8624,8 @@ TBF[6] class 1 reserves .....C.. TBF[6] class 1 reserves ......C. TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL and DL) + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL) +Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -8658,8 +8658,8 @@ TBF[29] class 10 reserves ...CD... TBF[30] class 10 reserves ...CD... TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 12 (UL and DL) + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL) +Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) TBF[0] class 12 reserves ...DDCD. TBF[1] class 12 reserves .....DCD TBF[2] class 12 reserves ...DCD.. @@ -8692,8 +8692,8 @@ TBF[29] class 12 reserves ...CD... TBF[30] class 12 reserves ...CD... TBF[31] class 12 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-12 (UL and DL) + Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL) +Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) TBF[0] class 1 reserves ...C.... TBF[1] class 2 reserves ....DC.. TBF[2] class 3 reserves ......DC @@ -8726,8 +8726,8 @@ TBF[29] class 6 reserves ......CD TBF[30] class 7 reserves ...CD... TBF[31] class 8 reserves ...DDCD. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm B class 1-29 (UL and DL) + Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL) +Going to test assignment with many TBF, algorithm B class 1..29 (UL and DL) TBF[0] class 1 reserves ...C.... TBF[1] class 2 reserves ....DC.. TBF[2] class 3 reserves ......DC @@ -8760,8 +8760,8 @@ TBF[29] class 1 reserves ...C.... TBF[30] class 2 reserves ......DC TBF[31] class 3 reserves ....DC.. - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 1-29 (UL and DL) + Successfully allocated 32 UL TBFs, algorithm B class 1..29 (UL and DL) +Going to test assignment with many TBF, algorithm dynamic class 1..29 (UL and DL) TBF[0] class 1 reserves ...C.... TBF[1] class 2 reserves ....DC.. TBF[2] class 3 reserves ......DC @@ -8797,8 +8797,8 @@ TBF[1] class 4 reserves ...C.... TBF[2] class 5 reserves ...C.... TBF[0] class 6 reserves ......C. - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL and UL) + Successfully allocated 35 UL TBFs, algorithm dynamic class 1..29 (UL and DL) +Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) TBF[0] class 1 reserves ...C.... TBF[0] class 1 reserves ....C... TBF[0] class 1 reserves .....C.. @@ -8834,8 +8834,8 @@ TBF[6] class 1 reserves .....C.. TBF[6] class 1 reserves ......C. TBF[6] class 1 reserves .......C - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL and UL) + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL) +Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -8868,8 +8868,8 @@ TBF[29] class 10 reserves ...CD... TBF[30] class 10 reserves .....DDC TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL and UL) + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -8902,8 +8902,8 @@ TBF[29] class 10 reserves ...CD... TBF[30] class 10 reserves .....DDC TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm A (DL after UL) + Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL) +Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) TBF[0] class 1 reserves ...C.... TBF[0] class 1 reserves ....C... TBF[0] class 1 reserves .....C.. @@ -9064,8 +9064,8 @@ TBF[31] class 1 reserves .....C.. TBF[31] class 1 reserves ......C. TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL after UL) + Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL) +Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -9098,8 +9098,8 @@ TBF[29] class 10 reserves .....DCD TBF[30] class 10 reserves ...DCD.. TBF[31] class 10 reserves .....DCD - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL after UL) + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -9195,8 +9195,8 @@ TBF[28] class 10 reserves ......C. TBF[31] class 10 reserves ....C... TBF[30] class 10 reserves ......C. - Successfully allocated 95 UL TBFs -Going to test assignment with many TBF, algorithm A (UL after DL) + Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) TBF[0] class 1 reserves ...U.... TBF[0] class 1 reserves ....U... TBF[0] class 1 reserves .....U.. @@ -9232,8 +9232,8 @@ TBF[6] class 1 reserves .....U.. TBF[6] class 1 reserves ......U. TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL after DL) + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL) +Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) TBF[0] class 10 reserves .....U.. TBF[1] class 10 reserves ......U. TBF[2] class 10 reserves ....U... @@ -9266,8 +9266,8 @@ TBF[29] class 10 reserves ...U.... TBF[30] class 10 reserves .......U TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL after DL) + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) TBF[0] class 10 reserves .....U.. TBF[1] class 10 reserves ......U. TBF[2] class 10 reserves ....U... @@ -9303,8 +9303,8 @@ TBF[0] class 10 reserves ...U.... TBF[1] class 10 reserves ...U.... TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (UL only) + Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL) +Going to test assignment with many TBF, algorithm A class 1..1 (UL only) TBF[0] class 1 reserves ...U.... TBF[0] class 1 reserves ....U... TBF[0] class 1 reserves .....U.. @@ -9340,8 +9340,8 @@ TBF[6] class 1 reserves .....U.. TBF[6] class 1 reserves ......U. TBF[6] class 1 reserves .......U - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (UL only) + Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only) +Going to test assignment with many TBF, algorithm B class 10..10 (UL only) TBF[0] class 10 reserves .....U.. TBF[1] class 10 reserves ......U. TBF[2] class 10 reserves ....U... @@ -9374,8 +9374,8 @@ TBF[29] class 10 reserves ...U.... TBF[30] class 10 reserves ...U.... TBF[31] class 10 reserves ...U.... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (UL only) + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) TBF[0] class 10 reserves .....U.. TBF[1] class 10 reserves ......U. TBF[2] class 10 reserves ....U... @@ -9411,8 +9411,8 @@ TBF[0] class 10 reserves ...U.... TBF[1] class 10 reserves ...U.... TBF[2] class 10 reserves ...U.... - Successfully allocated 35 UL TBFs -Going to test assignment with many TBF, algorithm A (DL ONLY) + Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only) +Going to test assignment with many TBF, algorithm A class 1..1 (DL only) TBF[0] class 1 reserves ...C.... TBF[0] class 1 reserves ....C... TBF[0] class 1 reserves .....C.. @@ -9573,8 +9573,8 @@ TBF[31] class 1 reserves .....C.. TBF[31] class 1 reserves ......C. TBF[31] class 1 reserves .......C - Successfully allocated 160 UL TBFs -Going to test assignment with many TBF, algorithm B class 10 (DL ONLY) + Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only) +Going to test assignment with many TBF, algorithm B class 10..10 (DL only) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -9607,8 +9607,8 @@ TBF[29] class 10 reserves .....DCD TBF[30] class 10 reserves ...CD... TBF[31] class 10 reserves ...CD... - Successfully allocated 32 UL TBFs -Going to test assignment with many TBF, algorithm dynamic class 10 (DL ONLY) + Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only) +Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) TBF[0] class 10 reserves ...DDCD. TBF[1] class 10 reserves .....DCD TBF[2] class 10 reserves ...DCD.. @@ -9710,7 +9710,7 @@ TBF[29] class 10 reserves ....C... TBF[31] class 10 reserves ......C. TBF[31] class 10 reserves .......C - Successfully allocated 101 UL TBFs + Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only) Going to test assignment with many connections, algorithm A TBF[0] class 1 reserves ...C.... TBF[0] class 2 reserves ....C... -- To view, visit https://gerrit.osmocom.org/4957 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30a4b8f561a9677f4e9ded33a051a249bd15a6a2 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu 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 Jan 25 16:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:13:11 +0000 Subject: [MERGED] osmo-pcu[master]: AllocTest: adjust test_alloc_b() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: AllocTest: adjust test_alloc_b() ...................................................................... AllocTest: adjust test_alloc_b() This function contains 3 independent test cases. Let's split them into separate functions to simplify further modifications: * split test cases into separate functions * use them for mass test as well * change function names to avoid confusion * make individual test cases return error instead of failing via assert on allocation failure The top-level test_alloc_b() is used as part of exhaustion tests in test_all_alloc_b() for example, so it's expected that allocation might fail (due to TFI or USF exhaustion for example) eventually. In this case it's better to indicate it to caller instead of failing entire program. The test output does not require any adjustements because we do not exhaust to the point of allocation failure yet. Change-Id: Id7e03a85ce96e7d617cecee963759bae589a3a1a Related: OS#2282 --- M tests/alloc/AllocTest.cpp 1 file changed, 175 insertions(+), 218 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index a88f477..f84ee69 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -166,8 +166,11 @@ test_alloc_a(GPRS_RLCMAC_UL_TBF, 0x1e, 28); } -static void dump_assignment(struct gprs_rlcmac_tbf *tbf, const char *dir) +static void dump_assignment(struct gprs_rlcmac_tbf *tbf, const char *dir, bool verbose) { + if (!verbose) + return; + for (size_t i = 0; i < ARRAY_SIZE(tbf->pdch); ++i) if (tbf->pdch[i]) printf("PDCH[%zu] is used for %s\n", i, dir); @@ -175,8 +178,162 @@ printf("PDCH[%d] is first common for %s\n", tbf->first_common_ts, dir); } -static void test_alloc_b(int ms_class) +#define ENABLE_PDCH(ts_no, enable_flag, trx) \ + if (enable_flag) \ + trx->pdch[ts_no].enable(); + +static inline void enable_ts_on_bts(struct gprs_rlcmac_bts *bts, + bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool ts5, bool ts6, bool ts7) { + struct gprs_rlcmac_trx *trx = &bts->trx[0]; + + ENABLE_PDCH(0, ts0, trx); + ENABLE_PDCH(1, ts1, trx); + ENABLE_PDCH(2, ts2, trx); + ENABLE_PDCH(3, ts3, trx); + ENABLE_PDCH(4, ts4, trx); + ENABLE_PDCH(5, ts5, trx); + ENABLE_PDCH(6, ts6, trx); + ENABLE_PDCH(7, ts7, trx); +} + +static inline bool test_alloc_b_ul_dl(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool ts5, bool ts6, bool ts7, + uint8_t ms_class, bool verbose) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts = the_bts.bts_data(); + gprs_rlcmac_ul_tbf *ul_tbf; + gprs_rlcmac_dl_tbf *dl_tbf; + + if (verbose) + printf("Testing UL then DL assignment.\n"); + + bts->alloc_algorithm = alloc_algorithm_b; + + enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); + + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + if (!ul_tbf) + return false; + + OSMO_ASSERT(ul_tbf->ms()); + OSMO_ASSERT(ul_tbf->ms()->current_trx()); + + dump_assignment(ul_tbf, "UL", verbose); + + /* assume final ack has not been sent */ + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + if (!dl_tbf) + return false; + + dump_assignment(dl_tbf, "DL", verbose); + + OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); + + check_tfi_usage(&the_bts); + + tbf_free(dl_tbf); + tbf_free(ul_tbf); + + return true; +} + +static inline bool test_alloc_b_dl_ul(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool ts5, bool ts6, bool ts7, + uint8_t ms_class, bool verbose) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts = the_bts.bts_data(); + gprs_rlcmac_ul_tbf *ul_tbf; + gprs_rlcmac_dl_tbf *dl_tbf; + + if (verbose) + printf("Testing DL then UL assignment followed by update\n"); + + bts->alloc_algorithm = alloc_algorithm_b; + + enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); + + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + if (!dl_tbf) + return false; + + dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); + + OSMO_ASSERT(dl_tbf->ms()); + OSMO_ASSERT(dl_tbf->ms()->current_trx()); + + dump_assignment(dl_tbf, "DL", verbose); + + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + if (!ul_tbf) + return false; + + ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); + ul_tbf->m_contention_resolution_done = 1; + + dump_assignment(ul_tbf, "UL", verbose); + + OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); + + /* now update the dl_tbf */ + dl_tbf->update(); + dump_assignment(dl_tbf, "DL", verbose); + OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); + + check_tfi_usage(&the_bts); + + tbf_free(dl_tbf); + tbf_free(ul_tbf); + + return true; +} + +static inline bool test_alloc_b_jolly(uint8_t ms_class) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts = the_bts.bts_data(); + int tfi; + uint8_t trx_no; + gprs_rlcmac_tbf *ul_tbf, *dl_tbf; + + printf("Testing jolly example\n"); + + bts->alloc_algorithm = alloc_algorithm_b; + + enable_ts_on_bts(bts, false, true, true, true, true, false, false, false); + + tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); + OSMO_ASSERT(tfi >= 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + if (!ul_tbf) + return false; + + OSMO_ASSERT(ul_tbf->ms()); + OSMO_ASSERT(ul_tbf->ms()->current_trx()); + trx_no = ul_tbf->ms()->current_trx()->trx_no; + dump_assignment(ul_tbf, "UL", true); + + /* assume final ack has not been sent */ + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + if (!dl_tbf) + return false; + + dump_assignment(dl_tbf, "DL", true); + + OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); + + check_tfi_usage(&the_bts); + + tbf_free(dl_tbf); + tbf_free(ul_tbf); + + return true; +} + +static void test_alloc_b_for_ms(uint8_t ms_class) +{ + bool rc; + printf("Going to test multislot assignment MS_CLASS=%d\n", ms_class); /* * PDCH is on TS 6,7,8 and we start with a UL allocation and @@ -184,143 +341,26 @@ * * Uplink assigned and still available.. */ - { - BTS the_bts; - struct gprs_rlcmac_bts *bts; - struct gprs_rlcmac_trx *trx; - uint8_t trx_no; - gprs_rlcmac_tbf *ul_tbf, *dl_tbf; - - printf("Testing UL then DL assignment.\n"); - - bts = the_bts.bts_data(); - bts->alloc_algorithm = alloc_algorithm_b; - - trx = &bts->trx[0]; - trx->pdch[5].enable(); - trx->pdch[6].enable(); - trx->pdch[7].enable(); - - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); - OSMO_ASSERT(ul_tbf); - OSMO_ASSERT(ul_tbf->ms()); - OSMO_ASSERT(ul_tbf->ms()->current_trx()); - trx_no = ul_tbf->ms()->current_trx()->trx_no; - dump_assignment(ul_tbf, "UL"); - - /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); - OSMO_ASSERT(dl_tbf); - dump_assignment(dl_tbf, "DL"); - - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - check_tfi_usage(&the_bts); - - tbf_free(dl_tbf); - tbf_free(ul_tbf); - } + rc = test_alloc_b_ul_dl(false, false, false, false, false, true, true, true, ms_class, true); + if (!rc) + return; /** * Test with the other order.. first DL and then UL */ - { - BTS the_bts; - struct gprs_rlcmac_bts *bts; - struct gprs_rlcmac_trx *trx; - uint8_t trx_no; - - gprs_rlcmac_ul_tbf *ul_tbf; - gprs_rlcmac_dl_tbf *dl_tbf; - - printf("Testing DL then UL assignment followed by update\n"); - - bts = the_bts.bts_data(); - bts->alloc_algorithm = alloc_algorithm_b; - - trx = &bts->trx[0]; - trx->pdch[5].enable(); - trx->pdch[6].enable(); - trx->pdch[7].enable(); - - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); - dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - OSMO_ASSERT(dl_tbf); - OSMO_ASSERT(dl_tbf->ms()); - OSMO_ASSERT(dl_tbf->ms()->current_trx()); - trx_no = dl_tbf->ms()->current_trx()->trx_no; - dump_assignment(dl_tbf, "DL"); - - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); - ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); - ul_tbf->m_contention_resolution_done = 1; - OSMO_ASSERT(ul_tbf); - dump_assignment(ul_tbf, "UL"); - - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - /* now update the dl_tbf */ - dl_tbf->update(); - dump_assignment(dl_tbf, "DL"); - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - check_tfi_usage(&the_bts); - - tbf_free(dl_tbf); - tbf_free(ul_tbf); - } + rc = test_alloc_b_dl_ul(false, false, false, false, false, true, true, true, ms_class, true); + if (!rc) + return; /* Andreas osmocom-pcu example */ - { - BTS the_bts; - struct gprs_rlcmac_bts *bts; - struct gprs_rlcmac_trx *trx; - int tfi; - uint8_t trx_no; - - gprs_rlcmac_tbf *ul_tbf, *dl_tbf; - - printf("Testing jolly example\n"); - - bts = the_bts.bts_data(); - bts->alloc_algorithm = alloc_algorithm_b; - - trx = &bts->trx[0]; - trx->pdch[1].enable(); - trx->pdch[2].enable(); - trx->pdch[3].enable(); - trx->pdch[4].enable(); - - tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); - OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); - OSMO_ASSERT(ul_tbf); - OSMO_ASSERT(ul_tbf->ms()); - OSMO_ASSERT(ul_tbf->ms()->current_trx()); - trx_no = ul_tbf->ms()->current_trx()->trx_no; - dump_assignment(ul_tbf, "UL"); - - /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); - OSMO_ASSERT(dl_tbf); - dump_assignment(dl_tbf, "DL"); - - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - check_tfi_usage(&the_bts); - - tbf_free(dl_tbf); - tbf_free(ul_tbf); - } + test_alloc_b_jolly(ms_class); } -#define ENABLE_PDCH(ts_no, enable_flag, trx) \ - if (enable_flag) \ - trx->pdch[ts_no].enable(); - -static void test_alloc_b(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool ts5, bool ts6, bool ts7, int ms_class) +static void test_alloc_mass(bool ts0, bool ts1, bool ts2, bool ts3, bool ts4, bool ts5, bool ts6, bool ts7, int ms_class) { + bool rc; + /* we can test the allocation failures differently */ if (!ts0 && !ts1 && !ts2 && !ts3 && !ts4 && !ts5 && !ts6 && !ts7) return; @@ -336,97 +376,14 @@ ts7 ? 'O' : 'x', ms_class); fflush(stdout); - { - BTS the_bts; - struct gprs_rlcmac_bts *bts; - struct gprs_rlcmac_trx *trx; - uint8_t trx_no; - - gprs_rlcmac_tbf *ul_tbf, *dl_tbf; - - bts = the_bts.bts_data(); - bts->alloc_algorithm = alloc_algorithm_b; - - trx = &bts->trx[0]; - ENABLE_PDCH(0, ts0, trx); - ENABLE_PDCH(1, ts1, trx); - ENABLE_PDCH(2, ts2, trx); - ENABLE_PDCH(3, ts3, trx); - ENABLE_PDCH(4, ts4, trx); - ENABLE_PDCH(5, ts5, trx); - ENABLE_PDCH(6, ts6, trx); - ENABLE_PDCH(7, ts7, trx); - - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); - OSMO_ASSERT(ul_tbf->ms()); - OSMO_ASSERT(ul_tbf->ms()->current_trx()); - trx_no = ul_tbf->ms()->current_trx()->trx_no; - OSMO_ASSERT(ul_tbf); - - /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); - OSMO_ASSERT(dl_tbf); - - /* verify that both are on the same ts */ - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - check_tfi_usage(&the_bts); - - tbf_free(dl_tbf); - tbf_free(ul_tbf); - } + rc = test_alloc_b_ul_dl(ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7, ms_class, false); + if (!rc) + return; /** * Test with the other order.. first DL and then UL */ - { - BTS the_bts; - struct gprs_rlcmac_bts *bts; - struct gprs_rlcmac_trx *trx; - uint8_t trx_no; - - gprs_rlcmac_ul_tbf *ul_tbf; - gprs_rlcmac_dl_tbf *dl_tbf; - - bts = the_bts.bts_data(); - bts->alloc_algorithm = alloc_algorithm_b; - - trx = &bts->trx[0]; - ENABLE_PDCH(0, ts0, trx); - ENABLE_PDCH(1, ts1, trx); - ENABLE_PDCH(2, ts2, trx); - ENABLE_PDCH(3, ts3, trx); - ENABLE_PDCH(4, ts4, trx); - ENABLE_PDCH(5, ts5, trx); - ENABLE_PDCH(6, ts6, trx); - ENABLE_PDCH(7, ts7, trx); - - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); - OSMO_ASSERT(dl_tbf); - OSMO_ASSERT(dl_tbf->ms()); - OSMO_ASSERT(dl_tbf->ms()->current_trx()); - trx_no = dl_tbf->ms()->current_trx()->trx_no; - dl_tbf->update_ms(0x23, GPRS_RLCMAC_DL_TBF); - - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), trx_no, ms_class, 0, 0); - OSMO_ASSERT(ul_tbf); - ul_tbf->update_ms(0x23, GPRS_RLCMAC_UL_TBF); - ul_tbf->m_contention_resolution_done = 1; - - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - /* now update the dl_tbf */ - dl_tbf->update(); - OSMO_ASSERT(dl_tbf->first_common_ts == ul_tbf->first_common_ts); - - OSMO_ASSERT(ul_tbf->ms_class() == ms_class); - OSMO_ASSERT(dl_tbf->ms_class() == ms_class); - - check_tfi_usage(&the_bts); - - tbf_free(dl_tbf); - tbf_free(ul_tbf); - } + test_alloc_b_dl_ul(ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7, ms_class, false); } static void test_all_alloc_b() @@ -441,13 +398,13 @@ for (uint8_t ts6 = 0; ts6 < 2; ++ts6) for (uint8_t ts7 = 0; ts7 < 2; ++ts7) for (int ms_class = 0; ms_class < 30; ++ms_class) - test_alloc_b(ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7, ms_class); + test_alloc_mass(ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7, ms_class); } static void test_alloc_b() { for (int i = 0; i < 30; ++i) - test_alloc_b(i); + test_alloc_b_for_ms(i); test_all_alloc_b(); } -- To view, visit https://gerrit.osmocom.org/4960 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7e03a85ce96e7d617cecee963759bae589a3a1a Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:13:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:13:11 +0000 Subject: [MERGED] osmo-pcu[master]: Add tests for find_multi_slots() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add tests for find_multi_slots() ...................................................................... Add tests for find_multi_slots() * make function public * add tests Change-Id: I4174703808335c19341cd5b5f4422496d958967f --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M tests/Makefile.am A tests/alloc/MslotTest.cpp A tests/alloc/MslotTest.ok M tests/testsuite.at 6 files changed, 1,353 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index aa773fc..64b6d6c 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -62,6 +62,9 @@ uint8_t block_payload; }; +/* TS allocation internal functions */ +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots); + int gprs_rlcmac_received_lost(struct gprs_rlcmac_dl_tbf *tbf, uint16_t received, uint16_t lost); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5e670d7..471b601 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -443,7 +443,7 @@ return 0; } -static int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) +int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ diff --git a/tests/Makefile.am b/tests/Makefile.am index 04136f5..1595a07 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,7 +1,7 @@ AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) -I$(top_srcdir)/src/ -I$(top_srcdir)/include/ AM_LDFLAGS = -lrt -check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest +check_PROGRAMS = rlcmac/RLCMACTest alloc/AllocTest alloc/MslotTest tbf/TbfTest types/TypesTest ms/MsTest llist/LListTest llc/LlcTest codel/codel_test edge/EdgeTest bitcomp/BitcompTest fn/FnTest noinst_PROGRAMS = emu/pcu_emu rlcmac_RLCMACTest_SOURCES = rlcmac/RLCMACTest.cpp @@ -12,6 +12,14 @@ alloc_AllocTest_SOURCES = alloc/AllocTest.cpp alloc_AllocTest_LDADD = \ + $(top_builddir)/src/libgprs.la \ + $(LIBOSMOGB_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOCORE_LIBS) \ + $(COMMON_LA) + +alloc_MslotTest_SOURCES = alloc/MslotTest.cpp +alloc_MslotTest_LDADD = \ $(top_builddir)/src/libgprs.la \ $(LIBOSMOGB_LIBS) \ $(LIBOSMOGSM_LIBS) \ @@ -124,7 +132,7 @@ tbf/TbfTest.ok tbf/TbfTest.err \ bitcomp/BitcompTest.ok bitcomp/BitcompTest.err \ types/TypesTest.ok types/TypesTest.err \ - ms/MsTest.ok ms/MsTest.err \ + ms/MsTest.ok ms/MsTest.err alloc/MslotTest.ok \ llc/LlcTest.ok llc/LlcTest.err \ llist/LListTest.ok llist/LListTest.err \ codel/codel_test.ok \ diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp new file mode 100644 index 0000000..1fa28bf --- /dev/null +++ b/tests/alloc/MslotTest.cpp @@ -0,0 +1,177 @@ +/* MslotTest.cpp + * + * Copyright (C) 2017 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "gprs_rlcmac.h" +#include "gprs_debug.h" +#include "tbf.h" +#include "bts.h" + +#include +#include +#include + +extern "C" { +#include +#include +#include +#include +} + +/* globals used by the code */ +void *tall_pcu_ctx; +int16_t spoof_mnc = 0, spoof_mcc = 0; + +static inline void test_all_classes(struct gprs_rlcmac_trx *trx, bool clear_masks) +{ + int i, rc; + uint8_t dl_slots = 0, ul_slots = 0; + + for (i = 0; i < 64; i++) { + rc = find_multi_slots(trx, i, &ul_slots, &dl_slots); + + printf(" [%s] multislot class %3u - UL: " OSMO_BIT_SPEC " DL: " OSMO_BIT_SPEC " [%d]\n", + clear_masks ? "SEQ" : "ACC", i, OSMO_BIT_PRINT(ul_slots), OSMO_BIT_PRINT(dl_slots), rc); + + if (rc == -EINVAL) + return; + + if (clear_masks) { + dl_slots = 0; + ul_slots = 0; + } + } +} + +static inline void test_multislot_total_ascending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 0; i < 8; i++) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_total_descending(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + int i; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + for (i = 7; i >= 0; i--) { + printf(" Enabled PDCH %u for multislot tests...\n", i); + trx->pdch[i].enable(); + + test_all_classes(trx, seq); + } +} + +static inline void test_multislot_middle(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[2].enable(); + trx->pdch[3].enable(); + trx->pdch[4].enable(); + + test_all_classes(trx, seq); +} + +static inline void test_multislot_ends(bool seq) +{ + BTS the_bts; + struct gprs_rlcmac_bts *bts; + struct gprs_rlcmac_trx *trx; + + printf("%s(): %s\n", __func__, seq ? "sequential" : "accumulative"); + + bts = the_bts.bts_data(); + + trx = &bts->trx[0]; + + trx->pdch[0].enable(); + trx->pdch[7].enable(); + + test_all_classes(trx, seq); +} + + +int main(int argc, char **argv) +{ + tall_pcu_ctx = talloc_named_const(NULL, 1, "MslotTest context"); + if (!tall_pcu_ctx) + abort(); + + msgb_talloc_ctx_init(tall_pcu_ctx, 0); + + osmo_init_logging(&gprs_log_info); + log_set_use_color(osmo_stderr_target, 0); + log_set_print_filename(osmo_stderr_target, 0); + log_set_log_level(osmo_stderr_target, LOGL_DEBUG); + + test_multislot_total_ascending(true); + test_multislot_total_ascending(false); + + test_multislot_total_descending(true); + test_multislot_total_descending(false); + + test_multislot_middle(true); + test_multislot_middle(false); + + test_multislot_ends(true); + test_multislot_ends(false); + + return EXIT_SUCCESS; +} + +/* + * stubs that should not be reached + */ +extern "C" { +void l1if_pdch_req() { abort(); } +void l1if_connect_pdch() { abort(); } +void l1if_close_pdch() { abort(); } +void l1if_open_pdch() { abort(); } +} diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok new file mode 100644 index 0000000..0cd50c8 --- /dev/null +++ b/tests/alloc/MslotTest.ok @@ -0,0 +1,1156 @@ +test_multislot_total_ascending(): sequential + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 5 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 6 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 7 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 9 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 10 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 11 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 12 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 13 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 14 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 15 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 16 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 17 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 18 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 19 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 20 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 21 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 22 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 23 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 24 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 25 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 26 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 27 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 28 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 29 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 7 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: ......11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 10 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 11 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 12 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 13 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 14 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 15 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 16 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 17 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 18 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 19 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 20 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 21 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 22 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 23 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 24 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 25 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 26 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 27 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 28 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 29 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 11 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 12 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 15 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 16 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 17 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 18 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 19 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 20 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 21 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 22 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 23 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 24 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 25 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 26 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 27 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 28 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 29 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 16 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 17 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 18 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 17 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 18 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 18 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 3 - UL: ......1. DL: ......11 [0] + [SEQ] multislot class 4 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 7 - UL: ......1. DL: .....111 [0] + [SEQ] multislot class 8 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 9 - UL: .....11. DL: .....111 [0] + [SEQ] multislot class 10 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 11 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 12 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 19 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 20 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 21 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 22 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 23 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 24 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 25 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 26 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 27 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 28 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 29 - UL: .....1.. DL: ....1111 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_ascending(): accumulative + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ......11 DL: ......11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: .....11. DL: .....111 [0] + [ACC] multislot class 1 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 2 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 3 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 4 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 5 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 6 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 7 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 8 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 9 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 10 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 11 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 12 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 13 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 14 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 15 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 16 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 17 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 18 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 19 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 20 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 21 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 22 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 23 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 24 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 25 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 26 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 27 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 28 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 29 - UL: ......1. DL: ......1. [0] + [ACC] multislot class 30 - UL: ......1. DL: ......1. [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: .....1.. DL: ....1111 [0] + [ACC] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 2 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 3 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 4 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 5 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 6 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 7 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 8 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 9 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 10 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 11 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 12 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 13 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 14 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 15 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 16 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 17 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 18 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 19 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 20 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 21 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 22 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 23 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 24 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 25 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 26 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 27 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 28 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 29 - UL: .....1.. DL: .....1.. [0] + [ACC] multislot class 30 - UL: .....1.. DL: .....1.. [-22] + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_total_descending(): sequential + Enabled PDCH 7 for multislot tests... + [SEQ] multislot class 0 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 1 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 4 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 5 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 6 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 7 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 8 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 9 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 10 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 11 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 12 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 13 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 14 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 15 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 16 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 17 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 18 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 19 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 20 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 21 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 22 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 23 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 24 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 25 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 26 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 27 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 28 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 29 - UL: 1....... DL: 1....... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 6 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 1 - UL: .1...... DL: .1...... [0] + [SEQ] multislot class 2 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 3 - UL: 1....... DL: 11...... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 5 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 6 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 7 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 11...... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 13 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 14 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 15 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 16 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 17 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 18 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 11...... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 5 for multislot tests... + [SEQ] multislot class 0 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [SEQ] multislot class 2 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 3 - UL: .1...... DL: .11..... [0] + [SEQ] multislot class 4 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 5 - UL: .11..... DL: .11..... [0] + [SEQ] multislot class 6 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 7 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 111..... [0] + [SEQ] multislot class 9 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 10 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 11 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 12 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 13 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 14 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 15 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 16 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 17 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 18 - UL: 111..... DL: 111..... [0] + [SEQ] multislot class 19 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 20 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 21 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 22 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 23 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 24 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 25 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 26 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 27 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 28 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 29 - UL: 11...... DL: 111..... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 4 for multislot tests... + [SEQ] multislot class 0 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [SEQ] multislot class 2 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 3 - UL: ..1..... DL: ..11.... [0] + [SEQ] multislot class 4 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 5 - UL: ..11.... DL: ..11.... [0] + [SEQ] multislot class 6 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 7 - UL: ..1..... DL: .111.... [0] + [SEQ] multislot class 8 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 9 - UL: .11..... DL: .111.... [0] + [SEQ] multislot class 10 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 11 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 12 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 13 - UL: .111.... DL: .111.... [0] + [SEQ] multislot class 14 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 15 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 16 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 17 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 18 - UL: 1111.... DL: 1111.... [0] + [SEQ] multislot class 19 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 20 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 21 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 22 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 23 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 24 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 25 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 26 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 27 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 28 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 29 - UL: .1...... DL: 1111.... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 3 for multislot tests... + [SEQ] multislot class 0 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 1 - UL: ....1... DL: ....1... [0] + [SEQ] multislot class 2 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 3 - UL: ...1.... DL: ...11... [0] + [SEQ] multislot class 4 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 5 - UL: ...11... DL: ...11... [0] + [SEQ] multislot class 6 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 7 - UL: ...1.... DL: ..111... [0] + [SEQ] multislot class 8 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 9 - UL: ..11.... DL: ..111... [0] + [SEQ] multislot class 10 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 11 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 12 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 13 - UL: ..111... DL: ..111... [0] + [SEQ] multislot class 14 - UL: .1111... DL: .1111... [0] + [SEQ] multislot class 15 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 16 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 17 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 18 - UL: 11111... DL: 11111... [0] + [SEQ] multislot class 19 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 20 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 21 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 22 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 23 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 24 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 25 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 26 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 27 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 28 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 29 - UL: ..1..... DL: .1111... [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 2 for multislot tests... + [SEQ] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 11 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 12 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ..1111.. DL: ..1111.. [0] + [SEQ] multislot class 15 - UL: .11111.. DL: .11111.. [0] + [SEQ] multislot class 16 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 17 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 18 - UL: 111111.. DL: 111111.. [0] + [SEQ] multislot class 19 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 20 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 21 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 22 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 23 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 24 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 25 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 26 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 27 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 28 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 29 - UL: ...1.... DL: ..1111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 1 for multislot tests... + [SEQ] multislot class 0 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 1 - UL: ......1. DL: ......1. [0] + [SEQ] multislot class 2 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 3 - UL: .....1.. DL: .....11. [0] + [SEQ] multislot class 4 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 5 - UL: .....11. DL: .....11. [0] + [SEQ] multislot class 6 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 7 - UL: .....1.. DL: ....111. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 9 - UL: ....11.. DL: ....111. [0] + [SEQ] multislot class 10 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 11 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 12 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 13 - UL: ....111. DL: ....111. [0] + [SEQ] multislot class 14 - UL: ...1111. DL: ...1111. [0] + [SEQ] multislot class 15 - UL: ..11111. DL: ..11111. [0] + [SEQ] multislot class 16 - UL: .111111. DL: .111111. [0] + [SEQ] multislot class 17 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 18 - UL: 1111111. DL: 1111111. [0] + [SEQ] multislot class 19 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 20 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 21 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 22 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 23 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 24 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 25 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 26 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 27 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 28 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 29 - UL: ....1... DL: ...1111. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] + Enabled PDCH 0 for multislot tests... + [SEQ] multislot class 0 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 5 - UL: ......11 DL: ......11 [0] + [SEQ] multislot class 6 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 7 - UL: .......1 DL: 1.....11 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 9 - UL: ......11 DL: 1.....11 [0] + [SEQ] multislot class 10 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 11 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 12 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 13 - UL: .....111 DL: .....111 [0] + [SEQ] multislot class 14 - UL: ....1111 DL: ....1111 [0] + [SEQ] multislot class 15 - UL: ...11111 DL: ...11111 [0] + [SEQ] multislot class 16 - UL: ..111111 DL: ..111111 [0] + [SEQ] multislot class 17 - UL: .1111111 DL: .1111111 [0] + [SEQ] multislot class 18 - UL: 11111111 DL: 11111111 [0] + [SEQ] multislot class 19 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 20 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 21 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 22 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 23 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 24 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 25 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 26 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 27 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 28 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 29 - UL: .......1 DL: 11....11 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_total_descending(): accumulative + Enabled PDCH 7 for multislot tests... + [ACC] multislot class 0 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 1 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 2 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 3 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 4 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 5 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 6 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 7 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 8 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 9 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 10 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 11 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 12 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 13 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 14 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 15 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 16 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 17 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 18 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 19 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 20 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 21 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 22 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 23 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 24 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 25 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 26 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 27 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 28 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 29 - UL: 1....... DL: 1....... [0] + [ACC] multislot class 30 - UL: 1....... DL: 1....... [-22] + Enabled PDCH 6 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 11...... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 5 for multislot tests... + [ACC] multislot class 0 - UL: 11...... DL: 111..... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 4 for multislot tests... + [ACC] multislot class 0 - UL: .1...... DL: 1111.... [0] + [ACC] multislot class 1 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 2 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 3 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 4 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 5 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 6 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 7 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 8 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 9 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 10 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 11 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 12 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 13 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 14 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 15 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 16 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 17 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 18 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 19 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 20 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 21 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 22 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 23 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 24 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 25 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 26 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 27 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 28 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 29 - UL: .1...... DL: .1...... [0] + [ACC] multislot class 30 - UL: .1...... DL: .1...... [-22] + Enabled PDCH 3 for multislot tests... + [ACC] multislot class 0 - UL: ..1..... DL: .1111... [0] + [ACC] multislot class 1 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 2 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 3 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 4 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 5 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 6 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 7 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 8 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 9 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 10 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 11 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 12 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 13 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 14 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 15 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 16 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 17 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 18 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 19 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 20 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 21 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 22 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 23 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 24 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 25 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 26 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 27 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 28 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 29 - UL: ..1..... DL: ..1..... [0] + [ACC] multislot class 30 - UL: ..1..... DL: ..1..... [-22] + Enabled PDCH 2 for multislot tests... + [ACC] multislot class 0 - UL: ...1.... DL: ..1111.. [0] + [ACC] multislot class 1 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 2 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 3 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 4 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 5 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 6 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 7 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 8 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 9 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 10 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 11 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 12 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 13 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 14 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 15 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 16 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 17 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 18 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 19 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 20 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 21 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 22 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 23 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 24 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 25 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 26 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 27 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 28 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 29 - UL: ...1.... DL: ...1.... [0] + [ACC] multislot class 30 - UL: ...1.... DL: ...1.... [-22] + Enabled PDCH 1 for multislot tests... + [ACC] multislot class 0 - UL: ....1... DL: ...1111. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] + Enabled PDCH 0 for multislot tests... + [ACC] multislot class 0 - UL: .......1 DL: 11....11 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] +test_multislot_middle(): sequential + [SEQ] multislot class 0 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 1 - UL: .....1.. DL: .....1.. [0] + [SEQ] multislot class 2 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 3 - UL: ....1... DL: ....11.. [0] + [SEQ] multislot class 4 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 5 - UL: ....11.. DL: ....11.. [0] + [SEQ] multislot class 6 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 7 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 8 - UL: ....1... DL: ...111.. [0] + [SEQ] multislot class 9 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 10 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 11 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 12 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 13 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 14 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 15 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 16 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 17 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 18 - UL: ...111.. DL: ...111.. [0] + [SEQ] multislot class 19 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 20 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 21 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 22 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 23 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 24 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 25 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 26 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 27 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 28 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 29 - UL: ...11... DL: ...111.. [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_middle(): accumulative + [ACC] multislot class 0 - UL: ...11... DL: ...111.. [0] + [ACC] multislot class 1 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 2 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 3 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 4 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 5 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 6 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 7 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 8 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 9 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 10 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 11 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 12 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 13 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 14 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 15 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 16 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 17 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 18 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 19 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 20 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 21 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 22 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 23 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 24 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 25 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 26 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 27 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 28 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 29 - UL: ....1... DL: ....1... [0] + [ACC] multislot class 30 - UL: ....1... DL: ....1... [-22] +test_multislot_ends(): sequential + [SEQ] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 1 - UL: .......1 DL: .......1 [0] + [SEQ] multislot class 2 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 3 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 4 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 5 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 6 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 7 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 8 - UL: .......1 DL: 1......1 [0] + [SEQ] multislot class 9 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 10 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 11 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 12 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 13 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 14 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 15 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 16 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 17 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 18 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 19 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 20 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 21 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 22 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 23 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 24 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 25 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 26 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 27 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 28 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 29 - UL: 1......1 DL: 1......1 [0] + [SEQ] multislot class 30 - UL: ........ DL: ........ [-22] +test_multislot_ends(): accumulative + [ACC] multislot class 0 - UL: 1......1 DL: 1......1 [0] + [ACC] multislot class 1 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 2 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 3 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 4 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 5 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 6 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 7 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 8 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 9 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 10 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 11 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 12 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 13 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 14 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 15 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 16 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 17 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 18 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 19 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 20 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 21 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 22 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 23 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 24 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 25 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 26 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 27 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 28 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 29 - UL: .......1 DL: .......1 [0] + [ACC] multislot class 30 - UL: .......1 DL: .......1 [-22] diff --git a/tests/testsuite.at b/tests/testsuite.at index d8f8f9a..86f45a8 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -9,6 +9,12 @@ AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/rlcmac/RLCMACTest], [0], [expout], [experr]) AT_CLEANUP +AT_SETUP([multi_slot]) +AT_KEYWORDS([multi_slot]) +cat $abs_srcdir/alloc/MslotTest.ok > expout +AT_CHECK([$OSMO_QEMU $abs_top_builddir/tests/alloc/MslotTest], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([ts_alloc]) AT_KEYWORDS([ts_alloc]) cat $abs_srcdir/alloc/AllocTest.ok > expout -- To view, visit https://gerrit.osmocom.org/4636 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4174703808335c19341cd5b5f4422496d958967f Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:14:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:14:08 +0000 Subject: osmo-msc[master]: Add a VTY command which deletes all expired SMS. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:14:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:14:45 +0000 Subject: osmo-pcu[master]: cosmetic: fix whitespace issue with include files In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc 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 Jan 25 16:16:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:16:16 +0000 Subject: [MERGED] osmo-msc[master]: Add a VTY command which deletes all expired SMS. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add a VTY command which deletes all expired SMS. ...................................................................... Add a VTY command which deletes all expired SMS. We already delete SMS which have been sent successfully. However, there are plans to accept SMS for any subscriber in order to fix the problem described in https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). This means we may end up storing SMS which never get sent, e.g. because the B subscriber doesn't actually exist. This could lead to a higher degree of SMS database growth over time, and therefore we need a way to keep database size under control. As a first step, introduce a DB function which removes an expired SMS, and add a VTY command which removes all expired SMS from the DB. Later commits will build upon this to remove expired SMS automatically. The SMS expiry time period is currently hard-coded to 2 weeks. We could make this configurable in the future if desired. Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Related: OS#2354 --- M include/osmocom/msc/db.h M include/osmocom/msc/sms_queue.h M src/libmsc/db.c M src/libmsc/sms_queue.c M src/libmsc/vty_interface_layer3.c 5 files changed, 85 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 13c5ed3..2105d38 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -50,6 +50,7 @@ int db_sms_inc_deliver_attempts(struct gsm_sms *sms); int db_sms_delete_by_msisdn(const char *msisdn); int db_sms_delete_sent_message_by_id(unsigned long long sms_id); +int db_sms_delete_expired_message_by_id(unsigned long long sms_id); /* Statistics counter storage */ struct osmo_counter; diff --git a/include/osmocom/msc/sms_queue.h b/include/osmocom/msc/sms_queue.h index 2a8bd58..b5488fe 100644 --- a/include/osmocom/msc/sms_queue.h +++ b/include/osmocom/msc/sms_queue.h @@ -13,5 +13,6 @@ int sms_queue_set_max_pending(struct gsm_sms_queue *, int max); int sms_queue_set_max_failure(struct gsm_sms_queue *, int fail); int sms_queue_clear(struct gsm_sms_queue *); +int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id); #endif diff --git a/src/libmsc/db.c b/src/libmsc/db.c index b48d137..c21aa70 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -989,6 +989,43 @@ return 0; } +int db_sms_delete_expired_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + time_t created, validity_timestamp, now, min_created; + + result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + if (!result) + return -1; + if (!next_row(result)) { + dbi_result_free(result); + return -1; + } + + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + dbi_result_free(result); + + now = time(NULL); + if (validity_timestamp > now) + return -1; + + /* Our SMS expiry threshold is hard-coded to roughly 2 weeks at the moment. */ + min_created = now - (time_t)(60 * 60 * 24 * 7 * 2); + if (min_created < 0) /* bogus system clock? */ + return -1; + if (created >= min_created) /* not yet expired */ + return -1; + + result = dbi_conn_queryf(conn, "DELETE FROM SMS WHERE id = %llu", sms_id); + if (!result) { + LOGP(DDB, LOGL_ERROR, "Failed to delete SMS %llu.\n", sms_id); + return -1; + } + dbi_result_free(result); + return 0; +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 3d39a0e..193d023 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -72,21 +72,21 @@ static int sms_sms_cb(unsigned int, unsigned int, void *, void *); static struct gsm_sms_pending *sms_find_pending(struct gsm_sms_queue *smsq, - struct gsm_sms *sms) + unsigned long long sms_id) { struct gsm_sms_pending *pending; llist_for_each_entry(pending, &smsq->pending_sms, entry) { - if (pending->sms_id == sms->id) + if (pending->sms_id == sms_id) return pending; } return NULL; } -static int sms_is_in_pending(struct gsm_sms_queue *smsq, struct gsm_sms *sms) +int sms_queue_sms_is_pending(struct gsm_sms_queue *smsq, unsigned long long sms_id) { - return sms_find_pending(smsq, sms) != NULL; + return sms_find_pending(smsq, sms_id) != NULL; } static struct gsm_sms_pending *sms_subscriber_find_pending( @@ -286,7 +286,7 @@ } /* no need to send a pending sms */ - if (sms_is_in_pending(smsq, sms)) { + if (sms_queue_sms_is_pending(smsq, sms->id)) { LOGP(DLSMS, LOGL_DEBUG, "SMSqueue with pending sms: %llu. Skipping\n", sms->id); sms_free(sms); @@ -337,7 +337,7 @@ goto no_pending_sms; /* The sms should not be scheduled right now */ - OSMO_ASSERT(!sms_is_in_pending(smsq, sms)); + OSMO_ASSERT(!sms_queue_sms_is_pending(smsq, sms->id)); /* Remember that we deliver this SMS and send it */ pending = sms_pending_from(smsq, sms); @@ -472,7 +472,7 @@ * sms that are not in our control as we just have a channel * open anyway. */ - pending = sms_find_pending(network->sms_queue, sig_sms->sms); + pending = sms_find_pending(network->sms_queue, sig_sms->sms->id); if (!pending) return 0; diff --git a/src/libmsc/vty_interface_layer3.c b/src/libmsc/vty_interface_layer3.c index f8fc098..fb6d32a 100644 --- a/src/libmsc/vty_interface_layer3.c +++ b/src/libmsc/vty_interface_layer3.c @@ -161,6 +161,44 @@ return CMD_SUCCESS; } + +DEFUN(sms_delete_expired, + sms_delete_expired_cmd, + "sms delete expired", + "SMS related commands\n" "SMS Database related commands\n" + "Delete all expired SMS") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + struct gsm_sms *sms; + unsigned long long sms_id = 0; + long long num_deleted = 0; + + while (1) { + sms = db_sms_get_next_unsent(gsmnet, sms_id, UINT_MAX); + if (!sms) + break; + + /* Skip SMS which are currently queued for sending. */ + if (sms_queue_sms_is_pending(gsmnet->sms_queue, sms->id)) + continue; + + /* Expiration check is performed by the DB layer. */ + if (db_sms_delete_expired_message_by_id(sms->id) == 0) + num_deleted++; + + sms_id = sms->id + 1; + } + + if (num_deleted == 0) { + vty_out(vty, "No expired SMS in database%s", VTY_NEWLINE); + return CMD_WARNING; + } + + vty_out(vty, "Deleted %llu expired SMS from database%s", num_deleted, VTY_NEWLINE); + return CMD_SUCCESS; +} + + static int _send_sms_str(struct vlr_subscr *receiver, struct vlr_subscr *sender, char *str, uint8_t tp_pid) @@ -861,6 +899,7 @@ install_element_ve(&show_subscr_cache_cmd); install_element_ve(&sms_send_pend_cmd); + install_element_ve(&sms_delete_expired_cmd); install_element_ve(&subscriber_create_cmd); install_element_ve(&subscriber_send_sms_cmd); -- To view, visit https://gerrit.osmocom.org/5989 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Gerrit-PatchSet: 3 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:16:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:16:57 +0000 Subject: osmo-bsc[master]: Remove an unused variable. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling 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 Jan 25 16:17:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 16:17:01 +0000 Subject: [MERGED] osmo-bsc[master]: Remove an unused variable. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove an unused variable. ...................................................................... Remove an unused variable. Local variable is_lu in rsl_rx_chan_rqd() has been unused since commit 6082a377f57901302816a2e57e75a3f262b7b7e6. Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 --- M src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index b54fab8..eced0e2 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1860,7 +1860,6 @@ enum gsm_chreq_reason_t chreq_reason; struct gsm_lchan *lchan; uint8_t rqd_ta; - int is_lu; uint16_t arfcn; uint8_t subch; @@ -1892,12 +1891,6 @@ lctype = get_ctype_by_chreq(bts->network, rqd_ref->ra); rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_TOTAL]); - - /* - * We want LOCATION UPDATES to succeed and will assign a TCH - * if we have no SDCCH available. - */ - is_lu = !!(chreq_reason == GSM_CHREQ_REASON_LOCATION_UPD); /* check availability / allocate channel * -- To view, visit https://gerrit.osmocom.org/6064 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I67594afcfa4104e91352d50f40ae9f2bc20f4cd1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 16:24:34 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 25 Jan 2018 16:24:34 +0000 Subject: [MERGED] osmo-pcu[master]: cosmetic: fix whitespace issue with include files In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: cosmetic: fix whitespace issue with include files ...................................................................... cosmetic: fix whitespace issue with include files Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc --- M src/pcu_vty_functions.cpp 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 001164c..eb15aa6 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -29,9 +29,9 @@ #include "cxx_linuxlist.h" extern "C" { -# include -# include -# include +#include +#include +#include } int pcu_vty_config_write_pcu_ext(struct vty *vty) -- To view, visit https://gerrit.osmocom.org/6065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I401fe88f5bd1665becd6fe6d4204b3877d548ccc 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 Jan 25 16:48:21 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 25 Jan 2018 16:48:21 +0000 Subject: osmo-msc[master]: WIP: VTY: Add 'show connections' and 'show transactions' com... In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/6050/1//COMMIT_MSG Commit Message: Line 18: Change-Id: I1c457c1eac20188f67b8379a36cfda3a085fcef4 cosmetic: is it related to https://osmocom.org/issues/2855? https://gerrit.osmocom.org/#/c/6050/1/src/libmsc/vty_interface_layer3.c File src/libmsc/vty_interface_layer3.c: Line 120: default: What about GSM48_PDISC_USSD / GSM48_PDISC_NC_SS? -- To view, visit https://gerrit.osmocom.org/6050 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1c457c1eac20188f67b8379a36cfda3a085fcef4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:00 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp.c: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/6066 gtp.c: Fix trailing whitespace Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 --- M gtp/gtp.c 1 file changed, 28 insertions(+), 28 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/66/6066/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 0d6d896..8652470 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,19 +1,19 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2010-2011, 2016-2017 Harald Welte * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* * gtp.c: Contains all GTP functionality. Should be able to handle multiple - * tunnels in the same program. + * tunnels in the same program. * * TODO: * - Do we need to handle fragmentation? @@ -326,19 +326,19 @@ /* *********************************************************** * Reliable delivery of signalling messages - * + * * Sequence numbers are used for both signalling messages and * data messages. * * For data messages each tunnel maintains a sequence counter, * which is incremented by one each time a new data message * is sent. The sequence number starts at (0) zero at tunnel - * establishment, and wraps around at 65535 (29.060 9.3.1.1 + * establishment, and wraps around at 65535 (29.060 9.3.1.1 * and 09.60 8.1.1.1). The sequence numbers are either ignored, * or can be used to check the validity of the message in the * receiver, or for reordering af packets. * - * For signalling messages the sequence number is used by + * For signalling messages the sequence number is used by * signalling messages for which a response is defined. A response * message should copy the sequence from the corresponding request * message. The sequence number "unambiguously" identifies a request @@ -356,7 +356,7 @@ * with path setup and teardown. * * If a response message is lost, the request will be retransmitted, and - * the receiving GSN will receive a "duplicated" request. The standard + * the receiving GSN will receive a "duplicated" request. The standard * requires the receiving GSN to send a response, with the same information * as in the original response. For most messages this happens automatically: * @@ -371,22 +371,22 @@ * a nonexist reply message. * * The correct solution will be to make a queue containing response messages. - * This queue should be checked whenever a request is received. If the + * This queue should be checked whenever a request is received. If the * response is allready in the queue that response should be transmitted. * It should be possible to find messages in this queue on the basis of * the sequence number and peer GSN IP address (The sequense number is unique * within each path). This need to be implemented by a hash table. Furthermore * it should be possibly to delete messages based on a timeout. This can be * achieved by means of a linked list. The timeout value need to be larger - * than T3-RESPONSE * N3-REQUESTS (recommended value 5). These timers are + * than T3-RESPONSE * N3-REQUESTS (recommended value 5). These timers are * set in the peer GSN, so there is no way to know these parameters. On the * other hand the timeout value need to be so small that we do not receive * wraparound sequence numbere before the message is deleted. 60 seconds is * probably not a bad choise. - * + * * This queue however is first really needed from gtp1. * - * gtp_req: + * gtp_req: * Send off a signalling message with appropiate sequence * number. Store packet in queue. * gtp_conf: @@ -897,7 +897,7 @@ * For response messages we need to be able to respond to * the relevant src port even if it is locally allocated by * the peer. - * + * * The need for path management! * We might need to keep a list of active paths. This might * be in the form of remote IP address + UDP port numbers. @@ -987,9 +987,9 @@ /* This message is somewhat special in that it actually is a * response to some other message with unsupported GTP version * For this reason it has parameters like a response, and does - * its own message transmission. No signalling queue is used + * its own message transmission. No signalling queue is used * The reply is sent to the peer IP and peer UDP. This means that - * the peer will be receiving a GTP0 message on a GTP1 port! + * the peer will be receiving a GTP0 message on a GTP1 port! * In practice however this will never happen as a GTP0 GSN will * only listen to the GTP0 port, and therefore will never receive * anything else than GTP0 */ @@ -1052,7 +1052,7 @@ * Messages: create, update and delete PDP context * * Information storage - * Information storage for each PDP context is defined in + * Information storage for each PDP context is defined in * 23.060 section 13.3. Includes IMSI, MSISDN, APN, PDP-type, * PDP-address (IP address), sequence numbers, charging ID. * For the SGSN it also includes radio related mobility @@ -1138,7 +1138,7 @@ pdp->cch_pdp); } - /* TODO + /* TODO gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_REF, pdp->traceref); gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_TYPE, @@ -1582,7 +1582,7 @@ (!memcmp(pdp->msisdn.v, pdp_old->msisdn.v, pdp->msisdn.l))) { /* OK! We are dealing with the same APN. We will copy new - * parameters to the old pdp and send off confirmation + * parameters to the old pdp and send off confirmation * We ignore the following information elements: * QoS: MS will get originally negotiated QoS. * End user address (EUA). MS will get old EUA anyway. @@ -1898,14 +1898,14 @@ gtpie_tv1(&packet, &length, GTP_MAX, GTPIE_NSAPI, pdp->nsapi); - /* TODO + /* TODO gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_REF, pdp->traceref); gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_TYPE, pdp->tracetype); */ /* TODO if ggsn update message - gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, + gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, pdp->eua.l, pdp->eua.v); */ @@ -1977,8 +1977,8 @@ gtpie_tv4(&packet, &length, GTP_MAX, GTPIE_CHARGING_ID, pdp->teid_own); - /* If ggsn - gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, + /* If ggsn + gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, pdp->eua.l, pdp->eua.v); */ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_GSN_ADDR, @@ -2172,7 +2172,7 @@ GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Missing mandatory information field"); memcpy(pdp, &pdp_backup, sizeof(pdp_backup)); - return gtp_update_pdp_resp(gsn, version, pdp, + return gtp_update_pdp_resp(gsn, version, pdp, GTPCAUSE_MAN_IE_MISSING); } */ @@ -2442,7 +2442,7 @@ if (pdp_getgtp1 (&secondary_pdp, linked_pdp->secondary_tei[n])) { - LOGP(DLGTP, LOGL_ERROR, + LOGP(DLGTP, LOGL_ERROR, "Unknown secondary PDP context\n"); return EOF; } @@ -2745,10 +2745,10 @@ return 0; } -/* Receives GTP packet and sends off for further processing +/* Receives GTP packet and sends off for further processing * Function will check the validity of the header. If the header - * is not valid the packet is either dropped or a version not - * supported is returned to the peer. + * is not valid the packet is either dropped or a version not + * supported is returned to the peer. * TODO: Need to decide on return values! */ int gtp_decaps0(struct gsn_t *gsn) { @@ -3298,7 +3298,7 @@ /* *********************************************************** * IP address conversion functions * There exist several types of address representations: - * - eua: End User Address. (29.060, 7.7.27, message type 128) + * - eua: End User Address. (29.060, 7.7.27, message type 128) * Used for signalling address to mobile station. Supports IPv4 * IPv6 x.25 etc. etc. * - gsna: GSN Address. (29.060, 7.7.32, message type 133): IP address -- To view, visit https://gerrit.osmocom.org/6066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:00 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp.c: Determine GTP version from header Message-ID: Review at https://gerrit.osmocom.org/6067 gtp.c: Determine GTP version from header Change-Id: I843071a090e877fd529e1e0b799df3585bf836d8 --- M gtp/gtp.c 1 file changed, 14 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/67/6067/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 8652470..f513b9b 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2757,7 +2757,7 @@ socklen_t peerlen; int status; struct gtp0_header *pheader; - int version = 0; /* GTP version should be determined from header! */ + uint8_t version; int fd = gsn->fd0; /* TODO: Need strategy of userspace buffering and blocking */ @@ -2793,12 +2793,14 @@ pheader = (struct gtp0_header *)(buffer); + version = GTPHDR_F_GET_VER(pheader->flags); + /* Version should be gtp0 (or earlier) */ /* 09.60 is somewhat unclear on this issue. On gsn->fd0 we expect only */ /* GTP 0 messages. If other version message is received we reply that we */ /* only support version 0, implying that this is the only version */ /* supported on this port */ - if (GTPHDR_F_GET_VER(pheader->flags) > 0) { + if (version > 0) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2902,7 +2904,7 @@ socklen_t peerlen; int status; struct gtp1_header_short *pheader; - int version = 1; /* TODO GTP version should be determined from header! */ + uint8_t version; int fd = gsn->fd1c; /* TODO: Need strategy of userspace buffering and blocking */ @@ -2938,8 +2940,10 @@ pheader = (struct gtp1_header_short *)(buffer); + version = GTPHDR_F_GET_VER(pheader->flags); + /* Version must be no larger than GTP 1 */ - if (GTPHDR_F_GET_VER(pheader->flags) > 1) { + if (version > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2952,7 +2956,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (GTPHDR_F_GET_VER(pheader->flags) < 1) { + if (version < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3077,7 +3081,7 @@ socklen_t peerlen; int status; struct gtp1_header_short *pheader; - int version = 1; /* GTP version should be determined from header! */ + uint8_t version; int fd = gsn->fd1u; /* TODO: Need strategy of userspace buffering and blocking */ @@ -3114,8 +3118,10 @@ pheader = (struct gtp1_header_short *)(buffer); + version = GTPHDR_F_GET_VER(pheader->flags); + /* Version must be no larger than GTP 1 */ - if (GTPHDR_F_GET_VER(pheader->flags) > 1) { + if (version > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3127,7 +3133,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (GTPHDR_F_GET_VER(pheader->flags) < 1) { + if (version < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); -- To view, visit https://gerrit.osmocom.org/6067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I843071a090e877fd529e1e0b799df3585bf836d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:00 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:00 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp.c: Log unsupported GTP version number Message-ID: Review at https://gerrit.osmocom.org/6068 gtp.c: Log unsupported GTP version number Change-Id: Idbc6e4c912b958bde5916b87ec53c3c4db70bee0 --- M gtp/gtp.c 1 file changed, 10 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/68/6068/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index f513b9b..53b38de 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2802,8 +2802,8 @@ /* supported on this port */ if (version > 0) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); gtp_unsup_req(gsn, 0, &peer, gsn->fd0, buffer, status); /* 29.60: 11.1.1 */ continue; } @@ -2945,8 +2945,8 @@ /* Version must be no larger than GTP 1 */ if (version > 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); gtp_unsup_req(gsn, version, &peer, fd, buffer, status); /*29.60: 11.1.1 */ continue; @@ -2958,8 +2958,8 @@ /* the message */ if (version < 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); continue; } @@ -3123,8 +3123,8 @@ /* Version must be no larger than GTP 1 */ if (version > 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); gtp_unsup_req(gsn, 1, &peer, gsn->fd1c, buffer, status); /*29.60: 11.1.1 */ continue; } @@ -3135,8 +3135,8 @@ /* the message */ if (version < 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); continue; } -- To view, visit https://gerrit.osmocom.org/6068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idbc6e4c912b958bde5916b87ec53c3c4db70bee0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:01 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/pdp: Fix trailing whitespace Message-ID: Review at https://gerrit.osmocom.org/6069 gtp/pdp: Fix trailing whitespace Change-Id: I1bc65ef9af1144779ee91a2c9b9887233ad15671 --- M gtp/pdp.c M gtp/pdp.h 2 files changed, 30 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/69/6069/1 diff --git a/gtp/pdp.c b/gtp/pdp.c index b1e1ff3..c245fed 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,17 +1,17 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* - * pdp.c: + * pdp.c: * */ @@ -44,17 +44,17 @@ * Functions related to PDP storage * * Lifecycle - * For a GGSN pdp context life begins with the reception of a + * For a GGSN pdp context life begins with the reception of a * create pdp context request. It normally ends with the reception * of a delete pdp context request, but will also end with the - * reception of an error indication message. + * reception of an error indication message. * Provisions should probably be made for terminating pdp contexts - * based on either idle timeout, or by sending downlink probe + * based on either idle timeout, or by sending downlink probe * messages (ping?) to see if the MS is still responding. - * + * * For an SGSN pdp context life begins with the application just * before sending off a create pdp context request. It normally - * ends when a delete pdp context response message is received + * ends when a delete pdp context response message is received * from the GGSN, but should also end when with the reception of * an error indication message. * @@ -64,15 +64,15 @@ * Downlink packets received in the GGSN are identified only by their * network interface together with their destination IP address (Two * network interfaces can use the same private IP address). Each IMSI - * (mobile station) can have several PDP contexts using the same IP + * (mobile station) can have several PDP contexts using the same IP * address. In this case the traffic flow template (TFT) is used to - * determine the correct PDP context for a particular IMSI. Also it + * determine the correct PDP context for a particular IMSI. Also it * should be possible for each PDP context to use several IP adresses * For fixed wireless access a mobile station might need a full class * C network. Even in the case of several IP adresses the PDP context * should be determined on the basis of the network IP address. * Thus we need a hash table based on network interface + IP address. - * + * * Uplink packets are for GTP0 identified by their IMSI and NSAPI, which * is collectively called the tunnel identifier. There is also a 16 bit * flow label that can be used for identification of uplink packets. This @@ -85,7 +85,7 @@ * Thus we need a hash table based on TID (IMSI and NSAPI). The TEID will * be used for directly addressing the PDP context. - * pdp_newpdp + * pdp_newpdp * Gives you a pdp context with no hash references In some way * this should have a limited lifetime. * @@ -296,7 +296,7 @@ /#printf("IPhash %ld\n", lookup(eua->v, eua->l, ipif) % PDP_MAX);#/ return (lookup(eua->v, eua->l, ipif) % PDP_MAX); } - + int pdp_ipset(struct pdp_t *pdp, void* ipif, struct ul66_t *eua) { int hash; struct pdp_t *pdp2; @@ -304,7 +304,7 @@ if (PDP_DEBUG) printf("Begin pdp_ipset %d %d %2x%2x%2x%2x\n", (unsigned) ipif, eua->l, - eua->v[2], eua->v[3], + eua->v[2], eua->v[3], eua->v[4], eua->v[5]); pdp->ipnext = NULL; @@ -316,9 +316,9 @@ for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) pdp_prev = pdp2; - if (!pdp_prev) + if (!pdp_prev) haship[hash] = pdp; - else + else pdp_prev->ipnext = pdp; if (PDP_DEBUG) printf("End pdp_ipset\n"); return 0; @@ -331,9 +331,9 @@ if (PDP_DEBUG) printf("Begin pdp_ipdel\n"); for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) { if (pdp2 == pdp) { - if (!pdp_prev) + if (!pdp_prev) haship[hash] = pdp2->ipnext; - else + else pdp_prev->ipnext = pdp2->ipnext; if (PDP_DEBUG) printf("End pdp_ipdel: PDP found\n"); return 0; @@ -347,17 +347,17 @@ int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua) { int hash = pdp_iphash(ipif, eua); struct pdp_t *pdp2; - /#printf("Begin pdp_ipget %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l, + /#printf("Begin pdp_ipget %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l, eua->v[2],eua->v[3],eua->v[4],eua->v[5]);#/ for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) { - if ((pdp2->ipif == ipif) && (pdp2->eua.l == eua->l) && + if ((pdp2->ipif == ipif) && (pdp2->eua.l == eua->l) && (memcmp(&pdp2->eua.v, &eua->v, eua->l) == 0)) { *pdp = pdp2; /#printf("End pdp_ipget. Found\n");#/ return 0; } } - if (PDP_DEBUG) printf("End pdp_ipget Notfound %d %d %2x%2x%2x%2x\n", + if (PDP_DEBUG) printf("End pdp_ipget Notfound %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l, eua->v[2],eua->v[3],eua->v[4],eua->v[5]); return EOF; /# End of linked list and not found #/ } diff --git a/gtp/pdp.h b/gtp/pdp.h index b581952..f8955bb 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,13 +1,13 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. * Copyright (C) 2017 Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #ifndef _PDP_H @@ -72,16 +72,16 @@ * and 09.60. * 31 * 4 + 15 structs + = 120 + 15 structs ~ 2k / context * Structs: IP address 16+4 bytes (6), APN 255 bytes (2) - * QOS: 255 bytes (3), msisdn 16 bytes (1), + * QOS: 255 bytes (3), msisdn 16 bytes (1), * * TODO: We need to consider who manages the pdp_t hash tables * Is it gtp_lib, or is it the application? - * I suppose that it will be gtp_lib. + * I suppose that it will be gtp_lib. * SGSN will ask gtplib for new pdp_t. Fill out the fields, * and pass it on to gtp_create_pdp_req. * GGSN will receive gtp_create_pdp_ind, create new pdp_t and * send responce to SGSN. - * SGSN will receive response and gtplib will find the + * SGSN will receive response and gtplib will find the * original pdp_t corresponding to the request. This will be * passed on to the application. * Eventually the SGSN will close the connection, and the @@ -89,10 +89,10 @@ * This means that gtplib need to have functions to * allocate, free, sort and find pdp_t * (newpdp, freepdp, getpdp) - * Hash tables: TID, IMSI, IP etc.) + * Hash tables: TID, IMSI, IP etc.) * * - * Secondary PDP Context Activation Procedure + * Secondary PDP Context Activation Procedure * * With GTP version 1 it is possible to establish multiple PDP * contexts with the same IP address. With this scheme the first -- To view, visit https://gerrit.osmocom.org/6069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1bc65ef9af1144779ee91a2c9b9887233ad15671 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:01 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton Message-ID: Review at https://gerrit.osmocom.org/6070 gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b --- M gtp/pdp.c M gtp/pdp.h 2 files changed, 0 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/70/6070/1 diff --git a/gtp/pdp.c b/gtp/pdp.c index c245fed..a630ee9 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -364,24 +364,6 @@ */ /* Various conversion functions */ -int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua) -{ - eua->l = 6; - eua->v[0] = PDP_EUA_ORG_IETF; - eua->v[1] = PDP_EUA_TYPE_v4; - memcpy(&eua->v[2], src, 4); /* Copy a 4 byte address */ - return 0; -} - -int pdp_euaton(struct ul66_t *eua, struct in_addr *dst) -{ - if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) { - return EOF; - } - memcpy(dst, &eua->v[2], 4); /* Copy a 4 byte address */ - return 0; -} - uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi) { return (imsi & 0x0fffffffffffffffull) + ((uint64_t) nsapi << 60); diff --git a/gtp/pdp.h b/gtp/pdp.h index f8955bb..81a38f4 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -267,8 +267,6 @@ int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua); */ -int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua); -int pdp_euaton(struct ul66_t *eua, struct in_addr *dst); uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi); #endif /* !_PDP_H */ -- To view, visit https://gerrit.osmocom.org/6070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:01 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp.c: gtp_gpdu_ind: Convert ifelse to switch statement Message-ID: Review at https://gerrit.osmocom.org/6071 gtp.c: gtp_gpdu_ind: Convert ifelse to switch statement Change-Id: I99b73f7a6d4100789fa92021c6ec9117869c881b --- M gtp/gtp.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/71/6071/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 53b38de..a2526a3 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2701,7 +2701,8 @@ /* Need to include code to verify packet src and dest addresses */ struct pdp_t *pdp; - if (version == 0) { + switch (version) { + case 0: if (pdp_getgtp0 (&pdp, ntoh16(((union gtp_packet *)pack)->gtp0.h.flow))) { gsn->err_unknownpdp++; @@ -2711,7 +2712,8 @@ len); } hlen = GTP0_HEADER_SIZE; - } else if (version == 1) { + break; + case 1: if (pdp_getgtp1 (&pdp, ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei))) { gsn->err_unknownpdp++; @@ -2726,7 +2728,8 @@ hlen = GTP1_HEADER_SIZE_LONG; else hlen = GTP1_HEADER_SIZE_SHORT; - } else { + break; + default: GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown version: %d\n", version); } -- To view, visit https://gerrit.osmocom.org/6071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99b73f7a6d4100789fa92021c6ec9117869c881b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:01 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitiali... Message-ID: Review at https://gerrit.osmocom.org/6072 gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitialized var If the version received is not known, pdp is then uninitalized so we should not be using it. Let's return an error to inform the caller. Change-Id: Ib3e23b61a3521bd3c9002d3165ca8eff4361a35e --- M gtp/gtp.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/72/6072/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index a2526a3..9dabcd2 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2696,7 +2696,7 @@ struct sockaddr_in *peer, int fd, void *pack, unsigned len) { - int hlen = GTP1_HEADER_SIZE_SHORT; + int hlen; /* Need to include code to verify packet src and dest addresses */ struct pdp_t *pdp; @@ -2732,6 +2732,7 @@ default: GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown version: %d\n", version); + return EOF; } /* If the GPDU was not from the peer GSN tell him to delete context */ -- To view, visit https://gerrit.osmocom.org/6072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3e23b61a3521bd3c9002d3165ca8eff4361a35e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:01 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:01 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/gtp.c: Mark non exported functions as static Message-ID: Review at https://gerrit.osmocom.org/6073 gtp/gtp.c: Mark non exported functions as static Functions not exported in gtp.h should be static. There's no need to mark functions as extern in the .c file. Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 --- M gtp/gtp.c 1 file changed, 16 insertions(+), 16 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/73/6073/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 9dabcd2..c087740 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -197,7 +197,7 @@ return 0; } -extern int gtp_set_cb_data_ind(struct gsn_t *gsn, +int gtp_set_cb_data_ind(struct gsn_t *gsn, int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len)) { @@ -402,7 +402,7 @@ * a predefined timeout. *************************************************************/ -int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, +static 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) { @@ -477,7 +477,7 @@ * Remove signalling packet from retransmission queue. * return 0 on success, EOF if packet was not found */ -int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { uint8_t ver = GTPHDR_F_GET_VER(packet->flags); @@ -568,7 +568,7 @@ return 0; } -int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, +static 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, uint16_t seq, uint64_t tid) { @@ -626,7 +626,7 @@ return 0; } -int gtp_notification(struct gsn_t *gsn, int version, +static int gtp_notification(struct gsn_t *gsn, int version, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq) { @@ -671,7 +671,7 @@ return 0; } -int gtp_dublicate(struct gsn_t *gsn, int version, +static int gtp_dublicate(struct gsn_t *gsn, int version, struct sockaddr_in *peer, uint16_t seq) { struct qmsg_t *qmsg; @@ -1016,7 +1016,7 @@ } /* Send off an Supported Extension Headers Notification */ -int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -1037,7 +1037,7 @@ } /* Handle a Supported Extension Headers Notification */ -int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, +static int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, void *pack, unsigned len) { @@ -1060,7 +1060,7 @@ *************************************************************/ /* API: Send Create PDP Context Request (7.3.1) */ -extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp, +int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp) { union gtp_packet packet; @@ -1936,7 +1936,7 @@ } /* Send Update PDP Context Response */ -int gtp_update_pdp_resp(struct gsn_t *gsn, int version, +static int gtp_update_pdp_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) @@ -1998,7 +1998,7 @@ } /* Handle Update PDP Context Request */ -int gtp_update_pdp_ind(struct gsn_t *gsn, int version, +static int gtp_update_pdp_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2226,7 +2226,7 @@ } /* Handle Update PDP Context Response */ -int gtp_update_pdp_conf(struct gsn_t *gsn, int version, +static int gtp_update_pdp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2614,7 +2614,7 @@ } /* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ -int gtp_error_ind_resp(struct gsn_t *gsn, int version, +static int gtp_error_ind_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2636,7 +2636,7 @@ } /* Handle Error Indication */ -int gtp_error_ind_conf(struct gsn_t *gsn, int version, +static int gtp_error_ind_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; @@ -2692,7 +2692,7 @@ return 0; } -int gtp_gpdu_ind(struct gsn_t *gsn, int version, +static int gtp_gpdu_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -3296,7 +3296,7 @@ * Conversion functions *************************************************************/ -int char2ul_t(char *src, struct ul_t dst) +static int char2ul_t(char *src, struct ul_t dst) { dst.l = strlen(src) + 1; dst.v = malloc(dst.l); -- To view, visit https://gerrit.osmocom.org/6073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:02 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/gtp.c: Remove unused function char2ul_t Message-ID: Review at https://gerrit.osmocom.org/6074 gtp/gtp.c: Remove unused function char2ul_t Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 --- M gtp/gtp.c 1 file changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/74/6074/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index c087740..2e24f7d 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3296,15 +3296,6 @@ * Conversion functions *************************************************************/ -static int char2ul_t(char *src, struct ul_t dst) -{ - dst.l = strlen(src) + 1; - dst.v = malloc(dst.l); - dst.v[0] = dst.l - 1; - memcpy(&dst.v[1], src, dst.v[0]); - return 0; -} - /* *********************************************************** * IP address conversion functions * There exist several types of address representations: -- To view, visit https://gerrit.osmocom.org/6074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:13:02 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 20:13:02 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/gtp.c: Use uint8_t for version param in static functions Message-ID: Review at https://gerrit.osmocom.org/6075 gtp/gtp.c: Use uint8_t for version param in static functions Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 --- M gtp/gtp.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/75/6075/1 diff --git a/gtp/gtp.c b/gtp/gtp.c index 2e24f7d..2abc32e 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -213,7 +213,7 @@ * to hold the packet header. * returns the length of the header. 0 on error. **/ -static unsigned int get_default_gtp(int version, uint8_t type, void *packet) +static unsigned int get_default_gtp(uint8_t version, uint8_t type, void *packet) { struct gtp0_header *gtp0_default = (struct gtp0_header *)packet; struct gtp1_header_long *gtp1_default = @@ -402,7 +402,7 @@ * a predefined timeout. *************************************************************/ -static int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, +static int gtp_req(struct gsn_t *gsn, uint8_t version, struct pdp_t *pdp, union gtp_packet *packet, int len, struct in_addr *inetaddr, void *cbp) { @@ -477,7 +477,7 @@ * Remove signalling packet from retransmission queue. * return 0 on success, EOF if packet was not found */ -static int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { uint8_t ver = GTPHDR_F_GET_VER(packet->flags); @@ -568,7 +568,7 @@ return 0; } -static int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, +static int gtp_resp(uint8_t version, struct gsn_t *gsn, struct pdp_t *pdp, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq, uint64_t tid) { @@ -626,7 +626,7 @@ return 0; } -static int gtp_notification(struct gsn_t *gsn, int version, +static int gtp_notification(struct gsn_t *gsn, uint8_t version, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq) { @@ -671,7 +671,7 @@ return 0; } -static int gtp_dublicate(struct gsn_t *gsn, int version, +static int gtp_dublicate(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, uint16_t seq) { struct qmsg_t *qmsg; @@ -1016,7 +1016,7 @@ } /* Send off an Supported Extension Headers Notification */ -static int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_extheader_req(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -1936,7 +1936,7 @@ } /* Send Update PDP Context Response */ -static int gtp_update_pdp_resp(struct gsn_t *gsn, int version, +static int gtp_update_pdp_resp(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) @@ -1998,7 +1998,7 @@ } /* Handle Update PDP Context Request */ -static int gtp_update_pdp_ind(struct gsn_t *gsn, int version, +static int gtp_update_pdp_ind(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2226,7 +2226,7 @@ } /* Handle Update PDP Context Response */ -static int gtp_update_pdp_conf(struct gsn_t *gsn, int version, +static int gtp_update_pdp_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2614,7 +2614,7 @@ } /* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ -static int gtp_error_ind_resp(struct gsn_t *gsn, int version, +static int gtp_error_ind_resp(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2636,7 +2636,7 @@ } /* Handle Error Indication */ -static int gtp_error_ind_conf(struct gsn_t *gsn, int version, +static int gtp_error_ind_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; @@ -2692,7 +2692,7 @@ return 0; } -static int gtp_gpdu_ind(struct gsn_t *gsn, int version, +static int gtp_gpdu_ind(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { -- To view, visit https://gerrit.osmocom.org/6075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:27:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:27:30 +0000 Subject: osmo-ggsn[master]: gtp.c: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 is this really worth our time? I wish we had less whitespace patches in our review queue... -- To view, visit https://gerrit.osmocom.org/6066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:27:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:27:59 +0000 Subject: osmo-ggsn[master]: gtp.c: Determine GTP version from header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I843071a090e877fd529e1e0b799df3585bf836d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:28:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:28:22 +0000 Subject: osmo-ggsn[master]: gtp.c: Log unsupported GTP version number In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idbc6e4c912b958bde5916b87ec53c3c4db70bee0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:28:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:28:29 +0000 Subject: osmo-ggsn[master]: gtp/pdp: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1bc65ef9af1144779ee91a2c9b9887233ad15671 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:28:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:28:46 +0000 Subject: osmo-ggsn[master]: gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 not really sure what we gain by this? -- To view, visit https://gerrit.osmocom.org/6070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:28:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:28:57 +0000 Subject: osmo-ggsn[master]: gtp.c: gtp_gpdu_ind: Convert ifelse to switch statement In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99b73f7a6d4100789fa92021c6ec9117869c881b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:29:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:29:25 +0000 Subject: osmo-ggsn[master]: gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitiali... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3e23b61a3521bd3c9002d3165ca8eff4361a35e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:30:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:30:09 +0000 Subject: osmo-ggsn[master]: gtp/gtp.c: Remove unused function char2ul_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:30:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:30:18 +0000 Subject: osmo-ggsn[master]: gtp/gtp.c: Use uint8_t for version param in static functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:30:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:30:34 +0000 Subject: [MERGED] osmo-msc[master]: Accept SMS for any receiver In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Accept SMS for any receiver ...................................................................... Accept SMS for any receiver Accept any SMS and store it in the database, even if the receiver of the message cannot be determined when the message arrives at the MSC. This fixes https://osmocom.org/issues/2354 ("SMSC: Store&Forward not working for subscribed but unregistered MS"). Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Depends: Icd6093b7b5d8db84b19a0aa47c68182566113ee2 Depends: I56cbe716e52b679c4b94f6cbb4a171306975be2e Depends: Icf786f9b1efabfe7407fb6414ec0d326d8f7244a Related: OS#2354 --- M src/libmsc/gsm_04_11.c 1 file changed, 4 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c index a6e8bf7..f178fd3 100644 --- a/src/libmsc/gsm_04_11.c +++ b/src/libmsc/gsm_04_11.c @@ -517,9 +517,10 @@ rc = sms_route_mt_sms(conn, gsms); - /* This SMS got routed through SMPP or no receiver exists. */ - if (!gsms->receiver) - return rc; + /* + * This SMS got routed through SMPP or no receiver exists. + * In any case, we store it in the database for further processing. + */ switch (sms_mti) { case GSM340_SMS_SUBMIT_MS2SC: -- To view, visit https://gerrit.osmocom.org/5997 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I833c3abd290d2bc5fceec7457e3933c9600e6c24 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:30:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:30:40 +0000 Subject: [MERGED] osmo-msc[master]: Delete expired SMS automatically. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Delete expired SMS automatically. ...................................................................... Delete expired SMS automatically. Delete expired SMS whenever we are done processing an SMS-related signal. In order to minimize additional latency only one SMS is removed at a time. Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Related: OS#2354 --- M include/osmocom/msc/db.h M src/libmsc/db.c M src/libmsc/sms_queue.c 3 files changed, 48 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h index 2105d38..a1de7d6 100644 --- a/include/osmocom/msc/db.h +++ b/include/osmocom/msc/db.h @@ -51,6 +51,7 @@ int db_sms_delete_by_msisdn(const char *msisdn); int db_sms_delete_sent_message_by_id(unsigned long long sms_id); int db_sms_delete_expired_message_by_id(unsigned long long sms_id); +void db_sms_delete_oldest_expired_message(void); /* Statistics counter storage */ struct osmo_counter; diff --git a/src/libmsc/db.c b/src/libmsc/db.c index c21aa70..db9989d 100644 --- a/src/libmsc/db.c +++ b/src/libmsc/db.c @@ -989,22 +989,11 @@ return 0; } -int db_sms_delete_expired_message_by_id(unsigned long long sms_id) + +static int delete_expired_sms(unsigned long long sms_id, time_t created, time_t validity_timestamp) { dbi_result result; - time_t created, validity_timestamp, now, min_created; - - result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); - if (!result) - return -1; - if (!next_row(result)) { - dbi_result_free(result); - return -1; - } - - created = dbi_result_get_datetime(result, "created"); - validity_timestamp = dbi_result_get_datetime(result, "valid_until"); - dbi_result_free(result); + time_t now, min_created; now = time(NULL); if (validity_timestamp > now) @@ -1026,6 +1015,47 @@ return 0; } +int db_sms_delete_expired_message_by_id(unsigned long long sms_id) +{ + dbi_result result; + time_t created, validity_timestamp; + + result = dbi_conn_queryf(conn, "SELECT created,valid_until FROM SMS WHERE id = %llu", sms_id); + if (!result) + return -1; + if (!next_row(result)) { + dbi_result_free(result); + return -1; + } + + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + + dbi_result_free(result); + return delete_expired_sms(sms_id, created, validity_timestamp); +} + +void db_sms_delete_oldest_expired_message(void) +{ + dbi_result result; + + result = dbi_conn_queryf(conn, "SELECT id,created,valid_until FROM SMS ORDER BY created LIMIT 1"); + if (!result) + return; + + if (next_row(result)) { + unsigned long long sms_id; + time_t created, validity_timestamp; + + sms_id = dbi_result_get_ulonglong(result, "id"); + created = dbi_result_get_datetime(result, "created"); + validity_timestamp = dbi_result_get_datetime(result, "valid_until"); + delete_expired_sms(sms_id, created, validity_timestamp); + } + + dbi_result_free(result); +} + int db_store_counter(struct osmo_counter *ctr) { dbi_result result; diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c index 193d023..163d4c7 100644 --- a/src/libmsc/sms_queue.c +++ b/src/libmsc/sms_queue.c @@ -529,6 +529,9 @@ sig_sms->paging_result); } + /* While here, attempt to remove an expired SMS from the DB. */ + db_sms_delete_oldest_expired_message(); + return 0; } -- To view, visit https://gerrit.osmocom.org/5996 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56cbe716e52b679c4b94f6cbb4a171306975be2e Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Thu Jan 25 20:31:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 20:31:19 +0000 Subject: osmo-mgw[master]: client: make callid in MDCX mandatory In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 21:26:28 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 21:26:28 +0000 Subject: osmo-ggsn[master]: gtp.c: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: My editor fixes it automatically which means otherwise every time I need to split the whitespace changes from my actual changes, so I think in the end it saves time from other people too. -- To view, visit https://gerrit.osmocom.org/6066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 22:02:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 25 Jan 2018 22:02:06 +0000 Subject: osmo-ggsn[master]: gtp.c: Fix trailing whitespace In-Reply-To: References: Message-ID: Patch Set 1: > My editor fixes it automatically which means otherwise every time I > need to split the whitespace changes from my actual changes, so I > think in the end it saves time from other people too. I think you should be able to configure your editor to refrain from doing so. It shouldn't touch code that you aren't touching yourself. -- To view, visit https://gerrit.osmocom.org/6066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 22:05:15 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Thu, 25 Jan 2018 22:05:15 +0000 Subject: osmo-ggsn[master]: gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton In-Reply-To: References: Message-ID: Patch Set 1: No need to maintain them as we are not using them. Furthermore, those functions don't have proper support for IPv6 or IPv4v6 EUAs, so if somebody requires to convert between them it's actually better to use in46a_to_eua or in46a_from_eua which provide far better implementation. Is there really a point on keeping them? -- To view, visit https://gerrit.osmocom.org/6070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Jan 25 23:58:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 25 Jan 2018 23:58:00 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: decrease L1 logging verbosity in test Message-ID: Review at https://gerrit.osmocom.org/6076 TBF: decrease L1 logging verbosity in test Don't clutter output with low-level details. Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 2 files changed, 1 insertion(+), 290 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/76/6076/1 diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ac693bb..46863e3 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -3276,7 +3276,7 @@ bssgp_set_log_ss(DBSSGP); log_parse_category_mask(osmo_stderr_target, "DRLCMAC,1:DRLCMACDATA,3:DRLCMACDL,3:DRLCMACUL,3:" "DRLCMACSCHED,1:DRLCMACMEAS,3:DNS,3:DBSSGP,3:DPCU,5:" - "DL1IF,1:DTBF,1:DTBFUL,1:DTBFDL,1:"); + "DL1IF,6:DTBF,1:DTBFUL,1:DTBFDL,1:"); vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 0de4917..d207a1d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -66,7 +66,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 0, CS=CS-1 @@ -76,7 +75,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==1) @@ -86,7 +84,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) changes state from FLOW to WAIT RELEASE @@ -156,7 +153,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 0, CS=CS-1 @@ -166,7 +162,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==1) @@ -176,7 +171,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) changes state from FLOW to WAIT RELEASE @@ -246,7 +240,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 0, CS=CS-1 @@ -256,7 +249,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==1) @@ -266,7 +258,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 2, CS=CS-1 @@ -275,7 +266,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 2, CS-1): 07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 3, CS=CS-1 @@ -284,7 +274,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 3, CS-1): 07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 4, CS=CS-1 @@ -293,7 +282,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 4, CS-1): 07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 5, CS=CS-1 @@ -302,7 +290,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 5, CS-1): 07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 6, CS=CS-1 @@ -311,7 +298,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 6, CS-1): 07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 7, CS=CS-1 @@ -320,7 +306,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 7, CS-1): 07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 8, CS=CS-1 @@ -329,7 +314,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 8, CS-1): 07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 9, CS=CS-1 @@ -338,7 +322,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 9, CS-1): 07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 10, CS=CS-1 @@ -349,7 +332,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 10, CS-1): 07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 11, CS=CS-1 @@ -358,7 +340,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 11, CS-1): 07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 12, CS=CS-1 @@ -367,7 +348,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 12, CS-1): 07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 13, CS=CS-1 @@ -376,7 +356,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 13, CS-1): 07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 14, CS=CS-1 @@ -385,7 +364,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 14, CS-1): 07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 15, CS=CS-1 @@ -394,7 +372,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 15, CS-1): 07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 16, CS=CS-1 @@ -403,7 +380,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 16, CS-1): 07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 17, CS=CS-1 @@ -412,7 +388,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 17, CS-1): 07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 18, CS=CS-1 @@ -421,7 +396,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 18, CS-1): 07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 19, CS=CS-1 @@ -430,7 +404,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 19, CS-1): 07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==20) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 20, CS=CS-1 @@ -444,7 +417,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 20, CS-1): 07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) ack: (BSN=85)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=20) R=ACK I=NACK TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRR...........................................' @@ -461,7 +433,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 21, CS-1): 07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) ack: (BSN=86)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=21) R=ACK I=NACK TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................' @@ -479,7 +450,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) msg block (BSN 22, CS-1): 07 01 2c 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=203 block=11 data=07 01 2c 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) changes state from FINISHED to WAIT RELEASE @@ -581,7 +551,6 @@ TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -607,7 +576,6 @@ TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 0f 8b 2b 2b 2b TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -633,7 +601,6 @@ TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 0f 8b 2b 2b 2b TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -659,7 +626,6 @@ TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 0f 8b 2b 2b 2b TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -685,7 +651,6 @@ TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 0f 8b 2b 2b 2b TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -711,7 +676,6 @@ TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 0f 8b 2b 2b 2b TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -737,7 +701,6 @@ TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 0f 8b 2b 2b 2b TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -763,7 +726,6 @@ TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 0f 8b 2b 2b 2b TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -789,7 +751,6 @@ TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 0f 8b 2b 2b 2b TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -815,7 +776,6 @@ TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 0f 8b 2b 2b 2b TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -841,7 +801,6 @@ TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 0f 8b 2b 2b 2b TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -867,7 +826,6 @@ TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 0f 8b 2b 2b 2b TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -893,7 +851,6 @@ TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 0f 8b 2b 2b 2b TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -919,7 +876,6 @@ TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 0f 8b 2b 2b 2b TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -945,7 +901,6 @@ TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 0f 8b 2b 2b 2b TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -971,7 +926,6 @@ TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 0f 8b 2b 2b 2b TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -997,7 +951,6 @@ TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 0f 8b 2b 2b 2b TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1023,7 +976,6 @@ TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 0f 8b 2b 2b 2b TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1049,7 +1001,6 @@ TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 0f 8b 2b 2b 2b TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1075,7 +1026,6 @@ TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 0f 8b 2b 2b 2b TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1101,7 +1051,6 @@ TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 0f 8b 2b 2b 2b TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1127,7 +1076,6 @@ TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 0f 8b 2b 2b 2b TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1153,7 +1101,6 @@ TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 0f 8b 2b 2b 2b TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1179,7 +1126,6 @@ TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 0f 8b 2b 2b 2b TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1205,7 +1151,6 @@ TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 0f 8b 2b 2b 2b TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1231,7 +1176,6 @@ TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 0f 8b 2b 2b 2b TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1257,7 +1201,6 @@ TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 0f 8b 2b 2b 2b TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1283,7 +1226,6 @@ TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 0f 8b 2b 2b 2b TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1309,7 +1251,6 @@ TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 0f 8b 2b 2b 2b TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1335,7 +1276,6 @@ TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 0f 8b 2b 2b 2b TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1361,7 +1301,6 @@ TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 0f 8b 2b 2b 2b TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1387,7 +1326,6 @@ TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 0f 8b 2b 2b 2b TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1421,7 +1359,6 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes Modifying MS object, TLLI = 0xc0123456, TA 220 -> 0 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes @@ -1450,7 +1387,6 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) Sending new block at BSN 0, CS=CS-1 @@ -1511,7 +1447,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) restarting timer T3169 [acked (data)] with 0 sec. 0 microsec. @@ -1555,15 +1490,12 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=7 TA=7 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1597,7 +1529,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1639,13 +1570,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1679,7 +1608,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1727,7 +1655,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack @@ -1759,7 +1686,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer T3191 [final block (DL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) 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 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=08 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 Received RTS for PDCH: TRX=0 TS=7 FN=2654283 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=7) prio=1 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) downlink (V(A)==0 .. V(S)==1) @@ -1769,13 +1695,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) msg block (BSN 0, CS-4): 07 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 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 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 MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654232 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8c f6 07 00 c0 0c 68 ab 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=1. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) poll timeout for FN=2654292, TS=7 (curr FN 2654335) @@ -1814,7 +1738,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1841,13 +1764,11 @@ TBF(TFI=0 TLLI=0xf5667788 DIR=DL STATE=FINISHED) appending 4 bytes Modifying MS object, TLLI: 0xf5667788 confirmed New MS: TLLI = 0xf5667788, TA = 7, IMSI = 0011223344, LLC = 1 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1881,7 +1802,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1931,13 +1851,11 @@ PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) ********** UL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654224 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b ee 07 00 c0 0c 60 6b 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1974,7 +1892,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -2012,13 +1929,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Frame 1 starts at offset 0, length=20, is_complete=0 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) No gaps in received block, last block: BSN=0 CV=15 New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -2052,7 +1967,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -2128,7 +2042,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) restarting timer T3169 [acked (data)] with 0 sec. 0 microsec. @@ -2160,13 +2073,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) Scheduling Ack/Nack, because last block has CV==0. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -2200,7 +2111,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -2287,7 +2197,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack @@ -2315,7 +2224,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=00 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2334,7 +2242,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2355,7 +2262,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 2) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 2, CS-1): 07 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654288 block=0 data=00 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2374,7 +2280,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 3) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 3, CS-1): 07 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654292 block=1 data=00 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2395,7 +2300,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 4) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 4, CS-1): 07 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654296 block=2 data=00 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2414,7 +2318,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 5) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 5, CS-1): 07 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654301 block=3 data=00 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2435,7 +2338,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 6) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 6, CS-1): 07 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654305 block=4 data=00 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2454,7 +2356,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 7, CS-1): 07 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654309 block=5 data=00 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2473,7 +2374,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 8) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 8, CS-1): 07 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654314 block=6 data=00 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2494,7 +2394,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 9) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 9, CS-1): 07 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654318 block=7 data=00 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2513,7 +2412,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 10) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 10, CS-1): 07 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654322 block=8 data=00 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2534,7 +2432,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 11) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 11, CS-1): 07 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=00 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2553,7 +2450,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 12) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 12, CS-1): 07 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654331 block=10 data=00 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2574,7 +2470,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 13) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 13, CS-1): 07 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=00 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2593,7 +2488,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 14) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 14, CS-1): 07 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654340 block=0 data=00 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2612,7 +2506,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 15) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 15, CS-1): 07 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654344 block=1 data=00 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2633,7 +2526,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 16) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 16, CS-1): 07 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654348 block=2 data=00 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2652,7 +2544,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 17) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 17, CS-1): 07 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654353 block=3 data=00 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2673,7 +2564,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 18) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 18, CS-1): 07 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654357 block=4 data=00 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2692,7 +2582,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 19) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 19, CS-1): 07 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654361 block=5 data=00 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2716,7 +2605,6 @@ 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 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) 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 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2735,7 +2623,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 21) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 21, CS-1): 07 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654370 block=7 data=00 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2754,7 +2641,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 22) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 22, CS-1): 07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654374 block=8 data=07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2775,7 +2661,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 23) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 23, CS-1): 07 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654379 block=9 data=00 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2794,7 +2679,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 24) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 24, CS-1): 07 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654383 block=10 data=00 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2815,7 +2699,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 25) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 25, CS-1): 07 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654387 block=11 data=00 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2834,7 +2717,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 26) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 26, CS-1): 07 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654392 block=0 data=00 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2857,7 +2739,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Polling is already scheduled TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) msg block (BSN 27, CS-1): 07 01 36 16 35 45 54 20 33 38 4c 4c 43 20 50 41 43 4b 45 54 20 33 39 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654396 block=1 data=00 01 36 16 35 45 54 20 33 38 4c 4c 43 20 50 41 43 4b 45 54 20 33 39 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes @@ -2906,7 +2787,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) RX: [PCU <- BTS] Packet Control Ack @@ -2938,7 +2818,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654405 block=3 data=00 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2957,7 +2836,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654409 block=4 data=00 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2976,7 +2854,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 2) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 2, CS-1): 07 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654413 block=5 data=00 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2995,7 +2872,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 3) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 3, CS-1): 07 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654418 block=6 data=00 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3014,7 +2890,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 4) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 4, CS-1): 07 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654422 block=7 data=00 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3033,7 +2908,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 5) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 5, CS-1): 07 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654426 block=8 data=00 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3052,7 +2926,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 6) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 6, CS-1): 07 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654431 block=9 data=00 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3071,7 +2944,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 7, CS-1): 07 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654435 block=10 data=00 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3090,7 +2962,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 8) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 8, CS-1): 07 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654439 block=11 data=00 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3109,7 +2980,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 9) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 9, CS-1): 07 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654444 block=0 data=00 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3132,7 +3002,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer T3191 [final block (DL-TBF)] with 0 sec. 0 microsec. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) 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 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654448 block=1 data=08 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 Not accepting non-EGPRS phone in EGPRS-only mode No PDCH resource ********** DL-TBF starts here ********** @@ -3213,13 +3082,11 @@ Detaching TBF from MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0x00000000 ********** DL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -3259,7 +3126,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -3305,13 +3171,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -3351,7 +3215,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -3561,7 +3424,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-1 @@ -3576,7 +3438,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-1): 07 00 00 16 28 2a 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 16 28 2a 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -3590,7 +3451,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-1): 07 40 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-1 @@ -3601,7 +3461,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-1): 07 80 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-1 @@ -3612,7 +3471,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-1): 07 c0 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-1 @@ -3623,7 +3481,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-1): 07 00 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-1 @@ -3634,7 +3491,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-1): 07 40 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-1 @@ -3645,7 +3501,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-1): 07 80 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-1 @@ -3656,7 +3511,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-1): 07 c0 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-1 @@ -3667,7 +3521,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-1): 07 00 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-1 @@ -3678,7 +3531,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-1): 07 40 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-1 @@ -3689,7 +3541,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-1): 07 80 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-1 @@ -3700,7 +3551,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-1): 07 c0 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-1 @@ -3711,7 +3561,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-1): 07 00 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 13, CS=MCS-1 @@ -3722,7 +3571,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 13, MCS-1): 07 40 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 40 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 14, CS=MCS-1 @@ -3733,7 +3581,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 14, MCS-1): 07 80 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 80 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 15, CS=MCS-1 @@ -3744,7 +3591,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 15, MCS-1): 07 c0 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 16, CS=MCS-1 @@ -3755,7 +3601,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 16, MCS-1): 07 00 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 17, CS=MCS-1 @@ -3766,7 +3611,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 17, MCS-1): 07 40 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 40 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 18, CS=MCS-1 @@ -3777,7 +3621,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 18, MCS-1): 07 80 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 80 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 19, CS=MCS-1 @@ -3788,7 +3631,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 19, MCS-1): 07 c0 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 c0 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==20) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 20, CS=MCS-1 @@ -3799,7 +3641,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 20, MCS-1): 07 00 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==21) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 21, CS=MCS-1 @@ -3810,7 +3651,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 21, MCS-1): 07 40 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 40 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==22) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 22, CS=MCS-1 @@ -3821,7 +3661,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 22, MCS-1): 07 80 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=99 block=11 data=07 80 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==23) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 23, CS=MCS-1 @@ -3832,7 +3671,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 23, MCS-1): 07 c0 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=104 block=0 data=07 c0 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==24) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 24, CS=MCS-1 @@ -3846,7 +3684,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 24, MCS-1): 07 00 06 16 18 3a 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=108 block=1 data=07 00 06 16 18 3a 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -3893,7 +3730,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-2 @@ -3908,7 +3744,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-2): 07 00 00 12 28 42 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 12 28 42 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -3922,7 +3757,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-2): 07 40 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-2 @@ -3933,7 +3767,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-2): 07 80 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-2 @@ -3944,7 +3777,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-2): 07 c0 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-2 @@ -3955,7 +3787,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-2): 07 00 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-2 @@ -3966,7 +3797,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-2): 07 40 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-2 @@ -3977,7 +3807,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-2): 07 80 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-2 @@ -3988,7 +3817,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-2): 07 c0 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-2 @@ -3999,7 +3827,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-2): 07 00 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-2 @@ -4010,7 +3837,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-2): 07 40 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-2 @@ -4021,7 +3847,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-2): 07 80 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-2 @@ -4032,7 +3857,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-2): 07 c0 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-2 @@ -4043,7 +3867,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-2): 07 00 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 13, CS=MCS-2 @@ -4054,7 +3877,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 13, MCS-2): 07 40 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 40 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 14, CS=MCS-2 @@ -4065,7 +3887,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 14, MCS-2): 07 80 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 80 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 15, CS=MCS-2 @@ -4076,7 +3897,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 15, MCS-2): 07 c0 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 16, CS=MCS-2 @@ -4087,7 +3907,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 16, MCS-2): 07 00 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 17, CS=MCS-2 @@ -4098,7 +3917,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 17, MCS-2): 07 40 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 40 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 18, CS=MCS-2 @@ -4109,7 +3927,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 18, MCS-2): 07 80 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 80 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 19, CS=MCS-2 @@ -4123,7 +3940,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 19, MCS-2): 07 c0 04 12 20 4a 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 c0 04 12 20 4a 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4170,7 +3986,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-3 @@ -4185,7 +4000,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-3): 07 00 00 06 28 66 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 06 28 66 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4199,7 +4013,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-3): 07 40 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-3 @@ -4210,7 +4023,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-3): 07 80 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-3 @@ -4221,7 +4033,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-3): 07 c0 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-3 @@ -4232,7 +4043,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-3): 07 00 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-3 @@ -4243,7 +4053,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-3): 07 40 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-3 @@ -4254,7 +4063,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-3): 07 80 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-3 @@ -4265,7 +4073,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-3): 07 c0 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-3 @@ -4276,7 +4083,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-3): 07 00 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-3 @@ -4287,7 +4093,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-3): 07 40 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-3 @@ -4298,7 +4103,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-3): 07 80 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-3 @@ -4309,7 +4113,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-3): 07 c0 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-3 @@ -4320,7 +4123,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-3): 07 00 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 13, CS=MCS-3 @@ -4331,7 +4133,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 13, MCS-3): 07 40 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 40 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 14, CS=MCS-3 @@ -4344,7 +4145,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 14, MCS-3): 07 80 03 06 7e 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 80 03 06 7e 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 15, CS=MCS-3 @@ -4358,7 +4158,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 15, MCS-3): 07 c0 03 06 04 8a 56 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 06 04 8a 56 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4405,7 +4204,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-4 @@ -4420,7 +4218,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-4): 07 00 00 00 28 82 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 28 82 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4434,7 +4231,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-4): 07 40 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-4 @@ -4445,7 +4241,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-4): 07 80 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-4 @@ -4456,7 +4251,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-4): 07 c0 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-4 @@ -4467,7 +4261,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-4): 07 00 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-4 @@ -4478,7 +4271,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-4): 07 40 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-4 @@ -4489,7 +4281,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-4): 07 80 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-4 @@ -4500,7 +4291,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-4): 07 c0 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-4 @@ -4511,7 +4301,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-4): 07 00 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-4 @@ -4522,7 +4311,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-4): 07 40 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-4 @@ -4533,7 +4321,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-4): 07 80 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-4 @@ -4544,7 +4331,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-4): 07 c0 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-4 @@ -4558,7 +4344,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-4): 07 00 03 00 70 3a 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 00 70 3a 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4605,7 +4390,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-5 @@ -4620,7 +4404,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-5): 07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4634,7 +4417,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-5): 07 40 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-5 @@ -4645,7 +4427,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-5): 07 80 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-5 @@ -4656,7 +4437,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-5): 07 c0 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-5 @@ -4667,7 +4447,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-5): 07 00 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-5 @@ -4678,7 +4457,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-5): 07 40 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-5 @@ -4689,7 +4467,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-5): 07 80 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-5 @@ -4700,7 +4477,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-5): 07 c0 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-5 @@ -4711,7 +4487,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-5): 07 00 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-5 @@ -4722,7 +4497,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-5): 07 40 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-5 @@ -4736,7 +4510,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-5): 07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4783,7 +4556,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-6 @@ -4798,7 +4570,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-6): 07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 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) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4812,7 +4583,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-6): 07 40 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-6 @@ -4823,7 +4593,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-6): 07 80 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-6 @@ -4834,7 +4603,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-6): 07 c0 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-6 @@ -4845,7 +4613,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-6): 07 00 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-6 @@ -4856,7 +4623,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-6): 07 40 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-6 @@ -4867,7 +4633,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-6): 07 80 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-6 @@ -4880,7 +4645,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-6): 07 c0 01 40 62 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 c0 10 70 c0 ca 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 40 62 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 c0 10 70 c0 ca 0a Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-6 @@ -4894,7 +4658,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-6): 07 00 02 80 c0 e3 ca 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 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 80 c0 e3 ca 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 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4941,7 +4704,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-7 @@ -4957,7 +4719,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-5): 07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4974,7 +4735,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-7): 07 00 00 02 b8 50 64 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 00 02 b8 50 64 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-7 @@ -4988,7 +4748,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-7): 07 80 00 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-7 @@ -5002,7 +4761,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-7): 07 00 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-7 @@ -5016,7 +4774,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-7): 07 80 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 80 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-7 @@ -5030,7 +4787,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-7): 07 00 02 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-7 @@ -5045,7 +4801,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-5): 07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -5092,7 +4847,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-8 @@ -5109,7 +4863,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-8): 07 00 00 00 60 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 40 11 17 10 10 10 10 10 10 10 10 10 30 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 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 60 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 40 11 17 10 10 10 10 10 10 10 10 10 30 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 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5126,7 +4879,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-8): 07 00 00 02 88 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 00 02 88 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-8 @@ -5140,7 +4892,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-8): 07 80 00 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-8 @@ -5154,7 +4905,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-8): 07 00 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-8 @@ -5168,7 +4918,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-8): 07 80 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 80 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-8 @@ -5184,7 +4933,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-8): 07 00 02 00 60 20 f5 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 80 d4 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 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 02 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 00 60 20 f5 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 80 d4 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 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 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -5231,7 +4979,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-9 @@ -5247,7 +4994,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-6): 07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 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) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5264,7 +5010,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-9): 07 00 00 02 20 50 f4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 00 02 20 50 f4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-9 @@ -5278,7 +5023,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-9): 07 80 00 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-9 @@ -5292,7 +5036,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-9): 07 00 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-9 @@ -5308,7 +5051,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-9): 07 80 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 90 18 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 04 1c b0 b2 02 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 80 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 90 18 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 04 1c b0 b2 02 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-9 @@ -5323,7 +5065,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-6): 07 00 02 80 c0 e3 ca 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 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 80 c0 e3 ca 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 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -6040,13 +5781,11 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** DL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -6086,7 +5825,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -6203,13 +5941,11 @@ Detaching TBF from MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0x00000000 ********** DL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -6249,7 +5985,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -6372,7 +6107,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6397,7 +6131,6 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6422,7 +6155,6 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6447,7 +6179,6 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6472,7 +6203,6 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6497,7 +6227,6 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6522,7 +6251,6 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6538,20 +6266,16 @@ - Skipping TS 7, because no USF available - Failed to allocate a TS, no USF available No PDCH resource sending Immediate Assignment Uplink (AGCH) reject -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b Destroying MS object, TLLI = 0x00000000 MS requests UL TBF on RACH, so we provide one: ra=0x70 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation No PDCH available. No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -6591,7 +6315,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -7178,7 +6901,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Got MCS-4 RLC data block: CV=0, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) BSN 64 already received Received RTS for PDCH: TRX=0 TS=7 FN=2654275 block_nr=9 scheduling USF=0 for required uplink resource of UL TFI=0 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=40 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** @@ -7366,7 +7088,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 Got MS: TLLI = 0xf1223344, TA = 7 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -7947,7 +7668,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) BSN 64 storing in window (0..191) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) data_length=44, data=80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 Received RTS for PDCH: TRX=0 TS=7 FN=2654283 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=40 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -8000,7 +7720,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8025,7 +7744,6 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8050,7 +7768,6 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8075,7 +7792,6 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8100,7 +7816,6 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8125,7 +7840,6 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8150,7 +7864,6 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- MS requests UL TBF in packet resource request of single block, so we provide one: @@ -8180,7 +7893,6 @@ Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec. Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Destroying MS object, TLLI = 0x00000000 Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed @@ -8189,7 +7901,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec. Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) timer 0 expired. TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) releasing due to PACCH assignment timeout. TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) free -- To view, visit https://gerrit.osmocom.org/6076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Jan 25 23:58:00 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 25 Jan 2018 23:58:00 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: override send function via linker option Message-ID: Review at https://gerrit.osmocom.org/6077 TBF: override send function via linker option Use --wrap linker facility to override pcu_sock_send() similar to other Osmo* projects. Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb --- M tests/Makefile.am M tests/tbf/TbfTest.cpp 2 files changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/77/6077/1 diff --git a/tests/Makefile.am b/tests/Makefile.am index 1595a07..e82647f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,6 +33,7 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(COMMON_LA) +tbf_TbfTest_LDFLAGS = -Wl,--wrap=pcu_sock_send bitcomp_BitcompTest_SOURCES = bitcomp/BitcompTest.cpp ../src/egprs_rlc_compression.cpp bitcomp_BitcompTest_LDADD = \ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 46863e3..aa1d7ac 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -137,7 +137,9 @@ static uint8_t llc_data[200]; -int pcu_sock_send(struct msgb *msg) +/* override, requires '-Wl,--wrap=pcu_sock_send' */ +int __real_pcu_sock_send(struct msgb *msg); +int __wrap_pcu_sock_send(struct msgb *msg) { return 0; } -- To view, visit https://gerrit.osmocom.org/6077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:26:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:26:57 +0000 Subject: [MERGED] osmo-mgw[master]: client: make callid in MDCX mandatory In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: make callid in MDCX mandatory ...................................................................... client: make callid in MDCX mandatory An MDCX without call-id does not make much sense. The call-id is an integral element of the MDCX message to ensure that the correct call is modified. - update the presence check bitmasks to mark the call-id field mandatory for MDCX requests Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index f094a09..135aed0 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -728,6 +728,7 @@ MGCP_MSG_PRESENCE_CALL_ID | \ MGCP_MSG_PRESENCE_CONN_MODE) #define MGCP_MDCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT | \ + MGCP_MSG_PRESENCE_CALL_ID | \ MGCP_MSG_PRESENCE_CONN_ID) #define MGCP_DLCX_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) #define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) -- To view, visit https://gerrit.osmocom.org/5993 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2bcc3a68139e0d935790bcea2ef91eaf6291aa3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw 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 Fri Jan 26 00:29:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:29:23 +0000 Subject: [MERGED] osmo-mgw[master]: client: add missing mandatory SDP fields In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: add missing mandatory SDP fields ...................................................................... client: add missing mandatory SDP fields The mcgp message generator function mgcp_msg_gen() lacks support for the mandatory SDP fields (v)ersion, (o)rigin, (s)ession and (t)ime. - Automatically generate the missing fields when SDP is generated. Change-Id: I5fbc31a17e8ac10c7cc5dbc31357b61e8920aaa5 Related: OS#2837 --- M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.ok 2 files changed, 32 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 135aed0..116baf3 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -740,6 +740,7 @@ uint32_t mandatory_mask; struct msgb *msg = msgb_alloc_headroom(4096, 128, "MGCP tx"); int rc = 0; + char local_ip[INET_ADDRSTRLEN]; msg->l2h = msg->data; msg->cb[MSGB_CB_MGCP_TRANS_ID] = trans_id; @@ -820,9 +821,32 @@ msgb_printf(msg, "M: %s\r\n", mgcp_client_cmode_name(mgcp_msg->conn_mode)); - /* Add RTP address and port (SDP) */ + /* Add SDP body */ if (mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_IP && mgcp_msg->presence & MGCP_MSG_PRESENCE_AUDIO_PORT) { + + /* Add separator to mark the beginning of the SDP block */ + rc += msgb_printf(msg, "\r\n"); + + /* Add SDP protocol version */ + rc += msgb_printf(msg, "v=0\r\n"); + + /* Add session name (none) */ + rc += msgb_printf(msg, "s=-\r\n"); + + /* Determine local IP-Address */ + if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) < 0) { + LOGP(DLMGCP, LOGL_ERROR, + "Could not determine local IP-Address!\n"); + msgb_free(msg); + return NULL; + } + + /* Add owner/creator (SDP) */ + rc += msgb_printf(msg, "o=- %x 23 IN IP4 %s\r\n", + mgcp_msg->call_id, local_ip); + + /* Add RTP address and port */ if (mgcp_msg->audio_port == 0) { LOGP(DLMGCP, LOGL_ERROR, "Invalid port number, can not generate MGCP message\n"); @@ -835,11 +859,13 @@ msgb_free(msg); return NULL; } - rc += msgb_printf(msg, "\r\n"); rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); rc += msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", mgcp_msg->audio_port); + + /* Add time description, active time (SDP) */ + rc += msgb_printf(msg, "t=0 0\r\n"); } if (rc != 0) { diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 4039bb0..00c7f7c 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -43,8 +43,12 @@ I: 11 M: sendrecv +v=0 +s=- +o=- 2f 23 IN IP4 127.0.0.1 c=IN IP4 192.168.100.23 m=audio 1234 RTP/AVP 255 +t=0 0 Generated DLCX message: DLCX 3 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/5994 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5fbc31a17e8ac10c7cc5dbc31357b61e8920aaa5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:29:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:29:33 +0000 Subject: osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:30:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:30:44 +0000 Subject: osmo-mgw[master]: mgcp: add prefix to virtual trunk In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 Gerrit-PatchSet: 5 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:30:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:30:46 +0000 Subject: osmo-mgw[master]: client: eliminate destructive parameter parsing In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia475036f7f3802b1638e0511a5e9162fea1592eb Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:30:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:30:52 +0000 Subject: osmo-mgw[master]: protocol: fix missing carriage return In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:31:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:31:44 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp: permit wildcarded endpoint assignment (CRCX) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: permit wildcarded endpoint assignment (CRCX) ...................................................................... mgcp: permit wildcarded endpoint assignment (CRCX) The mgcp protocol in general allows wildcarded endpoints on CRCX. osmo-mgw does not support this feature yet. - when the endpoint name contains a wildcard character, search a free endpoint automatically - return the resulting endpoint name in the parameter section of the mgcp response - add parsing support for the returned endpoint names - Be more concious about the parameters that are returned with each response. Do not unnecessarily attach known parameters. Return the connection ID only on CRCX commands. Only return the endpoint ID on CRCX commands that are wildcarded. Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 related: OS#2631 --- M include/osmocom/mgcp/mgcp_internal.h M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c M tests/mgcp/mgcp_test.c 6 files changed, 138 insertions(+), 40 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index 33a754c..c0ee556 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -260,6 +260,10 @@ /* fields for re-transmission */ char *last_trans; char *last_response; + + /* Memorize if this endpoint was choosen by the MGW (wildcarded, true) + * or if the user has choosen the particular endpoint explicitly */ + bool wildcarded_crcx; }; diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 882c908..676850f 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -31,6 +31,7 @@ mgcp_trans_id_t trans_id; const char *comment; char conn_id[MGCP_CONN_ID_LENGTH]; + char endpoint[MGCP_ENDPOINT_MAXLEN]; }; struct mgcp_response { diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 116baf3..a394f3b 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -146,8 +146,6 @@ /* Mark the end of the comment */ *end = '\0'; r->body = end + 1; - if (r->body[0] == '\n') - r->body ++; return 0; response_parse_failure: @@ -247,6 +245,10 @@ OSMO_ASSERT(r->body); char *data = mgcp_find_section_end(r->body); + /* Warning: This function performs a destructive parsing on r->body. + * Since this function is called at the very end of the persing + * process, destructive parsing is acceptable. */ + if (!data) { LOGP(DLMGCP, LOGL_ERROR, "MGCP response: cannot find start of parameters\n"); @@ -282,21 +284,29 @@ return 0; } -/* Parse a line like "I: 0cedfd5a19542d197af9afe5231f1d61" */ -static int mgcp_parse_conn_id(struct mgcp_response *r, const char *line) +/* Parse a line like "X: something" */ +static int mgcp_parse_head_param(char *result, unsigned int result_len, + char label, const char *line) { + char label_string[4]; + + /* Detect empty parameters */ if (strlen(line) < 4) goto response_parse_failure; - if (memcmp("I: ", line, 3) != 0) + /* Check if the label matches */ + snprintf(label_string, sizeof(label_string), "%c: ", label); + if (memcmp(label_string, line, 3) != 0) goto response_parse_failure; - osmo_strlcpy(r->head.conn_id, line + 3, sizeof(r->head.conn_id)); + /* Copy payload part of the string to destinations (the label string + * is always 3 chars long) */ + osmo_strlcpy(result, line + 3, result_len); return 0; response_parse_failure: LOGP(DLMGCP, LOGL_ERROR, - "Failed to parse MGCP response (connectionIdentifier)\n"); + "Failed to parse MGCP response (parameter label: %c)\n", label); return -EINVAL; } @@ -306,18 +316,37 @@ char *line; int rc = 0; OSMO_ASSERT(r->body); - char *data = r->body; - char *data_end = mgcp_find_section_end(r->body); + char *data; + char *data_ptr; + char *data_end; - /* Protect SDP body, for_each_non_empty_line() will - * only parse until it hits \0 mark. */ + /* Since this functions performs a destructive parsing, we create a + * local copy of the body data */ + data = talloc_zero_size(NULL, strlen(r->body)+1); + OSMO_ASSERT(data); + data_ptr = data; + osmo_strlcpy(data, r->body, strlen(r->body)); + + /* If there is an SDP body attached, prevent for_each_non_empty_line() + * into running in there, we are not yet interested in the parameters + * stored there. */ + data_end = mgcp_find_section_end(data); if (data_end) *data_end = '\0'; - for_each_non_empty_line(line, data) { + for_each_non_empty_line(line, data_ptr) { switch (line[0]) { + case 'Z': + rc = mgcp_parse_head_param(r->head.endpoint, + sizeof(r->head.endpoint), + 'Z', line); + if (rc) + goto exit; + break; case 'I': - rc = mgcp_parse_conn_id(r, line); + rc = mgcp_parse_head_param(r->head.conn_id, + sizeof(r->head.conn_id), + 'I', line); if (rc) goto exit; break; @@ -327,10 +356,7 @@ } } exit: - /* Restore original state */ - if (data_end) - *data_end = '\n'; - + talloc_free(data); return rc; } diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 74acffa..9bb2805 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -181,6 +181,30 @@ return &tcfg->endpoints[endp]; } +/* Find an endpoint that is not in use. Do this by going through the endpoint + * array, check the callid. A callid nullpointer indicates that the endpoint + * is free */ +static struct mgcp_endpoint *find_free_endpoint(struct mgcp_endpoint *endpoints, + unsigned int number_endpoints) +{ + struct mgcp_endpoint *endp; + unsigned int i; + + for (i = 0; i < number_endpoints; i++) { + if (endpoints[i].callid == NULL) { + endp = &endpoints[i]; + LOGP(DLMGCP, LOGL_DEBUG, + "endpoint:0x%x found free endpoint\n", + ENDPOINT_NUMBER(endp)); + endp->wildcarded_crcx = true; + return endp; + } + } + + LOGP(DLMGCP, LOGL_ERROR, "Not able to find a free endpoint"); + return NULL; +} + /* Check if the domain name, which is supplied with the endpoint name * matches the configuration. */ static int check_domain_name(struct mgcp_config *cfg, const char *mgcp) @@ -213,6 +237,11 @@ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); + if (strncmp(mgcp, "*", 1) == 0) { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 4c04712..16e9cb8 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -192,11 +192,32 @@ return create_resp(endp, code, " FAIL", msg, trans, NULL, NULL); } +/* Add MGCP parameters to a message buffer */ +static int add_params(struct msgb *msg, const struct mgcp_endpoint *endp, + const struct mgcp_conn_rtp *conn) +{ + int rc; + + if (endp->wildcarded_crcx) { + rc = msgb_printf(msg, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), + endp->cfg->domain); + if (rc < 0) + return -EINVAL; + } + + rc = msgb_printf(msg, "I: %s\n", conn->conn->id); + if (rc < 0) + return -EINVAL; + + return 0; +} + /* Format MGCP response string (with SDP attached) */ static struct msgb *create_response_with_sdp(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, const char *msg, - const char *trans_id) + const char *trans_id, + bool add_conn_params) { const char *addr = endp->cfg->local_ip; struct msgb *sdp; @@ -221,7 +242,14 @@ osmux_extension[0] = '\0'; } - rc = msgb_printf(sdp, "I: %s%s\n\n", conn->conn->id, osmux_extension); + /* Attach optional connection parameters */ + if (add_conn_params) { + rc = add_params(sdp, endp, conn); + if (rc < 0) + goto error; + } + + rc = msgb_printf(sdp, "%s\n", osmux_extension); if (rc < 0) goto error; @@ -648,7 +676,7 @@ LOGP(DLMGCP, LOGL_NOTICE, "CRCX: endpoint:0x%x connection successfully created\n", ENDPOINT_NUMBER(endp)); - return create_response_with_sdp(endp, conn, "CRCX", p->trans); + return create_response_with_sdp(endp, conn, "CRCX", p->trans, true); error2: mgcp_release_endp(endp); LOGP(DLMGCP, LOGL_NOTICE, @@ -801,7 +829,7 @@ LOGP(DLMGCP, LOGL_NOTICE, "MDCX: endpoint:0x%x connection successfully modified\n", ENDPOINT_NUMBER(endp)); - return create_response_with_sdp(endp, conn, "MDCX", p->trans); + return create_response_with_sdp(endp, conn, "MDCX", p->trans, false); error3: return create_err_response(endp, error_code, "MDCX", p->trans); @@ -1196,6 +1224,7 @@ endp->local_options.string = NULL; talloc_free(endp->local_options.codec); endp->local_options.codec = NULL; + endp->wildcarded_crcx = false; } static int send_agent(struct mgcp_config *cfg, const char *buf, int len) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index 467cb6c..ddee8c5 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -86,7 +86,6 @@ #define MDCX3_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -99,7 +98,6 @@ #define MDCX3A_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -112,7 +110,6 @@ #define MDCX3_FMTP_RET \ "200 18983215 OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -141,7 +138,6 @@ #define MDCX4_RET(Ident) \ "200 " Ident " OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -154,7 +150,6 @@ #define MDCX4_RO_RET(Ident) \ "200 " Ident " OK\r\n" \ - "I: %s\n" \ "\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ @@ -561,25 +556,39 @@ { char *conn_id_ptr; int i; + bool got_conn_id = false; + /* First try to get the conn_id from the I: parameter */ conn_id_ptr = strstr((char *)resp, "I: "); - if (!conn_id_ptr) - return -EINVAL; - - memset(conn_id, 0, conn_id_len); - memcpy(conn_id, conn_id_ptr + 3, 32); - - for (i = 0; i < conn_id_len; i++) { - if (conn_id[i] == '\n' || conn_id[i] == '\r') - conn_id[i] = '\0'; + if (conn_id_ptr) { + memset(conn_id, 0, conn_id_len); + memcpy(conn_id, conn_id_ptr + 3, 32); + got_conn_id = true; + } else { + /* Alternatively try to extract the conn_id from the o=- SDP + * parameter */ + conn_id_ptr = strstr((char *)resp, "o=- "); + if(conn_id_ptr) { + memset(conn_id, 0, conn_id_len); + memcpy(conn_id, conn_id_ptr + 4, 32); + got_conn_id = true; + } } - /* A valid conn_id must at least contain one digit, and must - * not exceed a length of 32 digits */ - OSMO_ASSERT(strlen(conn_id) <= 32); - OSMO_ASSERT(strlen(conn_id) > 0); + if (got_conn_id) { + for (i = 0; i < conn_id_len; i++) { + if (conn_id[i] == '\n' || conn_id[i] == '\r') + conn_id[i] = '\0'; + } - return 0; + /* A valid conn_id must at least contain one digit, and must + * not exceed a length of 32 digits */ + OSMO_ASSERT(strlen(conn_id) <= 32); + OSMO_ASSERT(strlen(conn_id) > 0); + + return 0; + } + return -EINVAL; } /* Check response, automatically patch connection ID if needed */ -- To view, visit https://gerrit.osmocom.org/5879 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iebc95043569191b6f5fbc8fe266b13fcfcab2e48 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:31:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:31:59 +0000 Subject: [MERGED] osmo-mgw[master]: mgcp: add prefix to virtual trunk In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mgcp: add prefix to virtual trunk ...................................................................... mgcp: add prefix to virtual trunk the virtual trunk is addressed without a prefix (just *@domain). - reorganize find_endpoint() so that it accepts a prefix when addressing the virtual trunk. - do no longer accept wildcarded CRCX requests without prefix (will not break anything, the feature of wildcarded CRCX is not in use yet) - keep the old prefix-less method but print a warning that it is depreacted. Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 --- M include/osmocom/mgcp/mgcp_common.h M src/libosmo-mgcp/mgcp_msg.c M src/libosmo-mgcp/mgcp_protocol.c 3 files changed, 30 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 7684936..7aa5d3f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -76,4 +76,7 @@ / (see also RFC3435 section 3.2.1.3) */ #define MGCP_ENDPOINT_MAXLEN (255*2+1+1) +/* A prefix to denote the virtual trunk (RTP on both ends) */ +#define MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK "rtpbridge/" + #endif diff --git a/src/libosmo-mgcp/mgcp_msg.c b/src/libosmo-mgcp/mgcp_msg.c index 9bb2805..3aa93b7 100644 --- a/src/libosmo-mgcp/mgcp_msg.c +++ b/src/libosmo-mgcp/mgcp_msg.c @@ -228,20 +228,38 @@ { char *endptr = NULL; unsigned int gw = INT_MAX; + const char *endpoint_number_str; + /* Check if the domainname in the request is correct */ if (check_domain_name(cfg, mgcp)) { LOGP(DLMGCP, LOGL_ERROR, "Wrong domain name '%s'\n", mgcp); return NULL; } + /* Check if the E1 trunk is requested */ if (strncmp(mgcp, "ds/e1", 5) == 0) return find_e1_endpoint(cfg, mgcp); - if (strncmp(mgcp, "*", 1) == 0) { - return find_free_endpoint(cfg->trunk.endpoints, - cfg->trunk.number_endpoints); + /* Check if the virtual trunk is addressed (new, correct way with prefix) */ + if (strncmp + (mgcp, MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK)) == 0) { + endpoint_number_str = + mgcp + strlen(MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK); + if (endpoint_number_str[0] == '*') { + return find_free_endpoint(cfg->trunk.endpoints, + cfg->trunk.number_endpoints); + } + + gw = strtoul(endpoint_number_str, &endptr, 16); + if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') + return &cfg->trunk.endpoints[gw]; } + /* Deprecated method without prefix */ + LOGP(DLMGCP, LOGL_NOTICE, + "Addressing virtual trunk without prefix (deprecated), please use %s: '%s'\n", + MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, mgcp); gw = strtoul(mgcp, &endptr, 16); if (gw < cfg->trunk.number_endpoints && endptr[0] == '@') return &cfg->trunk.endpoints[gw]; diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 16e9cb8..daedc8d 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -198,9 +198,12 @@ { int rc; - if (endp->wildcarded_crcx) { - rc = msgb_printf(msg, "Z: %u@%s\n", ENDPOINT_NUMBER(endp), - endp->cfg->domain); + /* NOTE: Only in the virtual trunk we allow dynamic endpoint names */ + if (endp->wildcarded_crcx + && endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) { + rc = msgb_printf(msg, "Z: %s%u@%s\n", + MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, + ENDPOINT_NUMBER(endp), endp->cfg->domain); if (rc < 0) return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/5880 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2aac3ba0f1f3122dfbb3bf36f74198ecb2b21de5 Gerrit-PatchSet: 6 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:05 +0000 Subject: [MERGED] osmo-mgw[master]: client: eliminate destructive parameter parsing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: eliminate destructive parameter parsing ...................................................................... client: eliminate destructive parameter parsing The function mgcp_response_parse_params() that is used to parse the SDP parameters edits the content of the r->body. - Create a local copy of r->body and work on this copy to keep the original r-body in its original state. Change-Id: Ia475036f7f3802b1638e0511a5e9162fea1592eb --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 19 insertions(+), 14 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index a394f3b..017911d 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -244,24 +244,25 @@ int rc; OSMO_ASSERT(r->body); char *data = mgcp_find_section_end(r->body); + char *data_ptr; - /* Warning: This function performs a destructive parsing on r->body. - * Since this function is called at the very end of the persing - * process, destructive parsing is acceptable. */ + /* Since this functions performs a destructive parsing, we create a + * local copy of the body data */ + data = talloc_zero_size(NULL, strlen(r->body)+1); + OSMO_ASSERT(data); + data_ptr = data; + osmo_strlcpy(data, r->body, strlen(r->body)); + /* Find beginning of the parameter (SDP) section */ + data_ptr = mgcp_find_section_end(data); if (!data) { LOGP(DLMGCP, LOGL_ERROR, "MGCP response: cannot find start of parameters\n"); - return -EINVAL; + rc = -EINVAL; + goto exit; } - /* Advance to after the \n\n, replace the second \n with \0. That's - * where the parameters start. */ - data ++; - *data = '\0'; - data ++; - - for_each_non_empty_line(line, data) { + for_each_non_empty_line(line, data_ptr) { if (!mgcp_line_is_valid(line)) return -EINVAL; @@ -269,19 +270,23 @@ case 'm': rc = mgcp_parse_audio_port(r, line); if (rc) - return rc; + goto exit; break; case 'c': rc = mgcp_parse_audio_ip(r, line); if (rc) - return rc; + goto exit; break; default: /* skip unhandled parameters */ break; } } - return 0; + + rc = 0; +exit: + talloc_free(data); + return rc; } /* Parse a line like "X: something" */ -- To view, visit https://gerrit.osmocom.org/5935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia475036f7f3802b1638e0511a5e9162fea1592eb Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:10 +0000 Subject: [MERGED] osmo-mgw[master]: client: eliminate destructive head parsing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: eliminate destructive head parsing ...................................................................... client: eliminate destructive head parsing While parsing the head of an MGCP response the r->body buffer is manipulated in order to NUL terminate the extracted comment filed. - Use a static buffer to store and manipulate the comment field. Change-Id: Ib273c13d6fe7ee042fb4e3b8ed46ac02602226f6 --- M include/osmocom/mgcp/mgcp_common.h M include/osmocom/mgcp_client/mgcp_client.h M src/libosmo-mgcp-client/mgcp_client.c 3 files changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_common.h b/include/osmocom/mgcp/mgcp_common.h index 7aa5d3f..d23339f 100644 --- a/include/osmocom/mgcp/mgcp_common.h +++ b/include/osmocom/mgcp/mgcp_common.h @@ -68,6 +68,9 @@ return 0; } +/* Maximum length of the comment field */ +#define MGCP_COMMENT_MAXLEN 256 + /* String length of Connection Identifiers * (see also RFC3435 2.1.3.2 Names of Connections) */ #define MGCP_CONN_ID_LENGTH 32+1 diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index 676850f..73f3bba 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -29,7 +29,7 @@ struct mgcp_response_head { int response_code; mgcp_trans_id_t trans_id; - const char *comment; + char comment[MGCP_COMMENT_MAXLEN]; char conn_id[MGCP_CONN_ID_LENGTH]; char endpoint[MGCP_ENDPOINT_MAXLEN]; }; diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 017911d..0cf5080 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -139,13 +139,12 @@ &comment_pos) != 2) goto response_parse_failure; - r->head.comment = r->body + comment_pos; + osmo_strlcpy(r->head.comment, r->body + comment_pos, sizeof(r->head.comment)); end = strchr(r->head.comment, '\r'); if (!end) goto response_parse_failure; /* Mark the end of the comment */ *end = '\0'; - r->body = end + 1; return 0; response_parse_failure: -- To view, visit https://gerrit.osmocom.org/5936 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib273c13d6fe7ee042fb4e3b8ed46ac02602226f6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:15 +0000 Subject: [MERGED] osmo-mgw[master]: cosmetic: client: add doxygen comments In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: client: add doxygen comments ...................................................................... cosmetic: client: add doxygen comments The client lacks doxygen apidoc comments - Add missing doxygen apidoc comments Change-Id: I0b8a0652e60f2b3d72ee1cedfa6e2d5547d88455 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 46 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 0cf5080..97f12c0 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -36,6 +36,8 @@ #include #include +/*! Initalize MGCP client configuration struct with default values. + * \param[out] conf Client configuration.*/ void mgcp_client_conf_init(struct mgcp_client_conf *conf) { /* NULL and -1 default to MGCP_CLIENT_*_DEFAULT values */ @@ -62,7 +64,9 @@ return false; } -/* Find and seize an unsused endpoint id */ +/*! Pick next free endpoint ID. + * \param[in,out] client MGCP client descriptor. + * \returns 0 on success, -EINVAL on error. */ int mgcp_client_next_endpoint(struct mgcp_client *client) { int i; @@ -95,6 +99,9 @@ return -EINVAL; } +/*! Release a seized endpoint ID to make it available again for other calls. + * \param[in] id Endpoint ID + * \param[in,out] client MGCP client descriptor. */ /* Release a seized endpoint id to make it available again for other calls */ void mgcp_client_release_endpoint(uint16_t id, struct mgcp_client *client) { @@ -237,6 +244,9 @@ return NULL; } +/*! Parse body (SDP) parameters of the MGCP response + * \param[in,out] r Response data + * \returns 0 on success, -EINVAL on error. */ int mgcp_response_parse_params(struct mgcp_response *r) { char *line; @@ -498,6 +508,9 @@ return mgcp; } +/*! Initalize client connection (opens socket only, no request is sent yet) + * \param[in,out] mgcp MGCP client descriptor. + * \returns 0 on success, -EINVAL on error. */ int mgcp_client_connect(struct mgcp_client *mgcp) { struct sockaddr_in addr; @@ -543,17 +556,25 @@ return rc; } +/*! Get the IP-Aaddress of the associated MGW as string. + * \param[in] mgcp MGCP client descriptor. + * \returns a pointer to the address string. */ const char *mgcp_client_remote_addr_str(struct mgcp_client *mgcp) { return mgcp->actual.remote_addr; } +/*! Get the IP-Port of the associated MGW. + * \param[in] mgcp MGCP client descriptor. + * \returns port number. */ uint16_t mgcp_client_remote_port(struct mgcp_client *mgcp) { return mgcp->actual.remote_port; } -/* Return the MGCP GW binary IPv4 address in network byte order. */ +/*! Get the IP-Aaddress of the associated MGW as its numeric representation. + * \param[in] mgcp MGCP client descriptor. + * \returns IP-Address as 32 bit integer (network byte order) */ uint32_t mgcp_client_remote_addr_n(struct mgcp_client *mgcp) { return mgcp->remote_addr; @@ -626,29 +647,32 @@ return -1; } -/* Cancel a pending transaction. +/*! Cancel a pending transaction. + * \param[in] mgcp MGCP client descriptor. + * \param[in,out] trans_id Transaction id. + * \returns 0 on success, -ENOENT on error. + * * Should a priv pointer passed to mgcp_client_tx() become invalid, this function must be called. In * practical terms, if the caller of mgcp_client_tx() wishes to tear down a transaction without having * received a response this function must be called. The trans_id can be obtained by calling - * mgcp_msg_trans_id() on the msgb produced by mgcp_msg_gen(). - */ + * mgcp_msg_trans_id() on the msgb produced by mgcp_msg_gen(). */ int mgcp_client_cancel(struct mgcp_client *mgcp, mgcp_trans_id_t trans_id) { struct mgcp_response_pending *pending = mgcp_client_response_pending_get(mgcp, trans_id); if (!pending) { - /* INFO is sufficient, it is not harmful to cancel a transaction twice. */ + /*! Note: it is not harmful to cancel a transaction twice. */ LOGP(DLMGCP, LOGL_INFO, "Cannot cancel, no such transaction: %u\n", trans_id); return -ENOENT; } LOGP(DLMGCP, LOGL_INFO, "Canceled transaction %u\n", trans_id); talloc_free(pending); return 0; - /* We don't really need to clean up the wqueue: In all sane cases, the msgb has already been sent - * out and is no longer in the wqueue. If it still is in the wqueue, then sending MGCP messages - * per se is broken and the program should notice so by a full wqueue. Even if this was called - * before we had a chance to send out the message and it is still going to be sent, we will just - * ignore the reply to it later. Removing a msgb from the wqueue here would just introduce more - * bug surface in terms of failing to update wqueue API's counters or some such. + /*! We don't really need to clean up the wqueue: In all sane cases, the msgb has already been sent + * out and is no longer in the wqueue. If it still is in the wqueue, then sending MGCP messages + * per se is broken and the program should notice so by a full wqueue. Even if this was called + * before we had a chance to send out the message and it is still going to be sent, we will just + * ignore the reply to it later. Removing a msgb from the wqueue here would just introduce more + * bug surface in terms of failing to update wqueue API's counters or some such. */ } @@ -764,6 +788,10 @@ #define MGCP_AUEP_MANDATORY (MGCP_MSG_PRESENCE_ENDPOINT) #define MGCP_RSIP_MANDATORY 0 /* none */ +/*! Generate an MGCP message + * \param[in] mgcp MGCP client descriptor. + * \param[in] mgcp_msg Message description + * \returns message buffer on success, NULL on error. */ struct msgb *mgcp_msg_gen(struct mgcp_client *mgcp, struct mgcp_msg *mgcp_msg) { mgcp_trans_id_t trans_id = mgcp_client_next_trans_id(mgcp); @@ -908,12 +936,17 @@ return msg; } -/* Retrieve the MGCP transaction ID from a msgb generated by mgcp_msg_gen() */ +/*! Retrieve the MGCP transaction ID from a msgb generated by mgcp_msg_gen() + * \param[in] msg message buffer + * \returns Transaction id. */ mgcp_trans_id_t mgcp_msg_trans_id(struct msgb *msg) { return (mgcp_trans_id_t)msg->cb[MSGB_CB_MGCP_TRANS_ID]; } +/*! Get the configuration parameters a given MGCP client instance + * \param[in] mgcp MGCP client descriptor. + * \returns configuration */ struct mgcp_client_conf *mgcp_client_conf_actual(struct mgcp_client *mgcp) { return &mgcp->actual; -- To view, visit https://gerrit.osmocom.org/5937 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0b8a0652e60f2b3d72ee1cedfa6e2d5547d88455 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:19 +0000 Subject: [MERGED] osmo-mgw[master]: protocol: fix problem with line break and OSMUX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: protocol: fix problem with line break and OSMUX ...................................................................... protocol: fix problem with line break and OSMUX The SDP parameter block must be detached from the regular parameters using an additional line break (empty line). At the moment this works because the empty OSMOX variable is added and by this also adds a line break. It breaks as soon as OSMUX is used again. - Make clear that no OSMUX variable is added when OSMUX is not in use. - Add the extra line break independently Change-Id: I6261971040db527b96fe79676520ccd7794bd327 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 11 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index daedc8d..49c4c3c 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -226,7 +226,7 @@ struct msgb *sdp; int rc; struct msgb *result; - char osmux_extension[strlen("\nX-Osmux: 255") + 1]; + char osmux_extension[strlen("X-Osmux: 255") + 1]; char local_ip_addr[INET_ADDRSTRLEN]; sdp = msgb_alloc_headroom(4096, 128, "sdp record"); @@ -239,7 +239,7 @@ } if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - sprintf(osmux_extension, "\nX-Osmux: %u", conn->osmux.cid); + sprintf(osmux_extension, "X-Osmux: %u", conn->osmux.cid); conn->osmux.state = OSMUX_STATE_ACTIVATING; } else { osmux_extension[0] = '\0'; @@ -252,9 +252,15 @@ goto error; } - rc = msgb_printf(sdp, "%s\n", osmux_extension); - if (rc < 0) - goto error; + /* Attach optional OSMUX parameters */ + if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { + rc = msgb_printf(sdp, "%s\n", osmux_extension); + if (rc < 0) + goto error; + } + + /* Attach line break to separate the parameters from the SDP block */ + rc = msgb_printf(sdp, "\n"); rc = mgcp_write_response_sdp(endp, conn, sdp, addr); if (rc < 0) -- To view, visit https://gerrit.osmocom.org/5980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6261971040db527b96fe79676520ccd7794bd327 Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:23 +0000 Subject: [MERGED] osmo-mgw[master]: protocol: fix missing carriage return In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: protocol: fix missing carriage return ...................................................................... protocol: fix missing carriage return Some of the line breaks lack the \r character, which leads to an inconsistancy. While our software and even wireshark does ignore the problem, other third party implementations might reject those messages. - Add the missing \r characters to make the message format consistant. Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c --- M src/libosmo-mgcp/mgcp_protocol.c M tests/mgcp/mgcp_test.c 2 files changed, 17 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 49c4c3c..73d7f5e 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -201,14 +201,14 @@ /* NOTE: Only in the virtual trunk we allow dynamic endpoint names */ if (endp->wildcarded_crcx && endp->tcfg->trunk_type == MGCP_TRUNK_VIRTUAL) { - rc = msgb_printf(msg, "Z: %s%u@%s\n", + rc = msgb_printf(msg, "Z: %s%u@%s\r\n", MGCP_ENDPOINT_PREFIX_VIRTUAL_TRUNK, ENDPOINT_NUMBER(endp), endp->cfg->domain); if (rc < 0) return -EINVAL; } - rc = msgb_printf(msg, "I: %s\n", conn->conn->id); + rc = msgb_printf(msg, "I: %s\r\n", conn->conn->id); if (rc < 0) return -EINVAL; @@ -254,13 +254,13 @@ /* Attach optional OSMUX parameters */ if (conn->osmux.state == OSMUX_STATE_NEGOTIATING) { - rc = msgb_printf(sdp, "%s\n", osmux_extension); + rc = msgb_printf(sdp, "%s\r\n", osmux_extension); if (rc < 0) goto error; } /* Attach line break to separate the parameters from the SDP block */ - rc = msgb_printf(sdp, "\n"); + rc = msgb_printf(sdp, "\r\n"); rc = mgcp_write_response_sdp(endp, conn, sdp, addr); if (rc < 0) diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index ddee8c5..1790444 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -86,7 +86,7 @@ #define MDCX3_RET \ "200 18983215 OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -98,7 +98,7 @@ #define MDCX3A_RET \ "200 18983215 OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -110,7 +110,7 @@ #define MDCX3_FMTP_RET \ "200 18983215 OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -138,7 +138,7 @@ #define MDCX4_RET(Ident) \ "200 " Ident " OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -150,7 +150,7 @@ #define MDCX4_RO_RET(Ident) \ "200 " Ident " OK\r\n" \ - "\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -247,8 +247,8 @@ #define CRCX_RET \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -260,8 +260,8 @@ #define CRCX_RET_NO_RTPMAP \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -272,8 +272,8 @@ #define CRCX_FMTP_RET \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ @@ -296,8 +296,8 @@ #define CRCX_ZYN_RET \ "200 2 OK\r\n" \ - "I: %s\n" \ - "\n" \ + "I: %s\r\n" \ + "\r\n" \ "v=0\r\n" \ "o=- %s 23 IN IP4 0.0.0.0\r\n" \ "s=-\r\n" \ -- To view, visit https://gerrit.osmocom.org/5981 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0cd80afae65accd3b4ddc5d82e5d30385879141c Gerrit-PatchSet: 3 Gerrit-Project: osmo-mgw 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 Fri Jan 26 00:32:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:47 +0000 Subject: osmo-ggsn[master]: gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:54 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton ...................................................................... gtp/pdp: Remove unused APIs pdp_ntoeua pdp_euaton Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b --- M gtp/pdp.c M gtp/pdp.h 2 files changed, 0 insertions(+), 20 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/pdp.c b/gtp/pdp.c index c245fed..a630ee9 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -364,24 +364,6 @@ */ /* Various conversion functions */ -int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua) -{ - eua->l = 6; - eua->v[0] = PDP_EUA_ORG_IETF; - eua->v[1] = PDP_EUA_TYPE_v4; - memcpy(&eua->v[2], src, 4); /* Copy a 4 byte address */ - return 0; -} - -int pdp_euaton(struct ul66_t *eua, struct in_addr *dst) -{ - if ((eua->l != 6) || (eua->v[0] != PDP_EUA_ORG_IETF) || (eua->v[1] != PDP_EUA_TYPE_v4)) { - return EOF; - } - memcpy(dst, &eua->v[2], 4); /* Copy a 4 byte address */ - return 0; -} - uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi) { return (imsi & 0x0fffffffffffffffull) + ((uint64_t) nsapi << 60); diff --git a/gtp/pdp.h b/gtp/pdp.h index f8955bb..81a38f4 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -267,8 +267,6 @@ int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua); */ -int pdp_ntoeua(struct in_addr *src, struct ul66_t *eua); -int pdp_euaton(struct ul66_t *eua, struct in_addr *dst); uint64_t pdp_gettid(uint64_t imsi, uint8_t nsapi); #endif /* !_PDP_H */ -- To view, visit https://gerrit.osmocom.org/6070 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I00db99ba8de3f3d90e85bf593ed31555eedb439b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:54 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp.c: Fix trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp.c: Fix trailing whitespace ...................................................................... gtp.c: Fix trailing whitespace Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 --- M gtp/gtp.c 1 file changed, 28 insertions(+), 28 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 0d6d896..8652470 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -1,19 +1,19 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2010-2011, 2016-2017 Harald Welte * Copyright (C) 2015-2017 sysmocom - s.f.m.c. GmbH - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* * gtp.c: Contains all GTP functionality. Should be able to handle multiple - * tunnels in the same program. + * tunnels in the same program. * * TODO: * - Do we need to handle fragmentation? @@ -326,19 +326,19 @@ /* *********************************************************** * Reliable delivery of signalling messages - * + * * Sequence numbers are used for both signalling messages and * data messages. * * For data messages each tunnel maintains a sequence counter, * which is incremented by one each time a new data message * is sent. The sequence number starts at (0) zero at tunnel - * establishment, and wraps around at 65535 (29.060 9.3.1.1 + * establishment, and wraps around at 65535 (29.060 9.3.1.1 * and 09.60 8.1.1.1). The sequence numbers are either ignored, * or can be used to check the validity of the message in the * receiver, or for reordering af packets. * - * For signalling messages the sequence number is used by + * For signalling messages the sequence number is used by * signalling messages for which a response is defined. A response * message should copy the sequence from the corresponding request * message. The sequence number "unambiguously" identifies a request @@ -356,7 +356,7 @@ * with path setup and teardown. * * If a response message is lost, the request will be retransmitted, and - * the receiving GSN will receive a "duplicated" request. The standard + * the receiving GSN will receive a "duplicated" request. The standard * requires the receiving GSN to send a response, with the same information * as in the original response. For most messages this happens automatically: * @@ -371,22 +371,22 @@ * a nonexist reply message. * * The correct solution will be to make a queue containing response messages. - * This queue should be checked whenever a request is received. If the + * This queue should be checked whenever a request is received. If the * response is allready in the queue that response should be transmitted. * It should be possible to find messages in this queue on the basis of * the sequence number and peer GSN IP address (The sequense number is unique * within each path). This need to be implemented by a hash table. Furthermore * it should be possibly to delete messages based on a timeout. This can be * achieved by means of a linked list. The timeout value need to be larger - * than T3-RESPONSE * N3-REQUESTS (recommended value 5). These timers are + * than T3-RESPONSE * N3-REQUESTS (recommended value 5). These timers are * set in the peer GSN, so there is no way to know these parameters. On the * other hand the timeout value need to be so small that we do not receive * wraparound sequence numbere before the message is deleted. 60 seconds is * probably not a bad choise. - * + * * This queue however is first really needed from gtp1. * - * gtp_req: + * gtp_req: * Send off a signalling message with appropiate sequence * number. Store packet in queue. * gtp_conf: @@ -897,7 +897,7 @@ * For response messages we need to be able to respond to * the relevant src port even if it is locally allocated by * the peer. - * + * * The need for path management! * We might need to keep a list of active paths. This might * be in the form of remote IP address + UDP port numbers. @@ -987,9 +987,9 @@ /* This message is somewhat special in that it actually is a * response to some other message with unsupported GTP version * For this reason it has parameters like a response, and does - * its own message transmission. No signalling queue is used + * its own message transmission. No signalling queue is used * The reply is sent to the peer IP and peer UDP. This means that - * the peer will be receiving a GTP0 message on a GTP1 port! + * the peer will be receiving a GTP0 message on a GTP1 port! * In practice however this will never happen as a GTP0 GSN will * only listen to the GTP0 port, and therefore will never receive * anything else than GTP0 */ @@ -1052,7 +1052,7 @@ * Messages: create, update and delete PDP context * * Information storage - * Information storage for each PDP context is defined in + * Information storage for each PDP context is defined in * 23.060 section 13.3. Includes IMSI, MSISDN, APN, PDP-type, * PDP-address (IP address), sequence numbers, charging ID. * For the SGSN it also includes radio related mobility @@ -1138,7 +1138,7 @@ pdp->cch_pdp); } - /* TODO + /* TODO gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_REF, pdp->traceref); gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_TYPE, @@ -1582,7 +1582,7 @@ (!memcmp(pdp->msisdn.v, pdp_old->msisdn.v, pdp->msisdn.l))) { /* OK! We are dealing with the same APN. We will copy new - * parameters to the old pdp and send off confirmation + * parameters to the old pdp and send off confirmation * We ignore the following information elements: * QoS: MS will get originally negotiated QoS. * End user address (EUA). MS will get old EUA anyway. @@ -1898,14 +1898,14 @@ gtpie_tv1(&packet, &length, GTP_MAX, GTPIE_NSAPI, pdp->nsapi); - /* TODO + /* TODO gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_REF, pdp->traceref); gtpie_tv2(&packet, &length, GTP_MAX, GTPIE_TRACE_TYPE, pdp->tracetype); */ /* TODO if ggsn update message - gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, + gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, pdp->eua.l, pdp->eua.v); */ @@ -1977,8 +1977,8 @@ gtpie_tv4(&packet, &length, GTP_MAX, GTPIE_CHARGING_ID, pdp->teid_own); - /* If ggsn - gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, + /* If ggsn + gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_EUA, pdp->eua.l, pdp->eua.v); */ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_GSN_ADDR, @@ -2172,7 +2172,7 @@ GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Missing mandatory information field"); memcpy(pdp, &pdp_backup, sizeof(pdp_backup)); - return gtp_update_pdp_resp(gsn, version, pdp, + return gtp_update_pdp_resp(gsn, version, pdp, GTPCAUSE_MAN_IE_MISSING); } */ @@ -2442,7 +2442,7 @@ if (pdp_getgtp1 (&secondary_pdp, linked_pdp->secondary_tei[n])) { - LOGP(DLGTP, LOGL_ERROR, + LOGP(DLGTP, LOGL_ERROR, "Unknown secondary PDP context\n"); return EOF; } @@ -2745,10 +2745,10 @@ return 0; } -/* Receives GTP packet and sends off for further processing +/* Receives GTP packet and sends off for further processing * Function will check the validity of the header. If the header - * is not valid the packet is either dropped or a version not - * supported is returned to the peer. + * is not valid the packet is either dropped or a version not + * supported is returned to the peer. * TODO: Need to decide on return values! */ int gtp_decaps0(struct gsn_t *gsn) { @@ -3298,7 +3298,7 @@ /* *********************************************************** * IP address conversion functions * There exist several types of address representations: - * - eua: End User Address. (29.060, 7.7.27, message type 128) + * - eua: End User Address. (29.060, 7.7.27, message type 128) * Used for signalling address to mobile station. Supports IPv4 * IPv6 x.25 etc. etc. * - gsna: GSN Address. (29.060, 7.7.32, message type 133): IP address -- To view, visit https://gerrit.osmocom.org/6066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I636c81d0c0ff53c97e6aedbc00f90c1325a3d607 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:55 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitiali... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitialized var ...................................................................... gtp.c: gtp_gpdu_ind: Early return to avoid use of uninitialized var If the version received is not known, pdp is then uninitalized so we should not be using it. Let's return an error to inform the caller. Change-Id: Ib3e23b61a3521bd3c9002d3165ca8eff4361a35e --- M gtp/gtp.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index a2526a3..9dabcd2 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2696,7 +2696,7 @@ struct sockaddr_in *peer, int fd, void *pack, unsigned len) { - int hlen = GTP1_HEADER_SIZE_SHORT; + int hlen; /* Need to include code to verify packet src and dest addresses */ struct pdp_t *pdp; @@ -2732,6 +2732,7 @@ default: GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown version: %d\n", version); + return EOF; } /* If the GPDU was not from the peer GSN tell him to delete context */ -- To view, visit https://gerrit.osmocom.org/6072 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3e23b61a3521bd3c9002d3165ca8eff4361a35e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:55 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp.c: gtp_gpdu_ind: Convert ifelse to switch statement In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp.c: gtp_gpdu_ind: Convert ifelse to switch statement ...................................................................... gtp.c: gtp_gpdu_ind: Convert ifelse to switch statement Change-Id: I99b73f7a6d4100789fa92021c6ec9117869c881b --- M gtp/gtp.c 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 53b38de..a2526a3 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2701,7 +2701,8 @@ /* Need to include code to verify packet src and dest addresses */ struct pdp_t *pdp; - if (version == 0) { + switch (version) { + case 0: if (pdp_getgtp0 (&pdp, ntoh16(((union gtp_packet *)pack)->gtp0.h.flow))) { gsn->err_unknownpdp++; @@ -2711,7 +2712,8 @@ len); } hlen = GTP0_HEADER_SIZE; - } else if (version == 1) { + break; + case 1: if (pdp_getgtp1 (&pdp, ntoh32(((union gtp_packet *)pack)->gtp1l.h.tei))) { gsn->err_unknownpdp++; @@ -2726,7 +2728,8 @@ hlen = GTP1_HEADER_SIZE_LONG; else hlen = GTP1_HEADER_SIZE_SHORT; - } else { + break; + default: GTP_LOGPKG(LOGL_ERROR, peer, pack, len, "Unknown version: %d\n", version); } -- To view, visit https://gerrit.osmocom.org/6071 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99b73f7a6d4100789fa92021c6ec9117869c881b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:55 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp/pdp: Fix trailing whitespace In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp/pdp: Fix trailing whitespace ...................................................................... gtp/pdp: Fix trailing whitespace Change-Id: I1bc65ef9af1144779ee91a2c9b9887233ad15671 --- M gtp/pdp.c M gtp/pdp.h 2 files changed, 30 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/pdp.c b/gtp/pdp.c index b1e1ff3..c245fed 100644 --- a/gtp/pdp.c +++ b/gtp/pdp.c @@ -1,17 +1,17 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003, 2004 Mondru AB. * Copyright (C) 2017 Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ /* - * pdp.c: + * pdp.c: * */ @@ -44,17 +44,17 @@ * Functions related to PDP storage * * Lifecycle - * For a GGSN pdp context life begins with the reception of a + * For a GGSN pdp context life begins with the reception of a * create pdp context request. It normally ends with the reception * of a delete pdp context request, but will also end with the - * reception of an error indication message. + * reception of an error indication message. * Provisions should probably be made for terminating pdp contexts - * based on either idle timeout, or by sending downlink probe + * based on either idle timeout, or by sending downlink probe * messages (ping?) to see if the MS is still responding. - * + * * For an SGSN pdp context life begins with the application just * before sending off a create pdp context request. It normally - * ends when a delete pdp context response message is received + * ends when a delete pdp context response message is received * from the GGSN, but should also end when with the reception of * an error indication message. * @@ -64,15 +64,15 @@ * Downlink packets received in the GGSN are identified only by their * network interface together with their destination IP address (Two * network interfaces can use the same private IP address). Each IMSI - * (mobile station) can have several PDP contexts using the same IP + * (mobile station) can have several PDP contexts using the same IP * address. In this case the traffic flow template (TFT) is used to - * determine the correct PDP context for a particular IMSI. Also it + * determine the correct PDP context for a particular IMSI. Also it * should be possible for each PDP context to use several IP adresses * For fixed wireless access a mobile station might need a full class * C network. Even in the case of several IP adresses the PDP context * should be determined on the basis of the network IP address. * Thus we need a hash table based on network interface + IP address. - * + * * Uplink packets are for GTP0 identified by their IMSI and NSAPI, which * is collectively called the tunnel identifier. There is also a 16 bit * flow label that can be used for identification of uplink packets. This @@ -85,7 +85,7 @@ * Thus we need a hash table based on TID (IMSI and NSAPI). The TEID will * be used for directly addressing the PDP context. - * pdp_newpdp + * pdp_newpdp * Gives you a pdp context with no hash references In some way * this should have a limited lifetime. * @@ -296,7 +296,7 @@ /#printf("IPhash %ld\n", lookup(eua->v, eua->l, ipif) % PDP_MAX);#/ return (lookup(eua->v, eua->l, ipif) % PDP_MAX); } - + int pdp_ipset(struct pdp_t *pdp, void* ipif, struct ul66_t *eua) { int hash; struct pdp_t *pdp2; @@ -304,7 +304,7 @@ if (PDP_DEBUG) printf("Begin pdp_ipset %d %d %2x%2x%2x%2x\n", (unsigned) ipif, eua->l, - eua->v[2], eua->v[3], + eua->v[2], eua->v[3], eua->v[4], eua->v[5]); pdp->ipnext = NULL; @@ -316,9 +316,9 @@ for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) pdp_prev = pdp2; - if (!pdp_prev) + if (!pdp_prev) haship[hash] = pdp; - else + else pdp_prev->ipnext = pdp; if (PDP_DEBUG) printf("End pdp_ipset\n"); return 0; @@ -331,9 +331,9 @@ if (PDP_DEBUG) printf("Begin pdp_ipdel\n"); for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) { if (pdp2 == pdp) { - if (!pdp_prev) + if (!pdp_prev) haship[hash] = pdp2->ipnext; - else + else pdp_prev->ipnext = pdp2->ipnext; if (PDP_DEBUG) printf("End pdp_ipdel: PDP found\n"); return 0; @@ -347,17 +347,17 @@ int pdp_ipget(struct pdp_t **pdp, void* ipif, struct ul66_t *eua) { int hash = pdp_iphash(ipif, eua); struct pdp_t *pdp2; - /#printf("Begin pdp_ipget %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l, + /#printf("Begin pdp_ipget %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l, eua->v[2],eua->v[3],eua->v[4],eua->v[5]);#/ for (pdp2 = haship[hash]; pdp2; pdp2 = pdp2->ipnext) { - if ((pdp2->ipif == ipif) && (pdp2->eua.l == eua->l) && + if ((pdp2->ipif == ipif) && (pdp2->eua.l == eua->l) && (memcmp(&pdp2->eua.v, &eua->v, eua->l) == 0)) { *pdp = pdp2; /#printf("End pdp_ipget. Found\n");#/ return 0; } } - if (PDP_DEBUG) printf("End pdp_ipget Notfound %d %d %2x%2x%2x%2x\n", + if (PDP_DEBUG) printf("End pdp_ipget Notfound %d %d %2x%2x%2x%2x\n", (unsigned)ipif, eua->l, eua->v[2],eua->v[3],eua->v[4],eua->v[5]); return EOF; /# End of linked list and not found #/ } diff --git a/gtp/pdp.h b/gtp/pdp.h index b581952..f8955bb 100644 --- a/gtp/pdp.h +++ b/gtp/pdp.h @@ -1,13 +1,13 @@ -/* +/* * OsmoGGSN - Gateway GPRS Support Node * Copyright (C) 2002, 2003 Mondru AB. * Copyright (C) 2017 Harald Welte - * + * * The contents of this file may be used under the terms of the GNU * General Public License Version 2, provided that the above copyright * notice and this permission notice is included in all copies or * substantial portions of the software. - * + * */ #ifndef _PDP_H @@ -72,16 +72,16 @@ * and 09.60. * 31 * 4 + 15 structs + = 120 + 15 structs ~ 2k / context * Structs: IP address 16+4 bytes (6), APN 255 bytes (2) - * QOS: 255 bytes (3), msisdn 16 bytes (1), + * QOS: 255 bytes (3), msisdn 16 bytes (1), * * TODO: We need to consider who manages the pdp_t hash tables * Is it gtp_lib, or is it the application? - * I suppose that it will be gtp_lib. + * I suppose that it will be gtp_lib. * SGSN will ask gtplib for new pdp_t. Fill out the fields, * and pass it on to gtp_create_pdp_req. * GGSN will receive gtp_create_pdp_ind, create new pdp_t and * send responce to SGSN. - * SGSN will receive response and gtplib will find the + * SGSN will receive response and gtplib will find the * original pdp_t corresponding to the request. This will be * passed on to the application. * Eventually the SGSN will close the connection, and the @@ -89,10 +89,10 @@ * This means that gtplib need to have functions to * allocate, free, sort and find pdp_t * (newpdp, freepdp, getpdp) - * Hash tables: TID, IMSI, IP etc.) + * Hash tables: TID, IMSI, IP etc.) * * - * Secondary PDP Context Activation Procedure + * Secondary PDP Context Activation Procedure * * With GTP version 1 it is possible to establish multiple PDP * contexts with the same IP address. With this scheme the first -- To view, visit https://gerrit.osmocom.org/6069 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1bc65ef9af1144779ee91a2c9b9887233ad15671 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:55 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp.c: Log unsupported GTP version number In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp.c: Log unsupported GTP version number ...................................................................... gtp.c: Log unsupported GTP version number Change-Id: Idbc6e4c912b958bde5916b87ec53c3c4db70bee0 --- M gtp/gtp.c 1 file changed, 10 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index f513b9b..53b38de 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2802,8 +2802,8 @@ /* supported on this port */ if (version > 0) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); gtp_unsup_req(gsn, 0, &peer, gsn->fd0, buffer, status); /* 29.60: 11.1.1 */ continue; } @@ -2945,8 +2945,8 @@ /* Version must be no larger than GTP 1 */ if (version > 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); gtp_unsup_req(gsn, version, &peer, fd, buffer, status); /*29.60: 11.1.1 */ continue; @@ -2958,8 +2958,8 @@ /* the message */ if (version < 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); continue; } @@ -3123,8 +3123,8 @@ /* Version must be no larger than GTP 1 */ if (version > 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); gtp_unsup_req(gsn, 1, &peer, gsn->fd1c, buffer, status); /*29.60: 11.1.1 */ continue; } @@ -3135,8 +3135,8 @@ /* the message */ if (version < 1) { gsn->unsup++; - GTP_LOGPKG(LOGL_ERROR, &peer, buffer, - status, "Unsupported GTP version\n"); + GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, + "Unsupported GTP version %"PRIu8"\n", version); continue; } -- To view, visit https://gerrit.osmocom.org/6068 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idbc6e4c912b958bde5916b87ec53c3c4db70bee0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 00:32:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 00:32:56 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp.c: Determine GTP version from header In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp.c: Determine GTP version from header ...................................................................... gtp.c: Determine GTP version from header Change-Id: I843071a090e877fd529e1e0b799df3585bf836d8 --- M gtp/gtp.c 1 file changed, 14 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 8652470..f513b9b 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2757,7 +2757,7 @@ socklen_t peerlen; int status; struct gtp0_header *pheader; - int version = 0; /* GTP version should be determined from header! */ + uint8_t version; int fd = gsn->fd0; /* TODO: Need strategy of userspace buffering and blocking */ @@ -2793,12 +2793,14 @@ pheader = (struct gtp0_header *)(buffer); + version = GTPHDR_F_GET_VER(pheader->flags); + /* Version should be gtp0 (or earlier) */ /* 09.60 is somewhat unclear on this issue. On gsn->fd0 we expect only */ /* GTP 0 messages. If other version message is received we reply that we */ /* only support version 0, implying that this is the only version */ /* supported on this port */ - if (GTPHDR_F_GET_VER(pheader->flags) > 0) { + if (version > 0) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2902,7 +2904,7 @@ socklen_t peerlen; int status; struct gtp1_header_short *pheader; - int version = 1; /* TODO GTP version should be determined from header! */ + uint8_t version; int fd = gsn->fd1c; /* TODO: Need strategy of userspace buffering and blocking */ @@ -2938,8 +2940,10 @@ pheader = (struct gtp1_header_short *)(buffer); + version = GTPHDR_F_GET_VER(pheader->flags); + /* Version must be no larger than GTP 1 */ - if (GTPHDR_F_GET_VER(pheader->flags) > 1) { + if (version > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -2952,7 +2956,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (GTPHDR_F_GET_VER(pheader->flags) < 1) { + if (version < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3077,7 +3081,7 @@ socklen_t peerlen; int status; struct gtp1_header_short *pheader; - int version = 1; /* GTP version should be determined from header! */ + uint8_t version; int fd = gsn->fd1u; /* TODO: Need strategy of userspace buffering and blocking */ @@ -3114,8 +3118,10 @@ pheader = (struct gtp1_header_short *)(buffer); + version = GTPHDR_F_GET_VER(pheader->flags); + /* Version must be no larger than GTP 1 */ - if (GTPHDR_F_GET_VER(pheader->flags) > 1) { + if (version > 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); @@ -3127,7 +3133,7 @@ /* 29.060 is somewhat unclear on this issue. On gsn->fd1c we expect only */ /* GTP 1 messages. If GTP 0 message is received we silently discard */ /* the message */ - if (GTPHDR_F_GET_VER(pheader->flags) < 1) { + if (version < 1) { gsn->unsup++; GTP_LOGPKG(LOGL_ERROR, &peer, buffer, status, "Unsupported GTP version\n"); -- To view, visit https://gerrit.osmocom.org/6067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I843071a090e877fd529e1e0b799df3585bf836d8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 02:29:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 02:29:27 +0000 Subject: osmo-bsc[master]: Improve an error message in page_lai_and_lac() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 02:29:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 02:29:32 +0000 Subject: [MERGED] osmo-bsc[master]: Improve an error message in page_lai_and_lac() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Improve an error message in page_lai_and_lac() ...................................................................... Improve an error message in page_lai_and_lac() This error message is now contained in a loop, and the current iteration does not know whether paging will fail entirely or if later iterations will succeed. Update the error message accordingly. This also makes the error message consistent with the one in page_cgi(). Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 --- M src/osmo-bsc/osmo_bsc_bssap.c M tests/bssap/bssap_test.err 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 799cb46..67ff230 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -412,7 +412,7 @@ mi_string, lac); } } else { - LOGP(DMSC, LOGL_DEBUG, "Not paging IMSI %s: MCC/MNC in Cell Identifier List " + LOGP(DMSC, LOGL_DEBUG, "Paging IMSI %s: MCC/MNC in Cell Identifier List " "(%d/%d) do not match our network (%d/%d)\n", mi_string, mcc, mnc, msc->network->country_code, msc->network->network_code); } diff --git a/tests/bssap/bssap_test.err b/tests/bssap/bssap_test.err index abe1def..18bfbca 100644 --- a/tests/bssap/bssap_test.err +++ b/tests/bssap/bssap_test.err @@ -16,7 +16,7 @@ 2: DMSC Rx MSC UDT: 00 19 52 08 08 59 51 20 69 00 07 43 94 09 04 01 08 44 60 1a 06 04 15 f5 49 00 65 DMSC Rx MSC UDT BSSMAP PAGING -DMSC Not paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) +DMSC Paging IMSI 515029600703449: MCC/MNC in Cell Identifier List (515/94) do not match our network (1/1) bsc_handle_udt() returned 0 3: -- To view, visit https://gerrit.osmocom.org/6063 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ec229702343343dedcbb242b6d0ed170c858511 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 02:30:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 02:30:43 +0000 Subject: osmo-pcu[master]: TBF: decrease L1 logging verbosity in test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d 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 Fri Jan 26 02:31:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 02:31:06 +0000 Subject: osmo-pcu[master]: TBF: override send function via linker option In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb 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 Fri Jan 26 02:31:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 02:31:11 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: override send function via linker option In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: override send function via linker option ...................................................................... TBF: override send function via linker option Use --wrap linker facility to override pcu_sock_send() similar to other Osmo* projects. Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb --- M tests/Makefile.am M tests/tbf/TbfTest.cpp 2 files changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/Makefile.am b/tests/Makefile.am index 1595a07..e82647f 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -33,6 +33,7 @@ $(LIBOSMOGSM_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(COMMON_LA) +tbf_TbfTest_LDFLAGS = -Wl,--wrap=pcu_sock_send bitcomp_BitcompTest_SOURCES = bitcomp/BitcompTest.cpp ../src/egprs_rlc_compression.cpp bitcomp_BitcompTest_LDADD = \ diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 46863e3..aa1d7ac 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -137,7 +137,9 @@ static uint8_t llc_data[200]; -int pcu_sock_send(struct msgb *msg) +/* override, requires '-Wl,--wrap=pcu_sock_send' */ +int __real_pcu_sock_send(struct msgb *msg); +int __wrap_pcu_sock_send(struct msgb *msg) { return 0; } -- To view, visit https://gerrit.osmocom.org/6077 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia3d436bd3d1fb0ce8e98526bd7457f4c57667ceb 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 Fri Jan 26 02:31:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 02:31:12 +0000 Subject: [MERGED] osmo-pcu[master]: TBF: decrease L1 logging verbosity in test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: TBF: decrease L1 logging verbosity in test ...................................................................... TBF: decrease L1 logging verbosity in test Don't clutter output with low-level details. Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d --- M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 2 files changed, 1 insertion(+), 290 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index ac693bb..46863e3 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -3276,7 +3276,7 @@ bssgp_set_log_ss(DBSSGP); log_parse_category_mask(osmo_stderr_target, "DRLCMAC,1:DRLCMACDATA,3:DRLCMACDL,3:DRLCMACUL,3:" "DRLCMACSCHED,1:DRLCMACMEAS,3:DNS,3:DBSSGP,3:DPCU,5:" - "DL1IF,1:DTBF,1:DTBFUL,1:DTBFDL,1:"); + "DL1IF,6:DTBF,1:DTBFUL,1:DTBFDL,1:"); vty_init(&pcu_vty_info); pcu_vty_init(&gprs_log_info); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 0de4917..d207a1d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -66,7 +66,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 0, CS=CS-1 @@ -76,7 +75,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==1) @@ -86,7 +84,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) changes state from FLOW to WAIT RELEASE @@ -156,7 +153,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 0, CS=CS-1 @@ -166,7 +162,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==1) @@ -176,7 +171,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) changes state from FLOW to WAIT RELEASE @@ -246,7 +240,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 0, CS=CS-1 @@ -256,7 +249,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 01 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==1) @@ -266,7 +258,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 03 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 2, CS=CS-1 @@ -275,7 +266,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 2, CS-1): 07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 00 05 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 3, CS=CS-1 @@ -284,7 +274,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 3, CS-1): 07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 07 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 4, CS=CS-1 @@ -293,7 +282,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 4, CS-1): 07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 09 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 62 63 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 5, CS=CS-1 @@ -302,7 +290,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 5, CS-1): 07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 0b 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 76 77 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 6, CS=CS-1 @@ -311,7 +298,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 6, CS-1): 07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 00 0d 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 8a 8b Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 7, CS=CS-1 @@ -320,7 +306,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 7, CS-1): 07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 00 0f 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d 9e 9f Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 8, CS=CS-1 @@ -329,7 +314,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 8, CS-1): 07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 11 a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 b2 b3 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 9, CS=CS-1 @@ -338,7 +322,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 9, CS-1): 07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 00 12 01 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 c6 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 10, CS=CS-1 @@ -349,7 +332,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 10, CS-1): 07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 00 14 07 c7 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 11, CS=CS-1 @@ -358,7 +340,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 11, CS-1): 07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 00 17 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 12, CS=CS-1 @@ -367,7 +348,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 12, CS-1): 07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 19 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 13, CS=CS-1 @@ -376,7 +356,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 13, CS-1): 07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 00 1b 3a 3b 3c 3d 3e 3f 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 14, CS=CS-1 @@ -385,7 +364,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 14, CS-1): 07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 00 1d 4e 4f 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 60 61 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 15, CS=CS-1 @@ -394,7 +372,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 15, CS-1): 07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 00 1f 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f 70 71 72 73 74 75 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 16, CS=CS-1 @@ -403,7 +380,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 16, CS-1): 07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 21 76 77 78 79 7a 7b 7c 7d 7e 7f 80 81 82 83 84 85 86 87 88 89 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 17, CS=CS-1 @@ -412,7 +388,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 17, CS-1): 07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 00 23 8a 8b 8c 8d 8e 8f 90 91 92 93 94 95 96 97 98 99 9a 9b 9c 9d Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 18, CS=CS-1 @@ -421,7 +396,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 18, CS-1): 07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 00 25 9e 9f a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 aa ab ac ad ae af b0 b1 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 19, CS=CS-1 @@ -430,7 +404,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Copying data unit 0 (BSN 19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 19, CS-1): 07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 00 27 b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2 c3 c4 c5 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink (V(A)==0 .. V(S)==20) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Sending new block at BSN 20, CS=CS-1 @@ -444,7 +417,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 20, CS-1): 07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) ack: (BSN=85)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=20) R=ACK I=NACK TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRR...........................................' @@ -461,7 +433,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) msg block (BSN 21, CS-1): 07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) ack: (BSN=86)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=21) R=ACK I=NACK TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................' @@ -479,7 +450,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) msg block (BSN 22, CS-1): 07 01 2c 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=203 block=11 data=07 01 2c 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FINISHED) changes state from FINISHED to WAIT RELEASE @@ -581,7 +551,6 @@ TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 08 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -607,7 +576,6 @@ TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 18 40 0f 8b 2b 2b 2b TBF(TFI=1 TLLI=0xc0000001 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -633,7 +601,6 @@ TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 28 80 0f 8b 2b 2b 2b TBF(TFI=2 TLLI=0xc0000002 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -659,7 +626,6 @@ TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 38 c0 0f 8b 2b 2b 2b TBF(TFI=3 TLLI=0xc0000003 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -685,7 +651,6 @@ TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 49 00 0f 8b 2b 2b 2b TBF(TFI=4 TLLI=0xc0000004 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -711,7 +676,6 @@ TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 59 40 0f 8b 2b 2b 2b TBF(TFI=5 TLLI=0xc0000005 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -737,7 +701,6 @@ TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 69 80 0f 8b 2b 2b 2b TBF(TFI=6 TLLI=0xc0000006 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -763,7 +726,6 @@ TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 79 c0 0f 8b 2b 2b 2b TBF(TFI=7 TLLI=0xc0000007 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -789,7 +751,6 @@ TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 8a 00 0f 8b 2b 2b 2b TBF(TFI=8 TLLI=0xc0000008 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -815,7 +776,6 @@ TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 30 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 9a 40 0f 8b 2b 2b 2b TBF(TFI=9 TLLI=0xc0000009 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -841,7 +801,6 @@ TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 aa 80 0f 8b 2b 2b 2b TBF(TFI=10 TLLI=0xc000000a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -867,7 +826,6 @@ TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 ba c0 0f 8b 2b 2b 2b TBF(TFI=11 TLLI=0xc000000b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -893,7 +851,6 @@ TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 cb 00 0f 8b 2b 2b 2b TBF(TFI=12 TLLI=0xc000000c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -919,7 +876,6 @@ TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 db 40 0f 8b 2b 2b 2b TBF(TFI=13 TLLI=0xc000000d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -945,7 +901,6 @@ TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 eb 80 0f 8b 2b 2b 2b TBF(TFI=14 TLLI=0xc000000e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -971,7 +926,6 @@ TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 00 fb c0 0f 8b 2b 2b 2b TBF(TFI=15 TLLI=0xc000000f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -997,7 +951,6 @@ TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 0c 00 0f 8b 2b 2b 2b TBF(TFI=16 TLLI=0xc0000010 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1023,7 +976,6 @@ TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 1c 40 0f 8b 2b 2b 2b TBF(TFI=17 TLLI=0xc0000011 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1049,7 +1001,6 @@ TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 2c 80 0f 8b 2b 2b 2b TBF(TFI=18 TLLI=0xc0000012 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1075,7 +1026,6 @@ TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 31 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 3c c0 0f 8b 2b 2b 2b TBF(TFI=19 TLLI=0xc0000013 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1101,7 +1051,6 @@ TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 4d 00 0f 8b 2b 2b 2b TBF(TFI=20 TLLI=0xc0000014 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1127,7 +1076,6 @@ TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 5d 40 0f 8b 2b 2b 2b TBF(TFI=21 TLLI=0xc0000015 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1153,7 +1101,6 @@ TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 32 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 6d 80 0f 8b 2b 2b 2b TBF(TFI=22 TLLI=0xc0000016 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1179,7 +1126,6 @@ TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 33 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 7d c0 0f 8b 2b 2b 2b TBF(TFI=23 TLLI=0xc0000017 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1205,7 +1151,6 @@ TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 34 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 8e 00 0f 8b 2b 2b 2b TBF(TFI=24 TLLI=0xc0000018 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1231,7 +1176,6 @@ TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 35 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 9e 40 0f 8b 2b 2b 2b TBF(TFI=25 TLLI=0xc0000019 DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1257,7 +1201,6 @@ TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ae 80 0f 8b 2b 2b 2b TBF(TFI=26 TLLI=0xc000001a DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1283,7 +1226,6 @@ TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 37 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 be c0 0f 8b 2b 2b 2b TBF(TFI=27 TLLI=0xc000001b DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1309,7 +1251,6 @@ TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 38 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 cf 00 0f 8b 2b 2b 2b TBF(TFI=28 TLLI=0xc000001c DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1335,7 +1276,6 @@ TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 32 39 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 df 40 0f 8b 2b 2b 2b TBF(TFI=29 TLLI=0xc000001d DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1361,7 +1301,6 @@ TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 30 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ef 80 0f 8b 2b 2b 2b TBF(TFI=30 TLLI=0xc000001e DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1387,7 +1326,6 @@ TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=30 33 31 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 00 00 01 ff c0 0f 8b 2b 2b 2b TBF(TFI=31 TLLI=0xc000001f DIR=DL STATE=ASSIGN) appending 256 bytes ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 @@ -1421,7 +1359,6 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=220 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 1c 00 dc 01 23 45 68 00 0f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes Modifying MS object, TLLI = 0xc0123456, TA 220 -> 0 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes @@ -1450,7 +1387,6 @@ TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=4 TA=0 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=34 35 36 2d 06 3f 30 0c 00 00 7d 80 00 00 00 dc 01 23 45 68 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) Sending new block at BSN 0, CS=CS-1 @@ -1511,7 +1447,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) restarting timer T3169 [acked (data)] with 0 sec. 0 microsec. @@ -1555,15 +1490,12 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) TX: START Immediate Assignment Downlink (PCH) - TRX=0 (0) TS=7 TA=7 pollFN=-1 -Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 2f 8b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1597,7 +1529,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1639,13 +1570,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1679,7 +1608,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1727,7 +1655,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack @@ -1759,7 +1686,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer T3191 [final block (DL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654292, TS=7 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) 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 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=08 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 Received RTS for PDCH: TRX=0 TS=7 FN=2654283 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=7) prio=1 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) downlink (V(A)==0 .. V(S)==1) @@ -1769,13 +1695,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) msg block (BSN 0, CS-4): 07 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 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 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 MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654232 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8c f6 07 00 c0 0c 68 ab 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=1. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) poll timeout for FN=2654292, TS=7 (curr FN 2654335) @@ -1814,7 +1738,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=1 TLLI=0xf5667788 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1841,13 +1764,11 @@ TBF(TFI=0 TLLI=0xf5667788 DIR=DL STATE=FINISHED) appending 4 bytes Modifying MS object, TLLI: 0xf5667788 confirmed New MS: TLLI = 0xf5667788, TA = 7, IMSI = 0011223344, LLC = 1 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1881,7 +1802,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -1931,13 +1851,11 @@ PDCH(TS 7, TRX 0): Detaching TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) ********** UL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654224 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b ee 07 00 c0 0c 60 6b 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -1974,7 +1892,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -2012,13 +1929,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) Frame 1 starts at offset 0, length=20, is_complete=0 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) No gaps in received block, last block: BSN=0 CV=15 New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -2052,7 +1967,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -2128,7 +2042,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 00 1f 2b 2b 2b 2b 2b 2b 2b Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) restarting timer T3169 [acked (data)] with 0 sec. 0 microsec. @@ -2160,13 +2073,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) Scheduling Ack/Nack, because last block has CV==0. TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FINISHED) changes UL ACK state from GPRS_RLCMAC_UL_ACK_NONE to GPRS_RLCMAC_UL_ACK_SEND_ACK New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -2200,7 +2111,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) RX: [PCU <- BTS] Packet Control Ack @@ -2287,7 +2197,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) RX: [PCU <- BTS] Packet Control Ack @@ -2315,7 +2224,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=00 00 00 37 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2334,7 +2242,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 00 02 1f 43 4b 45 54 20 30 31 4c 4c 43 20 50 41 43 4b 45 54 20 30 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2355,7 +2262,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 2) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 2, CS-1): 07 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654288 block=0 data=00 00 04 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2374,7 +2280,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 3) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 3, CS-1): 07 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654292 block=1 data=00 00 06 27 50 41 43 4b 45 54 20 30 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2395,7 +2300,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 4) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 4, CS-1): 07 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654296 block=2 data=00 00 08 0e 37 20 30 35 4c 4c 43 20 50 41 43 4b 45 54 20 30 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2414,7 +2318,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 5) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 5, CS-1): 07 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654301 block=3 data=00 00 0a 2f 43 20 50 41 43 4b 45 54 20 30 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2435,7 +2338,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 6) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 6, CS-1): 07 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654305 block=4 data=00 00 0c 16 35 45 54 20 30 38 4c 4c 43 20 50 41 43 4b 45 54 20 30 39 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2454,7 +2356,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 7) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 7, CS-1): 07 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654309 block=5 data=00 00 0e 37 4c 4c 43 20 50 41 43 4b 45 54 20 31 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2473,7 +2374,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 8) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 8, CS-1): 07 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654314 block=6 data=00 00 10 1f 43 4b 45 54 20 31 31 4c 4c 43 20 50 41 43 4b 45 54 20 31 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2494,7 +2394,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 9) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 9, CS-1): 07 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654318 block=7 data=00 00 12 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 31 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2513,7 +2412,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 10) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 10, CS-1): 07 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654322 block=8 data=00 00 14 27 50 41 43 4b 45 54 20 31 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2534,7 +2432,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 11) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 11, CS-1): 07 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654327 block=9 data=00 00 16 0e 37 20 31 35 4c 4c 43 20 50 41 43 4b 45 54 20 31 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2553,7 +2450,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 12) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 12, CS-1): 07 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654331 block=10 data=00 00 18 2f 43 20 50 41 43 4b 45 54 20 31 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2574,7 +2470,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 13) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 13, CS-1): 07 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654335 block=11 data=00 00 1a 16 35 45 54 20 31 38 4c 4c 43 20 50 41 43 4b 45 54 20 31 39 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2593,7 +2488,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 14) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 14, CS-1): 07 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654340 block=0 data=00 00 1c 37 4c 4c 43 20 50 41 43 4b 45 54 20 32 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2612,7 +2506,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 15) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 15, CS-1): 07 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654344 block=1 data=00 00 1e 1f 43 4b 45 54 20 32 31 4c 4c 43 20 50 41 43 4b 45 54 20 32 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2633,7 +2526,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 16) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 16, CS-1): 07 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654348 block=2 data=00 00 20 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 32 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2652,7 +2544,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 17) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 17, CS-1): 07 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654353 block=3 data=00 00 22 27 50 41 43 4b 45 54 20 32 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2673,7 +2564,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 18) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 18, CS-1): 07 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654357 block=4 data=00 00 24 0e 37 20 32 35 4c 4c 43 20 50 41 43 4b 45 54 20 32 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2692,7 +2582,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 19) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 19, CS-1): 07 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654361 block=5 data=00 00 26 2f 43 20 50 41 43 4b 45 54 20 32 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2716,7 +2605,6 @@ 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 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) 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 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2735,7 +2623,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 21) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 21, CS-1): 07 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654370 block=7 data=00 00 2a 37 4c 4c 43 20 50 41 43 4b 45 54 20 33 30 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2754,7 +2641,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 22) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 22, CS-1): 07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654374 block=8 data=07 00 2c 1f 43 4b 45 54 20 33 31 4c 4c 43 20 50 41 43 4b 45 54 20 33 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2775,7 +2661,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 23) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 23, CS-1): 07 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654379 block=9 data=00 00 2e 06 37 32 4c 4c 43 20 50 41 43 4b 45 54 20 33 33 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2794,7 +2679,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 24) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 24, CS-1): 07 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654383 block=10 data=00 00 30 27 50 41 43 4b 45 54 20 33 34 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2815,7 +2699,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 25) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 25, CS-1): 07 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654387 block=11 data=00 00 32 0e 37 20 33 35 4c 4c 43 20 50 41 43 4b 45 54 20 33 36 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2834,7 +2717,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 26) TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 26, CS-1): 07 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654392 block=0 data=00 00 34 2f 43 20 50 41 43 4b 45 54 20 33 37 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2857,7 +2739,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduling Ack/Nack polling, because is was requested explicitly (e.g. first final block sent). TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Polling is already scheduled TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) msg block (BSN 27, CS-1): 07 01 36 16 35 45 54 20 33 38 4c 4c 43 20 50 41 43 4b 45 54 20 33 39 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654396 block=1 data=00 01 36 16 35 45 54 20 33 38 4c 4c 43 20 50 41 43 4b 45 54 20 33 39 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=FINISHED) appending 21 bytes @@ -2906,7 +2787,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) RX: [PCU <- BTS] Packet Control Ack @@ -2938,7 +2818,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 0) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 0, CS-1): 07 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654405 block=3 data=00 02 01 4c 4c 43 20 50 41 43 4b 45 54 20 30 30 20 28 54 42 46 20 32 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2957,7 +2836,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 1) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 1, CS-1): 07 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654409 block=4 data=00 02 02 07 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 31 20 28 54 42 46 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2976,7 +2854,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 2) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 2, CS-1): 07 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654413 block=5 data=00 02 04 0f 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 32 20 28 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -2995,7 +2872,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 3) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 3, CS-1): 07 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654418 block=6 data=00 02 06 17 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 33 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3014,7 +2890,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 4) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 4, CS-1): 07 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654422 block=7 data=00 02 08 1f 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 20 30 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3033,7 +2908,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 5) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 5, CS-1): 07 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654426 block=8 data=00 02 0a 27 34 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b 45 54 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3052,7 +2926,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 6) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 6, CS-1): 07 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654431 block=9 data=00 02 0c 2f 20 30 35 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 43 4b Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3071,7 +2944,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 7) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 7, CS-1): 07 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654435 block=10 data=00 02 0e 37 45 54 20 30 36 20 28 54 42 46 20 32 29 4c 4c 43 20 50 41 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3090,7 +2962,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 8) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 8, CS-1): 07 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654439 block=11 data=00 02 10 3f 43 4b 45 54 20 30 37 20 28 54 42 46 20 32 29 4c 4c 43 20 Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3109,7 +2980,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying 1 RLC blocks, 1 BSNs TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) Copying data unit 0 (BSN 9) TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FLOW) msg block (BSN 9, CS-1): 07 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654444 block=0 data=00 02 12 47 50 41 43 4b 45 54 20 30 38 20 28 54 42 46 20 32 29 4c 4c Received RTS on disabled PDCH: TRX=0 TS=0 Received RTS on disabled PDCH: TRX=0 TS=1 Received RTS on disabled PDCH: TRX=0 TS=2 @@ -3132,7 +3002,6 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) starting timer T3191 [final block (DL-TBF)] with 0 sec. 0 microsec. TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) Scheduled Ack/Nack polling on FN=2654461, TS=7 TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=FINISHED) 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 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654448 block=1 data=08 03 14 4d 43 20 50 41 43 4b 45 54 20 30 39 20 28 54 42 46 20 32 29 Not accepting non-EGPRS phone in EGPRS-only mode No PDCH resource ********** DL-TBF starts here ********** @@ -3213,13 +3082,11 @@ Detaching TBF from MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0x00000000 ********** DL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -3259,7 +3126,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -3305,13 +3171,11 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -3351,7 +3215,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -3561,7 +3424,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-1 @@ -3576,7 +3438,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-1): 07 00 00 16 28 2a 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 16 28 2a 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -3590,7 +3451,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-1): 07 40 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-1 @@ -3601,7 +3461,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-1): 07 80 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-1 @@ -3612,7 +3471,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-1): 07 c0 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-1 @@ -3623,7 +3481,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-1): 07 00 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-1 @@ -3634,7 +3491,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-1): 07 40 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-1 @@ -3645,7 +3501,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-1): 07 80 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-1 @@ -3656,7 +3511,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-1): 07 c0 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-1 @@ -3667,7 +3521,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-1): 07 00 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-1 @@ -3678,7 +3531,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-1): 07 40 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-1 @@ -3689,7 +3541,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-1): 07 80 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-1 @@ -3700,7 +3551,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-1): 07 c0 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-1 @@ -3711,7 +3561,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-1): 07 00 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 13, CS=MCS-1 @@ -3722,7 +3571,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 13, MCS-1): 07 40 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 40 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 14, CS=MCS-1 @@ -3733,7 +3581,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 14, MCS-1): 07 80 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 80 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 15, CS=MCS-1 @@ -3744,7 +3591,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 15, MCS-1): 07 c0 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 16, CS=MCS-1 @@ -3755,7 +3601,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 16, MCS-1): 07 00 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 17, CS=MCS-1 @@ -3766,7 +3611,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 17, MCS-1): 07 40 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 40 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 18, CS=MCS-1 @@ -3777,7 +3621,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 18, MCS-1): 07 80 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 80 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 19, CS=MCS-1 @@ -3788,7 +3631,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 19, MCS-1): 07 c0 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 c0 04 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==20) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 20, CS=MCS-1 @@ -3799,7 +3641,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 20, MCS-1): 07 00 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==21) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 21, CS=MCS-1 @@ -3810,7 +3651,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 21, MCS-1): 07 40 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 40 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==22) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 22, CS=MCS-1 @@ -3821,7 +3661,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 22, MCS-1): 07 80 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=99 block=11 data=07 80 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==23) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 23, CS=MCS-1 @@ -3832,7 +3671,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 23, MCS-1): 07 c0 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=104 block=0 data=07 c0 05 96 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==24) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 24, CS=MCS-1 @@ -3846,7 +3684,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 24, MCS-1): 07 00 06 16 18 3a 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=108 block=1 data=07 00 06 16 18 3a 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -3893,7 +3730,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-2 @@ -3908,7 +3744,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-2): 07 00 00 12 28 42 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 12 28 42 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -3922,7 +3757,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-2): 07 40 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-2 @@ -3933,7 +3767,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-2): 07 80 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-2 @@ -3944,7 +3777,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-2): 07 c0 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-2 @@ -3955,7 +3787,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-2): 07 00 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-2 @@ -3966,7 +3797,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-2): 07 40 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-2 @@ -3977,7 +3807,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-2): 07 80 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-2 @@ -3988,7 +3817,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-2): 07 c0 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-2 @@ -3999,7 +3827,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-2): 07 00 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-2 @@ -4010,7 +3837,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-2): 07 40 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-2 @@ -4021,7 +3847,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-2): 07 80 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-2 @@ -4032,7 +3857,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-2): 07 c0 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-2 @@ -4043,7 +3867,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-2): 07 00 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 13, CS=MCS-2 @@ -4054,7 +3877,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 13, MCS-2): 07 40 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 40 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 14, CS=MCS-2 @@ -4065,7 +3887,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 14, MCS-2): 07 80 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 80 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 15, CS=MCS-2 @@ -4076,7 +3897,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 15, MCS-2): 07 c0 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==16) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 16, CS=MCS-2 @@ -4087,7 +3907,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 16, MCS-2): 07 00 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=73 block=5 data=07 00 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==17) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 17, CS=MCS-2 @@ -4098,7 +3917,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 17, MCS-2): 07 40 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=78 block=6 data=07 40 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==18) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 18, CS=MCS-2 @@ -4109,7 +3927,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 18, MCS-2): 07 80 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=82 block=7 data=07 80 04 92 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==19) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 19, CS=MCS-2 @@ -4123,7 +3940,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 19, MCS-2): 07 c0 04 12 20 4a 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=86 block=8 data=07 c0 04 12 20 4a 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4170,7 +3986,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-3 @@ -4185,7 +4000,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-3): 07 00 00 06 28 66 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 06 28 66 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4199,7 +4013,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-3): 07 40 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-3 @@ -4210,7 +4023,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-3): 07 80 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-3 @@ -4221,7 +4033,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-3): 07 c0 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-3 @@ -4232,7 +4043,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-3): 07 00 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-3 @@ -4243,7 +4053,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-3): 07 40 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-3 @@ -4254,7 +4063,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-3): 07 80 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-3 @@ -4265,7 +4073,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-3): 07 c0 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-3 @@ -4276,7 +4083,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-3): 07 00 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-3 @@ -4287,7 +4093,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-3): 07 40 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-3 @@ -4298,7 +4103,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-3): 07 80 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-3 @@ -4309,7 +4113,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-3): 07 c0 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-3 @@ -4320,7 +4123,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-3): 07 00 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==13) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 13, CS=MCS-3 @@ -4331,7 +4133,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 13, MCS-3): 07 40 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=60 block=2 data=07 40 03 86 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==14) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 14, CS=MCS-3 @@ -4344,7 +4145,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 14, MCS-3): 07 80 03 06 7e 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=65 block=3 data=07 80 03 06 7e 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==15) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 15, CS=MCS-3 @@ -4358,7 +4158,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 15, MCS-3): 07 c0 03 06 04 8a 56 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=69 block=4 data=07 c0 03 06 04 8a 56 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4405,7 +4204,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-4 @@ -4420,7 +4218,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-4): 07 00 00 00 28 82 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 28 82 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4434,7 +4231,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-4): 07 40 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-4 @@ -4445,7 +4241,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-4): 07 80 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-4 @@ -4456,7 +4251,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-4): 07 c0 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-4 @@ -4467,7 +4261,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-4): 07 00 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-4 @@ -4478,7 +4271,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-4): 07 40 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-4 @@ -4489,7 +4281,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-4): 07 80 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-4 @@ -4500,7 +4291,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-4): 07 c0 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-4 @@ -4511,7 +4301,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-4): 07 00 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-4 @@ -4522,7 +4311,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-4): 07 40 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-4 @@ -4533,7 +4321,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-4): 07 80 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==11) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 11, CS=MCS-4 @@ -4544,7 +4331,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 11, MCS-4): 07 c0 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=52 block=0 data=07 c0 02 80 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==12) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 12, CS=MCS-4 @@ -4558,7 +4344,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 12, MCS-4): 07 00 03 00 70 3a 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=56 block=1 data=07 00 03 00 70 3a 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 02 86 80 03 56 56 56 56 56 56 56 56 56 56 56 00 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4605,7 +4390,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-5 @@ -4620,7 +4404,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-5): 07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4634,7 +4417,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-5): 07 40 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-5 @@ -4645,7 +4427,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-5): 07 80 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-5 @@ -4656,7 +4437,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-5): 07 c0 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-5 @@ -4667,7 +4447,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-5): 07 00 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-5 @@ -4678,7 +4457,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-5): 07 40 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-5 @@ -4689,7 +4467,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-5): 07 80 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-5 @@ -4700,7 +4477,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-5): 07 c0 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-5 @@ -4711,7 +4487,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-5): 07 00 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==9) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 9, CS=MCS-5 @@ -4722,7 +4497,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 9, MCS-5): 07 40 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=43 block=10 data=07 40 02 58 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-5 @@ -4736,7 +4510,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-5): 07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=47 block=11 data=07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4783,7 +4556,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-6 @@ -4798,7 +4570,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-6): 07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 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) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4812,7 +4583,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 1, MCS-6): 07 40 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 40 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-6 @@ -4823,7 +4593,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-6): 07 80 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==3) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 3, CS=MCS-6 @@ -4834,7 +4603,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 3, MCS-6): 07 c0 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 c0 00 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-6 @@ -4845,7 +4613,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-6): 07 00 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 00 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==5) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 5, CS=MCS-6 @@ -4856,7 +4623,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 5, MCS-6): 07 40 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 40 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-6 @@ -4867,7 +4633,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-6): 07 80 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 01 50 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==7) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 7, CS=MCS-6 @@ -4880,7 +4645,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 7, MCS-6): 07 c0 01 40 62 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 c0 10 70 c0 ca 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=34 block=8 data=07 c0 01 40 62 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 40 c0 10 70 c0 ca 0a Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-6 @@ -4894,7 +4658,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-6): 07 00 02 80 c0 e3 ca 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 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=39 block=9 data=07 00 02 80 c0 e3 ca 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 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -4941,7 +4704,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-7 @@ -4957,7 +4719,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-5): 07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 08 45 56 40 40 40 40 40 40 40 40 40 c0 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 0a TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -4974,7 +4735,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-7): 07 00 00 02 b8 50 64 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 00 02 b8 50 64 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-7 @@ -4988,7 +4748,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-7): 07 80 00 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-7 @@ -5002,7 +4761,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-7): 07 00 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-7 @@ -5016,7 +4774,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-7): 07 80 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 80 01 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-7 @@ -5030,7 +4787,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-7): 07 00 02 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 02 a0 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==10) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 10, CS=MCS-7 @@ -5045,7 +4801,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 10, MCS-5): 07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=30 block=7 data=07 80 02 08 44 57 40 40 40 40 40 40 40 c0 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -5092,7 +4847,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-8 @@ -5109,7 +4863,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-8): 07 00 00 00 60 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 40 11 17 10 10 10 10 10 10 10 10 10 30 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 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 60 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 40 11 17 10 10 10 10 10 10 10 10 10 30 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 b2 b2 b2 b2 b2 b2 b2 b2 b2 b2 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5126,7 +4879,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-8): 07 00 00 02 88 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 00 02 88 50 c4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-8 @@ -5140,7 +4892,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-8): 07 80 00 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-8 @@ -5154,7 +4905,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-8): 07 00 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-8 @@ -5168,7 +4918,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-8): 07 80 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 80 01 02 58 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-8 @@ -5184,7 +4933,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-8): 07 00 02 00 60 20 f5 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 80 d4 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 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 02 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 00 60 20 f5 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 80 d4 13 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 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 02 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -5231,7 +4979,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==0) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 0, CS=MCS-9 @@ -5247,7 +4994,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-6): 07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca ca 0a -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=4 block=1 data=07 00 00 00 45 5f 40 40 40 40 40 40 40 40 40 c0 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 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) appending 512 bytes Received RTS for PDCH: TRX=0 TS=4 FN=8 block_nr=2 scheduling free USF for polling at FN=13 of TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 @@ -5264,7 +5010,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 0, MCS-9): 07 00 00 02 20 50 f4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=8 block=2 data=07 00 00 02 20 50 f4 05 04 04 04 04 04 04 04 04 04 0c 01 07 ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac ac 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==2) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 2, CS=MCS-9 @@ -5278,7 +5023,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 2, MCS-9): 07 80 00 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=13 block=3 data=07 80 00 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==4) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 4, CS=MCS-9 @@ -5292,7 +5036,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 4, MCS-9): 07 00 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=17 block=4 data=07 00 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 14 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 00 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==6) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 6, CS=MCS-9 @@ -5308,7 +5051,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 6, MCS-9): 07 80 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 90 18 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 04 1c b0 b2 02 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=21 block=5 data=07 80 01 02 00 05 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 04 90 18 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 10 30 04 1c b0 b2 02 Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=3 TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink (V(A)==0 .. V(S)==8) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Sending new block at BSN 8, CS=MCS-9 @@ -5323,7 +5065,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) 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) Polling is already scheduled TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) msg block (BSN 8, MCS-6): 07 00 02 80 c0 e3 ca 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 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 -Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=26 block=6 data=07 00 02 80 c0 e3 ca 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 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 acknowledge TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Final ACK received. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to WAIT RELEASE @@ -6040,13 +5781,11 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** DL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -6086,7 +5825,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -6203,13 +5941,11 @@ Detaching TBF from MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0x00000000 ********** DL-TBF ends here ********** -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -6249,7 +5985,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -6372,7 +6107,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6397,7 +6131,6 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6422,7 +6155,6 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6447,7 +6179,6 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6472,7 +6203,6 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6497,7 +6227,6 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6522,7 +6251,6 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7f Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -6538,20 +6266,16 @@ - Skipping TS 7, because no USF available - Failed to allocate a TS, no USF available No PDCH resource sending Immediate Assignment Uplink (AGCH) reject -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b Destroying MS object, TLLI = 0x00000000 MS requests UL TBF on RACH, so we provide one: ra=0x70 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation No PDCH available. No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b Searching for first unallocated TFI: TRX=0 Found TFI=0. +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ @@ -6591,7 +6315,6 @@ ------------------------- TX : Packet Uplink Assignment ------------------------- 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 +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) RX: [PCU <- BTS] Packet Control Ack @@ -7178,7 +6901,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Got MCS-4 RLC data block: CV=0, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) BSN 64 already received Received RTS for PDCH: TRX=0 TS=7 FN=2654275 block_nr=9 scheduling USF=0 for required uplink resource of UL TFI=0 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=40 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** @@ -7366,7 +7088,6 @@ ------------------------- TX : Packet Downlink Assignment ------------------------- 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 Got MS: TLLI = 0xf1223344, TA = 7 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -7947,7 +7668,6 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) BSN 64 storing in window (0..191) TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) data_length=44, data=80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 Received RTS for PDCH: TRX=0 TS=7 FN=2654283 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=40 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes @@ -8000,7 +7720,6 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x79 Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8025,7 +7744,6 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7a Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8050,7 +7768,6 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7b Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8075,7 +7792,6 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7c Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8100,7 +7816,6 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7d Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8125,7 +7840,6 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 60 1f 2b 2b 2b 2b 2b 2b 2b MS requests UL TBF on RACH, so we provide one: ra=0x7e Fn=2654167 qta=31 is_11bit=0: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 @@ -8150,7 +7864,6 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 -Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 60 1f 2b 2b 2b 2b 2b 2b 2b +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- MS requests UL TBF in packet resource request of single block, so we provide one: @@ -8180,7 +7893,6 @@ Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec. Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Destroying MS object, TLLI = 0x00000000 Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed @@ -8189,7 +7901,6 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) changes UL ASS state from GPRS_RLCMAC_UL_ASS_NONE to GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer T0 [reject (PACCH)] with 0 sec. 2000 microsec. Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) -Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) timer 0 expired. TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) releasing due to PACCH assignment timeout. TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) free -- To view, visit https://gerrit.osmocom.org/6076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I451f2472070dea2387bfaea45ca5bdd9e3b2276d 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 Fri Jan 26 09:43:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:04 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn: Move random number helpers to Osmocom_Types.ttcn Message-ID: Review at https://gerrit.osmocom.org/6078 ggsn: Move random number helpers to Osmocom_Types.ttcn Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af --- M ggsn_tests/GGSN_Tests.ttcn M library/Osmocom_Types.ttcn 2 files changed, 33 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/78/6078/1 diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 22cdc21..23e7054 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -615,11 +615,6 @@ const octetstring c_ApnInet6 := '05696E657436'O; const octetstring c_ApnInet46 := '06696E65743436'O; - /* return random integer between 0 and max */ - function f_rnd_int(integer max) return integer { - return float2int(rnd()*int2float(max)); - } - /* return random NSAPI */ function f_rnd_nsapi() return BIT4 { return int2bit(f_rnd_int(16), 4); @@ -629,35 +624,6 @@ function f_rnd_tei() return OCT4 { return int2oct(f_rnd_int(4294967296), 4); } - - /* return hexstring composed of random digits */ - function f_rnd_hexstring(in integer len, in integer max := 15) return hexstring { - var integer i; - var hexstring ret := ''H; - for (i := 0; i < len; i := i + 1) { - ret := ret & int2hex(f_rnd_int(max), 1); - } - return ret; - } - - /* return octetstring composed of random bytes */ - function f_rnd_octstring(in integer len) return octetstring { - var integer i; - var octetstring ret := ''O; - for (i := 0; i < len; i := i + 1) { - ret := ret & int2oct(f_rnd_int(255), 1); - } - return ret; - } - - function f_rnd_imsi(in hexstring prefix) return hexstring { - return prefix & f_rnd_hexstring(15 - lengthof(prefix), 9); - } - - function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring { - return prefix & f_rnd_octstring(len - lengthof(prefix)); - } - /* define an (internal) representation of a PDP context */ template PdpContext t_DefinePDP(hexstring imsi, octetstring msisdn, octetstring apn, diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 484f6d1..495b684 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -27,4 +27,37 @@ uint15_t arfcn } with { variant "" }; + /* return random integer between 0 and max */ + function f_rnd_int(integer max) return integer { + return float2int(rnd()*int2float(max)); + } + + /* return hexstring composed of random digits */ + function f_rnd_hexstring(in integer len, in integer max := 15) return hexstring { + var integer i; + var hexstring ret := ''H; + for (i := 0; i < len; i := i + 1) { + ret := ret & int2hex(f_rnd_int(max), 1); + } + return ret; + } + + /* return octetstring composed of random bytes */ + function f_rnd_octstring(in integer len) return octetstring { + var integer i; + var octetstring ret := ''O; + for (i := 0; i < len; i := i + 1) { + ret := ret & int2oct(f_rnd_int(255), 1); + } + return ret; + } + + function f_rnd_imsi(in hexstring prefix) return hexstring { + return prefix & f_rnd_hexstring(15 - lengthof(prefix), 9); + } + + function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring { + return prefix & f_rnd_octstring(len - lengthof(prefix)); + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/6078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:06 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: move default (auth=off, tmsi=on, encry=off) vty command... Message-ID: Review at https://gerrit.osmocom.org/6079 msc: move default (auth=off, tmsi=on, encry=off) vty commands to f_init() Change-Id: I38644ca3c4f629edb762cd24959033d426438e02 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/79/6079/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 74d1b93..426f479 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -126,6 +126,11 @@ map(self:MSCVTY, system:MSCVTY); f_vty_set_prompts(MSCVTY); f_vty_transceive(MSCVTY, "enable"); + + /* set some defaults */ + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + f_vty_config(MSCVTY, "network", "encryption a5 0"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -374,8 +379,6 @@ testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); vc_conn.done; @@ -388,7 +391,6 @@ testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); f_vty_config(MSCVTY, "msc", "no assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); @@ -419,7 +421,6 @@ testcase TC_lu_imsi_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); vc_conn.done; @@ -450,7 +451,6 @@ testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); vc_conn.done; @@ -506,7 +506,6 @@ testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 6); vc_conn.done; } @@ -557,7 +556,6 @@ testcase TC_lu_and_mo_call() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 7); vc_conn.done; @@ -722,7 +720,6 @@ testcase TC_lu_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 12); vc_conn.done; @@ -770,7 +767,6 @@ testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 13); vc_conn.done; @@ -933,8 +929,6 @@ testcase TC_emerg_call_imsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 18); vc_conn.done; @@ -959,8 +953,6 @@ testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 19); vc_conn.done; @@ -985,8 +977,6 @@ testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 20); vc_conn.done; @@ -1011,8 +1001,6 @@ testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 21); vc_conn.done; @@ -1037,8 +1025,6 @@ testcase TC_cm_reest_req_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_reest_req_reject), testcasename(), 22); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/6079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I38644ca3c4f629edb762cd24959033d426438e02 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:06 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: New TC_cl3_rnd_payload / TC_cl3_no_payload for COMPLETE L3 Message-ID: Review at https://gerrit.osmocom.org/6080 msc: New TC_cl3_rnd_payload / TC_cl3_no_payload for COMPLETE L3 Test BSSMAP COMPLETE L3 INFO either with no payload whatsoever or with random payload. Change-Id: I37ca3e5048cc1c2678d763a44b7e228da29851cc --- M msc_tests/MSC_Tests.ttcn 1 file changed, 61 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/80/6080/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 426f479..5f49d3a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1089,6 +1089,63 @@ vc_conn.done; } +/* Test Complete L3 without payload */ +private function f_tc_cl3_no_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* Send Complete L3 Info with empty L3 frame */ + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, ''O)))); + + alt { + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + /* Expect LU REJECT with Cause == Illegal MS */ + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + } + setverdict(pass); +} +testcase TC_cl3_no_payload() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cl3_no_payload), testcasename(), 24); + vc_conn.done; +} + +/* Test Complete L3 with random payload */ +private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var integer len := float2int(rnd() * 256.0); + var octetstring payl := f_rnd_octstring(len); + + /* Send Complete L3 Info with empty L3 frame */ + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, payl)))); + + alt { + /* Immediate disconnect */ + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + /* Expect LU REJECT with Cause == Illegal MS */ + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } + } + setverdict(pass); +} +testcase TC_cl3_rnd_payload() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cl3_rnd_payload), testcasename(), 24); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? @@ -1096,8 +1153,6 @@ * MT call while LU or is ongoing: Do we use existing lchan or page while lchan active? * 3G/2G auth permutations * encryption algorithms vs. classmark vs. vty config - * emergency call - * IMSI DETACH * send new transaction after/during clear (like SMS, ...) * too long L3 INFO in DTAP * too long / padded BSSAP @@ -1127,6 +1182,10 @@ execute( TC_cm_serv_req_vbs_reject() ); execute( TC_cm_serv_req_lcs_reject() ); execute( TC_cm_reest_req_reject() ); + execute( TC_lu_auth_2G_fail() ); + execute( TC_lu_imsi_auth_tmsi_encr_13_13() ); + execute( TC_cl3_no_payload() ); + execute( TC_cl3_rnd_payload() ); } -- To view, visit https://gerrit.osmocom.org/6080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I37ca3e5048cc1c2678d763a44b7e228da29851cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:06 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: Add MGCP_Emulation Message-ID: Review at https://gerrit.osmocom.org/6081 Add MGCP_Emulation Change-Id: I5245be2b44e98e1c74b9519c610564667b980a67 --- A library/MGCP_Emulation.ttcn 1 file changed, 149 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/6081/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn new file mode 100644 index 0000000..2ab5669 --- /dev/null +++ b/library/MGCP_Emulation.ttcn @@ -0,0 +1,149 @@ +module MGCP_Emulation { + +import from MGCP_CodecPort all; +import from MGCP_CodecPort_CtrlFunct all; +import from MGCP_Types all; +import from MGCP_Templates all; +import from Osmocom_Types all; +import from IPL4asp_Types all; + +type component MGCP_ConnHdlr { + port MGCP_Conn_PT MGCP; +} + +/* port between individual per-connection components and this dispatcher */ +type port MGCP_Conn_PT message { + inout MgcpCommand, MgcpResponse; +} with { extension "internal" }; + + +type component MGCP_Emulation_CT { + /* Port facing to the UDP SUT */ + port MGCP_CODEC_PT MGCP; + /* All MGCP_ConnHdlr MGCP ports connect here + * MGCP_Emulation_CT.main needs to figure out what messages + * to send where with CLIENT.send() to vc_conn */ + port MGCP_Conn_PT CLIENT; + /* currently tracked connections */ +// var ConnectionData ConnectionTable[16]; + /* pending expected CRCX */ + var ExpectData ExpectTable[8]; + /* procedure based port to register for incoming connections */ + port MGCPEM_PROC_PT PROC; + + var charstring g_mgcp_id; +} + +type function MGCPCreateCallback(MgcpCommand cmd, charstring id) +runs on MGCP_Emulation_CT return MGCP_ConnHdlr; + +type record MGCPOps { + MGCPCreateCallback create_cb +} + +type record MGCP_conn_parameters { + charstring callagent_ip, + uint16_t callagent_udp_port, + charstring mgw_ip, + uint16_t mgw_udp_port +} + +function main(MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { + var Result res; + g_mgcp_id := id; + //f_conn_table_init(); + + map(self:MGCP, system:MGCP_CODEC_PT); + res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.mgw_ip, +p.mgw_udp_port, + p.callagent_ip, p.callagent_udp_port, 0, { udp:={} }); + + + while (true) { + alt { + [] CLIENT.receive(MgcpCommand:?) { + } + [] MGCP.receive(MGCP_RecvFrom:?) { + } + } + } +} + +/* "Expect" Handling */ + +/* */ +type union ExpectCriteria { + MgcpConnectionId connid, + MgcpEndpoint endpoint, + MgcpTransId transid +} + +type record ExpectData { + ExpectCriteria crit optional, + MGCP_ConnHdlr vc_conn optional +} + +signature MGCPEM_register(in MgcpCommand cmd, in MGCP_ConnHdlr hdlr); + +type port MGCPEM_PROC_PT procedure { + inout MGCPEM_register; +} with { extension "internal" }; + +function f_get_mgcp_by_crit(ExpectCriteria crit) +return template MgcpCommand { + template MgcpCommand ret := { + }; + + return ret; +} + +/* Function that can be used as create_cb and will usse the expect table */ +function ExpectedCreateCallback(MgcpCommand cmd, charstring id) +runs on MGCP_Emulation_CT return MGCP_ConnHdlr { + var MGCP_ConnHdlr ret := null; + var template MgcpCommand mgcpcmd; + var integer i; + + /* Ensure cmd is a CRCX? */ + + for (i := 0; i < sizeof(ExpectTable); i := i+1) { + if (not ispresent(ExpectTable[i].vc_conn)) { + continue; + } + mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); + if (match(cmd, mgcpcmd)) { + ret := ExpectTable[i].vc_conn; + /* Release this entry */ + ExpectTable[i].crit := omit; + ExpectTable[i].vc_conn := null; + log("Found Expect[", i, "] for ", cmd, " handled at ", ret); + return ret; + } + } + setverdict(fail, "Couldn't find Expect for CRCX", cmd); + return ret; +} + +private function f_create_expect(ExpectCriteria crit, MGCP_ConnHdlr hdlr) +runs on MGCP_Emulation_CT { + var integer i; + + /* Check an entry like this is not already presnt */ + for (i := 0; i < sizeof(ExpectTable); i := i+1) { + if (crit == ExpectTable[i].crit) { + setverdict(fail, "Crit already present", crit); + self.stop; + } + } + for (i := 0; i < sizeof(ExpectTable); i := i+1) { + if (not ispresent(ExpectTable[i].crit)) { + ExpectTable[i].crit := crit; + ExpectTable[i].vc_conn := hdlr; + log("Created Expect[", i, "] for ", crit, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in ExpectTable") +} + +} -- To view, visit https://gerrit.osmocom.org/6081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5245be2b44e98e1c74b9519c610564667b980a67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:06 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_CodecPort: Receive MGCP command or response Message-ID: Review at https://gerrit.osmocom.org/6082 MGCP_CodecPort: Receive MGCP command or response If we act as MGW we need to accept MGCP commands sent to us as well Change-Id: I895cfb688a2923b278828f5ae918c73fda18636d --- M library/MGCP_CodecPort.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/6082/1 diff --git a/library/MGCP_CodecPort.ttcn b/library/MGCP_CodecPort.ttcn index 416ac36..c206986 100644 --- a/library/MGCP_CodecPort.ttcn +++ b/library/MGCP_CodecPort.ttcn @@ -53,7 +53,7 @@ pout.msg := dec_MgcpMessage(oct2char(pin.msg)); - see https://www.eclipse.org/forums/index.php/t/1088893/ */ - pout.msg := { response := dec_MgcpResponse(oct2char(pin.msg)) }; + pout.msg := dec_MgcpMessage(oct2char(pin.msg)); } with { extension "prototype(fast)" }; private function MGCP_to_IPL4_Send(in MGCP_Send pin, out ASP_Send pout) { -- To view, visit https://gerrit.osmocom.org/6082 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I895cfb688a2923b278828f5ae918c73fda18636d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:07 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_Emulation part of "bsc: Register expect criteria for MG... Message-ID: Review at https://gerrit.osmocom.org/6083 MGCP_Emulation part of "bsc: Register expect criteria for MGCP CRCX" Change-Id: I466df816eef9863bf1664e785b996c0697dc04e3 --- M library/MGCP_Emulation.ttcn 1 file changed, 25 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/6083/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 2ab5669..b164748 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -48,10 +48,11 @@ uint16_t mgw_udp_port } -function main(MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { +function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; //f_conn_table_init(); + f_expect_table_init(); map(self:MGCP, system:MGCP_CODEC_PT); res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.mgw_ip, @@ -65,6 +66,10 @@ } [] MGCP.receive(MGCP_RecvFrom:?) { } + [] PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { + f_create_expect(crit, vc_conn); + PROC.reply(MGCPEM_register:{crit, vc_conn}); + } } } } @@ -72,18 +77,18 @@ /* "Expect" Handling */ /* */ -type union ExpectCriteria { - MgcpConnectionId connid, - MgcpEndpoint endpoint, - MgcpTransId transid +type record ExpectCriteria { + MgcpConnectionId connid optional, + MgcpEndpoint endpoint optional, + MgcpTransId transid optional } type record ExpectData { ExpectCriteria crit optional, - MGCP_ConnHdlr vc_conn optional + MGCP_ConnHdlr vc_conn } -signature MGCPEM_register(in MgcpCommand cmd, in MGCP_ConnHdlr hdlr); +signature MGCPEM_register(in ExpectCriteria cmd, in MGCP_ConnHdlr hdlr); type port MGCPEM_PROC_PT procedure { inout MGCPEM_register; @@ -107,18 +112,19 @@ /* Ensure cmd is a CRCX? */ for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].vc_conn)) { + if (not ispresent(ExpectTable[i].crit)) { continue; } - mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); - if (match(cmd, mgcpcmd)) { + /* FIXME: Ignore criteria for now */ +// mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); +// if (match(cmd, mgcpcmd)) { ret := ExpectTable[i].vc_conn; /* Release this entry */ ExpectTable[i].crit := omit; ExpectTable[i].vc_conn := null; log("Found Expect[", i, "] for ", cmd, " handled at ", ret); return ret; - } +// } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); return ret; @@ -146,4 +152,12 @@ setverdict(fail, "No space left in ExpectTable") } +private function f_expect_table_init() +runs on MGCP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(ExpectTable); i := i + 1) { + ExpectTable[i].crit := omit; + } +} + } -- To view, visit https://gerrit.osmocom.org/6083 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I466df816eef9863bf1664e785b996c0697dc04e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:07 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP library part of "bsc: Reply to CRCX with ACK" Message-ID: Review at https://gerrit.osmocom.org/6084 MGCP library part of "bsc: Reply to CRCX with ACK" Change-Id: I68b66d26dfbbba11e1b3a8c04435f08d095f68ed --- M library/MGCP_Emulation.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/6084/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index b164748..f8d5a1e 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -9,6 +9,7 @@ type component MGCP_ConnHdlr { port MGCP_Conn_PT MGCP; + var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/6084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I68b66d26dfbbba11e1b3a8c04435f08d095f68ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: CRCX is answered with (malformed) ACK Message-ID: Review at https://gerrit.osmocom.org/6085 bsc: CRCX is answered with (malformed) ACK Change-Id: I09c1ed467e95be236e0758d6a9c8bbef405c02eb --- M library/MGCP_Emulation.ttcn 1 file changed, 41 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/6085/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index f8d5a1e..1209ff6 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -33,6 +33,7 @@ port MGCPEM_PROC_PT PROC; var charstring g_mgcp_id; + var integer g_mgcp_conn_id := -1; } type function MGCPCreateCallback(MgcpCommand cmd, charstring id) @@ -49,6 +50,19 @@ uint16_t mgw_udp_port } +function tr_MGCP_RecvFrom_R(template MgcpMessage msg) +runs on MGCP_Emulation_CT return template MGCP_RecvFrom { + var template MGCP_RecvFrom mrf := { + connId := g_mgcp_conn_id, + remName := ?, + remPort := ?, + locName := ?, + locPort := ?, + msg := msg + } + return mrf; +} + function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; @@ -60,12 +74,32 @@ p.mgw_udp_port, p.callagent_ip, p.callagent_udp_port, 0, { udp:={} }); + g_mgcp_conn_id := res.connId; while (true) { + var MGCP_ConnHdlr vc_conn; + var ExpectCriteria crit; + var MGCP_RecvFrom mrf; + var MgcpMessage msg; + var MgcpCommand cmd; + var MgcpResponse resp; + alt { - [] CLIENT.receive(MgcpCommand:?) { + /* MGCP from client */ + [] CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { + /* Pass message through */ + msg.response := resp; + MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg)); } - [] MGCP.receive(MGCP_RecvFrom:?) { + [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) -> value mrf { + if (ischosen(mrf.msg.command)) { + cmd := mrf.msg.command; + vc_conn := ops.create_cb.apply(cmd, id); + f_handle_userData(vc_conn, cmd); + } else { + setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); + self.stop; + } } [] PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { f_create_expect(crit, vc_conn); @@ -75,6 +109,11 @@ } } +private function f_handle_userData(MGCP_ConnHdlr conn, MgcpCommand cmd) +runs on MGCP_Emulation_CT { + CLIENT.send(cmd) to conn; +} + /* "Expect" Handling */ /* */ -- To view, visit https://gerrit.osmocom.org/6085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I09c1ed467e95be236e0758d6a9c8bbef405c02eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: L3_Templates: ts_Bcap_voice(): Include speech version octets Message-ID: Review at https://gerrit.osmocom.org/6086 L3_Templates: ts_Bcap_voice(): Include speech version octets Change-Id: Iff48bff6df6fa7dae3bc8467be4d75b0305f68ad --- M library/L3_Templates.ttcn 1 file changed, 20 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/6086/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 7836555..5816ab9 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -435,6 +435,19 @@ digits := digits } +type integer SpeechVer; + +template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { + speechVersionIndication := int2bit(ver-1,3) & suffix, + spare1_1 := '0'B, + cTM_or_Spare := '0'B, + coding := '0'B, + extension_octet_3a_3b := '0'B +} + +template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B); +template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B); + template (value) BearerCapability_TLV ts_Bcap_voice := { elementIdentifier := '04'O, lengthIndicator := 0, /* overwritten */ @@ -444,7 +457,13 @@ codingStandard := '0'B, radioChannelRequirement := '11'B, /* FR preferred */ extension_octet_3 := '0'B, /* overwritten */ - speech_aux_3a_3b := omit + speech_aux_3a_3b := { + valueof(ts_SpeechAuxHR(3)), + valueof(ts_SpeechAuxFR(3)), + valueof(ts_SpeechAuxFR(2)), + valueof(ts_SpeechAuxFR(1)), + valueof(ts_SpeechAuxHR(1)) + } }, octet4 := omit, octet5 := omit, -- To view, visit https://gerrit.osmocom.org/6086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff48bff6df6fa7dae3bc8467be4d75b0305f68ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC Message-ID: Review at https://gerrit.osmocom.org/6087 BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC Change-Id: Id0379fcb676698d92effce755dbc07c26a6a1101 --- M library/BSSMAP_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/6087/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 33c370e..bc55f58 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -478,7 +478,7 @@ channelType := ?, layer3HeaderInfo := *, priority := *, - circuitIdentityCode := ?, + circuitIdentityCode := *, downLinkDTX_Flag := *, interferenceBandToBeUsed := *, classmarkInformationType2 := *, -- To view, visit https://gerrit.osmocom.org/6087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0379fcb676698d92effce755dbc07c26a6a1101 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_Emulation: Add comment + license disclaimer Message-ID: Review at https://gerrit.osmocom.org/6088 MGCP_Emulation: Add comment + license disclaimer Change-Id: Ibf1a1ed80a99c8d8754cce3b47b11b5186b9c52d --- M library/MGCP_Emulation.ttcn 1 file changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/88/6088/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 1209ff6..beef9e8 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -1,5 +1,32 @@ module MGCP_Emulation { +/* MGCP Emulation, runs on top of MGCP_CodecPort. It multiplexes/demultiplexes + * the individual connections, so there can be separate TTCN-3 components handling + * each of the connections. + * + * The MGCP_Emulation.main() function processes MGCP primitives from the MGCP + * socket via the MGCP_CodecPort, and dispatches them to the per-connection components. + * + * For each new inbound connection, the MgcpOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + MGCP, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the MGCP emulation. + * + * Inbound Unit Data messages (such as are dispatched to the MgcpOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2017-2018 by Harald Welte + * (C) 2018 by sysmocom - s.f.m.c. GmbH, Author: Daniel Willmann + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from MGCP_CodecPort all; import from MGCP_CodecPort_CtrlFunct all; import from MGCP_Types all; -- To view, visit https://gerrit.osmocom.org/6088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf1a1ed80a99c8d8754cce3b47b11b5186b9c52d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:09 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_Emulation: More complete implementation Message-ID: Review at https://gerrit.osmocom.org/6089 MGCP_Emulation: More complete implementation * re-introduce connection table * introduce unitdata_cb for connectionless MGCP messages (like AUEP) * rename MGCP_Emulation_CT members to avoid clashes with other similar component names when using "multiple inheritance" * Use HostName/PortNumber types on MGCP_conn_parameters * allow "bind to local UDP port only, permit any UDP source port" behavior * implement expect matching criteria + expect matching only on CRCX * add helper function f_create_mgcp_expect() like in other Emulations Change-Id: I953a91e663648715fa4fe98acacca393c8747001 --- M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn 2 files changed, 191 insertions(+), 44 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/89/6089/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index beef9e8..5bd4e50 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -36,6 +36,8 @@ type component MGCP_ConnHdlr { port MGCP_Conn_PT MGCP; + /* procedure based port to register for incoming connections */ + port MGCPEM_PROC_PT MGCP_PROC; var MgcpConnectionId mgcp_conn_id; } @@ -44,6 +46,11 @@ inout MgcpCommand, MgcpResponse; } with { extension "internal" }; +/* represents a single MGCP Connection */ +type record ConnectionData { + MGCP_ConnHdlr comp_ref, + MgcpConnectionId conn_id optional +}; type component MGCP_Emulation_CT { /* Port facing to the UDP SUT */ @@ -51,13 +58,13 @@ /* All MGCP_ConnHdlr MGCP ports connect here * MGCP_Emulation_CT.main needs to figure out what messages * to send where with CLIENT.send() to vc_conn */ - port MGCP_Conn_PT CLIENT; + port MGCP_Conn_PT MGCP_CLIENT; /* currently tracked connections */ -// var ConnectionData ConnectionTable[16]; + var ConnectionData MgcpConnectionTable[16]; /* pending expected CRCX */ - var ExpectData ExpectTable[8]; + var ExpectData MgcpExpectTable[8]; /* procedure based port to register for incoming connections */ - port MGCPEM_PROC_PT PROC; + port MGCPEM_PROC_PT MGCP_PROC; var charstring g_mgcp_id; var integer g_mgcp_conn_id := -1; @@ -66,15 +73,19 @@ type function MGCPCreateCallback(MgcpCommand cmd, charstring id) runs on MGCP_Emulation_CT return MGCP_ConnHdlr; +type function MGCPUnitdataCallback(MgcpMessage msg) +runs on MGCP_Emulation_CT return template MgcpMessage; + type record MGCPOps { - MGCPCreateCallback create_cb + MGCPCreateCallback create_cb, + MGCPUnitdataCallback unitdata_cb } type record MGCP_conn_parameters { - charstring callagent_ip, - uint16_t callagent_udp_port, - charstring mgw_ip, - uint16_t mgw_udp_port + HostName callagent_ip, + PortNumber callagent_udp_port, + HostName mgw_ip, + PortNumber mgw_udp_port } function tr_MGCP_RecvFrom_R(template MgcpMessage msg) @@ -90,19 +101,94 @@ return mrf; } +private function f_conn_id_known(MgcpConnectionId conn_id) +runs on MGCP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].conn_id == conn_id) { + return true; + } + } + return false; +} + +private function f_comp_known(MGCP_ConnHdlr client) +runs on MGCP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +private function f_comp_by_conn_id(MgcpConnectionId conn_id) +runs on MGCP_Emulation_CT return MGCP_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].conn_id == conn_id) { + return MgcpConnectionTable[i].comp_ref; + } + } + log("MGCP Connection Table not found by Connection Id", conn_id); + setverdict(fail); + self.stop; +} + +private function f_conn_id_by_comp(MGCP_ConnHdlr client) +runs on MGCP_Emulation_CT return MgcpConnectionId { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].comp_ref == client) { + return MgcpConnectionTable[i].conn_id; + } + } + log("MGCP Connection Table not found by component ", client); + setverdict(fail); + self.stop; +} + +/* TODO: move this to MGCP_Types? */ +function f_mgcp_conn_id(MgcpMessage msg) return hexstring { + var MgcpParameterList params; + var integer i; + if (ischosen(msg.command)) { + params := msg.command.params; + } else { + params := msg.response.params; + } + for (i := 0; i < lengthof(params); i := i+1) { + if (params[i].code == "I") { + return str2hex(params[i].val); + } + } + return ''H; +} + +private function f_conn_table_init() +runs on MGCP_Emulation_CT { + for (var integer i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + MgcpConnectionTable[i].comp_ref := null; + MgcpConnectionTable[i].conn_id := omit; + } +} + function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; - //f_conn_table_init(); + f_conn_table_init(); f_expect_table_init(); map(self:MGCP, system:MGCP_CODEC_PT); - res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.mgw_ip, -p.mgw_udp_port, - p.callagent_ip, p.callagent_udp_port, 0, { udp:={} }); - + if (p.callagent_udp_port == -1) { + res := MGCP_CodecPort_CtrlFunct.f_IPL4_listen(MGCP, p.mgw_ip, p.mgw_udp_port, { udp:={} }); + } else { + res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, -1, { udp:={} }); + } + g_mgcp_conn_id := res.connId; - + while (true) { var MGCP_ConnHdlr vc_conn; var ExpectCriteria crit; @@ -113,32 +199,48 @@ alt { /* MGCP from client */ - [] CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { + [] MGCP_CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { /* Pass message through */ msg.response := resp; + /* TODO: check which ConnectionID client has allocated + store in table? */ MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg)); } [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) -> value mrf { + if (p.callagent_udp_port == -1) { + /* we aren't yet connected to the remote side port, let's fix this */ + p.callagent_udp_port := mrf.remPort; + MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} }); + } if (ischosen(mrf.msg.command)) { cmd := mrf.msg.command; - vc_conn := ops.create_cb.apply(cmd, id); - f_handle_userData(vc_conn, cmd); + if (match(cmd, tr_MgcpCommand_CO)) { + /* connection-oriented MGCP */ + if (cmd.line.verb == "CRCX") { + /* TODO: allocate ConnectionID here + store in Table? */ + vc_conn := ops.create_cb.apply(cmd, id); + } else { + var MgcpConnectionId conn_id := f_mgcp_conn_id(mrf.msg); + vc_conn := f_comp_by_conn_id(conn_id); + } + MGCP_CLIENT.send(cmd) to vc_conn; + } else { + /* connectionless MGCP, i.e. messages without ConnectionId */ + var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg); + if (isvalue(r)) { + MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r)); + } + } } else { setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); self.stop; } } - [] PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { + [] MGCP_PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { f_create_expect(crit, vc_conn); - PROC.reply(MGCPEM_register:{crit, vc_conn}); + MGCP_PROC.reply(MGCPEM_register:{crit, vc_conn}); } } } -} - -private function f_handle_userData(MGCP_ConnHdlr conn, MgcpCommand cmd) -runs on MGCP_Emulation_CT { - CLIENT.send(cmd) to conn; } /* "Expect" Handling */ @@ -163,8 +265,25 @@ function f_get_mgcp_by_crit(ExpectCriteria crit) return template MgcpCommand { - template MgcpCommand ret := { - }; + var template MgcpCommand ret := { + line := { + verb := ?, + trans_id := ?, + ep := ?, + ver := ? + }, + params := *, + sdp := * + } + if (ispresent(crit.connid)) { + ret.params := { *, ts_MgcpParConnectionId(crit.connid), * }; + } + if (ispresent(crit.endpoint)) { + ret.line.ep := crit.endpoint; + } + if (ispresent(crit.transid)) { + ret.line.trans_id := crit.transid; + } return ret; } @@ -178,20 +297,20 @@ /* Ensure cmd is a CRCX? */ - for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].crit)) { + for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { + if (not ispresent(MgcpExpectTable[i].crit)) { continue; } /* FIXME: Ignore criteria for now */ -// mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); -// if (match(cmd, mgcpcmd)) { - ret := ExpectTable[i].vc_conn; + mgcpcmd := f_get_mgcp_by_crit(MgcpExpectTable[i].crit); + if (match(cmd, mgcpcmd)) { + ret := MgcpExpectTable[i].vc_conn; /* Release this entry */ - ExpectTable[i].crit := omit; - ExpectTable[i].vc_conn := null; + MgcpExpectTable[i].crit := omit; + MgcpExpectTable[i].vc_conn := null; log("Found Expect[", i, "] for ", cmd, " handled at ", ret); return ret; -// } + } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); return ret; @@ -202,29 +321,43 @@ var integer i; /* Check an entry like this is not already presnt */ - for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (crit == ExpectTable[i].crit) { + for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { + if (crit == MgcpExpectTable[i].crit) { setverdict(fail, "Crit already present", crit); self.stop; } } - for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].crit)) { - ExpectTable[i].crit := crit; - ExpectTable[i].vc_conn := hdlr; + for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { + if (not ispresent(MgcpExpectTable[i].crit)) { + MgcpExpectTable[i].crit := crit; + MgcpExpectTable[i].vc_conn := hdlr; log("Created Expect[", i, "] for ", crit, " to be handled at ", hdlr); return; } } - setverdict(fail, "No space left in ExpectTable") + setverdict(fail, "No space left in MgcpExpectTable") +} + +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mgcp_expect(ExpectCriteria dest_number) runs on MGCP_ConnHdlr { + MGCP_PROC.call(MGCPEM_register:{dest_number, self}) { + [] MGCP_PROC.getreply(MGCPEM_register:{?,?}) {}; + } } private function f_expect_table_init() runs on MGCP_Emulation_CT { var integer i; - for (i := 0; i < sizeof(ExpectTable); i := i + 1) { - ExpectTable[i].crit := omit; + for (i := 0; i < sizeof(MgcpExpectTable); i := i + 1) { + MgcpExpectTable[i].crit := omit; } } +function DummyUnitdataCallback(MgcpMessage msg) +runs on MGCP_Emulation_CT return template MgcpMessage { + log("Ignoring MGCP ", msg); + return omit; +} + + } diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index f4c6e0f..c0c827f 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -268,4 +268,18 @@ return int2hex(float2int(rnd()*2147483647.0), 8); } + /* those verbs that related to a connection (and hence have ConnectionId) */ + template MgcpVerb tr_MgcpVerb_ConnectionOriented := ("CRCX", "MDCX", "DLCX", "AUCX"); + /* entire command template matching only connection oriented verbs */ + template MgcpCommand tr_MgcpCommand_CO := { + line := { + verb := tr_MgcpVerb_ConnectionOriented, + trans_id := ?, + ep := ?, + ver := ? + }, + params := *, + sdp := * + } + } -- To view, visit https://gerrit.osmocom.org/6089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I953a91e663648715fa4fe98acacca393c8747001 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:09 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Start to integrate MGCP_Emulation component Message-ID: Review at https://gerrit.osmocom.org/6090 msc: Start to integrate MGCP_Emulation component Change-Id: I5330a06b7868b3f3a362cb5b640cd0cb985f2143 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh 3 files changed, 33 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/90/6090/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 656fb4e..58b64d3 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -14,13 +14,16 @@ import from MNCC_Types all; import from MNCC_Emulation all; +import from MGCP_Types all; +import from MGCP_Emulation all; + import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; import from MobileL3_MM_Types all; import from L3_Templates all; /* this component represents a single subscriber connection */ -type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { +type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr { var BSC_ConnHdlrPars g_pars; } diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5f49d3a..87e3e78 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -26,6 +26,11 @@ import from MNCC_Emulation all; import from MNCC_Types all; +import from MGCP_Emulation all; +import from MGCP_Types all; +import from MGCP_Templates all; +import from SDP_Types all; + import from GSUP_Emulation all; import from GSUP_Types all; import from IPA_Emulation all; @@ -47,6 +52,7 @@ /* no 'adapter_CT' for MNCC or GSUP */ var MNCC_Emulation_CT vc_MNCC; + var MGCP_Emulation_CT vc_MGCP; var GSUP_Emulation_CT vc_GSUP; var IPA_Emulation_CT vc_GSUP_IPA; @@ -80,6 +86,24 @@ vc_MNCC := MNCC_Emulation_CT.create(id); map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); +} + +function f_init_mgcp(charstring id) runs on MTC_CT { + id := id & "-MGCP"; + var MGCPOps ops := { + create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) + } + var MGCP_conn_parameters pars := { + callagent_ip := "127.0.0.1", + callagent_udp_port := -1, + mgw_ip := "127.0.0.1", + mgw_udp_port := 2427 + } + + vc_MGCP := MGCP_Emulation_CT.create(id); + map(vc_MGCP:MGCP, system:MGCP_CODEC_PT); + vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); } function f_init_gsup(charstring id) runs on MTC_CT { @@ -121,6 +145,7 @@ f_bssap_init("MSC_Test", BSC_BssmapOps); f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); + f_init_mgcp("MSC_Test"); f_init_gsup("MSC_Test"); map(self:MSCVTY, system:MSCVTY); @@ -347,6 +372,9 @@ /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); + /* MGCP part */ + connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); + connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); /* GSUP part */ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 30ebed1..b501c55 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -78,7 +78,7 @@ FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn " FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " -FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn IPA_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES -- To view, visit https://gerrit.osmocom.org/6090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5330a06b7868b3f3a362cb5b640cd0cb985f2143 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:09 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Make use of MGCP_Emulation in f_tc_lu_and_mo_call Message-ID: Review at https://gerrit.osmocom.org/6091 msc: Make use of MGCP_Emulation in f_tc_lu_and_mo_call Change-Id: Id33f17007b99776129e99625f8f6258a1653d863 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 20 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/91/6091/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 87e3e78..aee0165 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -547,20 +547,34 @@ var hexstring called := '12345'H; var integer tid := 0; var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; f_create_mncc_expect(hex2str(called)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(tid, called))); - MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc; - /* FIXME: extract call_id */ - - /* Call Proceeding */ - MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + interleave { + [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc { + /* FIXME: extract call_id */ + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + }; + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP("127.0.0.2", "127.0.0.1", "23", "42", 1234, + { "98" }, + { valueof(ts_SDP_rtpmap(98, "AMR/8000")), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, '1234'H, sdp)); + } + } /* Alerting */ MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); + BSSAP.receive(tr_BSSMAP_AssignmentReq); + BSSAP.send(ts_BSSMAP_AssignmentComplete); + /* Answer. This causes TCH assignment in case of "late assignment" */ MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); -- To view, visit https://gerrit.osmocom.org/6091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id33f17007b99776129e99625f8f6258a1653d863 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:43:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:45 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn: Move random number helpers to Osmocom_Types.ttcn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:43:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:53 +0000 Subject: osmo-ttcn3-hacks[master]: msc: move default (auth=off, tmsi=on, encry=off) vty command... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I38644ca3c4f629edb762cd24959033d426438e02 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:43:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:43:58 +0000 Subject: osmo-ttcn3-hacks[master]: msc: New TC_cl3_rnd_payload / TC_cl3_no_payload for COMPLETE L3 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I37ca3e5048cc1c2678d763a44b7e228da29851cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:00 +0000 Subject: osmo-ttcn3-hacks[master]: Add MGCP_Emulation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5245be2b44e98e1c74b9519c610564667b980a67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:02 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_CodecPort: Receive MGCP command or response In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6082 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I895cfb688a2923b278828f5ae918c73fda18636d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:04 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_Emulation part of "bsc: Register expect criteria for MG... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6083 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I466df816eef9863bf1664e785b996c0697dc04e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:06 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP library part of "bsc: Reply to CRCX with ACK" In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I68b66d26dfbbba11e1b3a8c04435f08d095f68ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:12 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: CRCX is answered with (malformed) ACK In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I09c1ed467e95be236e0758d6a9c8bbef405c02eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:31 +0000 Subject: osmo-ttcn3-hacks[master]: L3_Templates: ts_Bcap_voice(): Include speech version octets In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff48bff6df6fa7dae3bc8467be4d75b0305f68ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:34 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0379fcb676698d92effce755dbc07c26a6a1101 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:36 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_Emulation: Add comment + license disclaimer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf1a1ed80a99c8d8754cce3b47b11b5186b9c52d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:38 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_Emulation: More complete implementation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I953a91e663648715fa4fe98acacca393c8747001 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:40 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Start to integrate MGCP_Emulation component In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5330a06b7868b3f3a362cb5b640cd0cb985f2143 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:41 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Make use of MGCP_Emulation in f_tc_lu_and_mo_call In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id33f17007b99776129e99625f8f6258a1653d863 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 26 09:44:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:43 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Make use of MGCP_Emulation in f_tc_lu_and_mo_call In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Make use of MGCP_Emulation in f_tc_lu_and_mo_call ...................................................................... msc: Make use of MGCP_Emulation in f_tc_lu_and_mo_call Change-Id: Id33f17007b99776129e99625f8f6258a1653d863 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 20 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 87e3e78..aee0165 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -547,20 +547,34 @@ var hexstring called := '12345'H; var integer tid := 0; var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; f_create_mncc_expect(hex2str(called)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(tid, called))); - MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc; - /* FIXME: extract call_id */ - - /* Call Proceeding */ - MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + interleave { + [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc { + /* FIXME: extract call_id */ + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); + }; + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP("127.0.0.2", "127.0.0.1", "23", "42", 1234, + { "98" }, + { valueof(ts_SDP_rtpmap(98, "AMR/8000")), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, '1234'H, sdp)); + } + } /* Alerting */ MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); + BSSAP.receive(tr_BSSMAP_AssignmentReq); + BSSAP.send(ts_BSSMAP_AssignmentComplete); + /* Answer. This causes TCH assignment in case of "late assignment" */ MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); -- To view, visit https://gerrit.osmocom.org/6091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id33f17007b99776129e99625f8f6258a1653d863 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:44 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Start to integrate MGCP_Emulation component In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Start to integrate MGCP_Emulation component ...................................................................... msc: Start to integrate MGCP_Emulation component Change-Id: I5330a06b7868b3f3a362cb5b640cd0cb985f2143 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh 3 files changed, 33 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 656fb4e..58b64d3 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -14,13 +14,16 @@ import from MNCC_Types all; import from MNCC_Emulation all; +import from MGCP_Types all; +import from MGCP_Emulation all; + import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; import from MobileL3_MM_Types all; import from L3_Templates all; /* this component represents a single subscriber connection */ -type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr { +type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr { var BSC_ConnHdlrPars g_pars; } diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5f49d3a..87e3e78 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -26,6 +26,11 @@ import from MNCC_Emulation all; import from MNCC_Types all; +import from MGCP_Emulation all; +import from MGCP_Types all; +import from MGCP_Templates all; +import from SDP_Types all; + import from GSUP_Emulation all; import from GSUP_Types all; import from IPA_Emulation all; @@ -47,6 +52,7 @@ /* no 'adapter_CT' for MNCC or GSUP */ var MNCC_Emulation_CT vc_MNCC; + var MGCP_Emulation_CT vc_MGCP; var GSUP_Emulation_CT vc_GSUP; var IPA_Emulation_CT vc_GSUP_IPA; @@ -80,6 +86,24 @@ vc_MNCC := MNCC_Emulation_CT.create(id); map(vc_MNCC:MNCC, system:MNCC_CODEC_PT); vc_MNCC.start(MNCC_Emulation.main(ops, id, mp_msc_mncc)); +} + +function f_init_mgcp(charstring id) runs on MTC_CT { + id := id & "-MGCP"; + var MGCPOps ops := { + create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) + } + var MGCP_conn_parameters pars := { + callagent_ip := "127.0.0.1", + callagent_udp_port := -1, + mgw_ip := "127.0.0.1", + mgw_udp_port := 2427 + } + + vc_MGCP := MGCP_Emulation_CT.create(id); + map(vc_MGCP:MGCP, system:MGCP_CODEC_PT); + vc_MGCP.start(MGCP_Emulation.main(ops, pars, id)); } function f_init_gsup(charstring id) runs on MTC_CT { @@ -121,6 +145,7 @@ f_bssap_init("MSC_Test", BSC_BssmapOps); f_ipa_ctrl_start(mp_msc_ip, mp_msc_ctrl_port); f_init_mncc("MSC_Test"); + f_init_mgcp("MSC_Test"); f_init_gsup("MSC_Test"); map(self:MSCVTY, system:MSCVTY); @@ -347,6 +372,9 @@ /* MNCC part */ connect(vc_conn:MNCC, vc_MNCC:MNCC_CLIENT); connect(vc_conn:MNCC_PROC, vc_MNCC:MNCC_PROC); + /* MGCP part */ + connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); + connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); /* GSUP part */ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index 30ebed1..b501c55 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -78,7 +78,7 @@ FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn " FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " -FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn IPA_Emulation.ttcn " +FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn IPA_Emulation.ttcn " FILES+="RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunctDef.cc " FILES+="MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunctDef.cc " gen_links $DIR $FILES -- To view, visit https://gerrit.osmocom.org/6090 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5330a06b7868b3f3a362cb5b640cd0cb985f2143 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:44 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_Emulation: More complete implementation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_Emulation: More complete implementation ...................................................................... MGCP_Emulation: More complete implementation * re-introduce connection table * introduce unitdata_cb for connectionless MGCP messages (like AUEP) * rename MGCP_Emulation_CT members to avoid clashes with other similar component names when using "multiple inheritance" * Use HostName/PortNumber types on MGCP_conn_parameters * allow "bind to local UDP port only, permit any UDP source port" behavior * implement expect matching criteria + expect matching only on CRCX * add helper function f_create_mgcp_expect() like in other Emulations Change-Id: I953a91e663648715fa4fe98acacca393c8747001 --- M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn 2 files changed, 191 insertions(+), 44 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index beef9e8..5bd4e50 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -36,6 +36,8 @@ type component MGCP_ConnHdlr { port MGCP_Conn_PT MGCP; + /* procedure based port to register for incoming connections */ + port MGCPEM_PROC_PT MGCP_PROC; var MgcpConnectionId mgcp_conn_id; } @@ -44,6 +46,11 @@ inout MgcpCommand, MgcpResponse; } with { extension "internal" }; +/* represents a single MGCP Connection */ +type record ConnectionData { + MGCP_ConnHdlr comp_ref, + MgcpConnectionId conn_id optional +}; type component MGCP_Emulation_CT { /* Port facing to the UDP SUT */ @@ -51,13 +58,13 @@ /* All MGCP_ConnHdlr MGCP ports connect here * MGCP_Emulation_CT.main needs to figure out what messages * to send where with CLIENT.send() to vc_conn */ - port MGCP_Conn_PT CLIENT; + port MGCP_Conn_PT MGCP_CLIENT; /* currently tracked connections */ -// var ConnectionData ConnectionTable[16]; + var ConnectionData MgcpConnectionTable[16]; /* pending expected CRCX */ - var ExpectData ExpectTable[8]; + var ExpectData MgcpExpectTable[8]; /* procedure based port to register for incoming connections */ - port MGCPEM_PROC_PT PROC; + port MGCPEM_PROC_PT MGCP_PROC; var charstring g_mgcp_id; var integer g_mgcp_conn_id := -1; @@ -66,15 +73,19 @@ type function MGCPCreateCallback(MgcpCommand cmd, charstring id) runs on MGCP_Emulation_CT return MGCP_ConnHdlr; +type function MGCPUnitdataCallback(MgcpMessage msg) +runs on MGCP_Emulation_CT return template MgcpMessage; + type record MGCPOps { - MGCPCreateCallback create_cb + MGCPCreateCallback create_cb, + MGCPUnitdataCallback unitdata_cb } type record MGCP_conn_parameters { - charstring callagent_ip, - uint16_t callagent_udp_port, - charstring mgw_ip, - uint16_t mgw_udp_port + HostName callagent_ip, + PortNumber callagent_udp_port, + HostName mgw_ip, + PortNumber mgw_udp_port } function tr_MGCP_RecvFrom_R(template MgcpMessage msg) @@ -90,19 +101,94 @@ return mrf; } +private function f_conn_id_known(MgcpConnectionId conn_id) +runs on MGCP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].conn_id == conn_id) { + return true; + } + } + return false; +} + +private function f_comp_known(MGCP_ConnHdlr client) +runs on MGCP_Emulation_CT return boolean { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].comp_ref == client) { + return true; + } + } + return false; +} + +private function f_comp_by_conn_id(MgcpConnectionId conn_id) +runs on MGCP_Emulation_CT return MGCP_ConnHdlr { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].conn_id == conn_id) { + return MgcpConnectionTable[i].comp_ref; + } + } + log("MGCP Connection Table not found by Connection Id", conn_id); + setverdict(fail); + self.stop; +} + +private function f_conn_id_by_comp(MGCP_ConnHdlr client) +runs on MGCP_Emulation_CT return MgcpConnectionId { + var integer i; + for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + if (MgcpConnectionTable[i].comp_ref == client) { + return MgcpConnectionTable[i].conn_id; + } + } + log("MGCP Connection Table not found by component ", client); + setverdict(fail); + self.stop; +} + +/* TODO: move this to MGCP_Types? */ +function f_mgcp_conn_id(MgcpMessage msg) return hexstring { + var MgcpParameterList params; + var integer i; + if (ischosen(msg.command)) { + params := msg.command.params; + } else { + params := msg.response.params; + } + for (i := 0; i < lengthof(params); i := i+1) { + if (params[i].code == "I") { + return str2hex(params[i].val); + } + } + return ''H; +} + +private function f_conn_table_init() +runs on MGCP_Emulation_CT { + for (var integer i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { + MgcpConnectionTable[i].comp_ref := null; + MgcpConnectionTable[i].conn_id := omit; + } +} + function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; - //f_conn_table_init(); + f_conn_table_init(); f_expect_table_init(); map(self:MGCP, system:MGCP_CODEC_PT); - res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.mgw_ip, -p.mgw_udp_port, - p.callagent_ip, p.callagent_udp_port, 0, { udp:={} }); - + if (p.callagent_udp_port == -1) { + res := MGCP_CodecPort_CtrlFunct.f_IPL4_listen(MGCP, p.mgw_ip, p.mgw_udp_port, { udp:={} }); + } else { + res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, -1, { udp:={} }); + } + g_mgcp_conn_id := res.connId; - + while (true) { var MGCP_ConnHdlr vc_conn; var ExpectCriteria crit; @@ -113,32 +199,48 @@ alt { /* MGCP from client */ - [] CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { + [] MGCP_CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { /* Pass message through */ msg.response := resp; + /* TODO: check which ConnectionID client has allocated + store in table? */ MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg)); } [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) -> value mrf { + if (p.callagent_udp_port == -1) { + /* we aren't yet connected to the remote side port, let's fix this */ + p.callagent_udp_port := mrf.remPort; + MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.callagent_ip, p.callagent_udp_port, p.mgw_ip, p.mgw_udp_port, g_mgcp_conn_id, { udp:={} }); + } if (ischosen(mrf.msg.command)) { cmd := mrf.msg.command; - vc_conn := ops.create_cb.apply(cmd, id); - f_handle_userData(vc_conn, cmd); + if (match(cmd, tr_MgcpCommand_CO)) { + /* connection-oriented MGCP */ + if (cmd.line.verb == "CRCX") { + /* TODO: allocate ConnectionID here + store in Table? */ + vc_conn := ops.create_cb.apply(cmd, id); + } else { + var MgcpConnectionId conn_id := f_mgcp_conn_id(mrf.msg); + vc_conn := f_comp_by_conn_id(conn_id); + } + MGCP_CLIENT.send(cmd) to vc_conn; + } else { + /* connectionless MGCP, i.e. messages without ConnectionId */ + var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg); + if (isvalue(r)) { + MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r)); + } + } } else { setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); self.stop; } } - [] PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { + [] MGCP_PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { f_create_expect(crit, vc_conn); - PROC.reply(MGCPEM_register:{crit, vc_conn}); + MGCP_PROC.reply(MGCPEM_register:{crit, vc_conn}); } } } -} - -private function f_handle_userData(MGCP_ConnHdlr conn, MgcpCommand cmd) -runs on MGCP_Emulation_CT { - CLIENT.send(cmd) to conn; } /* "Expect" Handling */ @@ -163,8 +265,25 @@ function f_get_mgcp_by_crit(ExpectCriteria crit) return template MgcpCommand { - template MgcpCommand ret := { - }; + var template MgcpCommand ret := { + line := { + verb := ?, + trans_id := ?, + ep := ?, + ver := ? + }, + params := *, + sdp := * + } + if (ispresent(crit.connid)) { + ret.params := { *, ts_MgcpParConnectionId(crit.connid), * }; + } + if (ispresent(crit.endpoint)) { + ret.line.ep := crit.endpoint; + } + if (ispresent(crit.transid)) { + ret.line.trans_id := crit.transid; + } return ret; } @@ -178,20 +297,20 @@ /* Ensure cmd is a CRCX? */ - for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].crit)) { + for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { + if (not ispresent(MgcpExpectTable[i].crit)) { continue; } /* FIXME: Ignore criteria for now */ -// mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); -// if (match(cmd, mgcpcmd)) { - ret := ExpectTable[i].vc_conn; + mgcpcmd := f_get_mgcp_by_crit(MgcpExpectTable[i].crit); + if (match(cmd, mgcpcmd)) { + ret := MgcpExpectTable[i].vc_conn; /* Release this entry */ - ExpectTable[i].crit := omit; - ExpectTable[i].vc_conn := null; + MgcpExpectTable[i].crit := omit; + MgcpExpectTable[i].vc_conn := null; log("Found Expect[", i, "] for ", cmd, " handled at ", ret); return ret; -// } + } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); return ret; @@ -202,29 +321,43 @@ var integer i; /* Check an entry like this is not already presnt */ - for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (crit == ExpectTable[i].crit) { + for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { + if (crit == MgcpExpectTable[i].crit) { setverdict(fail, "Crit already present", crit); self.stop; } } - for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].crit)) { - ExpectTable[i].crit := crit; - ExpectTable[i].vc_conn := hdlr; + for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { + if (not ispresent(MgcpExpectTable[i].crit)) { + MgcpExpectTable[i].crit := crit; + MgcpExpectTable[i].vc_conn := hdlr; log("Created Expect[", i, "] for ", crit, " to be handled at ", hdlr); return; } } - setverdict(fail, "No space left in ExpectTable") + setverdict(fail, "No space left in MgcpExpectTable") +} + +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mgcp_expect(ExpectCriteria dest_number) runs on MGCP_ConnHdlr { + MGCP_PROC.call(MGCPEM_register:{dest_number, self}) { + [] MGCP_PROC.getreply(MGCPEM_register:{?,?}) {}; + } } private function f_expect_table_init() runs on MGCP_Emulation_CT { var integer i; - for (i := 0; i < sizeof(ExpectTable); i := i + 1) { - ExpectTable[i].crit := omit; + for (i := 0; i < sizeof(MgcpExpectTable); i := i + 1) { + MgcpExpectTable[i].crit := omit; } } +function DummyUnitdataCallback(MgcpMessage msg) +runs on MGCP_Emulation_CT return template MgcpMessage { + log("Ignoring MGCP ", msg); + return omit; +} + + } diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index f4c6e0f..c0c827f 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -268,4 +268,18 @@ return int2hex(float2int(rnd()*2147483647.0), 8); } + /* those verbs that related to a connection (and hence have ConnectionId) */ + template MgcpVerb tr_MgcpVerb_ConnectionOriented := ("CRCX", "MDCX", "DLCX", "AUCX"); + /* entire command template matching only connection oriented verbs */ + template MgcpCommand tr_MgcpCommand_CO := { + line := { + verb := tr_MgcpVerb_ConnectionOriented, + trans_id := ?, + ep := ?, + ver := ? + }, + params := *, + sdp := * + } + } -- To view, visit https://gerrit.osmocom.org/6089 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I953a91e663648715fa4fe98acacca393c8747001 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:44 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_Emulation: Add comment + license disclaimer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_Emulation: Add comment + license disclaimer ...................................................................... MGCP_Emulation: Add comment + license disclaimer Change-Id: Ibf1a1ed80a99c8d8754cce3b47b11b5186b9c52d --- M library/MGCP_Emulation.ttcn 1 file changed, 27 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 1209ff6..beef9e8 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -1,5 +1,32 @@ module MGCP_Emulation { +/* MGCP Emulation, runs on top of MGCP_CodecPort. It multiplexes/demultiplexes + * the individual connections, so there can be separate TTCN-3 components handling + * each of the connections. + * + * The MGCP_Emulation.main() function processes MGCP primitives from the MGCP + * socket via the MGCP_CodecPort, and dispatches them to the per-connection components. + * + * For each new inbound connection, the MgcpOps.create_cb() is called. It can create + * or resolve a TTCN-3 component, and returns a component reference to which that inbound + * connection is routed/dispatched. + * + * If a pre-existing component wants to register to handle a future inbound call, it can + * do so by registering an "expect" with the expected destination phone number. This is e.g. useful + * if you are simulating BSC + MGCP, and first trigger a connection from BSC side in a + * component which then subsequently should also handle the MGCP emulation. + * + * Inbound Unit Data messages (such as are dispatched to the MgcpOps.unitdata_cb() callback, + * which is registered with an argument to the main() function below. + * + * (C) 2017-2018 by Harald Welte + * (C) 2018 by sysmocom - s.f.m.c. GmbH, Author: Daniel Willmann + * All rights reserved. + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + */ + import from MGCP_CodecPort all; import from MGCP_CodecPort_CtrlFunct all; import from MGCP_Types all; -- To view, visit https://gerrit.osmocom.org/6088 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf1a1ed80a99c8d8754cce3b47b11b5186b9c52d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:44 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC ...................................................................... BSSMAP_Templates: Permit tr_BSSMAP_AssignmentReq without CIC Change-Id: Id0379fcb676698d92effce755dbc07c26a6a1101 --- M library/BSSMAP_Templates.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 33c370e..bc55f58 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -478,7 +478,7 @@ channelType := ?, layer3HeaderInfo := *, priority := *, - circuitIdentityCode := ?, + circuitIdentityCode := *, downLinkDTX_Flag := *, interferenceBandToBeUsed := *, classmarkInformationType2 := *, -- To view, visit https://gerrit.osmocom.org/6087 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id0379fcb676698d92effce755dbc07c26a6a1101 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:45 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: L3_Templates: ts_Bcap_voice(): Include speech version octets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: L3_Templates: ts_Bcap_voice(): Include speech version octets ...................................................................... L3_Templates: ts_Bcap_voice(): Include speech version octets Change-Id: Iff48bff6df6fa7dae3bc8467be4d75b0305f68ad --- M library/L3_Templates.ttcn 1 file changed, 20 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 7836555..5816ab9 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -435,6 +435,19 @@ digits := digits } +type integer SpeechVer; + +template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { + speechVersionIndication := int2bit(ver-1,3) & suffix, + spare1_1 := '0'B, + cTM_or_Spare := '0'B, + coding := '0'B, + extension_octet_3a_3b := '0'B +} + +template (value) Speech_AuxiliarySpeech ts_SpeechAuxFR(SpeechVer ver) := ts_SpeechAux(ver, '0'B); +template (value) Speech_AuxiliarySpeech ts_SpeechAuxHR(SpeechVer ver) := ts_SpeechAux(ver, '1'B); + template (value) BearerCapability_TLV ts_Bcap_voice := { elementIdentifier := '04'O, lengthIndicator := 0, /* overwritten */ @@ -444,7 +457,13 @@ codingStandard := '0'B, radioChannelRequirement := '11'B, /* FR preferred */ extension_octet_3 := '0'B, /* overwritten */ - speech_aux_3a_3b := omit + speech_aux_3a_3b := { + valueof(ts_SpeechAuxHR(3)), + valueof(ts_SpeechAuxFR(3)), + valueof(ts_SpeechAuxFR(2)), + valueof(ts_SpeechAuxFR(1)), + valueof(ts_SpeechAuxHR(1)) + } }, octet4 := omit, octet5 := omit, -- To view, visit https://gerrit.osmocom.org/6086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff48bff6df6fa7dae3bc8467be4d75b0305f68ad Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:45 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: CRCX is answered with (malformed) ACK In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: CRCX is answered with (malformed) ACK ...................................................................... bsc: CRCX is answered with (malformed) ACK Change-Id: I09c1ed467e95be236e0758d6a9c8bbef405c02eb --- M library/MGCP_Emulation.ttcn 1 file changed, 41 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index f8d5a1e..1209ff6 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -33,6 +33,7 @@ port MGCPEM_PROC_PT PROC; var charstring g_mgcp_id; + var integer g_mgcp_conn_id := -1; } type function MGCPCreateCallback(MgcpCommand cmd, charstring id) @@ -49,6 +50,19 @@ uint16_t mgw_udp_port } +function tr_MGCP_RecvFrom_R(template MgcpMessage msg) +runs on MGCP_Emulation_CT return template MGCP_RecvFrom { + var template MGCP_RecvFrom mrf := { + connId := g_mgcp_conn_id, + remName := ?, + remPort := ?, + locName := ?, + locPort := ?, + msg := msg + } + return mrf; +} + function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; @@ -60,12 +74,32 @@ p.mgw_udp_port, p.callagent_ip, p.callagent_udp_port, 0, { udp:={} }); + g_mgcp_conn_id := res.connId; while (true) { + var MGCP_ConnHdlr vc_conn; + var ExpectCriteria crit; + var MGCP_RecvFrom mrf; + var MgcpMessage msg; + var MgcpCommand cmd; + var MgcpResponse resp; + alt { - [] CLIENT.receive(MgcpCommand:?) { + /* MGCP from client */ + [] CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { + /* Pass message through */ + msg.response := resp; + MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg)); } - [] MGCP.receive(MGCP_RecvFrom:?) { + [] MGCP.receive(tr_MGCP_RecvFrom_R(?)) -> value mrf { + if (ischosen(mrf.msg.command)) { + cmd := mrf.msg.command; + vc_conn := ops.create_cb.apply(cmd, id); + f_handle_userData(vc_conn, cmd); + } else { + setverdict(fail, "Received unexpected MGCP response: ", mrf.msg.response); + self.stop; + } } [] PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { f_create_expect(crit, vc_conn); @@ -75,6 +109,11 @@ } } +private function f_handle_userData(MGCP_ConnHdlr conn, MgcpCommand cmd) +runs on MGCP_Emulation_CT { + CLIENT.send(cmd) to conn; +} + /* "Expect" Handling */ /* */ -- To view, visit https://gerrit.osmocom.org/6085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I09c1ed467e95be236e0758d6a9c8bbef405c02eb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:45 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP library part of "bsc: Reply to CRCX with ACK" In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP library part of "bsc: Reply to CRCX with ACK" ...................................................................... MGCP library part of "bsc: Reply to CRCX with ACK" Change-Id: I68b66d26dfbbba11e1b3a8c04435f08d095f68ed --- M library/MGCP_Emulation.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index b164748..f8d5a1e 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -9,6 +9,7 @@ type component MGCP_ConnHdlr { port MGCP_Conn_PT MGCP; + var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/6084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I68b66d26dfbbba11e1b3a8c04435f08d095f68ed Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:45 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:45 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_Emulation part of "bsc: Register expect criteria for MG... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_Emulation part of "bsc: Register expect criteria for MGCP CRCX" ...................................................................... MGCP_Emulation part of "bsc: Register expect criteria for MGCP CRCX" Change-Id: I466df816eef9863bf1664e785b996c0697dc04e3 --- M library/MGCP_Emulation.ttcn 1 file changed, 25 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 2ab5669..b164748 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -48,10 +48,11 @@ uint16_t mgw_udp_port } -function main(MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { +function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; //f_conn_table_init(); + f_expect_table_init(); map(self:MGCP, system:MGCP_CODEC_PT); res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.mgw_ip, @@ -65,6 +66,10 @@ } [] MGCP.receive(MGCP_RecvFrom:?) { } + [] PROC.getcall(MGCPEM_register:{?,?}) -> param(crit, vc_conn) { + f_create_expect(crit, vc_conn); + PROC.reply(MGCPEM_register:{crit, vc_conn}); + } } } } @@ -72,18 +77,18 @@ /* "Expect" Handling */ /* */ -type union ExpectCriteria { - MgcpConnectionId connid, - MgcpEndpoint endpoint, - MgcpTransId transid +type record ExpectCriteria { + MgcpConnectionId connid optional, + MgcpEndpoint endpoint optional, + MgcpTransId transid optional } type record ExpectData { ExpectCriteria crit optional, - MGCP_ConnHdlr vc_conn optional + MGCP_ConnHdlr vc_conn } -signature MGCPEM_register(in MgcpCommand cmd, in MGCP_ConnHdlr hdlr); +signature MGCPEM_register(in ExpectCriteria cmd, in MGCP_ConnHdlr hdlr); type port MGCPEM_PROC_PT procedure { inout MGCPEM_register; @@ -107,18 +112,19 @@ /* Ensure cmd is a CRCX? */ for (i := 0; i < sizeof(ExpectTable); i := i+1) { - if (not ispresent(ExpectTable[i].vc_conn)) { + if (not ispresent(ExpectTable[i].crit)) { continue; } - mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); - if (match(cmd, mgcpcmd)) { + /* FIXME: Ignore criteria for now */ +// mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); +// if (match(cmd, mgcpcmd)) { ret := ExpectTable[i].vc_conn; /* Release this entry */ ExpectTable[i].crit := omit; ExpectTable[i].vc_conn := null; log("Found Expect[", i, "] for ", cmd, " handled at ", ret); return ret; - } +// } } setverdict(fail, "Couldn't find Expect for CRCX", cmd); return ret; @@ -146,4 +152,12 @@ setverdict(fail, "No space left in ExpectTable") } +private function f_expect_table_init() +runs on MGCP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(ExpectTable); i := i + 1) { + ExpectTable[i].crit := omit; + } +} + } -- To view, visit https://gerrit.osmocom.org/6083 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I466df816eef9863bf1664e785b996c0697dc04e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:46 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_CodecPort: Receive MGCP command or response In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_CodecPort: Receive MGCP command or response ...................................................................... MGCP_CodecPort: Receive MGCP command or response If we act as MGW we need to accept MGCP commands sent to us as well Change-Id: I895cfb688a2923b278828f5ae918c73fda18636d --- M library/MGCP_CodecPort.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_CodecPort.ttcn b/library/MGCP_CodecPort.ttcn index 416ac36..c206986 100644 --- a/library/MGCP_CodecPort.ttcn +++ b/library/MGCP_CodecPort.ttcn @@ -53,7 +53,7 @@ pout.msg := dec_MgcpMessage(oct2char(pin.msg)); - see https://www.eclipse.org/forums/index.php/t/1088893/ */ - pout.msg := { response := dec_MgcpResponse(oct2char(pin.msg)) }; + pout.msg := dec_MgcpMessage(oct2char(pin.msg)); } with { extension "prototype(fast)" }; private function MGCP_to_IPL4_Send(in MGCP_Send pin, out ASP_Send pout) { -- To view, visit https://gerrit.osmocom.org/6082 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I895cfb688a2923b278828f5ae918c73fda18636d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:46 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: Add MGCP_Emulation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add MGCP_Emulation ...................................................................... Add MGCP_Emulation Change-Id: I5245be2b44e98e1c74b9519c610564667b980a67 --- A library/MGCP_Emulation.ttcn 1 file changed, 149 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn new file mode 100644 index 0000000..2ab5669 --- /dev/null +++ b/library/MGCP_Emulation.ttcn @@ -0,0 +1,149 @@ +module MGCP_Emulation { + +import from MGCP_CodecPort all; +import from MGCP_CodecPort_CtrlFunct all; +import from MGCP_Types all; +import from MGCP_Templates all; +import from Osmocom_Types all; +import from IPL4asp_Types all; + +type component MGCP_ConnHdlr { + port MGCP_Conn_PT MGCP; +} + +/* port between individual per-connection components and this dispatcher */ +type port MGCP_Conn_PT message { + inout MgcpCommand, MgcpResponse; +} with { extension "internal" }; + + +type component MGCP_Emulation_CT { + /* Port facing to the UDP SUT */ + port MGCP_CODEC_PT MGCP; + /* All MGCP_ConnHdlr MGCP ports connect here + * MGCP_Emulation_CT.main needs to figure out what messages + * to send where with CLIENT.send() to vc_conn */ + port MGCP_Conn_PT CLIENT; + /* currently tracked connections */ +// var ConnectionData ConnectionTable[16]; + /* pending expected CRCX */ + var ExpectData ExpectTable[8]; + /* procedure based port to register for incoming connections */ + port MGCPEM_PROC_PT PROC; + + var charstring g_mgcp_id; +} + +type function MGCPCreateCallback(MgcpCommand cmd, charstring id) +runs on MGCP_Emulation_CT return MGCP_ConnHdlr; + +type record MGCPOps { + MGCPCreateCallback create_cb +} + +type record MGCP_conn_parameters { + charstring callagent_ip, + uint16_t callagent_udp_port, + charstring mgw_ip, + uint16_t mgw_udp_port +} + +function main(MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { + var Result res; + g_mgcp_id := id; + //f_conn_table_init(); + + map(self:MGCP, system:MGCP_CODEC_PT); + res := MGCP_CodecPort_CtrlFunct.f_IPL4_connect(MGCP, p.mgw_ip, +p.mgw_udp_port, + p.callagent_ip, p.callagent_udp_port, 0, { udp:={} }); + + + while (true) { + alt { + [] CLIENT.receive(MgcpCommand:?) { + } + [] MGCP.receive(MGCP_RecvFrom:?) { + } + } + } +} + +/* "Expect" Handling */ + +/* */ +type union ExpectCriteria { + MgcpConnectionId connid, + MgcpEndpoint endpoint, + MgcpTransId transid +} + +type record ExpectData { + ExpectCriteria crit optional, + MGCP_ConnHdlr vc_conn optional +} + +signature MGCPEM_register(in MgcpCommand cmd, in MGCP_ConnHdlr hdlr); + +type port MGCPEM_PROC_PT procedure { + inout MGCPEM_register; +} with { extension "internal" }; + +function f_get_mgcp_by_crit(ExpectCriteria crit) +return template MgcpCommand { + template MgcpCommand ret := { + }; + + return ret; +} + +/* Function that can be used as create_cb and will usse the expect table */ +function ExpectedCreateCallback(MgcpCommand cmd, charstring id) +runs on MGCP_Emulation_CT return MGCP_ConnHdlr { + var MGCP_ConnHdlr ret := null; + var template MgcpCommand mgcpcmd; + var integer i; + + /* Ensure cmd is a CRCX? */ + + for (i := 0; i < sizeof(ExpectTable); i := i+1) { + if (not ispresent(ExpectTable[i].vc_conn)) { + continue; + } + mgcpcmd := f_get_mgcp_by_crit(ExpectTable[i].crit); + if (match(cmd, mgcpcmd)) { + ret := ExpectTable[i].vc_conn; + /* Release this entry */ + ExpectTable[i].crit := omit; + ExpectTable[i].vc_conn := null; + log("Found Expect[", i, "] for ", cmd, " handled at ", ret); + return ret; + } + } + setverdict(fail, "Couldn't find Expect for CRCX", cmd); + return ret; +} + +private function f_create_expect(ExpectCriteria crit, MGCP_ConnHdlr hdlr) +runs on MGCP_Emulation_CT { + var integer i; + + /* Check an entry like this is not already presnt */ + for (i := 0; i < sizeof(ExpectTable); i := i+1) { + if (crit == ExpectTable[i].crit) { + setverdict(fail, "Crit already present", crit); + self.stop; + } + } + for (i := 0; i < sizeof(ExpectTable); i := i+1) { + if (not ispresent(ExpectTable[i].crit)) { + ExpectTable[i].crit := crit; + ExpectTable[i].vc_conn := hdlr; + log("Created Expect[", i, "] for ", crit, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in ExpectTable") +} + +} -- To view, visit https://gerrit.osmocom.org/6081 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5245be2b44e98e1c74b9519c610564667b980a67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:46 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: New TC_cl3_rnd_payload / TC_cl3_no_payload for COMPLETE L3 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: New TC_cl3_rnd_payload / TC_cl3_no_payload for COMPLETE L3 ...................................................................... msc: New TC_cl3_rnd_payload / TC_cl3_no_payload for COMPLETE L3 Test BSSMAP COMPLETE L3 INFO either with no payload whatsoever or with random payload. Change-Id: I37ca3e5048cc1c2678d763a44b7e228da29851cc --- M msc_tests/MSC_Tests.ttcn 1 file changed, 61 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 426f479..5f49d3a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1089,6 +1089,63 @@ vc_conn.done; } +/* Test Complete L3 without payload */ +private function f_tc_cl3_no_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + /* Send Complete L3 Info with empty L3 frame */ + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, ''O)))); + + alt { + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + /* Expect LU REJECT with Cause == Illegal MS */ + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + } + setverdict(pass); +} +testcase TC_cl3_no_payload() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cl3_no_payload), testcasename(), 24); + vc_conn.done; +} + +/* Test Complete L3 with random payload */ +private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + var integer len := float2int(rnd() * 256.0); + var octetstring payl := f_rnd_octstring(len); + + /* Send Complete L3 Info with empty L3 frame */ + BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, + valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, payl)))); + + alt { + /* Immediate disconnect */ + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + /* Expect LU REJECT with Cause == Illegal MS */ + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } + } + setverdict(pass); +} +testcase TC_cl3_rnd_payload() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_cl3_rnd_payload), testcasename(), 24); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? @@ -1096,8 +1153,6 @@ * MT call while LU or is ongoing: Do we use existing lchan or page while lchan active? * 3G/2G auth permutations * encryption algorithms vs. classmark vs. vty config - * emergency call - * IMSI DETACH * send new transaction after/during clear (like SMS, ...) * too long L3 INFO in DTAP * too long / padded BSSAP @@ -1127,6 +1182,10 @@ execute( TC_cm_serv_req_vbs_reject() ); execute( TC_cm_serv_req_lcs_reject() ); execute( TC_cm_reest_req_reject() ); + execute( TC_lu_auth_2G_fail() ); + execute( TC_lu_imsi_auth_tmsi_encr_13_13() ); + execute( TC_cl3_no_payload() ); + execute( TC_cl3_rnd_payload() ); } -- To view, visit https://gerrit.osmocom.org/6080 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I37ca3e5048cc1c2678d763a44b7e228da29851cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:46 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: move default (auth=off, tmsi=on, encry=off) vty command... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: move default (auth=off, tmsi=on, encry=off) vty commands to f_init() ...................................................................... msc: move default (auth=off, tmsi=on, encry=off) vty commands to f_init() Change-Id: I38644ca3c4f629edb762cd24959033d426438e02 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 74d1b93..426f479 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -126,6 +126,11 @@ map(self:MSCVTY, system:MSCVTY); f_vty_set_prompts(MSCVTY); f_vty_transceive(MSCVTY, "enable"); + + /* set some defaults */ + f_vty_config(MSCVTY, "network", "authentication optional"); + f_vty_config(MSCVTY, "msc", "assign-tmsi"); + f_vty_config(MSCVTY, "network", "encryption a5 0"); } template PDU_BSSAP ts_BSSAP_BSSMAP := { @@ -374,8 +379,6 @@ testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_tmsi), testcasename(), 1); vc_conn.done; @@ -388,7 +391,6 @@ testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); f_vty_config(MSCVTY, "msc", "no assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_noauth_notmsi), testcasename(), 2); @@ -419,7 +421,6 @@ testcase TC_lu_imsi_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_reject), testcasename(), 3); vc_conn.done; @@ -450,7 +451,6 @@ testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_timeout_gsup), testcasename(), 4); vc_conn.done; @@ -506,7 +506,6 @@ testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_cmserv_imsi_unknown), testcasename(), 6); vc_conn.done; } @@ -557,7 +556,6 @@ testcase TC_lu_and_mo_call() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_and_mo_call), testcasename(), 7); vc_conn.done; @@ -722,7 +720,6 @@ testcase TC_lu_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_by_imei), testcasename(), 12); vc_conn.done; @@ -770,7 +767,6 @@ testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); vc_conn := f_start_handler(refers(f_tc_lu_tmsi_noauth_unknown), testcasename(), 13); vc_conn.done; @@ -933,8 +929,6 @@ testcase TC_emerg_call_imsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_emerg_call_imsi), testcasename(), 18); vc_conn.done; @@ -959,8 +953,6 @@ testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vgcs_reject), testcasename(), 19); vc_conn.done; @@ -985,8 +977,6 @@ testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_vbs_reject), testcasename(), 20); vc_conn.done; @@ -1011,8 +1001,6 @@ testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_serv_req_lcs_reject), testcasename(), 21); vc_conn.done; @@ -1037,8 +1025,6 @@ testcase TC_cm_reest_req_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; f_init(); - f_vty_config(MSCVTY, "network", "authentication optional"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_cm_reest_req_reject), testcasename(), 22); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/6079 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I38644ca3c4f629edb762cd24959033d426438e02 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 09:44:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 09:44:47 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: ggsn: Move random number helpers to Osmocom_Types.ttcn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Move random number helpers to Osmocom_Types.ttcn ...................................................................... ggsn: Move random number helpers to Osmocom_Types.ttcn Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af --- M ggsn_tests/GGSN_Tests.ttcn M library/Osmocom_Types.ttcn 2 files changed, 33 insertions(+), 34 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 22cdc21..23e7054 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -615,11 +615,6 @@ const octetstring c_ApnInet6 := '05696E657436'O; const octetstring c_ApnInet46 := '06696E65743436'O; - /* return random integer between 0 and max */ - function f_rnd_int(integer max) return integer { - return float2int(rnd()*int2float(max)); - } - /* return random NSAPI */ function f_rnd_nsapi() return BIT4 { return int2bit(f_rnd_int(16), 4); @@ -629,35 +624,6 @@ function f_rnd_tei() return OCT4 { return int2oct(f_rnd_int(4294967296), 4); } - - /* return hexstring composed of random digits */ - function f_rnd_hexstring(in integer len, in integer max := 15) return hexstring { - var integer i; - var hexstring ret := ''H; - for (i := 0; i < len; i := i + 1) { - ret := ret & int2hex(f_rnd_int(max), 1); - } - return ret; - } - - /* return octetstring composed of random bytes */ - function f_rnd_octstring(in integer len) return octetstring { - var integer i; - var octetstring ret := ''O; - for (i := 0; i < len; i := i + 1) { - ret := ret & int2oct(f_rnd_int(255), 1); - } - return ret; - } - - function f_rnd_imsi(in hexstring prefix) return hexstring { - return prefix & f_rnd_hexstring(15 - lengthof(prefix), 9); - } - - function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring { - return prefix & f_rnd_octstring(len - lengthof(prefix)); - } - /* define an (internal) representation of a PDP context */ template PdpContext t_DefinePDP(hexstring imsi, octetstring msisdn, octetstring apn, diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 484f6d1..495b684 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -27,4 +27,37 @@ uint15_t arfcn } with { variant "" }; + /* return random integer between 0 and max */ + function f_rnd_int(integer max) return integer { + return float2int(rnd()*int2float(max)); + } + + /* return hexstring composed of random digits */ + function f_rnd_hexstring(in integer len, in integer max := 15) return hexstring { + var integer i; + var hexstring ret := ''H; + for (i := 0; i < len; i := i + 1) { + ret := ret & int2hex(f_rnd_int(max), 1); + } + return ret; + } + + /* return octetstring composed of random bytes */ + function f_rnd_octstring(in integer len) return octetstring { + var integer i; + var octetstring ret := ''O; + for (i := 0; i < len; i := i + 1) { + ret := ret & int2oct(f_rnd_int(255), 1); + } + return ret; + } + + function f_rnd_imsi(in hexstring prefix) return hexstring { + return prefix & f_rnd_hexstring(15 - lengthof(prefix), 9); + } + + function f_rnd_msisdn(in octetstring prefix, integer len := 6) return octetstring { + return prefix & f_rnd_octstring(len - lengthof(prefix)); + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/6078 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I141289cbf1807e81d72f07ac1183fa48b2dc54af Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 10:18:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 10:18:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3920 to look at the new patch set (#8). Simplify TS alloc: use defines for constants * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/8 diff --git a/src/bts.cpp b/src/bts.cpp index d652c59..e236f93 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,7 +475,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index 8d3a3cc..34326b8 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c246676..0e8b785 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -83,7 +83,7 @@ int8_t tfi; tfi_map = pdch->assigned_tfi(dir); - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -164,7 +164,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -295,10 +295,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 6e344dc..1c98e46 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -585,17 +585,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 26 10:18:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 10:18:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: fix allocation calls In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4084 to look at the new patch set (#2). Simplify TS alloc: fix allocation calls Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#228 --- M src/bts.cpp M src/tbf.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 4 files changed, 26 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/84/4084/2 diff --git a/src/bts.cpp b/src/bts.cpp index 94354f2..d652c59 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -749,7 +749,7 @@ // Create new TBF /* FIXME: Copy and paste with other routines.. */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " diff --git a/src/tbf.cpp b/src/tbf.cpp index ea3ffe3..8cfca3a 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -403,7 +403,8 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, + false); if (!tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -1350,7 +1351,7 @@ new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1aa3f63..6e344dc 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -213,7 +213,7 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); if (!ul_tbf) return false; @@ -223,7 +223,8 @@ dump_assignment(ul_tbf, "UL", verbose); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, + false); if (!dl_tbf) return false; @@ -254,7 +255,7 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); if (!dl_tbf) return false; @@ -265,7 +266,8 @@ dump_assignment(dl_tbf, "DL", verbose); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, + false); if (!ul_tbf) return false; @@ -305,7 +307,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); if (!ul_tbf) return false; @@ -315,7 +317,8 @@ dump_assignment(ul_tbf, "UL", true); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, + false); if (!dl_tbf) return false; @@ -466,7 +469,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -475,7 +478,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -755,7 +758,8 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -765,7 +769,8 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index aa1d7ac..fbed45a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -83,14 +83,14 @@ */ gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -172,7 +172,8 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, + true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2212,7 +2213,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2226,7 +2227,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2270,7 +2271,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/4084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43c76cb49093b40eb854d324e898e821270053dc 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 Jan 26 10:18:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 10:18:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures 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/3912 to look at the new patch set (#6). Simplify TS alloc: adjust function signatures * document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp 3 files changed, 61 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/3912/6 diff --git a/src/bts.cpp b/src/bts.cpp index e236f93..1669739 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -456,10 +456,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; diff --git a/src/bts.h b/src/bts.h index 34326b8..5679b98 100644 --- a/src/bts.h +++ b/src/bts.h @@ -364,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0e8b785..e394a6e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -58,7 +58,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -76,13 +76,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == NO_FREE_TFI) return -1; @@ -95,16 +93,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -142,22 +139,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -172,11 +166,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -185,7 +187,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -255,30 +257,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -289,9 +284,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -308,32 +303,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -380,7 +384,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -448,6 +452,14 @@ return 0; } +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] mslot_class The multislot class + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -681,7 +693,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -751,14 +763,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -786,7 +797,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -986,7 +997,7 @@ /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 26 10:31:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 10:31:34 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR Message-ID: Review at https://gerrit.osmocom.org/6092 share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR Since the NITB split, GSUP is used in all three network elements, so make the protocol a shared chapter Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f --- M OsmoHLR/osmohlr-usermanual.adoc M OsmoMSC/osmomsc-usermanual.adoc M OsmoSGSN/osmosgsn-usermanual.adoc R common/chapters/gsup.adoc 4 files changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/92/6092/1 diff --git a/OsmoHLR/osmohlr-usermanual.adoc b/OsmoHLR/osmohlr-usermanual.adoc index 2369155..043c971 100644 --- a/OsmoHLR/osmohlr-usermanual.adoc +++ b/OsmoHLR/osmohlr-usermanual.adoc @@ -22,6 +22,8 @@ include::../common/chapters/control_if.adoc[] +include::../common/chapters/gsup.adoc[] + include::../common/chapters/port_numbers.adoc[] include::../common/chapters/bibliography.adoc[] diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc index 6190481..ac68d93 100644 --- a/OsmoMSC/osmomsc-usermanual.adoc +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -28,6 +28,8 @@ include::../common/chapters/control_if.adoc[] +include::../common/chapters/gsup.adoc[] + include::../common/chapters/port_numbers.adoc[] include::../common/chapters/bibliography.adoc[] diff --git a/OsmoSGSN/osmosgsn-usermanual.adoc b/OsmoSGSN/osmosgsn-usermanual.adoc index a6a7709..079e811 100644 --- a/OsmoSGSN/osmosgsn-usermanual.adoc +++ b/OsmoSGSN/osmosgsn-usermanual.adoc @@ -25,7 +25,7 @@ include::../common/chapters/oap.adoc[] -include::chapters/gsup.adoc[] +include::../common/chapters/gsup.adoc[] include::chapters/counters.adoc[] diff --git a/OsmoSGSN/chapters/gsup.adoc b/common/chapters/gsup.adoc similarity index 100% rename from OsmoSGSN/chapters/gsup.adoc rename to common/chapters/gsup.adoc -- To view, visit https://gerrit.osmocom.org/6092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 10:31:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 10:31:35 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: GSUP: Change wording to cover both SGSN and MSC/VLR Message-ID: Review at https://gerrit.osmocom.org/6093 GSUP: Change wording to cover both SGSN and MSC/VLR Change-Id: I4b473e324e9314f4e9356a8bae6fbb48dbaaf58c --- M common/chapters/gsup.adoc 1 file changed, 48 insertions(+), 48 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/93/6093/1 diff --git a/common/chapters/gsup.adoc b/common/chapters/gsup.adoc index 733b60e..a231f7a 100644 --- a/common/chapters/gsup.adoc +++ b/common/chapters/gsup.adoc @@ -1,21 +1,21 @@ [[gsup]] -== GPRS Subscriber Update Protocol +== Generic Subscriber Update Protocol === General -This chapter describes the remote protocol that is used by the SGSN to update -and manage the local subscriber list. Functionally, it resembles the -interface between the SGSN on the one hand side, and HLR/AUC on the +This chapter describes the remote protocol that is used by OsmoSGSN and OsmoMSC to update +and manage the local subscriber list in OsmoHLR. Functionally, it resembles the +interface between the SGSN/VLR on the one hand side, and HLR/AUC on the other side. For more information, see the specification of the Gr interface (3GPP TS 03.60). Traditionally, the GSM MAP (Mobile Application Part) protocol is used for this purpose, running on top of a full telecom signalling protocol -stck of MTP2/MTP3/SCCP/TCAP, or any of the SIGTRAN alternatvives. +stack of MTP2/MTP3/SCCP/TCAP, or any of the SIGTRAN alternatives. In order to avoid many of the complexities of MAP, which are difficult -to implement in the plain C language evnironment of the Osmocom +to implement in the plain C language environment of the Osmocom cellular network elements like the SGSN, we introduce the GSUP protocol. @@ -50,20 +50,20 @@ ==== Authentication management -The SGSN sends a SEND_AUTHENTICATION_INFO_REQ message containing the MS's IMSI +The SGSN or VLR sends a SEND_AUTHENTICATION_INFO_REQ message containing the MS's IMSI to the peer. On errors, especially if authentication info is not available for that IMSI, the peer returns a SEND_AUTHENTICATION_INFO_ERR message. Otherwise the peer returns a SEND_AUTHENTICATION_INFO_RES message. If this message -contains at least one authentication tuple, the SGSN replaces all tuples that +contains at least one authentication tuple, the SGSN or VLR replaces all tuples that are assigned to the subscriber. If the message doesn't contain any tuple the -SGSN may reject the Attach Request. (see 3GPP TS 09.02, 25.5.6) +SGSN or VLR may reject the Attach Request. (see 3GPP TS 09.02, 25.5.6) .Send Authentication Info (Normal Case) ["mscgen"] ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; Peer => SGSN [label="SEND AUTHENTICATION INFO RESPONSE (Tuples)"]; @@ -75,7 +75,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; Peer => SGSN [label="SEND AUTHENTICATION INFO ERROR (Cause)"]; @@ -84,7 +84,7 @@ ==== Reporting of Authentication Failure -Using this procedure, the SGSN reports authentication failures to the +Using this procedure, the SGSN or VLR reports authentication failures to the HLR. .Authentication Failure Report (Normal Case) @@ -92,7 +92,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="AUTHENTICATION FAILURE REPORT (IMSI)"]; } @@ -100,11 +100,11 @@ ==== Location Updating -The SGSN sends a UPDATE_LOCATION_REQ to the peer. If the request is denied by -the network, the peer returns an UPDATE_LOCATION_ERR message to the SGSN. +The SGSN or VLR sends a UPDATE_LOCATION_REQ to the peer. If the request is denied by +the network, the peer returns an UPDATE_LOCATION_ERR message to the SGSN or VLR. Otherwise the peer returns an UPDATE_LOCATION_RES message containing all information fields that shall be inserted into the subscriber record. If -the 'PDP info complete' information element is set in the message, the SGSN +the 'PDP info complete' information element is set in the message, the SGSN or VLR clears existing PDP information fields in the subscriber record first. (see 3GPP TS 09.02, 19.1.1.8) @@ -113,7 +113,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; Peer => SGSN [label="INSERT SUBSCRIBER DATA"]; @@ -127,7 +127,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; Peer => SGSN [label="UPDATE LOCATTION ERROR (Cause)"]; @@ -137,14 +137,14 @@ ==== Location Cancellation Using the Location Cancellation procedure, the Network Peer (HLR) can -request the SGSN to remove a subscriber record. +request the SGSN or VLR to remove a subscriber record. .Cancel Location (Normal Case) ["mscgen"] ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; Peer => SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; SGSN => Peer [label="CANCEL LOCATION RESULT"]; @@ -156,7 +156,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; Peer => SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; SGSN => Peer [label="CANCEL LOCATION ERROR (Cause)"]; @@ -165,8 +165,8 @@ ==== Purge MS -Using the Purge MS procedure, the SGSN can request purging of MS -related state from a previous SGSN during an inter-SGSN location +Using the Purge MS procedure, the SGSN or VLR can request purging of MS +related state from a previous SGSN or VLR during an inter-SGSN / inter-MSC location update. .Purge MS (Normal Case) @@ -174,7 +174,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="PURGE MS REQUEST (IMSI)"]; Peer => SGSN [label="PURGE MS RESULT"]; @@ -184,16 +184,16 @@ ==== Delete Subscriber Data Using the Delete Subscriber Data procedure, the Peer (HLR) can remove -some of the subscriber data from the SGSN. This is used in case the +some of the subscriber data from the SGSN or VLR. This is used in case the subscription details (e.g. PDP Contexts / APNs) change while the -subscriber is registred to that SGSN. +subscriber is registered to that SGSN VLR. .Delete Subscriber Data (Normal Case) ["mscgen"] ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; 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 / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -239,7 +239,7 @@ ==== Send Authentication Info Error -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -251,7 +251,7 @@ ==== Send Authentication Info Response -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -263,7 +263,7 @@ ==== Authentication Failure Report -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -275,7 +275,7 @@ ==== Update Location Request -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -287,7 +287,7 @@ ==== Update Location Error -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -299,7 +299,7 @@ ==== Update Location Result -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -316,7 +316,7 @@ ==== Location Cancellation Request -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -329,7 +329,7 @@ ==== Location Cancellation Result -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -341,7 +341,7 @@ ==== Purge MS Request -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -354,7 +354,7 @@ ==== Purge MS Error -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -366,7 +366,7 @@ ==== Purge MS Result -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -378,7 +378,7 @@ ==== Insert Subscriber Data Request -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -397,7 +397,7 @@ ==== Insert Subscriber Data Error -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -409,7 +409,7 @@ ==== Insert Subscriber Data Result -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -420,7 +420,7 @@ ==== Delete Subscriber Data Request -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -433,7 +433,7 @@ ==== Delete Subscriber Data Error -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -445,7 +445,7 @@ ==== Delete Subscriber Data Result -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -754,7 +754,7 @@ ==== ISDN-AddressString / MSISDN / Called Party BCD Number The MSISDN is encoded as an ISDN-AddressString in 3GPP TS 09.02 and Called Party -BCD Number in 3GPP TS 04.08. It will be stored by the SGSN and then passed as is +BCD Number in 3GPP TS 04.08. It will be stored by the SGSN or VLR and then passed as is to the GGSN during the activation of the primary PDP Context. [packetdiag] @@ -812,7 +812,7 @@ This encodes the ChargingCharacteristics of 3GPP TS 32.215. A HLR may send this as part of the InsertSubscriberData or within a single PDP context definition. If the HLR supplies this information it must be -used by the SGSN when activating a PDP context. +used by the SGSN or VLR when activating a PDP context. [packetdiag] ---- @@ -830,7 +830,7 @@ ==== HLR Number encoded as 3GPP TS 09.02 ISDN-AddressString The HLR Number is encoded as an ISDN-AddressString in 3GPP TS 09.02. It -will be stored by the SGSN can be used by the CDR module to keep a +will be stored by the SGSN or VLR can be used by the CDR module to keep a record. [packetdiag] -- To view, visit https://gerrit.osmocom.org/6093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4b473e324e9314f4e9356a8bae6fbb48dbaaf58c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 10:32:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 10:32:20 +0000 Subject: osmo-gsm-manuals[master]: GSUP: Change wording to cover both SGSN and MSC/VLR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b473e324e9314f4e9356a8bae6fbb48dbaaf58c Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 10:32:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 10:32:23 +0000 Subject: osmo-gsm-manuals[master]: share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f 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 Jan 26 10:37:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 10:37:32 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: GSUP: Change wording to cover both SGSN and MSC/VLR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP: Change wording to cover both SGSN and MSC/VLR ...................................................................... GSUP: Change wording to cover both SGSN and MSC/VLR Change-Id: I4b473e324e9314f4e9356a8bae6fbb48dbaaf58c --- M common/chapters/gsup.adoc 1 file changed, 48 insertions(+), 48 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/common/chapters/gsup.adoc b/common/chapters/gsup.adoc index 733b60e..a231f7a 100644 --- a/common/chapters/gsup.adoc +++ b/common/chapters/gsup.adoc @@ -1,21 +1,21 @@ [[gsup]] -== GPRS Subscriber Update Protocol +== Generic Subscriber Update Protocol === General -This chapter describes the remote protocol that is used by the SGSN to update -and manage the local subscriber list. Functionally, it resembles the -interface between the SGSN on the one hand side, and HLR/AUC on the +This chapter describes the remote protocol that is used by OsmoSGSN and OsmoMSC to update +and manage the local subscriber list in OsmoHLR. Functionally, it resembles the +interface between the SGSN/VLR on the one hand side, and HLR/AUC on the other side. For more information, see the specification of the Gr interface (3GPP TS 03.60). Traditionally, the GSM MAP (Mobile Application Part) protocol is used for this purpose, running on top of a full telecom signalling protocol -stck of MTP2/MTP3/SCCP/TCAP, or any of the SIGTRAN alternatvives. +stack of MTP2/MTP3/SCCP/TCAP, or any of the SIGTRAN alternatives. In order to avoid many of the complexities of MAP, which are difficult -to implement in the plain C language evnironment of the Osmocom +to implement in the plain C language environment of the Osmocom cellular network elements like the SGSN, we introduce the GSUP protocol. @@ -50,20 +50,20 @@ ==== Authentication management -The SGSN sends a SEND_AUTHENTICATION_INFO_REQ message containing the MS's IMSI +The SGSN or VLR sends a SEND_AUTHENTICATION_INFO_REQ message containing the MS's IMSI to the peer. On errors, especially if authentication info is not available for that IMSI, the peer returns a SEND_AUTHENTICATION_INFO_ERR message. Otherwise the peer returns a SEND_AUTHENTICATION_INFO_RES message. If this message -contains at least one authentication tuple, the SGSN replaces all tuples that +contains at least one authentication tuple, the SGSN or VLR replaces all tuples that are assigned to the subscriber. If the message doesn't contain any tuple the -SGSN may reject the Attach Request. (see 3GPP TS 09.02, 25.5.6) +SGSN or VLR may reject the Attach Request. (see 3GPP TS 09.02, 25.5.6) .Send Authentication Info (Normal Case) ["mscgen"] ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; Peer => SGSN [label="SEND AUTHENTICATION INFO RESPONSE (Tuples)"]; @@ -75,7 +75,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="SEND AUTHENTICATION INFO REQUEST (IMSI)"]; Peer => SGSN [label="SEND AUTHENTICATION INFO ERROR (Cause)"]; @@ -84,7 +84,7 @@ ==== Reporting of Authentication Failure -Using this procedure, the SGSN reports authentication failures to the +Using this procedure, the SGSN or VLR reports authentication failures to the HLR. .Authentication Failure Report (Normal Case) @@ -92,7 +92,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="AUTHENTICATION FAILURE REPORT (IMSI)"]; } @@ -100,11 +100,11 @@ ==== Location Updating -The SGSN sends a UPDATE_LOCATION_REQ to the peer. If the request is denied by -the network, the peer returns an UPDATE_LOCATION_ERR message to the SGSN. +The SGSN or VLR sends a UPDATE_LOCATION_REQ to the peer. If the request is denied by +the network, the peer returns an UPDATE_LOCATION_ERR message to the SGSN or VLR. Otherwise the peer returns an UPDATE_LOCATION_RES message containing all information fields that shall be inserted into the subscriber record. If -the 'PDP info complete' information element is set in the message, the SGSN +the 'PDP info complete' information element is set in the message, the SGSN or VLR clears existing PDP information fields in the subscriber record first. (see 3GPP TS 09.02, 19.1.1.8) @@ -113,7 +113,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; Peer => SGSN [label="INSERT SUBSCRIBER DATA"]; @@ -127,7 +127,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="UPDATE LOCATION REQUEST (IMSI)"]; Peer => SGSN [label="UPDATE LOCATTION ERROR (Cause)"]; @@ -137,14 +137,14 @@ ==== Location Cancellation Using the Location Cancellation procedure, the Network Peer (HLR) can -request the SGSN to remove a subscriber record. +request the SGSN or VLR to remove a subscriber record. .Cancel Location (Normal Case) ["mscgen"] ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; Peer => SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; SGSN => Peer [label="CANCEL LOCATION RESULT"]; @@ -156,7 +156,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; Peer => SGSN [label="CANCEL LOCATION REQUEST (IMSI)"]; SGSN => Peer [label="CANCEL LOCATION ERROR (Cause)"]; @@ -165,8 +165,8 @@ ==== Purge MS -Using the Purge MS procedure, the SGSN can request purging of MS -related state from a previous SGSN during an inter-SGSN location +Using the Purge MS procedure, the SGSN or VLR can request purging of MS +related state from a previous SGSN or VLR during an inter-SGSN / inter-MSC location update. .Purge MS (Normal Case) @@ -174,7 +174,7 @@ ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; SGSN => Peer [label="PURGE MS REQUEST (IMSI)"]; Peer => SGSN [label="PURGE MS RESULT"]; @@ -184,16 +184,16 @@ ==== Delete Subscriber Data Using the Delete Subscriber Data procedure, the Peer (HLR) can remove -some of the subscriber data from the SGSN. This is used in case the +some of the subscriber data from the SGSN or VLR. This is used in case the subscription details (e.g. PDP Contexts / APNs) change while the -subscriber is registred to that SGSN. +subscriber is registered to that SGSN VLR. .Delete Subscriber Data (Normal Case) ["mscgen"] ---- msc { hscale="1.5"; - SGSN [label="SGSN"], Peer [label="Network Peer (HLR)"]; + SGSN [label="SGSN/VLR"], Peer [label="Network Peer (HLR)"]; 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 / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -239,7 +239,7 @@ ==== Send Authentication Info Error -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -251,7 +251,7 @@ ==== Send Authentication Info Response -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -263,7 +263,7 @@ ==== Authentication Failure Report -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -275,7 +275,7 @@ ==== Update Location Request -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -287,7 +287,7 @@ ==== Update Location Error -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -299,7 +299,7 @@ ==== Update Location Result -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -316,7 +316,7 @@ ==== Location Cancellation Request -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -329,7 +329,7 @@ ==== Location Cancellation Result -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -341,7 +341,7 @@ ==== Purge MS Request -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -354,7 +354,7 @@ ==== Purge MS Error -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -366,7 +366,7 @@ ==== Purge MS Result -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -378,7 +378,7 @@ ==== Insert Subscriber Data Request -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -397,7 +397,7 @@ ==== Insert Subscriber Data Error -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -409,7 +409,7 @@ ==== Insert Subscriber Data Result -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -420,7 +420,7 @@ ==== Delete Subscriber Data Request -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -433,7 +433,7 @@ ==== Delete Subscriber Data Error -Direction: SGSN => Network peer +Direction: SGSN / VLR => HLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -445,7 +445,7 @@ ==== Delete Subscriber Data Result -Direction: Network peer => SGSN +Direction: HLR => SGSN / VLR [options="header",cols="5%,20%,45%,10%,10%,10%"] |=== @@ -754,7 +754,7 @@ ==== ISDN-AddressString / MSISDN / Called Party BCD Number The MSISDN is encoded as an ISDN-AddressString in 3GPP TS 09.02 and Called Party -BCD Number in 3GPP TS 04.08. It will be stored by the SGSN and then passed as is +BCD Number in 3GPP TS 04.08. It will be stored by the SGSN or VLR and then passed as is to the GGSN during the activation of the primary PDP Context. [packetdiag] @@ -812,7 +812,7 @@ This encodes the ChargingCharacteristics of 3GPP TS 32.215. A HLR may send this as part of the InsertSubscriberData or within a single PDP context definition. If the HLR supplies this information it must be -used by the SGSN when activating a PDP context. +used by the SGSN or VLR when activating a PDP context. [packetdiag] ---- @@ -830,7 +830,7 @@ ==== HLR Number encoded as 3GPP TS 09.02 ISDN-AddressString The HLR Number is encoded as an ISDN-AddressString in 3GPP TS 09.02. It -will be stored by the SGSN can be used by the CDR module to keep a +will be stored by the SGSN or VLR can be used by the CDR module to keep a record. [packetdiag] -- To view, visit https://gerrit.osmocom.org/6093 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4b473e324e9314f4e9356a8bae6fbb48dbaaf58c Gerrit-PatchSet: 1 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 Jan 26 10:37:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 10:37:32 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR ...................................................................... share chapters/gsup.adoc from OsmoSGSN to OsmoMSC + OsmoHLR Since the NITB split, GSUP is used in all three network elements, so make the protocol a shared chapter Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f --- M OsmoHLR/osmohlr-usermanual.adoc M OsmoMSC/osmomsc-usermanual.adoc M OsmoSGSN/osmosgsn-usermanual.adoc R common/chapters/gsup.adoc 4 files changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoHLR/osmohlr-usermanual.adoc b/OsmoHLR/osmohlr-usermanual.adoc index 2369155..043c971 100644 --- a/OsmoHLR/osmohlr-usermanual.adoc +++ b/OsmoHLR/osmohlr-usermanual.adoc @@ -22,6 +22,8 @@ include::../common/chapters/control_if.adoc[] +include::../common/chapters/gsup.adoc[] + include::../common/chapters/port_numbers.adoc[] include::../common/chapters/bibliography.adoc[] diff --git a/OsmoMSC/osmomsc-usermanual.adoc b/OsmoMSC/osmomsc-usermanual.adoc index 6190481..ac68d93 100644 --- a/OsmoMSC/osmomsc-usermanual.adoc +++ b/OsmoMSC/osmomsc-usermanual.adoc @@ -28,6 +28,8 @@ include::../common/chapters/control_if.adoc[] +include::../common/chapters/gsup.adoc[] + include::../common/chapters/port_numbers.adoc[] include::../common/chapters/bibliography.adoc[] diff --git a/OsmoSGSN/osmosgsn-usermanual.adoc b/OsmoSGSN/osmosgsn-usermanual.adoc index a6a7709..079e811 100644 --- a/OsmoSGSN/osmosgsn-usermanual.adoc +++ b/OsmoSGSN/osmosgsn-usermanual.adoc @@ -25,7 +25,7 @@ include::../common/chapters/oap.adoc[] -include::chapters/gsup.adoc[] +include::../common/chapters/gsup.adoc[] include::chapters/counters.adoc[] diff --git a/OsmoSGSN/chapters/gsup.adoc b/common/chapters/gsup.adoc similarity index 100% rename from OsmoSGSN/chapters/gsup.adoc rename to common/chapters/gsup.adoc -- To view, visit https://gerrit.osmocom.org/6092 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2d7c27ef16eb0ebe5f60d625a1fcf42f1603f4f Gerrit-PatchSet: 1 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 Jan 26 10:53:44 2018 From: gerrit-no-reply at lists.osmocom.org (Viktor Tsymbalyuk) Date: Fri, 26 Jan 2018 10:53:44 +0000 Subject: [PATCH] osmo-ggsn[master]: Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add suppor... Message-ID: Review at https://gerrit.osmocom.org/6094 Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add support for IPv4v6 End User Addresses") Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 --- M sgsnemu/sgsnemu.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/94/6094/1 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index bb55b1c..630733b 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1400,7 +1400,7 @@ return EOF; /* Not what we expected */ } - if (in46a_from_eua(&pdp->eua, &addr)) { + if (in46a_from_eua(&pdp->eua, &addr) < 1) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:07:49 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:07:49 +0000 Subject: osmo-ggsn[master]: Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add suppor... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Could you perhaps elaborate - what exactly is fixed? I mean what kind of error was there which is eliminated by this patch? Would be nice to have this clarification as part of commit message. -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:35:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 11:35:38 +0000 Subject: osmo-ggsn[master]: Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add suppor... In-Reply-To: References: Message-ID: Patch Set 1: Hi Viktor, thanks for submitting. The fixes line should go at the end of the description. Usually The commit should have the following format: (you can rework it with git commit --amend) #### sgsnemu: Here's the first line (title) giving summary of the change [blank line here to separate title from description] Here goes a description explaining how did you find and how does this commit fix the issue you encountered. Afterwards, add the "Fixes" line you are provided. At the end, leave the Change-Id line, that gerrit uses to identify the commit with this web UI thread. -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:42:50 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 26 Jan 2018 11:42:50 +0000 Subject: [PATCH] osmo-bts[master]: fix nullpointer deref in rsl_tx_mode_modif_nack() Message-ID: Review at https://gerrit.osmocom.org/6096 fix nullpointer deref in rsl_tx_mode_modif_nack() The function rsl_tx_mode_modif_nack() uses abis_bts_rsl_sendmsg(). This function relys on msg->trx to be set (see abis.c). However, rsl_tx_mode_modif_nack() creates the message buffer, but does not set msg->trx. - Make sure that msg->trx is set properly Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a --- M src/common/rsl.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/96/6096/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 1f45cc6..3d0993c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1248,6 +1248,7 @@ msgb_tlv_put(msg, RSL_IE_CAUSE, 1, &cause); rsl_dch_push_hdr(msg, RSL_MT_MODE_MODIFY_NACK, chan_nr); msg->lchan = lchan; + msg->trx = lchan->ts->trx; return abis_bts_rsl_sendmsg(msg); } -- To view, visit https://gerrit.osmocom.org/6096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:42:48 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 26 Jan 2018 11:42:48 +0000 Subject: [PATCH] osmo-bts[master]: rsl: fix double-free in rsl_rx_mode_modif() Message-ID: Review at https://gerrit.osmocom.org/6095 rsl: fix double-free in rsl_rx_mode_modif() When the RSL_IE_CHAN_MODE is is missing, then the message buffer is freed and the channel mode modify is nacked using return rsl_tx_mode_modif_nack() The function rsl_tx_mode_modif_nack uses abis_bts_rsl_sendmsg() which returns 0 on success. This eventually leads into a double- free in rsl_rx_dchan() which frees the message buffer on all return codes except 1. - Remove the excess msgb_free() in the error handling path. Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6 --- M src/common/rsl.c 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/95/6095/1 diff --git a/src/common/rsl.c b/src/common/rsl.c index 88e240a..1f45cc6 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1283,7 +1283,6 @@ /* 9.3.6 Channel Mode */ if (!TLVP_PRESENT(&tp, RSL_IE_CHAN_MODE)) { LOGP(DRSL, LOGL_NOTICE, "missing Channel Mode\n"); - msgb_free(msg); return rsl_tx_mode_modif_nack(lchan, RSL_ERR_MAND_IE_ERROR); } cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE); -- To view, visit https://gerrit.osmocom.org/6095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:42:51 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 26 Jan 2018 11:42:51 +0000 Subject: [PATCH] osmo-bts[master]: rsl: do not allow MODE MODIFY request with unsupp. codec/rate Message-ID: Review at https://gerrit.osmocom.org/6097 rsl: do not allow MODE MODIFY request with unsupp. codec/rate When the BSC sends a MODE MODIFY request with an unsupported codec, the BTS must respond with a negative acknowledge. Currently the codec parameter is not checked at all, which may lead into malfunction or crash of the BTS. - Introduce a mechanism to check the codec/rate against a table that is set up in the phy specific code. - Add tables with supported codec/rate combinations for octphy, sysmobts, and trx. Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 Related: SYS#3212 --- M include/osmo-bts/bts.h M include/osmo-bts/gsm_data.h M src/common/bts.c M src/common/rsl.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/main.c M src/osmo-bts-trx/main.c M tests/misc/misc_test.c 8 files changed, 106 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/97/6097/1 diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index 9e16e05..2f63e37 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -45,5 +45,8 @@ int bts_main(int argc, char **argv); +int bts_supports_cm(struct gsm_bts_role_bts *bts, + enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm); + #endif /* _BTS_H */ diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index dcffcf6..853b445 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -33,6 +33,11 @@ struct pcu_sock_state *pcu_state; }; +struct bts_cm { + enum gsm_phys_chan_config pchan; + enum gsm48_chan_mode cm; +}; + /* data structure for BTS related data specific to the BTS role */ struct gsm_bts_role_bts { struct { @@ -89,6 +94,7 @@ bool rtp_jitter_adaptive; struct { uint8_t ciphers; /* flags A5/1==0x1, A5/2==0x2, A5/3==0x4 */ + const struct bts_cm *cm; /* Table with supp. ch rate/mode combinations */ } support; struct { uint8_t tc4_ctr; @@ -146,4 +152,6 @@ bool ts_is_pdch(const struct gsm_bts_trx_ts *ts); +int bts_model_check_cm_mode(enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm); + #endif /* _GSM_DATA_H */ diff --git a/src/common/bts.c b/src/common/bts.c index 6747f50..31afba4 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -675,3 +675,33 @@ return &btsb->gsm_time; } + +int bts_supports_cm(struct gsm_bts_role_bts *bts, + enum gsm_phys_chan_config pchan, enum gsm48_chan_mode cm) +{ + const struct bts_cm *supported; + int i; + + supported = bts->support.cm; + + /* Check if we got a list with supported codec, if not, no list has + * been configured yet for that BTS. In that case we will just skip + * and accept any combination */ + if (supported == NULL) + return 1; + + for (i = 0;; i++) { + /* If we manage to find the given combination in the list, + * we know that the pchan/cm combination is supported */ + if (supported[i].pchan == pchan && supported[i].cm == cm) + return 1; + + /* When we hit the terminator, we know that the given + * pchan/cm combination is not supported because it + * is not in the list. */ + if (supported[i].pchan == _GSM_PCHAN_MAX) + return 0; + } + + return 0; +} diff --git a/src/common/rsl.c b/src/common/rsl.c index 3d0993c..2eb0db1 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1278,6 +1278,7 @@ struct gsm_lchan *lchan = msg->lchan; struct rsl_ie_chan_mode *cm; struct tlv_parsed tp; + struct gsm_bts_role_bts *btsb = bts_role_bts(lchan->ts->trx->bts); rsl_tlv_parse(&tp, msgb_l3(msg), msgb_l3len(msg)); @@ -1289,6 +1290,11 @@ cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE); lchan_tchmode_from_cmode(lchan, cm); + if (bts_supports_cm(btsb, lchan->ts->pchan, lchan->tch_mode) != 1) { + LOGP(DRSL, LOGL_ERROR, "invalid mode/codec instructed by BSC, check BSC configuration.\n"); + return rsl_tx_mode_modif_nack(lchan, RSL_ERR_SERV_OPT_UNAVAIL); + } + /* 9.3.7 Encryption Information */ if (TLVP_PRESENT(&tp, RSL_IE_ENCR_INFO)) { uint8_t len = TLVP_LEN(&tp, RSL_IE_ENCR_INFO); diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index fce3484..dde993d 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -76,6 +76,14 @@ /* timeout until which we expect PHY to respond */ #define CMD_TIMEOUT 5 +/* Table with channel rate / and codec configuration that are supported + * by the hardware bts_supports_cm() */ +static const struct bts_cm bts_model_supported_cm[] = { + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1}, + { GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1}, + { _GSM_PCHAN_MAX, 0 } +}; + /* allocate a msgb for a Layer1 primitive */ struct msgb *l1p_msgb_alloc(void) { @@ -776,6 +784,7 @@ bts->variant = BTS_OSMO_OCTPHY; btsb = bts_role_bts(bts); btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + btsb->support.cm = bts_model_supported_cm; /* FIXME: what is the nominal transmit power of the PHY/board? */ bts->c0->nominal_power = 15; diff --git a/src/osmo-bts-sysmo/main.c b/src/osmo-bts-sysmo/main.c index ce12d63..f52ecdd 100644 --- a/src/osmo-bts-sysmo/main.c +++ b/src/osmo-bts-sysmo/main.c @@ -55,6 +55,17 @@ #include "hw_misc.h" #include "oml_router.h" +/* Table with channel rate / and codec configuration that are supported + * by the hardware bts_supports_cm() */ +static const struct bts_cm bts_model_supported_cm[] = { + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1}, + { GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1}, + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR}, + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR}, + { GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR}, + { _GSM_PCHAN_MAX, 0 } +}; + int bts_model_init(struct gsm_bts *bts) { struct gsm_bts_role_bts *btsb; @@ -65,6 +76,7 @@ bts->variant = BTS_OSMO_SYSMO; btsb = bts_role_bts(bts); btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2) | CIPHER_A5(3); + btsb->support.cm = bts_model_supported_cm; rc = oml_router_init(bts, OML_ROUTER_PATH, &accept_fd, &read_fd); if (rc < 0) { diff --git a/src/osmo-bts-trx/main.c b/src/osmo-bts-trx/main.c index a1eb686..973a611 100644 --- a/src/osmo-bts-trx/main.c +++ b/src/osmo-bts-trx/main.c @@ -59,6 +59,17 @@ #include "l1_if.h" #include "trx_if.h" +/* Table with channel rate / and codec configuration that are supported + * by the hardware bts_supports_cm() */ +static const struct bts_cm bts_model_supported_cm[] = { + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1}, + { GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1}, + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR}, + { GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR}, + { GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR}, + { _GSM_PCHAN_MAX, 0 } +}; + /* dummy, since no direct dsp support */ uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx) { @@ -101,6 +112,7 @@ bts->variant = BTS_OSMO_TRX; btsb->support.ciphers = CIPHER_A5(1) | CIPHER_A5(2); + btsb->support.cm = bts_model_supported_cm; /* FIXME: this needs to be overridden with the real hardrware * value */ diff --git a/tests/misc/misc_test.c b/tests/misc/misc_test.c index c2918fb..00744a6 100644 --- a/tests/misc/misc_test.c +++ b/tests/misc/misc_test.c @@ -157,6 +157,31 @@ } } +static const struct bts_cm bts_model_supported_cm[] = { + {GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1}, + {GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1}, + {GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR}, + {GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR}, + {_GSM_PCHAN_MAX, 0} +}; + +static void test_bts_supports_cm(void) +{ + struct gsm_bts_role_bts bts; + bts.support.cm = bts_model_supported_cm; + + OSMO_ASSERT(bts_supports_cm + (&bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_V1) == 1); + OSMO_ASSERT(bts_supports_cm + (&bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_V1) == 1); + OSMO_ASSERT(bts_supports_cm + (&bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_EFR) == 0); + OSMO_ASSERT(bts_supports_cm + (&bts, GSM_PCHAN_TCH_F, GSM48_CMODE_SPEECH_AMR) == 1); + OSMO_ASSERT(bts_supports_cm + (&bts, GSM_PCHAN_TCH_H, GSM48_CMODE_SPEECH_AMR) == 1); +} + int main(int argc, char **argv) { bts_log_init(NULL); @@ -164,5 +189,6 @@ test_sacch_get(); test_msg_utils_ipa(); test_msg_utils_oml(); + test_bts_supports_cm(); return EXIT_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/6097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust function signatures 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/3912 to look at the new patch set (#7). Simplify TS alloc: adjust function signatures * document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp 3 files changed, 61 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/3912/7 diff --git a/src/bts.cpp b/src/bts.cpp index e236f93..1669739 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -456,10 +456,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; diff --git a/src/bts.h b/src/bts.h index 34326b8..5679b98 100644 --- a/src/bts.h +++ b/src/bts.h @@ -364,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0e8b785..e394a6e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -58,7 +58,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -76,13 +76,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == NO_FREE_TFI) return -1; @@ -95,16 +93,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -142,22 +139,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -172,11 +166,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -185,7 +187,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -255,30 +257,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -289,9 +284,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -308,32 +303,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -380,7 +384,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -448,6 +452,14 @@ return 0; } +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] mslot_class The multislot class + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -681,7 +693,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -751,14 +763,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -786,7 +797,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -986,7 +997,7 @@ /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split off RX mask computation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3913 to look at the new patch set (#7). Simplify TS alloc: split off RX mask computation Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 53 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/7 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 4c96e9a..c9c9d8f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -568,6 +568,49 @@ return (win | win >> 8) & 0xFF; } +enum { MASK_TT, MASK_TR }; + +/*! Fill in RX mask table for a given MS Class + * + * \param[in] ms_cl MS Class pointer + * \param[in] num_tx Number of TX slots to consider + * \param[out] rx_mask RX mask table + */ +static inline void fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask) +{ + static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; + uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ + Sum = mslot_class_get_sum(mslot_class), /* Max number of Tx + Rx slots */ + Type = mslot_class_get_type(mslot_class), /* Type of Mobile */ + Tta = mslot_class_get_ta(mslot_class), /* Minimum number of slots */ + Ttb = mslot_class_get_tb(mslot_class), + /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly + see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ + Tra = mslot_class_get_ra(mslot_class, 0), + Trb = mslot_class_get_rb(mslot_class, 0); + + if (num_tx == 1) /* it's enough to log this once per TX slot set iteration */ + LOGP(DRLCMAC, LOGL_DEBUG, + "Rx=%d Tx=%d Sum Rx+Tx=%s, Tta=%s Ttb=%d, Tra=%d Trb=%d, Type=%d\n", + mslot_class_get_rx(mslot_class), Tx, + (Sum == MS_NA) ? "N/A" : digit[Sum], + (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); + + if (Type == 1) { + rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; + rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); + rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + } else { + /* Class type 2 MS have independant RX and TX */ + rx_mask[MASK_TT] = 0xff; + rx_mask[MASK_TR] = 0xff; + } + + rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); + rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -578,44 +621,24 @@ */ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { - uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ - uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ - uint8_t Type; /* Type of Mobile */ + uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ + Sum = mslot_class_get_sum(mslot_class); /* Max number of Tx + Rx slots */ uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; int16_t rx_window, tx_window; - static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; - enum {MASK_TT, MASK_TR}; + int max_capacity = -1; + uint8_t max_ul_slots = 0; + uint8_t max_dl_slots = 0; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", mslot_class); - - Tx = mslot_class_get_tx(mslot_class); - Sum = mslot_class_get_sum(mslot_class); - Tta = mslot_class_get_ta(mslot_class); - Ttb = mslot_class_get_tb(mslot_class); - - /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly - see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ - Tra = mslot_class_get_ra(mslot_class, 0); - Trb = mslot_class_get_rb(mslot_class, 0); - - Type = mslot_class_get_type(mslot_class); if (Tx == MS_NA) { LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not applicable.\n", mslot_class); return -EINVAL; } - - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", mslot_class_get_rx(mslot_class), Tx, - (Sum == MS_NA) ? "N/A" : digit[Sum], - (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); max_slots = OSMO_MAX(mslot_class_get_rx(mslot_class), Tx); @@ -636,29 +659,12 @@ /* Check for each UL (TX) slot */ - max_capacity = -1; - max_ul_slots = 0; - max_dl_slots = 0; - /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= mslot_class_get_tx(mslot_class); num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; + uint8_t rx_mask[MASK_TR + 1]; - uint8_t rx_mask[MASK_TR+1]; - if (Type == 1) { - rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; - rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); - rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); - } else { - /* Class type 2 MS have independant RX and TX */ - rx_mask[MASK_TT] = 0xff; - rx_mask[MASK_TR] = 0xff; - } - - rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); - rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); + fill_rx_mask(mslot_class, num_tx, rx_mask); /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 0e17ced..98ec04b 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3011,12 +3011,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -3050,12 +3050,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -5898,12 +5898,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 11 -- Rx=4 Tx=3 Sum Rx+Tx=5 Tta=3 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3920 to look at the new patch set (#9). Simplify TS alloc: use defines for constants * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/20/3920/9 diff --git a/src/bts.cpp b/src/bts.cpp index d652c59..e236f93 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,7 +475,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index 8d3a3cc..34326b8 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c246676..0e8b785 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -83,7 +83,7 @@ int8_t tfi; tfi_map = pdch->assigned_tfi(dir); - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -164,7 +164,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -295,10 +295,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 6e344dc..1c98e46 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -585,17 +585,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: internalize TRX 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/3760 to look at the new patch set (#19). Simplify TS alloc: internalize TRX check Move TRX check inside local tfi_find_free() wrapper to make main algorithm easier to follow. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 10 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/60/3760/19 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e394a6e..c45aa39 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -329,7 +329,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -341,6 +341,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -785,16 +794,6 @@ ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 19 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: fix allocation calls In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4084 to look at the new patch set (#3). Simplify TS alloc: fix allocation calls Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#2282 --- M src/bts.cpp M src/tbf.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 4 files changed, 26 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/84/4084/3 diff --git a/src/bts.cpp b/src/bts.cpp index 94354f2..d652c59 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -749,7 +749,7 @@ // Create new TBF /* FIXME: Copy and paste with other routines.. */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " diff --git a/src/tbf.cpp b/src/tbf.cpp index ea3ffe3..8cfca3a 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -403,7 +403,8 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, + false); if (!tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -1350,7 +1351,7 @@ new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1aa3f63..6e344dc 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -213,7 +213,7 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); if (!ul_tbf) return false; @@ -223,7 +223,8 @@ dump_assignment(ul_tbf, "UL", verbose); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, + false); if (!dl_tbf) return false; @@ -254,7 +255,7 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); if (!dl_tbf) return false; @@ -265,7 +266,8 @@ dump_assignment(dl_tbf, "DL", verbose); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, + false); if (!ul_tbf) return false; @@ -305,7 +307,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); if (!ul_tbf) return false; @@ -315,7 +317,8 @@ dump_assignment(ul_tbf, "UL", true); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, + false); if (!dl_tbf) return false; @@ -466,7 +469,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -475,7 +478,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -755,7 +758,8 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -765,7 +769,8 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index aa1d7ac..fbed45a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -83,14 +83,14 @@ */ gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -172,7 +172,8 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, + true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2212,7 +2213,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2226,7 +2227,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2270,7 +2271,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/4084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43c76cb49093b40eb854d324e898e821270053dc 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 Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: avoid TS reassignment In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4085 to look at the new patch set (#3). Simplify TS alloc: avoid TS reassignment Assign reserved_*_slots only when multislot masks are found to avoid reassignment and make code easier to follow. Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/85/4085/3 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index cd82ca7..c246676 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -770,8 +770,8 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); @@ -800,11 +800,11 @@ rc = find_multi_slots(trx, ms->ms_class(), &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/4085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 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 Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: improve readability In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4086 to look at the new patch set (#2). Simplify TS alloc: improve readability * consistently format log messages to make it possible to grep for test output in source code * remove dead code Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 6 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/4086/2 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c9c9d8f..b38a8ed 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -205,8 +205,7 @@ tfi = find_free_tfi(pdch, dir); if (tfi < 0) { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -215,25 +214,22 @@ usf = find_free_usf(pdch); if (usf < 0) { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -715,19 +711,6 @@ /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); - -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); -#endif if (capacity <= max_capacity) continue; -- To view, visit https://gerrit.osmocom.org/4086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb 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 Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: expand tests log 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/3895 to look at the new patch set (#19). TS alloc: expand tests log * restructure code for easier reading * use consistent formatting for output * log essential allocation parameters on failure Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 3 files changed, 192 insertions(+), 184 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/19 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b38a8ed..2fb5175 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -387,13 +387,14 @@ const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx = ms->current_trx(); - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " - "%d\n", tbf->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class %d [%s]\n", + tbf->ms_class(), (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted) for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return trx_no; } if (!trx) @@ -421,14 +422,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } @@ -880,7 +883,7 @@ LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); } - LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7), %s\n", slot_info, single ? "single" : "multi"); return sl; } @@ -968,7 +971,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): failed to allocate a TFI for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return tfi; } @@ -1012,23 +1016,27 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first common slots available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } + if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first slot available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 562135d..b514b78 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -193,7 +193,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -305,7 +305,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -713,7 +713,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 10 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -931,7 +931,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -189959,7 +189959,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190155,7 +190155,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=12/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190351,7 +190351,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=12/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190547,7 +190547,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=9/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190743,7 +190743,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190939,7 +190939,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 @@ -190961,7 +190961,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -191176,7 +191176,7 @@ TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -191373,7 +191373,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -191569,11 +191569,11 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=10/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -192701,7 +192701,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -192932,7 +192932,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 @@ -193164,7 +193164,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -193666,7 +193666,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -193916,7 +193916,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194148,7 +194148,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194380,7 +194380,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194390,7 +194390,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194400,7 +194400,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194410,8 +194410,8 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = f0 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -194519,7 +194519,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194619,7 +194619,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194719,26 +194719,26 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -195225,7 +195225,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195325,7 +195325,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195425,7 +195425,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). @@ -195702,7 +195702,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -196829,7 +196829,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -196937,7 +196937,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0xc0000022 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 35 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -198415,7 +198415,7 @@ TBF(TFI=0 TLLI=0xc000009f DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -199218,7 +199218,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -199450,7 +199450,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 @@ -199845,7 +199845,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously 32) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free @@ -200010,7 +200010,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200242,7 +200242,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 40 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -200696,7 +200696,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=44/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 89 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200771,7 +200771,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0xc0000017 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=25/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 24 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -202026,7 +202026,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -202829,7 +202829,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating DL TBF: MS_CLASS=11/11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 98ec04b..a48487d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1,7 +1,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 4, because not enabled @@ -18,7 +18,7 @@ Modifying MS object, TLLI = 0x00002342, TA 220 -> 4 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 3, because need to reuse TS @@ -41,7 +41,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -90,7 +90,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -128,7 +128,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -177,7 +177,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -215,7 +215,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -468,7 +468,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -490,7 +490,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -531,7 +531,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -556,7 +556,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -581,7 +581,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -606,7 +606,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -631,7 +631,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -656,7 +656,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -681,7 +681,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -706,7 +706,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -731,7 +731,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -756,7 +756,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -781,7 +781,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -806,7 +806,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -831,7 +831,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -856,7 +856,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -881,7 +881,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -906,7 +906,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -931,7 +931,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -956,7 +956,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -981,7 +981,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1006,7 +1006,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1031,7 +1031,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1056,7 +1056,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1081,7 +1081,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1106,7 +1106,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1131,7 +1131,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1156,7 +1156,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1181,7 +1181,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1206,7 +1206,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1231,7 +1231,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1256,7 +1256,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1281,7 +1281,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1306,7 +1306,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1331,15 +1331,15 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +Slot Allocation (Algorithm A) for class 45 [DL] +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1369,7 +1369,7 @@ ********** DL-TBF ends here ********** ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1427,7 +1427,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1470,7 +1470,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1505,7 +1505,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1549,7 +1549,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1584,7 +1584,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1627,7 +1627,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1713,7 +1713,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1778,7 +1778,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1821,7 +1821,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1870,7 +1870,7 @@ MS requests UL TBF in packet resource request of single block, so we provide one: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1901,7 +1901,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1943,7 +1943,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1986,7 +1986,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2022,7 +2022,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2087,7 +2087,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2130,7 +2130,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2763,7 +2763,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3017,8 +3017,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3056,8 +3056,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3099,7 +3099,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3148,7 +3148,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3188,7 +3188,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3367,7 +3367,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3398,7 +3398,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3704,7 +3704,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3960,7 +3960,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4178,7 +4178,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4364,7 +4364,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4530,7 +4530,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4678,7 +4678,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4821,7 +4821,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4953,7 +4953,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5085,7 +5085,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5140,7 +5140,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5195,7 +5195,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5250,7 +5250,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5321,7 +5321,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5392,7 +5392,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5463,7 +5463,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5534,7 +5534,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5596,7 +5596,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5658,7 +5658,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5720,7 +5720,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5798,7 +5798,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5866,7 +5866,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5905,7 +5905,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -5919,8 +5919,8 @@ PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Searching for first unallocated TFI: TRX=0 Found TFI=0. -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -5958,7 +5958,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6020,7 +6020,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6051,7 +6051,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6087,7 +6087,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6111,7 +6111,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6135,7 +6135,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6159,7 +6159,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6183,7 +6183,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6207,7 +6207,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6231,7 +6231,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6255,7 +6255,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6264,7 +6264,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Destroying MS object, TLLI = 0x00000000 MS requests UL TBF on RACH, so we provide one: ra=0x70 Fn=2654167 qta=31 is_11bit=0: @@ -6288,7 +6288,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6906,7 +6906,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7678,7 +7678,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7700,7 +7700,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7724,7 +7724,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7748,7 +7748,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7772,7 +7772,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7796,7 +7796,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7820,7 +7820,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7844,7 +7844,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7874,7 +7874,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7883,7 +7883,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 19 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 Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: print suggested TRX on allocation errors In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3931 to look at the new patch set (#6). TS alloc: print suggested TRX on allocation errors If TS allocation fails due to unavailable TFI, print TRX which was suggested to allocator. This simplifies allocator debugging but requires cosmetic modifications to test output. Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Related: OS#2282 --- M src/bts.cpp M tests/alloc/AllocTest.err 2 files changed, 825 insertions(+), 825 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/31/3931/6 -- To view, visit https://gerrit.osmocom.org/3931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3932 to look at the new patch set (#6). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.ok 2 files changed, 2,163 insertions(+), 2,163 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/3932/6 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1c98e46..6ea8ff4 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -595,24 +596,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves " OSMO_BIT_SPEC " [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index d2d9be1..e950700 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -13181,2201 +13181,2201 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=44 Mass test: TS0(OOOOOOOO)TS7 MS_Class=45 Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL) Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DDC - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DDC.. - TBF[7] class 10 reserves .....DDC - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DDC.. - TBF[11] class 10 reserves .....DDC - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DDC.. - TBF[15] class 10 reserves .....DDC - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DDC.. - TBF[19] class 10 reserves .....DDC - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DDC.. - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DDCD. - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves .....DDC - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL) Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) - TBF[0] class 12 reserves ...DDCD. - TBF[1] class 12 reserves .....DCD - TBF[2] class 12 reserves ...DCD.. - TBF[3] class 12 reserves .....DDC - TBF[4] class 12 reserves ...DCD.. - TBF[5] class 12 reserves .....DCD - TBF[6] class 12 reserves ...DDC.. - TBF[7] class 12 reserves .....DDC - TBF[8] class 12 reserves ...DCD.. - TBF[9] class 12 reserves .....DCD - TBF[10] class 12 reserves ...DDC.. - TBF[11] class 12 reserves .....DDC - TBF[12] class 12 reserves ...DCD.. - TBF[13] class 12 reserves .....DCD - TBF[14] class 12 reserves ...DDC.. - TBF[15] class 12 reserves .....DDC - TBF[16] class 12 reserves ...DCD.. - TBF[17] class 12 reserves .....DCD - TBF[18] class 12 reserves ...DDC.. - TBF[19] class 12 reserves .....DDC - TBF[20] class 12 reserves ...DCD.. - TBF[21] class 12 reserves .....DCD - TBF[22] class 12 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 12 reserves ...DCD.. - TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...DDCD. - TBF[27] class 12 reserves ...CD... - TBF[28] class 12 reserves .....DDC - TBF[29] class 12 reserves ...CD... - TBF[30] class 12 reserves ...CD... - TBF[31] class 12 reserves ...CD... + TBF[ 0] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 12 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL) Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 1 reserves ...C.... - TBF[13] class 2 reserves ......DC - TBF[14] class 3 reserves ...DC... - TBF[15] class 4 reserves ....DCD. - TBF[16] class 5 reserves ......CD - TBF[17] class 6 reserves ...CD... - TBF[18] class 7 reserves ......DC - TBF[19] class 8 reserves ...DDCD. - TBF[20] class 9 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 11 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 1 reserves ...C.... - TBF[25] class 2 reserves ......DC - TBF[26] class 3 reserves ...DC... - TBF[27] class 4 reserves .....DCD - TBF[28] class 5 reserves ...CD... - TBF[29] class 6 reserves ......CD - TBF[30] class 7 reserves ...CD... - TBF[31] class 8 reserves ...DDCD. + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[14] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[15] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[16] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[17] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[18] class 7 reserves ......DC [ 1 / 2 / 0 ] + TBF[19] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 11 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[26] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[27] class 4 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 6 reserves ......CD [ 1 / 2 / 0 ] + TBF[30] class 7 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL) Going to test assignment with many TBF, algorithm B class 1..46 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDDC + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDDC [ 1 / 4 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 1..46 (UL and DL) Going to test assignment with many TBF, algorithm dynamic class 1..46 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDDC - TBF[1] class 33 reserves ...C.... - TBF[2] class 34 reserves ...C.... - TBF[3] class 35 reserves ...C.... + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDDC [ 1 / 4 / 0 ] + TBF[ 1] class 33 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 35 reserves ...C.... [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 1..46 (UL and DL) Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL) Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL) Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL) Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[2] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[4] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[14] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[27] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[16] class 10 reserves ......C. - TBF[26] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[18] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[31] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[20] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[22] class 10 reserves ......C. - TBF[25] class 10 reserves ....C... - TBF[24] class 10 reserves ......C. - TBF[27] class 10 reserves ....C... - TBF[26] class 10 reserves ......C. - TBF[29] class 10 reserves ....C... - TBF[28] class 10 reserves ......C. - TBF[31] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL) Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL) Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL) Going to test assignment with many TBF, algorithm A class 1..1 (UL only) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only) Going to test assignment with many TBF, algorithm B class 10..10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only) Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only) Going to test assignment with many TBF, algorithm A class 1..1 (DL only) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only) Going to test assignment with many TBF, algorithm B class 10..10 (DL only) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[2] class 10 reserves ......C. - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[4] class 10 reserves ......C. - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[22] class 10 reserves .....C.. - TBF[14] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[24] class 10 reserves .....C.. - TBF[16] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[25] class 10 reserves .....C.. - TBF[18] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[27] class 10 reserves .....C.. - TBF[20] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[26] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[30] class 10 reserves .....C.. - TBF[22] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[28] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[31] class 10 reserves .....C.. - TBF[24] class 10 reserves ......C. - TBF[25] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[25] class 10 reserves ......C. - TBF[27] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[27] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[26] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[29] class 10 reserves ....C... - TBF[31] class 10 reserves ......C. - TBF[31] class 10 reserves .......C + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only) Going to test assignment with many connections, algorithm A - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 1 reserves .......C - TBF[1] class 2 reserves ......DC - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...CD... - TBF[28] class 29 reserves ...DCD.. - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 29 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[5] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[6] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[8] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[19] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[21] class 17 reserves .......C - TBF[18] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[18] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[23] class 22 reserves .......C - TBF[20] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[20] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[22] class 28 reserves ...C.... - TBF[22] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[27] class 31 reserves .......C - TBF[24] class 32 reserves ...C.... - TBF[24] class 33 reserves ....C... - TBF[21] class 34 reserves ......C. - TBF[30] class 35 reserves .......C - TBF[26] class 36 reserves ...C.... - TBF[26] class 37 reserves ....C... - TBF[23] class 38 reserves ......C. - TBF[28] class 39 reserves ...C.... - TBF[28] class 40 reserves ....C... - TBF[25] class 41 reserves ......C. - TBF[31] class 42 reserves ...C.... - TBF[27] class 43 reserves ......C. - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[17] class 30 reserves ......C. - TBF[6] class 31 reserves .....C.. - TBF[18] class 32 reserves ......C. - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[4] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[5] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[6] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[7] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[8] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[9] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[10] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[15] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[11] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[16] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[12] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[13] class 31 reserves .......C - TBF[18] class 32 reserves ...C.... - TBF[18] class 33 reserves ....C... - TBF[20] class 34 reserves ......C. - TBF[14] class 35 reserves .......C - TBF[19] class 36 reserves ...C.... - TBF[19] class 37 reserves ....C... - TBF[21] class 38 reserves ......C. - TBF[20] class 39 reserves ...C.... - TBF[20] class 40 reserves ....C... - TBF[22] class 41 reserves ......C. - TBF[21] class 42 reserves ...C.... - TBF[23] class 43 reserves ......C. - TBF[7] class 44 reserves .....C.. - TBF[8] class 45 reserves .....C.. - TBF[9] class 46 reserves .....C.. - TBF[10] class 1 reserves .....C.. - TBF[11] class 2 reserves .....C.. - TBF[12] class 3 reserves .....C.. - TBF[13] class 4 reserves .....C.. - TBF[14] class 5 reserves .....C.. - TBF[15] class 6 reserves .....C.. - TBF[15] class 7 reserves .......C - TBF[16] class 8 reserves .....C.. - TBF[16] class 9 reserves .......C - TBF[17] class 10 reserves .....C.. - TBF[17] class 11 reserves .......C - TBF[18] class 12 reserves .....C.. - TBF[18] class 13 reserves .......C - TBF[19] class 14 reserves .....C.. - TBF[19] class 15 reserves .......C - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves .......C - TBF[21] class 18 reserves ....C... - TBF[21] class 19 reserves .....C.. - TBF[21] class 20 reserves .......C - TBF[22] class 21 reserves ...C.... - TBF[22] class 22 reserves ....C... - TBF[22] class 23 reserves .....C.. - TBF[22] class 24 reserves .......C - TBF[23] class 25 reserves ...C.... - TBF[23] class 26 reserves ....C... - TBF[23] class 27 reserves .....C.. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[17] class 30 reserves ......C. - TBF[6] class 31 reserves .....C.. - TBF[18] class 32 reserves ......C. - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[4] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[5] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[6] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[7] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[8] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[9] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[10] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[15] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[11] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[16] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[12] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[13] class 31 reserves .......C - TBF[18] class 32 reserves ...C.... - TBF[18] class 33 reserves ....C... - TBF[20] class 34 reserves ......C. - TBF[14] class 35 reserves .......C - TBF[19] class 36 reserves ...C.... - TBF[19] class 37 reserves ....C... - TBF[21] class 38 reserves ......C. - TBF[20] class 39 reserves ...C.... - TBF[20] class 40 reserves ....C... - TBF[22] class 41 reserves ......C. - TBF[21] class 42 reserves ...C.... - TBF[23] class 43 reserves ......C. - TBF[7] class 44 reserves .....C.. - TBF[8] class 45 reserves .....C.. - TBF[9] class 46 reserves .....C.. - TBF[10] class 1 reserves .....C.. - TBF[11] class 2 reserves .....C.. - TBF[12] class 3 reserves .....C.. - TBF[13] class 4 reserves .....C.. - TBF[14] class 5 reserves .....C.. - TBF[15] class 6 reserves .....C.. - TBF[15] class 7 reserves .......C - TBF[16] class 8 reserves .....C.. - TBF[16] class 9 reserves .......C - TBF[17] class 10 reserves .....C.. - TBF[17] class 11 reserves .......C - TBF[18] class 12 reserves .....C.. - TBF[18] class 13 reserves .......C - TBF[19] class 14 reserves .....C.. - TBF[19] class 15 reserves .......C - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves .......C - TBF[21] class 18 reserves ....C... - TBF[21] class 19 reserves .....C.. - TBF[21] class 20 reserves .......C - TBF[22] class 21 reserves ...C.... - TBF[22] class 22 reserves ....C... - TBF[22] class 23 reserves .....C.. - TBF[22] class 24 reserves .......C - TBF[23] class 25 reserves ...C.... - TBF[23] class 26 reserves ....C... - TBF[23] class 27 reserves .....C.. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 0] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 1] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 1] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 1] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[ 3] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[ 3] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 5] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 6] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 5] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 6] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 44 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 44 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) -- To view, visit https://gerrit.osmocom.org/3932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures 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/3807 to look at the new patch set (#12). Simplify TS alloc: adjust allocator signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282 --- M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp 7 files changed, 59 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/3807/12 diff --git a/src/bts.h b/src/bts.h index b1724c9..8d3a3cc 100644 --- a/src/bts.h +++ b/src/bts.h @@ -203,11 +203,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 64b6d6c..33dd9fd 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -100,20 +102,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b5edf05..cd82ca7 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -351,14 +351,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -725,15 +730,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -954,7 +964,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -962,10 +972,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -977,7 +992,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -986,8 +1001,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 672c296..ea3ffe3 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -500,8 +500,7 @@ LOGP(DTBF, LOGL_DEBUG, "********** DL-TBF update **********\n"); tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, false, -1); /* if no resource */ if (rc < 0) { LOGPTBF(this, LOGL_ERROR, "No resource after update???\n"); @@ -828,9 +827,8 @@ LOGPTBF(this, LOGL_ERROR, "Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -845,8 +843,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -906,9 +903,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -995,9 +991,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; diff --git a/src/tbf.h b/src/tbf.h index bb5fd0a..803ea33 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -366,13 +366,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 80e3831..e8aec23 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -115,7 +115,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -133,11 +133,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 885e2a1..1aa3f63 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -40,7 +40,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -410,10 +410,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Jan 26 11:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 11:57:48 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3935 to look at the new patch set (#5). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 97 insertions(+), 112 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/5 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 5fba5cc..4c96e9a 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -94,11 +94,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -385,7 +385,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -469,7 +469,7 @@ * \param[in] tx_window Transmit window * \returns non-negative capacity */ -static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int16_t rx_window, int16_t tx_window) { const struct gprs_rlcmac_pdch *pdch; unsigned ts, capacity = 0; @@ -489,6 +489,85 @@ return capacity; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] rx_slot_count Number of TS in RX + * \param[in] tx_window Transmit window + * \param[in] tx_slot_count Number of TS in TX + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(uint8_t mslot_class, bool check_tr, + int16_t rx_window,uint8_t rx_slot_count, + int16_t tx_window, uint8_t tx_slot_count, uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots; + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the test_and_set_bit shortcut. */ + if (mslot_class_get_type(mslot_class) == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (mslot_class_get_type(mslot_class) == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +static int16_t filter_bad_slots(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xff & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} + +static inline uint16_t wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -502,18 +581,14 @@ uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ uint8_t Type; /* Type of Mobile */ - int rx_window, tx_window, pdch_slots; + uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; int max_capacity; uint8_t max_ul_slots; uint8_t max_dl_slots; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; enum {MASK_TT, MASK_TR}; - unsigned mask_sel; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", @@ -587,13 +662,12 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; + uint8_t tx_slot_count; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -610,8 +684,7 @@ tx_slot_count = pcu_bitcount(tx_window); - max_rx = OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { @@ -620,107 +693,19 @@ /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; + uint8_t rx_slot_count; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; + rx_window = filter_bad_slots(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) + continue; - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; rx_slot_count = pcu_bitcount(rx_window); -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (Type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) - continue; - - if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (Type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif - continue; - } + if (skip_slot(mslot_class, mask_sel != MASK_TT, + rx_window, rx_slot_count, + tx_window, tx_slot_count, checked_rx)) + continue; /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 12:19:38 2018 From: gerrit-no-reply at lists.osmocom.org (Viktor Tsymbalyuk) Date: Fri, 26 Jan 2018 12:19:38 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: sgsnemu stopped after recieving "Request accepted" ... In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6094 to look at the new patch set (#2). sgsnemu: sgsnemu stopped after recieving "Request accepted" from ggsn "sgsnemu" stopped with the message "Received create PDP context response. Cause value: 128", but normaly at that poit it should continue working and create "user plane". Reason: Funtion "create_pdp_conf" checking result of "in46a_from_eua" and mistakenly returned EOF when more than 1 IP address provided by GGSN. Now function "create_pdp_conf" stopped with error when 0 IP provided or error code comes from "in46a_from_eua". Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add support for IPv4v6 End User Addresses") Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 --- M sgsnemu/sgsnemu.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/94/6094/2 diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index bb55b1c..630733b 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1400,7 +1400,7 @@ return EOF; /* Not what we expected */ } - if (in46a_from_eua(&pdp->eua, &addr)) { + if (in46a_from_eua(&pdp->eua, &addr) < 1) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 12:25:05 2018 From: gerrit-no-reply at lists.osmocom.org (Viktor Tsymbalyuk) Date: Fri, 26 Jan 2018 12:25:05 +0000 Subject: osmo-ggsn[master]: sgsnemu: sgsnemu stopped after recieving "Request accepted" ... In-Reply-To: References: Message-ID: Patch Set 2: Hi, please check. Does it now looks ok? -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Viktor Tsymbalyuk Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 12:42:46 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 12:42:46 +0000 Subject: osmo-ggsn[master]: sgsnemu: sgsnemu stopped after recieving "Request accepted" ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Viktor Tsymbalyuk Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 13:30:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 13:30:48 +0000 Subject: osmo-ggsn[master]: sgsnemu: sgsnemu stopped after recieving "Request accepted" ... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Viktor Tsymbalyuk Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 13:30:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 13:30:52 +0000 Subject: [MERGED] osmo-ggsn[master]: sgsnemu: sgsnemu stopped after recieving "Request accepted" ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sgsnemu: sgsnemu stopped after recieving "Request accepted" from ggsn ...................................................................... sgsnemu: sgsnemu stopped after recieving "Request accepted" from ggsn "sgsnemu" stopped with the message "Received create PDP context response. Cause value: 128", but normaly at that poit it should continue working and create "user plane". Reason: Funtion "create_pdp_conf" checking result of "in46a_from_eua" and mistakenly returned EOF when more than 1 IP address provided by GGSN. Now function "create_pdp_conf" stopped with error when 0 IP provided or error code comes from "in46a_from_eua". Fixes: 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 ("Add support for IPv4v6 End User Addresses") Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 --- M sgsnemu/sgsnemu.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/sgsnemu/sgsnemu.c b/sgsnemu/sgsnemu.c index bb55b1c..630733b 100644 --- a/sgsnemu/sgsnemu.c +++ b/sgsnemu/sgsnemu.c @@ -1400,7 +1400,7 @@ return EOF; /* Not what we expected */ } - if (in46a_from_eua(&pdp->eua, &addr)) { + if (in46a_from_eua(&pdp->eua, &addr) < 1) { printf ("Received create PDP context response. Cause value: %d\n", cause); -- To view, visit https://gerrit.osmocom.org/6094 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7881b8e1f27c432007cb6e5ff665a2ce55f103b5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Viktor Tsymbalyuk From gerrit-no-reply at lists.osmocom.org Fri Jan 26 13:31:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 13:31:35 +0000 Subject: osmo-bts[master]: rsl: fix double-free in rsl_rx_mode_modif() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6 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 Fri Jan 26 13:31:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 13:31:54 +0000 Subject: osmo-bts[master]: fix nullpointer deref in rsl_tx_mode_modif_nack() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a 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 Fri Jan 26 14:07:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 14:07:11 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/gtp.c: Mark non exported functions as static In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6073 to look at the new patch set (#2). gtp/gtp.c: Mark non exported functions as static Functions not exported in gtp.h should be static. There's no need to mark functions as extern in the .c file. Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 --- M gtp/gtp.c 1 file changed, 15 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/73/6073/2 diff --git a/gtp/gtp.c b/gtp/gtp.c index 5b430b7..2e24f7d 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -197,7 +197,7 @@ return 0; } -extern int gtp_set_cb_data_ind(struct gsn_t *gsn, +int gtp_set_cb_data_ind(struct gsn_t *gsn, int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len)) { @@ -402,7 +402,7 @@ * a predefined timeout. *************************************************************/ -int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, +static 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) { @@ -477,7 +477,7 @@ * Remove signalling packet from retransmission queue. * return 0 on success, EOF if packet was not found */ -int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { uint8_t ver = GTPHDR_F_GET_VER(packet->flags); @@ -568,7 +568,7 @@ return 0; } -int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, +static 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, uint16_t seq, uint64_t tid) { @@ -626,7 +626,7 @@ return 0; } -int gtp_notification(struct gsn_t *gsn, int version, +static int gtp_notification(struct gsn_t *gsn, int version, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq) { @@ -671,7 +671,7 @@ return 0; } -int gtp_dublicate(struct gsn_t *gsn, int version, +static int gtp_dublicate(struct gsn_t *gsn, int version, struct sockaddr_in *peer, uint16_t seq) { struct qmsg_t *qmsg; @@ -1016,7 +1016,7 @@ } /* Send off an Supported Extension Headers Notification */ -int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -1037,7 +1037,7 @@ } /* Handle a Supported Extension Headers Notification */ -int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, +static int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, void *pack, unsigned len) { @@ -1060,7 +1060,7 @@ *************************************************************/ /* API: Send Create PDP Context Request (7.3.1) */ -extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp, +int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp) { union gtp_packet packet; @@ -1936,7 +1936,7 @@ } /* Send Update PDP Context Response */ -int gtp_update_pdp_resp(struct gsn_t *gsn, int version, +static int gtp_update_pdp_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) @@ -1998,7 +1998,7 @@ } /* Handle Update PDP Context Request */ -int gtp_update_pdp_ind(struct gsn_t *gsn, int version, +static int gtp_update_pdp_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2226,7 +2226,7 @@ } /* Handle Update PDP Context Response */ -int gtp_update_pdp_conf(struct gsn_t *gsn, int version, +static int gtp_update_pdp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2614,7 +2614,7 @@ } /* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ -int gtp_error_ind_resp(struct gsn_t *gsn, int version, +static int gtp_error_ind_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2636,7 +2636,7 @@ } /* Handle Error Indication */ -int gtp_error_ind_conf(struct gsn_t *gsn, int version, +static int gtp_error_ind_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; @@ -2692,7 +2692,7 @@ return 0; } -int gtp_gpdu_ind(struct gsn_t *gsn, int version, +static int gtp_gpdu_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { -- To view, visit https://gerrit.osmocom.org/6073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 14:07:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 14:07:11 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/gtp.c: Remove unused function char2ul_t 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/6074 to look at the new patch set (#2). gtp/gtp.c: Remove unused function char2ul_t Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 --- M gtp/gtp.c 1 file changed, 0 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/74/6074/2 diff --git a/gtp/gtp.c b/gtp/gtp.c index 9dabcd2..5b430b7 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3296,15 +3296,6 @@ * Conversion functions *************************************************************/ -int char2ul_t(char *src, struct ul_t dst) -{ - dst.l = strlen(src) + 1; - dst.v = malloc(dst.l); - dst.v[0] = dst.l - 1; - memcpy(&dst.v[1], src, dst.v[0]); - return 0; -} - /* *********************************************************** * IP address conversion functions * There exist several types of address representations: -- To view, visit https://gerrit.osmocom.org/6074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 14:07:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 14:07:11 +0000 Subject: [PATCH] osmo-ggsn[master]: gtp/gtp.c: Use uint8_t for version param in static functions 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/6075 to look at the new patch set (#2). gtp/gtp.c: Use uint8_t for version param in static functions Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 --- M gtp/gtp.c 1 file changed, 13 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/75/6075/2 diff --git a/gtp/gtp.c b/gtp/gtp.c index 2e24f7d..2abc32e 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -213,7 +213,7 @@ * to hold the packet header. * returns the length of the header. 0 on error. **/ -static unsigned int get_default_gtp(int version, uint8_t type, void *packet) +static unsigned int get_default_gtp(uint8_t version, uint8_t type, void *packet) { struct gtp0_header *gtp0_default = (struct gtp0_header *)packet; struct gtp1_header_long *gtp1_default = @@ -402,7 +402,7 @@ * a predefined timeout. *************************************************************/ -static int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, +static int gtp_req(struct gsn_t *gsn, uint8_t version, struct pdp_t *pdp, union gtp_packet *packet, int len, struct in_addr *inetaddr, void *cbp) { @@ -477,7 +477,7 @@ * Remove signalling packet from retransmission queue. * return 0 on success, EOF if packet was not found */ -static int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { uint8_t ver = GTPHDR_F_GET_VER(packet->flags); @@ -568,7 +568,7 @@ return 0; } -static int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, +static int gtp_resp(uint8_t version, struct gsn_t *gsn, struct pdp_t *pdp, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq, uint64_t tid) { @@ -626,7 +626,7 @@ return 0; } -static int gtp_notification(struct gsn_t *gsn, int version, +static int gtp_notification(struct gsn_t *gsn, uint8_t version, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq) { @@ -671,7 +671,7 @@ return 0; } -static int gtp_dublicate(struct gsn_t *gsn, int version, +static int gtp_dublicate(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, uint16_t seq) { struct qmsg_t *qmsg; @@ -1016,7 +1016,7 @@ } /* Send off an Supported Extension Headers Notification */ -static int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_extheader_req(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -1936,7 +1936,7 @@ } /* Send Update PDP Context Response */ -static int gtp_update_pdp_resp(struct gsn_t *gsn, int version, +static int gtp_update_pdp_resp(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) @@ -1998,7 +1998,7 @@ } /* Handle Update PDP Context Request */ -static int gtp_update_pdp_ind(struct gsn_t *gsn, int version, +static int gtp_update_pdp_ind(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2226,7 +2226,7 @@ } /* Handle Update PDP Context Response */ -static int gtp_update_pdp_conf(struct gsn_t *gsn, int version, +static int gtp_update_pdp_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2614,7 +2614,7 @@ } /* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ -static int gtp_error_ind_resp(struct gsn_t *gsn, int version, +static int gtp_error_ind_resp(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2636,7 +2636,7 @@ } /* Handle Error Indication */ -static int gtp_error_ind_conf(struct gsn_t *gsn, int version, +static int gtp_error_ind_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; @@ -2692,7 +2692,7 @@ return 0; } -static int gtp_gpdu_ind(struct gsn_t *gsn, int version, +static int gtp_gpdu_ind(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { -- To view, visit https://gerrit.osmocom.org/6075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 14:07:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 14:07:11 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... Message-ID: Review at https://gerrit.osmocom.org/6098 ggsn: encaps_tun: Avoid forwarding packet if EUA is unassigned, fix crash Check (before forwarding received GTP packets into the tun) if the pdp ctx associated with the packet requested was assigned an EUA of the given IP version. This way we avoid for instance forwarding an IPv6 packet (or sending back a response to a Router Solicitation packet) in case the APN was configured without IPv6 support or if the MS/SGSN didn't ask for an IPv6 while requesting an EUA. As a side effect, this commit fixes an OSMO_ASSERT hit introduced in handle_router_mcast in 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 due to a deffective MS sending an icmpv6 Router Solicitation over IPv6 after having been requesting and assigned an IPv4 EUA (so no IPv6 packets expected). Before that commit, there was no crash but the message was being wrongly answered and used an uninitialized .v6 addr field from the peer struct. Fixes: OS#2843 Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b --- M ggsn/ggsn.c M ggsn/icmpv6.c M ggsn/icmpv6.h 3 files changed, 51 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/98/6098/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 3e095f0..578389b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -705,6 +705,34 @@ .s6_addr = { 0xff,0x02,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,2 } }; +/*! Get the peer of pdp based on IP version used. + * \param[in] pdp PDP context to select the peer from. + * \param[in] v4v6 IP version to select. Valid values are 4 and 6. + * \returns The selected peer matching the given IP version. NULL if not present. + */ +static struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, uint8_t v46) { + uint8_t len1, len2, i; + switch (v46) { + case 4: + len1 = sizeof(struct in_addr); + len2 = len1; + break; + case 6: + len1 = 8; + len2 = 16; + break; + default: + OSMO_ASSERT(v46==4 || v46==6); + } + + for (i = 0; i < 2; i++) { + struct ippoolm_t * ippool = pdp->peer[i]; + if (ippool && (ippool->addr.len == len1 || ippool->addr.len == len2)) + return ippool; + } + return NULL; +} + /* MS-originated GTP1-U packet, needs to be sent via TUN device */ static int encaps_tun(struct pdp_t *pdp, void *pack, unsigned len) { @@ -712,6 +740,7 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct tun_t *tun = (struct tun_t *)pdp->ipif; struct apn_ctx *apn = tun->priv; + struct ippoolm_t *peer; OSMO_ASSERT(tun); OSMO_ASSERT(apn); @@ -720,11 +749,25 @@ switch (iph->version) { case 6: + peer = pdp_get_peer_ipv(pdp, 6); + if (!peer) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS IPv6 with unassigned EUA: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(pdp->gsn, pdp, &apn->v6_lladdr, pack, len); + return handle_router_mcast(pdp->gsn, pdp, &peer->addr.v6, + &apn->v6_lladdr, pack, len); break; case 4: + peer = pdp_get_peer_ipv(pdp, 4); + if (!peer) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS IPv4 with unassigned EUA: %s\n", + osmo_hexdump(pack, len)); + return -1; + } break; default: LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c index 6564a54..b7b97eb 100644 --- a/ggsn/icmpv6.c +++ b/ggsn/icmpv6.c @@ -180,21 +180,14 @@ } /* handle incoming packets to the all-routers multicast address */ -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, + const struct in6_addr *pdp_prefix, + const struct in6_addr *own_ll_addr, const uint8_t *pack, unsigned len) { - struct ippoolm_t *member; const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); struct msgb *msg; - - OSMO_ASSERT(pdp); - - member = pdp->peer[0]; - OSMO_ASSERT(member); - if (member->addr.len == sizeof(struct in_addr)) /* ipv4v6 context */ - member = pdp->peer[1]; - OSMO_ASSERT(member); if (len < sizeof(*ip6h)) { LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); @@ -226,7 +219,7 @@ /* Send router advertisement from GGSN link-local * address to MS link-local address, including prefix * allocated to this PDP context */ - msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, &member->addr.v6); + msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, pdp_prefix); /* Send the constructed RA to the MS */ gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); msgb_free(msg); diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h index b6eec63..bf91e27 100644 --- a/ggsn/icmpv6.h +++ b/ggsn/icmpv6.h @@ -3,5 +3,7 @@ #include "../gtp/gtp.h" #include "../gtp/pdp.h" -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, + const struct in6_addr *pdp_prefix, + const struct in6_addr *own_ll_addr, const uint8_t *pack, unsigned len); -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 14:07:12 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 14:07:12 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Validate packet src addr from MS Message-ID: Review at https://gerrit.osmocom.org/6099 ggsn: Validate packet src addr from MS Closes: OS#2422 Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442 --- M ggsn/ggsn.c M gtp/gtp.c 2 files changed, 19 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/99/6099/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 578389b..97f256e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -740,7 +740,9 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct tun_t *tun = (struct tun_t *)pdp->ipif; struct apn_ctx *apn = tun->priv; + char straddr[INET6_ADDRSTRLEN]; struct ippoolm_t *peer; + uint8_t pref_offset; OSMO_ASSERT(tun); OSMO_ASSERT(apn); @@ -756,6 +758,16 @@ return -1; } + /* Validate packet comes from IPaddr assigned to the pdp ctx. + If packet is a LL addr, then EUA is in the lower 64 bits, + otherwise it's used as the 64 prefix */ + pref_offset = IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_src) ? 8 : 0; + if (memcmp(((uint8_t*)&ip6h->ip6_src) + pref_offset, &peer->addr.v6, 8)) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS using unassigned src IPv6: %s\n", + inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr))); + return -1; + } + /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) return handle_router_mcast(pdp->gsn, pdp, &peer->addr.v6, @@ -768,6 +780,13 @@ osmo_hexdump(pack, len)); return -1; } + + /* Validate packet comes from IPaddr assigned to the pdp ctx */ + if (memcmp(&iph->saddr, &peer->addr.v4, sizeof(peer->addr.v4))) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS using unassigned src IPv4: %s\n", + inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr))); + return -1; + } break; default: LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", diff --git a/gtp/gtp.c b/gtp/gtp.c index 2abc32e..42e84a7 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2698,7 +2698,6 @@ int hlen; - /* Need to include code to verify packet src and dest addresses */ struct pdp_t *pdp; switch (version) { -- To view, visit https://gerrit.osmocom.org/6099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 15:10:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 15:10:14 +0000 Subject: [PATCH] osmo-pcu[master]: Update header includes Message-ID: Review at https://gerrit.osmocom.org/6100 Update header includes Many files include unnecessary headers and don't include headers which are actually used. Because of that combined with the fact that OsmoPCU is a mixture of C and C++, it makes it hard to modularize code. Fix this (using iwyu [1] tool): * add missing headers * remove unused headers [1] https://include-what-you-use.org/ Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 --- M src/bts.cpp M src/bts.h M src/gprs_ms.cpp M src/gprs_ms.h M src/gprs_ms_storage.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.h M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty_functions.cpp M src/poll_controller.cpp M src/poll_controller.h M src/rlc.cpp M src/sba.cpp M src/sba.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/edge/EdgeTest.cpp M tests/tbf/TbfTest.cpp 23 files changed, 111 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/00/6100/1 diff --git a/src/bts.cpp b/src/bts.cpp index 94354f2..e6afea8 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -25,9 +25,11 @@ #include #include #include - +#include #include #include +#include +#include extern "C" { #include @@ -37,6 +39,10 @@ #include #include #include + #include + #include + #include + #include } #include diff --git a/src/bts.h b/src/bts.h index b1724c9..2a4af81 100644 --- a/src/bts.h +++ b/src/bts.h @@ -26,8 +26,6 @@ #include #include #include -#include -#include #include #include } @@ -37,6 +35,8 @@ #include "tbf.h" #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" +#include +#include #endif #include diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 33d9cad..740ef6b 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -20,7 +20,7 @@ #include "gprs_ms.h" - +#include #include "bts.h" #include "tbf.h" #include "gprs_debug.h" @@ -33,6 +33,7 @@ #include #include #include + #include } #define GPRS_CODEL_SLOW_INTERVAL_MS 4000 diff --git a/src/gprs_ms.h b/src/gprs_ms.h index f094e96..8e5330f 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -26,9 +26,11 @@ #include "llc.h" #include "tbf.h" #include "pcu_l1_if.h" +#include extern "C" { #include + #include } #include diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp index 6a7f336..c7de6d3 100644 --- a/src/gprs_ms_storage.cpp +++ b/src/gprs_ms_storage.cpp @@ -23,7 +23,10 @@ #include "tbf.h" #include "bts.h" -#include "gprs_debug.h" + +extern "C" { + #include +} #define GPRS_UNDEFINED_IMSI "000" diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index ebf4714..111a096 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -25,6 +25,10 @@ #include "pcu_utils.h" +extern "C" { + #include +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b5edf05..e9c8e61 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -31,6 +31,9 @@ extern "C" { #include "mslot_class.h" +#include +#include +#include } /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ diff --git a/src/llc.h b/src/llc.h index 9d402c3..2e7229c 100644 --- a/src/llc.h +++ b/src/llc.h @@ -29,7 +29,6 @@ #define LLC_MAX_LEN 1543 struct BTS; -struct msgb; /** * I represent the LLC data to a MS diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 577d41e..f56332e 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -29,9 +29,11 @@ #include #include #include +#include +#include +#include } -#include #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b04..2a354d8 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -26,12 +26,18 @@ #include #include #include + extern "C" { #include #include #include #include #include +#include +#include +#include +#include +#include } #include @@ -40,7 +46,6 @@ #include #include #include -#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..0c3a414 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -17,22 +17,34 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include extern "C" { #include "pcu_vty.h" +#include +#include #include -#include +#include +#include #include +#include +#include +#include +#include #include #include #include diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index eb15aa6..d4162a9 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -27,11 +27,19 @@ #include "gprs_ms_storage.h" #include "gprs_ms.h" #include "cxx_linuxlist.h" +#include +#include +#include +#include +#include extern "C" { #include #include #include + #include + #include + #include } int pcu_vty_config_write_pcu_ext(struct vty *vty) diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index 5c5a717..744b612 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -23,6 +23,13 @@ #include #include #include +#include +#include + +extern "C" { +#include +#include +} PollController::PollController(BTS& bts) : m_bts(bts) diff --git a/src/poll_controller.h b/src/poll_controller.h index b9ae80e..65d1fee 100644 --- a/src/poll_controller.h +++ b/src/poll_controller.h @@ -21,8 +21,6 @@ #pragma once -struct gprs_rlcmac_bts; - struct BTS; /** diff --git a/src/rlc.cpp b/src/rlc.cpp index d7f0609..a82f550 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -18,11 +18,17 @@ #include "bts.h" #include "gprs_debug.h" +#include +#include -#include +#include +#include +#include extern "C" { #include +#include +#include } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..5dfdddb 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -20,14 +20,15 @@ */ #include -#include #include #include #include extern "C" { +#include #include #include +#include } #include diff --git a/src/sba.h b/src/sba.h index d2d3106..27dae21 100644 --- a/src/sba.h +++ b/src/sba.h @@ -27,7 +27,6 @@ } struct BTS; -class PollController; struct gprs_rlcmac_pdch; /* diff --git a/src/tbf.cpp b/src/tbf.cpp index 672c296..e208bdc 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -25,10 +25,13 @@ #include #include #include -#include #include -#include #include +#include +#include +#include +#include +#include extern "C" { #include @@ -36,6 +39,9 @@ #include #include #include + #include + #include + #include } #include diff --git a/src/tbf.h b/src/tbf.h index bb5fd0a..1b82eee 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -20,20 +20,23 @@ #ifdef __cplusplus -#include "gprs_rlcmac.h" #include "llc.h" #include "rlc.h" #include "cxx_linuxlist.h" #include - +#include +#include #include extern "C" { #include + #include + #include + #include } struct bssgp_bvc_ctx; -struct pcu_l1_meas; class GprsMs; +struct gprs_rlcmac_bts; /* * TBF instance diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 80e3831..1ad0c54 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -28,18 +28,28 @@ #include #include #include - +#include +#include +#include +#include #include "pcu_utils.h" extern "C" { #include #include #include + #include + #include + #include + #include + #include + #include + #include + #include } #include #include -#include /* After sending these frames, we poll for ack/nack. */ #define POLL_ACK_AFTER_FRAMES 20 diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1560eb0..6960ea9 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -28,12 +28,21 @@ #include #include #include - +#include +#include +#include #include "pcu_utils.h" extern "C" { #include #include + #include + #include + #include + #include + #include + #include + #include } #include diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 1abdcfd..eb9ef42 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -27,6 +27,8 @@ #include "rlc.h" #include "llc.h" #include "bts.h" +#include + extern "C" { #include "pcu_vty.h" diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index aa1d7ac..0e26d09 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -27,6 +27,7 @@ #include "gprs_bssgp_pcu.h" #include "pcu_l1_if.h" #include "decoding.h" +#include extern "C" { #include "pcu_vty.h" -- To view, visit https://gerrit.osmocom.org/6100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 15:12:31 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 15:12:31 +0000 Subject: osmo-ggsn[master]: ggsn: Validate packet src addr from MS In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn 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 Fri Jan 26 15:12:55 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 15:12:55 +0000 Subject: osmo-ggsn[master]: gtp/gtp.c: Remove unused function char2ul_t In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 15:13:38 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 15:13:38 +0000 Subject: osmo-ggsn[master]: gtp/gtp.c: Mark non exported functions as static In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn 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 Fri Jan 26 15:16:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 15:16:19 +0000 Subject: osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/6098/1/ggsn/ggsn.c File ggsn/ggsn.c: Line 710: * \param[in] v4v6 IP version to select. Valid values are 4 and 6. Why not use smth like "bool is_ipv6"? Line 725: OSMO_ASSERT(v46==4 || v46==6); This would eliminate the need for this check for example. -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn 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 Fri Jan 26 15:30:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 15:30:51 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6098 to look at the new patch set (#2). ggsn: encaps_tun: Avoid forwarding packet if EUA is unassigned, fix crash Check (before forwarding received GTP packets into the tun) if the pdp ctx associated with the packet requested was assigned an EUA of the given IP version. This way we avoid for instance forwarding an IPv6 packet (or sending back a response to a Router Solicitation packet) in case the APN was configured without IPv6 support or if the MS/SGSN didn't ask for an IPv6 while requesting an EUA. As a side effect, this commit fixes an OSMO_ASSERT hit introduced in handle_router_mcast in 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 due to a deffective MS sending an icmpv6 Router Solicitation over IPv6 after having been requesting and assigned an IPv4 EUA (so no IPv6 packets expected). Before that commit, there was no crash but the message was being wrongly answered and used an uninitialized .v6 addr field from the peer struct. Fixes: OS#2843 Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b --- M ggsn/ggsn.c M ggsn/icmpv6.c M ggsn/icmpv6.h 3 files changed, 47 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/98/6098/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 3e095f0..7954d5e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -425,6 +425,30 @@ return false; } +/*! Get the peer of pdp based on IP version used. + * \param[in] pdp PDP context to select the peer from. + * \param[in] v4v6 IP version to select. Valid values are 4 and 6. + * \returns The selected peer matching the given IP version. NULL if not present. + */ +static struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6) { + uint8_t len1, len2, i; + + if (is_ipv6) { + len1 = 8; + len2 = 16; + } else { + len1 = sizeof(struct in_addr); + len2 = len1; + } + + for (i = 0; i < 2; i++) { + struct ippoolm_t * ippool = pdp->peer[i]; + if (ippool && (ippool->addr.len == len1 || ippool->addr.len == len2)) + return ippool; + } + return NULL; +} + /* determine if PDP context has IPv6 support */ static bool pdp_has_v4(struct pdp_t *pdp) { @@ -712,6 +736,7 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct tun_t *tun = (struct tun_t *)pdp->ipif; struct apn_ctx *apn = tun->priv; + struct ippoolm_t *peer; OSMO_ASSERT(tun); OSMO_ASSERT(apn); @@ -720,11 +745,25 @@ switch (iph->version) { case 6: + peer = pdp_get_peer_ipv(pdp, true); + if (!peer) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS IPv6 with unassigned EUA: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(pdp->gsn, pdp, &apn->v6_lladdr, pack, len); + return handle_router_mcast(pdp->gsn, pdp, &peer->addr.v6, + &apn->v6_lladdr, pack, len); break; case 4: + peer = pdp_get_peer_ipv(pdp, false); + if (!peer) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS IPv4 with unassigned EUA: %s\n", + osmo_hexdump(pack, len)); + return -1; + } break; default: LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c index 6564a54..b7b97eb 100644 --- a/ggsn/icmpv6.c +++ b/ggsn/icmpv6.c @@ -180,21 +180,14 @@ } /* handle incoming packets to the all-routers multicast address */ -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, + const struct in6_addr *pdp_prefix, + const struct in6_addr *own_ll_addr, const uint8_t *pack, unsigned len) { - struct ippoolm_t *member; const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); struct msgb *msg; - - OSMO_ASSERT(pdp); - - member = pdp->peer[0]; - OSMO_ASSERT(member); - if (member->addr.len == sizeof(struct in_addr)) /* ipv4v6 context */ - member = pdp->peer[1]; - OSMO_ASSERT(member); if (len < sizeof(*ip6h)) { LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); @@ -226,7 +219,7 @@ /* Send router advertisement from GGSN link-local * address to MS link-local address, including prefix * allocated to this PDP context */ - msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, &member->addr.v6); + msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, pdp_prefix); /* Send the constructed RA to the MS */ gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); msgb_free(msg); diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h index b6eec63..bf91e27 100644 --- a/ggsn/icmpv6.h +++ b/ggsn/icmpv6.h @@ -3,5 +3,7 @@ #include "../gtp/gtp.h" #include "../gtp/pdp.h" -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, + const struct in6_addr *pdp_prefix, + const struct in6_addr *own_ll_addr, const uint8_t *pack, unsigned len); -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 15:31:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 15:31:38 +0000 Subject: osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... In-Reply-To: References: Message-ID: Patch Set 2: In 2nd version I moved the helper func upper in the file because I plan to use it in other places at some point. -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn 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 Fri Jan 26 15:34:14 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 15:34:14 +0000 Subject: osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn 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 Fri Jan 26 16:21:27 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 26 Jan 2018 16:21:27 +0000 Subject: osmo-bts[master]: rsl: do not allow MODE MODIFY request with unsupp. codec/rate In-Reply-To: References: Message-ID: Patch Set 1: (3 comments) https://gerrit.osmocom.org/#/c/6097/1/src/common/bts.c File src/common/bts.c: Line 679: int bts_supports_cm(struct gsm_bts_role_bts *bts, Why not to use bool here? Line 693: for (i = 0;; i++) { This way: (i = 0; i < _GSM_PCHAN_MAX; i++) Line 702: if (supported[i].pchan == _GSM_PCHAN_MAX) This could be moved to the 'for' condition... -- To view, visit https://gerrit.osmocom.org/6097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 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 Fri Jan 26 16:26:13 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Fri, 26 Jan 2018 16:26:13 +0000 Subject: osmo-pcu[master]: Update header includes In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6100/1/src/bts.h File src/bts.h: PS1, Line 38: #include : #include Cosmetic: usually we place the <..> headers first. -- To view, visit https://gerrit.osmocom.org/6100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:19:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 17:19:39 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx Message-ID: Review at https://gerrit.osmocom.org/6102 ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx pdp_has_v4 only take into account IPv4 EUAs. Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3 --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/02/6102/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0ff292d..c4e28f8 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -484,15 +484,6 @@ return NULL; } -/* determine if PDP context has IPv6 support */ -static bool pdp_has_v4(struct pdp_t *pdp) -{ - if (pdp->eua.l == 4+2) - return true; - else - return false; -} - /* construct an IPCP PCO response from request*/ static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { @@ -540,12 +531,13 @@ static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); unsigned int i; OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ - if (pdp_has_v4(pdp)) + if (peer_v4) build_ipcp_pco(apn, pdp, msg); if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { -- To view, visit https://gerrit.osmocom.org/6102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:19:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 17:19:39 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Parse PCO_IPCP Message-ID: Review at https://gerrit.osmocom.org/6101 ggsn: Parse PCO_IPCP Improvements include: - Use Identifier received from request instead of using hardcoded id=0. - Don't add DNS to response if they were not included in request. Change-Id: Ic8aa5d634e526683b2ad8ed5d14088e171c41c98 --- M ggsn/ggsn.c 1 file changed, 53 insertions(+), 15 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/01/6101/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6645d4c..0ff292d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -377,6 +377,41 @@ #include +/* RFC 1332 */ +enum ipcp_options { + IPCP_OPT_IPADDR = 3, + IPCP_OPT_PRIMARY_DNS = 129, + IPCP_OPT_SECONDARY_DNS = 131, +}; + +struct ipcp_option_hdr { + uint8_t type; + uint8_t len; + uint8_t data[0]; +}; + +struct ipcp_hdr { + uint8_t code; + uint8_t id; + uint16_t len; + uint8_t options[0]; +}; + +/* determine if IPCP contains given option */ +static struct ipcp_option_hdr *ipcp_contains_option(struct ipcp_hdr *ipcp, enum ipcp_options opt) +{ + uint8_t *cur = ipcp->options; + + /* iterate over Options and check if protocol contained */ + while (cur + 2 <= ((uint8_t *)ipcp) + ipcp->len) { + struct ipcp_option_hdr *cur_opt = (struct ipcp_option_hdr *) cur; + if (cur_opt->type == opt) + return cur_opt; + cur += cur_opt->len; + } + return NULL; +} + /* 3GPP TS 24.008 10.6.5.3 */ enum pco_protocols { PCO_P_LCP = 0xC021, @@ -410,7 +445,7 @@ }; /* determine if PCO contains given protocol */ -static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot) +static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot) { uint8_t *cur = pco->v + 1; @@ -419,10 +454,10 @@ uint16_t cur_prot = osmo_load16be(cur); uint8_t cur_len = cur[2]; if (cur_prot == prot) - return true; + return cur; cur += cur_len + 3; } - return false; + return NULL; } /*! Get the peer of pdp based on IP version used. @@ -458,30 +493,36 @@ return false; } -/* construct an IPCP PCO from up to two given DNS addreses */ -static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, - const struct in46_addr *dns2) +/* construct an IPCP PCO response from request*/ +static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { - uint8_t *len1, *len2; + const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; + const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; + struct ipcp_hdr *ipcp; + uint8_t *len1, *len2, *pco_ipcp; uint8_t *start = msg->tail; unsigned int len_appended; + + if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP))) + return 0; + ipcp = (struct ipcp_hdr*) (pco_ipcp + 3); /* 2=type + 1=len */ /* Three byte T16L header */ msgb_put_u16(msg, 0x8021); /* IPCP */ len1 = msgb_put(msg, 1); /* Length of contents: delay */ msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, ipcp->id); /* ID: Needs to match request */ msgb_put_u8(msg, 0x00); /* Length MSB */ len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1 && dns1->len == 4) { + if (dns1->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_PRIMARY_DNS)) { msgb_put_u8(msg, 0x81); /* DNS1 Tag */ msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); } - if (dns2 && dns2->len == 4) { + if (dns2->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_SECONDARY_DNS)) { msgb_put_u8(msg, 0x83); /* DNS2 Tag */ msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); @@ -504,11 +545,8 @@ OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ - /* FIXME: also check if primary / secondary DNS was requested */ - if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { - /* FIXME: properly implement this for IPCP */ - build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); - } + if (pdp_has_v4(pdp)) + build_ipcp_pco(apn, pdp, msg); if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { -- To view, visit https://gerrit.osmocom.org/6101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8aa5d634e526683b2ad8ed5d14088e171c41c98 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:19:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 17:19:40 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Print all addresses on successful pdp crx creation Message-ID: Review at https://gerrit.osmocom.org/6103 ggsn: Print all addresses on successful pdp crx creation Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 --- M ggsn/ggsn.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/03/6103/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c4e28f8..de8090b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -587,7 +587,8 @@ struct gsn_t *gsn = pdp->gsn; struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr[2]; - struct ippoolm_t *member = NULL; + struct ippoolm_t *member = NULL, *addrv4 = NULL, *addrv6 = NULL; + char straddrv4[INET_ADDRSTRLEN], straddrv6[INET6_ADDRSTRLEN]; struct apn_ctx *apn; int rc, num_addr, i; @@ -645,6 +646,8 @@ /* copy back */ memcpy(&addr[i].v4.s_addr, &member->addr.v4, 4); + addrv4 = member; + } else if (addr[i].len == sizeof(struct in6_addr)) { /* does this APN actually have an IPv6 pool? */ @@ -661,6 +664,8 @@ memcpy(addr[i].v6.s6_addr, &member->addr.v6, 8); /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ memcpy(addr[i].v6.s6_addr+8, &member->addr.v6, 8); + + addrv6 = member; } else OSMO_ASSERT(0); @@ -682,6 +687,7 @@ pdp->ipif = apn->tun.tun; /* TODO */ pdp->priv = apn; + /* TODO: change trap to send 2 IPs */ if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; @@ -692,8 +698,10 @@ /* Transmit G-PDU sequence numbers (only) if configured in APN */ pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; - LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", - name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IPv4=%s, IPv6=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, + addrv4 ? inet_ntop(AF_INET, &addrv4->addr.v4, straddrv4, sizeof(straddrv4)) : "none", + addrv6 ? inet_ntop(AF_INET6, &addrv6->addr.v6, straddrv6, sizeof(straddrv6)) : "none"); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ -- To view, visit https://gerrit.osmocom.org/6103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:47:19 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 17:47:19 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn: Print all addresses on successful pdp ctx creation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6103 to look at the new patch set (#2). ggsn: Print all addresses on successful pdp ctx creation Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 --- M ggsn/ggsn.c 1 file changed, 11 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/03/6103/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c4e28f8..de8090b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -587,7 +587,8 @@ struct gsn_t *gsn = pdp->gsn; struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr[2]; - struct ippoolm_t *member = NULL; + struct ippoolm_t *member = NULL, *addrv4 = NULL, *addrv6 = NULL; + char straddrv4[INET_ADDRSTRLEN], straddrv6[INET6_ADDRSTRLEN]; struct apn_ctx *apn; int rc, num_addr, i; @@ -645,6 +646,8 @@ /* copy back */ memcpy(&addr[i].v4.s_addr, &member->addr.v4, 4); + addrv4 = member; + } else if (addr[i].len == sizeof(struct in6_addr)) { /* does this APN actually have an IPv6 pool? */ @@ -661,6 +664,8 @@ memcpy(addr[i].v6.s6_addr, &member->addr.v6, 8); /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ memcpy(addr[i].v6.s6_addr+8, &member->addr.v6, 8); + + addrv6 = member; } else OSMO_ASSERT(0); @@ -682,6 +687,7 @@ pdp->ipif = apn->tun.tun; /* TODO */ pdp->priv = apn; + /* TODO: change trap to send 2 IPs */ if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; @@ -692,8 +698,10 @@ /* Transmit G-PDU sequence numbers (only) if configured in APN */ pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; - LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", - name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IPv4=%s, IPv6=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, + addrv4 ? inet_ntop(AF_INET, &addrv4->addr.v4, straddrv4, sizeof(straddrv4)) : "none", + addrv6 ? inet_ntop(AF_INET6, &addrv6->addr.v6, straddrv6, sizeof(straddrv6)) : "none"); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ -- To view, visit https://gerrit.osmocom.org/6103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:47:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 17:47:22 +0000 Subject: [PATCH] osmo-pcu[master]: Use built-in bit counter Message-ID: Review at https://gerrit.osmocom.org/6104 Use built-in bit counter Use gss' built-in function for counting bits instead of hand-coded routine. Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521 --- M src/pcu_utils.h 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/04/6104/1 diff --git a/src/pcu_utils.h b/src/pcu_utils.h index 767771c..298bb32 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -37,11 +37,7 @@ template inline unsigned int pcu_bitcount(T x) { - unsigned int count = 0; - for (count = 0; x; count += 1) - x &= x - 1; - - return count; + return __builtin_popcount(x); } template -- To view, visit https://gerrit.osmocom.org/6104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:50:47 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 17:50:47 +0000 Subject: [PATCH] osmo-pcu[master]: Use explicit type for pcu_lsb() Message-ID: Review at https://gerrit.osmocom.org/6105 Use explicit type for pcu_lsb() It#s only used for byte-long input su we can specify input and output types explicitly. Change-Id: Id0bef691e17e4331c7c4b491661e36173d85388a --- M src/pcu_utils.h 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/6105/1 diff --git a/src/pcu_utils.h b/src/pcu_utils.h index 298bb32..aab8d55 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -40,8 +40,7 @@ return __builtin_popcount(x); } -template -inline T pcu_lsb(T x) +inline uint8_t pcu_lsb(uint8_t x) { return x & -x; } -- To view, visit https://gerrit.osmocom.org/6105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id0bef691e17e4331c7c4b491661e36173d85388a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 17:52:44 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 17:52:44 +0000 Subject: osmo-pcu[master]: Use built-in bit counter In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/6104/1/src/pcu_utils.h File src/pcu_utils.h: Line 40: return __builtin_popcount(x); __builtin_popcount only works for unsigned int according to https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html, so having this inside a templated function is a really bad idea. If we want to use this pcu_bitcound for several different types which cannot be transformed to unsigned int, then it's wrong. If in the end we only use it for unsigned int types, then we should drop the templated function and use this bult function directly. -- To view, visit https://gerrit.osmocom.org/6104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu 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 Fri Jan 26 17:57:37 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Fri, 26 Jan 2018 17:57:37 +0000 Subject: osmo-pcu[master]: Use built-in bit counter In-Reply-To: References: Message-ID: Patch Set 1: fyi, if needed there's also __builtin_popcountl for unsigned long -- To view, visit https://gerrit.osmocom.org/6104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:07:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 26 Jan 2018 18:07:01 +0000 Subject: [PATCH] osmo-pcu[master]: Use explicit type for pcu_lsb() In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6105 to look at the new patch set (#2). Use explicit type for pcu_lsb() It's only used for byte-long input so we can specify input and output types explicitly. Change-Id: Id0bef691e17e4331c7c4b491661e36173d85388a --- M src/pcu_utils.h 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/6105/2 diff --git a/src/pcu_utils.h b/src/pcu_utils.h index 298bb32..aab8d55 100644 --- a/src/pcu_utils.h +++ b/src/pcu_utils.h @@ -40,8 +40,7 @@ return __builtin_popcount(x); } -template -inline T pcu_lsb(T x) +inline uint8_t pcu_lsb(uint8_t x) { return x & -x; } -- To view, visit https://gerrit.osmocom.org/6105 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id0bef691e17e4331c7c4b491661e36173d85388a 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 Jan 26 18:18:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:18:24 +0000 Subject: osmo-ggsn[master]: gtp/gtp.c: Remove unused function char2ul_t In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:18:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:18:26 +0000 Subject: osmo-ggsn[master]: gtp/gtp.c: Mark non exported functions as static In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:19:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:19:03 +0000 Subject: osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:19:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:19:29 +0000 Subject: osmo-ggsn[master]: ggsn: Validate packet src addr from MS In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:19:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:19:58 +0000 Subject: osmo-ggsn[master]: ggsn: Parse PCO_IPCP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8aa5d634e526683b2ad8ed5d14088e171c41c98 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:08 +0000 Subject: osmo-ggsn[master]: ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:20 +0000 Subject: osmo-ggsn[master]: ggsn: Print all addresses on successful pdp ctx creation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:22 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Print all addresses on successful pdp ctx creation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Print all addresses on successful pdp ctx creation ...................................................................... ggsn: Print all addresses on successful pdp ctx creation Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 --- M ggsn/ggsn.c 1 file changed, 11 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c4e28f8..de8090b 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -587,7 +587,8 @@ struct gsn_t *gsn = pdp->gsn; struct ggsn_ctx *ggsn = gsn->priv; struct in46_addr addr[2]; - struct ippoolm_t *member = NULL; + struct ippoolm_t *member = NULL, *addrv4 = NULL, *addrv6 = NULL; + char straddrv4[INET_ADDRSTRLEN], straddrv6[INET6_ADDRSTRLEN]; struct apn_ctx *apn; int rc, num_addr, i; @@ -645,6 +646,8 @@ /* copy back */ memcpy(&addr[i].v4.s_addr, &member->addr.v4, 4); + addrv4 = member; + } else if (addr[i].len == sizeof(struct in6_addr)) { /* does this APN actually have an IPv6 pool? */ @@ -661,6 +664,8 @@ memcpy(addr[i].v6.s6_addr, &member->addr.v6, 8); /* use allocated 64bit prefix as lower 64bit, used as link id by MS */ memcpy(addr[i].v6.s6_addr+8, &member->addr.v6, 8); + + addrv6 = member; } else OSMO_ASSERT(0); @@ -682,6 +687,7 @@ pdp->ipif = apn->tun.tun; /* TODO */ pdp->priv = apn; + /* TODO: change trap to send 2 IPs */ if (!send_trap(gsn, pdp, member, "imsi-ass-ip")) { /* TRAP with IP assignment */ gtp_create_context_resp(gsn, pdp, GTPCAUSE_NO_RESOURCES); return 0; @@ -692,8 +698,10 @@ /* Transmit G-PDU sequence numbers (only) if configured in APN */ pdp->tx_gpdu_seq = apn->cfg.tx_gpdu_seq; - LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IP=%s\n", - name_buf, apn->cfg.name, pdp->teic_own, in46a_ntoa(&member->addr)); + LOGPPDP(LOGL_INFO, pdp, "Successful PDP Context Creation: APN=%s(%s), TEIC=%u, IPv4=%s, IPv6=%s\n", + name_buf, apn->cfg.name, pdp->teic_own, + addrv4 ? inet_ntop(AF_INET, &addrv4->addr.v4, straddrv4, sizeof(straddrv4)) : "none", + addrv6 ? inet_ntop(AF_INET6, &addrv6->addr.v6, straddrv6, sizeof(straddrv6)) : "none"); gtp_create_context_resp(gsn, pdp, GTPCAUSE_ACC_REQ); return 0; /* Success */ -- To view, visit https://gerrit.osmocom.org/6103 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c57df17d91bade127027e03633494adb6f818c5 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:23 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx ...................................................................... ggsn: Parse PCO_IPCP for IPv4v6 pdp ctx pdp_has_v4 only take into account IPv4 EUAs. Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3 --- M ggsn/ggsn.c 1 file changed, 2 insertions(+), 10 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 0ff292d..c4e28f8 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -484,15 +484,6 @@ return NULL; } -/* determine if PDP context has IPv6 support */ -static bool pdp_has_v4(struct pdp_t *pdp) -{ - if (pdp->eua.l == 4+2) - return true; - else - return false; -} - /* construct an IPCP PCO response from request*/ static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { @@ -540,12 +531,13 @@ static void process_pco(struct apn_ctx *apn, struct pdp_t *pdp) { struct msgb *msg = msgb_alloc(256, "PCO"); + struct ippoolm_t *peer_v4 = pdp_get_peer_ipv(pdp, false); unsigned int i; OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ - if (pdp_has_v4(pdp)) + if (peer_v4) build_ipcp_pco(apn, pdp, msg); if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { -- To view, visit https://gerrit.osmocom.org/6102 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1cf8d6548951e5732075beeea1412d12fb6bdec3 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:23 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Parse PCO_IPCP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Parse PCO_IPCP ...................................................................... ggsn: Parse PCO_IPCP Improvements include: - Use Identifier received from request instead of using hardcoded id=0. - Don't add DNS to response if they were not included in request. Change-Id: Ic8aa5d634e526683b2ad8ed5d14088e171c41c98 --- M ggsn/ggsn.c 1 file changed, 53 insertions(+), 15 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 6645d4c..0ff292d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -377,6 +377,41 @@ #include +/* RFC 1332 */ +enum ipcp_options { + IPCP_OPT_IPADDR = 3, + IPCP_OPT_PRIMARY_DNS = 129, + IPCP_OPT_SECONDARY_DNS = 131, +}; + +struct ipcp_option_hdr { + uint8_t type; + uint8_t len; + uint8_t data[0]; +}; + +struct ipcp_hdr { + uint8_t code; + uint8_t id; + uint16_t len; + uint8_t options[0]; +}; + +/* determine if IPCP contains given option */ +static struct ipcp_option_hdr *ipcp_contains_option(struct ipcp_hdr *ipcp, enum ipcp_options opt) +{ + uint8_t *cur = ipcp->options; + + /* iterate over Options and check if protocol contained */ + while (cur + 2 <= ((uint8_t *)ipcp) + ipcp->len) { + struct ipcp_option_hdr *cur_opt = (struct ipcp_option_hdr *) cur; + if (cur_opt->type == opt) + return cur_opt; + cur += cur_opt->len; + } + return NULL; +} + /* 3GPP TS 24.008 10.6.5.3 */ enum pco_protocols { PCO_P_LCP = 0xC021, @@ -410,7 +445,7 @@ }; /* determine if PCO contains given protocol */ -static bool pco_contains_proto(struct ul255_t *pco, uint16_t prot) +static uint8_t *pco_contains_proto(struct ul255_t *pco, uint16_t prot) { uint8_t *cur = pco->v + 1; @@ -419,10 +454,10 @@ uint16_t cur_prot = osmo_load16be(cur); uint8_t cur_len = cur[2]; if (cur_prot == prot) - return true; + return cur; cur += cur_len + 3; } - return false; + return NULL; } /*! Get the peer of pdp based on IP version used. @@ -458,30 +493,36 @@ return false; } -/* construct an IPCP PCO from up to two given DNS addreses */ -static int build_ipcp_pco(struct msgb *msg, uint8_t id, const struct in46_addr *dns1, - const struct in46_addr *dns2) +/* construct an IPCP PCO response from request*/ +static int build_ipcp_pco(struct apn_ctx *apn, struct pdp_t *pdp, struct msgb *msg) { - uint8_t *len1, *len2; + const struct in46_addr *dns1 = &apn->v4.cfg.dns[0]; + const struct in46_addr *dns2 = &apn->v4.cfg.dns[1]; + struct ipcp_hdr *ipcp; + uint8_t *len1, *len2, *pco_ipcp; uint8_t *start = msg->tail; unsigned int len_appended; + + if (!(pco_ipcp = pco_contains_proto(&pdp->pco_req, PCO_P_IPCP))) + return 0; + ipcp = (struct ipcp_hdr*) (pco_ipcp + 3); /* 2=type + 1=len */ /* Three byte T16L header */ msgb_put_u16(msg, 0x8021); /* IPCP */ len1 = msgb_put(msg, 1); /* Length of contents: delay */ msgb_put_u8(msg, 0x02); /* ACK */ - msgb_put_u8(msg, id); /* ID: Needs to match request */ + msgb_put_u8(msg, ipcp->id); /* ID: Needs to match request */ msgb_put_u8(msg, 0x00); /* Length MSB */ len2 = msgb_put(msg, 1); /* Length LSB: delay */ - if (dns1 && dns1->len == 4) { + if (dns1->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_PRIMARY_DNS)) { msgb_put_u8(msg, 0x81); /* DNS1 Tag */ msgb_put_u8(msg, 2 + dns1->len);/* DNS1 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns1->v4.s_addr)); } - if (dns2 && dns2->len == 4) { + if (dns2->len == 4 && ipcp_contains_option(ipcp, IPCP_OPT_SECONDARY_DNS)) { msgb_put_u8(msg, 0x83); /* DNS2 Tag */ msgb_put_u8(msg, 2 + dns2->len);/* DNS2 Length, incl. TL */ msgb_put_u32(msg, ntohl(dns2->v4.s_addr)); @@ -504,11 +545,8 @@ OSMO_ASSERT(msg); msgb_put_u8(msg, 0x80); /* ext-bit + configuration protocol byte */ - /* FIXME: also check if primary / secondary DNS was requested */ - if (pdp_has_v4(pdp) && pco_contains_proto(&pdp->pco_req, PCO_P_IPCP)) { - /* FIXME: properly implement this for IPCP */ - build_ipcp_pco(msg, 0, &apn->v4.cfg.dns[0], &apn->v4.cfg.dns[1]); - } + if (pdp_has_v4(pdp)) + build_ipcp_pco(apn, pdp, msg); if (pco_contains_proto(&pdp->pco_req, PCO_P_DNS_IPv6_ADDR)) { for (i = 0; i < ARRAY_SIZE(apn->v6.cfg.dns); i++) { -- To view, visit https://gerrit.osmocom.org/6101 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8aa5d634e526683b2ad8ed5d14088e171c41c98 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:24 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: Validate packet src addr from MS In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: Validate packet src addr from MS ...................................................................... ggsn: Validate packet src addr from MS Closes: OS#2422 Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442 --- M ggsn/ggsn.c M gtp/gtp.c 2 files changed, 19 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/ggsn/ggsn.c b/ggsn/ggsn.c index 7954d5e..6645d4c 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -736,7 +736,9 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct tun_t *tun = (struct tun_t *)pdp->ipif; struct apn_ctx *apn = tun->priv; + char straddr[INET6_ADDRSTRLEN]; struct ippoolm_t *peer; + uint8_t pref_offset; OSMO_ASSERT(tun); OSMO_ASSERT(apn); @@ -752,6 +754,16 @@ return -1; } + /* Validate packet comes from IPaddr assigned to the pdp ctx. + If packet is a LL addr, then EUA is in the lower 64 bits, + otherwise it's used as the 64 prefix */ + pref_offset = IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_src) ? 8 : 0; + if (memcmp(((uint8_t*)&ip6h->ip6_src) + pref_offset, &peer->addr.v6, 8)) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS using unassigned src IPv6: %s\n", + inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr))); + return -1; + } + /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) return handle_router_mcast(pdp->gsn, pdp, &peer->addr.v6, @@ -764,6 +776,13 @@ osmo_hexdump(pack, len)); return -1; } + + /* Validate packet comes from IPaddr assigned to the pdp ctx */ + if (memcmp(&iph->saddr, &peer->addr.v4, sizeof(peer->addr.v4))) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS using unassigned src IPv4: %s\n", + inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr))); + return -1; + } break; default: LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", diff --git a/gtp/gtp.c b/gtp/gtp.c index 2abc32e..42e84a7 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -2698,7 +2698,6 @@ int hlen; - /* Need to include code to verify packet src and dest addresses */ struct pdp_t *pdp; switch (version) { -- To view, visit https://gerrit.osmocom.org/6099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie658a7f161103bb6f631ab0508e45e55fb42a442 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:24 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassign... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn: encaps_tun: Avoid forwarding packet if EUA is unassigned, fix crash ...................................................................... ggsn: encaps_tun: Avoid forwarding packet if EUA is unassigned, fix crash Check (before forwarding received GTP packets into the tun) if the pdp ctx associated with the packet requested was assigned an EUA of the given IP version. This way we avoid for instance forwarding an IPv6 packet (or sending back a response to a Router Solicitation packet) in case the APN was configured without IPv6 support or if the MS/SGSN didn't ask for an IPv6 while requesting an EUA. As a side effect, this commit fixes an OSMO_ASSERT hit introduced in handle_router_mcast in 2d6a69e69a4b4cb2b8cc63c4810dae44e5a4d8f6 due to a deffective MS sending an icmpv6 Router Solicitation over IPv6 after having been requesting and assigned an IPv4 EUA (so no IPv6 packets expected). Before that commit, there was no crash but the message was being wrongly answered and used an uninitialized .v6 addr field from the peer struct. Fixes: OS#2843 Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b --- M ggsn/ggsn.c M ggsn/icmpv6.c M ggsn/icmpv6.h 3 files changed, 47 insertions(+), 13 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/ggsn/ggsn.c b/ggsn/ggsn.c index 3e095f0..7954d5e 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -425,6 +425,30 @@ return false; } +/*! Get the peer of pdp based on IP version used. + * \param[in] pdp PDP context to select the peer from. + * \param[in] v4v6 IP version to select. Valid values are 4 and 6. + * \returns The selected peer matching the given IP version. NULL if not present. + */ +static struct ippoolm_t *pdp_get_peer_ipv(struct pdp_t *pdp, bool is_ipv6) { + uint8_t len1, len2, i; + + if (is_ipv6) { + len1 = 8; + len2 = 16; + } else { + len1 = sizeof(struct in_addr); + len2 = len1; + } + + for (i = 0; i < 2; i++) { + struct ippoolm_t * ippool = pdp->peer[i]; + if (ippool && (ippool->addr.len == len1 || ippool->addr.len == len2)) + return ippool; + } + return NULL; +} + /* determine if PDP context has IPv6 support */ static bool pdp_has_v4(struct pdp_t *pdp) { @@ -712,6 +736,7 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct tun_t *tun = (struct tun_t *)pdp->ipif; struct apn_ctx *apn = tun->priv; + struct ippoolm_t *peer; OSMO_ASSERT(tun); OSMO_ASSERT(apn); @@ -720,11 +745,25 @@ switch (iph->version) { case 6: + peer = pdp_get_peer_ipv(pdp, true); + if (!peer) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS IPv6 with unassigned EUA: %s\n", + osmo_hexdump(pack, len)); + return -1; + } + /* daddr: all-routers multicast addr */ if (IN6_ARE_ADDR_EQUAL(&ip6h->ip6_dst, &all_router_mcast_addr)) - return handle_router_mcast(pdp->gsn, pdp, &apn->v6_lladdr, pack, len); + return handle_router_mcast(pdp->gsn, pdp, &peer->addr.v6, + &apn->v6_lladdr, pack, len); break; case 4: + peer = pdp_get_peer_ipv(pdp, false); + if (!peer) { + LOGPPDP(LOGL_ERROR, pdp, "Packet from MS IPv4 with unassigned EUA: %s\n", + osmo_hexdump(pack, len)); + return -1; + } break; default: LOGPPDP(LOGL_ERROR, pdp, "Packet from MS is neither IPv4 nor IPv6: %s\n", diff --git a/ggsn/icmpv6.c b/ggsn/icmpv6.c index 6564a54..b7b97eb 100644 --- a/ggsn/icmpv6.c +++ b/ggsn/icmpv6.c @@ -180,21 +180,14 @@ } /* handle incoming packets to the all-routers multicast address */ -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, + const struct in6_addr *pdp_prefix, + const struct in6_addr *own_ll_addr, const uint8_t *pack, unsigned len) { - struct ippoolm_t *member; const struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; const struct icmpv6_hdr *ic6h = (struct icmpv6_hdr *) (pack + sizeof(*ip6h)); struct msgb *msg; - - OSMO_ASSERT(pdp); - - member = pdp->peer[0]; - OSMO_ASSERT(member); - if (member->addr.len == sizeof(struct in_addr)) /* ipv4v6 context */ - member = pdp->peer[1]; - OSMO_ASSERT(member); if (len < sizeof(*ip6h)) { LOGP(DICMP6, LOGL_NOTICE, "Packet too short: %u bytes\n", len); @@ -226,7 +219,7 @@ /* Send router advertisement from GGSN link-local * address to MS link-local address, including prefix * allocated to this PDP context */ - msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, &member->addr.v6); + msg = icmpv6_construct_ra(own_ll_addr, &ip6h->ip6_src, pdp_prefix); /* Send the constructed RA to the MS */ gtp_data_req(gsn, pdp, msgb_data(msg), msgb_length(msg)); msgb_free(msg); diff --git a/ggsn/icmpv6.h b/ggsn/icmpv6.h index b6eec63..bf91e27 100644 --- a/ggsn/icmpv6.h +++ b/ggsn/icmpv6.h @@ -3,5 +3,7 @@ #include "../gtp/gtp.h" #include "../gtp/pdp.h" -int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, const struct in6_addr *own_ll_addr, +int handle_router_mcast(struct gsn_t *gsn, struct pdp_t *pdp, + const struct in6_addr *pdp_prefix, + const struct in6_addr *own_ll_addr, const uint8_t *pack, unsigned len); -- To view, visit https://gerrit.osmocom.org/6098 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6d18a64c2b71f3bcf6cb7e3a978d2d3f9c7a79b Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn 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 Jan 26 18:20:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:24 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp/gtp.c: Mark non exported functions as static In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp/gtp.c: Mark non exported functions as static ...................................................................... gtp/gtp.c: Mark non exported functions as static Functions not exported in gtp.h should be static. There's no need to mark functions as extern in the .c file. Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 --- M gtp/gtp.c 1 file changed, 15 insertions(+), 15 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/gtp/gtp.c b/gtp/gtp.c index 5b430b7..2e24f7d 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -197,7 +197,7 @@ return 0; } -extern int gtp_set_cb_data_ind(struct gsn_t *gsn, +int gtp_set_cb_data_ind(struct gsn_t *gsn, int (*cb_data_ind) (struct pdp_t * pdp, void *pack, unsigned len)) { @@ -402,7 +402,7 @@ * a predefined timeout. *************************************************************/ -int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, +static 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) { @@ -477,7 +477,7 @@ * Remove signalling packet from retransmission queue. * return 0 on success, EOF if packet was not found */ -int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { uint8_t ver = GTPHDR_F_GET_VER(packet->flags); @@ -568,7 +568,7 @@ return 0; } -int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, +static 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, uint16_t seq, uint64_t tid) { @@ -626,7 +626,7 @@ return 0; } -int gtp_notification(struct gsn_t *gsn, int version, +static int gtp_notification(struct gsn_t *gsn, int version, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq) { @@ -671,7 +671,7 @@ return 0; } -int gtp_dublicate(struct gsn_t *gsn, int version, +static int gtp_dublicate(struct gsn_t *gsn, int version, struct sockaddr_in *peer, uint16_t seq) { struct qmsg_t *qmsg; @@ -1016,7 +1016,7 @@ } /* Send off an Supported Extension Headers Notification */ -int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -1037,7 +1037,7 @@ } /* Handle a Supported Extension Headers Notification */ -int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, +static int gtp_extheader_ind(struct gsn_t *gsn, struct sockaddr_in *peer, void *pack, unsigned len) { @@ -1060,7 +1060,7 @@ *************************************************************/ /* API: Send Create PDP Context Request (7.3.1) */ -extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp, +int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp, void *cbp) { union gtp_packet packet; @@ -1936,7 +1936,7 @@ } /* Send Update PDP Context Response */ -int gtp_update_pdp_resp(struct gsn_t *gsn, int version, +static int gtp_update_pdp_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) @@ -1998,7 +1998,7 @@ } /* Handle Update PDP Context Request */ -int gtp_update_pdp_ind(struct gsn_t *gsn, int version, +static int gtp_update_pdp_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2226,7 +2226,7 @@ } /* Handle Update PDP Context Response */ -int gtp_update_pdp_conf(struct gsn_t *gsn, int version, +static int gtp_update_pdp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2614,7 +2614,7 @@ } /* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ -int gtp_error_ind_resp(struct gsn_t *gsn, int version, +static int gtp_error_ind_resp(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2636,7 +2636,7 @@ } /* Handle Error Indication */ -int gtp_error_ind_conf(struct gsn_t *gsn, int version, +static int gtp_error_ind_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; @@ -2692,7 +2692,7 @@ return 0; } -int gtp_gpdu_ind(struct gsn_t *gsn, int version, +static int gtp_gpdu_ind(struct gsn_t *gsn, int version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { -- To view, visit https://gerrit.osmocom.org/6073 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie61d5c6e0ae45ef3885911cedf71c826ed1705d0 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:24 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp/gtp.c: Remove unused function char2ul_t In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp/gtp.c: Remove unused function char2ul_t ...................................................................... gtp/gtp.c: Remove unused function char2ul_t Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 --- M gtp/gtp.c 1 file changed, 0 insertions(+), 9 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/gtp/gtp.c b/gtp/gtp.c index 9dabcd2..5b430b7 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -3296,15 +3296,6 @@ * Conversion functions *************************************************************/ -int char2ul_t(char *src, struct ul_t dst) -{ - dst.l = strlen(src) + 1; - dst.v = malloc(dst.l); - dst.v[0] = dst.l - 1; - memcpy(&dst.v[1], src, dst.v[0]); - return 0; -} - /* *********************************************************** * IP address conversion functions * There exist several types of address representations: -- To view, visit https://gerrit.osmocom.org/6074 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0d7493404ea05ce2e795958041bbb6cb75a04d31 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:20:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:20:25 +0000 Subject: [MERGED] osmo-ggsn[master]: gtp/gtp.c: Use uint8_t for version param in static functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtp/gtp.c: Use uint8_t for version param in static functions ...................................................................... gtp/gtp.c: Use uint8_t for version param in static functions Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 --- 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 2e24f7d..2abc32e 100644 --- a/gtp/gtp.c +++ b/gtp/gtp.c @@ -213,7 +213,7 @@ * to hold the packet header. * returns the length of the header. 0 on error. **/ -static unsigned int get_default_gtp(int version, uint8_t type, void *packet) +static unsigned int get_default_gtp(uint8_t version, uint8_t type, void *packet) { struct gtp0_header *gtp0_default = (struct gtp0_header *)packet; struct gtp1_header_long *gtp1_default = @@ -402,7 +402,7 @@ * a predefined timeout. *************************************************************/ -static int gtp_req(struct gsn_t *gsn, int version, struct pdp_t *pdp, +static int gtp_req(struct gsn_t *gsn, uint8_t version, struct pdp_t *pdp, union gtp_packet *packet, int len, struct in_addr *inetaddr, void *cbp) { @@ -477,7 +477,7 @@ * Remove signalling packet from retransmission queue. * return 0 on success, EOF if packet was not found */ -static int gtp_conf(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, union gtp_packet *packet, int len, uint8_t * type, void **cbp) { uint8_t ver = GTPHDR_F_GET_VER(packet->flags); @@ -568,7 +568,7 @@ return 0; } -static int gtp_resp(int version, struct gsn_t *gsn, struct pdp_t *pdp, +static int gtp_resp(uint8_t version, struct gsn_t *gsn, struct pdp_t *pdp, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq, uint64_t tid) { @@ -626,7 +626,7 @@ return 0; } -static int gtp_notification(struct gsn_t *gsn, int version, +static int gtp_notification(struct gsn_t *gsn, uint8_t version, union gtp_packet *packet, int len, struct sockaddr_in *peer, int fd, uint16_t seq) { @@ -671,7 +671,7 @@ return 0; } -static int gtp_dublicate(struct gsn_t *gsn, int version, +static int gtp_dublicate(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, uint16_t seq) { struct qmsg_t *qmsg; @@ -1016,7 +1016,7 @@ } /* Send off an Supported Extension Headers Notification */ -static int gtp_extheader_req(struct gsn_t *gsn, int version, struct sockaddr_in *peer, +static int gtp_extheader_req(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { union gtp_packet packet; @@ -1936,7 +1936,7 @@ } /* Send Update PDP Context Response */ -static int gtp_update_pdp_resp(struct gsn_t *gsn, int version, +static int gtp_update_pdp_resp(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len, struct pdp_t *pdp, uint8_t cause) @@ -1998,7 +1998,7 @@ } /* Handle Update PDP Context Request */ -static int gtp_update_pdp_ind(struct gsn_t *gsn, int version, +static int gtp_update_pdp_ind(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2226,7 +2226,7 @@ } /* Handle Update PDP Context Response */ -static int gtp_update_pdp_conf(struct gsn_t *gsn, int version, +static int gtp_update_pdp_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, void *pack, unsigned len) { struct pdp_t *pdp; @@ -2614,7 +2614,7 @@ } /* Send Error Indication (response to a GPDU message) - 3GPP TS 29.060 7.3.7 */ -static int gtp_error_ind_resp(struct gsn_t *gsn, int version, +static int gtp_error_ind_resp(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { @@ -2636,7 +2636,7 @@ } /* Handle Error Indication */ -static int gtp_error_ind_conf(struct gsn_t *gsn, int version, +static int gtp_error_ind_conf(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, void *pack, unsigned len) { union gtpie_member *ie[GTPIE_SIZE]; @@ -2692,7 +2692,7 @@ return 0; } -static int gtp_gpdu_ind(struct gsn_t *gsn, int version, +static int gtp_gpdu_ind(struct gsn_t *gsn, uint8_t version, struct sockaddr_in *peer, int fd, void *pack, unsigned len) { -- To view, visit https://gerrit.osmocom.org/6075 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9afc36e2304f1060615219e88dd28821fb74e300 Gerrit-PatchSet: 3 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Jan 26 18:21:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:21:05 +0000 Subject: [MERGED] osmo-bts[master]: rsl: fix double-free in rsl_rx_mode_modif() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rsl: fix double-free in rsl_rx_mode_modif() ...................................................................... rsl: fix double-free in rsl_rx_mode_modif() When the RSL_IE_CHAN_MODE is is missing, then the message buffer is freed and the channel mode modify is nacked using return rsl_tx_mode_modif_nack() The function rsl_tx_mode_modif_nack uses abis_bts_rsl_sendmsg() which returns 0 on success. This eventually leads into a double- free in rsl_rx_dchan() which frees the message buffer on all return codes except 1. - Remove the excess msgb_free() in the error handling path. Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6 --- M src/common/rsl.c 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/rsl.c b/src/common/rsl.c index 88e240a..1f45cc6 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1283,7 +1283,6 @@ /* 9.3.6 Channel Mode */ if (!TLVP_PRESENT(&tp, RSL_IE_CHAN_MODE)) { LOGP(DRSL, LOGL_NOTICE, "missing Channel Mode\n"); - msgb_free(msg); return rsl_tx_mode_modif_nack(lchan, RSL_ERR_MAND_IE_ERROR); } cm = (struct rsl_ie_chan_mode *) TLVP_VAL(&tp, RSL_IE_CHAN_MODE); -- To view, visit https://gerrit.osmocom.org/6095 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6 Gerrit-PatchSet: 1 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 Jan 26 18:21:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:21:13 +0000 Subject: [MERGED] osmo-bts[master]: fix nullpointer deref in rsl_tx_mode_modif_nack() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix nullpointer deref in rsl_tx_mode_modif_nack() ...................................................................... fix nullpointer deref in rsl_tx_mode_modif_nack() The function rsl_tx_mode_modif_nack() uses abis_bts_rsl_sendmsg(). This function relys on msg->trx to be set (see abis.c). However, rsl_tx_mode_modif_nack() creates the message buffer, but does not set msg->trx. - Make sure that msg->trx is set properly Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a --- M src/common/rsl.c 1 file changed, 1 insertion(+), 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 1f45cc6..3d0993c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -1248,6 +1248,7 @@ msgb_tlv_put(msg, RSL_IE_CAUSE, 1, &cause); rsl_dch_push_hdr(msg, RSL_MT_MODE_MODIFY_NACK, chan_nr); msg->lchan = lchan; + msg->trx = lchan->ts->trx; return abis_bts_rsl_sendmsg(msg); } -- To view, visit https://gerrit.osmocom.org/6096 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a Gerrit-PatchSet: 1 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 Jan 26 18:22:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 18:22:49 +0000 Subject: osmo-bts[master]: rsl: do not allow MODE MODIFY request with unsupp. codec/rate In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6097/1/include/osmo-bts/gsm_data.h File include/osmo-bts/gsm_data.h: Line 97: const struct bts_cm *cm; /* Table with supp. ch rate/mode combinations */ if this is alway an array that needs to be as large as MAX_PCHAN_T, then why not simply have it as a static array here? Allowing it to be dynamically allocated just makes it harder to use, as somebody could allocate a too small array, and the generic code has no way of knowing the size of that array. -- To view, visit https://gerrit.osmocom.org/6097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Jan 26 20:46:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 20:46:50 +0000 Subject: osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams In-Reply-To: References: Message-ID: Patch Set 19: I'm having problems getting this to work, see https://osmocom.org/issues/2876 -- To view, visit https://gerrit.osmocom.org/4980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 Gerrit-PatchSet: 19 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Move f_sleep() to common Osmocom_Types.ttcn Message-ID: Review at https://gerrit.osmocom.org/6106 msc: Move f_sleep() to common Osmocom_Types.ttcn Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504 --- M library/Osmocom_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/06/6106/1 diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 495b684..a748bbc 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -60,4 +60,10 @@ return prefix & f_rnd_octstring(len - lengthof(prefix)); } + function f_sleep(float seconds) { + timer T := seconds; + T.start; + T.timeout; + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index aee0165..a6e92bc 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -383,12 +383,6 @@ return vc_conn; } -function f_sleep(float seconds) { - timer T := seconds; - T.start; - T.timeout; -} - function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd) { /* enter config mode; enter node */ -- To view, visit https://gerrit.osmocom.org/6106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Move auth/ciph handling in shared f_mm_common() Message-ID: Review at https://gerrit.osmocom.org/6107 msc: Move auth/ciph handling in shared f_mm_common() This shared function can now be used not only from f_perform_lu() but also from f_establish_fully() and others. Change-Id: Ib174b1e7153ce2ae531755cd0ba586bb12264551 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 39 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/07/6107/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 58b64d3..d691d80 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -27,6 +27,13 @@ var BSC_ConnHdlrPars g_pars; } +type record AuthVector { + OCT16 rand, + OCT4 sres, + OCT8 kc + /* FIXME: 3G elements */ +} + type record BSC_ConnHdlrPars { SCCP_PAR_Address sccp_addr_own, SCCP_PAR_Address sccp_addr_peer, @@ -37,7 +44,7 @@ OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional, - octetstring kc optional + AuthVector vec optional }; @@ -103,7 +110,7 @@ } /* helper function to fully establish a dedicated channel */ -function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) +function f_establish_fully(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; @@ -111,10 +118,13 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_info); - if (expect_auth) { - /* FIXME */ + f_mm_common(expect_auth, expect_ciph); + if (expect_ciph) { + /* implicit CM SERVICE ACCEPT? */ + } else { + /* explicit CM SERVICE ACCEPT */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); } - BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); } /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ @@ -141,13 +151,6 @@ return l3_info; } -type record AuthVector { - OCT16 rand, - OCT4 sres, - OCT8 kc - /* FIXME: 3G elements */ -} - private function f_rnd_oct(integer len) return octetstring { var integer i; var octetstring res; @@ -165,12 +168,32 @@ return vec; } + +function f_mm_common(boolean expect_auth, boolean expect_ciph) runs on BSC_ConnHdlr +{ + if (expect_auth) { + g_pars.vec := f_gen_auth_vec_2g(); + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, + g_pars.vec.sres, + g_pars.vec.kc)); + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); + } + + if (expect_ciph) { + BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)); + BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); + } +} + function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm, boolean expect_ciph := false) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; - var AuthVector vec; /* tell GSUP dispatcher to send this IMSI to us */ f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -182,21 +205,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); } - if (expect_auth) { - vec := f_gen_auth_vec_2g(); - var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); - GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); - GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); - - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(vec.sres))); - } - - if (expect_ciph) { - BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, vec.kc)); - g_pars.kc := vec.kc; - BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); - } + f_mm_common(expect_auth, expect_ciph); /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index a6e92bc..83ad17c 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -362,7 +362,7 @@ tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit, - kc := omit + vec := omit }; vc_conn := BSC_ConnHdlr.create(id); @@ -536,7 +536,7 @@ g_pars := pars; f_perform_lu(false, true, true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); var hexstring called := '12345'H; var integer tid := 0; -- To view, visit https://gerrit.osmocom.org/6107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib174b1e7153ce2ae531755cd0ba586bb12264551 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_Emulation: Move from connetion-based to endpoint-based ... Message-ID: Review at https://gerrit.osmocom.org/6108 MGCP_Emulation: Move from connetion-based to endpoint-based model In the end, we will often see two connections that relate to one endpoint, so let's dispatch based on the endpoint name and not based on the connection identifier. In the BSC case, we have * two MGCP connections on one EP in case of RTP/IP based Abis * one MGCP connectio on one EP in case of E1/T1 based Abis In the MSC case, we have * two MGCP connections on one EP: BSS and MSS/MNCC side Change-Id: I8cd7395ee7b076a9a9ef513cc1b71f2db5009845 --- M library/MGCP_Emulation.ttcn 1 file changed, 122 insertions(+), 52 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/08/6108/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 5bd4e50..df8e4b4 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -38,7 +38,6 @@ port MGCP_Conn_PT MGCP; /* procedure based port to register for incoming connections */ port MGCPEM_PROC_PT MGCP_PROC; - var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ @@ -46,11 +45,14 @@ inout MgcpCommand, MgcpResponse; } with { extension "internal" }; -/* represents a single MGCP Connection */ -type record ConnectionData { +/* represents a single MGCP Endpoint */ +type record EndpointData { MGCP_ConnHdlr comp_ref, - MgcpConnectionId conn_id optional + MgcpEndpoint endpoint optional }; + +/* pending CRCX with their transaction ID */ +type set of MgcpTransId MgcpTransIds; type component MGCP_Emulation_CT { /* Port facing to the UDP SUT */ @@ -60,7 +62,8 @@ * to send where with CLIENT.send() to vc_conn */ port MGCP_Conn_PT MGCP_CLIENT; /* currently tracked connections */ - var ConnectionData MgcpConnectionTable[16]; + var EndpointData MgcpEndpointTable[16]; + var MgcpTransIds MgcpPendingTrans := {}; /* pending expected CRCX */ var ExpectData MgcpExpectTable[8]; /* procedure based port to register for incoming connections */ @@ -101,11 +104,11 @@ return mrf; } -private function f_conn_id_known(MgcpConnectionId conn_id) +private function f_ep_known(MgcpEndpoint ep) runs on MGCP_Emulation_CT return boolean { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].conn_id == conn_id) { + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].endpoint == ep) { return true; } } @@ -115,69 +118,113 @@ private function f_comp_known(MGCP_ConnHdlr client) runs on MGCP_Emulation_CT return boolean { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].comp_ref == client) { + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].comp_ref == client) { return true; } } return false; } -private function f_comp_by_conn_id(MgcpConnectionId conn_id) +private function f_comp_by_ep(MgcpEndpoint ep) runs on MGCP_Emulation_CT return MGCP_ConnHdlr { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].conn_id == conn_id) { - return MgcpConnectionTable[i].comp_ref; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].endpoint == ep) { + return MgcpEndpointTable[i].comp_ref; } } - log("MGCP Connection Table not found by Connection Id", conn_id); + log("MGCP Endpoint Table not found by Endpoint", ep); setverdict(fail); self.stop; } -private function f_conn_id_by_comp(MGCP_ConnHdlr client) -runs on MGCP_Emulation_CT return MgcpConnectionId { +private function f_ep_by_comp(MGCP_ConnHdlr client) +runs on MGCP_Emulation_CT return MgcpEndpoint { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].comp_ref == client) { - return MgcpConnectionTable[i].conn_id; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].comp_ref == client) { + return MgcpEndpointTable[i].endpoint; } } - log("MGCP Connection Table not found by component ", client); + log("MGCP Endpoint Table not found by component ", client); setverdict(fail); self.stop; +} + +private function f_ep_table_add(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) +runs on MGCP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (not isvalue(MgcpEndpointTable[i].endpoint)) { + MgcpEndpointTable[i].endpoint := ep; + MgcpEndpointTable[i].comp_ref := comp_ref; + return; + } + } + setverdict(fail, "MGCP Endpoint Table full!"); + self.stop; +} + +private function f_ep_table_del(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) +runs on MGCP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].comp_ref == comp_ref and + MgcpEndpointTable[i].endpoint == ep) { + MgcpEndpointTable[i].endpoint := omit; + MgcpEndpointTable[i].comp_ref := null; + return; + } + } + setverdict(fail, "MGCP Endpoint Table: Couldn't find to-be-deleted entry!"); + self.stop; +} + + +/* Check if the given transaction ID is a pending CRCX. If yes, return true + remove */ +private function f_trans_id_was_pending(MgcpTransId trans_id) +runs on MGCP_Emulation_CT return boolean { + for (var integer i := 0; i < lengthof(MgcpPendingTrans); i := i+1) { + if (MgcpPendingTrans[i] == trans_id) { + /* Remove from list */ + var MgcpTransIds OldPendingTrans := MgcpPendingTrans; + MgcpPendingTrans := {} + for (var integer j := 0; j < lengthof(OldPendingTrans); j := j+1) { + if (j != i) { + MgcpPendingTrans := MgcpPendingTrans & {OldPendingTrans[j]}; + } + } + return true; + } + } + return false; } /* TODO: move this to MGCP_Types? */ -function f_mgcp_conn_id(MgcpMessage msg) return hexstring { +function f_mgcp_ep(MgcpMessage msg) return MgcpEndpoint { var MgcpParameterList params; var integer i; if (ischosen(msg.command)) { - params := msg.command.params; + return msg.command.line.ep; } else { - params := msg.response.params; + /* FIXME */ + return "null at none"; } - for (i := 0; i < lengthof(params); i := i+1) { - if (params[i].code == "I") { - return str2hex(params[i].val); - } - } - return ''H; } -private function f_conn_table_init() +private function f_ep_table_init() runs on MGCP_Emulation_CT { - for (var integer i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - MgcpConnectionTable[i].comp_ref := null; - MgcpConnectionTable[i].conn_id := omit; + for (var integer i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + MgcpEndpointTable[i].comp_ref := null; + MgcpEndpointTable[i].endpoint := omit; } } function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; - f_conn_table_init(); + f_ep_table_init(); f_expect_table_init(); map(self:MGCP, system:MGCP_CODEC_PT); @@ -196,12 +243,19 @@ var MgcpMessage msg; var MgcpCommand cmd; var MgcpResponse resp; + var MgcpEndpoint ep; alt { /* MGCP from client */ [] MGCP_CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { + msg := { + response := resp + }; + /* If this is the resposne to a pending CRCX, extract Endpoint and store in table */ + if (f_trans_id_was_pending(resp.line.trans_id)) { + f_ep_table_add(vc_conn, f_mgcp_ep(msg)); + } /* Pass message through */ - msg.response := resp; /* TODO: check which ConnectionID client has allocated + store in table? */ MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg)); } @@ -213,21 +267,25 @@ } if (ischosen(mrf.msg.command)) { cmd := mrf.msg.command; - if (match(cmd, tr_MgcpCommand_CO)) { - /* connection-oriented MGCP */ - if (cmd.line.verb == "CRCX") { - /* TODO: allocate ConnectionID here + store in Table? */ - vc_conn := ops.create_cb.apply(cmd, id); - } else { - var MgcpConnectionId conn_id := f_mgcp_conn_id(mrf.msg); - vc_conn := f_comp_by_conn_id(conn_id); - } + if (f_ep_known(cmd.line.ep)) { + vc_conn := f_comp_by_ep(cmd.line.ep); MGCP_CLIENT.send(cmd) to vc_conn; } else { - /* connectionless MGCP, i.e. messages without ConnectionId */ - var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg); - if (isvalue(r)) { - MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r)); + if (cmd.line.verb == "CRCX") { + vc_conn := ops.create_cb.apply(cmd, id); + if (true /* non-wildcard EP */) { + f_ep_table_add(vc_conn, cmd.line.ep); + } else { + /* add this transaction to list of pending transactions */ + MgcpPendingTrans := MgcpPendingTrans & {cmd.line.trans_id}; + } + MGCP_CLIENT.send(cmd) to vc_conn; + } else { + /* connectionless MGCP, i.e. messages without ConnectionId */ + var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg); + if (isvalue(r)) { + MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r)); + } } } } else { @@ -239,7 +297,12 @@ f_create_expect(crit, vc_conn); MGCP_PROC.reply(MGCPEM_register:{crit, vc_conn}); } + [] MGCP_PROC.getcall(MGCPEM_delete_ep:{?,?}) -> param(ep, vc_conn) { + f_ep_table_del(vc_conn, ep); + MGCP_PROC.reply(MGCPEM_delete_ep:{ep, vc_conn}); + } } + } } @@ -258,9 +321,10 @@ } signature MGCPEM_register(in ExpectCriteria cmd, in MGCP_ConnHdlr hdlr); +signature MGCPEM_delete_ep(in MgcpEndpoint ep, in MGCP_ConnHdlr hdlr); type port MGCPEM_PROC_PT procedure { - inout MGCPEM_register; + inout MGCPEM_register, MGCPEM_delete_ep; } with { extension "internal" }; function f_get_mgcp_by_crit(ExpectCriteria crit) @@ -294,8 +358,6 @@ var MGCP_ConnHdlr ret := null; var template MgcpCommand mgcpcmd; var integer i; - - /* Ensure cmd is a CRCX? */ for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { if (not ispresent(MgcpExpectTable[i].crit)) { @@ -345,6 +407,14 @@ } } +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mgcp_delete_ep(MgcpEndpoint ep) runs on MGCP_ConnHdlr { + MGCP_PROC.call(MGCPEM_delete_ep:{ep, self}) { + [] MGCP_PROC.getreply(MGCPEM_delete_ep:{?,?}) {}; + } +} + + private function f_expect_table_init() runs on MGCP_Emulation_CT { var integer i; -- To view, visit https://gerrit.osmocom.org/6108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8cd7395ee7b076a9a9ef513cc1b71f2db5009845 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Rewrite TC_lu_and_mo_call() to be more modular Message-ID: Review at https://gerrit.osmocom.org/6109 msc: Rewrite TC_lu_and_mo_call() to be more modular All relevant parameters are passed in in form of a CallParameters record, and the bulk of the work has been moved to BSC_ConnectionHandler. Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e --- M library/L3_Templates.ttcn M library/MGCP_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 6 files changed, 210 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/09/6109/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 5816ab9..549997e 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -632,6 +632,30 @@ } } +template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + releaseComplete_MS_NW := { + messageType := '101010'B, + nsd := '00'B, + cause := omit, + facility := omit, + user_user := omit, + ss_VersionIndicator := omit + } + } + } +} + + template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { discriminator := '0101'B, tiOrSkip := { diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index c0c827f..182868e 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -137,8 +137,8 @@ return cmd; } - template MgcpCommand tr_DLCX := { - line := t_MgcpCmdLine("DLCX", ?, ?), + template MgcpCommand tr_DLCX(template MgcpEndpoint ep := ?) := { + line := t_MgcpCmdLine("DLCX", ?, ep), params := *, sdp := * } @@ -152,6 +152,18 @@ params:= *, sdp := * } + + template MgcpResponse ts_DLCX_ACK2(MgcpTransId trans_id) := { + line := { + code := "250", + trans_id := trans_id, + string := "OK" + }, + params:= { /* list of ConnectionIDs */ }, + sdp := omit + } + + template MgcpResponse ts_DLCX_ACK(MgcpTransId trans_id, MgcpConnectionId conn_id, template SDP_Message sdp := omit) := ts_CRCX_ACK(trans_id, conn_id, sdp); @@ -244,16 +256,35 @@ } } - function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { - var integer i; - for (i := 0; i < lengthof(resp.params); i := i + 1) { - var MgcpParameter par := resp.params[i]; - if (par.code == "I") { - return str2hex(par.val); + function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring { + var MgcpParameterList pars; + if (ischosen(msg.command)) { + pars := msg.command.params; + } else { + pars := msg.response.params; + } + for (var integer i := 0; i < lengthof(pars); i := i + 1) { + var MgcpParameter par := pars[i]; + if (par.code == code) { + return par.val; } } setverdict(fail); - return '00000000'H; + return ""; + } + + function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { + var MgcpMessage msg := { + response := resp + } + return str2hex(f_mgcp_extract_par(msg, "I")); + } + + function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId { + var MgcpMessage msg := { + command := cmd + } + return str2hex(f_mgcp_extract_par(msg, "C")); } function f_mgcp_alloc_tid() return MgcpTransId { @@ -282,4 +313,5 @@ sdp := * } + } diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index d691d80..8ce1332 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -2,7 +2,9 @@ import from General_Types all; import from Osmocom_Types all; +import from Native_Functions all; import from GSM_Types all; +import from IPL4asp_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; import from BSSMAP_Emulation all; @@ -16,10 +18,13 @@ import from MGCP_Types all; import from MGCP_Emulation all; +import from MGCP_Templates all; +import from SDP_Types all; import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; import from MobileL3_MM_Types all; +import from MobileL3_CC_Types all; import from L3_Templates all; /* this component represents a single subscriber connection */ @@ -261,6 +266,138 @@ /* re-configure MSC behaviour via VTY */ } +/* parameters related to a (MO?) voice call */ +type record CallParameters { + boolean expect_auth, /* do we expect AUTHENTICATE from network */ + boolean expect_ciph, /* do we expect CIPHER MODE from network */ + + /* CC related parameters */ + hexstring called_party, /* whom are we calling */ + integer transaction_id optional, /* which TS 04.08 CC transaction ID to use */ + BearerCapability_TLV bearer_cap, /* which bearer capabilities to claim */ + + /* MNCC related parameters */ + uint32_t mncc_callref optional, /* call reference on the MNCC side */ + MNCC_bearer_cap mncc_bearer_cap optional, /* MNCC-side bearer capabilities */ + + /* RTP related parameters */ + HostName bss_rtp_ip optional, /* BSS Side RTP IP */ + PortNumber bss_rtp_port optional, /* BSS Side RTP Port */ + HostName mss_rtp_ip optional, /* MSS Side RTP IP */ + PortNumber mss_rtp_port optional, /* MSS Side RTP Port */ + uint7_t rtp_payload_type, /* dynamic RTP payload type */ + charstring rtp_sdp_format, /* AMR/8000 or the like */ + + MgcpCallId mgcp_call_id optional, /* MGCP Call ID; CallAgent allocated */ + MgcpEndpoint mgcp_ep optional /* MGCP Endpoint, CallAgent or MGW allocated */, + MgcpConnectionId mgcp_connection_id_bss, /* MGCP Connection ID BSS Side */ + MgcpConnectionId mgcp_connection_id_mss /* MGCP Connection ID MSS Side */ +} + +template (value) CallParameters t_CallParams(hexstring called, integer tid) := { + expect_auth := false, + expect_ciph := false, + called_party := called, + transaction_id := tid, + bearer_cap := valueof(ts_Bcap_voice), + mncc_callref := omit, + mncc_bearer_cap := valueof(ts_MNCC_bcap_voice), + bss_rtp_ip := "1.1.1.1", + bss_rtp_port := 0,// + mss_rtp_ip := omit, + mss_rtp_port := omit, + rtp_payload_type := 98, + rtp_sdp_format := "AMR/8000", + mgcp_call_id := omit, + mgcp_ep := omit, + mgcp_connection_id_bss := '0'H,// + mgcp_connection_id_mss := '0'H // +}; + + +function f_mo_call(inout CallParameters cpars) +runs on BSC_ConnHdlr { + + var MobileIdentityLV mi; + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + /* If we have a TMSI, use TMSI instead of IMSI */ + if (ispresent(g_pars.tmsi)) { + mi := valueof(ts_MI_TMSI_LV(g_pars.tmsi)); + } else { + mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + } + f_establish_fully(mi, cpars.expect_auth, cpars.expect_ciph); + + /* Create MNCC and MGCP expect */ + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + interleave { + [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc { + cpars.mncc_callref := mncc.u.signal.callref; + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + }; + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + /* TODO: dynamic EP allocation case */ + cpars.mgcp_ep := mgcp_cmd.line.ep; + var SDP_Message sdp := valueof(ts_SDP(cpars.bss_rtp_ip, cpars.bss_rtp_ip, + hex2str(cpars.mgcp_call_id), "42", + cpars.bss_rtp_port, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_bss, sdp)); + } + } + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))); + + alt { + /* FIXME: expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla)); + } + } + + /* Answer. This causes TCH assignment in case of "late assignment" */ + MNCC.send(ts_MNCC_SETUP_COMPL_req(cpars.mncc_callref)); + + f_sleep(3.0); + + /* Hangup by "B" side */ + MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + + /* Release of call */ + MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); + + /* clearing of radio channel */ + interleave { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + /* TODO: For one or all connections on EP? */ + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + } + setverdict(pass); +} diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 83ad17c..5afa93a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -534,60 +534,13 @@ private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - f_perform_lu(false, true, true); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); - - var hexstring called := '12345'H; - var integer tid := 0; - var MNCC_PDU mncc; - var MgcpCommand mgcp_cmd; - f_create_mncc_expect(hex2str(called)); - f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); - - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(tid, called))); - interleave { - [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc { - /* FIXME: extract call_id */ - /* Call Proceeding */ - MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); - }; - [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP("127.0.0.2", "127.0.0.1", "23", "42", 1234, - { "98" }, - { valueof(ts_SDP_rtpmap(98, "AMR/8000")), - valueof(ts_SDP_ptime(20)) })); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, '1234'H, sdp)); - } - } - - /* Alerting */ - MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); - - BSSAP.receive(tr_BSSMAP_AssignmentReq); - BSSAP.send(ts_BSSMAP_AssignmentComplete); - - /* Answer. This causes TCH assignment in case of "late assignment" */ - MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); - - f_sleep(3.0); - - /* Hangup by "B" side */ - MNCC.send(ts_MNCC_DISC_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(23)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(tid))); - - /* Release of call */ - MNCC.send(ts_MNCC_REL_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(42)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); - - /* clearing of radio channel */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - - f_sleep(5.0); + f_perform_lu(cpars.expect_auth, true, true); + f_mo_call(cpars); } testcase TC_lu_and_mo_call() runs on MTC_CT { var BSC_ConnHdlr vc_conn; diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index b501c55..4249947 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -75,7 +75,7 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn " +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn IPA_Emulation.ttcn " diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index 10ec38f..dacd10b 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc *.c" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for... Message-ID: Review at https://gerrit.osmocom.org/6110 BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for receive Change-Id: I8ef753e448453fcab845fbd2936e37a0c22075a0 --- M library/BSSMAP_Templates.ttcn 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/10/6110/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index bc55f58..cf0dfef 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -383,16 +383,17 @@ } template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA(BSSMAP_FIELD_IPAddress addr, - uint16_t udp_port) := { + uint16_t udp_port, + integer len) := { elementIdentifier := '7C'O, - lengthIndicator := 0, /* overwritten */ + lengthIndicator := len, /* overwritten */ ipAddress := addr, uDPPortValue := udp_port } template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA4(OCT4 ip, uint16_t pt) := - ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt); + ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA6(OCT16 ip, uint16_t pt) := - ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt); + ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { elementIdentifier := '83'O, -- To view, visit https://gerrit.osmocom.org/6110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ef753e448453fcab845fbd2936e37a0c22075a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + ... Message-ID: Review at https://gerrit.osmocom.org/6111 BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + aoip Change-Id: I666e70d265d9d5dea7516640809b6081ddeecb88 --- M library/BSSMAP_Templates.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/11/6111/1 diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index cf0dfef..075dab7 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -471,7 +471,9 @@ } } -template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := { +template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *, + template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) +modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { assignmentRequest := { @@ -479,7 +481,7 @@ channelType := ?, layer3HeaderInfo := *, priority := *, - circuitIdentityCode := *, + circuitIdentityCode := cic, downLinkDTX_Flag := *, interferenceBandToBeUsed := *, classmarkInformationType2 := *, @@ -490,7 +492,7 @@ serviceHandover := *, encryptionInformation := *, talkerPriority := *, - aoIPTransportLayer := *, + aoIPTransportLayer := aoip, codecList := *, callIdentifier := *, kC128 := *, -- To view, visit https://gerrit.osmocom.org/6111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I666e70d265d9d5dea7516640809b6081ddeecb88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osm... Message-ID: Review at https://gerrit.osmocom.org/6112 msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osmo-msc This is for patch https://gerrit.osmocom.org/#/c/4980 in osmo-msc Change-Id: Ieec52d5e0da776d35d6a473bd726b368af9d5c66 --- M library/L3_Templates.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Types.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 5 files changed, 93 insertions(+), 25 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/6112/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 549997e..2050e3d 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -585,6 +585,49 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + cc := { + connect_NW_MS := { + messageType := '000111'B, + nsd := '00'B, + facility := *, + progressIndicator := *, + connectedNumber := *, + connectedSubAddress := *, + user_user := * + } + } + } +} + +template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + connectAck := { + messageType := '001111'B, + nsd := '00'B + } + } + } +} + template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { discriminator := '0011'B, tiOrSkip := { diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 182868e..7f10bd2 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -74,8 +74,8 @@ sdp := sdp } - template MgcpCommand tr_CRCX := { - line := t_MgcpCmdLine("CRCX", ?, ?), + template MgcpCommand tr_CRCX(template MgcpEndpoint ep := ?) := { + line := t_MgcpCmdLine("CRCX", ?, ep), params := *, sdp := * } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 46159b7..884a7c0 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -499,9 +499,9 @@ } }; -/* MT: MSC -> MNCC: Respons to SETUP.req */ -template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id := ?, template MNCC_number connected := *, - template charstring imsi := ?) := { +/* MO: MSC <- MNCC: Respons to SETUP.ind */ +template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "", + template MNCC_number connected := omit) := { msg_type := MNCC_SETUP_RSP, u := { signal := { /* See 24.008 9.3.5 */ @@ -513,20 +513,20 @@ connected := connected, cause := omit, progress := omit, - useruser := *, - facility := *, + useruser := omit, /* optional */ + facility := omit, /* optional */ cccap := omit, - ssversion := *, + ssversion := omit, /* optional */ clir_sup := 0, clir_inv := 0, signal := omit, keypad := omit, more := 0, notify := 0, - emergency := *, + emergency := omit, imsi := imsi, - lchan_type := ?, - lchan_mode := ? + lchan_type := 0, + lchan_mode := 0 } } }; @@ -595,9 +595,9 @@ } } -/* MO: MSC <- MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ -template MNCC_PDU ts_MNCC_SETUP_COMPL_req(uint32_t call_id) := - ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ +/* MT: MSC -> MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ +template MNCC_PDU tr_MNCC_SETUP_COMPL_req(template uint32_t call_id) := + tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ /* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */ template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) := diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 8ce1332..75871c5 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -285,6 +285,10 @@ PortNumber bss_rtp_port optional, /* BSS Side RTP Port */ HostName mss_rtp_ip optional, /* MSS Side RTP IP */ PortNumber mss_rtp_port optional, /* MSS Side RTP Port */ + HostName mgw_rtp_ip_bss, /* BSS-facing MGW RTP IP */ + PortNumber mgw_rtp_port_bss, /* BSS-facing MGW RTP Port */ + HostName mgw_rtp_ip_mss, /* MSS-facing MGW RTP IP */ + PortNumber mgw_rtp_port_mss, /* MSS-facing MGW RTP Port */ uint7_t rtp_payload_type, /* dynamic RTP payload type */ charstring rtp_sdp_format, /* AMR/8000 or the like */ @@ -302,10 +306,14 @@ bearer_cap := valueof(ts_Bcap_voice), mncc_callref := omit, mncc_bearer_cap := valueof(ts_MNCC_bcap_voice), - bss_rtp_ip := "1.1.1.1", - bss_rtp_port := 0,// + bss_rtp_ip := "9.8.7.6", + bss_rtp_port := 9000, mss_rtp_ip := omit, mss_rtp_port := omit, + mgw_rtp_ip_bss := "1.1.1.1", + mgw_rtp_port_bss := 10000, + mgw_rtp_ip_mss := "1.1.1.1", + mgw_rtp_port_mss := 11000, rtp_payload_type := 98, rtp_sdp_format := "AMR/8000", mgcp_call_id := omit, @@ -342,13 +350,14 @@ MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); }; + /* First MGCP CRCX (for BSS/RAN side) */ [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); /* TODO: dynamic EP allocation case */ cpars.mgcp_ep := mgcp_cmd.line.ep; - var SDP_Message sdp := valueof(ts_SDP(cpars.bss_rtp_ip, cpars.bss_rtp_ip, + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_bss, cpars.mgw_rtp_ip_bss, hex2str(cpars.mgcp_call_id), "42", - cpars.bss_rtp_port, + cpars.mgw_rtp_port_bss, { int2str(cpars.rtp_payload_type) }, { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, cpars.rtp_sdp_format)), @@ -356,22 +365,37 @@ MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_bss, sdp)); } } + /* Second MGCP CRCX (this time for MSS/CN side) */ + MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + } /* Alerting */ MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))); - alt { - /* FIXME: expect AoIP IP/Port to match what we returned in CRCX_ACK above */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); + interleave { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) {} + /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { var BSSMAP_IE_AoIP_TransportLayerAddress tla; tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla)); } } - /* Answer. This causes TCH assignment in case of "late assignment" */ - MNCC.send(ts_MNCC_SETUP_COMPL_req(cpars.mncc_callref)); + /* Answer. MNCC_SETUP_RSP -> CONNECT to MS; CONNECT_ACK from MS */ + MNCC.send(ts_MNCC_SETUP_rsp(cpars.mncc_callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CONNECT(cpars.transaction_id))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT_ACK(cpars.transaction_id))); f_sleep(3.0); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5afa93a..c5ab892 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -866,7 +866,8 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); /* Answer. This causes TCH assignment in case of "late assignment" */ - MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + //MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + MNCC.send(ts_MNCC_SETUP_rsp(mncc.u.signal.callref)); f_sleep(3.0); -- To view, visit https://gerrit.osmocom.org/6112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieec52d5e0da776d35d6a473bd726b368af9d5c66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_establish_and_nothing Message-ID: Review at https://gerrit.osmocom.org/6113 msc: Add TC_establish_and_nothing Change-Id: Ia8782558d8570750fd95c2b41953aaa61839ef8c Related: OS#2879 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 29 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/13/6113/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c5ab892..f26a825 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1136,6 +1136,35 @@ vc_conn.done; } +/* Test Complete L3 with random payload */ +private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + timer T := 30.0; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive { repeat; } + } +} +testcase TC_establish_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), testcasename(), 25); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia8782558d8570750fd95c2b41953aaa61839ef8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_mo_setup_and_nothing (MO SETUP with no follow-up) Message-ID: Review at https://gerrit.osmocom.org/6114 msc: Add TC_mo_setup_and_nothing (MO SETUP with no follow-up) Change-Id: Ie0352dd91736b04722cf3fb44f90537bc87218c7 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 37 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/6114/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index f26a825..2d43d78 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1145,7 +1145,7 @@ f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); timer T := 30.0; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); } + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); @@ -1165,6 +1165,42 @@ vc_conn.done; } +/* Test MO Call SETUP with no response from MNCC */ +private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + + timer T := 30.0; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive { repeat; } + } +} +testcase TC_mo_setup_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), testcasename(), 26); + vc_conn.done; +} + + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0352dd91736b04722cf3fb44f90537bc87218c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_mo_crcx_ran_timeout Message-ID: Review at https://gerrit.osmocom.org/6115 msc: Add TC_mo_crcx_ran_timeout Change-Id: I085457bd0af429fd3cde6b442604c08cb60eaae3 Related: OS#2881 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 45 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/6115/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 2d43d78..72b13ad 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1200,6 +1200,51 @@ vc_conn.done; } +/* Test MO Call with no response to RAN-side CRCX */ +private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; + cpars.mncc_callref := mncc.u.signal.callref; + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + /* never respond to this */ + + timer T := 30.0; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive { repeat; } + } +} +testcase TC_mo_crcx_ran_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), testcasename(), 27); + vc_conn.done; +} + + /* TODO: -- To view, visit https://gerrit.osmocom.org/6115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I085457bd0af429fd3cde6b442604c08cb60eaae3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_mo_crcx_ran_reject Message-ID: Review at https://gerrit.osmocom.org/6116 msc: Add TC_mo_crcx_ran_reject Change-Id: I9b1e24c505e1d5911bb1f0335034ff8d0641895d Related: OS#2882 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 61 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/6116/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 72b13ad..8172e7a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1244,6 +1244,67 @@ vc_conn.done; } +/* Test MO Call with reject to RAN-side CRCX */ +private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; + cpars.mncc_callref := mncc.u.signal.callref; + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; + /* Respond to CRCX with error */ + var MgcpResponse mgcp_rsp := { + line := { + code := "542", + trans_id := mgcp_cmd.line.trans_id, + string := "FORCED_FAIL" + }, + params := omit, + sdp := omit + } + MGCP.send(mgcp_rsp); + + timer T := 30.0; + T.start; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + [] MGCP.receive { repeat; } + } +} +testcase TC_mo_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), testcasename(), 28); + vc_conn.done; +} + -- To view, visit https://gerrit.osmocom.org/6116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9b1e24c505e1d5911bb1f0335034ff8d0641895d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add missing timer start in MO call related tests Message-ID: Review at https://gerrit.osmocom.org/6117 msc: Add missing timer start in MO call related tests Change-Id: I13958b40426ef871b4c69561385a39eea95e24e4 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/17/6117/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 8172e7a..9e01fd5 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1144,6 +1144,7 @@ f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); timer T := 30.0; + T.start; alt { [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { @@ -1179,6 +1180,7 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); timer T := 30.0; + T.start; alt { [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { @@ -1223,6 +1225,7 @@ /* never respond to this */ timer T := 30.0; + T.start; alt { [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { -- To view, visit https://gerrit.osmocom.org/6117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I13958b40426ef871b4c69561385a39eea95e24e4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Jan 26 21:54:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 26 Jan 2018 21:54:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Ensure all MO call related tests are in control section Message-ID: Review at https://gerrit.osmocom.org/6118 msc: Ensure all MO call related tests are in control section Change-Id: Id836b695d9ac1bc8135af95be2b90b5a3e29fd34 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/18/6118/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9e01fd5..43ae760 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1222,6 +1222,8 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; /* never respond to this */ timer T := 30.0; @@ -1350,6 +1352,10 @@ execute( TC_lu_imsi_auth_tmsi_encr_13_13() ); execute( TC_cl3_no_payload() ); execute( TC_cl3_rnd_payload() ); + execute( TC_establish_and_nothing() ); + execute( TC_mo_setup_and_nothing() ); + execute( TC_mo_crcx_ran_timeout() ); + execute( TC_mo_crcx_ran_reject() ); } -- To view, visit https://gerrit.osmocom.org/6118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id836b695d9ac1bc8135af95be2b90b5a3e29fd34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:00:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:00:25 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Move f_sleep() to common Osmocom_Types.ttcn In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:00:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:00:52 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Move auth/ciph handling in shared f_mm_common() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib174b1e7153ce2ae531755cd0ba586bb12264551 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:01 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_Emulation: Move from connetion-based to endpoint-based ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8cd7395ee7b076a9a9ef513cc1b71f2db5009845 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:07 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Rewrite TC_lu_and_mo_call() to be more modular In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:12 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ef753e448453fcab845fbd2936e37a0c22075a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:17 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I666e70d265d9d5dea7516640809b6081ddeecb88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:27 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osm... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieec52d5e0da776d35d6a473bd726b368af9d5c66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:31 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_establish_and_nothing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia8782558d8570750fd95c2b41953aaa61839ef8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:36 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_mo_setup_and_nothing (MO SETUP with no follow-up) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0352dd91736b04722cf3fb44f90537bc87218c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:42 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_mo_crcx_ran_timeout In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I085457bd0af429fd3cde6b442604c08cb60eaae3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:48 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_mo_crcx_ran_reject In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b1e24c505e1d5911bb1f0335034ff8d0641895d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:01:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:01:55 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add missing timer start in MO call related tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I13958b40426ef871b4c69561385a39eea95e24e4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:02:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:05 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Ensure all MO call related tests are in control section In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id836b695d9ac1bc8135af95be2b90b5a3e29fd34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 00:02:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:08 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Ensure all MO call related tests are in control section In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Ensure all MO call related tests are in control section ...................................................................... msc: Ensure all MO call related tests are in control section Change-Id: Id836b695d9ac1bc8135af95be2b90b5a3e29fd34 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9e01fd5..43ae760 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1222,6 +1222,8 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; /* never respond to this */ timer T := 30.0; @@ -1350,6 +1352,10 @@ execute( TC_lu_imsi_auth_tmsi_encr_13_13() ); execute( TC_cl3_no_payload() ); execute( TC_cl3_rnd_payload() ); + execute( TC_establish_and_nothing() ); + execute( TC_mo_setup_and_nothing() ); + execute( TC_mo_crcx_ran_timeout() ); + execute( TC_mo_crcx_ran_reject() ); } -- To view, visit https://gerrit.osmocom.org/6118 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id836b695d9ac1bc8135af95be2b90b5a3e29fd34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:09 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add missing timer start in MO call related tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add missing timer start in MO call related tests ...................................................................... msc: Add missing timer start in MO call related tests Change-Id: I13958b40426ef871b4c69561385a39eea95e24e4 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 8172e7a..9e01fd5 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1144,6 +1144,7 @@ f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); timer T := 30.0; + T.start; alt { [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { @@ -1179,6 +1180,7 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); timer T := 30.0; + T.start; alt { [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { @@ -1223,6 +1225,7 @@ /* never respond to this */ timer T := 30.0; + T.start; alt { [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { -- To view, visit https://gerrit.osmocom.org/6117 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I13958b40426ef871b4c69561385a39eea95e24e4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:09 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_mo_crcx_ran_reject In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_mo_crcx_ran_reject ...................................................................... msc: Add TC_mo_crcx_ran_reject Change-Id: I9b1e24c505e1d5911bb1f0335034ff8d0641895d Related: OS#2882 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 61 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 72b13ad..8172e7a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1244,6 +1244,67 @@ vc_conn.done; } +/* Test MO Call with reject to RAN-side CRCX */ +private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; + cpars.mncc_callref := mncc.u.signal.callref; + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; + /* Respond to CRCX with error */ + var MgcpResponse mgcp_rsp := { + line := { + code := "542", + trans_id := mgcp_cmd.line.trans_id, + string := "FORCED_FAIL" + }, + params := omit, + sdp := omit + } + MGCP.send(mgcp_rsp); + + timer T := 30.0; + T.start; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + [] MGCP.receive { repeat; } + } +} +testcase TC_mo_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_reject), testcasename(), 28); + vc_conn.done; +} + -- To view, visit https://gerrit.osmocom.org/6116 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b1e24c505e1d5911bb1f0335034ff8d0641895d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:09 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_mo_crcx_ran_timeout In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_mo_crcx_ran_timeout ...................................................................... msc: Add TC_mo_crcx_ran_timeout Change-Id: I085457bd0af429fd3cde6b442604c08cb60eaae3 Related: OS#2881 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 45 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 2d43d78..72b13ad 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1200,6 +1200,51 @@ vc_conn.done; } +/* Test MO Call with no response to RAN-side CRCX */ +private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc; + cpars.mncc_callref := mncc.u.signal.callref; + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + /* never respond to this */ + + timer T := 30.0; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive { repeat; } + } +} +testcase TC_mo_crcx_ran_timeout() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_crcx_ran_timeout), testcasename(), 27); + vc_conn.done; +} + + /* TODO: -- To view, visit https://gerrit.osmocom.org/6115 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I085457bd0af429fd3cde6b442604c08cb60eaae3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:09 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_mo_setup_and_nothing (MO SETUP with no follow-up) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_mo_setup_and_nothing (MO SETUP with no follow-up) ...................................................................... msc: Add TC_mo_setup_and_nothing (MO SETUP with no follow-up) Change-Id: Ie0352dd91736b04722cf3fb44f90537bc87218c7 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 37 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index f26a825..2d43d78 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1145,7 +1145,7 @@ f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); timer T := 30.0; alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); } + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); @@ -1165,6 +1165,42 @@ vc_conn.done; } +/* Test MO Call SETUP with no response from MNCC */ +private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + + timer T := 30.0; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive { repeat; } + } +} +testcase TC_mo_setup_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mo_setup_and_nothing), testcasename(), 26); + vc_conn.done; +} + + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6114 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0352dd91736b04722cf3fb44f90537bc87218c7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:10 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_establish_and_nothing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_establish_and_nothing ...................................................................... msc: Add TC_establish_and_nothing Change-Id: Ia8782558d8570750fd95c2b41953aaa61839ef8c Related: OS#2879 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 29 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c5ab892..f26a825 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1136,6 +1136,35 @@ vc_conn.done; } +/* Test Complete L3 with random payload */ +private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + + f_perform_lu(false, true, true, false); + + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + timer T := 30.0; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive { repeat; } + } +} +testcase TC_establish_and_nothing() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_establish_and_nothing), testcasename(), 25); + vc_conn.done; +} + /* TODO: * continue to send repeated MO signalling messages to keep channel open: does MSC tmeout? -- To view, visit https://gerrit.osmocom.org/6113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia8782558d8570750fd95c2b41953aaa61839ef8c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:10 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osm... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osmo-msc ...................................................................... msc: Make TC_lu_and_mo_call succeed with osmo-mg enabled osmo-msc This is for patch https://gerrit.osmocom.org/#/c/4980 in osmo-msc Change-Id: Ieec52d5e0da776d35d6a473bd726b368af9d5c66 --- M library/L3_Templates.ttcn M library/MGCP_Templates.ttcn M library/MNCC_Types.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 5 files changed, 93 insertions(+), 25 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 549997e..2050e3d 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -585,6 +585,49 @@ } } +template PDU_ML3_NW_MS tr_ML3_MT_CC_CONNECT(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '1'B, + tIExtension := omit + } + }, + msgs := { + cc := { + connect_NW_MS := { + messageType := '000111'B, + nsd := '00'B, + facility := *, + progressIndicator := *, + connectedNumber := *, + connectedSubAddress := *, + user_user := * + } + } + } +} + +template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_CONNECT_ACK(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + connectAck := { + messageType := '001111'B, + nsd := '00'B + } + } + } +} + template PDU_ML3_NW_MS tr_ML3_MT_CC_DISC(integer tid) := { discriminator := '0011'B, tiOrSkip := { diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 182868e..7f10bd2 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -74,8 +74,8 @@ sdp := sdp } - template MgcpCommand tr_CRCX := { - line := t_MgcpCmdLine("CRCX", ?, ?), + template MgcpCommand tr_CRCX(template MgcpEndpoint ep := ?) := { + line := t_MgcpCmdLine("CRCX", ?, ep), params := *, sdp := * } diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 46159b7..884a7c0 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -499,9 +499,9 @@ } }; -/* MT: MSC -> MNCC: Respons to SETUP.req */ -template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id := ?, template MNCC_number connected := *, - template charstring imsi := ?) := { +/* MO: MSC <- MNCC: Respons to SETUP.ind */ +template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "", + template MNCC_number connected := omit) := { msg_type := MNCC_SETUP_RSP, u := { signal := { /* See 24.008 9.3.5 */ @@ -513,20 +513,20 @@ connected := connected, cause := omit, progress := omit, - useruser := *, - facility := *, + useruser := omit, /* optional */ + facility := omit, /* optional */ cccap := omit, - ssversion := *, + ssversion := omit, /* optional */ clir_sup := 0, clir_inv := 0, signal := omit, keypad := omit, more := 0, notify := 0, - emergency := *, + emergency := omit, imsi := imsi, - lchan_type := ?, - lchan_mode := ? + lchan_type := 0, + lchan_mode := 0 } } }; @@ -595,9 +595,9 @@ } } -/* MO: MSC <- MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ -template MNCC_PDU ts_MNCC_SETUP_COMPL_req(uint32_t call_id) := - ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ +/* MT: MSC -> MNCC: SETUP_COMPL.req; request to send CONNECT ACK */ +template MNCC_PDU tr_MNCC_SETUP_COMPL_req(template uint32_t call_id) := + tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_REQ, call_id); /* See 24.008 9.3.6 */ /* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */ template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) := diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 8ce1332..75871c5 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -285,6 +285,10 @@ PortNumber bss_rtp_port optional, /* BSS Side RTP Port */ HostName mss_rtp_ip optional, /* MSS Side RTP IP */ PortNumber mss_rtp_port optional, /* MSS Side RTP Port */ + HostName mgw_rtp_ip_bss, /* BSS-facing MGW RTP IP */ + PortNumber mgw_rtp_port_bss, /* BSS-facing MGW RTP Port */ + HostName mgw_rtp_ip_mss, /* MSS-facing MGW RTP IP */ + PortNumber mgw_rtp_port_mss, /* MSS-facing MGW RTP Port */ uint7_t rtp_payload_type, /* dynamic RTP payload type */ charstring rtp_sdp_format, /* AMR/8000 or the like */ @@ -302,10 +306,14 @@ bearer_cap := valueof(ts_Bcap_voice), mncc_callref := omit, mncc_bearer_cap := valueof(ts_MNCC_bcap_voice), - bss_rtp_ip := "1.1.1.1", - bss_rtp_port := 0,// + bss_rtp_ip := "9.8.7.6", + bss_rtp_port := 9000, mss_rtp_ip := omit, mss_rtp_port := omit, + mgw_rtp_ip_bss := "1.1.1.1", + mgw_rtp_port_bss := 10000, + mgw_rtp_ip_mss := "1.1.1.1", + mgw_rtp_port_mss := 11000, rtp_payload_type := 98, rtp_sdp_format := "AMR/8000", mgcp_call_id := omit, @@ -342,13 +350,14 @@ MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); }; + /* First MGCP CRCX (for BSS/RAN side) */ [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); /* TODO: dynamic EP allocation case */ cpars.mgcp_ep := mgcp_cmd.line.ep; - var SDP_Message sdp := valueof(ts_SDP(cpars.bss_rtp_ip, cpars.bss_rtp_ip, + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_bss, cpars.mgw_rtp_ip_bss, hex2str(cpars.mgcp_call_id), "42", - cpars.bss_rtp_port, + cpars.mgw_rtp_port_bss, { int2str(cpars.rtp_payload_type) }, { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, cpars.rtp_sdp_format)), @@ -356,22 +365,37 @@ MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_bss, sdp)); } } + /* Second MGCP CRCX (this time for MSS/CN side) */ + MGCP.receive(tr_CRCX(cpars.mgcp_ep)) -> value mgcp_cmd { + var SDP_Message sdp := valueof(ts_SDP(cpars.mgw_rtp_ip_mss, cpars.mgw_rtp_ip_mss, + hex2str(cpars.mgcp_call_id), "42", + cpars.mgw_rtp_port_mss, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_mss, sdp)); + } /* Alerting */ MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))); - alt { - /* FIXME: expect AoIP IP/Port to match what we returned in CRCX_ACK above */ - [] BSSAP.receive(tr_BSSMAP_AssignmentReq) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla_ass := + valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.mgw_rtp_ip_bss),cpars.mgw_rtp_port_bss)); + interleave { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))) {} + /* expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq(omit, tla_ass)) { var BSSMAP_IE_AoIP_TransportLayerAddress tla; tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla)); } } - /* Answer. This causes TCH assignment in case of "late assignment" */ - MNCC.send(ts_MNCC_SETUP_COMPL_req(cpars.mncc_callref)); + /* Answer. MNCC_SETUP_RSP -> CONNECT to MS; CONNECT_ACK from MS */ + MNCC.send(ts_MNCC_SETUP_rsp(cpars.mncc_callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CONNECT(cpars.transaction_id))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CONNECT_ACK(cpars.transaction_id))); f_sleep(3.0); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 5afa93a..c5ab892 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -866,7 +866,8 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); /* Answer. This causes TCH assignment in case of "late assignment" */ - MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + //MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); + MNCC.send(ts_MNCC_SETUP_rsp(mncc.u.signal.callref)); f_sleep(3.0); -- To view, visit https://gerrit.osmocom.org/6112 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieec52d5e0da776d35d6a473bd726b368af9d5c66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:10 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + aoip ...................................................................... BSSMAP_Templates: tr_BSSMAP_AssignmentReq support for cic + aoip Change-Id: I666e70d265d9d5dea7516640809b6081ddeecb88 --- M library/BSSMAP_Templates.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index cf0dfef..075dab7 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -471,7 +471,9 @@ } } -template PDU_BSSAP tr_BSSMAP_AssignmentReq modifies tr_BSSAP_BSSMAP := { +template PDU_BSSAP tr_BSSMAP_AssignmentReq(template BSSMAP_IE_CircuitIdentityCode cic := *, + template BSSMAP_IE_AoIP_TransportLayerAddress aoip := *) +modifies tr_BSSAP_BSSMAP := { pdu := { bssmap := { assignmentRequest := { @@ -479,7 +481,7 @@ channelType := ?, layer3HeaderInfo := *, priority := *, - circuitIdentityCode := *, + circuitIdentityCode := cic, downLinkDTX_Flag := *, interferenceBandToBeUsed := *, classmarkInformationType2 := *, @@ -490,7 +492,7 @@ serviceHandover := *, encryptionInformation := *, talkerPriority := *, - aoIPTransportLayer := *, + aoIPTransportLayer := aoip, codecList := *, callIdentifier := *, kC128 := *, -- To view, visit https://gerrit.osmocom.org/6111 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I666e70d265d9d5dea7516640809b6081ddeecb88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:10 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for receive ...................................................................... BSSMAP_Templates: Make ts_BSSMAP_IE_AoIP_TLA also usable for receive Change-Id: I8ef753e448453fcab845fbd2936e37a0c22075a0 --- M library/BSSMAP_Templates.ttcn 1 file changed, 5 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index bc55f58..cf0dfef 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -383,16 +383,17 @@ } template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA(BSSMAP_FIELD_IPAddress addr, - uint16_t udp_port) := { + uint16_t udp_port, + integer len) := { elementIdentifier := '7C'O, - lengthIndicator := 0, /* overwritten */ + lengthIndicator := len, /* overwritten */ ipAddress := addr, uDPPortValue := udp_port } template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA4(OCT4 ip, uint16_t pt) := - ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt); + ts_BSSMAP_IE_AoIP_TLA({ipv4:=ip}, pt, 6); template (value) BSSMAP_IE_AoIP_TransportLayerAddress ts_BSSMAP_IE_AoIP_TLA6(OCT16 ip, uint16_t pt) := - ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt); + ts_BSSMAP_IE_AoIP_TLA({ipv6:=ip}, pt, 18); template (value) BSSMAP_IE_KC128 ts_BSSMAP_IE_Kc128(OCT16 kc128) := { elementIdentifier := '83'O, -- To view, visit https://gerrit.osmocom.org/6110 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ef753e448453fcab845fbd2936e37a0c22075a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:11 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Rewrite TC_lu_and_mo_call() to be more modular In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Rewrite TC_lu_and_mo_call() to be more modular ...................................................................... msc: Rewrite TC_lu_and_mo_call() to be more modular All relevant parameters are passed in in form of a CallParameters record, and the bulk of the work has been moved to BSC_ConnectionHandler. Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e --- M library/L3_Templates.ttcn M library/MGCP_Templates.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn M msc_tests/gen_links.sh M msc_tests/regen_makefile.sh 6 files changed, 210 insertions(+), 64 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 5816ab9..549997e 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -632,6 +632,30 @@ } } +template (value) PDU_ML3_MS_NW ts_ML3_MO_CC_REL_COMPL(integer tid) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, + tIExtension := omit + } + }, + msgs := { + cc := { + releaseComplete_MS_NW := { + messageType := '101010'B, + nsd := '00'B, + cause := omit, + facility := omit, + user_user := omit, + ss_VersionIndicator := omit + } + } + } +} + + template PDU_ML3_NW_MS tr_ML3_MT_MM_AUTH_REQ(template OCT16 rand := ?) := { discriminator := '0101'B, tiOrSkip := { diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index c0c827f..182868e 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -137,8 +137,8 @@ return cmd; } - template MgcpCommand tr_DLCX := { - line := t_MgcpCmdLine("DLCX", ?, ?), + template MgcpCommand tr_DLCX(template MgcpEndpoint ep := ?) := { + line := t_MgcpCmdLine("DLCX", ?, ep), params := *, sdp := * } @@ -152,6 +152,18 @@ params:= *, sdp := * } + + template MgcpResponse ts_DLCX_ACK2(MgcpTransId trans_id) := { + line := { + code := "250", + trans_id := trans_id, + string := "OK" + }, + params:= { /* list of ConnectionIDs */ }, + sdp := omit + } + + template MgcpResponse ts_DLCX_ACK(MgcpTransId trans_id, MgcpConnectionId conn_id, template SDP_Message sdp := omit) := ts_CRCX_ACK(trans_id, conn_id, sdp); @@ -244,16 +256,35 @@ } } - function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { - var integer i; - for (i := 0; i < lengthof(resp.params); i := i + 1) { - var MgcpParameter par := resp.params[i]; - if (par.code == "I") { - return str2hex(par.val); + function f_mgcp_extract_par(MgcpMessage msg, MgcpInfoCode code) return charstring { + var MgcpParameterList pars; + if (ischosen(msg.command)) { + pars := msg.command.params; + } else { + pars := msg.response.params; + } + for (var integer i := 0; i < lengthof(pars); i := i + 1) { + var MgcpParameter par := pars[i]; + if (par.code == code) { + return par.val; } } setverdict(fail); - return '00000000'H; + return ""; + } + + function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { + var MgcpMessage msg := { + response := resp + } + return str2hex(f_mgcp_extract_par(msg, "I")); + } + + function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId { + var MgcpMessage msg := { + command := cmd + } + return str2hex(f_mgcp_extract_par(msg, "C")); } function f_mgcp_alloc_tid() return MgcpTransId { @@ -282,4 +313,5 @@ sdp := * } + } diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index d691d80..8ce1332 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -2,7 +2,9 @@ import from General_Types all; import from Osmocom_Types all; +import from Native_Functions all; import from GSM_Types all; +import from IPL4asp_Types all; import from SCCPasp_Types all; import from BSSAP_Types all; import from BSSMAP_Emulation all; @@ -16,10 +18,13 @@ import from MGCP_Types all; import from MGCP_Emulation all; +import from MGCP_Templates all; +import from SDP_Types all; import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; import from MobileL3_MM_Types all; +import from MobileL3_CC_Types all; import from L3_Templates all; /* this component represents a single subscriber connection */ @@ -261,6 +266,138 @@ /* re-configure MSC behaviour via VTY */ } +/* parameters related to a (MO?) voice call */ +type record CallParameters { + boolean expect_auth, /* do we expect AUTHENTICATE from network */ + boolean expect_ciph, /* do we expect CIPHER MODE from network */ + + /* CC related parameters */ + hexstring called_party, /* whom are we calling */ + integer transaction_id optional, /* which TS 04.08 CC transaction ID to use */ + BearerCapability_TLV bearer_cap, /* which bearer capabilities to claim */ + + /* MNCC related parameters */ + uint32_t mncc_callref optional, /* call reference on the MNCC side */ + MNCC_bearer_cap mncc_bearer_cap optional, /* MNCC-side bearer capabilities */ + + /* RTP related parameters */ + HostName bss_rtp_ip optional, /* BSS Side RTP IP */ + PortNumber bss_rtp_port optional, /* BSS Side RTP Port */ + HostName mss_rtp_ip optional, /* MSS Side RTP IP */ + PortNumber mss_rtp_port optional, /* MSS Side RTP Port */ + uint7_t rtp_payload_type, /* dynamic RTP payload type */ + charstring rtp_sdp_format, /* AMR/8000 or the like */ + + MgcpCallId mgcp_call_id optional, /* MGCP Call ID; CallAgent allocated */ + MgcpEndpoint mgcp_ep optional /* MGCP Endpoint, CallAgent or MGW allocated */, + MgcpConnectionId mgcp_connection_id_bss, /* MGCP Connection ID BSS Side */ + MgcpConnectionId mgcp_connection_id_mss /* MGCP Connection ID MSS Side */ +} + +template (value) CallParameters t_CallParams(hexstring called, integer tid) := { + expect_auth := false, + expect_ciph := false, + called_party := called, + transaction_id := tid, + bearer_cap := valueof(ts_Bcap_voice), + mncc_callref := omit, + mncc_bearer_cap := valueof(ts_MNCC_bcap_voice), + bss_rtp_ip := "1.1.1.1", + bss_rtp_port := 0,// + mss_rtp_ip := omit, + mss_rtp_port := omit, + rtp_payload_type := 98, + rtp_sdp_format := "AMR/8000", + mgcp_call_id := omit, + mgcp_ep := omit, + mgcp_connection_id_bss := '0'H,// + mgcp_connection_id_mss := '0'H // +}; + + +function f_mo_call(inout CallParameters cpars) +runs on BSC_ConnHdlr { + + var MobileIdentityLV mi; + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + /* If we have a TMSI, use TMSI instead of IMSI */ + if (ispresent(g_pars.tmsi)) { + mi := valueof(ts_MI_TMSI_LV(g_pars.tmsi)); + } else { + mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + } + f_establish_fully(mi, cpars.expect_auth, cpars.expect_ciph); + + /* Create MNCC and MGCP expect */ + f_create_mncc_expect(hex2str(cpars.called_party)); + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); + interleave { + [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(cpars.called_party)))) -> value mncc { + cpars.mncc_callref := mncc.u.signal.callref; + /* Call Proceeding */ + MNCC.send(ts_MNCC_CALL_PROC_req(cpars.mncc_callref, cpars.mncc_bearer_cap)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(cpars.transaction_id))); + }; + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + /* TODO: dynamic EP allocation case */ + cpars.mgcp_ep := mgcp_cmd.line.ep; + var SDP_Message sdp := valueof(ts_SDP(cpars.bss_rtp_ip, cpars.bss_rtp_ip, + hex2str(cpars.mgcp_call_id), "42", + cpars.bss_rtp_port, + { int2str(cpars.rtp_payload_type) }, + { valueof(ts_SDP_rtpmap(cpars.rtp_payload_type, + cpars.rtp_sdp_format)), + valueof(ts_SDP_ptime(20)) })); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, cpars.mgcp_connection_id_bss, sdp)); + } + } + + /* Alerting */ + MNCC.send(ts_MNCC_ALERT_req(cpars.mncc_callref)); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(cpars.transaction_id))); + + alt { + /* FIXME: expect AoIP IP/Port to match what we returned in CRCX_ACK above */ + [] BSSAP.receive(tr_BSSMAP_AssignmentReq) { + var BSSMAP_IE_AoIP_TransportLayerAddress tla; + tla := valueof(ts_BSSMAP_IE_AoIP_TLA4(f_inet_addr(cpars.bss_rtp_ip), cpars.bss_rtp_port)); + BSSAP.send(ts_BSSMAP_AssignmentComplete(omit, tla)); + } + } + + /* Answer. This causes TCH assignment in case of "late assignment" */ + MNCC.send(ts_MNCC_SETUP_COMPL_req(cpars.mncc_callref)); + + f_sleep(3.0); + + /* Hangup by "B" side */ + MNCC.send(ts_MNCC_DISC_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + + /* Release of call */ + MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(42)))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); + + /* clearing of radio channel */ + interleave { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + /* TODO: For one or all connections on EP? */ + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + } + } + setverdict(pass); +} diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 83ad17c..5afa93a 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -534,60 +534,13 @@ private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { g_pars := pars; - f_perform_lu(false, true, true); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); - - var hexstring called := '12345'H; - var integer tid := 0; - var MNCC_PDU mncc; - var MgcpCommand mgcp_cmd; - f_create_mncc_expect(hex2str(called)); - f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); - - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(tid, called))); - interleave { - [] MNCC.receive(tr_MNCC_SETUP_ind(?, tr_MNCC_number(hex2str(called)))) -> value mncc { - /* FIXME: extract call_id */ - /* Call Proceeding */ - MNCC.send(ts_MNCC_CALL_PROC_req(mncc.u.signal.callref, ts_MNCC_bcap_voice)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_CALL_PROC(tid))); - }; - [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { - var SDP_Message sdp := valueof(ts_SDP("127.0.0.2", "127.0.0.1", "23", "42", 1234, - { "98" }, - { valueof(ts_SDP_rtpmap(98, "AMR/8000")), - valueof(ts_SDP_ptime(20)) })); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, '1234'H, sdp)); - } - } - - /* Alerting */ - MNCC.send(ts_MNCC_ALERT_req(mncc.u.signal.callref)); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_ALERTING(tid))); - - BSSAP.receive(tr_BSSMAP_AssignmentReq); - BSSAP.send(ts_BSSMAP_AssignmentComplete); - - /* Answer. This causes TCH assignment in case of "late assignment" */ - MNCC.send(ts_MNCC_SETUP_COMPL_req(mncc.u.signal.callref)); - - f_sleep(3.0); - - /* Hangup by "B" side */ - MNCC.send(ts_MNCC_DISC_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(23)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(tid))); - - /* Release of call */ - MNCC.send(ts_MNCC_REL_req(mncc.u.signal.callref, valueof(ts_MNCC_cause(42)))); - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); - - /* clearing of radio channel */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - - f_sleep(5.0); + f_perform_lu(cpars.expect_auth, true, true); + f_mo_call(cpars); } testcase TC_lu_and_mo_call() runs on MTC_CT { var BSC_ConnHdlr vc_conn; diff --git a/msc_tests/gen_links.sh b/msc_tests/gen_links.sh index b501c55..4249947 100755 --- a/msc_tests/gen_links.sh +++ b/msc_tests/gen_links.sh @@ -75,7 +75,7 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn " +FILES="General_Types.ttcn GSM_Types.ttcn Osmocom_Types.ttcn MNCC_Types.ttcn MNCC_EncDec.cc MNCC_CodecPort.ttcn mncc.h MNCC_Emulation.ttcn Osmocom_VTY_Functions.ttcn Native_Functions.ttcn Native_FunctionDefs.cc " FILES+="IPA_Types.ttcn IPA_Emulation.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc RSL_Types.ttcn GSUP_Types.ttcn GSUP_Emulation.ttcn " FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn L3_Templates.ttcn L3_Templates.ttcn " FILES+="BSSMAP_Emulation.ttcn BSSAP_CodecPort.ttcn BSSMAP_Templates.ttcn BSSAP_Adapter.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_Emulation.ttcn IPA_Emulation.ttcn " diff --git a/msc_tests/regen_makefile.sh b/msc_tests/regen_makefile.sh index 10ec38f..dacd10b 100755 --- a/msc_tests/regen_makefile.sh +++ b/msc_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc *.c" +FILES="*.ttcn SCCP_EncDec.cc SCTPasp_PT.cc TCCConversion.cc TCCInterface.cc UD_PT.cc MNCC_EncDec.cc IPL4asp_PT.cc IPL4asp_discovery.cc SDP_EncDec.cc RTP_EncDec.cc IPA_CodecPort_CtrlFunctDef.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc TELNETasp_PT.cc Native_FunctionDefs.cc *.c" ../regen-makefile.sh MSC_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6109 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I932c6c9f7a48b6a1f1ec399e8bba6a413c8bc69e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:11 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_Emulation: Move from connetion-based to endpoint-based ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_Emulation: Move from connetion-based to endpoint-based model ...................................................................... MGCP_Emulation: Move from connetion-based to endpoint-based model In the end, we will often see two connections that relate to one endpoint, so let's dispatch based on the endpoint name and not based on the connection identifier. In the BSC case, we have * two MGCP connections on one EP in case of RTP/IP based Abis * one MGCP connectio on one EP in case of E1/T1 based Abis In the MSC case, we have * two MGCP connections on one EP: BSS and MSS/MNCC side Change-Id: I8cd7395ee7b076a9a9ef513cc1b71f2db5009845 --- M library/MGCP_Emulation.ttcn 1 file changed, 122 insertions(+), 52 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 5bd4e50..df8e4b4 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -38,7 +38,6 @@ port MGCP_Conn_PT MGCP; /* procedure based port to register for incoming connections */ port MGCPEM_PROC_PT MGCP_PROC; - var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ @@ -46,11 +45,14 @@ inout MgcpCommand, MgcpResponse; } with { extension "internal" }; -/* represents a single MGCP Connection */ -type record ConnectionData { +/* represents a single MGCP Endpoint */ +type record EndpointData { MGCP_ConnHdlr comp_ref, - MgcpConnectionId conn_id optional + MgcpEndpoint endpoint optional }; + +/* pending CRCX with their transaction ID */ +type set of MgcpTransId MgcpTransIds; type component MGCP_Emulation_CT { /* Port facing to the UDP SUT */ @@ -60,7 +62,8 @@ * to send where with CLIENT.send() to vc_conn */ port MGCP_Conn_PT MGCP_CLIENT; /* currently tracked connections */ - var ConnectionData MgcpConnectionTable[16]; + var EndpointData MgcpEndpointTable[16]; + var MgcpTransIds MgcpPendingTrans := {}; /* pending expected CRCX */ var ExpectData MgcpExpectTable[8]; /* procedure based port to register for incoming connections */ @@ -101,11 +104,11 @@ return mrf; } -private function f_conn_id_known(MgcpConnectionId conn_id) +private function f_ep_known(MgcpEndpoint ep) runs on MGCP_Emulation_CT return boolean { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].conn_id == conn_id) { + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].endpoint == ep) { return true; } } @@ -115,69 +118,113 @@ private function f_comp_known(MGCP_ConnHdlr client) runs on MGCP_Emulation_CT return boolean { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].comp_ref == client) { + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].comp_ref == client) { return true; } } return false; } -private function f_comp_by_conn_id(MgcpConnectionId conn_id) +private function f_comp_by_ep(MgcpEndpoint ep) runs on MGCP_Emulation_CT return MGCP_ConnHdlr { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].conn_id == conn_id) { - return MgcpConnectionTable[i].comp_ref; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].endpoint == ep) { + return MgcpEndpointTable[i].comp_ref; } } - log("MGCP Connection Table not found by Connection Id", conn_id); + log("MGCP Endpoint Table not found by Endpoint", ep); setverdict(fail); self.stop; } -private function f_conn_id_by_comp(MGCP_ConnHdlr client) -runs on MGCP_Emulation_CT return MgcpConnectionId { +private function f_ep_by_comp(MGCP_ConnHdlr client) +runs on MGCP_Emulation_CT return MgcpEndpoint { var integer i; - for (i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - if (MgcpConnectionTable[i].comp_ref == client) { - return MgcpConnectionTable[i].conn_id; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].comp_ref == client) { + return MgcpEndpointTable[i].endpoint; } } - log("MGCP Connection Table not found by component ", client); + log("MGCP Endpoint Table not found by component ", client); setverdict(fail); self.stop; +} + +private function f_ep_table_add(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) +runs on MGCP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (not isvalue(MgcpEndpointTable[i].endpoint)) { + MgcpEndpointTable[i].endpoint := ep; + MgcpEndpointTable[i].comp_ref := comp_ref; + return; + } + } + setverdict(fail, "MGCP Endpoint Table full!"); + self.stop; +} + +private function f_ep_table_del(MGCP_ConnHdlr comp_ref, MgcpEndpoint ep) +runs on MGCP_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + if (MgcpEndpointTable[i].comp_ref == comp_ref and + MgcpEndpointTable[i].endpoint == ep) { + MgcpEndpointTable[i].endpoint := omit; + MgcpEndpointTable[i].comp_ref := null; + return; + } + } + setverdict(fail, "MGCP Endpoint Table: Couldn't find to-be-deleted entry!"); + self.stop; +} + + +/* Check if the given transaction ID is a pending CRCX. If yes, return true + remove */ +private function f_trans_id_was_pending(MgcpTransId trans_id) +runs on MGCP_Emulation_CT return boolean { + for (var integer i := 0; i < lengthof(MgcpPendingTrans); i := i+1) { + if (MgcpPendingTrans[i] == trans_id) { + /* Remove from list */ + var MgcpTransIds OldPendingTrans := MgcpPendingTrans; + MgcpPendingTrans := {} + for (var integer j := 0; j < lengthof(OldPendingTrans); j := j+1) { + if (j != i) { + MgcpPendingTrans := MgcpPendingTrans & {OldPendingTrans[j]}; + } + } + return true; + } + } + return false; } /* TODO: move this to MGCP_Types? */ -function f_mgcp_conn_id(MgcpMessage msg) return hexstring { +function f_mgcp_ep(MgcpMessage msg) return MgcpEndpoint { var MgcpParameterList params; var integer i; if (ischosen(msg.command)) { - params := msg.command.params; + return msg.command.line.ep; } else { - params := msg.response.params; + /* FIXME */ + return "null at none"; } - for (i := 0; i < lengthof(params); i := i+1) { - if (params[i].code == "I") { - return str2hex(params[i].val); - } - } - return ''H; } -private function f_conn_table_init() +private function f_ep_table_init() runs on MGCP_Emulation_CT { - for (var integer i := 0; i < sizeof(MgcpConnectionTable); i := i+1) { - MgcpConnectionTable[i].comp_ref := null; - MgcpConnectionTable[i].conn_id := omit; + for (var integer i := 0; i < sizeof(MgcpEndpointTable); i := i+1) { + MgcpEndpointTable[i].comp_ref := null; + MgcpEndpointTable[i].endpoint := omit; } } function main(MGCPOps ops, MGCP_conn_parameters p, charstring id) runs on MGCP_Emulation_CT { var Result res; g_mgcp_id := id; - f_conn_table_init(); + f_ep_table_init(); f_expect_table_init(); map(self:MGCP, system:MGCP_CODEC_PT); @@ -196,12 +243,19 @@ var MgcpMessage msg; var MgcpCommand cmd; var MgcpResponse resp; + var MgcpEndpoint ep; alt { /* MGCP from client */ [] MGCP_CLIENT.receive(MgcpResponse:?) -> value resp sender vc_conn { + msg := { + response := resp + }; + /* If this is the resposne to a pending CRCX, extract Endpoint and store in table */ + if (f_trans_id_was_pending(resp.line.trans_id)) { + f_ep_table_add(vc_conn, f_mgcp_ep(msg)); + } /* Pass message through */ - msg.response := resp; /* TODO: check which ConnectionID client has allocated + store in table? */ MGCP.send(t_MGCP_Send(g_mgcp_conn_id, msg)); } @@ -213,21 +267,25 @@ } if (ischosen(mrf.msg.command)) { cmd := mrf.msg.command; - if (match(cmd, tr_MgcpCommand_CO)) { - /* connection-oriented MGCP */ - if (cmd.line.verb == "CRCX") { - /* TODO: allocate ConnectionID here + store in Table? */ - vc_conn := ops.create_cb.apply(cmd, id); - } else { - var MgcpConnectionId conn_id := f_mgcp_conn_id(mrf.msg); - vc_conn := f_comp_by_conn_id(conn_id); - } + if (f_ep_known(cmd.line.ep)) { + vc_conn := f_comp_by_ep(cmd.line.ep); MGCP_CLIENT.send(cmd) to vc_conn; } else { - /* connectionless MGCP, i.e. messages without ConnectionId */ - var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg); - if (isvalue(r)) { - MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r)); + if (cmd.line.verb == "CRCX") { + vc_conn := ops.create_cb.apply(cmd, id); + if (true /* non-wildcard EP */) { + f_ep_table_add(vc_conn, cmd.line.ep); + } else { + /* add this transaction to list of pending transactions */ + MgcpPendingTrans := MgcpPendingTrans & {cmd.line.trans_id}; + } + MGCP_CLIENT.send(cmd) to vc_conn; + } else { + /* connectionless MGCP, i.e. messages without ConnectionId */ + var template MgcpMessage r := ops.unitdata_cb.apply(mrf.msg); + if (isvalue(r)) { + MGCP.send(t_MGCP_Send(g_mgcp_conn_id, r)); + } } } } else { @@ -239,7 +297,12 @@ f_create_expect(crit, vc_conn); MGCP_PROC.reply(MGCPEM_register:{crit, vc_conn}); } + [] MGCP_PROC.getcall(MGCPEM_delete_ep:{?,?}) -> param(ep, vc_conn) { + f_ep_table_del(vc_conn, ep); + MGCP_PROC.reply(MGCPEM_delete_ep:{ep, vc_conn}); + } } + } } @@ -258,9 +321,10 @@ } signature MGCPEM_register(in ExpectCriteria cmd, in MGCP_ConnHdlr hdlr); +signature MGCPEM_delete_ep(in MgcpEndpoint ep, in MGCP_ConnHdlr hdlr); type port MGCPEM_PROC_PT procedure { - inout MGCPEM_register; + inout MGCPEM_register, MGCPEM_delete_ep; } with { extension "internal" }; function f_get_mgcp_by_crit(ExpectCriteria crit) @@ -294,8 +358,6 @@ var MGCP_ConnHdlr ret := null; var template MgcpCommand mgcpcmd; var integer i; - - /* Ensure cmd is a CRCX? */ for (i := 0; i < sizeof(MgcpExpectTable); i := i+1) { if (not ispresent(MgcpExpectTable[i].crit)) { @@ -345,6 +407,14 @@ } } +/* client/conn_hdlr side function to use procedure port to create expect in emulation */ +function f_create_mgcp_delete_ep(MgcpEndpoint ep) runs on MGCP_ConnHdlr { + MGCP_PROC.call(MGCPEM_delete_ep:{ep, self}) { + [] MGCP_PROC.getreply(MGCPEM_delete_ep:{?,?}) {}; + } +} + + private function f_expect_table_init() runs on MGCP_Emulation_CT { var integer i; -- To view, visit https://gerrit.osmocom.org/6108 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8cd7395ee7b076a9a9ef513cc1b71f2db5009845 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:11 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Move auth/ciph handling in shared f_mm_common() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Move auth/ciph handling in shared f_mm_common() ...................................................................... msc: Move auth/ciph handling in shared f_mm_common() This shared function can now be used not only from f_perform_lu() but also from f_establish_fully() and others. Change-Id: Ib174b1e7153ce2ae531755cd0ba586bb12264551 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 39 insertions(+), 30 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 58b64d3..d691d80 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -27,6 +27,13 @@ var BSC_ConnHdlrPars g_pars; } +type record AuthVector { + OCT16 rand, + OCT4 sres, + OCT8 kc + /* FIXME: 3G elements */ +} + type record BSC_ConnHdlrPars { SCCP_PAR_Address sccp_addr_own, SCCP_PAR_Address sccp_addr_peer, @@ -37,7 +44,7 @@ OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional, - octetstring kc optional + AuthVector vec optional }; @@ -103,7 +110,7 @@ } /* helper function to fully establish a dedicated channel */ -function f_establish_fully(MobileIdentityLV mi, boolean expect_auth) +function f_establish_fully(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; @@ -111,10 +118,13 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_info); - if (expect_auth) { - /* FIXME */ + f_mm_common(expect_auth, expect_ciph); + if (expect_ciph) { + /* implicit CM SERVICE ACCEPT? */ + } else { + /* explicit CM SERVICE ACCEPT */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); } - BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_ACC)); } /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ @@ -141,13 +151,6 @@ return l3_info; } -type record AuthVector { - OCT16 rand, - OCT4 sres, - OCT8 kc - /* FIXME: 3G elements */ -} - private function f_rnd_oct(integer len) return octetstring { var integer i; var octetstring res; @@ -165,12 +168,32 @@ return vec; } + +function f_mm_common(boolean expect_auth, boolean expect_ciph) runs on BSC_ConnHdlr +{ + if (expect_auth) { + g_pars.vec := f_gen_auth_vec_2g(); + var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, + g_pars.vec.sres, + g_pars.vec.kc)); + GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); + GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); + + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); + } + + if (expect_ciph) { + BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)); + BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); + } +} + function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm, boolean expect_ciph := false) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; - var AuthVector vec; /* tell GSUP dispatcher to send this IMSI to us */ f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -182,21 +205,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); } - if (expect_auth) { - vec := f_gen_auth_vec_2g(); - var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(vec.rand, vec.sres, vec.kc)); - GSUP.receive(tr_GSUP_SAI_REQ(g_pars.imsi)); - GSUP.send(ts_GSUP_SAI_RES(g_pars.imsi, auth_tuple)); - - BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(vec.rand))); - BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(vec.sres))); - } - - if (expect_ciph) { - BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, vec.kc)); - g_pars.kc := vec.kc; - BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); - } + f_mm_common(expect_auth, expect_ciph); /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index a6e92bc..83ad17c 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -362,7 +362,7 @@ tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit, - kc := omit + vec := omit }; vc_conn := BSC_ConnHdlr.create(id); @@ -536,7 +536,7 @@ g_pars := pars; f_perform_lu(false, true, true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); var hexstring called := '12345'H; var integer tid := 0; -- To view, visit https://gerrit.osmocom.org/6107 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib174b1e7153ce2ae531755cd0ba586bb12264551 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 00:02:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 00:02:11 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Move f_sleep() to common Osmocom_Types.ttcn In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Move f_sleep() to common Osmocom_Types.ttcn ...................................................................... msc: Move f_sleep() to common Osmocom_Types.ttcn Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504 --- M library/Osmocom_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/Osmocom_Types.ttcn b/library/Osmocom_Types.ttcn index 495b684..a748bbc 100644 --- a/library/Osmocom_Types.ttcn +++ b/library/Osmocom_Types.ttcn @@ -60,4 +60,10 @@ return prefix & f_rnd_octstring(len - lengthof(prefix)); } + function f_sleep(float seconds) { + timer T := seconds; + T.start; + T.timeout; + } + } with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index aee0165..a6e92bc 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -383,12 +383,6 @@ return vc_conn; } -function f_sleep(float seconds) { - timer T := seconds; - T.start; - T.timeout; -} - function f_vty_config(TELNETasp_PT pt, charstring config_node, charstring cmd) { /* enter config mode; enter node */ -- To view, visit https://gerrit.osmocom.org/6106 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic748e1dfe002cb6ee4d785e9b7f8dca34873e504 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 08:48:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 08:48:28 +0000 Subject: [PATCH] libosmocore[master]: gsm_04_08.h: Clearly annotate timers that don't have a 3GPP ... Message-ID: Review at https://gerrit.osmocom.org/6119 gsm_04_08.h: Clearly annotate timers that don't have a 3GPP Default value Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/19/6119/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 93b8c59..a7ab612 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1495,14 +1495,14 @@ #define GSM48_T303 30, 0 #define GSM48_T305 30, 0 #define GSM48_T306 30, 0 -#define GSM48_T308 10, 0 -#define GSM48_T310 180, 0 -#define GSM48_T313 30, 0 +#define GSM48_T308 10, 0 /* no spec default */ +#define GSM48_T310 180, 0 /* no spec default */ +#define GSM48_T313 30, 0 /* no spec default */ #define GSM48_T323 30, 0 -#define GSM48_T331 30, 0 -#define GSM48_T333 30, 0 -#define GSM48_T334 25, 0 /* min 15 */ -#define GSM48_T338 30, 0 +#define GSM48_T331 30, 0 /* no spec default */ +#define GSM48_T333 30, 0 /* no spec default */ +#define GSM48_T334 25, 0 /* min 15s */ +#define GSM48_T338 30, 0 /* no spec default */ #define GSM48_T303_MS 30, 0 #define GSM48_T305_MS 30, 0 #define GSM48_T308_MS 30, 0 -- To view, visit https://gerrit.osmocom.org/6119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 08:48:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 08:48:29 +0000 Subject: [PATCH] libosmocore[master]: gsm_04_08.h: Reduce T310 default to 30s. Message-ID: Review at https://gerrit.osmocom.org/6120 gsm_04_08.h: Reduce T310 default to 30s. 3GPP doesn't specify a network-side T310 default, but waiting for 180s (3 minutes!) for the next message after CALL CONFIRMED is clearly way too long and will just use radio resources for no good reason. Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a Related: OS#2884 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/20/6120/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index a7ab612..e54084f 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1496,7 +1496,7 @@ #define GSM48_T305 30, 0 #define GSM48_T306 30, 0 #define GSM48_T308 10, 0 /* no spec default */ -#define GSM48_T310 180, 0 /* no spec default */ +#define GSM48_T310 30, 0 /* no spec default */ #define GSM48_T313 30, 0 /* no spec default */ #define GSM48_T323 30, 0 #define GSM48_T331 30, 0 /* no spec default */ -- To view, visit https://gerrit.osmocom.org/6120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging Message-ID: Review at https://gerrit.osmocom.org/6121 BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging If we're emulating BSC/BTS/MS, then we must be able to dispatch incoming paging requests based on their IMSI or TMSI to the right ConnHdlr component. This introduces a new table to facilitate that dispatch. Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b --- M library/BSSMAP_Emulation.ttcn M library/BSSMAP_Templates.ttcn 2 files changed, 120 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/21/6121/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index e7a432c..ca5afb9 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -116,6 +116,12 @@ integer cic optional } +type record ImsiMapping { + BSSAP_ConnHdlr comp_ref, + hexstring imsi optional, + OCT4 tmsi +} + type component BSSMAP_Emulation_CT { /* SCCP port on the bottom side, using ASP primitives */ port BSSAP_CODEC_PT BSSAP; @@ -129,6 +135,10 @@ /* pending expected incoming connections */ var ExpectData ExpectTable[8]; + + /* tables for mapping inbound unitdata (like paging) */ + var ImsiMapping ImsiTable[16]; + /* procedure based port to register for incoming connections */ port BSSMAPEM_PROC_PT PROC; @@ -270,6 +280,11 @@ ConnectionTable[i].mgcp_trans_id := omit; ConnectionTable[i].cic := omit; } + for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { + ImsiTable[i].comp_ref := null; + ImsiTable[i].imsi := omit; + ImsiTable[i].tmsi := 'FFFFFFFF'O; + } } private function f_conn_table_add(BSSAP_ConnHdlr comp_ref, integer sccp_conn_id) @@ -301,6 +316,17 @@ log("BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); setverdict(fail); self.stop; +} + +private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) +runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { + for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { + if (ImsiTable[i].imsi == imsi or + isvalue(tmsi) and match(ImsiTable[i].tmsi, tmsi)) { + return ImsiTable[i].comp_ref; + } + } + return null; } /* handle (optional) userData portion of various primitives and dispatch it to the client */ @@ -346,6 +372,27 @@ type function BssmapUnitdataCallback(PDU_BSSAP bssap) runs on BSSMAP_Emulation_CT return template PDU_BSSAP; +/* handle common Unitdata such as Paging */ +private function CommonBssmapUnitdataCallback(PDU_BSSAP bssap) +runs on BSSMAP_Emulation_CT return template PDU_BSSAP { + if (match(bssap, tr_BSSMAP_Paging)) { + var BSSAP_ConnHdlr client := null; + client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits, + bssap.pdu.bssmap.paging.tMSI.tmsiOctets); + if (isvalue(client)) { + log("CommonBssmapUnitdataCallback: IMSI/TMSI found in table, dispatching to ", + client); + CLIENT.send(bssap) to client; + return omit; + } + log("CommonBssmapUnitdataCallback: IMSI/TMSI not found in table"); + } else { + log("CommonBssmapUnitdataCallback: Not a paging message"); + } + /* ELSE: handle in user callback */ + return g_bssmap_ops.unitdata_cb.apply(bssap); +} + type record BssmapOps { BssmapCreateCallback create_cb, BssmapUnitdataCallback unitdata_cb, @@ -375,13 +422,15 @@ var MgcpResponse mgcp_resp; var BSSAP_ConnHdlr vc_hdlr; var octetstring l3_info; + var hexstring imsi; + var OCT4 tmsi; alt { /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ [] BSSAP.receive(BSSAP_N_UNITDATA_ind:?) -> value ud_ind { /* Connectionless Procedures like RESET */ var template PDU_BSSAP resp; - resp := ops.unitdata_cb.apply(ud_ind.userData); + resp := CommonBssmapUnitdataCallback(ud_ind.userData); if (isvalue(resp)) { BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, resp)); @@ -528,6 +577,12 @@ PROC.reply(BSSMAPEM_register:{l3_info, vc_hdlr}); } + [] PROC.getcall(BSSMAPEM_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { + f_create_imsi(imsi, tmsi, vc_hdlr); + PROC.reply(BSSMAPEM_register_imsi:{imsi, tmsi, vc_hdlr}); + } + + } } } @@ -553,8 +608,11 @@ /* procedure based port to register for incoming connections */ signature BSSMAPEM_register(in octetstring l3, in BSSAP_ConnHdlr hdlr); +/* procedure based port to register for incoming IMSI/TMSI */ +signature BSSMAPEM_register_imsi(in hexstring imsi, in OCT4 tmsi, in BSSAP_ConnHdlr hdlr); + type port BSSMAPEM_PROC_PT procedure { - inout BSSMAPEM_register; + inout BSSMAPEM_register, BSSMAPEM_register_imsi; } with { extension "internal" }; /* CreateCallback that can be used as create_cb and will use the expectation table */ @@ -602,6 +660,22 @@ setverdict(fail, "No space left in ExpectTable"); } +private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) +runs on BSSMAP_Emulation_CT { + for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { + if (not ispresent(ImsiTable[i].imsi)) { + ImsiTable[i].imsi := imsi; + ImsiTable[i].tmsi := tmsi; + ImsiTable[i].comp_ref := hdlr; + log("Created IMSI[", i, "] for ", imsi, tmsi, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in ImsiTable"); + self.stop; +} + + private function f_expect_table_init() runs on BSSMAP_Emulation_CT { for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { @@ -609,4 +683,13 @@ } } +/* helper function for clients to register their IMSI/TMSI */ +function f_bssmap_register_imsi(hexstring imsi, OCT4 tmsi) +runs on BSSAP_ConnHdlr { + BSSAP_PROC.call(BSSMAPEM_register_imsi:{imsi, tmsi, self}) { + [] BSSAP_PROC.getreply(BSSMAPEM_register_imsi:{?,?,?}) {}; + } +} + + } diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 075dab7..c98f5eb 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -660,6 +660,14 @@ digits := imsi_digits } +template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := { + elementIdentifier := '08'O, + lengthIndicator := ?, /* overwritten */ + typeOfIdentity := '001'B, /* IMSI */ + oddEvenIndicator := ?, + digits := imsi_digits +} + template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { cIl_noCell := ''O } @@ -699,6 +707,12 @@ tmsiOctets := tmsi }; +template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := { + elementIdentifier := '09'O, + lengthIndicator := 4, + tmsiOctets := tmsi +}; + private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { var template BSSMAP_IE_TMSI ret; if (ispresent(tmsi)) { @@ -717,7 +731,7 @@ pdu := { bssmap := { paging := { - messageType := '51'O, + messageType := '52'O, iMSI := ts_BSSMAP_Imsi(imsi_digits), tMSI := f_tmsi_or_omit(tmsi), cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)), @@ -729,6 +743,26 @@ } } +template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?, + template OCT4 tmsi := *, + template BSSMAP_IE_ChannelNeeded chneed := *) +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + paging := { + messageType := '52'O, + iMSI := tr_BSSMAP_Imsi(imsi_digits), + tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent, + cellIdentifierList := ?, + channelNeeded := chneed, + eMLPP_Priority := omit, + pagingInformation := omit /* only VGCS/VBS flag */ + } + } + } +} + + template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) modifies ts_BSSAP_BSSMAP := { pdu := { -- To view, visit https://gerrit.osmocom.org/6121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC Message-ID: Review at https://gerrit.osmocom.org/6122 GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC OsmoMSC seems to have broken encoding of MSISDN which is not in-line with the spec. Let's adapt to it. Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3 Related: OS#2883 --- M library/GSUP_Types.ttcn 1 file changed, 29 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/22/6122/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 7f239ca..4d2c3c5 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -80,6 +80,11 @@ OSMO_GSUP_CN_DOMAIN_CS (2) } with { variant "FIELDLENGTH(8)" }; +type record GSUP_MSISDN { + uint8_t len, + hexstring digits optional +} with { variant (len) "LENGTHTO(digits)" }; + type record GSUP_IE { GSUP_IEI tag, uint8_t len, @@ -121,7 +126,7 @@ octetstring ck, octetstring autn, octetstring res, - hexstring msisdn, + GSUP_MSISDN msisdn, octetstring hlr_number, GSUP_CnDomain cn_domain, octetstring charg_char @@ -157,6 +162,27 @@ } } } + +template (value) GSUP_MSISDN ts_GSUP_MSISDN(hexstring digits, + BIT3 ton := '000'B, + BIT4 npi := '0000'B) := { + len := 0, /* overwritten */ + /* numberingPlanIdentification := npi, + typeOfNumber := ton, + ext1 := '0'B, */ + digits := digits +} + +template GSUP_MSISDN tr_GSUP_MSISDN(template hexstring digits, + template BIT3 ton := ?, + template BIT4 npi := ?) := { + len := ?, + /* numberingPlanIdentification := npi, + typeOfNumber := ton, + ext1 := '0'B, */ + digits := digits +} + template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, @@ -273,7 +299,7 @@ tag := OSMO_GSUP_MSISDN_IE, len := 0, /* overwritten */ val := { - msisdn := msisdn + msisdn := ts_GSUP_MSISDN(msisdn) } } @@ -281,7 +307,7 @@ tag := OSMO_GSUP_MSISDN_IE, len := ?, val := { - msisdn := msisdn + msisdn := tr_GSUP_MSISDN(msisdn) } } -- To view, visit https://gerrit.osmocom.org/6122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: WIP: msc: First test case for mobile terminated call testing Message-ID: Review at https://gerrit.osmocom.org/6123 WIP: msc: First test case for mobile terminated call testing We start the call from the MNCC side, match on the paging and then pick it up from there. It currently fails as the MNCC_Emulation cannot yet handle "ConnHdlr originated" MNCC calls yet. Change-Id: I28c465187fd8b1dcfd687180b373a47bb9ac6734 --- M library/L3_Templates.ttcn M library/MNCC_Emulation.ttcn M library/MNCC_Types.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 5 files changed, 259 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/23/6123/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 2050e3d..7736ff5 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -435,6 +435,22 @@ digits := digits } +template CalledPartyBCD_Number tr_Called(template hexstring digits) := { + elementIdentifier := '5E'O, + lengthIndicator := ?, + numberingPlanIdentification := ?, + typeOfNumber := ?, + ext1 := ?, + digits := digits +} + +template CallingPartyBCD_Number tr_Calling(template hexstring digits) := { + elementIdentifier := '5C'O, + lengthIndicator := ?, + oct3 := ?, + digits := digits +} + type integer SpeechVer; template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { @@ -756,5 +772,79 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid, + template BearerCapability_TLV bcap := omit) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '1'B, /* response from destination */ + tIExtension := omit + } + }, + msgs := { + cc := { + callConfirmed := { + messageType := '001000'B, + nsd := '00'B, + repeatIndicator := omit, + bearerCapability1 := bcap, + bearerCapability2 := omit, + cause := omit, + cC_Capabilities := omit, + streamIdentifier := omit, + supportedCodecs := omit + } + } + } +} + + +template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *, + template hexstring calling := *, + template BearerCapability_TLV bcap := *) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, /* from originator */ + tIExtension := omit + } + }, + msgs := { + cc := { + setup_NW_MS := { + messageType := '000101'B, + nsd := '00'B, + bcRepeatIndicator := *, + bearerCapability1 := bcap, + bearerCapability2 := *, + facility := *, + progressIndicator := *, + signal := *, + callingPartyBCD_Number := tr_Calling(calling) ifpresent, + callingPartySubAddress := *, + calledPartyBCD_Number := tr_Called(called) ifpresent, + calledPartySubAddress := *, + redirectingPartyBCDNumber := *, + redirectingPartySubaddress := *, + llc_RepeatIndicator := *, + lowLayerCompatibility1 := *, + lowLayerCompatibility2 := *, + hlc_RepeatIndicator := *, + highLayerCompatibility1 := *, + highLayerCompatibility2 := *, + user_user := *, + priority := *, + alert := *, + networkCCCapabilities := *, + causeofNoCli := *, + backupBearerCapacity := * + } + } + } +} + + } diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index 4bf516d..de29288 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -280,6 +280,14 @@ f_call_table_del(call_id); } + /* Client -> MNCC Socket: SETUP.req: forward + add call table entry */ + [] MNCC_CLIENT.receive(MNCC_PDU:{msg_type := MNCC_SETUP_REQ, u:=?}) -> value mncc sender vc_conn { + /* add to call table */ + f_call_table_add(vc_conn, f_mncc_get_call_id(mncc)); + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + } + /* Client -> MNCC Socket: Normal message */ [] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn { /* forward to MNCC socket */ diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 884a7c0..258db3f 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -665,10 +665,10 @@ } } -/* MT: MSC <- MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ -template MNCC_PDU ts_MNCC_CALL_CONF_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, - template MNCC_cause cause := omit, - template MNCC_cccap cccap := omit) := { +/* MT: MSC -> MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ +template MNCC_PDU tr_MNCC_CALL_CONF_ind(template uint32_t call_id, template MNCC_bearer_cap bcap := *, + template MNCC_cause cause := *, + template MNCC_cccap cccap := *) := { msg_type := MNCC_CALL_CONF_IND, u := { signal := { /* See 24.008 9.3.2 */ @@ -691,9 +691,9 @@ more := 0, notify := 0, emergency := omit, - imsi := "", - lchan_type := 0, - lchan_mode := 0 + imsi := ?, + lchan_type := ?, + lchan_mode := ? } } } diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 75871c5..bc6eebc 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -132,6 +132,19 @@ } } +/* helper function to fully establish a dedicated channel */ +function f_establish_fully_pag(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_info := valueof(ts_PAG_RESP(mi)); + var PDU_DTAP_MT dtap_mt; + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + f_mm_common(expect_auth, expect_ciph); +} + + /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 43ae760..29e8303 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1311,6 +1311,147 @@ } +/* helper function to start a MT call: MNCC SETUP; Paging; DChan est.; DTAP SETUP */ +private function f_mt_call_start(inout CallParameters cpars) runs on BSC_ConnHdlr { + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + var OCT4 tmsi; + + f_perform_lu(false, true, true, false); + if (isvalue(g_pars.tmsi)) { + tmsi := g_pars.tmsi; + } else { + tmsi := 'FFFFFFFF'O; + } + f_bssmap_register_imsi(g_pars.imsi, tmsi); + + /* Allocate call reference and send SETUP via MNCC to MSC */ + cpars.mncc_callref := f_rnd_int(2147483648); + MNCC.send(ts_MNCC_SETUP_req(cpars.mncc_callref, hex2str(g_pars.msisdn), + hex2str(cpars.called_party), hex2str(g_pars.imsi))); + + /* MSC->BSC: expect PAGING from MSC */ + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + /* MS -> MSC: PAGING RESPONSE */ + f_establish_fully_pag(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + /* MSC->MS: SETUP */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_SETUP(cpars.transaction_id, *, cpars.called_party))); +} + +/* Test MT Call */ +private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_mt_call_start(cpars); + + /* MS->MSC: CALL CONFIRMED */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CALL_CONF(cpars.transaction_id))); + + MNCC.receive(tr_MNCC_CALL_CONF_ind(cpars.mncc_callref)); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; + /* Respond to CRCX with error */ + var MgcpResponse mgcp_rsp := { + line := { + code := "542", + trans_id := mgcp_cmd.line.trans_id, + string := "FORCED_FAIL" + }, + params := omit, + sdp := omit + } + MGCP.send(mgcp_rsp); + + timer T := 30.0; + T.start; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + repeat; + } + [] MGCP.receive { repeat; } + } +} +testcase TC_mt_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), testcasename(), 29); + vc_conn.done; +} + + +/* Test MT Call T310 timer */ +private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_mt_call_start(cpars); + + /* MS->MSC: CALL CONFIRMED */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CALL_CONF(cpars.transaction_id))); + MNCC.receive(tr_MNCC_CALL_CONF_ind(cpars.mncc_callref)); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; + /* FIXME: Respond to CRCX */ + + /* old libosmocore T310 default timeout is 180s. so let's wait 190 */ + timer T := 190.0; + T.start; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for T310"); self.stop; } + [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)) { + MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); + } + } + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + /* FIXME: We're sending this with TIflag 0: allocated by sender, which is wrong */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); + + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + repeat; + } + } +} +testcase TC_mt_t310() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mt_t310), testcasename(), 30); + vc_conn.done; +} + /* TODO: -- To view, visit https://gerrit.osmocom.org/6123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I28c465187fd8b1dcfd687180b373a47bb9ac6734 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Fix TC_cmserv_imsi_unknown Message-ID: Review at https://gerrit.osmocom.org/6124 msc: Fix TC_cmserv_imsi_unknown g_pars was not initialized, leading to IMSI encoding failure. Change-Id: Iadab7aed3d3d39186002f1ed25e83f3d3c1ed177 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/24/6124/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 29e8303..73466b6 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -495,6 +495,7 @@ /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); -- To view, visit https://gerrit.osmocom.org/6124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iadab7aed3d3d39186002f1ed25e83f3d3c1ed177 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Fix TC_lu_tmsi_noauth_unknown Message-ID: Review at https://gerrit.osmocom.org/6125 msc: Fix TC_lu_tmsi_noauth_unknown As the MSC allocates a new TMSI to us, we must send a TMSI REALLOC COMPL to avoid a LU REJ after the LU ACK. Change-Id: I6f0d85750a68e71e9b589b23ad74b945a46a6a88 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/25/6125/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 73466b6..94e5822 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -742,7 +742,9 @@ GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); alt { - [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); + } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { setverdict(fail, "Expected LU ACK, but received REJ"); } -- To view, visit https://gerrit.osmocom.org/6125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f0d85750a68e71e9b589b23ad74b945a46a6a88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Don't explicitly enable TMSI allocation Message-ID: Review at https://gerrit.osmocom.org/6126 msc: Don't explicitly enable TMSI allocation f_init() already enables TMSI allocation, no need to re-do that. Only tests *without* TMSI allocation must explicitly change this config. Change-Id: I123b44b36c3ed7e6bc0347d9703b8bd6288ba060 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/26/6126/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 94e5822..8512d3e 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1061,7 +1061,6 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_auth_2G_fail), testcasename(), 23); vc_conn.done; @@ -1075,7 +1074,6 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); f_vty_config(MSCVTY, "network", "encryption a5 1 3"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_13), testcasename(), 24); -- To view, visit https://gerrit.osmocom.org/6126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I123b44b36c3ed7e6bc0347d9703b8bd6288ba060 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add global g_Tguard timer to make sure BSC_ConnHdlr ter... Message-ID: Review at https://gerrit.osmocom.org/6127 msc: Add global g_Tguard timer to make sure BSC_ConnHdlr terminates Change-Id: I10fc0ff04c16eacc12f09ac1759940676ae62213 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 53 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/27/6127/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index bc6eebc..843197e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -30,6 +30,7 @@ /* this component represents a single subscriber connection */ type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr { var BSC_ConnHdlrPars g_pars; + timer g_Tguard := 60.0; } type record AuthVector { @@ -52,6 +53,23 @@ AuthVector vec optional }; +/* altstep for the global guard timer */ +private altstep as_Tguard() runs on BSC_ConnHdlr { + [] g_Tguard.timeout { + setverdict(inconc, "Tguard timeout"); + self.stop; + } +} + +/* init function, called as first function in new BSC_ConnHdlr */ +function f_init_handler(BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + /* make parameters available via component variable */ + g_pars := pars; + /* Start guard timer and activate it as default */ + g_Tguard.start; + activate(as_Tguard()); +} + /* Callback function from general BSSMAP_Emulation whenever a connectionless * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 8512d3e..f38b989 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -379,6 +379,8 @@ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + /* We cannot use vc_conn.start(f_init_handler(fn, id, pars)); as we cannot have + * a stand-alone 'derefers()' call, see https://www.eclipse.org/forums/index.php/t/1091364/ */ vc_conn.start(derefers(fn)(id, pars)); return vc_conn; } @@ -395,7 +397,7 @@ } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(false, true, true); } testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { @@ -407,7 +409,7 @@ } private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(false, false, true); } testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { @@ -421,7 +423,7 @@ /* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -450,7 +452,7 @@ /* Do LU by IMSI, timeout on GSUP */ private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -479,7 +481,7 @@ } private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(true, true, true); } testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { @@ -495,7 +497,7 @@ /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); @@ -534,7 +536,7 @@ } private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); cpars.bss_rtp_port := 1110; cpars.mgcp_connection_id_bss := '22222'H; @@ -553,7 +555,7 @@ /* Test LU (with authentication enabled), where HLR times out sending SAI response */ private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -587,7 +589,7 @@ /* Test LU (with authentication enabled), where HLR rejects sending SAI error */ private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -621,7 +623,7 @@ /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -653,7 +655,7 @@ /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -683,7 +685,7 @@ /* Test LU but with illegal mobile identity type = IMEI */ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei) var PDU_DTAP_MT dtap_mt; @@ -717,7 +719,7 @@ /* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_tmsi('01020304'O); /* FIXME: Random */ var PDU_DTAP_MT dtap_mt; @@ -767,7 +769,7 @@ /* Test IMSI DETACH (MI=IMSI) */ private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); @@ -793,7 +795,7 @@ /* Test IMSI DETACH (MI=TMSI) */ private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); @@ -819,7 +821,7 @@ /* Test IMSI DETACH (MI=IMEI), which is illegal */ private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); @@ -892,7 +894,7 @@ /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); @@ -913,7 +915,7 @@ /* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); /* Then issue emergency call identified by IMSI */ @@ -929,7 +931,7 @@ /* CM Service Request for VGCS -> reject */ private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -953,7 +955,7 @@ /* CM Service Request for VBS -> reject */ private function f_tc_cm_serv_req_vbs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -977,7 +979,7 @@ /* CM Service Request for LCS -> reject */ private function f_tc_cm_serv_req_lcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -1001,7 +1003,7 @@ /* CM Re-Establishment Request */ private function f_tc_cm_reest_req_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -1025,7 +1027,7 @@ /* Test LU (with authentication enabled), with wrong response from MS */ private function f_tc_lu_auth_2G_fail(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -1067,7 +1069,7 @@ } private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(true, true, true, true); } testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { @@ -1082,7 +1084,7 @@ /* Test Complete L3 without payload */ private function f_tc_cl3_no_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* Send Complete L3 Info with empty L3 frame */ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, @@ -1108,7 +1110,7 @@ /* Test Complete L3 with random payload */ private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var integer len := float2int(rnd() * 256.0); var octetstring payl := f_rnd_octstring(len); @@ -1139,7 +1141,7 @@ /* Test Complete L3 with random payload */ private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(false, true, true, false); @@ -1169,7 +1171,8 @@ /* Test MO Call SETUP with no response from MNCC */ private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); f_perform_lu(false, true, true, false); @@ -1205,7 +1208,7 @@ /* Test MO Call with no response to RAN-side CRCX */ private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; @@ -1252,7 +1255,7 @@ /* Test MO Call with reject to RAN-side CRCX */ private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; @@ -1344,7 +1347,7 @@ /* Test MT Call */ private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; @@ -1402,7 +1405,7 @@ /* Test MT Call T310 timer */ private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; -- To view, visit https://gerrit.osmocom.org/6127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10fc0ff04c16eacc12f09ac1759940676ae62213 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 11:46:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 11:46:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add missing 'repeat' in TC_mo_crcx_ran_reject Message-ID: Review at https://gerrit.osmocom.org/6128 msc: Add missing 'repeat' in TC_mo_crcx_ran_reject Change-Id: Id5c538546ba59f8a8d5f4379f16df2d99c8c2669 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/6128/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index f38b989..2f85ab4 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1302,6 +1302,7 @@ [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); f_create_mgcp_delete_ep(cpars.mgcp_ep); + repeat; } [] MGCP.receive { repeat; } } -- To view, visit https://gerrit.osmocom.org/6128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id5c538546ba59f8a8d5f4379f16df2d99c8c2669 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:27:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:27:52 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: deps: Switch back to upstream titan.TestPorts.UNIX_DOMAIN_SO... Message-ID: Review at https://gerrit.osmocom.org/6129 deps: Switch back to upstream titan.TestPorts.UNIX_DOMAIN_SOCKETasp Upstream TITAN has merged our SOCK_SEQPACKET support, so there's no need for using our private repo anymore. Change-Id: Ib04d9a3095cf93609af07af0de0b701cba460f67 --- M deps/Makefile 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/29/6129/1 diff --git a/deps/Makefile b/deps/Makefile index 64f5c2c..c4c21e3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -21,7 +21,8 @@ titan.TestPorts.SIPmsg \ titan.TestPorts.TCPasp \ titan.TestPorts.TELNETasp \ - titan.TestPorts.UDPasp + titan.TestPorts.UDPasp \ + titan.TestPorts.UNIX_DOMAIN_SOCKETasp ECLIPSEGIT2_REPOS= titan.ProtocolModules.GRE \ titan.ProtocolModules.M2PA \ @@ -40,7 +41,7 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 -OSMOGITHUB_REPOS= titan.TestPorts.UNIX_DOMAIN_SOCKETasp +OSMOGITHUB_REPOS= ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) -- To view, visit https://gerrit.osmocom.org/6129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib04d9a3095cf93609af07af0de0b701cba460f67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:27:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:27:52 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: deps: Use SCTPasp from osmocom github fork (SO_REUSEADDR, us... Message-ID: Review at https://gerrit.osmocom.org/6130 deps: Use SCTPasp from osmocom github fork (SO_REUSEADDR, usleep hack) Change-Id: I9169d231358a9a7e9e10302044a895087f7e7d78 --- M deps/Makefile 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/30/6130/1 diff --git a/deps/Makefile b/deps/Makefile index c4c21e3..e1cbfe3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -17,7 +17,6 @@ titan.TestPorts.IPL4asp \ titan.TestPorts.LANL2asp \ titan.TestPorts.PCAPasp \ - titan.TestPorts.SCTPasp \ titan.TestPorts.SIPmsg \ titan.TestPorts.TCPasp \ titan.TestPorts.TELNETasp \ @@ -41,7 +40,7 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 -OSMOGITHUB_REPOS= +OSMOGITHUB_REPOS= titan.TestPorts.SCTPasp ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) -- To view, visit https://gerrit.osmocom.org/6130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9169d231358a9a7e9e10302044a895087f7e7d78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:27:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:27:53 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Accept optional f_init_handler() argument for Tguard Message-ID: Review at https://gerrit.osmocom.org/6131 msc: Accept optional f_init_handler() argument for Tguard Some tests may want an extended guard timer as they're waiting for some particularly slow events. They can override the default now. Change-Id: Iee6f50559a8fe45c7655b9f41e7fa163199b39a6 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/31/6131/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 843197e..97c02b8 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -62,11 +62,11 @@ } /* init function, called as first function in new BSC_ConnHdlr */ -function f_init_handler(BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +function f_init_handler(BSC_ConnHdlrPars pars, float t_guard := 60.0) runs on BSC_ConnHdlr { /* make parameters available via component variable */ g_pars := pars; /* Start guard timer and activate it as default */ - g_Tguard.start; + g_Tguard.start(t_guard); activate(as_Tguard()); } diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 2f85ab4..2e9176f 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1406,7 +1406,7 @@ /* Test MT Call T310 timer */ private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - f_init_handler(pars); + f_init_handler(pars, 200.0); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; -- To view, visit https://gerrit.osmocom.org/6131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee6f50559a8fe45c7655b9f41e7fa163199b39a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:27:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:27:53 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Introduce shared f_expect_clear() Message-ID: Review at https://gerrit.osmocom.org/6132 msc: Introduce shared f_expect_clear() Avoid having to copy+paste the matching of a channel clear/relesae Change-Id: If070b079f2ffadb8065fb99d1c8951ac9baec88b --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 55 insertions(+), 114 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/32/6132/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 97c02b8..a7ce1ea 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -454,6 +454,41 @@ setverdict(pass); } +/* expect a clear command */ +function f_expect_clear(float t := 5.0) runs on BSC_ConnHdlr { + timer T := t; + + T.start; + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { } + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSMAP while waiting for ClearCommand"); + self.stop; + } + [] T.timeout { + setverdict(inconc, "Timeout waiting for ClearCommand"); + self.stop; + } + } + + BSSAP.send(ts_BSSMAP_ClearComplete); + + T.start; + alt { + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(pass); + } + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSMAP while waiting for SCCP Release"); + self.stop; + } + [] T.timeout { + setverdict(inconc, "Timeout waiting for SCCP Release"); + self.stop; + } + } +} + diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 2e9176f..c241d74 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -437,10 +437,7 @@ self.stop; } } - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_imsi_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -467,10 +464,7 @@ self.stop; } } - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -520,13 +514,7 @@ [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } - alt { - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - setverdict(pass); - } - [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } - [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } - } + f_expect_clear(); } testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -573,10 +561,7 @@ /* The HLR would normally return an auth vector here, but we fail to do so. */ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_auth_sai_timeout() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -607,10 +592,7 @@ GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_auth_sai_err() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -704,10 +686,7 @@ [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req)) { repeat; } } /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -753,10 +732,7 @@ } /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -780,10 +756,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_imsi_detach_by_imsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -806,10 +779,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_imsi_detach_by_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -832,10 +802,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_imsi_detach_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -885,11 +852,7 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); /* clearing of radio channel */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - - f_sleep(5.0); + f_expect_clear(); } /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ @@ -900,10 +863,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_emerg_call_imei_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -940,10 +900,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -964,10 +921,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -988,10 +942,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1012,10 +963,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_reest_req_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1054,10 +1002,7 @@ /* Expect LU REJECT with Cause == Illegal MS */ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej('03'O))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_auth_2G_fail() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1146,20 +1091,7 @@ f_perform_lu(false, true, true, false); f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); - timer T := 30.0; - T.start; - alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); - } - [] BSSAP.receive { repeat; } - [] MNCC.receive { repeat; } - [] GSUP.receive { repeat; } - [] MGCP.receive { repeat; } - } + f_expect_clear(); } testcase TC_establish_and_nothing() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1183,20 +1115,7 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); - timer T := 30.0; - T.start; - alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); - } - [] BSSAP.receive { repeat; } - [] MNCC.receive { repeat; } - [] GSUP.receive { repeat; } - [] MGCP.receive { repeat; } - } + f_expect_clear(30.0); } testcase TC_mo_setup_and_nothing() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1230,20 +1149,7 @@ cpars.mgcp_ep := mgcp_cmd.line.ep; /* never respond to this */ - timer T := 30.0; - T.start; - alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); - } - [] BSSAP.receive { repeat; } - [] MNCC.receive { repeat; } - [] GSUP.receive { repeat; } - [] MGCP.receive { repeat; } - } + f_expect_clear(30.0); } testcase TC_mo_crcx_ran_timeout() runs on MTC_CT { var BSC_ConnHdlr vc_conn; -- To view, visit https://gerrit.osmocom.org/6132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If070b079f2ffadb8065fb99d1c8951ac9baec88b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:27:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:27:53 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Fastert timeout in TC_cl3_{rnd, no}_payload Message-ID: Review at https://gerrit.osmocom.org/6133 msc: Fastert timeout in TC_cl3_{rnd,no}_payload Change-Id: Ida2674fca10e164385f68d2ab7f8d300abd8b6f7 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/33/6133/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c241d74..fb4248e 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1035,12 +1035,18 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, ''O)))); + timer T := 5.0; + T.start; alt { [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} /* Expect LU REJECT with Cause == Illegal MS */ [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] T.timeout { + setverdict(inconc, "Timeout waiting for ClearCommand or SCCP Release"); + self.stop; } } setverdict(pass); @@ -1064,6 +1070,8 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, payl)))); + timer T := 5.0; + T.start; alt { /* Immediate disconnect */ [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} @@ -1073,6 +1081,10 @@ BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); } [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } + [] T.timeout { + setverdict(inconc, "Timeout waiting for ClearCommand or SCCP Release"); + self.stop; + } } setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida2674fca10e164385f68d2ab7f8d300abd8b6f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:27:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:27:54 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Enable all test cases in control section Message-ID: Review at https://gerrit.osmocom.org/6134 msc: Enable all test cases in control section Change-Id: Idc8c88de1b55d1f7e1e19be1b218edaebd7d767b --- M msc_tests/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/34/6134/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index fb4248e..9ac715b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1391,11 +1391,12 @@ control { - execute( TC_cmserv_imsi_unknown() ); execute( TC_lu_imsi_noauth_tmsi() ); - //execute( TC_lu_imsi_noauth_notmsi() ); + execute( TC_lu_imsi_noauth_notmsi() ); execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); + execute( TC_lu_imsi_auth_tmsi() ); + execute( TC_cmserv_imsi_unknown() ); execute( TC_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); execute( TC_lu_auth_sai_err() ); @@ -1420,6 +1421,8 @@ execute( TC_mo_setup_and_nothing() ); execute( TC_mo_crcx_ran_timeout() ); execute( TC_mo_crcx_ran_reject() ); + execute( TC_mt_crcx_ran_reject() ); + execute( TC_mt_t310() ); } -- To view, visit https://gerrit.osmocom.org/6134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc8c88de1b55d1f7e1e19be1b218edaebd7d767b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:24 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:27 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:29 +0000 Subject: osmo-ttcn3-hacks[master]: WIP: msc: First test case for mobile terminated call testing In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I28c465187fd8b1dcfd687180b373a47bb9ac6734 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:31 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Fix TC_cmserv_imsi_unknown In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iadab7aed3d3d39186002f1ed25e83f3d3c1ed177 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:34 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Fix TC_lu_tmsi_noauth_unknown In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6f0d85750a68e71e9b589b23ad74b945a46a6a88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:36 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Don't explicitly enable TMSI allocation In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I123b44b36c3ed7e6bc0347d9703b8bd6288ba060 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:38 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add global g_Tguard timer to make sure BSC_ConnHdlr ter... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I10fc0ff04c16eacc12f09ac1759940676ae62213 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:40 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add missing 'repeat' in TC_mo_crcx_ran_reject In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id5c538546ba59f8a8d5f4379f16df2d99c8c2669 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:42 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:42 +0000 Subject: osmo-ttcn3-hacks[master]: deps: Switch back to upstream titan.TestPorts.UNIX_DOMAIN_SO... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib04d9a3095cf93609af07af0de0b701cba460f67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:44 +0000 Subject: osmo-ttcn3-hacks[master]: deps: Use SCTPasp from osmocom github fork (SO_REUSEADDR, us... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9169d231358a9a7e9e10302044a895087f7e7d78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:46 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Accept optional f_init_handler() argument for Tguard In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee6f50559a8fe45c7655b9f41e7fa163199b39a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:47 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Introduce shared f_expect_clear() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If070b079f2ffadb8065fb99d1c8951ac9baec88b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:50 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Fastert timeout in TC_cl3_{rnd, no}_payload In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ida2674fca10e164385f68d2ab7f8d300abd8b6f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:51 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Enable all test cases in control section In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc8c88de1b55d1f7e1e19be1b218edaebd7d767b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 13:32:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:52 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Enable all test cases in control section In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Enable all test cases in control section ...................................................................... msc: Enable all test cases in control section Change-Id: Idc8c88de1b55d1f7e1e19be1b218edaebd7d767b --- M msc_tests/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index fb4248e..9ac715b 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1391,11 +1391,12 @@ control { - execute( TC_cmserv_imsi_unknown() ); execute( TC_lu_imsi_noauth_tmsi() ); - //execute( TC_lu_imsi_noauth_notmsi() ); + execute( TC_lu_imsi_noauth_notmsi() ); execute( TC_lu_imsi_reject() ); execute( TC_lu_imsi_timeout_gsup() ); + execute( TC_lu_imsi_auth_tmsi() ); + execute( TC_cmserv_imsi_unknown() ); execute( TC_lu_and_mo_call() ); execute( TC_lu_auth_sai_timeout() ); execute( TC_lu_auth_sai_err() ); @@ -1420,6 +1421,8 @@ execute( TC_mo_setup_and_nothing() ); execute( TC_mo_crcx_ran_timeout() ); execute( TC_mo_crcx_ran_reject() ); + execute( TC_mt_crcx_ran_reject() ); + execute( TC_mt_t310() ); } -- To view, visit https://gerrit.osmocom.org/6134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc8c88de1b55d1f7e1e19be1b218edaebd7d767b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:53 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Fastert timeout in TC_cl3_{rnd, no}_payload In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Fastert timeout in TC_cl3_{rnd,no}_payload ...................................................................... msc: Fastert timeout in TC_cl3_{rnd,no}_payload Change-Id: Ida2674fca10e164385f68d2ab7f8d300abd8b6f7 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c241d74..fb4248e 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1035,12 +1035,18 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, ''O)))); + timer T := 5.0; + T.start; alt { [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} /* Expect LU REJECT with Cause == Illegal MS */ [] BSSAP.receive(tr_BSSMAP_ClearCommand) { BSSAP.send(ts_BSSMAP_ClearComplete); BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + } + [] T.timeout { + setverdict(inconc, "Timeout waiting for ClearCommand or SCCP Release"); + self.stop; } } setverdict(pass); @@ -1064,6 +1070,8 @@ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, valueof(ts_BSSMAP_ComplL3(g_pars.cell_id, payl)))); + timer T := 5.0; + T.start; alt { /* Immediate disconnect */ [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} @@ -1073,6 +1081,10 @@ BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); } [] BSSAP.receive(tr_PDU_DTAP_MT(?)) { repeat; } + [] T.timeout { + setverdict(inconc, "Timeout waiting for ClearCommand or SCCP Release"); + self.stop; + } } setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ida2674fca10e164385f68d2ab7f8d300abd8b6f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:53 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Introduce shared f_expect_clear() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Introduce shared f_expect_clear() ...................................................................... msc: Introduce shared f_expect_clear() Avoid having to copy+paste the matching of a channel clear/relesae Change-Id: If070b079f2ffadb8065fb99d1c8951ac9baec88b --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 55 insertions(+), 114 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 97c02b8..a7ce1ea 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -454,6 +454,41 @@ setverdict(pass); } +/* expect a clear command */ +function f_expect_clear(float t := 5.0) runs on BSC_ConnHdlr { + timer T := t; + + T.start; + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { } + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSMAP while waiting for ClearCommand"); + self.stop; + } + [] T.timeout { + setverdict(inconc, "Timeout waiting for ClearCommand"); + self.stop; + } + } + + BSSAP.send(ts_BSSMAP_ClearComplete); + + T.start; + alt { + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) { + setverdict(pass); + } + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSMAP while waiting for SCCP Release"); + self.stop; + } + [] T.timeout { + setverdict(inconc, "Timeout waiting for SCCP Release"); + self.stop; + } + } +} + diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 2e9176f..c241d74 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -437,10 +437,7 @@ self.stop; } } - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_imsi_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -467,10 +464,7 @@ self.stop; } } - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_imsi_timeout_gsup() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -520,13 +514,7 @@ [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } } - alt { - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - setverdict(pass); - } - [] BSSAP.receive { setverdict(fail, "Received unexpected BSSAP"); } - [] T.timeout { setverdict(inconc, "Timeout waiting for CM SERV REQ"); } - } + f_expect_clear(); } testcase TC_cmserv_imsi_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -573,10 +561,7 @@ /* The HLR would normally return an auth vector here, but we fail to do so. */ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_auth_sai_timeout() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -607,10 +592,7 @@ GSUP.send(ts_GSUP_SAI_ERR(g_pars.imsi, 13)); BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_auth_sai_err() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -704,10 +686,7 @@ [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_ID_Req)) { repeat; } } /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -753,10 +732,7 @@ } /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_by_tmsi_noauth_unknown() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -780,10 +756,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_imsi_detach_by_imsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -806,10 +779,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_imsi_detach_by_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -832,10 +802,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); /* wait for normal teardown */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_imsi_detach_by_imei() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -885,11 +852,7 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(tid))); /* clearing of radio channel */ - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - - f_sleep(5.0); + f_expect_clear(); } /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ @@ -900,10 +863,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ('05'O))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_emerg_call_imei_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -940,10 +900,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_serv_req_vgcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -964,10 +921,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_serv_req_vbs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -988,10 +942,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_serv_req_lcs_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1012,10 +963,7 @@ var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); f_bssap_compl_l3(l3_info); BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ(int2oct(32,1)))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_cm_reest_req_reject() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1054,10 +1002,7 @@ /* Expect LU REJECT with Cause == Illegal MS */ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej('03'O))); - BSSAP.receive(tr_BSSMAP_ClearCommand); - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); + f_expect_clear(); } testcase TC_lu_auth_2G_fail() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1146,20 +1091,7 @@ f_perform_lu(false, true, true, false); f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); - timer T := 30.0; - T.start; - alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); - } - [] BSSAP.receive { repeat; } - [] MNCC.receive { repeat; } - [] GSUP.receive { repeat; } - [] MGCP.receive { repeat; } - } + f_expect_clear(); } testcase TC_establish_and_nothing() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1183,20 +1115,7 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_SETUP(cpars.transaction_id, cpars.called_party))); - timer T := 30.0; - T.start; - alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); - } - [] BSSAP.receive { repeat; } - [] MNCC.receive { repeat; } - [] GSUP.receive { repeat; } - [] MGCP.receive { repeat; } - } + f_expect_clear(30.0); } testcase TC_mo_setup_and_nothing() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1230,20 +1149,7 @@ cpars.mgcp_ep := mgcp_cmd.line.ep; /* never respond to this */ - timer T := 30.0; - T.start; - alt { - [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } - [] BSSAP.receive(tr_BSSMAP_ClearCommand) { - BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); - setverdict(pass); - } - [] BSSAP.receive { repeat; } - [] MNCC.receive { repeat; } - [] GSUP.receive { repeat; } - [] MGCP.receive { repeat; } - } + f_expect_clear(30.0); } testcase TC_mo_crcx_ran_timeout() runs on MTC_CT { var BSC_ConnHdlr vc_conn; -- To view, visit https://gerrit.osmocom.org/6132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If070b079f2ffadb8065fb99d1c8951ac9baec88b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:54 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Accept optional f_init_handler() argument for Tguard In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Accept optional f_init_handler() argument for Tguard ...................................................................... msc: Accept optional f_init_handler() argument for Tguard Some tests may want an extended guard timer as they're waiting for some particularly slow events. They can override the default now. Change-Id: Iee6f50559a8fe45c7655b9f41e7fa163199b39a6 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 843197e..97c02b8 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -62,11 +62,11 @@ } /* init function, called as first function in new BSC_ConnHdlr */ -function f_init_handler(BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { +function f_init_handler(BSC_ConnHdlrPars pars, float t_guard := 60.0) runs on BSC_ConnHdlr { /* make parameters available via component variable */ g_pars := pars; /* Start guard timer and activate it as default */ - g_Tguard.start; + g_Tguard.start(t_guard); activate(as_Tguard()); } diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 2f85ab4..2e9176f 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1406,7 +1406,7 @@ /* Test MT Call T310 timer */ private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - f_init_handler(pars); + f_init_handler(pars, 200.0); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; -- To view, visit https://gerrit.osmocom.org/6131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iee6f50559a8fe45c7655b9f41e7fa163199b39a6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:54 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: deps: Use SCTPasp from osmocom github fork (SO_REUSEADDR, us... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: deps: Use SCTPasp from osmocom github fork (SO_REUSEADDR, usleep hack) ...................................................................... deps: Use SCTPasp from osmocom github fork (SO_REUSEADDR, usleep hack) Change-Id: I9169d231358a9a7e9e10302044a895087f7e7d78 --- M deps/Makefile 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/deps/Makefile b/deps/Makefile index c4c21e3..e1cbfe3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -17,7 +17,6 @@ titan.TestPorts.IPL4asp \ titan.TestPorts.LANL2asp \ titan.TestPorts.PCAPasp \ - titan.TestPorts.SCTPasp \ titan.TestPorts.SIPmsg \ titan.TestPorts.TCPasp \ titan.TestPorts.TELNETasp \ @@ -41,7 +40,7 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 -OSMOGITHUB_REPOS= +OSMOGITHUB_REPOS= titan.TestPorts.SCTPasp ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) -- To view, visit https://gerrit.osmocom.org/6130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9169d231358a9a7e9e10302044a895087f7e7d78 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:54 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: deps: Switch back to upstream titan.TestPorts.UNIX_DOMAIN_SO... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: deps: Switch back to upstream titan.TestPorts.UNIX_DOMAIN_SOCKETasp ...................................................................... deps: Switch back to upstream titan.TestPorts.UNIX_DOMAIN_SOCKETasp Upstream TITAN has merged our SOCK_SEQPACKET support, so there's no need for using our private repo anymore. Change-Id: Ib04d9a3095cf93609af07af0de0b701cba460f67 --- M deps/Makefile 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/deps/Makefile b/deps/Makefile index 64f5c2c..c4c21e3 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -21,7 +21,8 @@ titan.TestPorts.SIPmsg \ titan.TestPorts.TCPasp \ titan.TestPorts.TELNETasp \ - titan.TestPorts.UDPasp + titan.TestPorts.UDPasp \ + titan.TestPorts.UNIX_DOMAIN_SOCKETasp ECLIPSEGIT2_REPOS= titan.ProtocolModules.GRE \ titan.ProtocolModules.M2PA \ @@ -40,7 +41,7 @@ titan.ProtocolModules.NS_v7.3.0 \ titan.ProtocolModules.SNDCP_v7.0.0 -OSMOGITHUB_REPOS= titan.TestPorts.UNIX_DOMAIN_SOCKETasp +OSMOGITHUB_REPOS= ALL_REPOS=$(ECLIPSEGIT_REPOS) $(ECLIPSEGIT2_REPOS) $(OSMOGITHUB_REPOS) -- To view, visit https://gerrit.osmocom.org/6129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib04d9a3095cf93609af07af0de0b701cba460f67 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:55 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add missing 'repeat' in TC_mo_crcx_ran_reject In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add missing 'repeat' in TC_mo_crcx_ran_reject ...................................................................... msc: Add missing 'repeat' in TC_mo_crcx_ran_reject Change-Id: Id5c538546ba59f8a8d5f4379f16df2d99c8c2669 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index f38b989..2f85ab4 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1302,6 +1302,7 @@ [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); f_create_mgcp_delete_ep(cpars.mgcp_ep); + repeat; } [] MGCP.receive { repeat; } } -- To view, visit https://gerrit.osmocom.org/6128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id5c538546ba59f8a8d5f4379f16df2d99c8c2669 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:55 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add global g_Tguard timer to make sure BSC_ConnHdlr ter... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add global g_Tguard timer to make sure BSC_ConnHdlr terminates ...................................................................... msc: Add global g_Tguard timer to make sure BSC_ConnHdlr terminates Change-Id: I10fc0ff04c16eacc12f09ac1759940676ae62213 --- M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 53 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index bc6eebc..843197e 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -30,6 +30,7 @@ /* this component represents a single subscriber connection */ type component BSC_ConnHdlr extends BSSAP_ConnHdlr, MNCC_ConnHdlr, GSUP_ConnHdlr, MGCP_ConnHdlr { var BSC_ConnHdlrPars g_pars; + timer g_Tguard := 60.0; } type record AuthVector { @@ -52,6 +53,23 @@ AuthVector vec optional }; +/* altstep for the global guard timer */ +private altstep as_Tguard() runs on BSC_ConnHdlr { + [] g_Tguard.timeout { + setverdict(inconc, "Tguard timeout"); + self.stop; + } +} + +/* init function, called as first function in new BSC_ConnHdlr */ +function f_init_handler(BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + /* make parameters available via component variable */ + g_pars := pars; + /* Start guard timer and activate it as default */ + g_Tguard.start; + activate(as_Tguard()); +} + /* Callback function from general BSSMAP_Emulation whenever a connectionless * BSSMAP message arrives. Canreturn a PDU_BSSAPthat should be sent in return */ diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 8512d3e..f38b989 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -379,6 +379,8 @@ connect(vc_conn:GSUP, vc_GSUP:GSUP_CLIENT); connect(vc_conn:GSUP_PROC, vc_GSUP:GSUP_PROC); + /* We cannot use vc_conn.start(f_init_handler(fn, id, pars)); as we cannot have + * a stand-alone 'derefers()' call, see https://www.eclipse.org/forums/index.php/t/1091364/ */ vc_conn.start(derefers(fn)(id, pars)); return vc_conn; } @@ -395,7 +397,7 @@ } private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(false, true, true); } testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { @@ -407,7 +409,7 @@ } private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(false, false, true); } testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { @@ -421,7 +423,7 @@ /* Do LU by IMSI, refuse it on GSUP and expect LU REJ back to MS */ private function f_tc_lu_imsi_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -450,7 +452,7 @@ /* Do LU by IMSI, timeout on GSUP */ private function f_tc_lu_imsi_timeout_gsup(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); f_create_gsup_expect(hex2str(g_pars.imsi)); @@ -479,7 +481,7 @@ } private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(true, true, true); } testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { @@ -495,7 +497,7 @@ /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); @@ -534,7 +536,7 @@ } private function f_tc_lu_and_mo_call(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); cpars.bss_rtp_port := 1110; cpars.mgcp_connection_id_bss := '22222'H; @@ -553,7 +555,7 @@ /* Test LU (with authentication enabled), where HLR times out sending SAI response */ private function f_tc_lu_auth_sai_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -587,7 +589,7 @@ /* Test LU (with authentication enabled), where HLR rejects sending SAI error */ private function f_tc_lu_auth_sai_err(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -621,7 +623,7 @@ /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_clear_request(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -653,7 +655,7 @@ /* Test LU but BSC will send a clear request in the middle */ private function f_tc_lu_disconnect(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -683,7 +685,7 @@ /* Test LU but with illegal mobile identity type = IMEI */ private function f_tc_lu_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imei(g_pars.imei) var PDU_DTAP_MT dtap_mt; @@ -717,7 +719,7 @@ /* Test LU by TMSI with unknown TMSI, expect (and answer) ID REQ. */ private function f_tc_lu_tmsi_noauth_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_tmsi('01020304'O); /* FIXME: Random */ var PDU_DTAP_MT dtap_mt; @@ -767,7 +769,7 @@ /* Test IMSI DETACH (MI=IMSI) */ private function f_tc_imsi_detach_by_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); @@ -793,7 +795,7 @@ /* Test IMSI DETACH (MI=TMSI) */ private function f_tc_imsi_detach_by_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV('01020304'O)); @@ -819,7 +821,7 @@ /* Test IMSI DETACH (MI=IMEI), which is illegal */ private function f_tc_imsi_detach_by_imei(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); @@ -892,7 +894,7 @@ /* establish an emergency call by IMEI, no SIM inserted (and hence no IMSI) */ private function f_tc_emerg_call_imei_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(g_pars.imei)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_EMERG_CALL, mi)); @@ -913,7 +915,7 @@ /* establish an emergency call by IMSI, SIM inserted (and hence IMSI) */ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); /* Then issue emergency call identified by IMSI */ @@ -929,7 +931,7 @@ /* CM Service Request for VGCS -> reject */ private function f_tc_cm_serv_req_vgcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -953,7 +955,7 @@ /* CM Service Request for VBS -> reject */ private function f_tc_cm_serv_req_vbs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -977,7 +979,7 @@ /* CM Service Request for LCS -> reject */ private function f_tc_cm_serv_req_lcs_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -1001,7 +1003,7 @@ /* CM Re-Establishment Request */ private function f_tc_cm_reest_req_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* First perform location update to ensure subscriber is known */ f_perform_lu(false, true, true); @@ -1025,7 +1027,7 @@ /* Test LU (with authentication enabled), with wrong response from MS */ private function f_tc_lu_auth_2G_fail(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) @@ -1067,7 +1069,7 @@ } private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(true, true, true, true); } testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { @@ -1082,7 +1084,7 @@ /* Test Complete L3 without payload */ private function f_tc_cl3_no_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); /* Send Complete L3 Info with empty L3 frame */ BSSAP.send(ts_BSSAP_Conn_Req(g_pars.sccp_addr_peer, g_pars.sccp_addr_own, @@ -1108,7 +1110,7 @@ /* Test Complete L3 with random payload */ private function f_tc_cl3_rnd_payload(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var integer len := float2int(rnd() * 256.0); var octetstring payl := f_rnd_octstring(len); @@ -1139,7 +1141,7 @@ /* Test Complete L3 with random payload */ private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); f_perform_lu(false, true, true, false); @@ -1169,7 +1171,8 @@ /* Test MO Call SETUP with no response from MNCC */ private function f_tc_mo_setup_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); f_perform_lu(false, true, true, false); @@ -1205,7 +1208,7 @@ /* Test MO Call with no response to RAN-side CRCX */ private function f_tc_mo_crcx_ran_timeout(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; @@ -1252,7 +1255,7 @@ /* Test MO Call with reject to RAN-side CRCX */ private function f_tc_mo_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; @@ -1344,7 +1347,7 @@ /* Test MT Call */ private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; @@ -1402,7 +1405,7 @@ /* Test MT Call T310 timer */ private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { - g_pars := pars; + f_init_handler(pars); var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; -- To view, visit https://gerrit.osmocom.org/6127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I10fc0ff04c16eacc12f09ac1759940676ae62213 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:55 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Don't explicitly enable TMSI allocation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Don't explicitly enable TMSI allocation ...................................................................... msc: Don't explicitly enable TMSI allocation f_init() already enables TMSI allocation, no need to re-do that. Only tests *without* TMSI allocation must explicitly change this config. Change-Id: I123b44b36c3ed7e6bc0347d9703b8bd6288ba060 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 94e5822..8512d3e 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1061,7 +1061,6 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); vc_conn := f_start_handler(refers(f_tc_lu_auth_2G_fail), testcasename(), 23); vc_conn.done; @@ -1075,7 +1074,6 @@ var BSC_ConnHdlr vc_conn; f_init(); f_vty_config(MSCVTY, "network", "authentication required"); - f_vty_config(MSCVTY, "msc", "assign-tmsi"); f_vty_config(MSCVTY, "network", "encryption a5 1 3"); vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_13), testcasename(), 24); -- To view, visit https://gerrit.osmocom.org/6126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I123b44b36c3ed7e6bc0347d9703b8bd6288ba060 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:55 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Fix TC_lu_tmsi_noauth_unknown In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Fix TC_lu_tmsi_noauth_unknown ...................................................................... msc: Fix TC_lu_tmsi_noauth_unknown As the MSC allocates a new TMSI to us, we must send a TMSI REALLOC COMPL to avoid a LU REJ after the LU ACK. Change-Id: I6f0d85750a68e71e9b589b23ad74b945a46a6a88 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 73466b6..94e5822 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -742,7 +742,9 @@ GSUP.send(ts_GSUP_UL_RES(g_pars.imsi)); alt { - [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { } + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) { + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_TmsiRealloc_Cmpl)); + } [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { setverdict(fail, "Expected LU ACK, but received REJ"); } -- To view, visit https://gerrit.osmocom.org/6125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f0d85750a68e71e9b589b23ad74b945a46a6a88 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:56 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Fix TC_cmserv_imsi_unknown In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Fix TC_cmserv_imsi_unknown ...................................................................... msc: Fix TC_cmserv_imsi_unknown g_pars was not initialized, leading to IMSI encoding failure. Change-Id: Iadab7aed3d3d39186002f1ed25e83f3d3c1ed177 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 29e8303..73466b6 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -495,6 +495,7 @@ /* Send CM SERVICE REQ for IMSI that has never performed LU before */ private function f_tc_cmserv_imsi_unknown(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var BSSMAP_IE_CellIdentifier cell_id := valueof(ts_CellId_CGI('262'H, '042'H, 23, 42)); -- To view, visit https://gerrit.osmocom.org/6124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iadab7aed3d3d39186002f1ed25e83f3d3c1ed177 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:56 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: WIP: msc: First test case for mobile terminated call testing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: WIP: msc: First test case for mobile terminated call testing ...................................................................... WIP: msc: First test case for mobile terminated call testing We start the call from the MNCC side, match on the paging and then pick it up from there. It currently fails as the MNCC_Emulation cannot yet handle "ConnHdlr originated" MNCC calls yet. Change-Id: I28c465187fd8b1dcfd687180b373a47bb9ac6734 --- M library/L3_Templates.ttcn M library/MNCC_Emulation.ttcn M library/MNCC_Types.ttcn M msc_tests/BSC_ConnectionHandler.ttcn M msc_tests/MSC_Tests.ttcn 5 files changed, 259 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 2050e3d..7736ff5 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -435,6 +435,22 @@ digits := digits } +template CalledPartyBCD_Number tr_Called(template hexstring digits) := { + elementIdentifier := '5E'O, + lengthIndicator := ?, + numberingPlanIdentification := ?, + typeOfNumber := ?, + ext1 := ?, + digits := digits +} + +template CallingPartyBCD_Number tr_Calling(template hexstring digits) := { + elementIdentifier := '5C'O, + lengthIndicator := ?, + oct3 := ?, + digits := digits +} + type integer SpeechVer; template (value) Speech_AuxiliarySpeech ts_SpeechAux(SpeechVer ver, BIT1 suffix) := { @@ -756,5 +772,79 @@ } } +template PDU_ML3_MS_NW ts_ML3_MO_CC_CALL_CONF(integer tid, + template BearerCapability_TLV bcap := omit) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '1'B, /* response from destination */ + tIExtension := omit + } + }, + msgs := { + cc := { + callConfirmed := { + messageType := '001000'B, + nsd := '00'B, + repeatIndicator := omit, + bearerCapability1 := bcap, + bearerCapability2 := omit, + cause := omit, + cC_Capabilities := omit, + streamIdentifier := omit, + supportedCodecs := omit + } + } + } +} + + +template PDU_ML3_NW_MS tr_ML3_MT_CC_SETUP(integer tid, template hexstring called := *, + template hexstring calling := *, + template BearerCapability_TLV bcap := *) := { + discriminator := '0011'B, + tiOrSkip := { + transactionId := { + tio := int2bit(tid, 3), + tiFlag := '0'B, /* from originator */ + tIExtension := omit + } + }, + msgs := { + cc := { + setup_NW_MS := { + messageType := '000101'B, + nsd := '00'B, + bcRepeatIndicator := *, + bearerCapability1 := bcap, + bearerCapability2 := *, + facility := *, + progressIndicator := *, + signal := *, + callingPartyBCD_Number := tr_Calling(calling) ifpresent, + callingPartySubAddress := *, + calledPartyBCD_Number := tr_Called(called) ifpresent, + calledPartySubAddress := *, + redirectingPartyBCDNumber := *, + redirectingPartySubaddress := *, + llc_RepeatIndicator := *, + lowLayerCompatibility1 := *, + lowLayerCompatibility2 := *, + hlc_RepeatIndicator := *, + highLayerCompatibility1 := *, + highLayerCompatibility2 := *, + user_user := *, + priority := *, + alert := *, + networkCCCapabilities := *, + causeofNoCli := *, + backupBearerCapacity := * + } + } + } +} + + } diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn index 4bf516d..de29288 100644 --- a/library/MNCC_Emulation.ttcn +++ b/library/MNCC_Emulation.ttcn @@ -280,6 +280,14 @@ f_call_table_del(call_id); } + /* Client -> MNCC Socket: SETUP.req: forward + add call table entry */ + [] MNCC_CLIENT.receive(MNCC_PDU:{msg_type := MNCC_SETUP_REQ, u:=?}) -> value mncc sender vc_conn { + /* add to call table */ + f_call_table_add(vc_conn, f_mncc_get_call_id(mncc)); + /* forward to MNCC socket */ + MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc)); + } + /* Client -> MNCC Socket: Normal message */ [] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn { /* forward to MNCC socket */ diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn index 884a7c0..258db3f 100644 --- a/library/MNCC_Types.ttcn +++ b/library/MNCC_Types.ttcn @@ -665,10 +665,10 @@ } } -/* MT: MSC <- MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ -template MNCC_PDU ts_MNCC_CALL_CONF_req(uint32_t call_id, template MNCC_bearer_cap bcap := omit, - template MNCC_cause cause := omit, - template MNCC_cccap cccap := omit) := { +/* MT: MSC -> MNCC: CALL_CONF.req; send CALL CONFIRMED to MS */ +template MNCC_PDU tr_MNCC_CALL_CONF_ind(template uint32_t call_id, template MNCC_bearer_cap bcap := *, + template MNCC_cause cause := *, + template MNCC_cccap cccap := *) := { msg_type := MNCC_CALL_CONF_IND, u := { signal := { /* See 24.008 9.3.2 */ @@ -691,9 +691,9 @@ more := 0, notify := 0, emergency := omit, - imsi := "", - lchan_type := 0, - lchan_mode := 0 + imsi := ?, + lchan_type := ?, + lchan_mode := ? } } } diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc_tests/BSC_ConnectionHandler.ttcn index 75871c5..bc6eebc 100644 --- a/msc_tests/BSC_ConnectionHandler.ttcn +++ b/msc_tests/BSC_ConnectionHandler.ttcn @@ -132,6 +132,19 @@ } } +/* helper function to fully establish a dedicated channel */ +function f_establish_fully_pag(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) +runs on BSC_ConnHdlr { + var PDU_ML3_MS_NW l3_info := valueof(ts_PAG_RESP(mi)); + var PDU_DTAP_MT dtap_mt; + + /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ + f_bssap_compl_l3(l3_info); + + f_mm_common(expect_auth, expect_ciph); +} + + /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW { diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 43ae760..29e8303 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1311,6 +1311,147 @@ } +/* helper function to start a MT call: MNCC SETUP; Paging; DChan est.; DTAP SETUP */ +private function f_mt_call_start(inout CallParameters cpars) runs on BSC_ConnHdlr { + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + var OCT4 tmsi; + + f_perform_lu(false, true, true, false); + if (isvalue(g_pars.tmsi)) { + tmsi := g_pars.tmsi; + } else { + tmsi := 'FFFFFFFF'O; + } + f_bssmap_register_imsi(g_pars.imsi, tmsi); + + /* Allocate call reference and send SETUP via MNCC to MSC */ + cpars.mncc_callref := f_rnd_int(2147483648); + MNCC.send(ts_MNCC_SETUP_req(cpars.mncc_callref, hex2str(g_pars.msisdn), + hex2str(cpars.called_party), hex2str(g_pars.imsi))); + + /* MSC->BSC: expect PAGING from MSC */ + BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); + /* MS -> MSC: PAGING RESPONSE */ + f_establish_fully_pag(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + + f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); + + /* MSC->MS: SETUP */ + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_SETUP(cpars.transaction_id, *, cpars.called_party))); +} + +/* Test MT Call */ +private function f_tc_mt_crcx_ran_reject(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_mt_call_start(cpars); + + /* MS->MSC: CALL CONFIRMED */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CALL_CONF(cpars.transaction_id))); + + MNCC.receive(tr_MNCC_CALL_CONF_ind(cpars.mncc_callref)); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; + /* Respond to CRCX with error */ + var MgcpResponse mgcp_rsp := { + line := { + code := "542", + trans_id := mgcp_cmd.line.trans_id, + string := "FORCED_FAIL" + }, + params := omit, + sdp := omit + } + MGCP.send(mgcp_rsp); + + timer T := 30.0; + T.start; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for channel release"); self.stop; } + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] BSSAP.receive { repeat; } + [] MNCC.receive { repeat; } + [] GSUP.receive { repeat; } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + repeat; + } + [] MGCP.receive { repeat; } + } +} +testcase TC_mt_crcx_ran_reject() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mt_crcx_ran_reject), testcasename(), 29); + vc_conn.done; +} + + +/* Test MT Call T310 timer */ +private function f_tc_mt_t310(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + g_pars := pars; + var CallParameters cpars := valueof(t_CallParams('123456'H, 0)); + var MNCC_PDU mncc; + var MgcpCommand mgcp_cmd; + + f_mt_call_start(cpars); + + /* MS->MSC: CALL CONFIRMED */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_CALL_CONF(cpars.transaction_id))); + MNCC.receive(tr_MNCC_CALL_CONF_ind(cpars.mncc_callref)); + + MGCP.receive(tr_CRCX) -> value mgcp_cmd; + cpars.mgcp_call_id := f_MgcpCmd_extract_call_id(mgcp_cmd); + cpars.mgcp_ep := mgcp_cmd.line.ep; + /* FIXME: Respond to CRCX */ + + /* old libosmocore T310 default timeout is 180s. so let's wait 190 */ + timer T := 190.0; + T.start; + alt { + [] T.timeout { setverdict(fail, "Timeout waiting for T310"); self.stop; } + [] MNCC.receive(tr_MNCC_DISC_ind(cpars.mncc_callref)) { + MNCC.send(ts_MNCC_REL_req(cpars.mncc_callref, valueof(ts_MNCC_cause(23)))); + } + } + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_DISC(cpars.transaction_id))); + BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_CC_RELEASE(cpars.transaction_id))); + /* FIXME: We're sending this with TIflag 0: allocated by sender, which is wrong */ + BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MO_CC_REL_COMPL(cpars.transaction_id))); + + alt { + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { + BSSAP.send(ts_BSSMAP_ClearComplete); + BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + setverdict(pass); + } + [] MGCP.receive(tr_DLCX(?)) -> value mgcp_cmd { + MGCP.send(ts_DLCX_ACK2(mgcp_cmd.line.trans_id)); + f_create_mgcp_delete_ep(cpars.mgcp_ep); + repeat; + } + } +} +testcase TC_mt_t310() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_mt_t310), testcasename(), 30); + vc_conn.done; +} + /* TODO: -- To view, visit https://gerrit.osmocom.org/6123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I28c465187fd8b1dcfd687180b373a47bb9ac6734 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:56 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging ...................................................................... BSSMAP: Add IMSI/TMSI mapping table to dispatch incoming paging If we're emulating BSC/BTS/MS, then we must be able to dispatch incoming paging requests based on their IMSI or TMSI to the right ConnHdlr component. This introduces a new table to facilitate that dispatch. Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b --- M library/BSSMAP_Emulation.ttcn M library/BSSMAP_Templates.ttcn 2 files changed, 120 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index e7a432c..ca5afb9 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -116,6 +116,12 @@ integer cic optional } +type record ImsiMapping { + BSSAP_ConnHdlr comp_ref, + hexstring imsi optional, + OCT4 tmsi +} + type component BSSMAP_Emulation_CT { /* SCCP port on the bottom side, using ASP primitives */ port BSSAP_CODEC_PT BSSAP; @@ -129,6 +135,10 @@ /* pending expected incoming connections */ var ExpectData ExpectTable[8]; + + /* tables for mapping inbound unitdata (like paging) */ + var ImsiMapping ImsiTable[16]; + /* procedure based port to register for incoming connections */ port BSSMAPEM_PROC_PT PROC; @@ -270,6 +280,11 @@ ConnectionTable[i].mgcp_trans_id := omit; ConnectionTable[i].cic := omit; } + for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { + ImsiTable[i].comp_ref := null; + ImsiTable[i].imsi := omit; + ImsiTable[i].tmsi := 'FFFFFFFF'O; + } } private function f_conn_table_add(BSSAP_ConnHdlr comp_ref, integer sccp_conn_id) @@ -301,6 +316,17 @@ log("BSSMAP Connection table attempt to delete non-existant ", sccp_conn_id); setverdict(fail); self.stop; +} + +private function f_imsi_table_find(hexstring imsi, template OCT4 tmsi) +runs on BSSMAP_Emulation_CT return BSSAP_ConnHdlr { + for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { + if (ImsiTable[i].imsi == imsi or + isvalue(tmsi) and match(ImsiTable[i].tmsi, tmsi)) { + return ImsiTable[i].comp_ref; + } + } + return null; } /* handle (optional) userData portion of various primitives and dispatch it to the client */ @@ -346,6 +372,27 @@ type function BssmapUnitdataCallback(PDU_BSSAP bssap) runs on BSSMAP_Emulation_CT return template PDU_BSSAP; +/* handle common Unitdata such as Paging */ +private function CommonBssmapUnitdataCallback(PDU_BSSAP bssap) +runs on BSSMAP_Emulation_CT return template PDU_BSSAP { + if (match(bssap, tr_BSSMAP_Paging)) { + var BSSAP_ConnHdlr client := null; + client := f_imsi_table_find(bssap.pdu.bssmap.paging.iMSI.digits, + bssap.pdu.bssmap.paging.tMSI.tmsiOctets); + if (isvalue(client)) { + log("CommonBssmapUnitdataCallback: IMSI/TMSI found in table, dispatching to ", + client); + CLIENT.send(bssap) to client; + return omit; + } + log("CommonBssmapUnitdataCallback: IMSI/TMSI not found in table"); + } else { + log("CommonBssmapUnitdataCallback: Not a paging message"); + } + /* ELSE: handle in user callback */ + return g_bssmap_ops.unitdata_cb.apply(bssap); +} + type record BssmapOps { BssmapCreateCallback create_cb, BssmapUnitdataCallback unitdata_cb, @@ -375,13 +422,15 @@ var MgcpResponse mgcp_resp; var BSSAP_ConnHdlr vc_hdlr; var octetstring l3_info; + var hexstring imsi; + var OCT4 tmsi; alt { /* SCCP -> Client: UNIT-DATA (connectionless SCCP) from a BSC */ [] BSSAP.receive(BSSAP_N_UNITDATA_ind:?) -> value ud_ind { /* Connectionless Procedures like RESET */ var template PDU_BSSAP resp; - resp := ops.unitdata_cb.apply(ud_ind.userData); + resp := CommonBssmapUnitdataCallback(ud_ind.userData); if (isvalue(resp)) { BSSAP.send(ts_BSSAP_UNITDATA_req(ud_ind.callingAddress, ud_ind.calledAddress, resp)); @@ -528,6 +577,12 @@ PROC.reply(BSSMAPEM_register:{l3_info, vc_hdlr}); } + [] PROC.getcall(BSSMAPEM_register_imsi:{?,?,?}) -> param(imsi, tmsi, vc_hdlr) { + f_create_imsi(imsi, tmsi, vc_hdlr); + PROC.reply(BSSMAPEM_register_imsi:{imsi, tmsi, vc_hdlr}); + } + + } } } @@ -553,8 +608,11 @@ /* procedure based port to register for incoming connections */ signature BSSMAPEM_register(in octetstring l3, in BSSAP_ConnHdlr hdlr); +/* procedure based port to register for incoming IMSI/TMSI */ +signature BSSMAPEM_register_imsi(in hexstring imsi, in OCT4 tmsi, in BSSAP_ConnHdlr hdlr); + type port BSSMAPEM_PROC_PT procedure { - inout BSSMAPEM_register; + inout BSSMAPEM_register, BSSMAPEM_register_imsi; } with { extension "internal" }; /* CreateCallback that can be used as create_cb and will use the expectation table */ @@ -602,6 +660,22 @@ setverdict(fail, "No space left in ExpectTable"); } +private function f_create_imsi(hexstring imsi, OCT4 tmsi, BSSAP_ConnHdlr hdlr) +runs on BSSMAP_Emulation_CT { + for (var integer i := 0; i < sizeof(ImsiTable); i := i+1) { + if (not ispresent(ImsiTable[i].imsi)) { + ImsiTable[i].imsi := imsi; + ImsiTable[i].tmsi := tmsi; + ImsiTable[i].comp_ref := hdlr; + log("Created IMSI[", i, "] for ", imsi, tmsi, " to be handled at ", hdlr); + return; + } + } + setverdict(fail, "No space left in ImsiTable"); + self.stop; +} + + private function f_expect_table_init() runs on BSSMAP_Emulation_CT { for (var integer i := 0; i < sizeof(ExpectTable); i := i+1) { @@ -609,4 +683,13 @@ } } +/* helper function for clients to register their IMSI/TMSI */ +function f_bssmap_register_imsi(hexstring imsi, OCT4 tmsi) +runs on BSSAP_ConnHdlr { + BSSAP_PROC.call(BSSMAPEM_register_imsi:{imsi, tmsi, self}) { + [] BSSAP_PROC.getreply(BSSMAPEM_register_imsi:{?,?,?}) {}; + } +} + + } diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index 075dab7..c98f5eb 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -660,6 +660,14 @@ digits := imsi_digits } +template BSSMAP_IE_IMSI tr_BSSMAP_Imsi(template hexstring imsi_digits) := { + elementIdentifier := '08'O, + lengthIndicator := ?, /* overwritten */ + typeOfIdentity := '001'B, /* IMSI */ + oddEvenIndicator := ?, + digits := imsi_digits +} + template BSSMAP_FIELD_CellIdentificationList ts_BSSMAP_CIL_noCell := { cIl_noCell := ''O } @@ -699,6 +707,12 @@ tmsiOctets := tmsi }; +template BSSMAP_IE_TMSI tr_BSSMAP_IE_TMSI(template OCT4 tmsi) := { + elementIdentifier := '09'O, + lengthIndicator := 4, + tmsiOctets := tmsi +}; + private function f_tmsi_or_omit(template OCT4 tmsi) return template BSSMAP_IE_TMSI { var template BSSMAP_IE_TMSI ret; if (ispresent(tmsi)) { @@ -717,7 +731,7 @@ pdu := { bssmap := { paging := { - messageType := '51'O, + messageType := '52'O, iMSI := ts_BSSMAP_Imsi(imsi_digits), tMSI := f_tmsi_or_omit(tmsi), cellIdentifierList := ts_BSSMAP_IE_CidList(valueof(cid_list)), @@ -729,6 +743,26 @@ } } +template PDU_BSSAP tr_BSSMAP_Paging(template hexstring imsi_digits := ?, + template OCT4 tmsi := *, + template BSSMAP_IE_ChannelNeeded chneed := *) +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + paging := { + messageType := '52'O, + iMSI := tr_BSSMAP_Imsi(imsi_digits), + tMSI := tr_BSSMAP_IE_TMSI(tmsi) ifpresent, + cellIdentifierList := ?, + channelNeeded := chneed, + eMLPP_Priority := omit, + pagingInformation := omit /* only VGCS/VBS flag */ + } + } + } +} + + template PDU_BSSAP ts_BSSMAP_CipherModeCmd(OCT1 alg, OCT8 key) modifies ts_BSSAP_BSSMAP := { pdu := { -- To view, visit https://gerrit.osmocom.org/6121 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I85c1ea3bcf8fb4a100f20cffdc991826b58e290b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:32:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:32:56 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC ...................................................................... GSUP_Types: Make sure our MSISDN encoding agrees with OsmoMSC OsmoMSC seems to have broken encoding of MSISDN which is not in-line with the spec. Let's adapt to it. Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3 Related: OS#2883 --- M library/GSUP_Types.ttcn 1 file changed, 29 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 7f239ca..4d2c3c5 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -80,6 +80,11 @@ OSMO_GSUP_CN_DOMAIN_CS (2) } with { variant "FIELDLENGTH(8)" }; +type record GSUP_MSISDN { + uint8_t len, + hexstring digits optional +} with { variant (len) "LENGTHTO(digits)" }; + type record GSUP_IE { GSUP_IEI tag, uint8_t len, @@ -121,7 +126,7 @@ octetstring ck, octetstring autn, octetstring res, - hexstring msisdn, + GSUP_MSISDN msisdn, octetstring hlr_number, GSUP_CnDomain cn_domain, octetstring charg_char @@ -157,6 +162,27 @@ } } } + +template (value) GSUP_MSISDN ts_GSUP_MSISDN(hexstring digits, + BIT3 ton := '000'B, + BIT4 npi := '0000'B) := { + len := 0, /* overwritten */ + /* numberingPlanIdentification := npi, + typeOfNumber := ton, + ext1 := '0'B, */ + digits := digits +} + +template GSUP_MSISDN tr_GSUP_MSISDN(template hexstring digits, + template BIT3 ton := ?, + template BIT4 npi := ?) := { + len := ?, + /* numberingPlanIdentification := npi, + typeOfNumber := ton, + ext1 := '0'B, */ + digits := digits +} + template GSUP_IE ts_GSUP_IE_AuthTuple2G(octetstring rand, octetstring sres, @@ -273,7 +299,7 @@ tag := OSMO_GSUP_MSISDN_IE, len := 0, /* overwritten */ val := { - msisdn := msisdn + msisdn := ts_GSUP_MSISDN(msisdn) } } @@ -281,7 +307,7 @@ tag := OSMO_GSUP_MSISDN_IE, len := ?, val := { - msisdn := msisdn + msisdn := tr_GSUP_MSISDN(msisdn) } } -- To view, visit https://gerrit.osmocom.org/6122 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4892df63f1a135573dcac977f5eb0a79cbaffad3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:34:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:34:59 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:35:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:35:26 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: fix allocation calls In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:35:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:35:54 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: avoid TS reassignment In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/4085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:36:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:36:15 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:37:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:37:06 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:38:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:38:18 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:39:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:39:41 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:41:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:41:18 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: separate capacity computation In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 5 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 Sat Jan 27 13:42:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:42:16 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/3935/5/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 712 is it intentional that we loose those logging / debugging capabilities? -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:42:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:42:54 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: split off RX mask computation In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 7 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 Sat Jan 27 13:43:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:43:37 +0000 Subject: osmo-iuh[master]: configure.ac: Enable -Wall flag In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib05f7862081708d578d8f0302d926aab42897dc2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh 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 Sat Jan 27 13:43:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:43:40 +0000 Subject: [MERGED] osmo-iuh[master]: configure.ac: Enable -Wall flag In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: configure.ac: Enable -Wall flag ...................................................................... configure.ac: Enable -Wall flag Change-Id: Ib05f7862081708d578d8f0302d926aab42897dc2 --- M configure.ac 1 file 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/configure.ac b/configure.ac index 2b8974f..dd1d75e 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,9 @@ CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined" fi +CFLAGS="$CFLAGS -Wall" +CPPFLAGS="$CPPFLAGS -Wall" + AC_OUTPUT( libosmo-ranap.pc src/Makefile -- To view, visit https://gerrit.osmocom.org/5998 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib05f7862081708d578d8f0302d926aab42897dc2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Sat Jan 27 13:44:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:44:25 +0000 Subject: libosmocore[master]: gsm_04_08.h: Clearly annotate timers that don't have a 3GPP ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c 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 Sat Jan 27 13:44:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:44:27 +0000 Subject: libosmocore[master]: gsm_04_08.h: Reduce T310 default to 30s. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a 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 Sat Jan 27 13:44:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:44:29 +0000 Subject: [MERGED] libosmocore[master]: gsm_04_08.h: Reduce T310 default to 30s. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_04_08.h: Reduce T310 default to 30s. ...................................................................... gsm_04_08.h: Reduce T310 default to 30s. 3GPP doesn't specify a network-side T310 default, but waiting for 180s (3 minutes!) for the next message after CALL CONFIRMED is clearly way too long and will just use radio resources for no good reason. Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a Related: OS#2884 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index a7ab612..e54084f 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1496,7 +1496,7 @@ #define GSM48_T305 30, 0 #define GSM48_T306 30, 0 #define GSM48_T308 10, 0 /* no spec default */ -#define GSM48_T310 180, 0 /* no spec default */ +#define GSM48_T310 30, 0 /* no spec default */ #define GSM48_T313 30, 0 /* no spec default */ #define GSM48_T323 30, 0 #define GSM48_T331 30, 0 /* no spec default */ -- To view, visit https://gerrit.osmocom.org/6120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia52f9358bc86b23c72af9c80e2fff5cb0004b57a 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 Sat Jan 27 13:44:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:44:29 +0000 Subject: [MERGED] libosmocore[master]: gsm_04_08.h: Clearly annotate timers that don't have a 3GPP ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_04_08.h: Clearly annotate timers that don't have a 3GPP Default value ...................................................................... gsm_04_08.h: Clearly annotate timers that don't have a 3GPP Default value Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 7 insertions(+), 7 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 93b8c59..a7ab612 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1495,14 +1495,14 @@ #define GSM48_T303 30, 0 #define GSM48_T305 30, 0 #define GSM48_T306 30, 0 -#define GSM48_T308 10, 0 -#define GSM48_T310 180, 0 -#define GSM48_T313 30, 0 +#define GSM48_T308 10, 0 /* no spec default */ +#define GSM48_T310 180, 0 /* no spec default */ +#define GSM48_T313 30, 0 /* no spec default */ #define GSM48_T323 30, 0 -#define GSM48_T331 30, 0 -#define GSM48_T333 30, 0 -#define GSM48_T334 25, 0 /* min 15 */ -#define GSM48_T338 30, 0 +#define GSM48_T331 30, 0 /* no spec default */ +#define GSM48_T333 30, 0 /* no spec default */ +#define GSM48_T334 25, 0 /* min 15s */ +#define GSM48_T338 30, 0 /* no spec default */ #define GSM48_T303_MS 30, 0 #define GSM48_T305_MS 30, 0 #define GSM48_T308_MS 30, 0 -- To view, visit https://gerrit.osmocom.org/6119 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I44fffaec1f7c0d819aa2ebc85e97f19581fc689c 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 Sat Jan 27 13:50:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 13:50:11 +0000 Subject: [PATCH] osmo-msc[master]: mgcp: use osmo-mgw to switch rtp streams 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/4980 to look at the new patch set (#20). mgcp: use osmo-mgw to switch rtp streams in the current implementation we still use osmo-bsc_mgcp, which has many problems and is also obsoleted by osmo-mgw. integrate osmo-mgw and re-implement the current switching using an osmo fsm. Depends: osmo-mgw Iab6a6038e7610c62f34e642cd49c93d11151252c Depends: osmo-iuh I3c1a0455c5f25cae41ee19229d6daf299e023062 Closes: OS#2605 Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 --- M include/osmocom/msc/Makefile.am M include/osmocom/msc/gsm_data.h M include/osmocom/msc/iucs.h M include/osmocom/msc/msc_ifaces.h A include/osmocom/msc/msc_mgcp.h M src/libmsc/Makefile.am M src/libmsc/a_iface.c M src/libmsc/a_iface_bssap.c M src/libmsc/gsm_04_08.c M src/libmsc/iucs.c M src/libmsc/iucs_ranap.c M src/libmsc/msc_ifaces.c A src/libmsc/msc_mgcp.c M tests/msc_vlr/Makefile.am M tests/msc_vlr/msc_vlr_tests.c 15 files changed, 1,316 insertions(+), 325 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/80/4980/20 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index ec231d0..c947d96 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -20,6 +20,7 @@ mncc.h \ mncc_int.h \ msc_ifaces.h \ + msc_mgcp.h \ oap_client.h \ openbscdefines.h \ a_reset.h \ diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index e987136..0f6627e 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -185,9 +185,17 @@ struct gsm_encr encr; struct { + struct mgcp_ctx *mgcp_ctx; unsigned int mgcp_rtp_endpoint; - uint16_t port_subscr; - uint16_t port_cn; + + uint16_t local_port_ran; + char local_addr_ran[INET_ADDRSTRLEN]; + uint16_t remote_port_ran; + char remote_addr_ran[INET_ADDRSTRLEN]; + uint16_t local_port_cn; + char local_addr_cn[INET_ADDRSTRLEN]; + uint16_t remote_port_cn; + char remote_addr_cn[INET_ADDRSTRLEN]; } rtp; /* which Iu-CS connection, if any. */ diff --git a/include/osmocom/msc/iucs.h b/include/osmocom/msc/iucs.h index b7d6064..a48a316 100644 --- a/include/osmocom/msc/iucs.h +++ b/include/osmocom/msc/iucs.h @@ -1,7 +1,10 @@ #pragma once +#include + int gsm0408_rcvmsg_iucs(struct gsm_network *network, struct msgb *msg, uint16_t *lac); struct gsm_subscriber_connection *subscr_conn_lookup_iu(struct gsm_network *network, struct ranap_ue_conn_ctx *ue); +int iu_rab_act_cs(struct gsm_trans *trans); diff --git a/include/osmocom/msc/msc_ifaces.h b/include/osmocom/msc/msc_ifaces.h index 0592c07..ca25e9d 100644 --- a/include/osmocom/msc/msc_ifaces.h +++ b/include/osmocom/msc/msc_ifaces.h @@ -37,7 +37,3 @@ enum gsm48_reject_value value); int msc_tx_common_id(struct gsm_subscriber_connection *conn); -int msc_call_assignment(struct gsm_trans *trans); -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2); -void msc_call_release(struct gsm_trans *trans); -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip); diff --git a/include/osmocom/msc/msc_mgcp.h b/include/osmocom/msc/msc_mgcp.h new file mode 100644 index 0000000..ac3283c --- /dev/null +++ b/include/osmocom/msc/msc_mgcp.h @@ -0,0 +1,56 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#pragma once + +#include +#include + +/* MGCP state handler context. This context information stores all information + * to handle the direction of the RTP streams via MGCP. There is one instance + * of this context struct per subscriber connection. + * (see also struct gsm_subscriber_connection) */ +struct mgcp_ctx { + /* FSM instance, which handles the connection switching procedure */ + struct osmo_fsm_inst *fsm; + + /* RTP endpoint number. This number identifies the endpoint + * on the MGW on which the RAN and CN connection is created. This + * endpoint number is assigned and released automatically. */ + uint16_t rtp_endpoint; + + /* Set to true, when the context information is no longer needed */ + bool free_ctx; + + /* RTP connection identifiers */ + char conn_id_ran[MGCP_CONN_ID_LENGTH]; + char conn_id_cn[MGCP_CONN_ID_LENGTH]; + + /* Copy of the pointer and the data with context information + * needed to process the AoIP and MGCP requests (system data) */ + struct mgcp_client *mgcp; + struct gsm_trans *trans; + mgcp_trans_id_t mgw_pending_trans; +}; + +int msc_mgcp_call_assignment(struct gsm_trans *trans); +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr); +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr); +int msc_mgcp_call_release(struct gsm_trans *trans); diff --git a/src/libmsc/Makefile.am b/src/libmsc/Makefile.am index 8ae0e18..91d1854 100644 --- a/src/libmsc/Makefile.am +++ b/src/libmsc/Makefile.am @@ -39,6 +39,7 @@ mncc_builtin.c \ mncc_sock.c \ msc_ifaces.c \ + msc_mgcp.c \ rrlp.c \ silent_call.c \ sms_queue.c \ diff --git a/src/libmsc/a_iface.c b/src/libmsc/a_iface.c index 220642c..11e1542 100644 --- a/src/libmsc/a_iface.c +++ b/src/libmsc/a_iface.c @@ -396,8 +396,17 @@ /* Package RTP-Address data */ memset(&rtp_addr_in, 0, sizeof(rtp_addr_in)); rtp_addr_in.sin_family = AF_INET; - rtp_addr_in.sin_port = osmo_htons(conn->rtp.port_subscr); - rtp_addr_in.sin_addr.s_addr = osmo_htonl(mgcp_client_remote_addr_n(gsm_network->mgw.client)); + rtp_addr_in.sin_port = osmo_htons(conn->rtp.local_port_ran); + rtp_addr_in.sin_addr.s_addr = inet_addr(conn->rtp.local_addr_ran); + + if (rtp_addr_in.sin_addr.s_addr == INADDR_NONE) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Address -- assignment not sent!\n"); + return -EINVAL; + } + if (rtp_addr_in.sin_port == 0) { + LOGPCONN(conn, LOGL_ERROR, "Invalid RTP-Port -- assignment not sent!\n"); + return -EINVAL; + } memset(&rtp_addr, 0, sizeof(rtp_addr)); memcpy(&rtp_addr, &rtp_addr_in, sizeof(rtp_addr_in)); diff --git a/src/libmsc/a_iface_bssap.c b/src/libmsc/a_iface_bssap.c index 909a9f9..fc95dfb 100644 --- a/src/libmsc/a_iface_bssap.c +++ b/src/libmsc/a_iface_bssap.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -596,11 +597,7 @@ * transport address element */ if (rtp_addr.ss_family == AF_INET) { rtp_addr_in = (struct sockaddr_in *)&rtp_addr; - conn->rtp.port_subscr = osmo_ntohs(rtp_addr_in->sin_port); - /* FIXME: We also get the IP-Address of the remote (e.g. BTS) - * end with the response. Currently we just ignore that address. - * Instead we expect that our local MGCP gateway and the code - * controlling it, magically knows the IP of the remote end. */ + msc_mgcp_ass_complete(conn, osmo_ntohs(rtp_addr_in->sin_port), inet_ntoa(rtp_addr_in->sin_addr)); } else { LOGP(DMSC, LOGL_ERROR, "Unsopported addressing scheme. (supports only IPV4)\n"); goto fail; diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 126a216..fc3a71b 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -61,6 +61,7 @@ #include #include #include +#include #include #include #ifdef BUILD_IU @@ -69,6 +70,7 @@ #include #include +#include #include @@ -1360,8 +1362,8 @@ { gsm48_stop_cc_timer(trans); - /* Make sure call also gets released on the mgcp side */ - msc_call_release(trans); + /* Initiate the teardown of the related connections on the MGW */ + msc_mgcp_call_release(trans); /* send release to L4, if callref still exists */ if (trans->callref) { @@ -1422,6 +1424,7 @@ { struct gsm_trans *trans1 = trans_find_by_callref(net, bridge->callref[0]); struct gsm_trans *trans2 = trans_find_by_callref(net, bridge->callref[1]); + int rc; if (!trans1 || !trans2) return -EIO; @@ -1432,7 +1435,18 @@ /* Which subscriber do we want to track trans1 or trans2? */ log_set_context(LOG_CTX_VLR_SUBSCR, trans1->vsub); - return msc_call_bridge(trans1, trans2); + /* Bridge RTP streams */ + rc = msc_mgcp_call_complete(trans1, trans2->conn->rtp.local_port_cn, + trans2->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + rc = msc_mgcp_call_complete(trans2, trans1->conn->rtp.local_port_cn, + trans1->conn->rtp.local_addr_cn); + if (rc) + return -EINVAL; + + return 0; } static int gsm48_cc_rx_status_enq(struct gsm_trans *trans, struct msgb *msg) @@ -1777,7 +1791,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -1819,7 +1833,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2703,8 +2717,23 @@ * (0 if unknown) */ msg_type = GSM_TCHF_FRAME; - uint32_t addr = mgcp_client_remote_addr_n(net->mgw.client); - uint16_t port = trans->conn->rtp.port_cn; + uint32_t addr = inet_addr(trans->conn->rtp.local_addr_cn); + uint16_t port = trans->conn->rtp.local_port_cn; + + LOGP(DMNCC, LOGL_ERROR, "RTP create for non-existing trans\n"); + + if (addr == INADDR_NONE) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid IP-Address\n", + vlr_subscr_name(trans->vsub)); + return; + } + if (port == 0) { + LOGP(DMNCC, LOGL_ERROR, + "(subscriber:%s) external MNCC is signalling invalid Port\n", + vlr_subscr_name(trans->vsub)); + return; + } /* FIXME: This has to be set to some meaningful value, * before the MSC-Split, this value was pulled from @@ -2744,15 +2773,15 @@ trans->conn->mncc_rtp_bridge = 1; - /* When we call msc_call_assignment() we will trigger, depending + /* When we call msc_mgcp_call_assignment() we will trigger, depending * on the RAN type the call assignment on the A or Iu interface. - * msc_call_assignment() also takes care about sending the CRCX + * msc_mgcp_call_assignment() also takes care about sending the CRCX * command to the MGCP-GW. The CRCX will return the port number, * where the PBX (e.g. Asterisk) will send its RTP stream to. We * have to return this port number back to the MNCC by sending * it back with the TCH_RTP_CREATE message. To make sure that * this message is sent AFTER the response to CRCX from the - * MGCP-GW has arrived, we need will instruct msc_call_assignment() + * MGCP-GW has arrived, we need will instruct msc_mgcp_call_assignment() * to take care of this by setting trans->tch_rtp_create to true. * This will make sure that gsm48_tch_rtp_create() (below) is * called as soon as the local port number has become known. */ @@ -2760,7 +2789,7 @@ /* Assign call (if not done yet) */ if (trans->assignment_done == false) { - rc = msc_call_assignment(trans); + rc = msc_mgcp_call_assignment(trans); trans->assignment_done = true; } else @@ -2787,6 +2816,7 @@ { struct gsm_trans *trans; struct gsm_mncc_rtp *rtp = arg; + struct in_addr addr; /* Find callref */ trans = trans_find_by_callref(net, rtp->callref); @@ -2802,8 +2832,8 @@ return 0; } - msc_call_connect(trans, rtp->port, rtp->ip); - return 0; + addr.s_addr = osmo_htonl(rtp->ip); + return msc_mgcp_call_complete(trans, rtp->port, inet_ntoa(addr)); } static struct downstate { diff --git a/src/libmsc/iucs.c b/src/libmsc/iucs.c index c89e412..7bb45b2 100644 --- a/src/libmsc/iucs.c +++ b/src/libmsc/iucs.c @@ -30,8 +30,22 @@ #include #include +#include #include #include +#include + +#include "../../bscconfig.h" + +#ifdef BUILD_IU +#include +extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, + uint32_t rtp_ip, + uint16_t rtp_port, + bool use_x213_nsap); +#else +#include +#endif /* BUILD_IU */ /* For A-interface see libbsc/bsc_api.c subscr_con_allocate() */ static struct gsm_subscriber_connection *subscr_conn_allocate_iu(struct gsm_network *network, @@ -187,3 +201,53 @@ return rc; } + +int iu_rab_act_cs(struct gsm_trans *trans) +{ + struct gsm_subscriber_connection *conn; + struct msgb *msg; + bool use_x213_nsap; + uint32_t conn_id; + struct ranap_ue_conn_ctx *uectx; + uint8_t rab_id; + uint32_t rtp_ip; + uint16_t rtp_port; + + conn = trans->conn; + uectx = conn->iu.ue_ctx; + rab_id = conn->iu.rab_id; + rtp_ip = osmo_htonl(inet_addr(conn->rtp.local_addr_ran)); + rtp_port = conn->rtp.local_port_ran; + conn_id = uectx->conn_id; + + if (rtp_ip == INADDR_NONE) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP IP-Address\n", + conn_id, rab_id); + return -EINVAL; + } + if (rtp_port == 0) { + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, invalid RTP Port\n", + conn_id, rab_id); + return -EINVAL; + } + + use_x213_nsap = + (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); + + LOGP(DIUCS, LOGL_DEBUG, + "Assigning RAB: conn_id=%u, rab_id=%d, rtp=%x:%u, use_x213_nsap=%d\n", + conn_id, rab_id, rtp_ip, rtp_port, use_x213_nsap); + + msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, + use_x213_nsap); + msg->l2h = msg->data; + + if (ranap_iu_rab_act(uectx, msg)) + LOGP(DIUCS, LOGL_ERROR, + "Failed to send RAB Assignment: conn_id=%d rab_id=%d rtp=%x:%u\n", + conn_id, rab_id, rtp_ip, rtp_port); + return 0; +} + diff --git a/src/libmsc/iucs_ranap.c b/src/libmsc/iucs_ranap.c index abf1812..57cd50e 100644 --- a/src/libmsc/iucs_ranap.c +++ b/src/libmsc/iucs_ranap.c @@ -28,6 +28,8 @@ #include #include +#include +#include #include #include @@ -36,22 +38,54 @@ #include #include #include +#include + +#include /* To continue authorization after a Security Mode Complete */ int gsm0408_authorize(struct gsm_subscriber_connection *conn); -static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, - RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies) +static int iucs_rx_rab_assign(struct gsm_subscriber_connection *conn, RANAP_RAB_SetupOrModifiedItemIEs_t * setup_ies) { uint8_t rab_id; RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem; + RANAP_TransportLayerAddress_t *transp_layer_addr; + RANAP_IuTransportAssociation_t *transp_assoc; + uint16_t port = 0; + int rc; + char addr[INET_ADDRSTRLEN]; rab_id = item->rAB_ID.buf[0]; LOGP(DIUCS, LOGL_NOTICE, - "Received RAB assignment event for %s rab_id=%hhd\n", - vlr_subscr_name(conn->vsub), rab_id); + "Received RAB assignment event for %s rab_id=%hhd\n", vlr_subscr_name(conn->vsub), rab_id); + if (item->iuTransportAssociation && item->transportLayerAddress) { + transp_layer_addr = item->transportLayerAddress; + transp_assoc = item->iuTransportAssociation; + + rc = ranap_transp_assoc_decode(&port, transp_assoc); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode RTP port in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + rc = ranap_transp_layer_addr_decode(addr, sizeof(addr), transp_layer_addr); + if (rc != 0) { + LOGP(DIUCS, LOGL_ERROR, + "Unable to decode IP-Address in RAB assignment (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); + return 0; + } + + return msc_mgcp_ass_complete(conn, port, addr); + } + + LOGP(DIUCS, LOGL_ERROR, + "RAB assignment lacks RTP connection information. (%s rab_id=%hhd)\n", + vlr_subscr_name(conn->vsub), rab_id); return 0; } diff --git a/src/libmsc/msc_ifaces.c b/src/libmsc/msc_ifaces.c index e29fe0e..437d75c 100644 --- a/src/libmsc/msc_ifaces.c +++ b/src/libmsc/msc_ifaces.c @@ -29,15 +29,12 @@ #include #include #include +#include #include "../../bscconfig.h" #ifdef BUILD_IU #include -extern struct msgb *ranap_new_msg_rab_assign_voice(uint8_t rab_id, - uint32_t rtp_ip, - uint16_t rtp_port, - bool use_x213_nsap); #else #include #endif /* BUILD_IU */ @@ -140,287 +137,4 @@ DEBUGP(DIUCS, "%s: tx CommonID %s\n", vlr_subscr_name(conn->vsub), conn->vsub->imsi); return ranap_iu_tx_common_id(conn->iu.ue_ctx, conn->vsub->imsi); -} - -static int iu_rab_act_cs(struct ranap_ue_conn_ctx *uectx, uint8_t rab_id, - uint32_t rtp_ip, uint16_t rtp_port) -{ -#ifdef BUILD_IU - struct msgb *msg; - bool use_x213_nsap; - uint32_t conn_id = uectx->conn_id; - - use_x213_nsap = (uectx->rab_assign_addr_enc == RANAP_NSAP_ADDR_ENC_X213); - - LOGP(DIUCS, LOGL_DEBUG, "Assigning RAB: conn_id=%u, rab_id=%d," - " rtp=%x:%u, use_x213_nsap=%d\n", conn_id, rab_id, rtp_ip, - rtp_port, use_x213_nsap); - - msg = ranap_new_msg_rab_assign_voice(rab_id, rtp_ip, rtp_port, - use_x213_nsap); - msg->l2h = msg->data; - - if (ranap_iu_rab_act(uectx, msg)) - LOGP(DIUCS, LOGL_ERROR, "Failed to send RAB Assignment:" - " conn_id=%d rab_id=%d rtp=%x:%u\n", - conn_id, rab_id, rtp_ip, rtp_port); - return 0; -#else - LOGP(DMSC, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); - return -ENOTSUP; -#endif -} - -static void mgcp_response_rab_act_cs_crcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_subscriber_connection *conn = trans->conn; - uint32_t rtp_ip; - int rc; - - if (r->head.response_code != 200) { - LOGP(DMGCP, LOGL_ERROR, - "MGCPGW response yields error: %d %s\n", - r->head.response_code, r->head.comment); - goto rab_act_cs_error; - } - - rc = mgcp_response_parse_params(r); - if (rc) { - LOGP(DMGCP, LOGL_ERROR, - "Cannot parse MGCP response, for %s\n", - vlr_subscr_name(trans->vsub)); - goto rab_act_cs_error; - } - - conn->rtp.port_cn = r->audio_port; - - rtp_ip = mgcp_client_remote_addr_n(conn->network->mgw.client); - - if (trans->conn->via_ran == RAN_UTRAN_IU) { - /* Assign a voice channel via RANAP on 3G */ - if (iu_rab_act_cs(conn->iu.ue_ctx, conn->iu.rab_id, rtp_ip, conn->rtp.port_subscr)) - goto rab_act_cs_error; - } else if (trans->conn->via_ran == RAN_GERAN_A) { - /* Assign a voice channel via A on 2G */ - if (a_iface_tx_assignment(trans)) - goto rab_act_cs_error; - } else - goto rab_act_cs_error; - - /* Respond back to MNCC (if requested) */ - if (trans->tch_rtp_create) { - if (gsm48_tch_rtp_create(trans)) - goto rab_act_cs_error; - } - return; - -rab_act_cs_error: - /* FIXME abort call, invalidate conn, ... */ - LOGP(DMSC, LOGL_ERROR, "%s: failure during assignment\n", - vlr_subscr_name(trans->vsub)); - return; -} - -int msc_call_assignment(struct gsm_trans *trans) -{ - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - uint16_t bts_base; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - -#ifdef BUILD_IU - /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ - static uint8_t next_iu_rab_id = 1; - if (conn->via_ran == RAN_UTRAN_IU) - conn->iu.rab_id = next_iu_rab_id ++; -#endif - - conn->rtp.mgcp_rtp_endpoint = - mgcp_client_next_endpoint(conn->network->mgw.client); - - /* This will calculate the port we assign to the BTS via AoIP - * assignment command (or rab-assignment on 3G) The BTS will send - * its RTP traffic to that port on the MGCPGW side. The MGCPGW only - * gets the endpoint ID via the CRCX. It will do the same calculation - * on his side too to get knowledge of the rtp port. */ - bts_base = mgcp_client_conf_actual(mgcp)->bts_base; - conn->rtp.port_subscr = bts_base + 2 * conn->rtp.mgcp_rtp_endpoint; - - /* Establish the RTP stream first as looping back to the originator. - * The MDCX will patch through to the counterpart. TODO: play a ring - * tone instead. */ - msg = mgcp_msg_crcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint, MGCP_CONN_LOOPBACK); - return mgcp_client_tx(mgcp, msg, mgcp_response_rab_act_cs_crcx, trans); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv); - -static void mgcp_bridge(struct gsm_trans *from, struct gsm_trans *to, - enum bridge_state state, - enum mgcp_connection_mode mode) -{ - struct gsm_subscriber_connection *conn1 = from->conn; - struct gsm_subscriber_connection *conn2 = to->conn; - struct mgcp_client *mgcp = conn1->network->mgw.client; - const char *ip; - struct msgb *msg; - - OSMO_ASSERT(mgcp); - - from->bridge.peer = to; - from->bridge.state = state; - - /* Loop back to the same MGCP GW */ - ip = mgcp_client_remote_addr_str(mgcp); - - msg = mgcp_msg_mdcx(mgcp, - conn1->rtp.mgcp_rtp_endpoint, - ip, conn2->rtp.port_cn, - mode); - if (mgcp_client_tx(mgcp, msg, mgcp_response_bridge_mdcx, from)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(from->vsub)); -} - -static void mgcp_response_bridge_mdcx(struct mgcp_response *r, void *priv) -{ - struct gsm_trans *trans = priv; - struct gsm_trans *peer = trans->bridge.peer; - - switch (trans->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - trans->bridge.state = BRIDGE_STATE_LOOPBACK_ESTABLISHED; - - switch (peer->bridge.state) { - case BRIDGE_STATE_LOOPBACK_PENDING: - /* Wait until the other is done as well. */ - return; - case BRIDGE_STATE_LOOPBACK_ESTABLISHED: - /* Now that both are in loopback, switch both to - * forwarding. */ - mgcp_bridge(trans, peer, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - mgcp_bridge(peer, trans, BRIDGE_STATE_BRIDGE_PENDING, - MGCP_CONN_RECV_SEND); - break; - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } - break; - - case BRIDGE_STATE_BRIDGE_PENDING: - trans->bridge.state = BRIDGE_STATE_BRIDGE_ESTABLISHED; - break; - - default: - LOGP(DMGCP, LOGL_ERROR, - "Unexpected bridge state: %d for %s\n", - trans->bridge.state, vlr_subscr_name(trans->vsub)); - break; - } -} - -int msc_call_connect(struct gsm_trans *trans, uint16_t port, uint32_t ip) -{ - /* With this function we inform the MGCP-GW where (ip/port) it - * has to send its outgoing voic traffic. The receiving end will - * usually be a PBX (e.g. Asterisk). The IP-Address we tell, will - * not only be used to direct the traffic, it will also be used - * as a filter to make sure only RTP packets from the right - * remote end will reach the BSS. This is also the reason why - * inbound audio will not work until this step is performed */ - - /* NOTE: This function is used when msc_call_bridge(), is not - * applicable. This is usually the case when an external MNCC - * is in use */ - - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - struct msgb *msg; - - if (!trans) - return -EINVAL; - if (!trans->conn) - return -EINVAL; - if (!trans->conn->network) - return -EINVAL; - if (!trans->conn->network->mgw.client) - return -EINVAL; - - mgcp = trans->conn->network->mgw.client; - - struct in_addr ip_addr; - ip_addr.s_addr = ntohl(ip); - - conn = trans->conn; - - msg = mgcp_msg_mdcx(mgcp, - conn->rtp.mgcp_rtp_endpoint, - inet_ntoa(ip_addr), port, MGCP_CONN_RECV_SEND); - if (mgcp_client_tx(mgcp, msg, NULL, trans)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send MDCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - return 0; -} - -int msc_call_bridge(struct gsm_trans *trans1, struct gsm_trans *trans2) -{ - if (!trans1) - return -EINVAL; - if (!trans2) - return -EINVAL; - - /* First setup as loopback and configure the counterparts' endpoints, - * so that when transmission starts the originating addresses are - * already known to be valid. The mgcp callback will continue. */ - mgcp_bridge(trans1, trans2, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - mgcp_bridge(trans2, trans1, BRIDGE_STATE_LOOPBACK_PENDING, - MGCP_CONN_LOOPBACK); - - return 0; -} - -void msc_call_release(struct gsm_trans *trans) -{ - struct msgb *msg; - struct gsm_subscriber_connection *conn; - struct mgcp_client *mgcp; - - if (!trans) - return; - if (!trans->conn) - return; - if (!trans->conn->network) - return; - - conn = trans->conn; - mgcp = conn->network->mgw.client; - - /* Send DLCX */ - msg = mgcp_msg_dlcx(mgcp, conn->rtp.mgcp_rtp_endpoint, - conn->rtp.mgcp_rtp_endpoint); - if (mgcp_client_tx(mgcp, msg, NULL, NULL)) - LOGP(DMGCP, LOGL_ERROR, - "Failed to send DLCX message for %s\n", - vlr_subscr_name(trans->vsub)); - - /* Release endpoint id */ - mgcp_client_release_endpoint(conn->rtp.mgcp_rtp_endpoint, mgcp); } diff --git a/src/libmsc/msc_mgcp.c b/src/libmsc/msc_mgcp.c new file mode 100644 index 0000000..bd60c13 --- /dev/null +++ b/src/libmsc/msc_mgcp.c @@ -0,0 +1,1078 @@ +/* (C) 2017 by sysmocom - s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "../../bscconfig.h" + +#define S(x) (1 << (x)) + +#define CONN_ID_RAN 1 +#define CONN_ID_CN 2 + +#define MGCP_MGW_TIMEOUT 4 /* in seconds */ +#define MGCP_MGW_TIMEOUT_TIMER_NR 1 +#define MGCP_RAN_TIMEOUT 10 /* in seconds */ +#define MGCP_RAN_TIMEOUT_TIMER_NR 2 +#define MGCP_REL_TIMEOUT 60 /* in seconds */ +#define MGCP_REL_TIMEOUT_TIMER_NR 3 +#define MGCP_ASS_TIMEOUT 10 /* in seconds */ +#define MGCP_ASS_TIMEOUT_TIMER_NR 4 + +#define MGCP_ENDPOINT_FORMAT "%x at mgw" + +/* Some internal cause codes to indicate fault condition inside the FSM */ +enum msc_mgcp_cause_code { + MGCP_ERR_MGW_FAIL, + MGCP_ERR_MGW_INVAL_RESP, + MGCP_ERR_MGW_TX_FAIL, + MGCP_ERR_UNEXP_TEARDOWN, + MGCP_ERR_UNSUPP_ADDR_FMT, + MGCP_ERR_RAN_TIMEOUT, + MGCP_ERR_ASS_TIMEOUT, + MGCP_ERR_NOMEM, + MGCP_ERR_ASSGMNT_FAIL +}; + +/* Human readable respresentation of the faul codes, will be displayed by + * handle_error() */ +static const struct value_string msc_mgcp_cause_codes_names[] = { + {MGCP_ERR_MGW_FAIL, "operation failed on MGW"}, + {MGCP_ERR_MGW_INVAL_RESP, "invalid / unparseable response from MGW"}, + {MGCP_ERR_MGW_TX_FAIL, "failed to transmit MGCP message to MGW"}, + {MGCP_ERR_UNEXP_TEARDOWN, "unexpected connection teardown"}, + {MGCP_ERR_UNSUPP_ADDR_FMT, "unsupported network address format used (RAN)"}, + {MGCP_ERR_RAN_TIMEOUT, "call could not be completed in time (RAN)"}, + {MGCP_ERR_ASS_TIMEOUT, "assignment could not be completed in time (RAN)"}, + {MGCP_ERR_NOMEM, "out of memory"}, + {MGCP_ERR_ASSGMNT_FAIL, "assignment failure (RAN)"}, + {0, NULL} +}; + +enum fsm_msc_mgcp_states { + ST_CRCX_RAN, + ST_CRCX_CN, + ST_CRCX_COMPL, + ST_MDCX_CN, + ST_MDCX_CN_COMPL, + ST_MDCX_RAN, + ST_MDCX_RAN_COMPL, + ST_CALL, + ST_HALT, +}; + +enum msc_mgcp_fsm_evt { + /* Initial event: start off the state machine */ + EV_INIT, + + /* External event: Notify that the Assignment is complete and we + * may now forward IP/Port of the remote call leg to the MGW */ + EV_ASSIGN, + + /* External event: Notify that the Call is complete and that the + * two half open connections on the MGW should now be connected */ + EV_CONNECT, + + /* External event: Notify that the call is over and the connections + * on the mgw shall be removed */ + EV_TEARDOWN, + + /* Internal event: An error occurred that requires a controlled + * teardown of the RTP connections */ + EV_TEARDOWN_ERROR, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the RAN side */ + EV_CRCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its CRCX response for + * the CN side */ + EV_CRCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the RAN side */ + EV_MDCX_RAN_RESP, + + /* Internal event: The mgcp_gw has sent its MDCX response for + * the CN side */ + EV_MDCX_CN_RESP, + + /* Internal event: The mgcp_gw has sent its DLCX response for + * the RAN and CN side */ + EV_DLCX_ALL_RESP, +}; + +/* A general error handler function. On error we still have an interest to + * remove a half open connection (if possible). This function will execute + * a controlled jump to the DLCX phase. From there, the FSM will then just + * continue like the call were ended normally */ + +#define handle_error(mgcp_ctx, cause) \ + _handle_error(mgcp_ctx, cause, __FILE__, __LINE__) +static void _handle_error(struct mgcp_ctx *mgcp_ctx, enum msc_mgcp_cause_code cause, + const char *file, int line) +{ + struct osmo_fsm_inst *fi; + + OSMO_ASSERT(mgcp_ctx); + fi = mgcp_ctx->fsm; + OSMO_ASSERT(fi); + + LOGPFSMLSRC(mgcp_ctx->fsm, LOGL_ERROR, file, line, "%s -- graceful shutdown...\n", + get_value_string(msc_mgcp_cause_codes_names, cause)); + + /* Set the VM into the state where it waits for the call end */ + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); + + /* Simulate the call end by sending a teardown event, so that + * the FSM proceeds directly with the DLCX */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN_ERROR, mgcp_ctx); +} + +/* Timer callback to shut down in case of connectivity problems */ +static int fsm_timeout_cb(struct osmo_fsm_inst *fi) +{ + struct mgcp_ctx *mgcp_ctx = fi->priv; + struct mgcp_client *mgcp; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + if (fi->T == MGCP_MGW_TIMEOUT_TIMER_NR) { + /* We were unable to communicate with the MGW, unfortunately + * there is no meaningful action we can take now other than + * giving up. */ + + /* At least release the occupied endpoint ID */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Cancel the transaction that timed out */ + mgcp_client_cancel(mgcp, mgcp_ctx->mgw_pending_trans); + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN_ERROR, mgcp_ctx); + } else if (fi->T == MGCP_RAN_TIMEOUT_TIMER_NR) { + /* If the logic that controls the RAN is unable to negotiate a + * connection, we presumably still have a working connection to + * the MGW, we will try to shut down gracefully. */ + handle_error(mgcp_ctx, MGCP_ERR_RAN_TIMEOUT); + } else if (fi->T == MGCP_REL_TIMEOUT_TIMER_NR) { + /* Under normal conditions, the MSC logic should always command + * to release the call at some point. However, the release may + * be missing due to errors in the MSC logic and we may have + * reached ST_HALT because of cascading errors and timeouts. In + * this and only in this case we will allow ST_HALT to free all + * context information on its own authority. */ + mgcp_ctx->free_ctx = true; + + /* Initiate self destruction of the FSM */ + osmo_fsm_inst_state_chg(fi, ST_HALT, 0, 0); + osmo_fsm_inst_dispatch(fi, EV_TEARDOWN, mgcp_ctx); + } else if (fi->T == MGCP_ASS_TIMEOUT_TIMER_NR) { + /* There may be rare cases in which the MSC is unable to + * complete the call assignment */ + handle_error(mgcp_ctx, MGCP_ERR_ASS_TIMEOUT); + } else { + /* Ther must not be any unsolicited timers in this FSM. If so, + * we have serious problem. */ + OSMO_ASSERT(false); + } + + return 0; +} + +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_RAN: Send CRCX for RAN side to MGW */ +static void fsm_crcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + mgcp_ctx->rtp_endpoint = mgcp_client_next_endpoint(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/RAN: creating connection for the RAN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_CN, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for RAN associated CRCX */ +static void mgw_crcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_ran, r->head.conn_id, sizeof(mgcp_ctx->conn_id_ran)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/RAN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_ran); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/RAN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/BTS: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_ran = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_ran, r->audio_ip, sizeof(conn->rtp.local_addr_ran)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_RAN_RESP, mgcp_ctx); +} + +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CRCX_CN: check MGW response and send CRCX for CN side to MGW */ +static void fsm_crcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + switch (event) { + case EV_CRCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "CRCX/CN creating connection for the CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_CRCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_MODE), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_mode = MGCP_CONN_LOOPBACK + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_crcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_CRCX_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_crcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + int rc; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "CRCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* memorize connection identifier */ + osmo_strlcpy(mgcp_ctx->conn_id_cn, r->head.conn_id, sizeof(mgcp_ctx->conn_id_cn)); + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with CI: %s\n", mgcp_ctx->conn_id_cn); + + rc = mgcp_response_parse_params(r); + if (rc) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, "CRCX/CN: Cannot parse response\n"); + handle_error(mgcp_ctx, MGCP_ERR_MGW_INVAL_RESP); + return; + } + + LOGPFSML(mgcp_ctx->fsm, LOGL_DEBUG, "CRCX/CN: MGW responded with address %s:%u\n", r->audio_ip, r->audio_port); + + conn->rtp.local_port_cn = r->audio_port; + osmo_strlcpy(conn->rtp.local_addr_cn, r->audio_ip, sizeof(conn->rtp.local_addr_cn)); + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CRCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_CRCX_COMPL: check MGW response, start assignment */ +static void fsm_crcx_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CRCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Forward assignment request to A/RANAP */ + if (conn->via_ran == RAN_UTRAN_IU) { +#ifdef BUILD_IU + /* Assign a voice channel via RANAP on 3G */ + if (iu_rab_act_cs(trans)) + goto error; +#else + LOGPFSML(fi, LOGL_ERROR, "Cannot send Iu RAB Assignment: built without Iu support\n"); + goto error; +#endif + } else if (conn->via_ran == RAN_GERAN_A) { + /* Assign a voice channel via A on 2G */ + if (a_iface_tx_assignment(trans)) + goto error; + } else { + /* Unset or unimplemented new RAN type */ + LOGPFSML(fi, LOGL_ERROR, "Unknown RAN type: %d\n", conn->via_ran); + return; + } + + /* Respond back to MNCC (if requested) */ + if (trans->tch_rtp_create) { + if (gsm48_tch_rtp_create(trans)) + goto error; + } + + /* Note: When we reach this point then the situation is basically that + * we have two sides connected, both are in loopback. The local ports + * of the side pointing towards the BSS should be already communicated + * and we are waiting now for the BSS to return with the assignment + * complete command. */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN, MGCP_RAN_TIMEOUT, MGCP_RAN_TIMEOUT_TIMER_NR); + return; + +error: + handle_error(mgcp_ctx, MGCP_ERR_ASSGMNT_FAIL); +} + +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_CN: send MDCX for RAN side to MGW */ +static void fsm_mdcx_cn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_CONNECT: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/CN: completing connection for the CN side on MGW endpoint:0x%x, remote leg expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_cn, conn->rtp.remote_port_cn); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_cn, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_cn, + .audio_port = conn->rtp.remote_port_cn + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_cn_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_CN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_cn_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/CN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_CN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_CN_COMPL: wait for mgw response, move on with the MDCX + * for the RAN side if we already have valid IP/Port data for the RAN sided + * RTP stream. */ +static void fsm_mdcx_cn_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct gsm_subscriber_connection *conn; + struct gsm_trans *trans; + + OSMO_ASSERT(mgcp_ctx); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_MDCX_CN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + /* Enter MDCX phase, but we must be sure that the Assigmnet on the A or + * IuCS interface is complete (IP-Address and Port are valid) */ + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN, MGCP_ASS_TIMEOUT, MGCP_ASS_TIMEOUT_TIMER_NR); + + /* If we already have a valid remote port and IP-Address from the RAN side + * call leg, the assignment has been completed before we got here, so we + * may move on immediately */ + if (conn->rtp.remote_port_ran != 0 || strlen(conn->rtp.remote_addr_ran) > 0) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); +} + +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_MDCX_RAN: wait for assignment completion, send MDCX for CN side to MGW */ +static void fsm_mdcx_ran_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + struct mgcp_client *mgcp; + struct gsm_trans *trans; + struct gsm_subscriber_connection *conn; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + trans = mgcp_ctx->trans; + OSMO_ASSERT(trans); + conn = trans->conn; + OSMO_ASSERT(conn); + + switch (event) { + case EV_ASSIGN: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, + "MDCX/RAN: completing connection for the CN side on MGW endpoint:0x%x, RAN expects RTP input on address %s:%u\n", + mgcp_ctx->rtp_endpoint, conn->rtp.remote_addr_ran, conn->rtp.remote_port_ran); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_MDCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID | MGCP_MSG_PRESENCE_CONN_ID | + MGCP_MSG_PRESENCE_CONN_MODE | MGCP_MSG_PRESENCE_AUDIO_IP | + MGCP_MSG_PRESENCE_AUDIO_PORT), + .call_id = mgcp_ctx->rtp_endpoint, + .conn_id = mgcp_ctx->conn_id_ran, + .conn_mode = MGCP_CONN_RECV_SEND, + .audio_ip = conn->rtp.remote_addr_ran, + .audio_port = conn->rtp.remote_port_ran + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_mdcx_ran_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_MDCX_RAN_COMPL, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_mdcx_ran_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "MDCX/RAN: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_MDCX_RAN_RESP, mgcp_ctx); +} + +/* Callback for ST_MDCX_RAN_COMPL: check MGW response */ +static void fsm_mdcx_ran_compl_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + OSMO_ASSERT(mgcp_ctx); + + switch (event) { + case EV_MDCX_RAN_RESP: + break; + default: + handle_error(mgcp_ctx, MGCP_ERR_UNEXP_TEARDOWN); + return; + } + + LOGPFSML(fi, LOGL_DEBUG, "call active, waiting for teardown...\n"); + osmo_fsm_inst_state_chg(fi, ST_CALL, 0, 0); +} + +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv); + +/* Callback for ST_CALL: call is active, send DLCX for both sides on teardown */ +static void fsm_call_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + + struct mgcp_ctx *mgcp_ctx = (struct mgcp_ctx *)data; + struct mgcp_client *mgcp; + struct mgcp_msg mgcp_msg; + struct msgb *msg; + int rc; + + OSMO_ASSERT(mgcp_ctx); + mgcp = mgcp_ctx->mgcp; + OSMO_ASSERT(mgcp); + + LOGPFSML(fi, LOGL_DEBUG, + "DLCX: removing connection for the RAN and CN side on MGW endpoint:0x%x...\n", mgcp_ctx->rtp_endpoint); + + /* We now relase the endpoint back to the pool in order to allow + * other connections to use this endpoint */ + mgcp_client_release_endpoint(mgcp_ctx->rtp_endpoint, mgcp); + + /* Generate MGCP message string */ + mgcp_msg = (struct mgcp_msg) { + .verb = MGCP_VERB_DLCX, + .presence = (MGCP_MSG_PRESENCE_ENDPOINT | MGCP_MSG_PRESENCE_CALL_ID), + .call_id = mgcp_ctx->rtp_endpoint + }; + if (snprintf(mgcp_msg.endpoint, MGCP_ENDPOINT_MAXLEN, MGCP_ENDPOINT_FORMAT, mgcp_ctx->rtp_endpoint) >= + MGCP_ENDPOINT_MAXLEN) { + handle_error(mgcp_ctx, MGCP_ERR_NOMEM); + return; + } + msg = mgcp_msg_gen(mgcp, &mgcp_msg); + OSMO_ASSERT(msg); + + /* Transmit MGCP message to MGW */ + mgcp_ctx->mgw_pending_trans = mgcp_msg_trans_id(msg); + rc = mgcp_client_tx(mgcp, msg, mgw_dlcx_all_resp_cb, mgcp_ctx); + if (rc < 0) { + handle_error(mgcp_ctx, MGCP_ERR_MGW_TX_FAIL); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_MGW_TIMEOUT, MGCP_MGW_TIMEOUT_TIMER_NR); +} + +/* Callback for MGCP-Client: handle response for CN associated CRCX */ +static void mgw_dlcx_all_resp_cb(struct mgcp_response *r, void *priv) +{ + struct mgcp_ctx *mgcp_ctx = priv; + + OSMO_ASSERT(mgcp_ctx); + + if (r->head.response_code != 200) { + LOGPFSML(mgcp_ctx->fsm, LOGL_ERROR, + "DLCX: response yields error: %d %s\n", r->head.response_code, r->head.comment); + handle_error(mgcp_ctx, MGCP_ERR_MGW_FAIL); + return; + } + + /* Notify the FSM that we got the response. */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_DLCX_ALL_RESP, mgcp_ctx); +} + +/* Callback for ST_HALT: Terminate the state machine */ +static void fsm_halt_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct mgcp_ctx *mgcp_ctx = data; + + OSMO_ASSERT(mgcp_ctx); + + /* NOTE: We must not free the context information now, we have to + * wait until msc_mgcp_call_release() is called. Then we are sure + * that the logic controlling us is fully aware that the context + * information is freed. If we would free early now the controlling + * logic might mistakenly think that the context info is still alive, + * so lets keep the context info until we are explicitly asked for + * throwing it away. */ + if (mgcp_ctx->free_ctx) { + osmo_fsm_inst_free(mgcp_ctx->fsm); + talloc_free(mgcp_ctx); + return; + } + + osmo_fsm_inst_state_chg(fi, ST_HALT, MGCP_REL_TIMEOUT, MGCP_REL_TIMEOUT_TIMER_NR); +} + +static struct osmo_fsm_state fsm_msc_mgcp_states[] = { + + /* Startup state machine, send CRCX for RAN side. */ + [ST_CRCX_RAN] = { + .in_event_mask = S(EV_INIT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_RAN), + .action = fsm_crcx_ran_cb, + }, + /* When the response to the RAN CRCX is received, then proceed with + sending the CRCX for CN side */ + [ST_CRCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_CRCX_COMPL), + .name = OSMO_STRINGIFY(ST_CRCX_CN), + .action = fsm_crcx_cn_cb, + }, + /* Complete the CRCX phase by starting the assignment. Depending on the + * RAT (Radio Access Technology), this will either trigger an + * Assignment Request on the A-Interface or an RAB-Assignment on the + * IU-interface */ + [ST_CRCX_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CRCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN), + .name = OSMO_STRINGIFY(ST_CRCX_COMPL), + .action = fsm_crcx_compl, + }, + /* Wait for MSC to complete the assignment request, when complete, we + * will enter the MDCX phase by sending an MDCX for the CN side to the + * MGW */ + [ST_MDCX_CN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_CONNECT), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_CN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_CN), + .action = fsm_mdcx_cn_cb, + }, + /* We arrive in this state when the MDCX phase for the CN side has + * completed we will check the IP/Port of the RAN connection. If this + * data is valid we may continue with the MDCX phase for the RAN side. + * If not we wait until the assinment completes on the A or on the IuCS + * interface. The completion of the assignment will fill in the port and + * IP-Address of the RAN side and way may continue then. */ + [ST_MDCX_CN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_MDCX_CN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN), + .name = OSMO_STRINGIFY(ST_MDCX_CN_COMPL), + .action = fsm_mdcx_cn_compl_cb, + }, + /* When the response for the CN MDCX is received, send the MDCX for the + * RAN side to the MGW */ + [ST_MDCX_RAN] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_ASSIGN), + .out_state_mask = S(ST_HALT) | S(ST_CALL) | S(ST_MDCX_RAN_COMPL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN), + .action = fsm_mdcx_ran_cb, + }, + /* The RAN side MDCX phase is complete when the response is received + * from the MGW. The call is then active, we change to ST_CALL and wait + * there until the call ends. */ + [ST_MDCX_RAN_COMPL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_MDCX_RAN_RESP), + .out_state_mask = S(ST_HALT) | S(ST_CALL), + .name = OSMO_STRINGIFY(ST_MDCX_RAN_COMPL), + .action = fsm_mdcx_ran_compl_cb, + }, + /* We are now in the active call phase, wait until the call is done + * and send a DLCX then to remove all connections from the MGW */ + [ST_CALL] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_CALL), + .action = fsm_call_cb, + }, + /* When the MGW confirms that the connections are terminated, then halt + * the state machine. */ + [ST_HALT] = { + .in_event_mask = S(EV_TEARDOWN) | S(EV_TEARDOWN_ERROR) | S(EV_DLCX_ALL_RESP), + .out_state_mask = S(ST_HALT), + .name = OSMO_STRINGIFY(ST_HALT), + .action = fsm_halt_cb, + }, +}; + +/* State machine definition */ +static struct osmo_fsm fsm_msc_mgcp = { + .name = "MGW", + .states = fsm_msc_mgcp_states, + .num_states = ARRAY_SIZE(fsm_msc_mgcp_states), + .log_subsys = DMGCP, + .timer_cb = fsm_timeout_cb, +}; + +/* Notify that a new call begins. This will create a connection for the + * RAN and the CN on the MGW. + * Parameter: + * trans: transaction context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_assignment(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + char name[32]; + static bool fsm_registered = false; + struct gsm_subscriber_connection *conn; + struct mgcp_client *mgcp; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call assignment failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + mgcp = conn->network->mgw.client; + OSMO_ASSERT(mgcp); + + if (conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) double assignment detected, dropping...\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + +#ifdef BUILD_IU + /* FIXME: HACK. where to scope the RAB Id? At the conn / subscriber / ranap_ue_conn_ctx? */ + static uint8_t next_iu_rab_id = 1; + if (conn->via_ran == RAN_UTRAN_IU) + conn->iu.rab_id = next_iu_rab_id++; +#endif + + if (snprintf(name, sizeof(name), "MGW_%i", trans->transaction_id) >= sizeof(name)) + return -EINVAL; + + /* Register the fsm description (if not already done) */ + if (fsm_registered == false) { + osmo_fsm_register(&fsm_msc_mgcp); + fsm_registered = true; + } + + /* Allocate and configure a new fsm instance */ + mgcp_ctx = talloc_zero(NULL, struct mgcp_ctx); + OSMO_ASSERT(mgcp_ctx); + + mgcp_ctx->fsm = osmo_fsm_inst_alloc(&fsm_msc_mgcp, NULL, NULL, LOGL_DEBUG, name); + OSMO_ASSERT(mgcp_ctx->fsm); + mgcp_ctx->fsm->priv = mgcp_ctx; + mgcp_ctx->mgcp = mgcp; + mgcp_ctx->trans = trans; + + /* start state machine */ + OSMO_ASSERT(mgcp_ctx->fsm->state == ST_CRCX_RAN); + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_INIT, mgcp_ctx); + + conn->rtp.mgcp_ctx = mgcp_ctx; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call assignment initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Inform the FSM that the assignment (RAN connection) is now complete. + * Parameter: + * conn: subscriber connection context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_ass_complete(struct gsm_subscriber_connection *conn, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(conn); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, assignmnet completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, assignmnet completion failed\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + mgcp_ctx = conn->rtp.mgcp_ctx; + if (!mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, assignmnet completion failed.\n", + vlr_subscr_name(conn->vsub)); + return -EINVAL; + } + + /* Memorize port and IP-Address of the remote RAN call leg. We need this + * information at latest when we enter the MDCX phase for the RAN side. */ + conn->rtp.remote_port_ran = port; + osmo_strlcpy(conn->rtp.remote_addr_ran, addr, sizeof(conn->rtp.remote_addr_ran)); + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) assignmnet completed, rtp %s:%d.\n", + vlr_subscr_name(conn->vsub), conn->rtp.remote_addr_ran, port); + + /* Note: We only dispatch the event if we are really waiting for the + * assignment, if we are not yet waiting, there is no need to loudly + * broadcast an event that the all other states do not understand anyway */ + if (mgcp_ctx->fsm->state == ST_MDCX_RAN) + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_ASSIGN, mgcp_ctx); + + return 0; +} + +/* Make the connection of a previously assigned call complete + * Parameter: + * trans: transaction context. + * port: port number of the remote leg. + * addr: IP-address of the remote leg. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_complete(struct gsm_trans *trans, uint16_t port, char *addr) +{ + struct mgcp_ctx *mgcp_ctx; + struct gsm_subscriber_connection *conn; + + OSMO_ASSERT(trans); + OSMO_ASSERT(addr); + + if (port == 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid remote call leg port, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!addr || strlen(addr) <= 0) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) missing remote call leg address, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call completion failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* The FSM should already have passed all CRCX phases and be ready to move + * on with the MDCX phases. */ + if (mgcp_ctx->fsm->state != ST_MDCX_CN) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid call state, call completion failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + conn = trans->conn; + osmo_strlcpy(conn->rtp.remote_addr_cn, addr, sizeof(conn->rtp.remote_addr_cn)); + conn->rtp.remote_port_cn = port; + + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_CONNECT, mgcp_ctx); + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call completion initiated\n", + vlr_subscr_name(conn->vsub)); + + return 0; +} + +/* Release ongoing call. + * Parameter: + * trans: connection context. + * Returns -EINVAL on error, 0 on success. */ +int msc_mgcp_call_release(struct gsm_trans *trans) +{ + struct mgcp_ctx *mgcp_ctx; + + OSMO_ASSERT(trans); + + if (!trans->conn) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid conn, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) invalid mgcp context, call release failed.\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + if (!trans->conn->rtp.mgcp_ctx->fsm) { + LOGP(DMGCP, LOGL_ERROR, "(subscriber:%s) no FSM, call release failed\n", + vlr_subscr_name(trans->vsub)); + return -EINVAL; + } + + mgcp_ctx = trans->conn->rtp.mgcp_ctx; + + /* Inform the FSM that as soon as it reaches ST_HALT it may free + * all context information immediately */ + mgcp_ctx->free_ctx = true; + + /* Initaite teardown, regardless of which state we are currently + * in */ + osmo_fsm_inst_dispatch(mgcp_ctx->fsm, EV_TEARDOWN, mgcp_ctx); + + /* Prevent any further operation that is triggered from outside by + * overwriting the context pointer with NULL. The FSM will now + * take care for a graceful shutdown and when done it will free + * all related context information */ + trans->conn->rtp.mgcp_ctx = NULL; + + LOGP(DMGCP, LOGL_DEBUG, "(subscriber:%s) call release initiated\n", + vlr_subscr_name(trans->vsub)); + + return 0; +} diff --git a/tests/msc_vlr/Makefile.am b/tests/msc_vlr/Makefile.am index 3a2c859..43b4e07 100644 --- a/tests/msc_vlr/Makefile.am +++ b/tests/msc_vlr/Makefile.am @@ -30,8 +30,8 @@ -Wl,--wrap=msc_stop_paging \ -Wl,--wrap=gsm340_gen_scts \ -Wl,--wrap=osmo_get_rand_id \ - -Wl,--wrap=msc_call_assignment \ - -Wl,--wrap=msc_call_release \ + -Wl,--wrap=msc_mgcp_call_release \ + -Wl,--wrap=msc_mgcp_call_assignment \ $(NULL) LDADD = \ diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 2152fe4..13f8767 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -553,18 +553,18 @@ return 0; } -/* override, requires '-Wl,--wrap=msc_call_assignment' */ -int __real_msc_call_assignment(struct gsm_trans *trans); -int __wrap_msc_call_assignment(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_assignment' */ +int __real_msc_mgcp_call_assignment(struct gsm_trans *trans); +int __wrap_msc_mgcp_call_assignment(struct gsm_trans *trans) { log("MS <--Call Assignment-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); return 0; } -/* override, requires '-Wl,--wrap=msc_call_release' */ -void __real_msc_call_release(struct gsm_trans *trans); -void __wrap_msc_call_release(struct gsm_trans *trans) +/* override, requires '-Wl,--wrap=msc_mgcp_call_release' */ +void __real_msc_mgcp_call_release(struct gsm_trans *trans); +void __wrap_msc_mgcp_call_release(struct gsm_trans *trans) { log("MS <--Call Release-- MSC: subscr=%s callref=0x%x", vlr_subscr_name(trans->vsub), trans->callref); -- To view, visit https://gerrit.osmocom.org/4980 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieea9630358b3963261fa1993cf1f3b563ff23538 Gerrit-PatchSet: 20 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Sat Jan 27 14:52:41 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sat, 27 Jan 2018 14:52:41 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Patch Set 7: Hmm. I am really not sure about the API. :( -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 17:05:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 17:05:24 +0000 Subject: osmo-sgsn[master]: gtphub: check for gsn_addr_from_sockaddr() errors In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If6babdad650dc6a84e6a784fc8d3c5abe146ecc1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 17:05:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 17:05:28 +0000 Subject: [MERGED] osmo-sgsn[master]: gtphub: check for gsn_addr_from_sockaddr() errors In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtphub: check for gsn_addr_from_sockaddr() errors ...................................................................... gtphub: check for gsn_addr_from_sockaddr() errors Previously the return value was ignored. Check it and log error message. Change-Id: If6babdad650dc6a84e6a784fc8d3c5abe146ecc1 --- M src/gprs/gtphub.c 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index b0e75ca..2ff1b7c 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -1583,7 +1583,9 @@ * gtphub_handle_buf(), we'd be creating a peer port just to * expire it right away. */ if (hub->sgsn_use_sender && (side_idx == GTPH_SIDE_SGSN)) { - gsn_addr_from_sockaddr(&use_addr, &use_port, &from_ctrl->sa); + int rc = gsn_addr_from_sockaddr(&use_addr, &use_port, &from_ctrl->sa); + if (rc < 0) + LOG(LOGL_ERROR, "%s(): failed to obtain GSN address\n", __func__); } else { use_port = gtphub_plane_idx_default_port[plane_idx]; @@ -2765,7 +2767,9 @@ struct gsn_addr gsna; uint16_t port; - gsn_addr_from_sockaddr(&gsna, &port, addr); + int rc = gsn_addr_from_sockaddr(&gsna, &port, addr); + if (rc < 0) + LOG(LOGL_ERROR, "%s(): failed to obtain GSN address\n", __func__); pa = gtphub_addr_find(bind, &gsna); if (!pa) -- To view, visit https://gerrit.osmocom.org/5529 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If6babdad650dc6a84e6a784fc8d3c5abe146ecc1 Gerrit-PatchSet: 3 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:00:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:00:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP_Types: Use (value) annotation for send (ts_) templates Message-ID: Review at https://gerrit.osmocom.org/6135 GSUP_Types: Use (value) annotation for send (ts_) templates Change-Id: I5c74ad71e8a0966f10bddcdf800cd94226cd900d --- M library/GSUP_Types.ttcn 1 file changed, 7 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/35/6135/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 4d2c3c5..b9c6f39 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -227,7 +227,7 @@ ies := ies } -template GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := +template (value) GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := @@ -241,9 +241,9 @@ tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); -template GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := - tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { - ts_GSUP_IE_IMSI(imsi), ts_GSUP_IE_Cause(cause) }); +template (value) GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := + ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); template GSUP_PDU tr_GSUP_SAI_RES(template hexstring imsi) := @@ -254,14 +254,14 @@ tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); -template GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := +template (value) GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); -template GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := +template (value) GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR, { valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); -template GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := +template (value) GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := ts_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); -- To view, visit https://gerrit.osmocom.org/6135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5c74ad71e8a0966f10bddcdf800cd94226cd900d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:00:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:00:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMS... Message-ID: Review at https://gerrit.osmocom.org/6136 GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMSI as first IE Change-Id: Ie1b9682d102da28fa7de4cb391d61aeb52f1676b --- M library/GSUP_Types.ttcn 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/6136/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index b9c6f39..1e28ffe 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -222,6 +222,11 @@ ies := ies } +template GSUP_PDU tr_GSUP_IMSI(template GSUP_MessageType msgt := ?, template hexstring imsi) := { + msg_type := msgt, + ies := { tr_GSUP_IE_IMSI(imsi), * } +} + template GSUP_PDU ts_GSUP(GSUP_MessageType msgt, GSUP_IEs ies := {}) := { msg_type := msgt, ies := ies @@ -231,7 +236,7 @@ ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, imsi); template (value) GSUP_PDU ts_GSUP_SAI_RES(hexstring imsi, GSUP_IE auth_tuple) := ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT, { @@ -251,8 +256,7 @@ tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); template GSUP_PDU tr_GSUP_UL_REQ(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { - tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, imsi); template (value) GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); @@ -266,12 +270,10 @@ valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); template GSUP_PDU tr_GSUP_ISD_RES(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { - tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, imsi); template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, { - tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi); template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, -- To view, visit https://gerrit.osmocom.org/6136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie1b9682d102da28fa7de4cb391d61aeb52f1676b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:00:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:00:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Add TC_gsup_cancel testing GSUP Location Cancel Message-ID: Review at https://gerrit.osmocom.org/6137 msc: Add TC_gsup_cancel testing GSUP Location Cancel Related: OS#2886 Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4 --- M library/GSUP_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 69 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/37/6137/1 diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 1e28ffe..fda9549 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -275,6 +275,29 @@ template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi); +template (value) GSUP_PDU ts_GSUP_CL_REQ(hexstring imsi, GSUP_CancelType ctype) := + ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_CancelType(ctype)) }); + +template GSUP_PDU tr_GSUP_CL_RES(template hexstring imsi) := + tr_GSUP_IMSI(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, imsi); + +template GSUP_PDU tr_GSUP_CL_ERR(template hexstring imsi, template integer cause := ?) := + tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, { + tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); + + +template (value) GSUP_IE ts_GSUP_IE_CancelType(GSUP_CancelType ctype) := { + tag := OSMO_GSUP_CANCEL_TYPE_IE, + len := 0, /* overwritten */ + val := { + cancel_type := ctype + } +} + +template GSUP_IE tr_GSUP_IE_CancelType(template GSUP_CancelType ctype) := + tr_GSUP_IE(OSMO_GSUP_CANCEL_TYPE_IE, GSUP_IeValue:{cancel_type:=ctype}); + template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, len := ?, diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9ac715b..c8ac429 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1375,6 +1375,51 @@ vc_conn.done; } +/* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */ +private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; + + /* Location Update to make subscriber known */ + f_perform_lu(cpars.expect_auth, true, true); + + /* First MO call should succeed */ + f_mo_call(cpars); + + /* Cancel the subscriber in the VLR */ + GSUP.send(ts_GSUP_CL_REQ(g_pars.imsi, OSMO_GSUP_CANCEL_TYPE_WITHDRAW)); + alt { + [] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { } + [] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) { + setverdict(fail, "Received GSUP Location Cancel Error"); + self.stop; + } + } + + /* Follow-up transactions should fail */ + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); + f_bssap_compl_l3(l3_info); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } + [] BSSAP.receive { + setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ"); + self.stop; + } + } + setverdict(pass); +} +testcase TC_gsup_cancel() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_gsup_cancel), testcasename(), 31); + vc_conn.done; +} + /* TODO: @@ -1423,6 +1468,7 @@ execute( TC_mo_crcx_ran_reject() ); execute( TC_mt_crcx_ran_reject() ); execute( TC_mt_t310() ); + execute( TC_gsup_cancel() ); } -- To view, visit https://gerrit.osmocom.org/6137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:00:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:00:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: rename sub-directory from msc_tests to msc (to be in li... Message-ID: Review at https://gerrit.osmocom.org/6138 msc: rename sub-directory from msc_tests to msc (to be in line with bsc, ...) Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c --- R msc/BSC_ConnectionHandler.ttcn R msc/MSC_Tests.cfg R msc/MSC_Tests.ttcn R msc/gen_links.sh R msc/regen_makefile.sh 5 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/6138/1 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn similarity index 100% rename from msc_tests/BSC_ConnectionHandler.ttcn rename to msc/BSC_ConnectionHandler.ttcn diff --git a/msc_tests/MSC_Tests.cfg b/msc/MSC_Tests.cfg similarity index 100% rename from msc_tests/MSC_Tests.cfg rename to msc/MSC_Tests.cfg diff --git a/msc_tests/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn similarity index 100% rename from msc_tests/MSC_Tests.ttcn rename to msc/MSC_Tests.ttcn diff --git a/msc_tests/gen_links.sh b/msc/gen_links.sh similarity index 100% rename from msc_tests/gen_links.sh rename to msc/gen_links.sh diff --git a/msc_tests/regen_makefile.sh b/msc/regen_makefile.sh similarity index 100% rename from msc_tests/regen_makefile.sh rename to msc/regen_makefile.sh -- To view, visit https://gerrit.osmocom.org/6138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:01:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:01:22 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP_Types: Use (value) annotation for send (ts_) templates In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c74ad71e8a0966f10bddcdf800cd94226cd900d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 18:01:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:01:24 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMS... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie1b9682d102da28fa7de4cb391d61aeb52f1676b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 18:01:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:01:25 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Add TC_gsup_cancel testing GSUP Location Cancel In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 18:01:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:01:31 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Add TC_gsup_cancel testing GSUP Location Cancel In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Add TC_gsup_cancel testing GSUP Location Cancel ...................................................................... msc: Add TC_gsup_cancel testing GSUP Location Cancel Related: OS#2886 Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4 --- M library/GSUP_Types.ttcn M msc_tests/MSC_Tests.ttcn 2 files changed, 69 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 1e28ffe..fda9549 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -275,6 +275,29 @@ template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi); +template (value) GSUP_PDU ts_GSUP_CL_REQ(hexstring imsi, GSUP_CancelType ctype) := + ts_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_REQUEST, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_CancelType(ctype)) }); + +template GSUP_PDU tr_GSUP_CL_RES(template hexstring imsi) := + tr_GSUP_IMSI(OSMO_GSUP_MSGT_LOCATION_CANCEL_RESULT, imsi); + +template GSUP_PDU tr_GSUP_CL_ERR(template hexstring imsi, template integer cause := ?) := + tr_GSUP(OSMO_GSUP_MSGT_LOCATION_CANCEL_ERROR, { + tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); + + +template (value) GSUP_IE ts_GSUP_IE_CancelType(GSUP_CancelType ctype) := { + tag := OSMO_GSUP_CANCEL_TYPE_IE, + len := 0, /* overwritten */ + val := { + cancel_type := ctype + } +} + +template GSUP_IE tr_GSUP_IE_CancelType(template GSUP_CancelType ctype) := + tr_GSUP_IE(OSMO_GSUP_CANCEL_TYPE_IE, GSUP_IeValue:{cancel_type:=ctype}); + template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, len := ?, diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index 9ac715b..c8ac429 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -1375,6 +1375,51 @@ vc_conn.done; } +/* Perform successful LU + MO call, then GSUP LocationCancel. Subscriber must be denied CM SERV */ +private function f_tc_gsup_cancel(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + f_init_handler(pars); + var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); + cpars.bss_rtp_port := 1110; + cpars.mgcp_connection_id_bss := '22222'H; + cpars.mgcp_connection_id_mss := '33333'H; + + /* Location Update to make subscriber known */ + f_perform_lu(cpars.expect_auth, true, true); + + /* First MO call should succeed */ + f_mo_call(cpars); + + /* Cancel the subscriber in the VLR */ + GSUP.send(ts_GSUP_CL_REQ(g_pars.imsi, OSMO_GSUP_CANCEL_TYPE_WITHDRAW)); + alt { + [] GSUP.receive(tr_GSUP_CL_RES(g_pars.imsi)) { } + [] GSUP.receive(tr_GSUP_CL_ERR(g_pars.imsi)) { + setverdict(fail, "Received GSUP Location Cancel Error"); + self.stop; + } + } + + /* Follow-up transactions should fail */ + var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); + var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); + f_bssap_compl_l3(l3_info); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_CM_SERV_REJ)) { } + [] BSSAP.receive { + setverdict(fail, "Received unexpected BSSAP instead of CM SERV REJ"); + self.stop; + } + } + setverdict(pass); +} +testcase TC_gsup_cancel() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + + vc_conn := f_start_handler(refers(f_tc_gsup_cancel), testcasename(), 31); + vc_conn.done; +} + /* TODO: @@ -1423,6 +1468,7 @@ execute( TC_mo_crcx_ran_reject() ); execute( TC_mt_crcx_ran_reject() ); execute( TC_mt_t310() ); + execute( TC_gsup_cancel() ); } -- To view, visit https://gerrit.osmocom.org/6137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib962c4a1e71f926631503fe4b3459ca49360dfa4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:01:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:01:32 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMS... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMSI as first IE ...................................................................... GSUP_Types: Add tr_GSUP_IMSI as helper for messages with IMSI as first IE Change-Id: Ie1b9682d102da28fa7de4cb391d61aeb52f1676b --- M library/GSUP_Types.ttcn 1 file changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index b9c6f39..1e28ffe 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -222,6 +222,11 @@ ies := ies } +template GSUP_PDU tr_GSUP_IMSI(template GSUP_MessageType msgt := ?, template hexstring imsi) := { + msg_type := msgt, + ies := { tr_GSUP_IE_IMSI(imsi), * } +} + template GSUP_PDU ts_GSUP(GSUP_MessageType msgt, GSUP_IEs ies := {}) := { msg_type := msgt, ies := ies @@ -231,7 +236,7 @@ ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, imsi); template (value) GSUP_PDU ts_GSUP_SAI_RES(hexstring imsi, GSUP_IE auth_tuple) := ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_RESULT, { @@ -251,8 +256,7 @@ tr_GSUP_IE_IMSI(imsi), *, tr_GSUP_IE(OSMO_GSUP_AUTH_TUPLE_IE), * }); template GSUP_PDU tr_GSUP_UL_REQ(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { - tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, imsi); template (value) GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); @@ -266,12 +270,10 @@ valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); template GSUP_PDU tr_GSUP_ISD_RES(template hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, { - tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_INSERT_DATA_RESULT, imsi); template GSUP_PDU tr_GSUP_AUTH_FAIL_IND(hexstring imsi) := - tr_GSUP(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, { - tr_GSUP_IE_IMSI(imsi), * }); + tr_GSUP_IMSI(OSMO_GSUP_MSGT_AUTH_FAIL_REPORT, imsi); template GSUP_IE tr_GSUP_IE(template GSUP_IEI iei, template GSUP_IeValue val := ?) := { tag := iei, -- To view, visit https://gerrit.osmocom.org/6136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie1b9682d102da28fa7de4cb391d61aeb52f1676b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:01:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:01:32 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP_Types: Use (value) annotation for send (ts_) templates In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP_Types: Use (value) annotation for send (ts_) templates ...................................................................... GSUP_Types: Use (value) annotation for send (ts_) templates Change-Id: I5c74ad71e8a0966f10bddcdf800cd94226cd900d --- M library/GSUP_Types.ttcn 1 file changed, 7 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Types.ttcn b/library/GSUP_Types.ttcn index 4d2c3c5..b9c6f39 100644 --- a/library/GSUP_Types.ttcn +++ b/library/GSUP_Types.ttcn @@ -227,7 +227,7 @@ ies := ies } -template GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := +template (value) GSUP_PDU ts_GSUP_SAI_REQ(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)) }); template GSUP_PDU tr_GSUP_SAI_REQ(template hexstring imsi) := @@ -241,9 +241,9 @@ tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { tr_GSUP_IE_IMSI(imsi), tr_GSUP_IE_Cause(cause) }); -template GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := - tr_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { - ts_GSUP_IE_IMSI(imsi), ts_GSUP_IE_Cause(cause) }); +template (value) GSUP_PDU ts_GSUP_SAI_ERR(hexstring imsi, integer cause) := + ts_GSUP(OSMO_GSUP_MSGT_SEND_AUTH_INFO_ERROR, { + valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); template GSUP_PDU tr_GSUP_SAI_RES(template hexstring imsi) := @@ -254,14 +254,14 @@ tr_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST, { tr_GSUP_IE_IMSI(imsi), * }); -template GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := +template (value) GSUP_PDU ts_GSUP_UL_RES(hexstring imsi) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_RESULT, { valueof(ts_GSUP_IE_IMSI(imsi)) }); -template GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := +template (value) GSUP_PDU ts_GSUP_UL_ERR(hexstring imsi, integer cause) := ts_GSUP(OSMO_GSUP_MSGT_UPDATE_LOCATION_ERROR, { valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_Cause(cause)) }); -template GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := +template (value) GSUP_PDU ts_GSUP_ISD_REQ(hexstring imsi, hexstring msisdn) := ts_GSUP(OSMO_GSUP_MSGT_INSERT_DATA_REQUEST, { valueof(ts_GSUP_IE_IMSI(imsi)), valueof(ts_GSUP_IE_MSISDN(msisdn)) }); -- To view, visit https://gerrit.osmocom.org/6135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c74ad71e8a0966f10bddcdf800cd94226cd900d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:06:38 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:06:38 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: rename sub-directory from msc_tests to msc (to be in li... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6138 to look at the new patch set (#2). msc: rename sub-directory from msc_tests to msc (to be in line with bsc, etc.) Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c --- R msc/BSC_ConnectionHandler.ttcn R msc/MSC_Tests.cfg R msc/MSC_Tests.ttcn R msc/gen_links.sh R msc/regen_makefile.sh 5 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/6138/2 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn similarity index 100% rename from msc_tests/BSC_ConnectionHandler.ttcn rename to msc/BSC_ConnectionHandler.ttcn diff --git a/msc_tests/MSC_Tests.cfg b/msc/MSC_Tests.cfg similarity index 100% rename from msc_tests/MSC_Tests.cfg rename to msc/MSC_Tests.cfg diff --git a/msc_tests/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn similarity index 100% rename from msc_tests/MSC_Tests.ttcn rename to msc/MSC_Tests.ttcn diff --git a/msc_tests/gen_links.sh b/msc/gen_links.sh similarity index 100% rename from msc_tests/gen_links.sh rename to msc/gen_links.sh diff --git a/msc_tests/regen_makefile.sh b/msc/regen_makefile.sh similarity index 100% rename from msc_tests/regen_makefile.sh rename to msc/regen_makefile.sh -- To view, visit https://gerrit.osmocom.org/6138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:08:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:08:22 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: rename sub-directory from msc_tests to msc (to be in li... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6138 to look at the new patch set (#3). msc: rename sub-directory from msc_tests to msc (to be in line with bsc, etc.) Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c --- R msc/BSC_ConnectionHandler.ttcn R msc/MSC_Tests.cfg R msc/MSC_Tests.ttcn R msc/gen_links.sh R msc/regen_makefile.sh 5 files changed, 0 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/6138/3 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn similarity index 100% rename from msc_tests/BSC_ConnectionHandler.ttcn rename to msc/BSC_ConnectionHandler.ttcn diff --git a/msc_tests/MSC_Tests.cfg b/msc/MSC_Tests.cfg similarity index 100% rename from msc_tests/MSC_Tests.cfg rename to msc/MSC_Tests.cfg diff --git a/msc_tests/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn similarity index 100% rename from msc_tests/MSC_Tests.ttcn rename to msc/MSC_Tests.ttcn diff --git a/msc_tests/gen_links.sh b/msc/gen_links.sh similarity index 100% rename from msc_tests/gen_links.sh rename to msc/gen_links.sh diff --git a/msc_tests/regen_makefile.sh b/msc/regen_makefile.sh similarity index 100% rename from msc_tests/regen_makefile.sh rename to msc/regen_makefile.sh -- To view, visit https://gerrit.osmocom.org/6138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:08:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:08:23 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Make TC_lu_clear_request tolerant to double ClearComman... Message-ID: Review at https://gerrit.osmocom.org/6139 msc: Make TC_lu_clear_request tolerant to double ClearCommand from MSC See https://osmocom.org/issues/2862 Change-Id: Ic266151038dc29220ec62279d16fcd181836bb42 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/39/6139/1 diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c8ac429..d0000d8 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -624,7 +624,11 @@ BSSAP.send(ts_BSSMAP_ClearRequest(0)); BSSAP.receive(tr_BSSMAP_ClearCommand); BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + alt { + /* See https://osmocom.org/issues/2862 */ + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { repeat; } + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + } setverdict(pass); } testcase TC_lu_clear_request() runs on MTC_CT { -- To view, visit https://gerrit.osmocom.org/6139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic266151038dc29220ec62279d16fcd181836bb42 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:08:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:08:56 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Make TC_lu_clear_request tolerant to double ClearComman... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic266151038dc29220ec62279d16fcd181836bb42 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 18:08:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:08:58 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Make TC_lu_clear_request tolerant to double ClearComman... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Make TC_lu_clear_request tolerant to double ClearCommand from MSC ...................................................................... msc: Make TC_lu_clear_request tolerant to double ClearCommand from MSC See https://osmocom.org/issues/2862 Change-Id: Ic266151038dc29220ec62279d16fcd181836bb42 --- M msc_tests/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc_tests/MSC_Tests.ttcn b/msc_tests/MSC_Tests.ttcn index c8ac429..d0000d8 100644 --- a/msc_tests/MSC_Tests.ttcn +++ b/msc_tests/MSC_Tests.ttcn @@ -624,7 +624,11 @@ BSSAP.send(ts_BSSMAP_ClearRequest(0)); BSSAP.receive(tr_BSSMAP_ClearCommand); BSSAP.send(ts_BSSMAP_ClearComplete); - BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND); + alt { + /* See https://osmocom.org/issues/2862 */ + [] BSSAP.receive(tr_BSSMAP_ClearCommand) { repeat; } + [] BSSAP.receive(BSSAP_Conn_Prim:MSC_CONN_PRIM_DISC_IND) {} + } setverdict(pass); } testcase TC_lu_clear_request() runs on MTC_CT { -- To view, visit https://gerrit.osmocom.org/6139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic266151038dc29220ec62279d16fcd181836bb42 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:10:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:10:21 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: rename sub-directory from msc_tests to msc (to be in li... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6138 to look at the new patch set (#4). msc: rename sub-directory from msc_tests to msc (to be in line with bsc, etc.) Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c --- M Makefile R msc/BSC_ConnectionHandler.ttcn R msc/MSC_Tests.cfg R msc/MSC_Tests.ttcn R msc/gen_links.sh R msc/regen_makefile.sh 6 files changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/38/6138/4 diff --git a/Makefile b/Makefile index 80211de..f009560 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc_tests selftest sysinfo +SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sysinfo PARALLEL_MAKE:=-j4 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn similarity index 100% rename from msc_tests/BSC_ConnectionHandler.ttcn rename to msc/BSC_ConnectionHandler.ttcn diff --git a/msc_tests/MSC_Tests.cfg b/msc/MSC_Tests.cfg similarity index 100% rename from msc_tests/MSC_Tests.cfg rename to msc/MSC_Tests.cfg diff --git a/msc_tests/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn similarity index 100% rename from msc_tests/MSC_Tests.ttcn rename to msc/MSC_Tests.ttcn diff --git a/msc_tests/gen_links.sh b/msc/gen_links.sh similarity index 100% rename from msc_tests/gen_links.sh rename to msc/gen_links.sh diff --git a/msc_tests/regen_makefile.sh b/msc/regen_makefile.sh similarity index 100% rename from msc_tests/regen_makefile.sh rename to msc/regen_makefile.sh -- To view, visit https://gerrit.osmocom.org/6138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 18:10:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:10:41 +0000 Subject: osmo-ttcn3-hacks[master]: msc: rename sub-directory from msc_tests to msc (to be in li... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 18:10:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 18:10:46 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: rename sub-directory from msc_tests to msc (to be in li... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: rename sub-directory from msc_tests to msc (to be in line with bsc, etc.) ...................................................................... msc: rename sub-directory from msc_tests to msc (to be in line with bsc, etc.) Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c --- M Makefile R msc/BSC_ConnectionHandler.ttcn R msc/MSC_Tests.cfg R msc/MSC_Tests.ttcn R msc/gen_links.sh R msc/regen_makefile.sh 6 files changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile b/Makefile index 80211de..f009560 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc_tests selftest sysinfo +SUBDIRS=bsc bsc-nat ggsn_tests gprs_gb lapdm mgw msc selftest sysinfo PARALLEL_MAKE:=-j4 diff --git a/msc_tests/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn similarity index 100% rename from msc_tests/BSC_ConnectionHandler.ttcn rename to msc/BSC_ConnectionHandler.ttcn diff --git a/msc_tests/MSC_Tests.cfg b/msc/MSC_Tests.cfg similarity index 100% rename from msc_tests/MSC_Tests.cfg rename to msc/MSC_Tests.cfg diff --git a/msc_tests/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn similarity index 100% rename from msc_tests/MSC_Tests.ttcn rename to msc/MSC_Tests.ttcn diff --git a/msc_tests/gen_links.sh b/msc/gen_links.sh similarity index 100% rename from msc_tests/gen_links.sh rename to msc/gen_links.sh diff --git a/msc_tests/regen_makefile.sh b/msc/regen_makefile.sh similarity index 100% rename from msc_tests/regen_makefile.sh rename to msc/regen_makefile.sh -- To view, visit https://gerrit.osmocom.org/6138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib219dee5e587bca3b79d29d631836cf1ef2be81c Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 19:08:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 19:08:57 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Make MGW ip/port parameters configurable as module para... Message-ID: Review at https://gerrit.osmocom.org/6140 msc: Make MGW ip/port parameters configurable as module parameters Change-Id: I9148ebd687a1cf96a4b8c433e771785e30216cbc --- M msc/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/40/6140/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index d0000d8..b6b38dd 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -71,6 +71,8 @@ /* local parameters of emulated HLR */ charstring mp_hlr_ip := "127.0.0.1"; integer mp_hlr_port := 4222; + charstring mp_mgw_ip := "127.0.0.1"; + integer mp_mgw_port := 2427; charstring mp_msc_mncc := "/tmp/mncc"; } @@ -95,10 +97,10 @@ unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) } var MGCP_conn_parameters pars := { - callagent_ip := "127.0.0.1", + callagent_ip := mp_msc_ip, callagent_udp_port := -1, - mgw_ip := "127.0.0.1", - mgw_udp_port := 2427 + mgw_ip := mp_mgw_ip, + mgw_udp_port := mp_mgw_port } vc_MGCP := MGCP_Emulation_CT.create(id); -- To view, visit https://gerrit.osmocom.org/6140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9148ebd687a1cf96a4b8c433e771785e30216cbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 19:16:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 19:16:15 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Make MGW ip/port parameters configurable as module para... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9148ebd687a1cf96a4b8c433e771785e30216cbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 19:16:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 19:16:17 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Make MGW ip/port parameters configurable as module para... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Make MGW ip/port parameters configurable as module parameters ...................................................................... msc: Make MGW ip/port parameters configurable as module parameters Change-Id: I9148ebd687a1cf96a4b8c433e771785e30216cbc --- M msc/MSC_Tests.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index d0000d8..b6b38dd 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -71,6 +71,8 @@ /* local parameters of emulated HLR */ charstring mp_hlr_ip := "127.0.0.1"; integer mp_hlr_port := 4222; + charstring mp_mgw_ip := "127.0.0.1"; + integer mp_mgw_port := 2427; charstring mp_msc_mncc := "/tmp/mncc"; } @@ -95,10 +97,10 @@ unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) } var MGCP_conn_parameters pars := { - callagent_ip := "127.0.0.1", + callagent_ip := mp_msc_ip, callagent_udp_port := -1, - mgw_ip := "127.0.0.1", - mgw_udp_port := 2427 + mgw_ip := mp_mgw_ip, + mgw_udp_port := mp_mgw_port } vc_MGCP := MGCP_Emulation_CT.create(id); -- To view, visit https://gerrit.osmocom.org/6140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9148ebd687a1cf96a4b8c433e771785e30216cbc Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 19:39:05 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 19:39:05 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessi... Message-ID: Review at https://gerrit.osmocom.org/6141 BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessing fields This seems not to be required on TITAN 6.3.0 on my laptop, but the older 6.1.0 on Debian 9 seems to need it. Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f --- M library/BSSMAP_Emulation.ttcn 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/6141/1 diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index ca5afb9..5f0409f 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -334,13 +334,15 @@ runs on BSSMAP_Emulation_CT { /* decode + send decoded BSSAP to client */ - /* BSC Side: If this is an assignment command, store CIC */ - if (ischosen(bssap.pdu.bssmap.assignmentRequest) and - ispresent(bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode)) { - var BSSMAP_IE_CircuitIdentityCode cic_ie := - bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode; - var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow); - f_comp_store_cic(client, cic); + if (ischosen(bssap.pdu.bssmap)) { + /* BSC Side: If this is an assignment command, store CIC */ + if (ischosen(bssap.pdu.bssmap.assignmentRequest) and + ispresent(bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode)) { + var BSSMAP_IE_CircuitIdentityCode cic_ie := + bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode; + var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow); + f_comp_store_cic(client, cic); + } } if (ischosen(bssap.pdu.dtap) and g_bssmap_ops.decode_dtap) { -- To view, visit https://gerrit.osmocom.org/6141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 19:39:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 19:39:46 +0000 Subject: osmo-ttcn3-hacks[master]: BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessi... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 19:39:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 19:39:47 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessi... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessing fields ...................................................................... BSSMAP_Emulation: ispresent(bssap.pdu.bssmap) before accessing fields This seems not to be required on TITAN 6.3.0 on my laptop, but the older 6.1.0 on Debian 9 seems to need it. Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f --- M library/BSSMAP_Emulation.ttcn 1 file changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/BSSMAP_Emulation.ttcn b/library/BSSMAP_Emulation.ttcn index ca5afb9..5f0409f 100644 --- a/library/BSSMAP_Emulation.ttcn +++ b/library/BSSMAP_Emulation.ttcn @@ -334,13 +334,15 @@ runs on BSSMAP_Emulation_CT { /* decode + send decoded BSSAP to client */ - /* BSC Side: If this is an assignment command, store CIC */ - if (ischosen(bssap.pdu.bssmap.assignmentRequest) and - ispresent(bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode)) { - var BSSMAP_IE_CircuitIdentityCode cic_ie := - bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode; - var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow); - f_comp_store_cic(client, cic); + if (ischosen(bssap.pdu.bssmap)) { + /* BSC Side: If this is an assignment command, store CIC */ + if (ischosen(bssap.pdu.bssmap.assignmentRequest) and + ispresent(bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode)) { + var BSSMAP_IE_CircuitIdentityCode cic_ie := + bssap.pdu.bssmap.assignmentRequest.circuitIdentityCode; + var integer cic := (oct2int(cic_ie.cicHigh) * 256) + oct2int(cic_ie.cicLow); + f_comp_store_cic(client, cic); + } } if (ischosen(bssap.pdu.dtap) and g_bssmap_ops.decode_dtap) { -- To view, visit https://gerrit.osmocom.org/6141 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I574d8b79ac43e0fceddb3f9815666aef0ed66a3f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 20:55:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 20:55:56 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSUP: Initialize ExpectTable Message-ID: Review at https://gerrit.osmocom.org/6142 GSUP: Initialize ExpectTable For some reason TITAN 6.1.0 requires the table to be explicitly initialized, while 6.3.0 is happy without it. Change-Id: I4f9ac98fb60ad16b98acd627efd617bfb4f6abcb --- M library/GSUP_Emulation.ttcn 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/6142/1 diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn index e1a515c..3990b73 100644 --- a/library/GSUP_Emulation.ttcn +++ b/library/GSUP_Emulation.ttcn @@ -124,6 +124,14 @@ } } +private function f_expect_table_init() +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupExpectTable); i := i+1) { + GsupExpectTable[i].vc_conn := null; + GsupExpectTable[i].imsi := omit; + } +} + private function f_imsi_table_add(GSUP_ConnHdlr comp_ref, charstring imsi) runs on GSUP_Emulation_CT { for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { @@ -168,6 +176,7 @@ function main(GsupOps ops, charstring id) runs on GSUP_Emulation_CT { f_imsi_table_init(); + f_expect_table_init(); while (true) { var GSUP_ConnHdlr vc_conn; -- To view, visit https://gerrit.osmocom.org/6142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f9ac98fb60ad16b98acd627efd617bfb4f6abcb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 20:59:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 20:59:32 +0000 Subject: osmo-ttcn3-hacks[master]: GSUP: Initialize ExpectTable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f9ac98fb60ad16b98acd627efd617bfb4f6abcb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 27 20:59:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 20:59:33 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSUP: Initialize ExpectTable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSUP: Initialize ExpectTable ...................................................................... GSUP: Initialize ExpectTable For some reason TITAN 6.1.0 requires the table to be explicitly initialized, while 6.3.0 is happy without it. Change-Id: I4f9ac98fb60ad16b98acd627efd617bfb4f6abcb --- M library/GSUP_Emulation.ttcn 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSUP_Emulation.ttcn b/library/GSUP_Emulation.ttcn index e1a515c..3990b73 100644 --- a/library/GSUP_Emulation.ttcn +++ b/library/GSUP_Emulation.ttcn @@ -124,6 +124,14 @@ } } +private function f_expect_table_init() +runs on GSUP_Emulation_CT { + for (var integer i := 0; i < sizeof(GsupExpectTable); i := i+1) { + GsupExpectTable[i].vc_conn := null; + GsupExpectTable[i].imsi := omit; + } +} + private function f_imsi_table_add(GSUP_ConnHdlr comp_ref, charstring imsi) runs on GSUP_Emulation_CT { for (var integer i := 0; i < sizeof(GsupImsiTable); i := i+1) { @@ -168,6 +176,7 @@ function main(GsupOps ops, charstring id) runs on GSUP_Emulation_CT { f_imsi_table_init(); + f_expect_table_init(); while (true) { var GSUP_ConnHdlr vc_conn; -- To view, visit https://gerrit.osmocom.org/6142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f9ac98fb60ad16b98acd627efd617bfb4f6abcb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Jan 27 21:59:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 21:59:32 +0000 Subject: [PATCH] osmo-msc[master]: Change GSUP re-connect interval to 1s Message-ID: Review at https://gerrit.osmocom.org/6143 Change GSUP re-connect interval to 1s This leads to faster recovery in case of link loss. It also makes the TTCN-3 test suite run much faster, as each test case will inherently terminate the GSUP connection. Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf --- M include/osmocom/msc/gsup_client.h 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/43/6143/1 diff --git a/include/osmocom/msc/gsup_client.h b/include/osmocom/msc/gsup_client.h index 3d1dce0..ce065a6 100644 --- a/include/osmocom/msc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -25,7 +25,10 @@ #include -#define GSUP_CLIENT_RECONNECT_INTERVAL 10 +/* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as + * possible. Even one new connection attempt per second should be quite acceptable until the link is + * re-established */ +#define GSUP_CLIENT_RECONNECT_INTERVAL 1 #define GSUP_CLIENT_PING_INTERVAL 20 struct msgb; -- To view, visit https://gerrit.osmocom.org/6143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Jan 27 22:05:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 27 Jan 2018 22:05:34 +0000 Subject: osmo-msc[master]: Change GSUP re-connect interval to 1s In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Jan 27 22:52:32 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 27 Jan 2018 22:52:32 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify TS alloc: avoid TS reassignment In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify TS alloc: avoid TS reassignment ...................................................................... Simplify TS alloc: avoid TS reassignment Assign reserved_*_slots only when multislot masks are found to avoid reassignment and make code easier to follow. Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index cd82ca7..c246676 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -770,8 +770,8 @@ return -EINVAL; } - reserved_dl_slots = dl_slots = ms->reserved_dl_slots(); - reserved_ul_slots = ul_slots = ms->reserved_ul_slots(); + dl_slots = ms->reserved_dl_slots(); + ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); @@ -800,11 +800,11 @@ rc = find_multi_slots(trx, ms->ms_class(), &ul_slots, &dl_slots); if (rc < 0) return rc; - - reserved_dl_slots = dl_slots; - reserved_ul_slots = ul_slots; } + reserved_dl_slots = dl_slots; + reserved_ul_slots = ul_slots; + /* Step 3: Derive the slot set for the current TBF */ if (single) { /* Make sure to consider the first common slot only */ -- To view, visit https://gerrit.osmocom.org/4085 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9b0482f4ea75ead9855cd78e33c8e70d0ccf4484 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Sat Jan 27 22:52:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 27 Jan 2018 22:52:35 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify TS alloc: fix allocation calls In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify TS alloc: fix allocation calls ...................................................................... Simplify TS alloc: fix allocation calls Using the semantic patch below, adjust allocation-related calls to match updated allocator signatures. // spatch --c++ --dir src -I src --sp-file callfix.spatch --in-place --recursive-includes // spatch --c++ --dir tests -I src --sp-file callfix.spatch --in-place --recursive-includes @@ expression A, B, C, D, E; @@ tbf_alloc_ul_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) @@ expression A, B, C, D, E; @@ tbf_alloc_dl_tbf(A, B, C, D, E, ( - 1 + true | - 0 + false ) ) Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Related: OS#2282 --- M src/bts.cpp M src/tbf.cpp M tests/alloc/AllocTest.cpp M tests/tbf/TbfTest.cpp 4 files changed, 26 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 94354f2..d652c59 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -749,7 +749,7 @@ // Create new TBF /* FIXME: Copy and paste with other routines.. */ - tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, 1); + tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, ms_class, true); if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " diff --git a/src/tbf.cpp b/src/tbf.cpp index ea3ffe3..8cfca3a 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -403,7 +403,8 @@ /* FIXME: Copy and paste with tbf_new_dl_assignment */ /* create new TBF, use same TRX as DL TBF */ /* use multislot class of downlink TBF */ - tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, use_trx, ms_class, egprs_ms_class, + false); if (!tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); /* FIXME: send reject */ @@ -1350,7 +1351,7 @@ new_tbf = tbf_alloc_dl_tbf(bts->bts_data(), ms(), this->trx->trx_no, ms_class(), - ms() ? ms()->egprs_ms_class() : 0, 0); + ms() ? ms()->egprs_ms_class() : 0, false); if (!new_tbf) { LOGP(DTBF, LOGL_NOTICE, "No PDCH resource\n"); diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1aa3f63..6e344dc 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -213,7 +213,7 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, 1); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, -1, ms_class, 0, true); if (!ul_tbf) return false; @@ -223,7 +223,8 @@ dump_assignment(ul_tbf, "UL", verbose); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), ul_tbf->ms()->current_trx()->trx_no, ms_class, 0, + false); if (!dl_tbf) return false; @@ -254,7 +255,7 @@ enable_ts_on_bts(bts, ts0, ts1, ts2, ts3, ts4, ts5, ts6, ts7); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, -1, ms_class, 0, true); if (!dl_tbf) return false; @@ -265,7 +266,8 @@ dump_assignment(dl_tbf, "DL", verbose); - ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, dl_tbf->ms(), dl_tbf->ms()->current_trx()->trx_no, ms_class, 0, + false); if (!ul_tbf) return false; @@ -305,7 +307,7 @@ tfi = the_bts.tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, 0); + ul_tbf = tbf_alloc_ul_tbf(bts, NULL, .1, ms_class, 0, false); if (!ul_tbf) return false; @@ -315,7 +317,8 @@ dump_assignment(ul_tbf, "UL", true); /* assume final ack has not been sent */ - dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, ul_tbf->ms(), trx_no, ms_class, 0, + false); if (!dl_tbf) return false; @@ -466,7 +469,7 @@ case TEST_MODE_UL_AND_DL: if (ms && ms->ul_tbf()) tbf_free(ms->ul_tbf()); - tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_ul_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; break; @@ -475,7 +478,7 @@ case TEST_MODE_DL_AND_UL: if (ms && ms->dl_tbf()) tbf_free(ms->dl_tbf()); - tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, 0); + tbf = tbf_alloc_dl_tbf(bts, ms, trx_no, ms_class, 0, false); if (tbf == NULL) return NULL; } @@ -755,7 +758,8 @@ trx->pdch[6].enable(); trx->pdch[7].enable(); - dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf1 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf1); for (int i = 0; i < 8; i++) { @@ -765,7 +769,8 @@ OSMO_ASSERT(numTs1 == 4); printf("TBF1: numTs(%d)\n", numTs1); - dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, 0); + dl_tbf2 = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, egprs_ms_class, + false); OSMO_ASSERT(dl_tbf2); for (int i = 0; i < 8; i++) { diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index aa1d7ac..fbed45a 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -83,14 +83,14 @@ */ gprs_rlcmac_tbf *dl_tbf = tbf_alloc_dl_tbf(the_bts.bts_data(), NULL, - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(dl_tbf != NULL); dl_tbf->update_ms(0x2342, GPRS_RLCMAC_DL_TBF); dl_tbf->set_ta(4); gprs_rlcmac_tbf *ul_tbf = tbf_alloc_ul_tbf(the_bts.bts_data(), dl_tbf->ms(), - 0, 0, 0, 0); + 0, 0, 0, false); OSMO_ASSERT(ul_tbf != NULL); ul_tbf->update_ms(0x2342, GPRS_RLCMAC_UL_TBF); @@ -172,7 +172,8 @@ tfi = the_bts->tfi_find_free(GPRS_RLCMAC_DL_TBF, &trx_no, -1); OSMO_ASSERT(tfi >= 0); - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, trx_no, ms_class, egprs_ms_class, + true); dl_tbf->set_ta(0); check_tbf(dl_tbf); @@ -2212,7 +2213,7 @@ 1234, 1234, 1234, 1, 1, 0, 0, 0); /* Does no support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, 0, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", dl_tbf->dl_slots(), @@ -2226,7 +2227,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 0); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, false); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", @@ -2270,7 +2271,7 @@ bts->egprs_enabled = 1; /* Does support EGPRS */ - dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, 1); + dl_tbf = tbf_alloc_dl_tbf(bts, NULL, 0, ms_class, ms_class, true); OSMO_ASSERT(dl_tbf != NULL); fprintf(stderr, "DL TBF slots: 0x%02x, N: %d, WS: %d\n", -- To view, visit https://gerrit.osmocom.org/4084 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43c76cb49093b40eb854d324e898e821270053dc Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Sat Jan 27 22:52:35 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 27 Jan 2018 22:52:35 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify TS alloc: adjust allocator signatures In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify TS alloc: adjust allocator signatures ...................................................................... Simplify TS alloc: adjust allocator signatures * drop unused parameters (from both functions and structs) * document used parameters and return values * tighten types used for parameters * use consistent formatting Tests are adjusted accordingly but test results are left untouched to avoid regressions. Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Related: OS#2282 --- M src/bts.h M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/alloc/AllocTest.cpp 7 files changed, 59 insertions(+), 60 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.h b/src/bts.h index b1724c9..8d3a3cc 100644 --- a/src/bts.h +++ b/src/bts.h @@ -203,11 +203,9 @@ struct gsmtap_inst *gsmtap; uint32_t gsmtap_categ_mask; struct gprs_rlcmac_trx trx[8]; - int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_tbf); - uint32_t alloc_algorithm_curst; /* options to customize algorithm */ + int (*alloc_algorithm)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, + bool single, int8_t use_tbf); + uint8_t force_two_phase; uint8_t alpha, gamma; uint8_t egprs_enabled; diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 64b6d6c..33dd9fd 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -21,6 +21,8 @@ #ifndef GPRS_RLCMAC_H #define GPRS_RLCMAC_H +#include + #ifdef __cplusplus #include #include @@ -100,20 +102,14 @@ extern "C" { #endif -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); #ifdef __cplusplus } #endif diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b5edf05..cd82ca7 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -351,14 +351,19 @@ return tfi; } -/* Slot Allocation: Algorithm A +/*! Slot Allocation: Algorithm A * * Assign single slot for uplink and downlink + * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, - struct gprs_rlcmac_tbf *tbf_, uint32_t cust, uint8_t single, - int use_trx) +int alloc_algorithm_a(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { struct gprs_rlcmac_pdch *pdch; int ts = -1; @@ -725,15 +730,20 @@ return 0; } -/* Slot Allocation: Algorithm B +/*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. * Assign one uplink slot. (With free USF) * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_b(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { uint8_t dl_slots; uint8_t ul_slots; @@ -954,7 +964,7 @@ return 0; } -/* Slot Allocation: Algorithm dynamic +/*! Slot Allocation: Algorithm dynamic * * This meta algorithm automatically selects on of the other algorithms based * on the current system state. @@ -962,10 +972,15 @@ * The goal is to support as many MS and TBF as possible. On low usage, the * goal is to provide the highest possible bandwidth per MS. * + * \param[in,out] bts Pointer to BTS struct + * \param[in,out] ms_ Pointer to MS object + * \param[in,out] tbf_ Pointer to TBF struct + * \param[in] single flag indicating if we should force single-slot allocation + * \param[in] use_trx which TRX to use or -1 if it should be selected during allocation + * \returns negative error code or 0 on success */ -int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, - GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, - uint32_t cust, uint8_t single, int use_trx) +int alloc_algorithm_dynamic(struct gprs_rlcmac_bts *bts, GprsMs *ms_, struct gprs_rlcmac_tbf *tbf_, bool single, + int8_t use_trx) { int rc; @@ -977,7 +992,7 @@ } if (!bts->multislot_disabled) { - rc = alloc_algorithm_b(bts, ms_, tbf_, cust, single, use_trx); + rc = alloc_algorithm_b(bts, ms_, tbf_, single, use_trx); if (rc >= 0) return rc; @@ -986,8 +1001,7 @@ bts->multislot_disabled = 1; } - rc = alloc_algorithm_a(bts, ms_, tbf_, cust, single, use_trx); - return rc; + return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) diff --git a/src/tbf.cpp b/src/tbf.cpp index 672c296..ea3ffe3 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -500,8 +500,7 @@ LOGP(DTBF, LOGL_DEBUG, "********** DL-TBF update **********\n"); tbf_unlink_pdch(this); - rc = bts_data->alloc_algorithm(bts_data, ms(), this, - bts_data->alloc_algorithm_curst, 0, -1); + rc = bts_data->alloc_algorithm(bts_data, ms(), this, false, -1); /* if no resource */ if (rc < 0) { LOGPTBF(this, LOGL_ERROR, "No resource after update???\n"); @@ -828,9 +827,8 @@ LOGPTBF(this, LOGL_ERROR, "Poll Timeout, but no event!\n"); } -static int setup_tbf(struct gprs_rlcmac_tbf *tbf, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +static int setup_tbf(struct gprs_rlcmac_tbf *tbf, GprsMs *ms, int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, + bool single_slot) { int rc; struct gprs_rlcmac_bts *bts; @@ -845,8 +843,7 @@ tbf->m_created_ts = time(NULL); tbf->set_ms_class(ms_class); /* select algorithm */ - rc = bts->alloc_algorithm(bts, ms, tbf, bts->alloc_algorithm_curst, - single_slot, use_trx); + rc = bts->alloc_algorithm(bts, ms, tbf, single_slot, use_trx); /* if no resource */ if (rc < 0) { return -1; @@ -906,9 +903,8 @@ } } -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_ul_tbf *tbf; int rc; @@ -995,9 +991,8 @@ return 0; } -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot) { struct gprs_rlcmac_dl_tbf *tbf; int rc; diff --git a/src/tbf.h b/src/tbf.h index bb5fd0a..803ea33 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -366,13 +366,11 @@ int8_t use_trx, uint8_t ms_class, uint8_t egprs_ms_class, uint32_t tlli, uint8_t ta, GprsMs *ms); -struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_ul_tbf *tbf_alloc_ul_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); -struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, - GprsMs *ms, int8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); +struct gprs_rlcmac_dl_tbf *tbf_alloc_dl_tbf(struct gprs_rlcmac_bts *bts, GprsMs *ms, int8_t use_trx, uint8_t ms_class, + uint8_t egprs_ms_class, bool single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 80e3831..e8aec23 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -115,7 +115,7 @@ const uint8_t egprs_ms_class, struct gprs_rlcmac_dl_tbf **tbf) { - uint8_t ss; + bool ss; int8_t use_trx; uint16_t ta = GSM48_TA_INVALID; struct gprs_rlcmac_ul_tbf *ul_tbf = NULL, *old_ul_tbf; @@ -133,11 +133,11 @@ if (ul_tbf && ul_tbf->m_contention_resolution_done && !ul_tbf->m_final_ack_sent) { use_trx = ul_tbf->trx->trx_no; - ss = 0; + ss = false; old_ul_tbf = ul_tbf; } else { use_trx = -1; - ss = 1; /* PCH assignment only allows one timeslot */ + ss = true; /* PCH assignment only allows one timeslot */ old_ul_tbf = NULL; } diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 885e2a1..1aa3f63 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -40,7 +40,7 @@ static gprs_rlcmac_tbf *tbf_alloc(struct gprs_rlcmac_bts *bts, GprsMs *ms, gprs_rlcmac_tbf_direction dir, uint8_t use_trx, - uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot) + uint8_t ms_class, uint8_t egprs_ms_class, bool single_slot) { if (dir == GPRS_RLCMAC_UL_TBF) return tbf_alloc_ul_tbf(bts, ms, use_trx, @@ -410,10 +410,8 @@ test_all_alloc_b(); } -typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, - struct GprsMs *ms, - struct gprs_rlcmac_tbf *tbf, uint32_t cust, uint8_t single, - int use_trx); +typedef int (*algo_t)(struct gprs_rlcmac_bts *bts, struct GprsMs *ms, struct gprs_rlcmac_tbf *tbf, bool single, + int8_t use_trx); static char get_dir_char(uint8_t mask, uint8_t tx, uint8_t rx, uint8_t busy) { -- To view, visit https://gerrit.osmocom.org/3807 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I39d81ab64ff790b9c4c2d0312a574485cd83e755 Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Sat Jan 27 23:37:16 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 27 Jan 2018 23:37:16 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify TS alloc: adjust function signatures In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify TS alloc: adjust function signatures ...................................................................... Simplify TS alloc: adjust function signatures * document used parameters and return values * use consistent formatting * constify function parameters where appropriate (adjusting parameter types if necessary) Change-Id: I211b10b4da59c73d509b719346774515c761886a Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp 3 files changed, 61 insertions(+), 51 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index e236f93..1669739 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -456,10 +456,9 @@ * a TRX. The first TRX that contains such an TFI is returned. Negative values * indicate errors. */ -int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, - uint8_t *_trx, int8_t use_trx) +int BTS::tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; uint32_t free_tfis; bool has_pdch = false; uint8_t trx_from, trx_to, trx, ts, tfi; diff --git a/src/bts.h b/src/bts.h index 34326b8..5679b98 100644 --- a/src/bts.h +++ b/src/bts.h @@ -364,7 +364,7 @@ gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi, uint8_t trx, uint8_t ts); - int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx); + int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx) const; int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn); diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 0e8b785..e394a6e 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -58,7 +58,7 @@ return was_set; } -static inline int8_t find_free_usf(struct gprs_rlcmac_pdch *pdch) +static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; uint8_t usf; @@ -76,13 +76,11 @@ return -1; } -static inline int8_t find_free_tfi(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { - uint32_t tfi_map = 0; + uint32_t tfi_map = pdch->assigned_tfi(dir); int8_t tfi; - tfi_map = pdch->assigned_tfi(dir); if (tfi_map == NO_FREE_TFI) return -1; @@ -95,16 +93,15 @@ return -1; } -static int find_possible_pdchs(struct gprs_rlcmac_trx *trx, - size_t max_slots, - uint8_t mask, const char *mask_reason = NULL) +static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; int valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch; + const struct gprs_rlcmac_pdch *pdch; pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) { @@ -142,22 +139,19 @@ return valid_ts_set; } -static int compute_usage_by_num_tbfs(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_by_num_tbfs(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { return pdch->num_tbfs(dir); } -static int compute_usage_by_reservation(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction) +static int compute_usage_by_reservation(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction) { return pdch->num_reserved(GPRS_RLCMAC_DL_TBF) + pdch->num_reserved(GPRS_RLCMAC_UL_TBF); } -static int compute_usage_for_algo_a(struct gprs_rlcmac_pdch *pdch, - enum gprs_rlcmac_tbf_direction dir) +static int compute_usage_for_algo_a(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { int usage = pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) + @@ -172,11 +166,19 @@ } -static int find_least_busy_pdch(struct gprs_rlcmac_trx *trx, - enum gprs_rlcmac_tbf_direction dir, - uint8_t mask, - int (*fn)(struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), - int *free_tfi = 0, int *free_usf = 0) +/*! Return the TS which corresponds to least busy PDCH + * + * \param[in] trx Pointer to TRX object + * \param[in] dir TBF direction + * \param[in] mask set of available timeslots + * \param[in] fn Function pointer to function which computes number of associated TBFs + * \param[out] free_tfi Free TFI + * \param[out] free_usf Free USF + * \returns TS number or -1 if unable to find + */ +static int find_least_busy_pdch(const struct gprs_rlcmac_trx *trx, enum gprs_rlcmac_tbf_direction dir, uint8_t mask, + int (*fn)(const struct gprs_rlcmac_pdch *, enum gprs_rlcmac_tbf_direction dir), + int *free_tfi = 0, int *free_usf = 0) { unsigned ts; int min_used = INT_MAX; @@ -185,7 +187,7 @@ int min_usf = -1; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; int num_tbfs; int usf = -1; /* must be signed */ int tfi = -1; @@ -255,30 +257,23 @@ pdch->attach_tbf(tbf); } -static void assign_uplink_tbf_usf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_ul_tbf *tbf, - int tfi, int8_t usf) +static void assign_uplink_tbf_usf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_ul_tbf *tbf, uint8_t tfi, int8_t usf) { tbf->m_tfi = tfi; tbf->m_usf[pdch->ts_no] = usf; attach_tbf_to_pdch(pdch, tbf); } -static void assign_dlink_tbf( - struct gprs_rlcmac_pdch *pdch, - struct gprs_rlcmac_dl_tbf *tbf, - int tfi) +static void assign_dlink_tbf(struct gprs_rlcmac_pdch *pdch, struct gprs_rlcmac_dl_tbf *tbf, uint8_t tfi) { tbf->m_tfi = tfi; attach_tbf_to_pdch(pdch, tbf); } -static int find_trx(BTS *bts, const GprsMs *ms, int use_trx) +static int find_trx(const struct gprs_rlcmac_bts *bts_data, const GprsMs *ms, int8_t use_trx) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* We must use the TRX currently actively used by an MS */ if (ms && ms->current_trx()) @@ -289,9 +284,9 @@ /* Find the first TRX that has a PDCH with a free UL and DL TFI */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; @@ -308,32 +303,41 @@ return -EBUSY; } -static struct gprs_rlcmac_pdch * find_idle_pdch(BTS *bts) +static bool idle_pdch_avail(const struct gprs_rlcmac_bts *bts_data) { unsigned trx_no; unsigned ts; - struct gprs_rlcmac_bts *bts_data = bts->bts_data(); /* Find the first PDCH with an unused DL TS */ for (trx_no = 0; trx_no < ARRAY_SIZE(bts_data->trx); trx_no += 1) { - struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; + const struct gprs_rlcmac_trx *trx = &bts_data->trx[trx_no]; for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (!pdch->is_enabled()) continue; if (pdch->num_tbfs(GPRS_RLCMAC_DL_TBF) > PDCH_IDLE_TBF_THRESH) continue; - return pdch; + return true; } } - return NULL; + return false; } -static int tfi_find_free(BTS *bts, const GprsMs *ms, - enum gprs_rlcmac_tbf_direction dir, int use_trx, int *trx_no_) +/*! Return free TFI + * + * \param[in] bts Pointer to BTS struct + * \param[in] trx Pointer to TRX struct + * \param[in] ms Pointer to MS object + * \param[in] dir DL or UL direction + * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses + * \param[out] trx_no_ TRX number on which TFI was found + * \returns negative error code or 0 on success + */ +static int tfi_find_free(const BTS *bts, const gprs_rlcmac_trx *trx, const GprsMs *ms, + enum gprs_rlcmac_tbf_direction dir, int8_t use_trx, uint8_t *trx_no_) { int tfi; uint8_t trx_no; @@ -380,7 +384,7 @@ LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " "%d\n", tbf->ms_class()); - trx_no = find_trx(bts->bts, ms, use_trx); + trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to find a usable TRX (TFI exhausted)\n"); @@ -448,6 +452,14 @@ return 0; } +/*! Find set of slots available for allocation while taking MS class into account + * + * \param[in] trx Pointer to TRX object + * \param[in] mslot_class The multislot class + * \param[in,out] ul_slots set of UL timeslots + * \param[in,out] dl_slots set of DL timeslots + * \returns negative error code or 0 on success + */ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ @@ -681,7 +693,7 @@ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { int c; - struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; + const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; if (rx_window & (1 << ts)) { c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); c = OSMO_MAX(c, 1); @@ -751,14 +763,13 @@ uint8_t reserved_ul_slots; int8_t first_common_ts; uint8_t slotcount = 0; - uint8_t avail_count = 0; + uint8_t avail_count = 0, trx_no; char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; int tfi; - int trx_no; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx; @@ -786,7 +797,7 @@ } /* Step 2a: Find usable TRX and TFI */ - tfi = tfi_find_free(bts->bts, ms, tbf->direction, use_trx, &trx_no); + tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); return tfi; @@ -986,7 +997,7 @@ /* Reset load_is_high if there is at least one idle PDCH */ if (bts->multislot_disabled) { - bts->multislot_disabled = find_idle_pdch(bts->bts) == NULL; + bts->multislot_disabled = !idle_pdch_avail(bts); if (!bts->multislot_disabled) LOGP(DRLCMAC, LOGL_DEBUG, "Enabling algorithm B\n"); } -- To view, visit https://gerrit.osmocom.org/3912 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I211b10b4da59c73d509b719346774515c761886a Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Jan 27 23:37:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Sat, 27 Jan 2018 23:37:17 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify TS alloc: use defines for constants In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify TS alloc: use defines for constants ...................................................................... Simplify TS alloc: use defines for constants * define and use constant for occupied TFI instead copying the same magic number all over the place * use libosmocore's define for bit pretty-printer Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Related: OS#2282 --- M src/bts.cpp M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.cpp 4 files changed, 9 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index d652c59..e236f93 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,7 +475,7 @@ for (trx = trx_from; trx <= trx_to; trx++) { bool trx_has_pdch = false; - free_tfis = 0xffffffff; + free_tfis = NO_FREE_TFI; for (ts = 0; ts < 8; ts++) { pdch = &m_bts.trx[trx].pdch[ts]; diff --git a/src/bts.h b/src/bts.h index 8d3a3cc..34326b8 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,7 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c246676..0e8b785 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -83,7 +83,7 @@ int8_t tfi; tfi_map = pdch->assigned_tfi(dir); - if (tfi_map == 0xffffffffUL) + if (tfi_map == NO_FREE_TFI) return -1; /* look for USF, don't use USF=7 */ @@ -164,7 +164,7 @@ pdch->num_tbfs(GPRS_RLCMAC_UL_TBF) + compute_usage_by_reservation(pdch, dir); - if (pdch->assigned_tfi(reverse(dir)) == 0xffffffff) + if (pdch->assigned_tfi(reverse(dir)) == NO_FREE_TFI) /* No TFI in the opposite direction, avoid it */ usage += 32; @@ -295,10 +295,10 @@ if (!pdch->is_enabled()) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) == NO_FREE_TFI) continue; - if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == 0xffffffff) + if (pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) == NO_FREE_TFI) continue; return trx_no; diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 6e344dc..1c98e46 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -585,17 +585,17 @@ continue; if (ul_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_DL_TBF) != NO_FREE_TFI) continue; if (dl_tbf && - pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != 0xffffffff) + pdch->assigned_tfi(GPRS_RLCMAC_UL_TBF) != NO_FREE_TFI) continue; busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves %c%c%c%c%c%c%c%c\n", + printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", tfi, ms_class, get_dir_char(0x01, ul_slots, dl_slots, busy_slots), get_dir_char(0x02, ul_slots, dl_slots, busy_slots), -- To view, visit https://gerrit.osmocom.org/3920 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2699ceebf0cbec01652a02fa68ccc9e9419d0293 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:08:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:08:39 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Introduce BSC_ConnHdlrNetworkPars Message-ID: Review at https://gerrit.osmocom.org/6144 msc: Introduce BSC_ConnHdlrNetworkPars This record collects information about the network configuration, such as whether or not authentication, tmsi allocation and/or encryption are enabled. The individual helper functions can then react according to this information, without having to pass long argument lists along the call chain. Change-Id: I01a931f1cbbca4593fff2fd12689f040ceaa79b6 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 55 insertions(+), 41 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/44/6144/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index a7ce1ea..a801e51 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -40,6 +40,13 @@ /* FIXME: 3G elements */ } +type record BSC_ConnHdlrNetworkPars { + OCT1 kc_support, + boolean expect_tmsi, + boolean expect_auth, + boolean expect_ciph +} + type record BSC_ConnHdlrPars { SCCP_PAR_Address sccp_addr_own, SCCP_PAR_Address sccp_addr_peer, @@ -50,7 +57,8 @@ OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional, - AuthVector vec optional + AuthVector vec optional, + BSC_ConnHdlrNetworkPars net }; /* altstep for the global guard timer */ @@ -133,7 +141,7 @@ } /* helper function to fully establish a dedicated channel */ -function f_establish_fully(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) +function f_establish_fully(MobileIdentityLV mi) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; @@ -141,8 +149,8 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_info); - f_mm_common(expect_auth, expect_ciph); - if (expect_ciph) { + f_mm_common(); + if (g_pars.net.expect_ciph) { /* implicit CM SERVICE ACCEPT? */ } else { /* explicit CM SERVICE ACCEPT */ @@ -151,7 +159,7 @@ } /* helper function to fully establish a dedicated channel */ -function f_establish_fully_pag(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) +function f_establish_fully_pag(MobileIdentityLV mi) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_info := valueof(ts_PAG_RESP(mi)); var PDU_DTAP_MT dtap_mt; @@ -159,7 +167,7 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_info); - f_mm_common(expect_auth, expect_ciph); + f_mm_common(); } @@ -205,9 +213,9 @@ } -function f_mm_common(boolean expect_auth, boolean expect_ciph) runs on BSC_ConnHdlr +function f_mm_common() runs on BSC_ConnHdlr { - if (expect_auth) { + if (g_pars.net.expect_auth) { g_pars.vec := f_gen_auth_vec_2g(); var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, g_pars.vec.sres, @@ -219,14 +227,13 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); } - if (expect_ciph) { + if (g_pars.net.expect_ciph) { BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)); BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); } } -function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm, - boolean expect_ciph := false) +function f_perform_lu(boolean send_early_cm) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -241,7 +248,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); } - f_mm_common(expect_auth, expect_ciph); + f_mm_common(); /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); @@ -252,7 +259,7 @@ alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt { var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept; - if (expect_tmsi) { + if (g_pars.net.expect_tmsi) { if (not ispresent(lu_acc.mobileIdentityTLV) or not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { setverdict(fail, "Expected TMSI but no TMSI was allocated"); @@ -299,9 +306,6 @@ /* parameters related to a (MO?) voice call */ type record CallParameters { - boolean expect_auth, /* do we expect AUTHENTICATE from network */ - boolean expect_ciph, /* do we expect CIPHER MODE from network */ - /* CC related parameters */ hexstring called_party, /* whom are we calling */ integer transaction_id optional, /* which TS 04.08 CC transaction ID to use */ @@ -330,8 +334,6 @@ } template (value) CallParameters t_CallParams(hexstring called, integer tid) := { - expect_auth := false, - expect_ciph := false, called_party := called, transaction_id := tid, bearer_cap := valueof(ts_Bcap_voice), @@ -367,7 +369,7 @@ } else { mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); } - f_establish_fully(mi, cpars.expect_auth, cpars.expect_ciph); + f_establish_fully(mi); /* Create MNCC and MGCP expect */ f_create_mncc_expect(hex2str(cpars.called_party)); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index b6b38dd..90f308f 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -354,6 +354,12 @@ /* FIXME: move into BSC_ConnectionHandler? */ function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { var BSC_ConnHdlr vc_conn; + var BSC_ConnHdlrNetworkPars net_pars := { + kc_support := '0A'O, /* A5/1 and A5/3 enabled */ + expect_tmsi := true, + expect_auth := false, + expect_ciph := false + }; var BSC_ConnHdlrPars pars := { sccp_addr_own := g_sccp_addr_own, sccp_addr_peer := g_sccp_addr_peer, @@ -364,7 +370,8 @@ tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit, - vec := omit + vec := omit, + net := net_pars }; vc_conn := BSC_ConnHdlr.create(id); @@ -400,7 +407,7 @@ private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); - f_perform_lu(false, true, true); + f_perform_lu(true); } testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -411,8 +418,9 @@ } private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_tmsi := false; f_init_handler(pars); - f_perform_lu(false, false, true); + f_perform_lu(true); } testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -477,8 +485,9 @@ } private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; f_init_handler(pars); - f_perform_lu(true, true, true); + f_perform_lu(true); } testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -532,7 +541,7 @@ cpars.mgcp_connection_id_bss := '22222'H; cpars.mgcp_connection_id_mss := '33333'H; - f_perform_lu(cpars.expect_auth, true, true); + f_perform_lu(true); f_mo_call(cpars); } testcase TC_lu_and_mo_call() runs on MTC_CT { @@ -883,7 +892,7 @@ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); /* Then issue emergency call identified by IMSI */ f_emerg_call(valueof(ts_MI_IMSI_LV(g_pars.imsi))); } @@ -900,7 +909,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); @@ -921,7 +930,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); @@ -942,7 +951,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); @@ -963,7 +972,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); @@ -1019,9 +1028,12 @@ vc_conn.done; } +/* A5/1 + A5/3 permitted on network side, and MS capable to do it */ private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; f_init_handler(pars); - f_perform_lu(true, true, true, true); + f_perform_lu(true); } testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1106,9 +1118,9 @@ private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_expect_clear(); } testcase TC_establish_and_nothing() runs on MTC_CT { @@ -1125,9 +1137,9 @@ var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mncc_expect(hex2str(cpars.called_party)); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1150,9 +1162,9 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mncc_expect(hex2str(cpars.called_party)); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1184,9 +1196,9 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mncc_expect(hex2str(cpars.called_party)); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1246,7 +1258,7 @@ var MgcpCommand mgcp_cmd; var OCT4 tmsi; - f_perform_lu(false, true, true, false); + f_perform_lu(true); if (isvalue(g_pars.tmsi)) { tmsi := g_pars.tmsi; } else { @@ -1262,7 +1274,7 @@ /* MSC->BSC: expect PAGING from MSC */ BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); /* MS -> MSC: PAGING RESPONSE */ - f_establish_fully_pag(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully_pag(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1390,7 +1402,7 @@ cpars.mgcp_connection_id_mss := '33333'H; /* Location Update to make subscriber known */ - f_perform_lu(cpars.expect_auth, true, true); + f_perform_lu(true); /* First MO call should succeed */ f_mo_call(cpars); -- To view, visit https://gerrit.osmocom.org/6144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01a931f1cbbca4593fff2fd12689f040ceaa79b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:08:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:08:39 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Cipher mode negotiation test Message-ID: Review at https://gerrit.osmocom.org/6145 msc: Cipher mode negotiation test This adds a series of test cases that test various combinations of A5/0, A5/1, A5/2 and A5/3 on both phone as well as network config side. Change-Id: I552fa4a23b7b65613a69b1a822e28e7dea401102 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 213 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/45/6145/1 diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index a801e51..4f50b70 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -55,11 +55,57 @@ hexstring imsi, hexstring msisdn, OCT4 tmsi optional, + MobileStationClassmark1_V cm1, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional, AuthVector vec optional, BSC_ConnHdlrNetworkPars net }; + +/* get a one-octet bitmaks of supported algorithms based on Classmark information */ +function f_alg_mask_from_cm(BSSMAP_IE_ClassmarkInformationType2 cm2) return OCT1 { + var BIT8 res := '00000001'B; /* A5/0 always supported */ + + if (cm2.a5_1 == '0'B) { + res := res or4b '00000010'B; + } + if (cm2.classmarkInformationType2_oct5.a5_2 == '1'B ) { + res := res or4b '00000100'B; + } + if (cm2.classmarkInformationType2_oct5.a5_3 == '1'B) { + res := res or4b '00001000'B; + } + /* TODO: CM3 for A5/4 and beyond */ + return bit2oct(res); +} + +/* determine the best algorithm available within the bit-mask */ +function f_best_alg_from_mask(OCT1 alg_in) return OCT1 { + var BIT8 alg := oct2bit(alg_in); + var BIT8 ordered_algs[8] := { + '10000000'B, '01000000'B, '00100000'B, '00010000'B, + '00001000'B, /* A5/3 */ + '00000010'B, /* A5/1 */ + '00000100'B, /* A5/2 */ + '00000001'B /* A5/0 */ } + for (var integer i := 0; i < sizeof(ordered_algs); i := i+1) { + if (alg and4b ordered_algs[i] != '00000000'B) { + return bit2oct(ordered_algs[i]); + } + } + return '00'O; +} + +/* return an integer like '1' for A5/1 based on a mask (with only one bit set */ +function f_alg_from_mask(OCT1 mask_in) return integer { + var BIT8 mask := oct2bit(mask_in); + for (var integer i := 0; i < 8; i := i+1) { + if (mask and4b ('00000001'B << i) != '00000000'B) { + return i; + } + } + return -1; +} /* altstep for the global guard timer */ private altstep as_Tguard() runs on BSC_ConnHdlr { @@ -172,26 +218,26 @@ /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ -function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW +function f_build_lu_imsi(hexstring imsi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); return f_build_lu(mi); } -function f_build_lu_imei(hexstring imei) return PDU_ML3_MS_NW +function f_build_lu_imei(hexstring imei) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(imei)); return f_build_lu(mi); } -function f_build_lu_tmsi(OCT4 tmsi) return PDU_ML3_MS_NW +function f_build_lu_tmsi(OCT4 tmsi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV(tmsi)); return f_build_lu(mi); } -private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW +private function f_build_lu(MobileIdentityLV mi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), - old_lai, mi, valueof(ts_CM1))); + old_lai, mi, g_pars.cm1)); return l3_info; } @@ -213,7 +259,7 @@ } -function f_mm_common() runs on BSC_ConnHdlr +function f_mm_auth() runs on BSC_ConnHdlr { if (g_pars.net.expect_auth) { g_pars.vec := f_gen_auth_vec_2g(); @@ -226,10 +272,26 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); } +} +function f_mm_common() runs on BSC_ConnHdlr +{ + f_mm_auth(); if (g_pars.net.expect_ciph) { - BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)); - BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); + var OCT1 a5_net := f_alg_mask_from_cm(g_pars.cm2); + var OCT1 a5_intersect := g_pars.net.kc_support and4b a5_net; + alt { + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(a5_intersect, g_pars.vec.kc)) { + var OCT1 a5_chosen := f_best_alg_from_mask(a5_intersect); + var integer a5_nr := f_alg_from_mask(a5_chosen); + BSSAP.send(ts_BSSMAP_CipherModeCompl(int2oct(a5_nr+1, 1))); + } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { + setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); + self.stop; + } + } + /* FIXME: Send the best available algorithm */ } } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 90f308f..f91ff38 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -368,6 +368,7 @@ imsi := f_gen_imsi(imsi_suffix), msisdn := f_gen_msisdn(imsi_suffix), tmsi := omit, + cm1 := valueof(ts_CM1), cm2 := valueof(ts_CM2_default), cm3 := omit, vec := omit, @@ -1438,6 +1439,143 @@ vc_conn.done; } +/* A5/1 only permitted on network side, and MS capable to do it */ +private function f_tc_lu_imsi_auth_tmsi_encr_1_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '02'O; /* A5/1 only */ + f_init_handler(pars); + f_perform_lu(true); +} +testcase TC_lu_imsi_auth_tmsi_encr_1_13() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 1"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_1_13), testcasename(), 32); + vc_conn.done; +} + +/* A5/3 only permitted on network side, and MS capable to do it */ +private function f_tc_lu_imsi_auth_tmsi_encr_3_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '08'O; /* A5/3 only */ + f_init_handler(pars); + f_perform_lu(true); +} +testcase TC_lu_imsi_auth_tmsi_encr_3_13() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_13), testcasename(), 33); + vc_conn.done; +} + +/* A5/3 only permitted on network side, and MS with only A5/1 support */ +private function f_tc_lu_imsi_auth_tmsi_encr_3_1(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '08'O; /* A5/3 only */ + pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; + f_init_handler(pars, 15.0); + + /* cannot use f_perform_lu() as we expect a reject */ + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + f_mm_auth(); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { + setverdict(fail, "CipherModeCommand despite no A5 intersection"); + self.stop; + } + [] BSSAP.receive { + setverdict(inconc, "Unknown/unexpected BSSAP received"); + self.stop; + } + } + setverdict(pass); +} +testcase TC_lu_imsi_auth_tmsi_encr_3_1() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_1), testcasename(), 34); + vc_conn.done; +} + +/* A5/1 + A5/3 only permitted on network side, and MS with only A5/2 support */ +private function f_tc_lu_imsi_auth_tmsi_encr_13_2(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '0A'O; /* A5/1 + A5/3 */ + pars.cm1.a5_1 := '1'B; + pars.cm2.a5_1 := '1'B; + pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; + pars.cm2.classmarkInformationType2_oct5.a5_2 := '1'B; + f_init_handler(pars, 15.0); + + /* cannot use f_perform_lu() as we expect a reject */ + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + f_mm_auth(); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { + setverdict(fail, "CipherModeCommand despite no A5 intersection"); + self.stop; + } + [] BSSAP.receive { + setverdict(inconc, "Unknown/unexpected BSSAP received"); + self.stop; + } + } + setverdict(pass); +} +testcase TC_lu_imsi_auth_tmsi_encr_13_2() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 1 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_2), testcasename(), 35); + vc_conn.done; +} + +/* A5/0 + A5/1 + A5/3 only permitted on network side, and MS with only A5/2 support */ +private function f_tc_lu_imsi_auth_tmsi_encr_013_2(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '0B'O; /* A5/1 + A5/3 */ + pars.cm1.a5_1 := '1'B; + pars.cm2.a5_1 := '1'B; + pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; + pars.cm2.classmarkInformationType2_oct5.a5_2 := '1'B; + f_init_handler(pars, 15.0); + f_perform_lu(true); +} +testcase TC_lu_imsi_auth_tmsi_encr_013_2() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 0 1 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_013_2), testcasename(), 36); + vc_conn.done; +} + + + /* TODO: @@ -1487,6 +1625,11 @@ execute( TC_mt_crcx_ran_reject() ); execute( TC_mt_t310() ); execute( TC_gsup_cancel() ); + execute( TC_lu_imsi_auth_tmsi_encr_1_13() ); + execute( TC_lu_imsi_auth_tmsi_encr_3_13() ); + execute( TC_lu_imsi_auth_tmsi_encr_3_1() ); + execute( TC_lu_imsi_auth_tmsi_encr_13_2() ); + execute( TC_lu_imsi_auth_tmsi_encr_013_2() ); } -- To view, visit https://gerrit.osmocom.org/6145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I552fa4a23b7b65613a69b1a822e28e7dea401102 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:09:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:09:07 +0000 Subject: osmo-msc[master]: Shift ciphering algorithm selection from VLR to MSC In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5ed80ca2086560a5975a758ec568a034a9a8ab89 Gerrit-PatchSet: 4 Gerrit-Project: osmo-msc 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 Jan 28 00:09:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:09:10 +0000 Subject: osmo-msc[master]: Permit a set of multiple different A5 ciphers In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte 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 Jan 28 00:09:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:09:36 +0000 Subject: osmo-msc[master]: MSC: Intersect configured A5 algorithms with MS-supported ones In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte 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 Jan 28 00:09:43 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:09:43 +0000 Subject: [MERGED] osmo-msc[master]: MSC: Intersect configured A5 algorithms with MS-supported ones In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MSC: Intersect configured A5 algorithms with MS-supported ones ...................................................................... MSC: Intersect configured A5 algorithms with MS-supported ones There's no point of ever asking a MS to perform ciphering using an algorithm it advertises no support for. Let's hence use CLASSMARK information to figure out the intersection between MSC policy (VTY command) and MS-reported CLASSMARK. Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3 --- M src/libmsc/gsm_04_08.c 1 file changed, 65 insertions(+), 1 deletion(-) 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/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 3574583..c9ea2c8 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -89,6 +89,62 @@ static uint32_t new_callref = 0x80000001; +/* Determine if the given CLASSMARK (1/2/3) value permits a given A5/n cipher */ +static bool classmark_supports_a5(const struct gsm_classmark *cm, uint8_t a5) +{ + switch (a5) { + case 0: + /* all phones must implement A5/0, see 3GPP TS 43.020 4.9 */ + return true; + case 1: + /* 3GPP TS 43.020 4.9 requires A5/1 to be suppored by all phones and actually states: + * "The network shall not provide service to an MS which indicates that it does not + * support the ciphering algorithm A5/1.". However, let's be more tolerant based + * on policy here */ + /* See 3GPP TS 24.008 10.5.1.7 */ + if (!cm->classmark1_set) { + DEBUGP(DMSC, "CLASSMARK 1 unknown, assuming MS supports A5/1\n"); + return true; + } else { + if (cm->classmark1.a5_1) + return false; /* Inverted logic for this bit! */ + else + return true; + } + break; + case 2: + case 3: + /* See 3GPP TS 24.008 10.5.1.6 */ + if (cm->classmark2_len < 3) { + DEBUGP(DMSC, "CLASSMARK 2 unknown, assuming MS doesn't support A5/%u\n", a5); + return false; + } else { + if (cm->classmark2[2] & (1 << (a5-2))) + return true; + else + return false; + } + break; + case 4: + case 5: + case 6: + case 7: + /* See 3GPP TS 24.008 10.5.1.7 */ + if (cm->classmark3_len < 1) { + DEBUGP(DMSC, "CLASSMARK 3 unknown, assuming MS doesn't support A5/%u\n", a5); + return false; + } else { + if (cm->classmark3[0] & (1 << (a5-4))) + return true; + else + return false; + } + break; + default: + return false; + } +} + void cc_tx_to_mncc(struct gsm_network *net, struct msgb *msg) { net->mncc_recv(net, msg); @@ -3452,11 +3508,19 @@ int i, j = 0; for (i = 0; i < 8; i++) { - if (net->a5_encryption_mask & (1 << i)) + if (net->a5_encryption_mask & (1 << i) && + classmark_supports_a5(&conn->classmark, i)) ei.perm_algo[j++] = vlr_ciph_to_gsm0808_alg_id(i); } ei.perm_algo_len = j; + if (ei.perm_algo_len == 0) { + LOGP(DMM, LOGL_ERROR, "%s: cannot start ciphering, no intersection " + "between MSC-configured and MS-supported A5 algorithms\n", + vlr_subscr_name(conn->vsub)); + return -ENOTSUP; + } + /* In case of UMTS AKA, the Kc for ciphering must be derived from the 3G auth * tokens. tuple->vec.kc was calculated from the GSM algorithm and is not * necessarily a match for the UMTS AKA tokens. */ -- To view, visit https://gerrit.osmocom.org/5560 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id124923ee52a357cb7d3e04d33f585214774f3a3 Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:09:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:09:44 +0000 Subject: [MERGED] osmo-msc[master]: Permit a set of multiple different A5 ciphers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Permit a set of multiple different A5 ciphers ...................................................................... Permit a set of multiple different A5 ciphers So far, the administrator had to pick one particular cipher which would then be used throughout all subscribers/phones. This is a bit impractical, as e.g. not all phones support A5/3. Extend the VTY command syntax in a backwards-compatible way to permit for multiple ciphers. NOTE: Like the previous code, OsmoMSC does *not yet check* whether the configured cipher is compatible with the MS capabilities as reported in CLASSMARK! The network hence might choose an algorithm not supported by the phone. Fixing this is subject to another patch. Closes: OS#2460 Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b --- M include/osmocom/msc/gsm_data.h M src/libcommon-cs/common_cs.c M src/libcommon-cs/common_cs_vty.c M src/libmsc/gsm_04_08.c M src/libmsc/msc_vty.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.c M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_tests.c 8 files changed, 49 insertions(+), 30 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/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index e987136..27324d7 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -299,7 +299,8 @@ regex_t authorized_regexp; char *authorized_reg_str; enum gsm48_reject_value reject_cause; - int a5_encryption; + /* bit-mask of permitted encryption algorithms. LSB=A5/0, MSB=A5/7 */ + uint8_t a5_encryption_mask; bool authentication_required; int neci; int send_mm_info; diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 41c456e..170b62a 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -56,6 +56,8 @@ net->country_code = country_code; net->network_code = network_code; + /* Permit a compile-time default of A5/3 and A5/1 */ + net->a5_encryption_mask = (1 << 3) | (1 << 1); /* Use 30 min periodic update interval as sane default */ net->t3212 = 5; diff --git a/src/libcommon-cs/common_cs_vty.c b/src/libcommon-cs/common_cs_vty.c index 4754531..8c9f127 100644 --- a/src/libcommon-cs/common_cs_vty.c +++ b/src/libcommon-cs/common_cs_vty.c @@ -155,15 +155,20 @@ DEFUN(cfg_net_encryption, cfg_net_encryption_cmd, - "encryption a5 (0|1|2|3)", + "encryption a5 <0-3> [<0-3>] [<0-3>] [<0-3>]", "Encryption options\n" - "A5 encryption\n" "A5/0: No encryption\n" - "A5/1: Encryption\n" "A5/2: Export-grade Encryption\n" - "A5/3: 'New' Secure Encryption\n") + "GSM A5 Air Interface Encryption\n" + "A5/n Algorithm Number\n" + "A5/n Algorithm Number\n" + "A5/n Algorithm Number\n" + "A5/n Algorithm Number\n") { struct gsm_network *gsmnet = gsmnet_from_vty(vty); + unsigned int i; - gsmnet->a5_encryption = atoi(argv[0]); + gsmnet->a5_encryption_mask = 0; + for (i = 0; i < argc; i++) + gsmnet->a5_encryption_mask |= (1 << atoi(argv[i])); return CMD_SUCCESS; } diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index c37aeb7..3574583 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -339,7 +339,7 @@ net->vlr, conn, vlr_lu_type, tmsi, imsi, &old_lai, &new_lai, is_utran || conn->network->authentication_required, - is_utran || conn->network->a5_encryption, + is_utran || conn->network->a5_encryption_mask > 0x01, classmark_is_r99(&conn->classmark), is_utran, net->vlr->cfg.assign_tmsi); @@ -723,7 +723,7 @@ net->vlr, conn, VLR_PR_ARQ_T_CM_SERV_REQ, mi-1, &lai, is_utran || conn->network->authentication_required, - is_utran || conn->network->a5_encryption, + is_utran || conn->network->a5_encryption_mask > 0x01, classmark_is_r99(&conn->classmark), is_utran); @@ -1127,7 +1127,7 @@ net->vlr, conn, VLR_PR_ARQ_T_PAGING_RESP, mi_lv, &lai, is_utran || conn->network->authentication_required, - is_utran || conn->network->a5_encryption, + is_utran || conn->network->a5_encryption_mask > 0x01, classmark_is_r99(&conn->classmark), is_utran); @@ -3447,10 +3447,15 @@ DEBUGP(DMM, "-> CIPHER MODE COMMAND %s\n", vlr_subscr_name(conn->vsub)); { + struct gsm_network *net = conn->network; struct gsm0808_encrypt_info ei; + int i, j = 0; - ei.perm_algo[0] = vlr_ciph_to_gsm0808_alg_id(conn->network->a5_encryption); - ei.perm_algo_len = 1; + for (i = 0; i < 8; i++) { + if (net->a5_encryption_mask & (1 << i)) + ei.perm_algo[j++] = vlr_ciph_to_gsm0808_alg_id(i); + } + ei.perm_algo_len = j; /* In case of UMTS AKA, the Kc for ciphering must be derived from the 3G auth * tokens. tuple->vec.kc was calculated from the GSM algorithm and is not diff --git a/src/libmsc/msc_vty.c b/src/libmsc/msc_vty.c index 82608c6..faf17ec 100644 --- a/src/libmsc/msc_vty.c +++ b/src/libmsc/msc_vty.c @@ -1,7 +1,7 @@ /* MSC interface to quagga VTY */ /* (C) 2016 by sysmocom s.m.f.c. GmbH * Based on OpenBSC interface to quagga VTY (libmsc/vty_interface_layer3.c) - * (C) 2009 by Harald Welte + * (C) 2009-2017 by Harald Welte * (C) 2009-2011 by Holger Hans Peter Freyther * All Rights Reserved * @@ -160,6 +160,7 @@ static int config_write_net(struct vty *vty) { struct gsm_network *gsmnet = gsmnet_from_vty(vty); + int i; vty_out(vty, "network%s", VTY_NEWLINE); vty_out(vty, " network country code %u%s", gsmnet->country_code, VTY_NEWLINE); @@ -169,7 +170,12 @@ vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE); vty_out(vty, " location updating reject cause %u%s", gsmnet->reject_cause, VTY_NEWLINE); - vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE); + vty_out(vty, " encryption a5"); + for (i = 0; i < 8; i++) { + if (gsmnet->a5_encryption_mask & (1 << i)) + vty_out(vty, " %u", i); + } + vty_out(vty, "%s", VTY_NEWLINE); vty_out(vty, " authentication %s%s", gsmnet->authentication_required ? "required" : "optional", VTY_NEWLINE); vty_out(vty, " rrlp mode %s%s", rrlp_mode_name(gsmnet->rrlp.mode), diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c index e0bd967..42e620a 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.c +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.c @@ -31,7 +31,7 @@ comment_start(); /* implicit: net->authentication_required = true; */ - net->a5_encryption = VLR_CIPH_A5_1; + net->a5_encryption_mask = (1 << 1); btw("Location Update request causes a GSUP Send Auth Info request to HLR"); lu_result_sent = RES_NONE; @@ -243,7 +243,7 @@ comment_start(); /* implicit: net->authentication_required = true; */ - net->a5_encryption = VLR_CIPH_A5_1; + net->a5_encryption_mask = (1 << 1); net->vlr->cfg.assign_tmsi = true; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -482,7 +482,7 @@ comment_start(); /* implicit: net->authentication_required = true; */ - net->a5_encryption = VLR_CIPH_A5_1; + net->a5_encryption_mask = (1 << 1); net->vlr->cfg.check_imei_rqd = true; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -584,7 +584,7 @@ comment_start(); /* implicit: net->authentication_required = true; */ - net->a5_encryption = VLR_CIPH_A5_1; + net->a5_encryption_mask = (1 << 1); net->vlr->cfg.retrieve_imeisv_ciphered = true; btw("Location Update request causes a GSUP Send Auth Info request to HLR"); @@ -682,7 +682,7 @@ comment_start(); /* implicit: net->authentication_required = true; */ - net->a5_encryption = VLR_CIPH_A5_1; + net->a5_encryption_mask = (1 << 1); net->vlr->cfg.assign_tmsi = true; net->vlr->cfg.check_imei_rqd = true; diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 0e9d996..cb9091c 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -62,7 +62,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 +- sending Ciphering Mode Command for IMSI:901700000004620: ciphers=0x02 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - dtap == 1 (0x4) @@ -225,7 +225,7 @@ DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=07fa7502e07e1c00 retrieve_imeisv=0 +- sending Ciphering Mode Command for MSISDN:46071: ciphers=0x02 kc=07fa7502e07e1c00 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF MSISDN:46071: MSC conn use - dtap == 1 (0x4) @@ -370,7 +370,7 @@ DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=e2b234f807886400 retrieve_imeisv=0 +- sending Ciphering Mode Command for MSISDN:46071: ciphers=0x02 kc=e2b234f807886400 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF MSISDN:46071: MSC conn use - dtap == 1 (0x4) @@ -547,7 +547,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 +- sending Ciphering Mode Command for IMSI:901700000004620: ciphers=0x02 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - dtap == 1 (0x4) @@ -747,7 +747,7 @@ DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=07fa7502e07e1c00 retrieve_imeisv=0 +- sending Ciphering Mode Command for MSISDN:46071: ciphers=0x02 kc=07fa7502e07e1c00 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF MSISDN:46071: MSC conn use - dtap == 1 (0x4) @@ -892,7 +892,7 @@ DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=e2b234f807886400 retrieve_imeisv=0 +- sending Ciphering Mode Command for MSISDN:46071: ciphers=0x02 kc=e2b234f807886400 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF MSISDN:46071: MSC conn use - dtap == 1 (0x4) @@ -1069,7 +1069,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 +- sending Ciphering Mode Command for IMSI:901700000004620: ciphers=0x02 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - dtap == 1 (0x4) @@ -1290,7 +1290,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=1 +- sending Ciphering Mode Command for IMSI:901700000004620: ciphers=0x02 kc=61855fb81fc2a800 retrieve_imeisv=1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - dtap == 1 (0x4) @@ -1500,7 +1500,7 @@ DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode -- sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 +- sending Ciphering Mode Command for IMSI:901700000004620: ciphers=0x02 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) DREF IMSI:901700000004620: MSC conn use - dtap == 1 (0x4) diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index b8553b6..e4adfe0 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -333,7 +333,7 @@ } net->authentication_required = false; - net->a5_encryption = VLR_CIPH_NONE; + net->a5_encryption_mask = (1 << 0); net->vlr->cfg.check_imei_rqd = false; net->vlr->cfg.assign_tmsi = false; net->vlr->cfg.retrieve_imeisv_early = false; @@ -670,10 +670,10 @@ struct gsm_subscriber_connection *conn = msc_conn_ref; switch (conn->via_ran) { case RAN_GERAN_A: - btw("sending Ciphering Mode Command for %s: cipher=%s kc=%s" + btw("sending Ciphering Mode Command for %s: ciphers=0x%02x kc=%s" " retrieve_imeisv=%d", vlr_subscr_name(conn->vsub), - vlr_ciph_name(conn->network->a5_encryption), + conn->network->a5_encryption_mask, osmo_hexdump_nospc(conn->vsub->last_tuple->vec.kc, 8), retrieve_imeisv); break; -- To view, visit https://gerrit.osmocom.org/5559 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79a4e2892eb5fbecc3d84e11dceffb7149db264b Gerrit-PatchSet: 6 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:09:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:09:44 +0000 Subject: [MERGED] osmo-msc[master]: Shift ciphering algorithm selection from VLR to MSC In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Shift ciphering algorithm selection from VLR to MSC ...................................................................... Shift ciphering algorithm selection from VLR to MSC The VLR code seems to have the assumption that there is one particular algorithm to be used, as opposed to one of a set of algorithms. What's missing is basically to decide when/where to pick the best algorithm within the capabilities of the phone (classmark) and the network configuration (net->a5_encryption_mask). So far, libvlr has no notion of classmark. Rather, libmsc has. Why does the VLR care about the particular algorithm at all? The VLR should probably simply decide if it should use encryption or not, and if so, the MSC will figure which algorithm to use. Change-Id: I5ed80ca2086560a5975a758ec568a034a9a8ab89 --- M include/osmocom/msc/vlr.h M src/libmsc/gsm_04_08.c M src/libvlr/vlr.c M src/libvlr/vlr_access_req_fsm.c M src/libvlr/vlr_lu_fsm.c M tests/msc_vlr/msc_vlr_test_authen_reuse.err M tests/msc_vlr/msc_vlr_test_call.err M tests/msc_vlr/msc_vlr_test_gsm_ciph.err M tests/msc_vlr/msc_vlr_test_umts_authen.err M tests/msc_vlr/msc_vlr_tests.c 10 files changed, 47 insertions(+), 73 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/msc/vlr.h b/include/osmocom/msc/vlr.h index 9943f15..054a18e 100644 --- a/include/osmocom/msc/vlr.h +++ b/include/osmocom/msc/vlr.h @@ -212,8 +212,7 @@ int (*tx_cm_serv_acc)(void *msc_conn_ref); int (*tx_cm_serv_rej)(void *msc_conn_ref, enum vlr_proc_arq_result result); - int (*set_ciph_mode)(void *msc_conn_ref, enum vlr_ciph ciph_mode, - bool umts_aka, bool retrieve_imeisv); + int (*set_ciph_mode)(void *msc_conn_ref, bool umts_aka, bool retrieve_imeisv); /* UTRAN: send Common Id (when auth+ciph are complete) */ int (*tx_common_id)(void *msc_conn_ref); @@ -271,7 +270,7 @@ const struct osmo_location_area_id *old_lai, const struct osmo_location_area_id *new_lai, bool authentication_required, - enum vlr_ciph ciphering_required, + bool ciphering_required, bool is_r99, bool is_utran, bool assign_tmsi); @@ -428,7 +427,7 @@ enum vlr_parq_type type, const uint8_t *mi_lv, const struct osmo_location_area_id *lai, bool authentication_required, - enum vlr_ciph ciphering_required, + bool ciphering_required, bool is_r99, bool is_utran); void vlr_parq_conn_timeout(struct osmo_fsm_inst *fi); @@ -438,7 +437,7 @@ int vlr_set_ciph_mode(struct vlr_instance *vlr, struct osmo_fsm_inst *fi, void *msc_conn_ref, - enum vlr_ciph ciph_mode, + bool ciph_required, bool umts_aka, bool retrieve_imeisv); diff --git a/src/libmsc/gsm_04_08.c b/src/libmsc/gsm_04_08.c index 126a216..c37aeb7 100644 --- a/src/libmsc/gsm_04_08.c +++ b/src/libmsc/gsm_04_08.c @@ -339,8 +339,7 @@ net->vlr, conn, vlr_lu_type, tmsi, imsi, &old_lai, &new_lai, is_utran || conn->network->authentication_required, - is_utran? VLR_CIPH_A5_3 - : conn->network->a5_encryption, + is_utran || conn->network->a5_encryption, classmark_is_r99(&conn->classmark), is_utran, net->vlr->cfg.assign_tmsi); @@ -724,8 +723,7 @@ net->vlr, conn, VLR_PR_ARQ_T_CM_SERV_REQ, mi-1, &lai, is_utran || conn->network->authentication_required, - is_utran? VLR_CIPH_A5_3 - : conn->network->a5_encryption, + is_utran || conn->network->a5_encryption, classmark_is_r99(&conn->classmark), is_utran); @@ -1129,8 +1127,7 @@ net->vlr, conn, VLR_PR_ARQ_T_PAGING_RESP, mi_lv, &lai, is_utran || conn->network->authentication_required, - is_utran? VLR_CIPH_A5_3 - : conn->network->a5_encryption, + is_utran || conn->network->a5_encryption, classmark_is_r99(&conn->classmark), is_utran); @@ -3422,7 +3419,6 @@ /* VLR asks us to start using ciphering */ static int msc_vlr_set_ciph_mode(void *msc_conn_ref, - enum vlr_ciph ciph, bool umts_aka, bool retrieve_imeisv) { @@ -3453,7 +3449,7 @@ { struct gsm0808_encrypt_info ei; - ei.perm_algo[0] = vlr_ciph_to_gsm0808_alg_id(ciph); + ei.perm_algo[0] = vlr_ciph_to_gsm0808_alg_id(conn->network->a5_encryption); ei.perm_algo_len = 1; /* In case of UMTS AKA, the Kc for ciphering must be derived from the 3G auth diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index 21ef082..6750a46 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -1105,33 +1105,15 @@ int vlr_set_ciph_mode(struct vlr_instance *vlr, struct osmo_fsm_inst *fi, void *msc_conn_ref, - enum vlr_ciph ciph_mode, + bool ciph_required, bool umts_aka, bool retrieve_imeisv) { - switch (ciph_mode) { - case VLR_CIPH_NONE: + if (!ciph_required) return 0; - case VLR_CIPH_A5_1: - case VLR_CIPH_A5_3: - LOGPFSML(fi, LOGL_DEBUG, "Set Ciphering Mode: %d=%s\n", - ciph_mode, vlr_ciph_name(ciph_mode)); - return vlr->ops.set_ciph_mode(msc_conn_ref, - ciph_mode, - umts_aka, - retrieve_imeisv); - - case VLR_CIPH_A5_2: - /* TODO policy by user config? */ - LOGPFSML(fi, LOGL_ERROR, "A5/2 ciphering is not allowed\n"); - return -EINVAL; - - default: - LOGPFSML(fi, LOGL_ERROR, "unknown ciphering value: %d\n", - ciph_mode); - return -EINVAL; - } + LOGPFSML(fi, LOGL_DEBUG, "Set Ciphering Mode\n"); + return vlr->ops.set_ciph_mode(msc_conn_ref, umts_aka, retrieve_imeisv); } /* Decide whether UMTS AKA should be used. diff --git a/src/libvlr/vlr_access_req_fsm.c b/src/libvlr/vlr_access_req_fsm.c index 41e629e..556e694 100644 --- a/src/libvlr/vlr_access_req_fsm.c +++ b/src/libvlr/vlr_access_req_fsm.c @@ -79,7 +79,7 @@ uint32_t tmsi; struct osmo_location_area_id lai; bool authentication_required; - enum vlr_ciph ciphering_required; + bool ciphering_required; bool is_r99; bool is_utran; bool implicitly_accepted_parq_by_ciphering_cmd; @@ -277,7 +277,7 @@ static bool is_ciph_required(struct proc_arq_priv *par) { - return par->ciphering_required != VLR_CIPH_NONE; + return par->ciphering_required; } static void _proc_arq_vlr_node2(struct osmo_fsm_inst *fi) @@ -311,8 +311,7 @@ /* The cases where the authentication procedure should be used * are defined in 3GPP TS 33.102 */ /* For now we use a default value passed in to vlr_lu_fsm(). */ - return par->authentication_required - || (par->ciphering_required != VLR_CIPH_NONE); + return par->authentication_required || par->ciphering_required; } /* after the IMSI is known */ @@ -654,7 +653,7 @@ enum vlr_parq_type type, const uint8_t *mi_lv, const struct osmo_location_area_id *lai, bool authentication_required, - enum vlr_ciph ciphering_required, + bool ciphering_required, bool is_r99, bool is_utran) { struct osmo_fsm_inst *fi; diff --git a/src/libvlr/vlr_lu_fsm.c b/src/libvlr/vlr_lu_fsm.c index e540e2a..6c8b53a 100644 --- a/src/libvlr/vlr_lu_fsm.c +++ b/src/libvlr/vlr_lu_fsm.c @@ -644,7 +644,7 @@ struct osmo_location_area_id old_lai; struct osmo_location_area_id new_lai; bool authentication_required; - enum vlr_ciph ciphering_required; + bool ciphering_required; bool is_r99; bool is_utran; bool assign_tmsi; @@ -665,14 +665,13 @@ /* The cases where the authentication procedure should be used * are defined in 3GPP TS 33.102 */ /* For now we use a default value passed in to vlr_lu_fsm(). */ - return lfp->authentication_required - || (lfp->ciphering_required != VLR_CIPH_NONE); + return lfp->authentication_required || lfp->ciphering_required; } /* Determine if ciphering is required */ static bool is_ciph_required(struct lu_fsm_priv *lfp) { - return lfp->ciphering_required != VLR_CIPH_NONE; + return lfp->ciphering_required; } /* Determine if a HLR Update is required */ @@ -1391,7 +1390,7 @@ const struct osmo_location_area_id *old_lai, const struct osmo_location_area_id *new_lai, bool authentication_required, - enum vlr_ciph ciphering_required, + bool ciphering_required, bool is_r99, bool is_utran, bool assign_tmsi) { diff --git a/tests/msc_vlr/msc_vlr_test_authen_reuse.err b/tests/msc_vlr/msc_vlr_test_authen_reuse.err index a161e3a..c6c3f72 100644 --- a/tests/msc_vlr/msc_vlr_test_authen_reuse.err +++ b/tests/msc_vlr/msc_vlr_test_authen_reuse.err @@ -490,7 +490,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -668,7 +668,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -797,7 +797,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1465,7 +1465,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1643,7 +1643,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1758,7 +1758,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1873,7 +1873,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -2341,7 +2341,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -2533,7 +2533,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) diff --git a/tests/msc_vlr/msc_vlr_test_call.err b/tests/msc_vlr/msc_vlr_test_call.err index 7b4c72e..32a65bb 100644 --- a/tests/msc_vlr/msc_vlr_test_call.err +++ b/tests/msc_vlr/msc_vlr_test_call.err @@ -63,7 +63,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -227,7 +227,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -412,7 +412,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -584,7 +584,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) diff --git a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err index 53273e3..0e9d996 100644 --- a/tests/msc_vlr/msc_vlr_test_gsm_ciph.err +++ b/tests/msc_vlr/msc_vlr_test_gsm_ciph.err @@ -61,7 +61,7 @@ DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -224,7 +224,7 @@ DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=07fa7502e07e1c00 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -369,7 +369,7 @@ DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=e2b234f807886400 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(901700000004620){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -546,7 +546,7 @@ DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -746,7 +746,7 @@ DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=07fa7502e07e1c00 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -891,7 +891,7 @@ DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for MSISDN:46071: cipher=VLR_CIPH_A5_1 kc=e2b234f807886400 retrieve_imeisv=0 DVLR Process_Access_Request_VLR(50462976){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:46071: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1068,7 +1068,7 @@ DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1289,7 +1289,7 @@ DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=1 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1499,7 +1499,7 @@ DVLR VLR_Authenticate(901700000004620){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 1=VLR_CIPH_A5_1 +DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending Ciphering Mode Command for IMSI:901700000004620: cipher=VLR_CIPH_A5_1 kc=61855fb81fc2a800 retrieve_imeisv=0 DVLR vlr_lu_fsm(901700000004620){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000004620: bump: conn still being established (SUBSCR_CONN_S_NEW) diff --git a/tests/msc_vlr/msc_vlr_test_umts_authen.err b/tests/msc_vlr/msc_vlr_test_umts_authen.err index a503822..a740bc2 100644 --- a/tests/msc_vlr/msc_vlr_test_umts_authen.err +++ b/tests/msc_vlr/msc_vlr_test_umts_authen.err @@ -524,7 +524,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -708,7 +708,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -844,7 +844,7 @@ DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Received Event PR_ARQ_E_AUTH_RES DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: got VLR_AUTH_RES_PASSED DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: _proc_arq_vlr_node2() -DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for MSISDN:42342 DVLR Process_Access_Request_VLR(901700000010650){PR_ARQ_S_WAIT_AUTH}: state_chg to PR_ARQ_S_WAIT_CIPH DMM MSISDN:42342: bump: conn still being established (SUBSCR_CONN_S_NEW) @@ -1255,7 +1255,7 @@ DVLR VLR_Authenticate(901700000010650){VLR_SUB_AS_AUTHENTICATED}: Deallocated DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Received Event VLR_ULA_E_AUTH_RES DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: vlr_loc_upd_post_auth() -DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode: 3=VLR_CIPH_A5_3 +DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: Set Ciphering Mode - sending SecurityModeControl for IMSI:901700000010650 DVLR vlr_lu_fsm(901700000010650){VLR_ULA_S_WAIT_AUTH}: state_chg to VLR_ULA_S_WAIT_CIPH DMM IMSI:901700000010650: bump: conn still being established (SUBSCR_CONN_S_NEW) diff --git a/tests/msc_vlr/msc_vlr_tests.c b/tests/msc_vlr/msc_vlr_tests.c index 2152fe4..b8553b6 100644 --- a/tests/msc_vlr/msc_vlr_tests.c +++ b/tests/msc_vlr/msc_vlr_tests.c @@ -661,8 +661,7 @@ return 0; } -static int fake_vlr_tx_ciph_mode_cmd(void *msc_conn_ref, enum vlr_ciph ciph, - bool umts_aka, bool retrieve_imeisv) +static int fake_vlr_tx_ciph_mode_cmd(void *msc_conn_ref, bool umts_aka, bool retrieve_imeisv) { /* FIXME: we actually would like to see the message bytes checked here, * not possible while msc_vlr_set_ciph_mode() calls -- To view, visit https://gerrit.osmocom.org/5558 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5ed80ca2086560a5975a758ec568a034a9a8ab89 Gerrit-PatchSet: 5 Gerrit-Project: osmo-msc 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 Sun Jan 28 00:13:20 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:13:20 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Introduce BSC_ConnHdlrNetworkPars In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I01a931f1cbbca4593fff2fd12689f040ceaa79b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 28 00:13:22 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:13:22 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Cipher mode negotiation test In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I552fa4a23b7b65613a69b1a822e28e7dea401102 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 28 00:13:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:13:23 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Cipher mode negotiation test In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Cipher mode negotiation test ...................................................................... msc: Cipher mode negotiation test This adds a series of test cases that test various combinations of A5/0, A5/1, A5/2 and A5/3 on both phone as well as network config side. Change-Id: I552fa4a23b7b65613a69b1a822e28e7dea401102 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 213 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index a801e51..4f50b70 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -55,11 +55,57 @@ hexstring imsi, hexstring msisdn, OCT4 tmsi optional, + MobileStationClassmark1_V cm1, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional, AuthVector vec optional, BSC_ConnHdlrNetworkPars net }; + +/* get a one-octet bitmaks of supported algorithms based on Classmark information */ +function f_alg_mask_from_cm(BSSMAP_IE_ClassmarkInformationType2 cm2) return OCT1 { + var BIT8 res := '00000001'B; /* A5/0 always supported */ + + if (cm2.a5_1 == '0'B) { + res := res or4b '00000010'B; + } + if (cm2.classmarkInformationType2_oct5.a5_2 == '1'B ) { + res := res or4b '00000100'B; + } + if (cm2.classmarkInformationType2_oct5.a5_3 == '1'B) { + res := res or4b '00001000'B; + } + /* TODO: CM3 for A5/4 and beyond */ + return bit2oct(res); +} + +/* determine the best algorithm available within the bit-mask */ +function f_best_alg_from_mask(OCT1 alg_in) return OCT1 { + var BIT8 alg := oct2bit(alg_in); + var BIT8 ordered_algs[8] := { + '10000000'B, '01000000'B, '00100000'B, '00010000'B, + '00001000'B, /* A5/3 */ + '00000010'B, /* A5/1 */ + '00000100'B, /* A5/2 */ + '00000001'B /* A5/0 */ } + for (var integer i := 0; i < sizeof(ordered_algs); i := i+1) { + if (alg and4b ordered_algs[i] != '00000000'B) { + return bit2oct(ordered_algs[i]); + } + } + return '00'O; +} + +/* return an integer like '1' for A5/1 based on a mask (with only one bit set */ +function f_alg_from_mask(OCT1 mask_in) return integer { + var BIT8 mask := oct2bit(mask_in); + for (var integer i := 0; i < 8; i := i+1) { + if (mask and4b ('00000001'B << i) != '00000000'B) { + return i; + } + } + return -1; +} /* altstep for the global guard timer */ private altstep as_Tguard() runs on BSC_ConnHdlr { @@ -172,26 +218,26 @@ /* build a PDU_ML3_MS_NW containing a Location Update by IMSI */ -function f_build_lu_imsi(hexstring imsi) return PDU_ML3_MS_NW +function f_build_lu_imsi(hexstring imsi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(imsi)); return f_build_lu(mi); } -function f_build_lu_imei(hexstring imei) return PDU_ML3_MS_NW +function f_build_lu_imei(hexstring imei) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var MobileIdentityLV mi := valueof(ts_MI_IMEI_LV(imei)); return f_build_lu(mi); } -function f_build_lu_tmsi(OCT4 tmsi) return PDU_ML3_MS_NW +function f_build_lu_tmsi(OCT4 tmsi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var MobileIdentityLV mi := valueof(ts_MI_TMSI_LV(tmsi)); return f_build_lu(mi); } -private function f_build_lu(MobileIdentityLV mi) return PDU_ML3_MS_NW +private function f_build_lu(MobileIdentityLV mi) runs on BSC_ConnHdlr return PDU_ML3_MS_NW { var LocationAreaIdentification_V old_lai := { '62F220'O, '9999'O }; var PDU_ML3_MS_NW l3_info := valueof(ts_ML3_MO_LU_Req(valueof(ts_ML3_IE_LuType_Attach), - old_lai, mi, valueof(ts_CM1))); + old_lai, mi, g_pars.cm1)); return l3_info; } @@ -213,7 +259,7 @@ } -function f_mm_common() runs on BSC_ConnHdlr +function f_mm_auth() runs on BSC_ConnHdlr { if (g_pars.net.expect_auth) { g_pars.vec := f_gen_auth_vec_2g(); @@ -226,10 +272,26 @@ BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_MM_AUTH_REQ(g_pars.vec.rand))); BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); } +} +function f_mm_common() runs on BSC_ConnHdlr +{ + f_mm_auth(); if (g_pars.net.expect_ciph) { - BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)); - BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); + var OCT1 a5_net := f_alg_mask_from_cm(g_pars.cm2); + var OCT1 a5_intersect := g_pars.net.kc_support and4b a5_net; + alt { + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(a5_intersect, g_pars.vec.kc)) { + var OCT1 a5_chosen := f_best_alg_from_mask(a5_intersect); + var integer a5_nr := f_alg_from_mask(a5_chosen); + BSSAP.send(ts_BSSMAP_CipherModeCompl(int2oct(a5_nr+1, 1))); + } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)) { + setverdict(fail, "Wrong ciphering algorithm mask in CiphModCmd"); + self.stop; + } + } + /* FIXME: Send the best available algorithm */ } } diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index 90f308f..f91ff38 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -368,6 +368,7 @@ imsi := f_gen_imsi(imsi_suffix), msisdn := f_gen_msisdn(imsi_suffix), tmsi := omit, + cm1 := valueof(ts_CM1), cm2 := valueof(ts_CM2_default), cm3 := omit, vec := omit, @@ -1438,6 +1439,143 @@ vc_conn.done; } +/* A5/1 only permitted on network side, and MS capable to do it */ +private function f_tc_lu_imsi_auth_tmsi_encr_1_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '02'O; /* A5/1 only */ + f_init_handler(pars); + f_perform_lu(true); +} +testcase TC_lu_imsi_auth_tmsi_encr_1_13() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 1"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_1_13), testcasename(), 32); + vc_conn.done; +} + +/* A5/3 only permitted on network side, and MS capable to do it */ +private function f_tc_lu_imsi_auth_tmsi_encr_3_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '08'O; /* A5/3 only */ + f_init_handler(pars); + f_perform_lu(true); +} +testcase TC_lu_imsi_auth_tmsi_encr_3_13() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_13), testcasename(), 33); + vc_conn.done; +} + +/* A5/3 only permitted on network side, and MS with only A5/1 support */ +private function f_tc_lu_imsi_auth_tmsi_encr_3_1(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '08'O; /* A5/3 only */ + pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; + f_init_handler(pars, 15.0); + + /* cannot use f_perform_lu() as we expect a reject */ + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + f_mm_auth(); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { + setverdict(fail, "CipherModeCommand despite no A5 intersection"); + self.stop; + } + [] BSSAP.receive { + setverdict(inconc, "Unknown/unexpected BSSAP received"); + self.stop; + } + } + setverdict(pass); +} +testcase TC_lu_imsi_auth_tmsi_encr_3_1() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_3_1), testcasename(), 34); + vc_conn.done; +} + +/* A5/1 + A5/3 only permitted on network side, and MS with only A5/2 support */ +private function f_tc_lu_imsi_auth_tmsi_encr_13_2(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '0A'O; /* A5/1 + A5/3 */ + pars.cm1.a5_1 := '1'B; + pars.cm2.a5_1 := '1'B; + pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; + pars.cm2.classmarkInformationType2_oct5.a5_2 := '1'B; + f_init_handler(pars, 15.0); + + /* cannot use f_perform_lu() as we expect a reject */ + var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi); + f_create_gsup_expect(hex2str(g_pars.imsi)); + f_bssap_compl_l3(l3_lu); + BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); + f_mm_auth(); + alt { + [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Rej)) { } + [] BSSAP.receive(tr_BSSMAP_CipherModeCmd(?,?)) { + setverdict(fail, "CipherModeCommand despite no A5 intersection"); + self.stop; + } + [] BSSAP.receive { + setverdict(inconc, "Unknown/unexpected BSSAP received"); + self.stop; + } + } + setverdict(pass); +} +testcase TC_lu_imsi_auth_tmsi_encr_13_2() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 1 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_13_2), testcasename(), 35); + vc_conn.done; +} + +/* A5/0 + A5/1 + A5/3 only permitted on network side, and MS with only A5/2 support */ +private function f_tc_lu_imsi_auth_tmsi_encr_013_2(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; + pars.net.kc_support := '0B'O; /* A5/1 + A5/3 */ + pars.cm1.a5_1 := '1'B; + pars.cm2.a5_1 := '1'B; + pars.cm2.classmarkInformationType2_oct5.a5_3 := '0'B; + pars.cm2.classmarkInformationType2_oct5.a5_2 := '1'B; + f_init_handler(pars, 15.0); + f_perform_lu(true); +} +testcase TC_lu_imsi_auth_tmsi_encr_013_2() runs on MTC_CT { + var BSC_ConnHdlr vc_conn; + f_init(); + f_vty_config(MSCVTY, "network", "authentication required"); + f_vty_config(MSCVTY, "network", "encryption a5 0 1 3"); + + vc_conn := f_start_handler(refers(f_tc_lu_imsi_auth_tmsi_encr_013_2), testcasename(), 36); + vc_conn.done; +} + + + /* TODO: @@ -1487,6 +1625,11 @@ execute( TC_mt_crcx_ran_reject() ); execute( TC_mt_t310() ); execute( TC_gsup_cancel() ); + execute( TC_lu_imsi_auth_tmsi_encr_1_13() ); + execute( TC_lu_imsi_auth_tmsi_encr_3_13() ); + execute( TC_lu_imsi_auth_tmsi_encr_3_1() ); + execute( TC_lu_imsi_auth_tmsi_encr_13_2() ); + execute( TC_lu_imsi_auth_tmsi_encr_013_2() ); } -- To view, visit https://gerrit.osmocom.org/6145 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I552fa4a23b7b65613a69b1a822e28e7dea401102 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:13:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:13:24 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Introduce BSC_ConnHdlrNetworkPars In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Introduce BSC_ConnHdlrNetworkPars ...................................................................... msc: Introduce BSC_ConnHdlrNetworkPars This record collects information about the network configuration, such as whether or not authentication, tmsi allocation and/or encryption are enabled. The individual helper functions can then react according to this information, without having to pass long argument lists along the call chain. Change-Id: I01a931f1cbbca4593fff2fd12689f040ceaa79b6 --- M msc/BSC_ConnectionHandler.ttcn M msc/MSC_Tests.ttcn 2 files changed, 55 insertions(+), 41 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/BSC_ConnectionHandler.ttcn b/msc/BSC_ConnectionHandler.ttcn index a7ce1ea..a801e51 100644 --- a/msc/BSC_ConnectionHandler.ttcn +++ b/msc/BSC_ConnectionHandler.ttcn @@ -40,6 +40,13 @@ /* FIXME: 3G elements */ } +type record BSC_ConnHdlrNetworkPars { + OCT1 kc_support, + boolean expect_tmsi, + boolean expect_auth, + boolean expect_ciph +} + type record BSC_ConnHdlrPars { SCCP_PAR_Address sccp_addr_own, SCCP_PAR_Address sccp_addr_peer, @@ -50,7 +57,8 @@ OCT4 tmsi optional, BSSMAP_IE_ClassmarkInformationType2 cm2, BSSMAP_IE_ClassmarkInformationType3 cm3 optional, - AuthVector vec optional + AuthVector vec optional, + BSC_ConnHdlrNetworkPars net }; /* altstep for the global guard timer */ @@ -133,7 +141,7 @@ } /* helper function to fully establish a dedicated channel */ -function f_establish_fully(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) +function f_establish_fully(MobileIdentityLV mi) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_MO_CALL, mi)); var PDU_DTAP_MT dtap_mt; @@ -141,8 +149,8 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_info); - f_mm_common(expect_auth, expect_ciph); - if (expect_ciph) { + f_mm_common(); + if (g_pars.net.expect_ciph) { /* implicit CM SERVICE ACCEPT? */ } else { /* explicit CM SERVICE ACCEPT */ @@ -151,7 +159,7 @@ } /* helper function to fully establish a dedicated channel */ -function f_establish_fully_pag(MobileIdentityLV mi, boolean expect_auth, boolean expect_ciph) +function f_establish_fully_pag(MobileIdentityLV mi) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_info := valueof(ts_PAG_RESP(mi)); var PDU_DTAP_MT dtap_mt; @@ -159,7 +167,7 @@ /* Send BSSAP_Conn_Req with COMPL L3 INFO to MSC */ f_bssap_compl_l3(l3_info); - f_mm_common(expect_auth, expect_ciph); + f_mm_common(); } @@ -205,9 +213,9 @@ } -function f_mm_common(boolean expect_auth, boolean expect_ciph) runs on BSC_ConnHdlr +function f_mm_common() runs on BSC_ConnHdlr { - if (expect_auth) { + if (g_pars.net.expect_auth) { g_pars.vec := f_gen_auth_vec_2g(); var GSUP_IE auth_tuple := valueof(ts_GSUP_IE_AuthTuple2G(g_pars.vec.rand, g_pars.vec.sres, @@ -219,14 +227,13 @@ BSSAP.send(ts_PDU_DTAP_MO(ts_ML3_MT_MM_AUTH_RESP_2G(g_pars.vec.sres))); } - if (expect_ciph) { + if (g_pars.net.expect_ciph) { BSSAP.receive(tr_BSSMAP_CipherModeCmd(?, g_pars.vec.kc)); BSSAP.send(ts_BSSMAP_CipherModeCompl('02'O)); } } -function f_perform_lu(boolean expect_auth, boolean expect_tmsi, boolean send_early_cm, - boolean expect_ciph := false) +function f_perform_lu(boolean send_early_cm) runs on BSC_ConnHdlr { var PDU_ML3_MS_NW l3_lu := f_build_lu_imsi(g_pars.imsi) var PDU_DTAP_MT dtap_mt; @@ -241,7 +248,7 @@ BSSAP.send(ts_BSSMAP_ClassmarkUpd(g_pars.cm2, g_pars.cm3)); } - f_mm_common(expect_auth, expect_ciph); + f_mm_common(); /* Expect MSC to perform LU with HLR */ GSUP.receive(tr_GSUP_UL_REQ(g_pars.imsi)); @@ -252,7 +259,7 @@ alt { [] BSSAP.receive(tr_PDU_DTAP_MT(tr_ML3_MT_LU_Acc)) -> value dtap_mt { var PDU_ML3_LocationUpdateAccept lu_acc := dtap_mt.dtap.msgs.mm.locationUpdateAccept; - if (expect_tmsi) { + if (g_pars.net.expect_tmsi) { if (not ispresent(lu_acc.mobileIdentityTLV) or not ischosen(lu_acc.mobileIdentityTLV.mobileIdentityLV.mobileIdentityV.oddEvenInd_identity.tmsi_ptmsi)) { setverdict(fail, "Expected TMSI but no TMSI was allocated"); @@ -299,9 +306,6 @@ /* parameters related to a (MO?) voice call */ type record CallParameters { - boolean expect_auth, /* do we expect AUTHENTICATE from network */ - boolean expect_ciph, /* do we expect CIPHER MODE from network */ - /* CC related parameters */ hexstring called_party, /* whom are we calling */ integer transaction_id optional, /* which TS 04.08 CC transaction ID to use */ @@ -330,8 +334,6 @@ } template (value) CallParameters t_CallParams(hexstring called, integer tid) := { - expect_auth := false, - expect_ciph := false, called_party := called, transaction_id := tid, bearer_cap := valueof(ts_Bcap_voice), @@ -367,7 +369,7 @@ } else { mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); } - f_establish_fully(mi, cpars.expect_auth, cpars.expect_ciph); + f_establish_fully(mi); /* Create MNCC and MGCP expect */ f_create_mncc_expect(hex2str(cpars.called_party)); diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index b6b38dd..90f308f 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -354,6 +354,12 @@ /* FIXME: move into BSC_ConnectionHandler? */ function f_start_handler(void_fn fn, charstring id, integer imsi_suffix) runs on MTC_CT return BSC_ConnHdlr { var BSC_ConnHdlr vc_conn; + var BSC_ConnHdlrNetworkPars net_pars := { + kc_support := '0A'O, /* A5/1 and A5/3 enabled */ + expect_tmsi := true, + expect_auth := false, + expect_ciph := false + }; var BSC_ConnHdlrPars pars := { sccp_addr_own := g_sccp_addr_own, sccp_addr_peer := g_sccp_addr_peer, @@ -364,7 +370,8 @@ tmsi := omit, cm2 := valueof(ts_CM2_default), cm3 := omit, - vec := omit + vec := omit, + net := net_pars }; vc_conn := BSC_ConnHdlr.create(id); @@ -400,7 +407,7 @@ private function f_tc_lu_imsi_noauth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); - f_perform_lu(false, true, true); + f_perform_lu(true); } testcase TC_lu_imsi_noauth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -411,8 +418,9 @@ } private function f_tc_lu_imsi_noauth_notmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_tmsi := false; f_init_handler(pars); - f_perform_lu(false, false, true); + f_perform_lu(true); } testcase TC_lu_imsi_noauth_notmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -477,8 +485,9 @@ } private function f_tc_lu_imsi_auth_tmsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; f_init_handler(pars); - f_perform_lu(true, true, true); + f_perform_lu(true); } testcase TC_lu_imsi_auth_tmsi() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -532,7 +541,7 @@ cpars.mgcp_connection_id_bss := '22222'H; cpars.mgcp_connection_id_mss := '33333'H; - f_perform_lu(cpars.expect_auth, true, true); + f_perform_lu(true); f_mo_call(cpars); } testcase TC_lu_and_mo_call() runs on MTC_CT { @@ -883,7 +892,7 @@ private function f_tc_emerg_call_imsi(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); /* Then issue emergency call identified by IMSI */ f_emerg_call(valueof(ts_MI_IMSI_LV(g_pars.imsi))); } @@ -900,7 +909,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VGCS, mi)); @@ -921,7 +930,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_VBS, mi)); @@ -942,7 +951,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_SERV_REQ(CM_TYPE_LCS, mi)); @@ -963,7 +972,7 @@ f_init_handler(pars); /* First perform location update to ensure subscriber is known */ - f_perform_lu(false, true, true); + f_perform_lu(true); var MobileIdentityLV mi := valueof(ts_MI_IMSI_LV(g_pars.imsi)); var PDU_ML3_MS_NW l3_info := valueof(ts_CM_REEST_REQ(0, mi)); @@ -1019,9 +1028,12 @@ vc_conn.done; } +/* A5/1 + A5/3 permitted on network side, and MS capable to do it */ private function f_tc_lu_imsi_auth_tmsi_encr_13_13(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { + pars.net.expect_auth := true; + pars.net.expect_ciph := true; f_init_handler(pars); - f_perform_lu(true, true, true, true); + f_perform_lu(true); } testcase TC_lu_imsi_auth_tmsi_encr_13_13() runs on MTC_CT { var BSC_ConnHdlr vc_conn; @@ -1106,9 +1118,9 @@ private function f_tc_establish_and_nothing(charstring id, BSC_ConnHdlrPars pars) runs on BSC_ConnHdlr { f_init_handler(pars); - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_expect_clear(); } testcase TC_establish_and_nothing() runs on MTC_CT { @@ -1125,9 +1137,9 @@ var CallParameters cpars := valueof(t_CallParams('12345'H, 0)); - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mncc_expect(hex2str(cpars.called_party)); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1150,9 +1162,9 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mncc_expect(hex2str(cpars.called_party)); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1184,9 +1196,9 @@ var MNCC_PDU mncc; var MgcpCommand mgcp_cmd; - f_perform_lu(false, true, true, false); + f_perform_lu(true); - f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mncc_expect(hex2str(cpars.called_party)); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1246,7 +1258,7 @@ var MgcpCommand mgcp_cmd; var OCT4 tmsi; - f_perform_lu(false, true, true, false); + f_perform_lu(true); if (isvalue(g_pars.tmsi)) { tmsi := g_pars.tmsi; } else { @@ -1262,7 +1274,7 @@ /* MSC->BSC: expect PAGING from MSC */ BSSAP.receive(tr_BSSMAP_Paging(g_pars.imsi)); /* MS -> MSC: PAGING RESPONSE */ - f_establish_fully_pag(valueof(ts_MI_IMSI_LV(g_pars.imsi)), false, false); + f_establish_fully_pag(valueof(ts_MI_IMSI_LV(g_pars.imsi))); f_create_mgcp_expect(ExpectCriteria:{omit,omit,omit}); @@ -1390,7 +1402,7 @@ cpars.mgcp_connection_id_mss := '33333'H; /* Location Update to make subscriber known */ - f_perform_lu(cpars.expect_auth, true, true); + f_perform_lu(true); /* First MO call should succeed */ f_mo_call(cpars); -- To view, visit https://gerrit.osmocom.org/6144 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I01a931f1cbbca4593fff2fd12689f040ceaa79b6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 00:14:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 00:14:25 +0000 Subject: [MERGED] osmo-msc[master]: Change GSUP re-connect interval to 1s In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Change GSUP re-connect interval to 1s ...................................................................... Change GSUP re-connect interval to 1s This leads to faster recovery in case of link loss. It also makes the TTCN-3 test suite run much faster, as each test case will inherently terminate the GSUP connection. Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf --- M include/osmocom/msc/gsup_client.h 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/msc/gsup_client.h b/include/osmocom/msc/gsup_client.h index 3d1dce0..ce065a6 100644 --- a/include/osmocom/msc/gsup_client.h +++ b/include/osmocom/msc/gsup_client.h @@ -25,7 +25,10 @@ #include -#define GSUP_CLIENT_RECONNECT_INTERVAL 10 +/* a loss of GSUP between MSC and HLR is considered quite serious, let's try to recover as quickly as + * possible. Even one new connection attempt per second should be quite acceptable until the link is + * re-established */ +#define GSUP_CLIENT_RECONNECT_INTERVAL 1 #define GSUP_CLIENT_PING_INTERVAL 20 struct msgb; -- To view, visit https://gerrit.osmocom.org/6143 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I16821a26f2c6ff4d0a76926c9212127ab6f6fedf Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 02:09:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 02:09:28 +0000 Subject: [PATCH] osmo-bsc[master]: cosmetic: Remove data/len variables in bssmap_handle_assignm... Message-ID: Review at https://gerrit.osmocom.org/6146 cosmetic: Remove data/len variables in bssmap_handle_assignm_req() There's nothing wrong with passing the TLVP_VAL/TLVP_LEN directly into the gsm0808 decoder functions, let's avoid variables that get assigned and used only once - particularly with such generic names. Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 6 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/46/6146/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 67ff230..586657f 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -744,8 +744,6 @@ struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; - const uint8_t *data; - char len; if (!conn->conn) { LOGP(DMSC, LOGL_ERROR, @@ -771,9 +769,8 @@ multiplex = (conn->user_plane.cic & ~0x1f) >> 5; } else if (TLVP_PRESENT(&tp, GSM0808_IE_AOIP_TRASP_ADDR)) { /* Decode AoIP transport address element */ - data = TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR); - len = TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR); - rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, data, len); + rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR), + TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode aoip transport address.\n"); @@ -796,9 +793,8 @@ } /* Decode Speech Codec list */ - data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&scl, TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST), + TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); @@ -808,9 +804,8 @@ } /* Decode Channel Type element */ - data = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE); - len = TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE); - rc = gsm0808_dec_channel_type(&ct, data, len); + rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE), + TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n"); goto reject; -- To view, visit https://gerrit.osmocom.org/6146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 28 02:09:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 02:09:28 +0000 Subject: [PATCH] osmo-bsc[master]: bssmap_handle_assignm_req(): Decode channel type as first step Message-ID: Review at https://gerrit.osmocom.org/6147 bssmap_handle_assignm_req(): Decode channel type as first step The decision on how to further process the request depends significantly on the contents of the only mandatory IE of the ASSIGNMENT REQ. Let's decode it first. Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 16 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/47/6147/1 diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 586657f..9bd3fe9 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -761,6 +761,22 @@ goto reject; } + /* Decode Channel Type element */ + rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE), + TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE)); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n"); + goto reject; + } + + /* Currently we only support a limited subset of all + * possible channel types. The limitation ends by not using + * multi-slot, limiting the channel coding to speech */ + if (ct.ch_indctr != GSM0808_CHAN_SPEECH) { + LOGP(DMSC, LOGL_ERROR, "Unsupported channel type, currently only speech is supported!\n"); + goto reject; + } + /* Detect if a CIC code is present, if so, we use the classic ip.access * method to calculate the RTP port */ if (TLVP_PRESENT(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) { @@ -801,23 +817,6 @@ goto reject; } scl_ptr = &scl; - } - - /* Decode Channel Type element */ - rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE), - TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE)); - if (rc < 0) { - LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n"); - goto reject; - } - - /* Currently we only support a limited subset of all - * possible channel types. The limitation ends by not using - * multi-slot, limiting the channel coding to speech */ - if (ct.ch_indctr != GSM0808_CHAN_SPEECH) { - LOGP(DMSC, LOGL_ERROR, - "Unsupported channel type, currently only speech is supported!\n"); - goto reject; } /* Match codec information from the assignment command against the -- To view, visit https://gerrit.osmocom.org/6147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 28 02:09:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 02:09:28 +0000 Subject: [PATCH] osmo-bsc[master]: update.gitignore with 'tags' files and 'deps' directory Message-ID: Review at https://gerrit.osmocom.org/6148 update.gitignore with 'tags' files and 'deps' directory Change-Id: I2b51bbb4dce9757be7f2430b83b7879e24aa0df1 --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/48/6148/1 diff --git a/.gitignore b/.gitignore index 4def47a..5a09016 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,8 @@ src/utils/osmo-meas-pcap2db src/utils/osmo-meas-udp2db +tags +/deps #tests tests/testsuite.dir -- To view, visit https://gerrit.osmocom.org/6148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2b51bbb4dce9757be7f2430b83b7879e24aa0df1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Jan 28 02:20:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 02:20:40 +0000 Subject: osmo-bsc[master]: cosmetic: Remove data/len variables in bssmap_handle_assignm... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 28 02:20:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 02:20:53 +0000 Subject: osmo-bsc[master]: bssmap_handle_assignm_req(): Decode channel type as first step In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 28 02:24:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 02:24:27 +0000 Subject: [PATCH] osmo-bsc[master]: remove obsolete gsm_subscriber_connection.bts member In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/5511 to look at the new patch set (#9). remove obsolete gsm_subscriber_connection.bts member This member was merely a cache for conn->lchan->ts->trx->bts, so let's avoid having to keep copies of the same data (which needs to be kept up to date). Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c M src/libbsc/handover_logic.c M tests/bsc/bsc_test.c 4 files changed, 5 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/5511/9 diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..bdf7cfb 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -96,9 +96,6 @@ struct gsm_lchan *lchan; /* the future/allocated but not yet used lchan during HANDOVER */ struct gsm_lchan *ho_lchan; - /* a short-hand pointer to the BTS currently serving the subscriber, - * points to gsm_subscriber_connection.lchan->ts->trx->bts */ - struct gsm_bts *bts; /* timer for assignment handling */ struct osmo_timer_list T10; @@ -116,13 +113,14 @@ struct llist_head ho_penalty_timers; }; -static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { - return conn->bts; -} - #include "gsm_data_shared.h" +static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { + OSMO_ASSERT(conn->lchan); + return conn->lchan->ts->trx->bts; +} + enum { BTS_CTR_CHREQ_TOTAL, BTS_CTR_CHREQ_NO_CHANNEL, diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 27bf739..21836f3 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -274,7 +274,6 @@ conn->network = net; conn->lchan = lchan; - conn->bts = lchan->ts->trx->bts; lchan->conn = conn; INIT_LLIST_HEAD(&conn->ho_dtap_cache); INIT_LLIST_HEAD(&conn->ho_penalty_timers); @@ -873,7 +872,6 @@ conn->lchan = NULL; conn->secondary_lchan = NULL; conn->ho_lchan = NULL; - conn->bts = NULL; osmo_timer_del(&conn->T10); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..6eada5b 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -288,7 +288,6 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; - new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 1fb51aa..420ef73 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -134,7 +134,6 @@ bts->network = net; sccp_con->msc = msc; - conn->bts = bts; conn->sccp_con = sccp_con; conn->lchan = &bts->c0->ts[1].lchan[0]; -- To view, visit https://gerrit.osmocom.org/5511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 09:42:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 09:42:27 +0000 Subject: osmo-bsc[master]: remove obsolete gsm_subscriber_connection.bts member In-Reply-To: References: Message-ID: Patch Set 9: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 28 09:42:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 09:42:29 +0000 Subject: osmo-bsc[master]: update.gitignore with 'tags' files and 'deps' directory In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2b51bbb4dce9757be7f2430b83b7879e24aa0df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Jan 28 09:42:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 09:42:33 +0000 Subject: [MERGED] osmo-bsc[master]: update.gitignore with 'tags' files and 'deps' directory In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: update.gitignore with 'tags' files and 'deps' directory ...................................................................... update.gitignore with 'tags' files and 'deps' directory Change-Id: I2b51bbb4dce9757be7f2430b83b7879e24aa0df1 --- M .gitignore 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index 4def47a..5a09016 100644 --- a/.gitignore +++ b/.gitignore @@ -58,6 +58,8 @@ src/utils/osmo-meas-pcap2db src/utils/osmo-meas-udp2db +tags +/deps #tests tests/testsuite.dir -- To view, visit https://gerrit.osmocom.org/6148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2b51bbb4dce9757be7f2430b83b7879e24aa0df1 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 09:42:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 09:42:33 +0000 Subject: [MERGED] osmo-bsc[master]: remove obsolete gsm_subscriber_connection.bts member In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: remove obsolete gsm_subscriber_connection.bts member ...................................................................... remove obsolete gsm_subscriber_connection.bts member This member was merely a cache for conn->lchan->ts->trx->bts, so let's avoid having to keep copies of the same data (which needs to be kept up to date). Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0 --- M include/osmocom/bsc/gsm_data.h M src/libbsc/bsc_api.c M src/libbsc/handover_logic.c M tests/bsc/bsc_test.c 4 files changed, 5 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index d9dd2d4..bdf7cfb 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -96,9 +96,6 @@ struct gsm_lchan *lchan; /* the future/allocated but not yet used lchan during HANDOVER */ struct gsm_lchan *ho_lchan; - /* a short-hand pointer to the BTS currently serving the subscriber, - * points to gsm_subscriber_connection.lchan->ts->trx->bts */ - struct gsm_bts *bts; /* timer for assignment handling */ struct osmo_timer_list T10; @@ -116,13 +113,14 @@ struct llist_head ho_penalty_timers; }; -static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { - return conn->bts; -} - #include "gsm_data_shared.h" +static inline struct gsm_bts *conn_get_bts(struct gsm_subscriber_connection *conn) { + OSMO_ASSERT(conn->lchan); + return conn->lchan->ts->trx->bts; +} + enum { BTS_CTR_CHREQ_TOTAL, BTS_CTR_CHREQ_NO_CHANNEL, diff --git a/src/libbsc/bsc_api.c b/src/libbsc/bsc_api.c index 27bf739..21836f3 100644 --- a/src/libbsc/bsc_api.c +++ b/src/libbsc/bsc_api.c @@ -274,7 +274,6 @@ conn->network = net; conn->lchan = lchan; - conn->bts = lchan->ts->trx->bts; lchan->conn = conn; INIT_LLIST_HEAD(&conn->ho_dtap_cache); INIT_LLIST_HEAD(&conn->ho_penalty_timers); @@ -873,7 +872,6 @@ conn->lchan = NULL; conn->secondary_lchan = NULL; conn->ho_lchan = NULL; - conn->bts = NULL; osmo_timer_del(&conn->T10); diff --git a/src/libbsc/handover_logic.c b/src/libbsc/handover_logic.c index 4b86de7..6eada5b 100644 --- a/src/libbsc/handover_logic.c +++ b/src/libbsc/handover_logic.c @@ -288,7 +288,6 @@ new_lchan->conn->ho_lchan = NULL; new_lchan->conn->lchan = new_lchan; - new_lchan->conn->bts = new_lchan->ts->trx->bts; ho->old_lchan->conn = NULL; lchan_release(ho->old_lchan, 0, RSL_REL_LOCAL_END); diff --git a/tests/bsc/bsc_test.c b/tests/bsc/bsc_test.c index 1fb51aa..420ef73 100644 --- a/tests/bsc/bsc_test.c +++ b/tests/bsc/bsc_test.c @@ -134,7 +134,6 @@ bts->network = net; sccp_con->msc = msc; - conn->bts = bts; conn->sccp_con = sccp_con; conn->lchan = &bts->c0->ts[1].lchan[0]; -- To view, visit https://gerrit.osmocom.org/5511 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id3bff8b18425ef5d45eb460ac9eb620023013ba0 Gerrit-PatchSet: 9 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 09:42:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 09:42:33 +0000 Subject: [MERGED] osmo-bsc[master]: bssmap_handle_assignm_req(): Decode channel type as first step In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bssmap_handle_assignm_req(): Decode channel type as first step ...................................................................... bssmap_handle_assignm_req(): Decode channel type as first step The decision on how to further process the request depends significantly on the contents of the only mandatory IE of the ASSIGNMENT REQ. Let's decode it first. Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 16 insertions(+), 17 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 586657f..9bd3fe9 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -761,6 +761,22 @@ goto reject; } + /* Decode Channel Type element */ + rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE), + TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE)); + if (rc < 0) { + LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n"); + goto reject; + } + + /* Currently we only support a limited subset of all + * possible channel types. The limitation ends by not using + * multi-slot, limiting the channel coding to speech */ + if (ct.ch_indctr != GSM0808_CHAN_SPEECH) { + LOGP(DMSC, LOGL_ERROR, "Unsupported channel type, currently only speech is supported!\n"); + goto reject; + } + /* Detect if a CIC code is present, if so, we use the classic ip.access * method to calculate the RTP port */ if (TLVP_PRESENT(&tp, GSM0808_IE_CIRCUIT_IDENTITY_CODE)) { @@ -801,23 +817,6 @@ goto reject; } scl_ptr = &scl; - } - - /* Decode Channel Type element */ - rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE), - TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE)); - if (rc < 0) { - LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n"); - goto reject; - } - - /* Currently we only support a limited subset of all - * possible channel types. The limitation ends by not using - * multi-slot, limiting the channel coding to speech */ - if (ct.ch_indctr != GSM0808_CHAN_SPEECH) { - LOGP(DMSC, LOGL_ERROR, - "Unsupported channel type, currently only speech is supported!\n"); - goto reject; } /* Match codec information from the assignment command against the -- To view, visit https://gerrit.osmocom.org/6147 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I030b5ad6f4fc33da9155c8a6061fd982312b20fb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 09:42:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 28 Jan 2018 09:42:34 +0000 Subject: [MERGED] osmo-bsc[master]: cosmetic: Remove data/len variables in bssmap_handle_assignm... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: Remove data/len variables in bssmap_handle_assignm_req() ...................................................................... cosmetic: Remove data/len variables in bssmap_handle_assignm_req() There's nothing wrong with passing the TLVP_VAL/TLVP_LEN directly into the gsm0808 decoder functions, let's avoid variables that get assigned and used only once - particularly with such generic names. Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669 --- M src/osmo-bsc/osmo_bsc_bssap.c 1 file changed, 6 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c index 67ff230..586657f 100644 --- a/src/osmo-bsc/osmo_bsc_bssap.c +++ b/src/osmo-bsc/osmo_bsc_bssap.c @@ -744,8 +744,6 @@ struct gsm0808_speech_codec_list scl; struct gsm0808_speech_codec_list *scl_ptr = NULL; int rc; - const uint8_t *data; - char len; if (!conn->conn) { LOGP(DMSC, LOGL_ERROR, @@ -771,9 +769,8 @@ multiplex = (conn->user_plane.cic & ~0x1f) >> 5; } else if (TLVP_PRESENT(&tp, GSM0808_IE_AOIP_TRASP_ADDR)) { /* Decode AoIP transport address element */ - data = TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR); - len = TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR); - rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, data, len); + rc = gsm0808_dec_aoip_trasp_addr(&rtp_addr, TLVP_VAL(&tp, GSM0808_IE_AOIP_TRASP_ADDR), + TLVP_LEN(&tp, GSM0808_IE_AOIP_TRASP_ADDR)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode aoip transport address.\n"); @@ -796,9 +793,8 @@ } /* Decode Speech Codec list */ - data = TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - len = TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST); - rc = gsm0808_dec_speech_codec_list(&scl, data, len); + rc = gsm0808_dec_speech_codec_list(&scl, TLVP_VAL(&tp, GSM0808_IE_SPEECH_CODEC_LIST), + TLVP_LEN(&tp, GSM0808_IE_SPEECH_CODEC_LIST)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "Unable to decode speech codec list\n"); @@ -808,9 +804,8 @@ } /* Decode Channel Type element */ - data = TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE); - len = TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE); - rc = gsm0808_dec_channel_type(&ct, data, len); + rc = gsm0808_dec_channel_type(&ct, TLVP_VAL(&tp, GSM0808_IE_CHANNEL_TYPE), + TLVP_LEN(&tp, GSM0808_IE_CHANNEL_TYPE)); if (rc < 0) { LOGP(DMSC, LOGL_ERROR, "unable to decode channel type.\n"); goto reject; -- To view, visit https://gerrit.osmocom.org/6146 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8557b4a9ff4de28b76c7d618631a4700176a8669 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Jan 28 15:27:28 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Sun, 28 Jan 2018 15:27:28 +0000 Subject: [PATCH] osmo-hlr[master]: cover all build artifacts in .gitignore Message-ID: Review at https://gerrit.osmocom.org/6149 cover all build artifacts in .gitignore Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915 --- M .gitignore 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/6149/1 diff --git a/.gitignore b/.gitignore index 72f11a1..d65cb68 100644 --- a/.gitignore +++ b/.gitignore @@ -22,10 +22,15 @@ missing .deps -src/osmo-hlr src/db_test +src/db_bootstrap.h +src/osmo-hlr +src/osmo-hlr-db-tool +tests/atconfig tests/testsuite tests/auc/auc_3g_test tests/auc/auc_ts_55_205_test_sets.c tests/auc/auc_ts_55_205_test_sets +tests/auc/auc_test +tests/gsup_server/gsup_server_test -- To view, visit https://gerrit.osmocom.org/6149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Alexander Huemer From gerrit-no-reply at lists.osmocom.org Sun Jan 28 21:57:48 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 28 Jan 2018 21:57:48 +0000 Subject: osmo-bts[master]: rsl: do not allow MODE MODIFY request with unsupp. codec/rate In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6097/1/src/common/bts.c File src/common/bts.c: Line 693: for (i = 0;; i++) { > This way: (i = 0; i < _GSM_PCHAN_MAX; i++) Oops, I was mistaken. As the size of bts->support.cm array is different for different BTS models, you may use the ARRAY_SIZE: for (i = 0; i < ARRAY_SIZE(bts->support.cm); i++) ... -- To view, visit https://gerrit.osmocom.org/6097 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Jan 28 22:03:14 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 28 Jan 2018 22:03:14 +0000 Subject: osmo-hlr[master]: cover all build artifacts in .gitignore In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6149/1//COMMIT_MSG Commit Message: Line 7: cover all build artifacts in .gitignore This sounds like you've invented a way to ignore *all* build products once and for all... My suggestion is: Add missing build products to .gitignore. -- To view, visit https://gerrit.osmocom.org/6149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915 Gerrit-PatchSet: 1 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Jan 29 08:31:21 2018 From: gerrit-no-reply at lists.osmocom.org (Alexander Huemer) Date: Mon, 29 Jan 2018 08:31:21 +0000 Subject: [PATCH] osmo-hlr[master]: Add missing build products in .gitignore In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6149 to look at the new patch set (#2). Add missing build products in .gitignore Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915 --- M .gitignore 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/49/6149/2 diff --git a/.gitignore b/.gitignore index 72f11a1..d65cb68 100644 --- a/.gitignore +++ b/.gitignore @@ -22,10 +22,15 @@ missing .deps -src/osmo-hlr src/db_test +src/db_bootstrap.h +src/osmo-hlr +src/osmo-hlr-db-tool +tests/atconfig tests/testsuite tests/auc/auc_3g_test tests/auc/auc_ts_55_205_test_sets.c tests/auc/auc_ts_55_205_test_sets +tests/auc/auc_test +tests/gsup_server/gsup_server_test -- To view, visit https://gerrit.osmocom.org/6149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Mon Jan 29 09:56:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 09:56:39 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward... Message-ID: Review at https://gerrit.osmocom.org/6150 Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue" This reverts commit 4a22ac7d2c0b24dba1939760121381e83827aa57. Issue has been fixed in OS#2354, osmo-msc 1e67fea7ba5c6336066b78f98a28ab33b05c36c4. Change-Id: I83d857c639db35abcd05bc87db9962d092c10eca --- M suites/aoip_smpp/esme_ms_sms_storeforward.py 1 file changed, 6 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/50/6150/1 diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 9effe6d..543170e 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -42,18 +42,17 @@ msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_STOREFORWARD) -# Disabled due to known issue, see ticket OsmoSMSC #2354 -#print('sending sms, it will be stored...') -#msg = Sms(esme.msisdn, ms.msisdn, 'smpp send not-yet-registered message') -#umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +print('sending sms, it will be stored...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send not-yet-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) print('MS registers and will receive the SMS...') ms.connect(msc.mcc_mnc()) wait(ms.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, ms) -#wait(ms.sms_was_received, msg) -#print('Waiting to receive and consume sms receipt with reference', umref) -#wait(esme.receipt_was_received, umref) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) print('checking MS can receive SMS while registered...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') -- To view, visit https://gerrit.osmocom.org/6150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I83d857c639db35abcd05bc87db9962d092c10eca 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 Jan 29 10:52:08 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 10:52:08 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: start-testsuite.sh: Add archlinux tccn3 path to LD_LIBRARY_PATH Message-ID: Review at https://gerrit.osmocom.org/6151 start-testsuite.sh: Add archlinux tccn3 path to LD_LIBRARY_PATH Archlinux installs ttcn33 libaries in /usr/ttcn3/lib (titan-git package from AUR). Change-Id: I99219f4ab36c82e562ef3fed047d3c52d64497f1 --- M start-testsuite.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/51/6151/1 diff --git a/start-testsuite.sh b/start-testsuite.sh index 87cf08b..a291a4f 100755 --- a/start-testsuite.sh +++ b/start-testsuite.sh @@ -15,4 +15,4 @@ CFG=$2 fi -LD_LIBRARY_PATH=`dirname $SUITE`:/usr/lib/titan ttcn3_start $SUITE $CFG +LD_LIBRARY_PATH=`dirname $SUITE`:/usr/lib/titan:/usr/ttcn3/lib ttcn3_start $SUITE $CFG -- To view, visit https://gerrit.osmocom.org/6151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I99219f4ab36c82e562ef3fed047d3c52d64497f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 10:52:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 10:52:10 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: regen-makefile.sh: Support Archlinux install paths Message-ID: Review at https://gerrit.osmocom.org/6152 regen-makefile.sh: Support Archlinux install paths Archlinux (titan-git AUR package) installs everything (includes, libs and bin) into /usr/ttcn/ prefix. Change-Id: I545f2f04890310e98233b04b44c4614df34f2f17 --- M regen-makefile.sh 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/52/6152/1 diff --git a/regen-makefile.sh b/regen-makefile.sh index f757fa3..e89b3ee 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -20,5 +20,9 @@ sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -DMAKEDEPEND_RUN -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile # for TITAN 6.3.0 -sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile +if cat /etc/issue | grep "Arch Linux" >/dev/null 2>&1; then + sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr\/ttcn3/' Makefile +else + sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile +fi sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile -- To view, visit https://gerrit.osmocom.org/6152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I545f2f04890310e98233b04b44c4614df34f2f17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 10:52:10 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 10:52:10 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: regen-makefile.sh: Exit with clear error if ttcn3 bin not found Message-ID: Review at https://gerrit.osmocom.org/6153 regen-makefile.sh: Exit with clear error if ttcn3 bin not found Change-Id: I866a758ec472968f368866e3b3b24dc6f14ac7cb --- M regen-makefile.sh 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/53/6153/1 diff --git a/regen-makefile.sh b/regen-makefile.sh index e89b3ee..7edd783 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -10,6 +10,8 @@ # unstable, so far tested with TITAN 6.1.0, 6.2.0 and 6.3.0 # +test -x "$(which ttcn3_makefilegen 2>/dev/null)" || { echo "ERROR: ttcn3_makefilegen not in PATH"; exit 1; } + ttcn3_makefilegen -l -f $* sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile -- To view, visit https://gerrit.osmocom.org/6153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I866a758ec472968f368866e3b3b24dc6f14ac7cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 10:55:36 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 10:55:36 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: gitignore: Ignore dependency subdirs Message-ID: Review at https://gerrit.osmocom.org/6154 gitignore: Ignore dependency subdirs Change-Id: I843da5c51d68102b992ce178404d8601c520229f --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/54/6154/1 diff --git a/.gitignore b/.gitignore index d525ada..d8c3ab3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/*.cc bin/*.hh +deps/*/ *.o *.log *.so -- To view, visit https://gerrit.osmocom.org/6154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I843da5c51d68102b992ce178404d8601c520229f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 11:11:56 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 11:11:56 +0000 Subject: osmo-gsm-tester[master]: Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I83d857c639db35abcd05bc87db9962d092c10eca 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-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 11:11:59 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 11:11:59 +0000 Subject: [MERGED] osmo-gsm-tester[master]: Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward... In-Reply-To: References: Message-ID: Pau Espin Pedrol has submitted this change and it was merged. Change subject: Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue" ...................................................................... Revert "aoip_smpp: Disable check in esme_ms_sms_storeforward due to known issue" This reverts commit 4a22ac7d2c0b24dba1939760121381e83827aa57. Issue has been fixed in OS#2354, osmo-msc 1e67fea7ba5c6336066b78f98a28ab33b05c36c4. Change-Id: I83d857c639db35abcd05bc87db9962d092c10eca --- M suites/aoip_smpp/esme_ms_sms_storeforward.py 1 file changed, 6 insertions(+), 7 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, approved Jenkins Builder: Verified diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 9effe6d..543170e 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -42,18 +42,17 @@ msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_STOREFORWARD) -# Disabled due to known issue, see ticket OsmoSMSC #2354 -#print('sending sms, it will be stored...') -#msg = Sms(esme.msisdn, ms.msisdn, 'smpp send not-yet-registered message') -#umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) +print('sending sms, it will be stored...') +msg = Sms(esme.msisdn, ms.msisdn, 'smpp send not-yet-registered message') +umref = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) print('MS registers and will receive the SMS...') ms.connect(msc.mcc_mnc()) wait(ms.is_connected, msc.mcc_mnc()) wait(msc.subscriber_attached, ms) -#wait(ms.sms_was_received, msg) -#print('Waiting to receive and consume sms receipt with reference', umref) -#wait(esme.receipt_was_received, umref) +wait(ms.sms_was_received, msg) +print('Waiting to receive and consume sms receipt with reference', umref) +wait(esme.receipt_was_received, umref) print('checking MS can receive SMS while registered...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send already-registered message') -- To view, visit https://gerrit.osmocom.org/6150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I83d857c639db35abcd05bc87db9962d092c10eca 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-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Mon Jan 29 11:52:02 2018 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Mon, 29 Jan 2018 11:52:02 +0000 Subject: osmo-hlr[master]: Add missing build products in .gitignore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6149 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48b93adc280c1b0521e7f5acc1f66ce5db462915 Gerrit-PatchSet: 2 Gerrit-Project: osmo-hlr Gerrit-Branch: master Gerrit-Owner: Alexander Huemer Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 12:09:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 12:09:51 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Configure expected GGSN DNS values and improve e... Message-ID: Review at https://gerrit.osmocom.org/6155 ggsn_tests: Configure expected GGSN DNS values and improve error message Change-Id: Ie64ca0b4cda22fd358c8c304d5b3909fd9685948 --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 15 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/55/6155/1 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index e97578c..90368b9 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -14,8 +14,10 @@ [MODULE_PARAMETERS] GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1" GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1" -GGSN_Tests.m_ggsn_ip_gtpc := "127.0.23.1" -GGSN_Tests.m_ggsn_ip_gtpu := "127.0.23.1" +GGSN_Tests.m_ggsn_ip_gtpc := "127.0.0.2" +GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2" +GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1" +GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8" [EXECUTE] #GGSN_Tests.TC_dummy diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 23e7054..06d9dcf 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -23,6 +23,9 @@ charstring m_ggsn_ip_gtpc := "127.0.0.6"; charstring m_ggsn_ip_gtpu := "127.0.0.6"; + + charstring m_ggsn_ip4_dns1 := "192.168.100.1" + charstring m_ggsn_ip4_dns2 := "8.8.8.8" } type set PdpContext { @@ -954,6 +957,8 @@ /* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP */ testcase TC_pdp4_act_deact_ipcp() runs on GT_CT { f_init(); + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); ctx.pco_req := valueof(ts_PCO_IPv4_DNS_IPCP); f_pdp_ctx_act(ctx); @@ -963,8 +968,12 @@ } /* verify IPCP contains both primary and secondary DNS */ var IpcpPacket ipcp := dec_IpcpPacket(f_PCO_extract_proto(ctx.pco_neg, '8021'O)); - if (not match(ipcp, tr_IPCP_Ack_DNS(0, 'C0A86401'O, '08080808'O))) { - setverdict(fail, "Primary/Secondary DNS not found in IPCP"); + if (not match(ipcp, tr_IPCP_Ack_DNS(0, ggsn_ip4_dns1, ggsn_ip4_dns2))) { + if (not match(ipcp, tr_IPCP_Ack_DNS(0))) { + setverdict(fail, "Primary/Secondary DNS PCO IPCP option not found"); + } else { + setverdict(fail, "Primary/Secondary DNS PCO IPCP option found but not matching expected values"); + } } f_pdp_ctx_del(ctx, '1'B); } -- To view, visit https://gerrit.osmocom.org/6155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie64ca0b4cda22fd358c8c304d5b3909fd9685948 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 14:19:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 14:19:39 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: library: Implement f_inet6_addr function Message-ID: Review at https://gerrit.osmocom.org/6156 library: Implement f_inet6_addr function It can be used to parse IPv6 functions, since inet_addr supports IPv4 only. Change-Id: Icb6dd38462501895d1b4409a3c530793917bd803 --- M library/Native_FunctionDefs.cc M library/Native_Functions.ttcn 2 files changed, 18 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/56/6156/1 diff --git a/library/Native_FunctionDefs.cc b/library/Native_FunctionDefs.cc index 5dda08c..8aa31b4 100644 --- a/library/Native_FunctionDefs.cc +++ b/library/Native_FunctionDefs.cc @@ -7,12 +7,28 @@ #include #include #include +#include +#include +#include #include #include namespace Native__Functions { +OCTETSTRING f__inet6__addr(const CHARSTRING& in) +{ + char buf[INET6_ADDRSTRLEN]; + TTCN_Buffer ttcn_buffer(in); + int ret; + + ret = inet_pton(AF_INET6, (const char *)ttcn_buffer.get_data(), buf); + if(ret < 1) + fprintf(stderr, "inet_pton failed: %d %s\n", ret, strerror(errno)); + + return OCTETSTRING(16, (const unsigned char *)&buf[0]); +} + OCTETSTRING f__inet__addr(const CHARSTRING& in) { TTCN_Buffer ttcn_buffer(in); diff --git a/library/Native_Functions.ttcn b/library/Native_Functions.ttcn index 31bc767..d59670a 100644 --- a/library/Native_Functions.ttcn +++ b/library/Native_Functions.ttcn @@ -1,5 +1,7 @@ module Native_Functions { + /* direct import of inet_pton(AF_INET6) C function, returns net byte order */ + external function f_inet6_addr(in charstring ch) return octetstring; /* direct import of inet_addr() C function, returns net byte order */ external function f_inet_addr(in charstring ch) return octetstring; /* like inet_addr() but return is host byte order */ -- To view, visit https://gerrit.osmocom.org/6156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icb6dd38462501895d1b4409a3c530793917bd803 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 17:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:06:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#10). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 90 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/10 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index fa3f788..7aecf09 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -50,6 +50,21 @@ return buf; } +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) +{ + int i; + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) + buf[i] = set_char; +} + +static void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); +} + static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; @@ -658,6 +673,75 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + ts_format(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -841,50 +925,16 @@ /* Step 4: Update MS and TBF and really allocate the resources */ - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index c673af6..98ec04b 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -5906,7 +5906,7 @@ Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu 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 Mon Jan 29 17:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:06:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split allocation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3906 to look at the new patch set (#12). Simplify TS alloc: split allocation * generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 95 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3906/12 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 7aecf09..ce4dc46 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -742,6 +742,87 @@ } } +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (ts < 0) + ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (ts < 0) + return ffs(ret); + + return ret & (1 << ts); +} + +/*! Find set of timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \returns negative error code or selected TS on success + */ +static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx *trx, bool single, + uint8_t ul_slots, uint8_t dl_slots, + uint8_t reserved_ul_slots, uint8_t reserved_dl_slots, + int8_t first_common_ts) +{ + uint8_t sl = tbf->direction != GPRS_RLCMAC_DL_TBF ? ul_slots : dl_slots; + char slot_info[9] = { 0 }; + + if (single) + sl = get_single_ts(trx, tbf, dl_slots, ul_slots, first_common_ts); + + if (!sl) { + LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n", + tbf->direction != GPRS_RLCMAC_DL_TBF ? "uplink" : "downlink"); + return -EINVAL; + } + + if (tbf->direction != GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, sl, 'U'); + LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected UL"); + } else { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, sl, 'D'); + LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); + } + + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + + return sl; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -764,7 +845,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; @@ -816,86 +896,43 @@ reserved_dl_slots = dl_slots; reserved_ul_slots = ul_slots; - /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + dl_slots = rc; + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { int free_usf = -1; + + ul_slots = rc; if (first_common_ts >= 0) ul_slots = 1 << first_common_ts; else ul_slots = ul_slots & dl_slots; - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); if (free_usf < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); return -EBUSY; } + OSMO_ASSERT(ts >= 0 && ts <= 8); + /* We will stick to that single UL slot, unreserve the others */ ul_slots = 1 << ts; usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; - - /* We will stick to that single UL slot, unreserve the others */ reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } first_common_ts = ffs(dl_slots & ul_slots) - 1; -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 17:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:06:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split off RX mask computation 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/3913 to look at the new patch set (#8). Simplify TS alloc: split off RX mask computation Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/tbf/TbfTest.err 4 files changed, 55 insertions(+), 47 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/8 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 438ec93..fa3f788 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -533,44 +533,24 @@ */ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { - uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ - uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ - uint8_t Type; /* Type of Mobile */ + uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ + Sum = mslot_class_get_sum(mslot_class); /* Max number of Tx + Rx slots */ uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; int16_t rx_window, tx_window; - static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; - enum {MASK_TT, MASK_TR}; + int max_capacity = -1; + uint8_t max_ul_slots = 0; + uint8_t max_dl_slots = 0; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", mslot_class); - - Tx = mslot_class_get_tx(mslot_class); - Sum = mslot_class_get_sum(mslot_class); - Tta = mslot_class_get_ta(mslot_class); - Ttb = mslot_class_get_tb(mslot_class); - - /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly - see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ - Tra = mslot_class_get_ra(mslot_class, 0); - Trb = mslot_class_get_rb(mslot_class, 0); - - Type = mslot_class_get_type(mslot_class); if (Tx == MS_NA) { LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not applicable.\n", mslot_class); return -EINVAL; } - - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", mslot_class_get_rx(mslot_class), Tx, - (Sum == MS_NA) ? "N/A" : digit[Sum], - (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); max_slots = OSMO_MAX(mslot_class_get_rx(mslot_class), Tx); @@ -593,29 +573,12 @@ /* Check for each UL (TX) slot */ - max_capacity = -1; - max_ul_slots = 0; - max_dl_slots = 0; - /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= mslot_class_get_tx(mslot_class); num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; + uint8_t rx_mask[MASK_TR + 1]; - uint8_t rx_mask[MASK_TR+1]; - if (Type == 1) { - rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; - rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); - rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); - } else { - /* Class type 2 MS have independant RX and TX */ - rx_mask[MASK_TT] = 0xff; - rx_mask[MASK_TR] = 0xff; - } - - rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); - rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); + mslot_fill_rx_mask(mslot_class, num_tx, rx_mask); /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { diff --git a/src/mslot_class.c b/src/mslot_class.c index f8441e4..24f6de6 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -205,3 +206,44 @@ return rx_good & rx_valid_win; } + +/*! Fill in RX mask table for a given MS Class + * + * \param[in] ms_cl MS Class pointer + * \param[in] num_tx Number of TX slots to consider + * \param[out] rx_mask RX mask table + */ +void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask) +{ + static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; + uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ + Sum = mslot_class_get_sum(mslot_class), /* Max number of Tx + Rx slots */ + Type = mslot_class_get_type(mslot_class), /* Type of Mobile */ + Tta = mslot_class_get_ta(mslot_class), /* Minimum number of slots */ + Ttb = mslot_class_get_tb(mslot_class), + /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly + see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ + Tra = mslot_class_get_ra(mslot_class, 0), + Trb = mslot_class_get_rb(mslot_class, 0); + + if (num_tx == 1) /* it's enough to log this once per TX slot set iteration */ + LOGP(DRLCMAC, LOGL_DEBUG, + "Rx=%d Tx=%d Sum Rx+Tx=%s, Tta=%s Ttb=%d, Tra=%d Trb=%d, Type=%d\n", + mslot_class_get_rx(mslot_class), Tx, + (Sum == MS_NA) ? "N/A" : digit[Sum], + (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); + + if (Type == 1) { + rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; + rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); + rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + } else { + /* Class type 2 MS have independant RX and TX */ + rx_mask[MASK_TT] = 0xff; + rx_mask[MASK_TR] = 0xff; + } + + rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); + rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); +} diff --git a/src/mslot_class.h b/src/mslot_class.h index 7e8bcfa..0c23afd 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -36,6 +36,8 @@ #define DEFAULT_MSLOT_CLASS 12 +enum { MASK_TT = 0, MASK_TR = 1 }; + /* multislot class selection routines */ uint8_t mslot_class_get_ta(uint8_t ms_cl); uint8_t mslot_class_get_tb(uint8_t ms_cl); @@ -51,3 +53,4 @@ uint16_t mslot_wrap_window(uint16_t win); bool mslot_test_and_set_bit(uint32_t *bits, size_t elem); int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win); +void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index d207a1d..c673af6 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3011,12 +3011,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -3050,12 +3050,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -5898,12 +5898,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 11 -- Rx=4 Tx=3 Sum Rx+Tx=5 Tta=3 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"....C..."(TS=7) -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 17:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:06:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#8). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 3 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/8 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 707aca5..5cebed4 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -36,20 +36,6 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) -{ - int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) - buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } - - return buf; -} - static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; @@ -588,11 +574,9 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_format(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Mon Jan 29 17:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:06:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: separate capacity computation 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/3934 to look at the new patch set (#6). Simplify TS alloc: separate capacity computation Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 32 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/3934/6 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index af4d011..438ec93 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -496,6 +496,33 @@ return false; } +/*! Compute capacity of a given TRX + * + * \param[in] trx Pointer to TRX object + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \returns non-negative capacity + */ +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +{ + const struct gprs_rlcmac_pdch *pdch; + unsigned ts, capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF), 1); + + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF), 1); + } + } + + return capacity; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -620,7 +647,6 @@ /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned ts; int capacity; rx_window = mslot_filter_bad(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); @@ -631,25 +657,7 @@ continue; /* Compute capacity */ - capacity = 0; - - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - } - } + capacity = compute_capacity(trx, rx_window, tx_window); #ifdef ENABLE_TS_ALLOC_DEBUG LOGP(DRLCMAC, LOGL_DEBUG, @@ -670,7 +678,10 @@ max_capacity = capacity; max_ul_slots = tx_window; max_dl_slots = rx_window; - }}}} + } + } + } + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 17:06:19 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:06:19 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3935 to look at the new patch set (#6). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. Add corresponding tests. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/MslotTest.cpp M tests/alloc/MslotTest.ok 5 files changed, 627 insertions(+), 122 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/6 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e394a6e..af4d011 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -50,14 +50,6 @@ return buf; } -static bool test_and_set_bit(uint32_t *bits, size_t elem) -{ - bool was_set = bits[elem/32] & (1 << (elem % 32)); - bits[elem/32] |= (1 << (elem % 32)); - - return was_set; -} - static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; @@ -93,11 +85,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -375,7 +367,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -452,6 +444,58 @@ return 0; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(uint8_t mslot_class, bool check_tr, + int16_t rx_window, int16_t tx_window, + uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots, + rx_slot_count = pcu_bitcount(rx_window), + tx_slot_count = pcu_bitcount(tx_window); + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the mslot_test_and_set_bit shortcut. */ + if (mslot_class_get_type(mslot_class) == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (mslot_test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (mslot_class_get_type(mslot_class) == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -465,18 +509,14 @@ uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ uint8_t Type; /* Type of Mobile */ - int rx_window, tx_window, pdch_slots; + uint8_t max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; int max_capacity; uint8_t max_ul_slots; uint8_t max_dl_slots; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; enum {MASK_TT, MASK_TR}; - unsigned mask_sel; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", @@ -552,13 +592,11 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = mslot_wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -573,10 +611,7 @@ if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) continue; - tx_slot_count = pcu_bitcount(tx_window); - - max_rx = OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { @@ -585,108 +620,15 @@ /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; unsigned ts; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; - - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); - -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (Type == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) + rx_window = mslot_filter_bad(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) continue; - if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (Type == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif - continue; - } + if (skip_slot(mslot_class, mask_sel != MASK_TT, rx_window, tx_window, checked_rx)) + continue; /* Compute capacity */ capacity = 0; diff --git a/src/mslot_class.c b/src/mslot_class.c index 12d6d9e..f8441e4 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -170,3 +170,38 @@ { return get_mslot_table(ms_cl)->type; } + +uint16_t mslot_wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + +bool mslot_test_and_set_bit(uint32_t *bits, size_t elem) +{ + bool was_set = bits[elem/32] & (1 << (elem % 32)); + bits[elem/32] |= (1 << (elem % 32)); + + return was_set; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xFF & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xFF; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} diff --git a/src/mslot_class.h b/src/mslot_class.h index a6366fc..7e8bcfa 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -46,3 +46,8 @@ uint8_t mslot_class_get_sum(uint8_t ms_cl); uint8_t mslot_class_get_type(uint8_t ms_cl); uint8_t mslot_class_max(); + +/* multislot allocation helper routines */ +uint16_t mslot_wrap_window(uint16_t win); +bool mslot_test_and_set_bit(uint32_t *bits, size_t elem); +int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win); diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp index 1fa28bf..92f92fa 100644 --- a/tests/alloc/MslotTest.cpp +++ b/tests/alloc/MslotTest.cpp @@ -27,6 +27,7 @@ #include extern "C" { + #include "mslot_class.h" #include #include #include @@ -137,6 +138,13 @@ test_all_classes(trx, seq); } +static inline void test_window_wrapper() +{ + uint16_t i; + for (i = 0; i < 256 * 2 + 1; i++) + printf("W[%03u] -> %3u %s\n", + i, mslot_wrap_window(i), mslot_wrap_window(i) < 256 ? "OK" : "FAIL"); +} int main(int argc, char **argv) { @@ -163,6 +171,8 @@ test_multislot_ends(true); test_multislot_ends(false); + test_window_wrapper(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok index 86526bf..a47cf57 100644 --- a/tests/alloc/MslotTest.ok +++ b/tests/alloc/MslotTest.ok @@ -1730,3 +1730,516 @@ [ACC] multislot class 44 - UL: .......1 DL: .......1 [0] [ACC] multislot class 45 - UL: .......1 DL: .......1 [0] [ACC] multislot class 46 - UL: .......1 DL: .......1 [-22] +W[000] -> 0 OK +W[001] -> 1 OK +W[002] -> 2 OK +W[003] -> 3 OK +W[004] -> 4 OK +W[005] -> 5 OK +W[006] -> 6 OK +W[007] -> 7 OK +W[008] -> 8 OK +W[009] -> 9 OK +W[010] -> 10 OK +W[011] -> 11 OK +W[012] -> 12 OK +W[013] -> 13 OK +W[014] -> 14 OK +W[015] -> 15 OK +W[016] -> 16 OK +W[017] -> 17 OK +W[018] -> 18 OK +W[019] -> 19 OK +W[020] -> 20 OK +W[021] -> 21 OK +W[022] -> 22 OK +W[023] -> 23 OK +W[024] -> 24 OK +W[025] -> 25 OK +W[026] -> 26 OK +W[027] -> 27 OK +W[028] -> 28 OK +W[029] -> 29 OK +W[030] -> 30 OK +W[031] -> 31 OK +W[032] -> 32 OK +W[033] -> 33 OK +W[034] -> 34 OK +W[035] -> 35 OK +W[036] -> 36 OK +W[037] -> 37 OK +W[038] -> 38 OK +W[039] -> 39 OK +W[040] -> 40 OK +W[041] -> 41 OK +W[042] -> 42 OK +W[043] -> 43 OK +W[044] -> 44 OK +W[045] -> 45 OK +W[046] -> 46 OK +W[047] -> 47 OK +W[048] -> 48 OK +W[049] -> 49 OK +W[050] -> 50 OK +W[051] -> 51 OK +W[052] -> 52 OK +W[053] -> 53 OK +W[054] -> 54 OK +W[055] -> 55 OK +W[056] -> 56 OK +W[057] -> 57 OK +W[058] -> 58 OK +W[059] -> 59 OK +W[060] -> 60 OK +W[061] -> 61 OK +W[062] -> 62 OK +W[063] -> 63 OK +W[064] -> 64 OK +W[065] -> 65 OK +W[066] -> 66 OK +W[067] -> 67 OK +W[068] -> 68 OK +W[069] -> 69 OK +W[070] -> 70 OK +W[071] -> 71 OK +W[072] -> 72 OK +W[073] -> 73 OK +W[074] -> 74 OK +W[075] -> 75 OK +W[076] -> 76 OK +W[077] -> 77 OK +W[078] -> 78 OK +W[079] -> 79 OK +W[080] -> 80 OK +W[081] -> 81 OK +W[082] -> 82 OK +W[083] -> 83 OK +W[084] -> 84 OK +W[085] -> 85 OK +W[086] -> 86 OK +W[087] -> 87 OK +W[088] -> 88 OK +W[089] -> 89 OK +W[090] -> 90 OK +W[091] -> 91 OK +W[092] -> 92 OK +W[093] -> 93 OK +W[094] -> 94 OK +W[095] -> 95 OK +W[096] -> 96 OK +W[097] -> 97 OK +W[098] -> 98 OK +W[099] -> 99 OK +W[100] -> 100 OK +W[101] -> 101 OK +W[102] -> 102 OK +W[103] -> 103 OK +W[104] -> 104 OK +W[105] -> 105 OK +W[106] -> 106 OK +W[107] -> 107 OK +W[108] -> 108 OK +W[109] -> 109 OK +W[110] -> 110 OK +W[111] -> 111 OK +W[112] -> 112 OK +W[113] -> 113 OK +W[114] -> 114 OK +W[115] -> 115 OK +W[116] -> 116 OK +W[117] -> 117 OK +W[118] -> 118 OK +W[119] -> 119 OK +W[120] -> 120 OK +W[121] -> 121 OK +W[122] -> 122 OK +W[123] -> 123 OK +W[124] -> 124 OK +W[125] -> 125 OK +W[126] -> 126 OK +W[127] -> 127 OK +W[128] -> 128 OK +W[129] -> 129 OK +W[130] -> 130 OK +W[131] -> 131 OK +W[132] -> 132 OK +W[133] -> 133 OK +W[134] -> 134 OK +W[135] -> 135 OK +W[136] -> 136 OK +W[137] -> 137 OK +W[138] -> 138 OK +W[139] -> 139 OK +W[140] -> 140 OK +W[141] -> 141 OK +W[142] -> 142 OK +W[143] -> 143 OK +W[144] -> 144 OK +W[145] -> 145 OK +W[146] -> 146 OK +W[147] -> 147 OK +W[148] -> 148 OK +W[149] -> 149 OK +W[150] -> 150 OK +W[151] -> 151 OK +W[152] -> 152 OK +W[153] -> 153 OK +W[154] -> 154 OK +W[155] -> 155 OK +W[156] -> 156 OK +W[157] -> 157 OK +W[158] -> 158 OK +W[159] -> 159 OK +W[160] -> 160 OK +W[161] -> 161 OK +W[162] -> 162 OK +W[163] -> 163 OK +W[164] -> 164 OK +W[165] -> 165 OK +W[166] -> 166 OK +W[167] -> 167 OK +W[168] -> 168 OK +W[169] -> 169 OK +W[170] -> 170 OK +W[171] -> 171 OK +W[172] -> 172 OK +W[173] -> 173 OK +W[174] -> 174 OK +W[175] -> 175 OK +W[176] -> 176 OK +W[177] -> 177 OK +W[178] -> 178 OK +W[179] -> 179 OK +W[180] -> 180 OK +W[181] -> 181 OK +W[182] -> 182 OK +W[183] -> 183 OK +W[184] -> 184 OK +W[185] -> 185 OK +W[186] -> 186 OK +W[187] -> 187 OK +W[188] -> 188 OK +W[189] -> 189 OK +W[190] -> 190 OK +W[191] -> 191 OK +W[192] -> 192 OK +W[193] -> 193 OK +W[194] -> 194 OK +W[195] -> 195 OK +W[196] -> 196 OK +W[197] -> 197 OK +W[198] -> 198 OK +W[199] -> 199 OK +W[200] -> 200 OK +W[201] -> 201 OK +W[202] -> 202 OK +W[203] -> 203 OK +W[204] -> 204 OK +W[205] -> 205 OK +W[206] -> 206 OK +W[207] -> 207 OK +W[208] -> 208 OK +W[209] -> 209 OK +W[210] -> 210 OK +W[211] -> 211 OK +W[212] -> 212 OK +W[213] -> 213 OK +W[214] -> 214 OK +W[215] -> 215 OK +W[216] -> 216 OK +W[217] -> 217 OK +W[218] -> 218 OK +W[219] -> 219 OK +W[220] -> 220 OK +W[221] -> 221 OK +W[222] -> 222 OK +W[223] -> 223 OK +W[224] -> 224 OK +W[225] -> 225 OK +W[226] -> 226 OK +W[227] -> 227 OK +W[228] -> 228 OK +W[229] -> 229 OK +W[230] -> 230 OK +W[231] -> 231 OK +W[232] -> 232 OK +W[233] -> 233 OK +W[234] -> 234 OK +W[235] -> 235 OK +W[236] -> 236 OK +W[237] -> 237 OK +W[238] -> 238 OK +W[239] -> 239 OK +W[240] -> 240 OK +W[241] -> 241 OK +W[242] -> 242 OK +W[243] -> 243 OK +W[244] -> 244 OK +W[245] -> 245 OK +W[246] -> 246 OK +W[247] -> 247 OK +W[248] -> 248 OK +W[249] -> 249 OK +W[250] -> 250 OK +W[251] -> 251 OK +W[252] -> 252 OK +W[253] -> 253 OK +W[254] -> 254 OK +W[255] -> 255 OK +W[256] -> 1 OK +W[257] -> 1 OK +W[258] -> 3 OK +W[259] -> 3 OK +W[260] -> 5 OK +W[261] -> 5 OK +W[262] -> 7 OK +W[263] -> 7 OK +W[264] -> 9 OK +W[265] -> 9 OK +W[266] -> 11 OK +W[267] -> 11 OK +W[268] -> 13 OK +W[269] -> 13 OK +W[270] -> 15 OK +W[271] -> 15 OK +W[272] -> 17 OK +W[273] -> 17 OK +W[274] -> 19 OK +W[275] -> 19 OK +W[276] -> 21 OK +W[277] -> 21 OK +W[278] -> 23 OK +W[279] -> 23 OK +W[280] -> 25 OK +W[281] -> 25 OK +W[282] -> 27 OK +W[283] -> 27 OK +W[284] -> 29 OK +W[285] -> 29 OK +W[286] -> 31 OK +W[287] -> 31 OK +W[288] -> 33 OK +W[289] -> 33 OK +W[290] -> 35 OK +W[291] -> 35 OK +W[292] -> 37 OK +W[293] -> 37 OK +W[294] -> 39 OK +W[295] -> 39 OK +W[296] -> 41 OK +W[297] -> 41 OK +W[298] -> 43 OK +W[299] -> 43 OK +W[300] -> 45 OK +W[301] -> 45 OK +W[302] -> 47 OK +W[303] -> 47 OK +W[304] -> 49 OK +W[305] -> 49 OK +W[306] -> 51 OK +W[307] -> 51 OK +W[308] -> 53 OK +W[309] -> 53 OK +W[310] -> 55 OK +W[311] -> 55 OK +W[312] -> 57 OK +W[313] -> 57 OK +W[314] -> 59 OK +W[315] -> 59 OK +W[316] -> 61 OK +W[317] -> 61 OK +W[318] -> 63 OK +W[319] -> 63 OK +W[320] -> 65 OK +W[321] -> 65 OK +W[322] -> 67 OK +W[323] -> 67 OK +W[324] -> 69 OK +W[325] -> 69 OK +W[326] -> 71 OK +W[327] -> 71 OK +W[328] -> 73 OK +W[329] -> 73 OK +W[330] -> 75 OK +W[331] -> 75 OK +W[332] -> 77 OK +W[333] -> 77 OK +W[334] -> 79 OK +W[335] -> 79 OK +W[336] -> 81 OK +W[337] -> 81 OK +W[338] -> 83 OK +W[339] -> 83 OK +W[340] -> 85 OK +W[341] -> 85 OK +W[342] -> 87 OK +W[343] -> 87 OK +W[344] -> 89 OK +W[345] -> 89 OK +W[346] -> 91 OK +W[347] -> 91 OK +W[348] -> 93 OK +W[349] -> 93 OK +W[350] -> 95 OK +W[351] -> 95 OK +W[352] -> 97 OK +W[353] -> 97 OK +W[354] -> 99 OK +W[355] -> 99 OK +W[356] -> 101 OK +W[357] -> 101 OK +W[358] -> 103 OK +W[359] -> 103 OK +W[360] -> 105 OK +W[361] -> 105 OK +W[362] -> 107 OK +W[363] -> 107 OK +W[364] -> 109 OK +W[365] -> 109 OK +W[366] -> 111 OK +W[367] -> 111 OK +W[368] -> 113 OK +W[369] -> 113 OK +W[370] -> 115 OK +W[371] -> 115 OK +W[372] -> 117 OK +W[373] -> 117 OK +W[374] -> 119 OK +W[375] -> 119 OK +W[376] -> 121 OK +W[377] -> 121 OK +W[378] -> 123 OK +W[379] -> 123 OK +W[380] -> 125 OK +W[381] -> 125 OK +W[382] -> 127 OK +W[383] -> 127 OK +W[384] -> 129 OK +W[385] -> 129 OK +W[386] -> 131 OK +W[387] -> 131 OK +W[388] -> 133 OK +W[389] -> 133 OK +W[390] -> 135 OK +W[391] -> 135 OK +W[392] -> 137 OK +W[393] -> 137 OK +W[394] -> 139 OK +W[395] -> 139 OK +W[396] -> 141 OK +W[397] -> 141 OK +W[398] -> 143 OK +W[399] -> 143 OK +W[400] -> 145 OK +W[401] -> 145 OK +W[402] -> 147 OK +W[403] -> 147 OK +W[404] -> 149 OK +W[405] -> 149 OK +W[406] -> 151 OK +W[407] -> 151 OK +W[408] -> 153 OK +W[409] -> 153 OK +W[410] -> 155 OK +W[411] -> 155 OK +W[412] -> 157 OK +W[413] -> 157 OK +W[414] -> 159 OK +W[415] -> 159 OK +W[416] -> 161 OK +W[417] -> 161 OK +W[418] -> 163 OK +W[419] -> 163 OK +W[420] -> 165 OK +W[421] -> 165 OK +W[422] -> 167 OK +W[423] -> 167 OK +W[424] -> 169 OK +W[425] -> 169 OK +W[426] -> 171 OK +W[427] -> 171 OK +W[428] -> 173 OK +W[429] -> 173 OK +W[430] -> 175 OK +W[431] -> 175 OK +W[432] -> 177 OK +W[433] -> 177 OK +W[434] -> 179 OK +W[435] -> 179 OK +W[436] -> 181 OK +W[437] -> 181 OK +W[438] -> 183 OK +W[439] -> 183 OK +W[440] -> 185 OK +W[441] -> 185 OK +W[442] -> 187 OK +W[443] -> 187 OK +W[444] -> 189 OK +W[445] -> 189 OK +W[446] -> 191 OK +W[447] -> 191 OK +W[448] -> 193 OK +W[449] -> 193 OK +W[450] -> 195 OK +W[451] -> 195 OK +W[452] -> 197 OK +W[453] -> 197 OK +W[454] -> 199 OK +W[455] -> 199 OK +W[456] -> 201 OK +W[457] -> 201 OK +W[458] -> 203 OK +W[459] -> 203 OK +W[460] -> 205 OK +W[461] -> 205 OK +W[462] -> 207 OK +W[463] -> 207 OK +W[464] -> 209 OK +W[465] -> 209 OK +W[466] -> 211 OK +W[467] -> 211 OK +W[468] -> 213 OK +W[469] -> 213 OK +W[470] -> 215 OK +W[471] -> 215 OK +W[472] -> 217 OK +W[473] -> 217 OK +W[474] -> 219 OK +W[475] -> 219 OK +W[476] -> 221 OK +W[477] -> 221 OK +W[478] -> 223 OK +W[479] -> 223 OK +W[480] -> 225 OK +W[481] -> 225 OK +W[482] -> 227 OK +W[483] -> 227 OK +W[484] -> 229 OK +W[485] -> 229 OK +W[486] -> 231 OK +W[487] -> 231 OK +W[488] -> 233 OK +W[489] -> 233 OK +W[490] -> 235 OK +W[491] -> 235 OK +W[492] -> 237 OK +W[493] -> 237 OK +W[494] -> 239 OK +W[495] -> 239 OK +W[496] -> 241 OK +W[497] -> 241 OK +W[498] -> 243 OK +W[499] -> 243 OK +W[500] -> 245 OK +W[501] -> 245 OK +W[502] -> 247 OK +W[503] -> 247 OK +W[504] -> 249 OK +W[505] -> 249 OK +W[506] -> 251 OK +W[507] -> 251 OK +W[508] -> 253 OK +W[509] -> 253 OK +W[510] -> 255 OK +W[511] -> 255 OK +W[512] -> 2 OK -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 17:10:34 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:10:34 +0000 Subject: osmo-pcu[master]: Use built-in bit counter In-Reply-To: References: Message-ID: Patch Set 1: You're right - it's actually used for uint8_t only but it's not obvious from function type signatures and is not covered by tests so I've got to fix it first. Let#s keep this here until then. -- To view, visit https://gerrit.osmocom.org/6104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521 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 Jan 29 17:10:48 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 29 Jan 2018 17:10:48 +0000 Subject: osmo-pcu[master]: Use built-in bit counter In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/6104 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaf470e9a7ee0d003177c4328f93849606ca31521 Gerrit-PatchSet: 2 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 Jan 29 19:48:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 19:48:22 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Validate DNS PCO values Message-ID: Review at https://gerrit.osmocom.org/6157 ggsn_tests: Validate DNS PCO values Change-Id: I54124cb5269c0992e6c72af1a1ecaa8e3202bf05 --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 34 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/57/6157/1 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index 90368b9..d8994df 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -18,6 +18,8 @@ GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2" GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1" GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8" +GGSN_Tests.m_ggsn_ip6_dns1 := "2001:4860:4860::8888" +GGSN_Tests.m_ggsn_ip6_dns2 := "2001:4860:4860::8844" [EXECUTE] #GGSN_Tests.TC_dummy diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 06d9dcf..f7814db 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -26,6 +26,8 @@ charstring m_ggsn_ip4_dns1 := "192.168.100.1" charstring m_ggsn_ip4_dns2 := "8.8.8.8" + charstring m_ggsn_ip6_dns1 := "2001:4860:4860::8888" + charstring m_ggsn_ip6_dns2 := "2001:4860:4860::8844" } type set PdpContext { @@ -426,11 +428,15 @@ } /* extract a given protocol payload from PCO */ - function f_PCO_extract_proto(ProtConfigOptions pco, OCT2 protocol) return octetstring { + function f_PCO_extract_proto(ProtConfigOptions pco, OCT2 protocol, integer nth_match := 1) return octetstring { var integer i; + var integer num_matches := 0; for (i := 0; i < lengthof(pco.protocols); i := i + 1) { if (pco.protocols[i].protocolID == protocol) { - return pco.protocols[i].protoIDContents; + num_matches := num_matches + 1; + if (num_matches == nth_match) { + return pco.protocols[i].protoIDContents; + } } } setverdict(fail); @@ -925,6 +931,18 @@ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); ctx.pco_req := valueof(ts_PCO_IPv6_DNS); f_pdp_ctx_act(ctx); + + /* verify PCO contains both primary and secondary DNS */ + var OCT4 ggsn_ip6_dns1 := f_inet6_addr(m_ggsn_ip6_dns1); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 1), ggsn_ip6_dns1)) { + setverdict(fail, "Primary DNS IPv6 PCO option not found"); + } + + var OCT4 ggsn_ip6_dns2 := f_inet6_addr(m_ggsn_ip6_dns2); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 2), ggsn_ip6_dns2)) { + setverdict(fail, "Secondary DNS IPv6 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); } @@ -984,6 +1002,18 @@ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); f_pdp_ctx_act(ctx); + + /* verify PCO contains both primary and secondary DNS */ + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 1), ggsn_ip4_dns1)) { + setverdict(fail, "Primary DNS IPv4 PCO option not found"); + } + + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 2), ggsn_ip4_dns2)) { + setverdict(fail, "Secondary DNS IPv4 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); } -- To view, visit https://gerrit.osmocom.org/6157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54124cb5269c0992e6c72af1a1ecaa8e3202bf05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 19:48:22 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 19:48:22 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... Message-ID: Review at https://gerrit.osmocom.org/6158 ggsn_tests: Add test case to validate packets forwarded vs dropped New dependency is required: titan.ProtocolModules.ICMP It tests that ICMP echo packets can be sent successfully (reply is received or otherwise dest unreachable if routing is not set up correctly during the test). It also tests some cases in which osmo-ggsn is required to drop the packets (eg. unknown src ip unrelated to pdp ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx and vice versa. I am having some issues having my setup forwarding the crafted ICMPv4 echo messages. They are seen in the tun4 interface but it seems kernel routing is dropping them before sending them to my eth device. Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M ggsn_tests/regen_makefile.sh 4 files changed, 262 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/6158/1 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index d8994df..bf82057 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -26,9 +26,11 @@ GGSN_Tests.TC_pdp4_act_deact GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns +GGSN_Tests.TC_pdp4_act_deact_gtpu_access GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 +GGSN_Tests.TC_pdp6_act_deact_gtpu_access GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index f7814db..8bd5f52 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -10,6 +10,7 @@ import from GTPU_Types all; import from IPCP_Types all; import from IP_Types all; + import from ICMP_Types all; import from ICMPv6_Types all; import from Native_Functions all; @@ -734,6 +735,63 @@ /* IPv6 neighbor solicitation fe80::2 -> ff02::1:ff00:2 from 02:88:b5:1f:25:59 */ const octetstring c_neigh_solicit:= '6000000000203afffe800000000000000000000000000002ff0200000000000000000001ff00000287009f9600000000fe80000000000000000000000000000201010288b51f2559'O; + /* template for an ICMPv6 echo request */ + template PDU_ICMP ts_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := '0000'O, + identifier := '0345'O, + sequence_number := '0001'O, + data := ''O + } + } + + /* template for an ICMPv4 echo reply */ + template PDU_ICMP tr_ICMPv4_ERP(octetstring data := ''O) := { + echo_reply := { + type_field := 0, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := data + } + } + + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMP tr_ICMPv4_DU := { + destination_unreachable := { + type_field := 1, + code := ?, + checksum := ?, + unused := ?, + original_ip_msg := ? + } + } + + /* template to construct IPv4_packet from input arguments, ready for use in f_IPv4_enc() */ + template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, LIN2_BO_LAST tlen, octetstring payload) := { + header := { + ver := 4, + hlen := 5, + tos := 0, + tlen := tlen, + id := 35902, + res := '0'B, + dfrag := '1'B, + mfrag := '0'B, + foffset := 0, + ttl := 64, + proto := proto, + cksum := 0, + srcaddr := srcaddr, + dstaddr := dstaddr + }, + ext_headers := omit, + payload := payload + } + /* template to generate a 'Prefix Information' ICMPv6 option */ template OptionField ts_ICMP6_OptPrefix(OCT16 prefix, INT1 prefix_len) := { prefixInformation := { @@ -747,6 +805,18 @@ preferredLifetime := oct2int('FFFFFFFF'O), reserved2 := '00000000'O, prefix := prefix + } + } + + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 ts_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := '0000'O, + identifier := 0, + sequenceNr := 0, + data := ''O } } @@ -829,6 +899,29 @@ } } + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMPv6 tr_ICMPv6_DU := { + destinationUnreachable := { + typeField := 1, + code := ?, + checksum := ?, + unused := ?, + originalIpMsg := ? + } + } + + /* template for receiving/matching an ICMPv6 echo reply */ + template PDU_ICMPv6 tr_ICMPv6_ERP(octetstring data := ''O) := { + echoReply := { + typeField := 129, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := data + } + } + /* template to construct IPv6_packet from input arguments, ready for use in f_IPv6_enc() */ template IPv6_packet ts_IP6(OCT16 srcaddr, OCT16 dstaddr, LIN1 nexthead, octetstring payload, LIN1 hlim := 255) := { header := { @@ -847,6 +940,21 @@ function f_ipv6_link_local(in OCT16 link_id) return OCT16 { return 'FE80000000000000'O & substr(link_id, 8, 8); + } + + function f_ipv6_global(in OCT16 link_id) return OCT16 { + return substr(link_id, 0, 8) & '1234123412341234'O; + } + + /* Create a new different IPv6 addr from input. Starts mangling at byte prefix. */ + function f_ipv6_mangle(in OCT16 addr, in integer prefix := 0) return OCT16 { + var integer i; + var octetstring res := substr(addr, 0, prefix); + for (i := prefix; i < lengthof(addr); i := i + 1) { + var octetstring a := addr[i] xor4b '11'O; + res := res & a; + } + return res; } /* Compute solicited-node multicast address as per RFC4291 2.7.1 */ @@ -915,6 +1023,62 @@ T_default.stop; } + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, tr_ICMPv4_ERP()) and not match(icmp4, tr_ICMPv4_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv6_packet ip6 := f_IPv6_dec(gpdu); + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { + repeat; + } + var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); + if (not match(icmp6, tr_ICMPv6_ERP()) and not match(icmp6, tr_ICMPv6_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Assert we don't receive a ICMPv4/6 echo reply (or unreachable) from GTP */ + function f_wait_gtpu_fail(PdpContext ctx) runs on GT_CT { + T_default.start; + alt { + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { } + } + T_default.stop; + } + /* Test IPv6 context activation for dynamic IPv6 EUA without request of IPv6 DNS */ testcase TC_pdp6_act_deact() runs on GT_CT { f_init(); @@ -960,6 +1124,61 @@ f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); f_wait_rtr_adv(ctx); f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var octetstring tmp; + var IPv6_packet ip6; + + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv6_DNS); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + var OCT16 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '0003'O); + + /* Check if we can use valid link-local src addr */ + var OCT16 saddr_ll := f_ipv6_link_local(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + /* FIXME: Reply not going back to GTP tunnel */ + /*tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr_ll, dns1_addr); + ip6 := valueof(ts_IP6(saddr_ll, dns1_addr, 58, tmp)); + f_send_gtpu(ctx, f_IPv6_enc(ip6)); + f_wait_icmp6_echo_reply(ctx);*/ + + /* Check that attempting RA with another ll src addr won't work, packet dropped: */ + var OCT16 saddr_ll_wrong := f_ipv6_mangle(saddr_ll, 8); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_ll_wrong)); + f_wait_gtpu_fail(ctx); + + /* Check if we can use valid global src addr, should work */ + var OCT16 saddr_glob := f_ipv6_global(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr_glob, dns1_addr); + ip6 := valueof(ts_IP6(saddr_glob, dns1_addr, 58, tmp)); + f_send_gtpu(ctx, f_IPv6_enc(ip6)); + f_wait_icmp6_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT16 saddr_wrong := f_ipv6_mangle(saddr_glob); + tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr_wrong, dns1_addr); + ip6 := valueof(ts_IP6(saddr_wrong, dns1_addr, 58, tmp)); + f_send_gtpu(ctx, f_IPv6_enc(ip6)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped) */ + var OCT4 saddr_v4 := f_inet_addr("192.168.10.2"); + var OCT4 daddr_v4 := f_inet_addr("8.8.8.8"); + tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + var IPv4_packet ip4 := valueof(ts_IP4(saddr_v4, daddr_v4, 1, 50, tmp)); + f_send_gtpu(ctx, f_IPv4_enc(ip4)); + f_wait_gtpu_fail(ctx); f_pdp_ctx_del(ctx, '1'B); } @@ -1017,6 +1236,40 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp4_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var octetstring tmp; + var IPv4_packet ip4; + + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); + f_pdp_ctx_act(ctx); + + var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); + + /* Check if we can use valid global src addr, should work */ + var OCT4 saddr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + ip4 := valueof(ts_IP4(saddr, dns1_addr, 1, 50, tmp)); + f_send_gtpu(ctx, f_IPv4_enc(ip4)); + f_wait_icmp4_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT4 saddr_wrong := substr(saddr, 0, 3) & (saddr[3] xor4b '11'O); + tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + ip4 := valueof(ts_IP4(saddr_wrong, dns1_addr, 1, 50, tmp)); + f_send_gtpu(ctx, f_IPv4_enc(ip4)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv6 RA to APN4, should fail (packet dropped) */ + var OCT16 saddr_v6 := f_inet6_addr("fde4:8dba:82e1:2000:1:2:3:4"); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_v6)); + f_wait_gtpu_fail(ctx); + f_pdp_ctx_del(ctx, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1033,10 +1286,12 @@ execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); + execute(TC_pdp4_act_deact_gtpu_access()) execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_gtpu_access()) execute(TC_echo_req_resp()); } diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 8098f9b..58c681f 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -27,6 +27,10 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.ICMP/src +FILES="ICMP_EncDec.cc ICMP_Types.ttcn" +gen_links $DIR $FILES + DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh index 3970187..2fc74f7 100755 --- a/ggsn_tests/regen_makefile.sh +++ b/ggsn_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc" +FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc ICMP_EncDec.cc" ../regen-makefile.sh GGSN_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Mon Jan 29 20:05:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Mon, 29 Jan 2018 20:05:51 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 As described in the commit description, I'm still having some issues due to the ICMP packets not being forwarded after arriving to the tun device. The GGSN processing part seems to be working fine but still it'd be better to solve it before merging them. -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:07:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:12 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSC_Tests: Add MGCP_Emulation to gen_links Message-ID: Review at https://gerrit.osmocom.org/6165 BSC_Tests: Add MGCP_Emulation to gen_links Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01 --- M bsc/gen_links.sh 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/65/6165/1 diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index 01655c0..af747b3 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES -- To view, visit https://gerrit.osmocom.org/6165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:13 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler f... Message-ID: Review at https://gerrit.osmocom.org/6166 bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler for MGCP forward-ported by Harald Welte Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 39 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/66/6166/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 6b5ce24..8766503 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -31,6 +31,7 @@ import from IPA_Types all; import from RSL_Types all; import from RSL_Emulation all; +import from MGCP_Emulation all; import from Osmocom_CTRL_Functions all; import from Osmocom_CTRL_Types all; @@ -59,6 +60,8 @@ /* array of per-BTS RSL test ports */ port IPA_RSL_PT IPA_RSL[NUM_BTS]; + var MGCP_Emulation_CT vc_MGCP; + /* are we initialized yet */ var boolean g_initialized := false; @@ -74,6 +77,8 @@ integer mp_bsc_rsl_port := 3003; /* port number to which to establish the IPA CTRL connection */ integer mp_bsc_ctrl_port := 4249; + /* IP address at which the test binds */ + charstring mp_test_ip := "127.0.0.1"; } type record IPA_Client { @@ -176,6 +181,24 @@ } } +function f_init_mgcp(charstring id) runs on test_CT { + id := id & "-MGCP"; + + var MGCPOps ops := { + create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) + }; + var MGCP_conn_parameters mgcp_pars := { + callagent_ip := mp_bsc_ip, + callagent_udp_port := 2727, + mgw_ip := mp_test_ip, + mgw_udp_port := 2427 + }; + + vc_MGCP := MGCP_Emulation_CT.create(id); + vc_MGCP.start(MGCP_Emulation.main(ops, mgcp_pars, id)); +} + /* global initialization function * \param nr_bts Number of BTSs we should start/bring up * \param handler_mode Start an RSL_Emulation_CT component (true) or not (false) */ @@ -195,6 +218,8 @@ f_bssap_init("VirtMSC", omit); } f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); + + f_init_mgcp("VirtMSC"); for (i := 0; i < nr_bts; i := i+1) { /* wait until osmo-bts-omldummy has respawned */ @@ -1197,8 +1222,10 @@ vc_conn := MSC_ConnHdlr.create(id); connect(vc_conn:BSSMAPEM, vc_BSSMAP:PROC); + connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); + connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); vc_conn.start(derefers(fn)(id)); return vc_conn; } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index d1be0ef..3dbb782 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -10,6 +10,7 @@ import from MGCP_Types all; import from MGCP_Templates all; +import from MGCP_Emulation all; import from SDP_Types all; import from RSL_Emulation all; @@ -24,7 +25,7 @@ /* this component represents a single subscriber connection at the MSC. * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr { +type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; @@ -55,6 +56,10 @@ role_ms := false } +const MGCPOps MSC_MGCPOps := { + create_cb := refers(MGCP_Emulation.ExpectedCreateCallback) +} + type enumerated MSC_State { MSC_STATE_NONE, MSC_STATE_WAIT_ASS_COMPL, @@ -65,7 +70,7 @@ } /* register an expect with the BSSMAP core */ -private function f_create_exp(octetstring l3_enc) runs on MSC_ConnHdlr { +private function f_create_bssmap_exp(octetstring l3_enc) runs on MSC_ConnHdlr { BSSMAPEM.call(BSSMAPEM_register:{l3_enc, self}) { [] BSSMAPEM.getreply(BSSMAPEM_register:{?, ?}) {}; } @@ -92,7 +97,7 @@ /* call helper function for CHAN_RQD -> IMM ASS ->EST_IND */ RSL_Emulation.f_chan_est(pars.ra, l3_enc, pars.link_id, pars.fn); - f_create_exp(l3_enc); + f_create_bssmap_exp(l3_enc); } function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig) runs on MSC_ConnHdlr { @@ -184,10 +189,14 @@ crcx_seen := true; repeat; } + /* mgw CRCX goes here */ + [crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{ RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, 1, 1, 1, 1)); repeat; } + /* mgw MGCX goes here */ + [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { setverdict(fail, "Received non-matching ASSIGNMENT COMPLETE"); } -- To view, visit https://gerrit.osmocom.org/6166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Register expect criteria for MGCP CRCX Message-ID: Review at https://gerrit.osmocom.org/6167 bsc: Register expect criteria for MGCP CRCX Change-Id: I04afa663f4397d5d9b8dec06671aec84f4c4f80e --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/67/6167/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 3dbb782..e1fd35a 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -158,11 +158,17 @@ var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); var boolean crcx_seen := false; var boolean rr_modify_seen := false; + var ExpectCriteria mgcpcrit := { + connid := omit, + endpoint := omit, + transid := omit + }; f_create_chan_and_exp(pars); /* we should now have a COMPL_L3 at the MSC */ BSSAP.receive(tr_BSSMAP_ComplL3); + f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); alt { /* if we receive exactly what we expected, always return + pass */ -- To view, visit https://gerrit.osmocom.org/6167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04afa663f4397d5d9b8dec06671aec84f4c4f80e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Reply to CRCX with ACK Message-ID: Review at https://gerrit.osmocom.org/6168 bsc: Reply to CRCX with ACK Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df --- M bsc/MSC_ConnectionHandler.ttcn M library/MGCP_Emulation.ttcn 2 files changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/68/6168/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index e1fd35a..f763994 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -154,6 +154,7 @@ runs on MSC_ConnHdlr return PDU_BSSAP { var PDU_BSSAP bssap; var RSL_Message rsl; + var MgcpCommand cmd; timer T := 10.0; var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); var boolean crcx_seen := false; @@ -164,6 +165,7 @@ transid := omit }; + mgcp_conn_id := f_mgcp_alloc_conn_id(); f_create_chan_and_exp(pars); /* we should now have a COMPL_L3 at the MSC */ @@ -171,6 +173,9 @@ f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); alt { + [] MGCP.receive(tr_CRCX) -> value cmd { + MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, cmd.sdp)) + } /* if we receive exactly what we expected, always return + pass */ [] BSSAP.receive(exp_ass_cpl) -> value bssap { setverdict(pass); diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index df8e4b4..074385c 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -38,6 +38,7 @@ port MGCP_Conn_PT MGCP; /* procedure based port to register for incoming connections */ port MGCPEM_PROC_PT MGCP_PROC; + var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/6168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:14 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Expect CRCX and send an ACK back Message-ID: Review at https://gerrit.osmocom.org/6169 bsc: Expect CRCX and send an ACK back Change-Id: Ic4fabc2a2cf034a831e446697b3a22f4d1d0c6d6 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 7 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/69/6169/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index f763994..d619068 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -164,6 +164,7 @@ endpoint := omit, transid := omit }; + var SDP_Message sdp; mgcp_conn_id := f_mgcp_alloc_conn_id(); f_create_chan_and_exp(pars); @@ -172,10 +173,13 @@ BSSAP.receive(tr_BSSMAP_ComplL3); f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); + MGCP.receive(tr_CRCX) -> value cmd; + sdp := valueof(ts_SDP("127.0.0.1", "127.0.0.1", "foo", "21", 1000, { "98" }, + {valueof(ts_SDP_rtpmap(98, "AMR/8000")), + valueof(ts_SDP_ptime(20)) } )); + MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, sdp)) + alt { - [] MGCP.receive(tr_CRCX) -> value cmd { - MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, cmd.sdp)) - } /* if we receive exactly what we expected, always return + pass */ [] BSSAP.receive(exp_ass_cpl) -> value bssap { setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4fabc2a2cf034a831e446697b3a22f4d1d0c6d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Don't test CTRL commands for old NITB parameters Message-ID: Review at https://gerrit.osmocom.org/6170 bsc: Don't test CTRL commands for old NITB parameters Change-Id: Ib6c6b24842d7ceb12a93200bd6208a6b392544b5 --- M bsc/BSC_Tests.ttcn 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/70/6170/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 8766503..dacb630 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -872,8 +872,6 @@ f_ctrl_get_exp(IPA_CTRL, "mcc", "1"); f_ctrl_get_exp(IPA_CTRL, "mnc", "1"); - f_ctrl_get_exp(IPA_CTRL, "short-name", "OsmoBSC"); - f_ctrl_get_exp(IPA_CTRL, "long-name", "OsmoBSC"); f_ctrl_get_exp(IPA_CTRL, "number-of-bts", "3"); var integer bts_nr := 0; -- To view, visit https://gerrit.osmocom.org/6170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6c6b24842d7ceb12a93200bd6208a6b392544b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Update TC_exhaustion to recent osmo-bsc Message-ID: Review at https://gerrit.osmocom.org/6171 bsc: Update TC_exhaustion to recent osmo-bsc When Change-Id I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 was merged, OsmoBSC started to always allocate SDCCH first, no matter what the establishment cause. This basically means we don't do very early assignment anymore. TC_exhaustion must be adapted to allocate all SDCCH and all TCH before failing. Change-Id: I9d8bbfca0deebc738385f2a1a20d4a17c3853082 --- M bsc/BSC_Tests.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/6171/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index dacb630..84d0c38 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -46,6 +46,7 @@ /* make sure to sync this with the osmo-bts.cfg you're using */ const integer NUM_TCHF_PER_BTS := 5; +const integer NUM_SDCCH_PER_BTS := 4; /* per-BTS state which we keep */ @@ -386,13 +387,14 @@ chreq_nochan := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel"); /* expect 5xTCH/F to succeed */ - for (i := 0; i < NUM_TCHF_PER_BTS; i := i+1) { + for (i := 0; i < NUM_TCHF_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) { f_chreq_act_ack('23'O, i); } IPA_RSL[0].clear; - f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+NUM_TCHF_PER_BTS); + f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", + chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS); /* now expect additional channel activations to fail */ f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42)); @@ -408,7 +410,7 @@ rr := dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload); if (rr.header.message_type == IMMEDIATE_ASSIGNMENT_REJECT) { f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", - chreq_total+NUM_TCHF_PER_BTS+1); + chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS+1); f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel", chreq_nochan+1); setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d8bbfca0deebc738385f2a1a20d4a17c3853082 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm Message-ID: Review at https://gerrit.osmocom.org/6172 bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm In OsmoBSC Change-IdI68286d26e2014048b054f39ef29c35fef420cc97 we introduce a proper subscriber connection state machine which fixes the order of events during channel release after connection failure. Change-Id: Ibe9c3205ec11dafcc305ea72aeb33e9152a6458c --- M bsc/BSC_Tests.ttcn 1 file changed, 5 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/6172/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 84d0c38..87150db 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -582,11 +582,6 @@ f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL)); /* TODO: different cause values? */ - /* expect BSC to disable the channel */ - rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - /* expect Clear Request from BSC */ BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearRequest)) -> value rx_di; @@ -594,6 +589,11 @@ var BssmapCause cause := bit2int(rx_di.userData.pdu.bssmap.clearRequest.cause.causeValue); BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); + /* expect BSC to disable the channel */ + rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); + /* respond with CHAN REL ACK */ + f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); + /* expect Clear Complete from BSC */ BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)); -- To view, visit https://gerrit.osmocom.org/6172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe9c3205ec11dafcc305ea72aeb33e9152a6458c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: reduce code duplication by introducing f_expect_chan_rel() Message-ID: Review at https://gerrit.osmocom.org/6173 bsc: reduce code duplication by introducing f_expect_chan_rel() The handling of channel release is copy+pasted, let's introduce a shared function. Change-Id: If74b0838187f60004b7daf6176db259af511bf87 --- M bsc/BSC_Tests.ttcn 1 file changed, 37 insertions(+), 74 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/6173/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 87150db..c7b5a8f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -606,11 +606,44 @@ setverdict(pass); } +function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, boolean flush := true, + boolean handle_rll_rel := true) runs on test_CT { + + var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); + if (flush) { + /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ + IPA_RSL[bts_nr].clear; + } + alt { + /* ignore DEACTIVATE SACCH (if any) */ + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_DEACT_SACCH(rsl_chan_nr))) { + repeat; + } + /* acknowledge RLL release (if any)*/ + [handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_REL_REQ(rsl_chan_nr, ?))) { + /* FIXME: Why are we getting this for LinkID SACCH? */ + f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch)); + repeat; + } + /* Expect RF channel release from BSC on Abis */ + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { + /* respond with CHAN REL ACK */ + f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(rsl_chan_nr)); + } + /* ignore any user data */ + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) { + repeat; + } + } +} + /* Test behavior of channel release after hard Clear Command from MSC */ testcase TC_chan_rel_hard_clear() runs on test_CT { var BSSAP_N_DATA_ind rx_di; var DchanTuple dt; - var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); f_init(1); f_bssap_reset(); @@ -627,36 +660,13 @@ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); } - /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ - IPA_RSL[0].clear; - alt { - /* ignore DEACTIVATE SACCH (if any) */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_DEACT_SACCH(dt.rsl_chan_nr))) { - repeat; - } - /* acknowledge RLL release (if any)*/ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(dt.rsl_chan_nr, ?))) { - /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(dt.rsl_chan_nr, main_dcch)); - repeat; - } - /* Expect RF channel release from BSC on Abis */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - } - } - + f_expect_chan_rel(0, dt.rsl_chan_nr); setverdict(pass); } /* Test behavior of channel release after hard RLSD from MSC */ testcase TC_chan_rel_hard_rlsd() runs on test_CT { var DchanTuple dt; - var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); f_init(1); f_bssap_reset(); @@ -666,36 +676,13 @@ /* release the SCCP connection */ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); - /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ - IPA_RSL[0].clear; - alt { - /* ignore DEACTIVATE SACCH (if any) */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_DEACT_SACCH(dt.rsl_chan_nr))) { - repeat; - } - /* acknowledge RLL release (if any)*/ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(dt.rsl_chan_nr, ?))) { - /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(dt.rsl_chan_nr, main_dcch)); - repeat; - } - /* Expect RF channel release from BSC on Abis */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - } - } - + f_expect_chan_rel(0, dt.rsl_chan_nr); setverdict(pass); } /* Test behavior of channel release after BSSMAP RESET from MSC */ testcase TC_chan_rel_a_reset() runs on test_CT { var DchanTuple dt; - var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); f_init(1); f_bssap_reset(); @@ -712,31 +699,7 @@ [] BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)) { } } - alt { - /* ignore DEACTIVATE SACCH (if any) */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_DEACT_SACCH(dt.rsl_chan_nr))) { - repeat; - } - /* acknowledge RLL release (if any)*/ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(dt.rsl_chan_nr, ?))) { - /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(dt.rsl_chan_nr, main_dcch)); - repeat; - } - /* Expect RF channel release from BSC on Abis */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - } - /* ignore any user data */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) { - repeat; - } - } - + f_expect_chan_rel(0, dt.rsl_chan_nr); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If74b0838187f60004b7daf6176db259af511bf87 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:15 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Fix TC_chan_act_ack_est_ind_noreply() Message-ID: Review at https://gerrit.osmocom.org/6174 bsc: Fix TC_chan_act_ack_est_ind_noreply() This test case was incomplete in that it * applied the wrong timeout T3101 instead of T3210 * didn't account for a RLL REL REQ/RESP before RF_CHAN_REL Let's fix it. Together with OsmoBSC Change-Id Ie11d7d06353ba1b1e2fab6763dd7b032ce8a5d2c this check now actually passes for the first time. Change-Id: I9ed41d246cf153735fd4e71cc6cc174ede32a76b --- M bsc/BSC_Tests.ttcn 1 file changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/74/6174/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index c7b5a8f..b65d899 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -308,7 +308,10 @@ /* Test behavior if MSC never answers to CR */ testcase TC_chan_act_ack_est_ind_noreply() runs on test_CT { + var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); + var IpaStreamId sid := IPAC_PROTO_RSL_TRX0; var RSL_Message rx_rsl; + var ASP_RSL_Unitdata rx_rsl_ud; f_init(1); f_bssap_reset(); @@ -322,7 +325,15 @@ BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))); /* expect BSC to disable the channel again if there's no response from MSC */ - rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); + /* MS waits 20s (T3210) at LU; 10s (T3230) at CM SERV REQ and 5s (T3220) AT detach */ + IPA_RSL[0].clear; + alt { + [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) -> value rx_rsl_ud { } + [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_REL_REQ(chan_nr, ?))) -> value rx_rsl_ud { + f_ipa_tx(0, ts_RSL_REL_CONF(chan_nr, main_dcch)); + repeat; + } + } setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9ed41d246cf153735fd4e71cc6cc174ede32a76b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Fix TC_chan_act_ack_est_ind_refused() Message-ID: Review at https://gerrit.osmocom.org/6175 bsc: Fix TC_chan_act_ack_est_ind_refused() This test case was incomplete in that it didn't account for a RLL REL REQ/RESP before RF_CHAN_REL. Together with OsmoBSC Change-Id I64a46b5bcd4272e3fa2ff4ee824c2f3fdff6854b, this test now passes. Change-Id: Ia5af254d4fc572c1d324f70b5ec99d87bdaf9eb9 --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/75/6175/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b65d899..69f072b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -356,8 +356,7 @@ BSSAP.send(ts_BSSAP_DISC_req(rx_c_ind.connectionId, 0)); /* expect BSC to disable the channel */ - rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); - + f_expect_chan_rel(0, chan_nr); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5af254d4fc572c1d324f70b5ec99d87bdaf9eb9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Cosmetic: Update commented-out config file options Message-ID: Review at https://gerrit.osmocom.org/6176 bsc: Cosmetic: Update commented-out config file options There's no point in listing non-existing module parameters. Instead, list those that the BSC testsuite actually has Change-Id: I3cb756750cafba4ca481a0a98d19e27cb58395df --- M bsc/BSC_Tests.cfg 1 file changed, 9 insertions(+), 11 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/76/6176/1 diff --git a/bsc/BSC_Tests.cfg b/bsc/BSC_Tests.cfg index fcb1055..497489f 100644 --- a/bsc/BSC_Tests.cfg +++ b/bsc/BSC_Tests.cfg @@ -14,20 +14,18 @@ #*.*.udpReuseAddress := "yes"; [MODULE_PARAMETERS] -#mp_bsc_port := 49999; +#mp_bsc_rsl_port := 3003; +#mp_bsc_ctrl_port := 4249; #mp_bsc_ip := "127.0.0.1"; -#mp_msc_port := 5100; -#mp_msc_ip := "127.0.0.1"; -#mp_nat_port := 5000; -#mp_nat_ip := "127.0.0.1"; +#mp_test_ip := "127.0.0.1"; + +#mp_sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }; +#mp_own_pc := 185; +#mp_own_ssn := 254; +#mp_peer_pc := 187; +#mp_peer_ssn := 254; #mp_ipa_mgcp_uses_osmo_ext := true; - -#mp_mgcp_uses_udp := true; -#mp_callagent_ip := "127.0.0.1"; -#mp_callagent_udp_port := 2727; -#mp_mgw_ip := "127.0.0.1"; -#mp_mgw_udp_port := 2427; [MAIN_CONTROLLER] -- To view, visit https://gerrit.osmocom.org/6176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3cb756750cafba4ca481a0a98d19e27cb58395df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Fix TC_paging_imsi_nochan Message-ID: Review at https://gerrit.osmocom.org/6177 bsc: Fix TC_paging_imsi_nochan The point of this test is to verify that *no* paging messages are sent if "No cell" is given as cell identifier list by the MSC. We can thus not use the existing pageing_helper function, but have to handle this a bit differently. This makes TC_paging_imsi_nochan runs pass. Change-Id: Iec1086bd42f42de1986bb00b91af718977f73b30 --- M bsc/BSC_Tests.ttcn 1 file changed, 26 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/77/6177/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 69f072b..29150ce 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -976,7 +976,32 @@ testcase TC_paging_imsi_nochan() runs on test_CT { var BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := valueof(ts_BSSMAP_CIL_noCell); - f_pageing_helper('001010123456789'H, cid_list, c_BtsId_all); + var integer i; + + f_init(); + f_bssap_reset(); + + /* Clear the queue, it might still contain stuff like BCCH FILLING */ + for (i := 0; i < NUM_BTS; i := i + 1) { + IPA_RSL[i].clear; + } + + f_bssap_tx_ud(ts_BSSMAP_Paging('001010123456789'H, cid_list, omit, omit)); + + /* wait for some time until when paging messages would appear */ + f_sleep(3.0); + + for (i := 0; i < NUM_BTS; i := i + 1) { + timer T := 0.01; + T.start; + alt { + [] IPA_RSL[i].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { + setverdict(fail, "Received unexpected paging"); + } + [] T.timeout {} + } + } + setverdict(pass); } /* PAGING by IMSI + TMSI */ -- To view, visit https://gerrit.osmocom.org/6177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iec1086bd42f42de1986bb00b91af718977f73b30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_Templates: Some more convenience extraction functions Message-ID: Review at https://gerrit.osmocom.org/6178 MGCP_Templates: Some more convenience extraction functions Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7 --- M library/MGCP_Templates.ttcn 1 file changed, 17 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/78/6178/1 diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 7f10bd2..5a8d9b1 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -273,20 +273,33 @@ return ""; } - function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { + function f_MgcpResp_extract_par(MgcpResponse resp, MgcpInfoCode code) return charstring { var MgcpMessage msg := { response := resp } - return str2hex(f_mgcp_extract_par(msg, "I")); + return f_mgcp_extract_par(msg, code); } - function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId { + function f_MgcpCmd_extract_par(MgcpCommand cmd, MgcpInfoCode code) return charstring { var MgcpMessage msg := { command := cmd } - return str2hex(f_mgcp_extract_par(msg, "C")); + return f_mgcp_extract_par(msg, code); } + function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { + return str2hex(f_MgcpResp_extract_par(resp, "I")); + } + + function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId { + return str2hex(f_MgcpCmd_extract_par(cmd, "C")); + } + + function f_MgcpCmd_extract_conn_id(MgcpCommand cmd) return MgcpConnectionId { + return str2hex(f_MgcpCmd_extract_par(cmd, "I")); + } + + function f_mgcp_alloc_tid() return MgcpTransId { return int2str(float2int(rnd()*2147483647.0)); } -- To view, visit https://gerrit.osmocom.org/6178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL Message-ID: Review at https://gerrit.osmocom.org/6179 RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL There are quite a number of non-transparent RLL messages, such as RLL_RELEASE_REQ. Make sure we match those as intended. Change-Id: I30260a57fc01613450e6ac66e0af97c29041b4fa --- M library/RSL_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/79/6179/1 diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index f42b7fd..b3d758b 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -711,7 +711,7 @@ /* dedicated channel or RLL */ template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { - msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,true}, {RSL_MDISC_IPACCESS,false}) + msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false}) } -- To view, visit https://gerrit.osmocom.org/6179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I30260a57fc01613450e6ac66e0af97c29041b4fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: RSL_Types: More templates, f_rsl_find_ie() for finding an IE... Message-ID: Review at https://gerrit.osmocom.org/6180 RSL_Types: More templates, f_rsl_find_ie() for finding an IE in a message Change-Id: Id7fa7d672c1fde97882fa44959501e8bf7b8dc0b --- M library/RSL_Types.ttcn 1 file changed, 20 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/80/6180/1 diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index b3d758b..765a91e 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -909,6 +909,15 @@ msg_type := RSL_MT_MODE_MODIFY_NACK } + /* 8.4.14: BTS <- BSC */ + template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := { + msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), + msg_type := RSL_MT_RF_CHAN_REL, + ies := { + tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) + } + } + /* 8.4.19 BTS -> BSC */ template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) := ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), @@ -1160,5 +1169,16 @@ } + function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean { + for (var integer i := 0; i < sizeof(msg.ies); i := i+1) { + if (msg.ies[i].iei == iei) { + ret := msg.ies[i].body; + return true; + } + } + return false; + } + + } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/6180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7fa7d672c1fde97882fa44959501e8bf7b8dc0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm Message-ID: Review at https://gerrit.osmocom.org/6181 GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm Change-Id: I22dca2338ad66c81add5d161bd2a3b3e8e15bdcf --- M library/GSM_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/81/6181/1 diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index 1efeac8..e1d6b48 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -93,7 +93,7 @@ template RslChannelNr t_RslChanNr_PCH_AGCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH); template RslChannelNr t_RslChanNr_Bm(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH); template RslChannelNr t_RslChanNr_PDCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_PDCH); - template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, uint1_t sub_slot) := { + template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, template uint1_t sub_slot) := { u := { lm := { tag := '0001'B, sub_chan := sub_slot } }, tn := tn } -- To view, visit https://gerrit.osmocom.org/6181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22dca2338ad66c81add5d161bd2a3b3e8e15bdcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: RSL_Emulation: Permit registration of explicit Channel Number Message-ID: Review at https://gerrit.osmocom.org/6182 RSL_Emulation: Permit registration of explicit Channel Number During assignment or hand-over, a given TTCN-3 component may be interested in registering more than one channel number. Add an explicit procedure port with associated registration procedure, similar to what we already do in GSUP, MNCC and others. Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb --- M bsc/BSC_Tests.ttcn M library/RSL_Emulation.ttcn 2 files changed, 77 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/82/6182/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 29150ce..7e5b675 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1222,6 +1222,7 @@ connect(vc_conn:BSSMAPEM, vc_BSSMAP:PROC); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); + connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); vc_conn.start(derefers(fn)(id)); diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index a19e627..cbcff2c 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -31,6 +31,7 @@ type component RSL_DchanHdlr { /* port facing up towards dedicated channel handler */ port RSL_DCHAN_PT RSL; + port RSLEM_PROC_PT RSL_PROC; var RslChannelNr g_chan_nr; }; @@ -46,6 +47,12 @@ type port RSL_DCHAN_PT message { inout RSLDC_ChanRqd, RSL_Message; +} with { extension "internal" }; + +signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); + +type port RSLEM_PROC_PT procedure { + inout RSLEM_register; } with { extension "internal" }; /*********************************************************************** @@ -163,7 +170,8 @@ runs on RSL_Emulation_CT return integer { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { - if (not ispresent(ConnectionTable[i].ra)) { + if (not ispresent(ConnectionTable[i].ra) and + not ispresent(ConnectionTable[i].trx_nr)) { ConnectionTable[i].ra := ra; ConnectionTable[i].ra_fn := fn; ConnectionTable[i].comp_ref := comp_ref; @@ -174,14 +182,52 @@ return -1; } +/* create an ew client with given RA and FN */ +private function f_cid_create_cnr(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr comp_ref) +runs on RSL_Emulation_CT return integer { + var integer i; + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + if (not ispresent(ConnectionTable[i].ra) and + not ispresent(ConnectionTable[i].trx_nr)) { + ConnectionTable[i].stream_id := f_streamId_by_trx(trx_nr); + ConnectionTable[i].trx_nr := trx_nr; + ConnectionTable[i].chan_nr := chan_nr; + ConnectionTable[i].comp_ref := comp_ref; + return i; + } + } + log("No free entry in conn table for ", trx_nr, chan_nr, comp_ref); + return -1; +} + + +/* create an ew client with given RA and FN */ +private function f_cid_delete_cnr(IpaStreamId stream_id, RslChannelNr chan_nr, RSL_DchanHdlr comp_ref) +runs on RSL_Emulation_CT return integer { + var integer i; + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + if (ConnectionTable[i].comp_ref == null) { + continue; + } + if (ConnectionTable[i].stream_id == stream_id and + ConnectionTable[i].chan_nr == chan_nr and + ConnectionTable[i].comp_ref == comp_ref) { + f_cid_clear(i); + } + } + log("Unable to find entry to delete for ", stream_id, chan_nr, comp_ref); + return -1; +} + + private function f_cid_clear(integer cid) runs on RSL_Emulation_CT { ConnectionTable[cid].ra := omit; ConnectionTable[cid].ra_fn := omit; - ConnectionTable[cid].ra_fn := omit; ConnectionTable[cid].trx_nr := omit; ConnectionTable[cid].stream_id := omit; ConnectionTable[cid].chan_nr := omit; + ConnectionTable[cid].comp_ref := null; } type component RSL_Emulation_CT { @@ -189,6 +235,7 @@ port IPA_RSL_PT IPA_PT; /* port facing up towards dedicated channel handler */ port RSL_DCHAN_PT CLIENT_PT; + port RSLEM_PROC_PT RSL_PROC; /* state of all concurrent connections / dedicated channels */ var ConnectionData ConnectionTable[64]; @@ -205,12 +252,24 @@ return enum2int(id); } +private function f_streamId_by_trx(uint8_t trx_nr) return IpaStreamId { + select (trx_nr) { + case (0) { return IPAC_PROTO_RSL_TRX0; } + case (1) { return IPAC_PROTO_RSL_TRX1; } + case (2) { return IPAC_PROTO_RSL_TRX2; } + case (3) { return IPAC_PROTO_RSL_TRX3; } + } + self.stop; +} + function main() runs on RSL_Emulation_CT { var ASP_RSL_Unitdata rx_rsl; var RSL_Message rx_rsl_msg; var RSLDC_ChanRqd chan_rqd; var RSL_DchanHdlr vc_conn; + var RslChannelNr chan_nr; + var uint8_t trx_nr; var integer cid; var integer i; @@ -236,6 +295,7 @@ cid := f_cid_by_ra_fn(ra, fn); if (cid == -1) { setverdict(fail, "IMM ASS for unknown DChan"); + self.stop; } /* update client with trx_nr */ ConnectionTable[cid].trx_nr := f_trx_by_streamId(rx_rsl.streamId); @@ -280,7 +340,7 @@ /* blindly acknowledge all channel activations */ [] IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) -> value rx_rsl { - var RslChannelNr chan_nr := rx_rsl.rsl.ies[0].body.chan_nr; + chan_nr := rx_rsl.rsl.ies[0].body.chan_nr; IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.streamId, ts_RSL_CHAN_ACT_ACK(chan_nr, 23))); } @@ -313,6 +373,12 @@ IPA_PT.send(ts_ASP_RSL_UD(ConnectionTable[cid].stream_id, rx_rsl_msg)); } + /* explicit registration, e.g. in (non-immediate) assignment case */ + [] RSL_PROC.getcall(RSLEM_register:{?,?,?}) -> param(trx_nr, chan_nr, vc_conn) { + f_cid_create_cnr(trx_nr, chan_nr, vc_conn); + RSL_PROC.reply(RSLEM_register:{trx_nr, chan_nr, vc_conn}); + } + } } } @@ -327,4 +393,11 @@ } } +/* client/conn_hdlr side function to use procedure port to register stream_id/chan_nr */ +function f_rslem_register(uint8_t trx_nr, RslChannelNr chan_nr) runs on RSL_DchanHdlr { + RSL_PROC.call(RSLEM_register:{trx_nr, chan_nr, self}) { + [] RSL_PROC.getreply(RSLEM_register:{?,?,?}) {}; + } +} + } -- To view, visit https://gerrit.osmocom.org/6182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Permit MGCP messages from random ports on BSC side Message-ID: Review at https://gerrit.osmocom.org/6183 bsc: Permit MGCP messages from random ports on BSC side Change-Id: Ie8896edc3f4310a78b584fd4ad017b77bda22afb --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/83/6183/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 7e5b675..9da5b65 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -191,7 +191,7 @@ }; var MGCP_conn_parameters mgcp_pars := { callagent_ip := mp_bsc_ip, - callagent_udp_port := 2727, + callagent_udp_port := -1, mgw_ip := mp_test_ip, mgw_udp_port := 2427 }; -- To view, visit https://gerrit.osmocom.org/6183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie8896edc3f4310a78b584fd4ad017b77bda22afb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: L3_Templates: Add ts_RRM_AssignmentComplete Message-ID: Review at https://gerrit.osmocom.org/6184 L3_Templates: Add ts_RRM_AssignmentComplete Change-Id: I3ae33ea00496eaef5885a58cd5fbc491abe68c87 --- M library/L3_Templates.ttcn 1 file changed, 16 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/84/6184/1 diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 7736ff5..ed477d5 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -251,6 +251,22 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + assignmentComplete := { + messageType := '00101001'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} template PDU_ML3_MS_NW ts_ML3_MO := { discriminator := '0000'B, -- To view, visit https://gerrit.osmocom.org/6184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3ae33ea00496eaef5885a58cd5fbc491abe68c87 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP... Message-ID: Review at https://gerrit.osmocom.org/6185 MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP_ConnHdlr A given MGCP_ConnHdlr is handling multiple connections on one Endpoint anyway, and the variable is not set or used anywhere. Change-Id: If9eea3f665289a52915f114f0a69234aad28f322 --- M library/MGCP_Emulation.ttcn 1 file changed, 0 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/85/6185/1 diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 074385c..df8e4b4 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -38,7 +38,6 @@ port MGCP_Conn_PT MGCP; /* procedure based port to register for incoming connections */ port MGCPEM_PROC_PT MGCP_PROC; - var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/6185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If9eea3f665289a52915f114f0a69234aad28f322 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:07:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:07:18 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Implement Assignment handling Message-ID: Review at https://gerrit.osmocom.org/6186 bsc: Implement Assignment handling This adds code for the rather intricated and nested transactions happening on RSL, BSSAP, MGCP and RSL-IPA. We use explicit invocation of altsteps to simplify the main function f_establish_fully. Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b --- M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh M bsc/regen_makefile.sh 3 files changed, 379 insertions(+), 61 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/86/6186/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index d619068..80bc1fb 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -8,6 +8,9 @@ import from BSSMAP_Emulation all; import from BSSMAP_Templates all; +import from IPL4asp_Types all; +import from Native_Functions all; + import from MGCP_Types all; import from MGCP_Templates all; import from MGCP_Emulation all; @@ -18,8 +21,197 @@ import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; -//import from MobileL3_RRM_Types all; +import from MobileL3_RRM_Types all; import from L3_Templates all; + + +/*********************************************************************** + * Media related handling + ***********************************************************************/ + +/* Tuple containing host/ip and port */ +type record HostPort { + HostName host, + PortNumber port_nr +}; + +/* State encapsulating one MGCP Connection */ +type record MgcpConnState { + boolean crcx_seen, + MgcpConnectionId conn_id, + charstring mime_type, /* e.g. AMR */ + integer sample_rate, /* 8000 */ + integer ptime, /* 20 */ + uint7_t rtp_pt, /* RTP Payload Type */ + HostPort mgw, /* MGW side */ + HostPort peer /* CA side */ +}; + +/* BTS media state */ +type record BtsMediaState { + boolean ipa_crcx_seen, + uint16_t conn_id, + uint7_t rtp_pt, + HostPort bts, + HostPort peer +}; + +type record MediaState { + MgcpEndpoint mgcp_ep, + MgcpConnState mgcp_conn[2], + BtsMediaState bts +}; + +function f_MediaState_init(inout MediaState g_media, integer nr, HostName bts, HostName mgw) { + /* BTS Side */ + g_media.bts := { + ipa_crcx_seen := false, + conn_id := nr, + rtp_pt := 0, + bts := { + host := bts, + port_nr := 9000 + nr*2 + }, + peer := - + } + + //g_media.mgcp_ep := int2str(i) & "@mgw"; + + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + g_media.mgcp_conn[i].mime_type := "AMR"; + g_media.mgcp_conn[i].sample_rate := 8000; + g_media.mgcp_conn[i].ptime := 20; + g_media.mgcp_conn[i].rtp_pt := 98; + g_media.mgcp_conn[i].crcx_seen := false; + g_media.mgcp_conn[i].conn_id := f_mgcp_alloc_conn_id(); + } + + g_media.mgcp_conn[0].mgw := { + host := mgw, + port_nr := 10000 + nr*2 + } + g_media.mgcp_conn[1].mgw := { + host := mgw, + port_nr := 11000 + nr*2 + } +} + +private function f_get_free_mgcp_conn() runs on MSC_ConnHdlr return integer { + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + if (not g_media.mgcp_conn[i].crcx_seen) { + return i; + } + } + setverdict(fail, "Only 2 Connections per EP!"); + self.stop; + return -1; +} + +private function f_get_mgcp_conn(MgcpConnectionId cid) runs on MSC_ConnHdlr return integer { + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + if (g_media.mgcp_conn[i].conn_id == cid and g_media.mgcp_conn[i].crcx_seen) { + return i; + } + } + setverdict(fail, "No Connection for ID ", cid); + self.stop; + return -1; +} + + +/* altstep for handling of IPA + MGCP media related commands. Can be activated by a given + * test case if it expects to see media related handling (i.e. voice calls */ +altstep as_Media() runs on MSC_ConnHdlr { + var RSL_Message rsl; + var MgcpCommand mgcp_cmd; + var RSL_IE_Body ie; + [not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl { + /* Extract parameters from request + use in response */ + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt; + } + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt2; + } + RSL.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts.conn_id, + oct2int(f_inet_addr(g_media.bts.bts.host)), + g_media.bts.bts.port_nr, + g_media.bts.rtp_pt)); + g_media.bts.ipa_crcx_seen := true; + repeat; + } + [g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{ + /* Extract conn_id, ip, port, rtp_pt2 from request + use in response */ + f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie); + if (g_media.bts.conn_id != ie.ipa_conn_id) { + setverdict(fail, "IPA MDCX for unknown ConnId", rsl); + self.stop; + } + /* mandatory */ + f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie); + g_media.bts.peer.host := f_inet_ntoa(int2oct(ie.ipa_remote_ip, 4)); + f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie); + g_media.bts.peer.port_nr := ie.ipa_remote_port; + /* optional */ + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt; + } + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt2; + } + RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts.conn_id, + oct2int(f_inet_addr(g_media.bts.peer.host)), + g_media.bts.peer.port_nr, + g_media.bts.rtp_pt)); + //g_media.ipa_mdcx_seen := true; + repeat; + } + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + var SDP_Message sdp; + var integer cid := f_get_free_mgcp_conn(); + if (isvalue(mgcp_cmd.sdp)) { + sdp := mgcp_cmd.sdp; + g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr; + g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number; + } + var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid]; + sdp := valueof(ts_SDP(mgcp_conn.mgw.host, mgcp_conn.mgw.host, "foo", "21", + mgcp_conn.mgw.port_nr, { int2str(mgcp_conn.rtp_pt) }, + {valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt, + mgcp_conn.mime_type & "/" & + int2str(mgcp_conn.sample_rate))), + valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); + g_media.mgcp_conn[cid].crcx_seen := true; + repeat; + } + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + var SDP_Message sdp; + var integer cid := f_get_mgcp_conn(f_MgcpCmd_extract_conn_id(mgcp_cmd)); + if (isvalue(mgcp_cmd.sdp)) { + sdp := mgcp_cmd.sdp; + g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr; + g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number; + } else { + setverdict(fail, "MDCX has no [recognizable] SDP"); + /* HACK HACK HACK */ + g_media.mgcp_conn[cid].peer.host := "8.8.8.8"; + g_media.mgcp_conn[cid].peer.port_nr := 2342; + } + var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid]; + sdp := valueof(ts_SDP(mgcp_conn.peer.host, mgcp_conn.peer.host, "foo", "21", + mgcp_conn.peer.port_nr, { int2str(mgcp_conn.rtp_pt) }, + {valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt, + mgcp_conn.mime_type & "/" & + int2str(mgcp_conn.sample_rate))), + valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); + //mgcp_mdcx_seen := true; + repeat; + } +} + + /* this component represents a single subscriber connection at the MSC. @@ -32,7 +224,12 @@ /* procedure port back to our parent (BSSMAP_Emulation_CT) for control */ port BSSMAPEM_PROC_PT BSSMAPEM; - var MSC_State g_state := MSC_STATE_NONE; + var MediaState g_media; +} + +/* initialize all parameters */ +function f_MscConnHdlr_init(integer i, HostName bts, HostName mgw) runs on MSC_ConnHdlr { + f_MediaState_init(g_media, i, bts, mgw); } /* Callback function from general BSSMAP_Emulation whenever a connectionless @@ -58,15 +255,6 @@ const MGCPOps MSC_MGCPOps := { create_cb := refers(MGCP_Emulation.ExpectedCreateCallback) -} - -type enumerated MSC_State { - MSC_STATE_NONE, - MSC_STATE_WAIT_ASS_COMPL, - MSC_STATE_WAIT_CRCX_ACK, - MSC_STATE_WAIT_MDCX_ACK, - MSC_STATE_WAIT_CLEAR_COMPL, - MSC_STATE_WAIT_DLCX_ACK } /* register an expect with the BSSMAP core */ @@ -149,69 +337,196 @@ } } -/* establish a channel fully, expecting an assignment matching 'exp' */ -function f_establish_fully(TestHdlrParams pars, PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) -runs on MSC_ConnHdlr return PDU_BSSAP { - var PDU_BSSAP bssap; +/* Convert from Ericsson ChanDesc2 format to Osmocom RslChannelNr format */ +function f_ChDesc2RslChanNr(ChannelDescription2_V ch_desc, out RslChannelNr chan_nr, out GsmArfcn arfcn) { + var BIT5 inp := ch_desc.channelTypeandTDMAOffset; + + chan_nr.tn := bit2int(ch_desc.timeslotNumber); + + if (match(inp, '00001'B)) { /* TCH/F */ + chan_nr.u.ch0 := RSL_CHAN_NR_Bm_ACCH; + } + else if (match(inp, '0001?'B)) { /* TCH/H */ + chan_nr.u.lm.sub_chan := bit2int(substr(inp, 4, 1)); + } + else if (match(inp, '001??'B)) { /* SDCCH/4 */ + chan_nr.u.sdcch4.sub_chan := bit2int(substr(inp, 3, 2)); + } + else if (match(inp, '01???'B)) { /* SDCCH/8 */ + chan_nr.u.sdcch8.sub_chan := bit2int(substr(inp, 2, 3)); + } + else { + setverdict(fail, "Unknown ChDesc!"); + self.stop; + } + + if (ch_desc.octet3 and4b '10'O == '10'O) { + setverdict(fail, "No support for Hopping"); + self.stop; + } else { + var OCT2 concat := ch_desc.octet3 & ch_desc.octet4; + arfcn := oct2int(concat); + } +} + +type record AssignmentState { + /* global */ + boolean voice_call, + boolean is_assignment, + /* Assignment related bits */ + boolean rr_ass_cmpl_seen, + RslChannelNr old_chan_nr, + /* Modify related bits */ + boolean rr_modify_seen, + boolean rsl_modify_seen +} + +template (value) AssignmentState ts_AssignmentStateInit := { + voice_call := false, + is_assignment := false, + rr_ass_cmpl_seen := false, + old_chan_nr := -, + rr_modify_seen := false, + rsl_modify_seen := false +} + +altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr { var RSL_Message rsl; - var MgcpCommand cmd; - timer T := 10.0; - var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); - var boolean crcx_seen := false; - var boolean rr_modify_seen := false; - var ExpectCriteria mgcpcrit := { - connid := omit, - endpoint := omit, - transid := omit - }; - var SDP_Message sdp; + [not st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl { + var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload); + log("Rx L3 from net: ", l3); + if (ischosen(l3.msgs.rrm.assignmentCommand)) { + var RslChannelNr new_chan_nr; + var GsmArfcn arfcn; + f_ChDesc2RslChanNr(l3.msgs.rrm.assignmentCommand.descrOf1stChAfterTime, + new_chan_nr, arfcn); + /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ - mgcp_conn_id := f_mgcp_alloc_conn_id(); - f_create_chan_and_exp(pars); - /* we should now have a COMPL_L3 at the MSC */ - - BSSAP.receive(tr_BSSMAP_ComplL3); - f_create_mgcp_expect(mgcpcrit); - BSSAP.send(ass_cmd); - MGCP.receive(tr_CRCX) -> value cmd; - sdp := valueof(ts_SDP("127.0.0.1", "127.0.0.1", "foo", "21", 1000, { "98" }, - {valueof(ts_SDP_rtpmap(98, "AMR/8000")), - valueof(ts_SDP_ptime(20)) } )); - MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, sdp)) - - alt { - /* if we receive exactly what we expected, always return + pass */ - [] BSSAP.receive(exp_ass_cpl) -> value bssap { - setverdict(pass); - return bssap; + /* register our component for this channel number at the RSL Emulation */ + f_rslem_register(0, new_chan_nr); + var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_AssignmentComplete('00'O)); + /* send assignment complete over the new channel */ + RSL.send(ts_RSL_DATA_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), + enc_PDU_ML3_MS_NW(l3_tx))); + /* by default, send via the new channel from now */ + st.old_chan_nr := g_chan_nr; + g_chan_nr := new_chan_nr; + st.rr_ass_cmpl_seen := true; + repeat; + } else { + setverdict(fail, "Unexpected L3 received", l3); + self.stop; } - [rr_modify_seen == false] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl { + } + [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) { + RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); + repeat; + } + [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_RF_CHAN_REL(st.old_chan_nr)) { + RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr)); + /* FIXME: unregister for old channel number in RSL emulation */ + //f_rslem_unregister(0, st.old_chan_nr); + repeat; + } +} + +altstep as_modify(inout AssignmentState st) runs on MSC_ConnHdlr { + /* no assignment, just mode modify */ + var RSL_Message rsl; + + [st.voice_call and not st.rr_modify_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl { var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload); log("Rx L3 from net: ", l3); if (ischosen(l3.msgs.rrm.channelModeModify)) { f_rsl_reply(ts_RRM_ModeModifyAck(l3.msgs.rrm.channelModeModify.channelDescription, l3.msgs.rrm.channelModeModify.channelMode), rsl); - rr_modify_seen := true; + st.rr_modify_seen := true; } repeat; } - [rr_modify_seen] RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl { + [st.voice_call and st.rr_modify_seen] RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl { RSL.send(ts_RSL_MODE_MODIFY_ACK(g_chan_nr)); + st.rsl_modify_seen := true; repeat; } - [crcx_seen == false] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl { - RSL.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, 1, 1, 1, 1)); - crcx_seen := true; - repeat; - } - /* mgw CRCX goes here */ +} - [crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{ - RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, 1, 1, 1, 1)); - repeat; +/* Determine if given rsl_chan_nr is compatible with given BSSMAP ChannelType */ +function f_channel_compatible(BSSMAP_IE_ChannelType bssmap, RslChannelNr rsl_chan_nr) +return boolean { + select (bssmap.speechOrDataIndicator) { + case ('0011'B) { /* Signalling */ + /* all channels support signalling */ + return true; + } + case else { /* Speech, Speech+CTM or CSD */ + select (bssmap.channelRateAndType) { + case ('08'O) { /* TCH/F */ + select (rsl_chan_nr) { + case (t_RslChanNr_Bm(?)) { return true; } + } + } + case ('09'O) { /* TCH/H */ + select (rsl_chan_nr) { + case (t_RslChanNr_Lm(?, ?)) { return true; } + } + } + case else { /* full or half-rate */ + select (rsl_chan_nr) { + case (t_RslChanNr_Bm(?)) { return true; } + case (t_RslChanNr_Lm(?, ?)) { return true; } + } + } + } } - /* mgw MGCX goes here */ + } + return false; +} +/* establish a channel fully, expecting an assignment matching 'exp' */ +function f_establish_fully(TestHdlrParams pars, PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) +runs on MSC_ConnHdlr return PDU_BSSAP { + var PDU_BSSAP bssap; + timer T := 10.0; + var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); + var ExpectCriteria mgcpcrit := { + connid := omit, + endpoint := omit, + transid := omit + }; + var AssignmentState st := valueof(ts_AssignmentStateInit); + /* if the channel type is SIGNAL, we're not handling a voice call */ + if (ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechOrDataIndicator != '0011'B) { + st.voice_call := true; + } + /* determine if the current channel can support the given service or not */ + if (not f_channel_compatible(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr)) { + st.is_assignment := true; + } + + f_MediaState_init(g_media, 1, "127.0.0.2", "127.0.0.3"); + + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + f_create_mgcp_expect(mgcpcrit); + BSSAP.send(ass_cmd); + + T.start; + alt { + /* assignment related bits */ + [st.is_assignment] as_assignment(st); + + /* modify related bits */ + [not st.is_assignment] as_modify(st); + + /* voice call related bits (IPA CRCX/MDCX + MGCP) */ + [st.voice_call] as_Media(); + + /* if we receive exactly what we expected, always return + pass */ + [] BSSAP.receive(exp_ass_cpl) -> value bssap { + setverdict(pass); + } [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { setverdict(fail, "Received non-matching ASSIGNMENT COMPLETE"); } @@ -228,8 +543,11 @@ setverdict(inconc, "Timeout waiting for ASSIGNMENT COMPLETE"); } } - - self.stop; + log("g_media ", g_media); + if (not isbound(bssap)) { + self.stop; + } + return bssap; } diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index af747b3..6417a3c 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh index 1d5b92b..08eaae4 100755 --- a/bsc/regen_makefile.sh +++ b/bsc/regen_makefile.sh @@ -2,6 +2,6 @@ MAIN=BSC_Tests.ttcn -FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc *.c" +FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc *.c" ../regen-makefile.sh $MAIN $FILES -- To view, visit https://gerrit.osmocom.org/6186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:31:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:31:57 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Validate DNS PCO values In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I54124cb5269c0992e6c72af1a1ecaa8e3202bf05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:32:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:32:08 +0000 Subject: osmo-ttcn3-hacks[master]: start-testsuite.sh: Add archlinux tccn3 path to LD_LIBRARY_PATH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I99219f4ab36c82e562ef3fed047d3c52d64497f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:32:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:32:18 +0000 Subject: osmo-ttcn3-hacks[master]: regen-makefile.sh: Support Archlinux install paths In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I545f2f04890310e98233b04b44c4614df34f2f17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:32:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:32:27 +0000 Subject: osmo-ttcn3-hacks[master]: regen-makefile.sh: Exit with clear error if ttcn3 bin not found In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I866a758ec472968f368866e3b3b24dc6f14ac7cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:32:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:32:34 +0000 Subject: osmo-ttcn3-hacks[master]: gitignore: Ignore dependency subdirs In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I843da5c51d68102b992ce178404d8601c520229f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:32:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:32:47 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Configure expected GGSN DNS values and improve e... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie64ca0b4cda22fd358c8c304d5b3909fd9685948 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:32:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:32:56 +0000 Subject: osmo-ttcn3-hacks[master]: library: Implement f_inet6_addr function In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icb6dd38462501895d1b4409a3c530793917bd803 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:28 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: library: Implement f_inet6_addr function In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: library: Implement f_inet6_addr function ...................................................................... library: Implement f_inet6_addr function It can be used to parse IPv6 functions, since inet_addr supports IPv4 only. Change-Id: Icb6dd38462501895d1b4409a3c530793917bd803 --- M library/Native_FunctionDefs.cc M library/Native_Functions.ttcn 2 files changed, 18 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/Native_FunctionDefs.cc b/library/Native_FunctionDefs.cc index 5dda08c..8aa31b4 100644 --- a/library/Native_FunctionDefs.cc +++ b/library/Native_FunctionDefs.cc @@ -7,12 +7,28 @@ #include #include #include +#include +#include +#include #include #include namespace Native__Functions { +OCTETSTRING f__inet6__addr(const CHARSTRING& in) +{ + char buf[INET6_ADDRSTRLEN]; + TTCN_Buffer ttcn_buffer(in); + int ret; + + ret = inet_pton(AF_INET6, (const char *)ttcn_buffer.get_data(), buf); + if(ret < 1) + fprintf(stderr, "inet_pton failed: %d %s\n", ret, strerror(errno)); + + return OCTETSTRING(16, (const unsigned char *)&buf[0]); +} + OCTETSTRING f__inet__addr(const CHARSTRING& in) { TTCN_Buffer ttcn_buffer(in); diff --git a/library/Native_Functions.ttcn b/library/Native_Functions.ttcn index 31bc767..d59670a 100644 --- a/library/Native_Functions.ttcn +++ b/library/Native_Functions.ttcn @@ -1,5 +1,7 @@ module Native_Functions { + /* direct import of inet_pton(AF_INET6) C function, returns net byte order */ + external function f_inet6_addr(in charstring ch) return octetstring; /* direct import of inet_addr() C function, returns net byte order */ external function f_inet_addr(in charstring ch) return octetstring; /* like inet_addr() but return is host byte order */ -- To view, visit https://gerrit.osmocom.org/6156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icb6dd38462501895d1b4409a3c530793917bd803 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:28 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: ggsn_tests: Configure expected GGSN DNS values and improve e... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn_tests: Configure expected GGSN DNS values and improve error message ...................................................................... ggsn_tests: Configure expected GGSN DNS values and improve error message Change-Id: Ie64ca0b4cda22fd358c8c304d5b3909fd9685948 --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 15 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index e97578c..90368b9 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -14,8 +14,10 @@ [MODULE_PARAMETERS] GGSN_Tests.m_bind_ip_gtpc := "127.0.42.1" GGSN_Tests.m_bind_ip_gtpu := "127.0.42.1" -GGSN_Tests.m_ggsn_ip_gtpc := "127.0.23.1" -GGSN_Tests.m_ggsn_ip_gtpu := "127.0.23.1" +GGSN_Tests.m_ggsn_ip_gtpc := "127.0.0.2" +GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2" +GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1" +GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8" [EXECUTE] #GGSN_Tests.TC_dummy diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 23e7054..06d9dcf 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -23,6 +23,9 @@ charstring m_ggsn_ip_gtpc := "127.0.0.6"; charstring m_ggsn_ip_gtpu := "127.0.0.6"; + + charstring m_ggsn_ip4_dns1 := "192.168.100.1" + charstring m_ggsn_ip4_dns2 := "8.8.8.8" } type set PdpContext { @@ -954,6 +957,8 @@ /* Test PDP context activation for dynamic IPv4 EUA with IPv4 DNS in IPCP */ testcase TC_pdp4_act_deact_ipcp() runs on GT_CT { f_init(); + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); ctx.pco_req := valueof(ts_PCO_IPv4_DNS_IPCP); f_pdp_ctx_act(ctx); @@ -963,8 +968,12 @@ } /* verify IPCP contains both primary and secondary DNS */ var IpcpPacket ipcp := dec_IpcpPacket(f_PCO_extract_proto(ctx.pco_neg, '8021'O)); - if (not match(ipcp, tr_IPCP_Ack_DNS(0, 'C0A86401'O, '08080808'O))) { - setverdict(fail, "Primary/Secondary DNS not found in IPCP"); + if (not match(ipcp, tr_IPCP_Ack_DNS(0, ggsn_ip4_dns1, ggsn_ip4_dns2))) { + if (not match(ipcp, tr_IPCP_Ack_DNS(0))) { + setverdict(fail, "Primary/Secondary DNS PCO IPCP option not found"); + } else { + setverdict(fail, "Primary/Secondary DNS PCO IPCP option found but not matching expected values"); + } } f_pdp_ctx_del(ctx, '1'B); } -- To view, visit https://gerrit.osmocom.org/6155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie64ca0b4cda22fd358c8c304d5b3909fd9685948 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:29 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: gitignore: Ignore dependency subdirs In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gitignore: Ignore dependency subdirs ...................................................................... gitignore: Ignore dependency subdirs Change-Id: I843da5c51d68102b992ce178404d8601c520229f --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/.gitignore b/.gitignore index d525ada..d8c3ab3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ bin/*.cc bin/*.hh +deps/*/ *.o *.log *.so -- To view, visit https://gerrit.osmocom.org/6154 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I843da5c51d68102b992ce178404d8601c520229f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:29 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: regen-makefile.sh: Exit with clear error if ttcn3 bin not found In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: regen-makefile.sh: Exit with clear error if ttcn3 bin not found ...................................................................... regen-makefile.sh: Exit with clear error if ttcn3 bin not found Change-Id: I866a758ec472968f368866e3b3b24dc6f14ac7cb --- M regen-makefile.sh 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/regen-makefile.sh b/regen-makefile.sh index e89b3ee..7edd783 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -10,6 +10,8 @@ # unstable, so far tested with TITAN 6.1.0, 6.2.0 and 6.3.0 # +test -x "$(which ttcn3_makefilegen 2>/dev/null)" || { echo "ERROR: ttcn3_makefilegen not in PATH"; exit 1; } + ttcn3_makefilegen -l -f $* sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile sed -i -e 's/LDFLAGS = /LDFLAGS = -L \/usr\/lib\/titan /' Makefile -- To view, visit https://gerrit.osmocom.org/6153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I866a758ec472968f368866e3b3b24dc6f14ac7cb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:29 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: regen-makefile.sh: Support Archlinux install paths In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: regen-makefile.sh: Support Archlinux install paths ...................................................................... regen-makefile.sh: Support Archlinux install paths Archlinux (titan-git AUR package) installs everything (includes, libs and bin) into /usr/ttcn/ prefix. Change-Id: I545f2f04890310e98233b04b44c4614df34f2f17 --- M regen-makefile.sh 1 file changed, 5 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/regen-makefile.sh b/regen-makefile.sh index f757fa3..e89b3ee 100755 --- a/regen-makefile.sh +++ b/regen-makefile.sh @@ -20,5 +20,9 @@ sed -i -e 's/CPPFLAGS = -D$(PLATFORM) -I$(TTCN3_DIR)\/include/CPPFLAGS = -D$(PLATFORM) -DMAKEDEPEND_RUN -I$(TTCN3_DIR)\/include -I\/usr\/include\/titan/' Makefile # for TITAN 6.3.0 -sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile +if cat /etc/issue | grep "Arch Linux" >/dev/null 2>&1; then + sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr\/ttcn3/' Makefile +else + sed -i -e 's/TTCN3_DIR = $/TTCN3_DIR = \/usr/' Makefile +fi sed -i -e 's/\/bin\/compiler/\/bin\/ttcn3_compiler/' Makefile -- To view, visit https://gerrit.osmocom.org/6152 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I545f2f04890310e98233b04b44c4614df34f2f17 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:29 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: start-testsuite.sh: Add archlinux tccn3 path to LD_LIBRARY_PATH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: start-testsuite.sh: Add archlinux tccn3 path to LD_LIBRARY_PATH ...................................................................... start-testsuite.sh: Add archlinux tccn3 path to LD_LIBRARY_PATH Archlinux installs ttcn33 libaries in /usr/ttcn3/lib (titan-git package from AUR). Change-Id: I99219f4ab36c82e562ef3fed047d3c52d64497f1 --- M start-testsuite.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/start-testsuite.sh b/start-testsuite.sh index 87cf08b..a291a4f 100755 --- a/start-testsuite.sh +++ b/start-testsuite.sh @@ -15,4 +15,4 @@ CFG=$2 fi -LD_LIBRARY_PATH=`dirname $SUITE`:/usr/lib/titan ttcn3_start $SUITE $CFG +LD_LIBRARY_PATH=`dirname $SUITE`:/usr/lib/titan:/usr/ttcn3/lib ttcn3_start $SUITE $CFG -- To view, visit https://gerrit.osmocom.org/6151 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99219f4ab36c82e562ef3fed047d3c52d64497f1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:29 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: ggsn_tests: Validate DNS PCO values In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn_tests: Validate DNS PCO values ...................................................................... ggsn_tests: Validate DNS PCO values Change-Id: I54124cb5269c0992e6c72af1a1ecaa8e3202bf05 --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 34 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index 90368b9..d8994df 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -18,6 +18,8 @@ GGSN_Tests.m_ggsn_ip_gtpu := "127.0.0.2" GGSN_Tests.m_ggsn_ip4_dns1 := "192.168.100.1" GGSN_Tests.m_ggsn_ip4_dns2 := "8.8.8.8" +GGSN_Tests.m_ggsn_ip6_dns1 := "2001:4860:4860::8888" +GGSN_Tests.m_ggsn_ip6_dns2 := "2001:4860:4860::8844" [EXECUTE] #GGSN_Tests.TC_dummy diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index 06d9dcf..f7814db 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -26,6 +26,8 @@ charstring m_ggsn_ip4_dns1 := "192.168.100.1" charstring m_ggsn_ip4_dns2 := "8.8.8.8" + charstring m_ggsn_ip6_dns1 := "2001:4860:4860::8888" + charstring m_ggsn_ip6_dns2 := "2001:4860:4860::8844" } type set PdpContext { @@ -426,11 +428,15 @@ } /* extract a given protocol payload from PCO */ - function f_PCO_extract_proto(ProtConfigOptions pco, OCT2 protocol) return octetstring { + function f_PCO_extract_proto(ProtConfigOptions pco, OCT2 protocol, integer nth_match := 1) return octetstring { var integer i; + var integer num_matches := 0; for (i := 0; i < lengthof(pco.protocols); i := i + 1) { if (pco.protocols[i].protocolID == protocol) { - return pco.protocols[i].protoIDContents; + num_matches := num_matches + 1; + if (num_matches == nth_match) { + return pco.protocols[i].protoIDContents; + } } } setverdict(fail); @@ -925,6 +931,18 @@ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); ctx.pco_req := valueof(ts_PCO_IPv6_DNS); f_pdp_ctx_act(ctx); + + /* verify PCO contains both primary and secondary DNS */ + var OCT4 ggsn_ip6_dns1 := f_inet6_addr(m_ggsn_ip6_dns1); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 1), ggsn_ip6_dns1)) { + setverdict(fail, "Primary DNS IPv6 PCO option not found"); + } + + var OCT4 ggsn_ip6_dns2 := f_inet6_addr(m_ggsn_ip6_dns2); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '0003'O, 2), ggsn_ip6_dns2)) { + setverdict(fail, "Secondary DNS IPv6 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); } @@ -984,6 +1002,18 @@ var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); f_pdp_ctx_act(ctx); + + /* verify PCO contains both primary and secondary DNS */ + var OCT4 ggsn_ip4_dns1 := f_inet_addr(m_ggsn_ip4_dns1); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 1), ggsn_ip4_dns1)) { + setverdict(fail, "Primary DNS IPv4 PCO option not found"); + } + + var OCT4 ggsn_ip4_dns2 := f_inet_addr(m_ggsn_ip4_dns2); + if (not match(f_PCO_extract_proto(ctx.pco_neg, '000d'O, 2), ggsn_ip4_dns2)) { + setverdict(fail, "Secondary DNS IPv4 PCO option not found"); + } + f_pdp_ctx_del(ctx, '1'B); } -- To view, visit https://gerrit.osmocom.org/6157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I54124cb5269c0992e6c72af1a1ecaa8e3202bf05 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:37 +0000 Subject: osmo-ttcn3-hacks[master]: BSC_Tests: Add MGCP_Emulation to gen_links In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:39 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler f... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:44 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Register expect criteria for MGCP CRCX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04afa663f4397d5d9b8dec06671aec84f4c4f80e Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:46 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Reply to CRCX with ACK In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:48 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Expect CRCX and send an ACK back In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic4fabc2a2cf034a831e446697b3a22f4d1d0c6d6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:33:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:50 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Don't test CTRL commands for old NITB parameters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6c6b24842d7ceb12a93200bd6208a6b392544b5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:33:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:55 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Update TC_exhaustion to recent osmo-bsc In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d8bbfca0deebc738385f2a1a20d4a17c3853082 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:33:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:33:58 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe9c3205ec11dafcc305ea72aeb33e9152a6458c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:00 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: reduce code duplication by introducing f_expect_chan_rel() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If74b0838187f60004b7daf6176db259af511bf87 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:03 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Fix TC_chan_act_ack_est_ind_noreply() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9ed41d246cf153735fd4e71cc6cc174ede32a76b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:06 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Fix TC_chan_act_ack_est_ind_refused() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5af254d4fc572c1d324f70b5ec99d87bdaf9eb9 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:10 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:10 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Cosmetic: Update commented-out config file options In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3cb756750cafba4ca481a0a98d19e27cb58395df Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:12 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:12 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Fix TC_paging_imsi_nochan In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iec1086bd42f42de1986bb00b91af718977f73b30 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:15 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_Templates: Some more convenience extraction functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:23 +0000 Subject: osmo-ttcn3-hacks[master]: RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I30260a57fc01613450e6ac66e0af97c29041b4fa Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:30 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:30 +0000 Subject: osmo-ttcn3-hacks[master]: RSL_Types: More templates, f_rsl_find_ie() for finding an IE... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7fa7d672c1fde97882fa44959501e8bf7b8dc0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:35 +0000 Subject: osmo-ttcn3-hacks[master]: GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22dca2338ad66c81add5d161bd2a3b3e8e15bdcf Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:49 +0000 Subject: osmo-ttcn3-hacks[master]: RSL_Emulation: Permit registration of explicit Channel Number In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:34:55 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:34:55 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Permit MGCP messages from random ports on BSC side In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie8896edc3f4310a78b584fd4ad017b77bda22afb Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:35:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:04 +0000 Subject: osmo-ttcn3-hacks[master]: L3_Templates: Add ts_RRM_AssignmentComplete In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3ae33ea00496eaef5885a58cd5fbc491abe68c87 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:35:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:13 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: L3_Templates: Add ts_RRM_AssignmentComplete In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: L3_Templates: Add ts_RRM_AssignmentComplete ...................................................................... L3_Templates: Add ts_RRM_AssignmentComplete Change-Id: I3ae33ea00496eaef5885a58cd5fbc491abe68c87 --- M library/L3_Templates.ttcn 1 file changed, 16 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 7736ff5..ed477d5 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -251,6 +251,22 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_AssignmentComplete(OCT1 cause) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + assignmentComplete := { + messageType := '00101001'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} template PDU_ML3_MS_NW ts_ML3_MO := { discriminator := '0000'B, -- To view, visit https://gerrit.osmocom.org/6184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3ae33ea00496eaef5885a58cd5fbc491abe68c87 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:13 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Permit MGCP messages from random ports on BSC side In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Permit MGCP messages from random ports on BSC side ...................................................................... bsc: Permit MGCP messages from random ports on BSC side Change-Id: Ie8896edc3f4310a78b584fd4ad017b77bda22afb --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 7e5b675..9da5b65 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -191,7 +191,7 @@ }; var MGCP_conn_parameters mgcp_pars := { callagent_ip := mp_bsc_ip, - callagent_udp_port := 2727, + callagent_udp_port := -1, mgw_ip := mp_test_ip, mgw_udp_port := 2427 }; -- To view, visit https://gerrit.osmocom.org/6183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie8896edc3f4310a78b584fd4ad017b77bda22afb Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:13 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: RSL_Emulation: Permit registration of explicit Channel Number In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL_Emulation: Permit registration of explicit Channel Number ...................................................................... RSL_Emulation: Permit registration of explicit Channel Number During assignment or hand-over, a given TTCN-3 component may be interested in registering more than one channel number. Add an explicit procedure port with associated registration procedure, similar to what we already do in GSUP, MNCC and others. Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb --- M bsc/BSC_Tests.ttcn M library/RSL_Emulation.ttcn 2 files changed, 77 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 29150ce..7e5b675 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1222,6 +1222,7 @@ connect(vc_conn:BSSMAPEM, vc_BSSMAP:PROC); connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); + connect(vc_conn:RSL_PROC, bts[0].rsl.vc_RSL:RSL_PROC); connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); vc_conn.start(derefers(fn)(id)); diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index a19e627..cbcff2c 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -31,6 +31,7 @@ type component RSL_DchanHdlr { /* port facing up towards dedicated channel handler */ port RSL_DCHAN_PT RSL; + port RSLEM_PROC_PT RSL_PROC; var RslChannelNr g_chan_nr; }; @@ -46,6 +47,12 @@ type port RSL_DCHAN_PT message { inout RSLDC_ChanRqd, RSL_Message; +} with { extension "internal" }; + +signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); + +type port RSLEM_PROC_PT procedure { + inout RSLEM_register; } with { extension "internal" }; /*********************************************************************** @@ -163,7 +170,8 @@ runs on RSL_Emulation_CT return integer { var integer i; for (i := 0; i < sizeof(ConnectionTable); i := i+1) { - if (not ispresent(ConnectionTable[i].ra)) { + if (not ispresent(ConnectionTable[i].ra) and + not ispresent(ConnectionTable[i].trx_nr)) { ConnectionTable[i].ra := ra; ConnectionTable[i].ra_fn := fn; ConnectionTable[i].comp_ref := comp_ref; @@ -174,14 +182,52 @@ return -1; } +/* create an ew client with given RA and FN */ +private function f_cid_create_cnr(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr comp_ref) +runs on RSL_Emulation_CT return integer { + var integer i; + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + if (not ispresent(ConnectionTable[i].ra) and + not ispresent(ConnectionTable[i].trx_nr)) { + ConnectionTable[i].stream_id := f_streamId_by_trx(trx_nr); + ConnectionTable[i].trx_nr := trx_nr; + ConnectionTable[i].chan_nr := chan_nr; + ConnectionTable[i].comp_ref := comp_ref; + return i; + } + } + log("No free entry in conn table for ", trx_nr, chan_nr, comp_ref); + return -1; +} + + +/* create an ew client with given RA and FN */ +private function f_cid_delete_cnr(IpaStreamId stream_id, RslChannelNr chan_nr, RSL_DchanHdlr comp_ref) +runs on RSL_Emulation_CT return integer { + var integer i; + for (i := 0; i < sizeof(ConnectionTable); i := i+1) { + if (ConnectionTable[i].comp_ref == null) { + continue; + } + if (ConnectionTable[i].stream_id == stream_id and + ConnectionTable[i].chan_nr == chan_nr and + ConnectionTable[i].comp_ref == comp_ref) { + f_cid_clear(i); + } + } + log("Unable to find entry to delete for ", stream_id, chan_nr, comp_ref); + return -1; +} + + private function f_cid_clear(integer cid) runs on RSL_Emulation_CT { ConnectionTable[cid].ra := omit; ConnectionTable[cid].ra_fn := omit; - ConnectionTable[cid].ra_fn := omit; ConnectionTable[cid].trx_nr := omit; ConnectionTable[cid].stream_id := omit; ConnectionTable[cid].chan_nr := omit; + ConnectionTable[cid].comp_ref := null; } type component RSL_Emulation_CT { @@ -189,6 +235,7 @@ port IPA_RSL_PT IPA_PT; /* port facing up towards dedicated channel handler */ port RSL_DCHAN_PT CLIENT_PT; + port RSLEM_PROC_PT RSL_PROC; /* state of all concurrent connections / dedicated channels */ var ConnectionData ConnectionTable[64]; @@ -205,12 +252,24 @@ return enum2int(id); } +private function f_streamId_by_trx(uint8_t trx_nr) return IpaStreamId { + select (trx_nr) { + case (0) { return IPAC_PROTO_RSL_TRX0; } + case (1) { return IPAC_PROTO_RSL_TRX1; } + case (2) { return IPAC_PROTO_RSL_TRX2; } + case (3) { return IPAC_PROTO_RSL_TRX3; } + } + self.stop; +} + function main() runs on RSL_Emulation_CT { var ASP_RSL_Unitdata rx_rsl; var RSL_Message rx_rsl_msg; var RSLDC_ChanRqd chan_rqd; var RSL_DchanHdlr vc_conn; + var RslChannelNr chan_nr; + var uint8_t trx_nr; var integer cid; var integer i; @@ -236,6 +295,7 @@ cid := f_cid_by_ra_fn(ra, fn); if (cid == -1) { setverdict(fail, "IMM ASS for unknown DChan"); + self.stop; } /* update client with trx_nr */ ConnectionTable[cid].trx_nr := f_trx_by_streamId(rx_rsl.streamId); @@ -280,7 +340,7 @@ /* blindly acknowledge all channel activations */ [] IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) -> value rx_rsl { - var RslChannelNr chan_nr := rx_rsl.rsl.ies[0].body.chan_nr; + chan_nr := rx_rsl.rsl.ies[0].body.chan_nr; IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.streamId, ts_RSL_CHAN_ACT_ACK(chan_nr, 23))); } @@ -313,6 +373,12 @@ IPA_PT.send(ts_ASP_RSL_UD(ConnectionTable[cid].stream_id, rx_rsl_msg)); } + /* explicit registration, e.g. in (non-immediate) assignment case */ + [] RSL_PROC.getcall(RSLEM_register:{?,?,?}) -> param(trx_nr, chan_nr, vc_conn) { + f_cid_create_cnr(trx_nr, chan_nr, vc_conn); + RSL_PROC.reply(RSLEM_register:{trx_nr, chan_nr, vc_conn}); + } + } } } @@ -327,4 +393,11 @@ } } +/* client/conn_hdlr side function to use procedure port to register stream_id/chan_nr */ +function f_rslem_register(uint8_t trx_nr, RslChannelNr chan_nr) runs on RSL_DchanHdlr { + RSL_PROC.call(RSLEM_register:{trx_nr, chan_nr, self}) { + [] RSL_PROC.getreply(RSLEM_register:{?,?,?}) {}; + } +} + } -- To view, visit https://gerrit.osmocom.org/6182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iba37bf9541c779b79e179f995cdfa677633fadeb Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:13 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:13 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm ...................................................................... GSM_Types: Enable sub-slot templating in t_RslChanNr_Lm Change-Id: I22dca2338ad66c81add5d161bd2a3b3e8e15bdcf --- M library/GSM_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/GSM_Types.ttcn b/library/GSM_Types.ttcn index 1efeac8..e1d6b48 100644 --- a/library/GSM_Types.ttcn +++ b/library/GSM_Types.ttcn @@ -93,7 +93,7 @@ template RslChannelNr t_RslChanNr_PCH_AGCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_PCH_AGCH); template RslChannelNr t_RslChanNr_Bm(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_Bm_ACCH); template RslChannelNr t_RslChanNr_PDCH(template uint3_t tn) := t_RslChanNr0(tn, RSL_CHAN_NR_OSMO_PDCH); - template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, uint1_t sub_slot) := { + template RslChannelNr t_RslChanNr_Lm(template uint3_t tn, template uint1_t sub_slot) := { u := { lm := { tag := '0001'B, sub_chan := sub_slot } }, tn := tn } -- To view, visit https://gerrit.osmocom.org/6181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22dca2338ad66c81add5d161bd2a3b3e8e15bdcf Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:14 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: RSL_Types: More templates, f_rsl_find_ie() for finding an IE... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL_Types: More templates, f_rsl_find_ie() for finding an IE in a message ...................................................................... RSL_Types: More templates, f_rsl_find_ie() for finding an IE in a message Change-Id: Id7fa7d672c1fde97882fa44959501e8bf7b8dc0b --- M library/RSL_Types.ttcn 1 file changed, 20 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index b3d758b..765a91e 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -909,6 +909,15 @@ msg_type := RSL_MT_MODE_MODIFY_NACK } + /* 8.4.14: BTS <- BSC */ + template RSL_Message tr_RSL_RF_CHAN_REL(template RslChannelNr chan_nr) := { + msg_disc := ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), + msg_type := RSL_MT_RF_CHAN_REL, + ies := { + tr_RSL_IE(RSL_IE_Body:{chan_nr := chan_nr}) + } + } + /* 8.4.19 BTS -> BSC */ template RSL_Message ts_RSL_RF_CHAN_REL_ACK(RslChannelNr chan_nr) := ts_RSL_MsgDiscType(ts_RSL_MsgDisc(RSL_MDISC_DCHAN, false), @@ -1160,5 +1169,16 @@ } + function f_rsl_find_ie(RSL_Message msg, RSL_IE_Type iei, out RSL_IE_Body ret) return boolean { + for (var integer i := 0; i < sizeof(msg.ies); i := i+1) { + if (msg.ies[i].iei == iei) { + ret := msg.ies[i].body; + return true; + } + } + return false; + } + + } with { encode "RAW" ; variant "FIELDORDER(msb)" } -- To view, visit https://gerrit.osmocom.org/6180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7fa7d672c1fde97882fa44959501e8bf7b8dc0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:14 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL ...................................................................... RSL_Types: Make tr_RSL_MsgTypeDR match non-transparent RLL There are quite a number of non-transparent RLL messages, such as RLL_RELEASE_REQ. Make sure we match those as intended. Change-Id: I30260a57fc01613450e6ac66e0af97c29041b4fa --- M library/RSL_Types.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/RSL_Types.ttcn b/library/RSL_Types.ttcn index f42b7fd..b3d758b 100644 --- a/library/RSL_Types.ttcn +++ b/library/RSL_Types.ttcn @@ -711,7 +711,7 @@ /* dedicated channel or RLL */ template RSL_Message tr_RSL_MsgTypeDR(template RSL_MessageType msg_type) modifies tr_RSL_MsgType := { - msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,true}, {RSL_MDISC_IPACCESS,false}) + msg_disc := ({RSL_MDISC_DCHAN,?}, {RSL_MDISC_RLL,?}, {RSL_MDISC_IPACCESS,false}) } -- To view, visit https://gerrit.osmocom.org/6179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I30260a57fc01613450e6ac66e0af97c29041b4fa Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:14 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_Templates: Some more convenience extraction functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_Templates: Some more convenience extraction functions ...................................................................... MGCP_Templates: Some more convenience extraction functions Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7 --- M library/MGCP_Templates.ttcn 1 file changed, 17 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 7f10bd2..5a8d9b1 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -273,20 +273,33 @@ return ""; } - function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { + function f_MgcpResp_extract_par(MgcpResponse resp, MgcpInfoCode code) return charstring { var MgcpMessage msg := { response := resp } - return str2hex(f_mgcp_extract_par(msg, "I")); + return f_mgcp_extract_par(msg, code); } - function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId { + function f_MgcpCmd_extract_par(MgcpCommand cmd, MgcpInfoCode code) return charstring { var MgcpMessage msg := { command := cmd } - return str2hex(f_mgcp_extract_par(msg, "C")); + return f_mgcp_extract_par(msg, code); } + function f_MgcpResp_extract_conn_id(MgcpResponse resp) return MgcpConnectionId { + return str2hex(f_MgcpResp_extract_par(resp, "I")); + } + + function f_MgcpCmd_extract_call_id(MgcpCommand cmd) return MgcpCallId { + return str2hex(f_MgcpCmd_extract_par(cmd, "C")); + } + + function f_MgcpCmd_extract_conn_id(MgcpCommand cmd) return MgcpConnectionId { + return str2hex(f_MgcpCmd_extract_par(cmd, "I")); + } + + function f_mgcp_alloc_tid() return MgcpTransId { return int2str(float2int(rnd()*2147483647.0)); } -- To view, visit https://gerrit.osmocom.org/6178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2fc121b1d90327c879a096773ecc5c04faad07d7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:14 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Fix TC_paging_imsi_nochan In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Fix TC_paging_imsi_nochan ...................................................................... bsc: Fix TC_paging_imsi_nochan The point of this test is to verify that *no* paging messages are sent if "No cell" is given as cell identifier list by the MSC. We can thus not use the existing pageing_helper function, but have to handle this a bit differently. This makes TC_paging_imsi_nochan runs pass. Change-Id: Iec1086bd42f42de1986bb00b91af718977f73b30 --- M bsc/BSC_Tests.ttcn 1 file changed, 26 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 69f072b..29150ce 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -976,7 +976,32 @@ testcase TC_paging_imsi_nochan() runs on test_CT { var BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := valueof(ts_BSSMAP_CIL_noCell); - f_pageing_helper('001010123456789'H, cid_list, c_BtsId_all); + var integer i; + + f_init(); + f_bssap_reset(); + + /* Clear the queue, it might still contain stuff like BCCH FILLING */ + for (i := 0; i < NUM_BTS; i := i + 1) { + IPA_RSL[i].clear; + } + + f_bssap_tx_ud(ts_BSSMAP_Paging('001010123456789'H, cid_list, omit, omit)); + + /* wait for some time until when paging messages would appear */ + f_sleep(3.0); + + for (i := 0; i < NUM_BTS; i := i + 1) { + timer T := 0.01; + T.start; + alt { + [] IPA_RSL[i].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_PAGING_CMD(?))) { + setverdict(fail, "Received unexpected paging"); + } + [] T.timeout {} + } + } + setverdict(pass); } /* PAGING by IMSI + TMSI */ -- To view, visit https://gerrit.osmocom.org/6177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iec1086bd42f42de1986bb00b91af718977f73b30 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:15 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Cosmetic: Update commented-out config file options In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Cosmetic: Update commented-out config file options ...................................................................... bsc: Cosmetic: Update commented-out config file options There's no point in listing non-existing module parameters. Instead, list those that the BSC testsuite actually has Change-Id: I3cb756750cafba4ca481a0a98d19e27cb58395df --- M bsc/BSC_Tests.cfg 1 file changed, 9 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.cfg b/bsc/BSC_Tests.cfg index fcb1055..497489f 100644 --- a/bsc/BSC_Tests.cfg +++ b/bsc/BSC_Tests.cfg @@ -14,20 +14,18 @@ #*.*.udpReuseAddress := "yes"; [MODULE_PARAMETERS] -#mp_bsc_port := 49999; +#mp_bsc_rsl_port := 3003; +#mp_bsc_ctrl_port := 4249; #mp_bsc_ip := "127.0.0.1"; -#mp_msc_port := 5100; -#mp_msc_ip := "127.0.0.1"; -#mp_nat_port := 5000; -#mp_nat_ip := "127.0.0.1"; +#mp_test_ip := "127.0.0.1"; + +#mp_sctp_addr := { 23905, "127.0.0.1", 2905, "127.0.0.1" }; +#mp_own_pc := 185; +#mp_own_ssn := 254; +#mp_peer_pc := 187; +#mp_peer_ssn := 254; #mp_ipa_mgcp_uses_osmo_ext := true; - -#mp_mgcp_uses_udp := true; -#mp_callagent_ip := "127.0.0.1"; -#mp_callagent_udp_port := 2727; -#mp_mgw_ip := "127.0.0.1"; -#mp_mgw_udp_port := 2427; [MAIN_CONTROLLER] -- To view, visit https://gerrit.osmocom.org/6176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3cb756750cafba4ca481a0a98d19e27cb58395df Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:15 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Fix TC_chan_act_ack_est_ind_refused() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Fix TC_chan_act_ack_est_ind_refused() ...................................................................... bsc: Fix TC_chan_act_ack_est_ind_refused() This test case was incomplete in that it didn't account for a RLL REL REQ/RESP before RF_CHAN_REL. Together with OsmoBSC Change-Id I64a46b5bcd4272e3fa2ff4ee824c2f3fdff6854b, this test now passes. Change-Id: Ia5af254d4fc572c1d324f70b5ec99d87bdaf9eb9 --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b65d899..69f072b 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -356,8 +356,7 @@ BSSAP.send(ts_BSSAP_DISC_req(rx_c_ind.connectionId, 0)); /* expect BSC to disable the channel */ - rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); - + f_expect_chan_rel(0, chan_nr); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia5af254d4fc572c1d324f70b5ec99d87bdaf9eb9 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:15 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Fix TC_chan_act_ack_est_ind_noreply() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Fix TC_chan_act_ack_est_ind_noreply() ...................................................................... bsc: Fix TC_chan_act_ack_est_ind_noreply() This test case was incomplete in that it * applied the wrong timeout T3101 instead of T3210 * didn't account for a RLL REL REQ/RESP before RF_CHAN_REL Let's fix it. Together with OsmoBSC Change-Id Ie11d7d06353ba1b1e2fab6763dd7b032ce8a5d2c this check now actually passes for the first time. Change-Id: I9ed41d246cf153735fd4e71cc6cc174ede32a76b --- M bsc/BSC_Tests.ttcn 1 file changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index c7b5a8f..b65d899 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -308,7 +308,10 @@ /* Test behavior if MSC never answers to CR */ testcase TC_chan_act_ack_est_ind_noreply() runs on test_CT { + var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); + var IpaStreamId sid := IPAC_PROTO_RSL_TRX0; var RSL_Message rx_rsl; + var ASP_RSL_Unitdata rx_rsl_ud; f_init(1); f_bssap_reset(); @@ -322,7 +325,15 @@ BSSAP.receive(tr_BSSAP_CONNECT_ind(?, ?, tr_BSSMAP_ComplL3(l3))); /* expect BSC to disable the channel again if there's no response from MSC */ - rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); + /* MS waits 20s (T3210) at LU; 10s (T3230) at CM SERV REQ and 5s (T3220) AT detach */ + IPA_RSL[0].clear; + alt { + [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) -> value rx_rsl_ud { } + [] IPA_RSL[0].receive(tr_ASP_RSL_UD(sid, tr_RSL_REL_REQ(chan_nr, ?))) -> value rx_rsl_ud { + f_ipa_tx(0, ts_RSL_REL_CONF(chan_nr, main_dcch)); + repeat; + } + } setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9ed41d246cf153735fd4e71cc6cc174ede32a76b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:15 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: reduce code duplication by introducing f_expect_chan_rel() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: reduce code duplication by introducing f_expect_chan_rel() ...................................................................... bsc: reduce code duplication by introducing f_expect_chan_rel() The handling of channel release is copy+pasted, let's introduce a shared function. Change-Id: If74b0838187f60004b7daf6176db259af511bf87 --- M bsc/BSC_Tests.ttcn 1 file changed, 37 insertions(+), 74 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 87150db..c7b5a8f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -606,11 +606,44 @@ setverdict(pass); } +function f_expect_chan_rel(integer bts_nr, RslChannelNr rsl_chan_nr, boolean flush := true, + boolean handle_rll_rel := true) runs on test_CT { + + var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); + if (flush) { + /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ + IPA_RSL[bts_nr].clear; + } + alt { + /* ignore DEACTIVATE SACCH (if any) */ + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_DEACT_SACCH(rsl_chan_nr))) { + repeat; + } + /* acknowledge RLL release (if any)*/ + [handle_rll_rel] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_REL_REQ(rsl_chan_nr, ?))) { + /* FIXME: Why are we getting this for LinkID SACCH? */ + f_ipa_tx(0, ts_RSL_REL_CONF(rsl_chan_nr, main_dcch)); + repeat; + } + /* Expect RF channel release from BSC on Abis */ + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, + tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { + /* respond with CHAN REL ACK */ + f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(rsl_chan_nr)); + } + /* ignore any user data */ + [] IPA_RSL[bts_nr].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) { + repeat; + } + } +} + /* Test behavior of channel release after hard Clear Command from MSC */ testcase TC_chan_rel_hard_clear() runs on test_CT { var BSSAP_N_DATA_ind rx_di; var DchanTuple dt; - var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); f_init(1); f_bssap_reset(); @@ -627,36 +660,13 @@ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); } - /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ - IPA_RSL[0].clear; - alt { - /* ignore DEACTIVATE SACCH (if any) */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_DEACT_SACCH(dt.rsl_chan_nr))) { - repeat; - } - /* acknowledge RLL release (if any)*/ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(dt.rsl_chan_nr, ?))) { - /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(dt.rsl_chan_nr, main_dcch)); - repeat; - } - /* Expect RF channel release from BSC on Abis */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - } - } - + f_expect_chan_rel(0, dt.rsl_chan_nr); setverdict(pass); } /* Test behavior of channel release after hard RLSD from MSC */ testcase TC_chan_rel_hard_rlsd() runs on test_CT { var DchanTuple dt; - var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); f_init(1); f_bssap_reset(); @@ -666,36 +676,13 @@ /* release the SCCP connection */ BSSAP.send(ts_BSSAP_DISC_req(dt.sccp_conn_id, 0)); - /* Clear the queue, it might still contain stuff like IMMEDIATE ASSIGN */ - IPA_RSL[0].clear; - alt { - /* ignore DEACTIVATE SACCH (if any) */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_DEACT_SACCH(dt.rsl_chan_nr))) { - repeat; - } - /* acknowledge RLL release (if any)*/ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(dt.rsl_chan_nr, ?))) { - /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(dt.rsl_chan_nr, main_dcch)); - repeat; - } - /* Expect RF channel release from BSC on Abis */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - } - } - + f_expect_chan_rel(0, dt.rsl_chan_nr); setverdict(pass); } /* Test behavior of channel release after BSSMAP RESET from MSC */ testcase TC_chan_rel_a_reset() runs on test_CT { var DchanTuple dt; - var RslLinkId main_dcch := valueof(ts_RslLinkID_DCCH(0)); f_init(1); f_bssap_reset(); @@ -712,31 +699,7 @@ [] BSSAP.receive(tr_BSSAP_DISC_ind(dt.sccp_conn_id, ?, ?)) { } } - alt { - /* ignore DEACTIVATE SACCH (if any) */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_DEACT_SACCH(dt.rsl_chan_nr))) { - repeat; - } - /* acknowledge RLL release (if any)*/ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_REL_REQ(dt.rsl_chan_nr, ?))) { - /* FIXME: Why are we getting this for LinkID SACCH? */ - f_ipa_tx(0, ts_RSL_REL_CONF(dt.rsl_chan_nr, main_dcch)); - repeat; - } - /* Expect RF channel release from BSC on Abis */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, - tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL))) { - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - } - /* ignore any user data */ - [] IPA_RSL[0].receive(tr_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0, tr_RSL_MsgTypeR(?))) { - repeat; - } - } - + f_expect_chan_rel(0, dt.rsl_chan_nr); setverdict(pass); } -- To view, visit https://gerrit.osmocom.org/6173 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If74b0838187f60004b7daf6176db259af511bf87 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:15 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:15 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm ...................................................................... bsc: Update TC_chan_rel_conn_fail to subscr_conn_fsm In OsmoBSC Change-IdI68286d26e2014048b054f39ef29c35fef420cc97 we introduce a proper subscriber connection state machine which fixes the order of events during channel release after connection failure. Change-Id: Ibe9c3205ec11dafcc305ea72aeb33e9152a6458c --- M bsc/BSC_Tests.ttcn 1 file changed, 5 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 84d0c38..87150db 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -582,11 +582,6 @@ f_ipa_tx(0, ts_RSL_CONN_FAIL_IND(dt.rsl_chan_nr, RSL_ERR_RADIO_LINK_FAIL)); /* TODO: different cause values? */ - /* expect BSC to disable the channel */ - rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); - /* respond with CHAN REL ACK */ - f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); - /* expect Clear Request from BSC */ BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearRequest)) -> value rx_di; @@ -594,6 +589,11 @@ var BssmapCause cause := bit2int(rx_di.userData.pdu.bssmap.clearRequest.cause.causeValue); BSSAP.send(ts_BSSAP_DATA_req(dt.sccp_conn_id, ts_BSSMAP_ClearCommand(cause))); + /* expect BSC to disable the channel */ + rx_rsl := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_RF_CHAN_REL), T3101_MAX); + /* respond with CHAN REL ACK */ + f_ipa_tx(0, ts_RSL_RF_CHAN_REL_ACK(dt.rsl_chan_nr)); + /* expect Clear Complete from BSC */ BSSAP.receive(tr_BSSAP_DATA_ind(dt.sccp_conn_id, tr_BSSMAP_ClearComplete)); -- To view, visit https://gerrit.osmocom.org/6172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe9c3205ec11dafcc305ea72aeb33e9152a6458c Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:16 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Update TC_exhaustion to recent osmo-bsc In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Update TC_exhaustion to recent osmo-bsc ...................................................................... bsc: Update TC_exhaustion to recent osmo-bsc When Change-Id I10fc9f60c58c6b7ed424a86ce23bf6b9802c9eb1 was merged, OsmoBSC started to always allocate SDCCH first, no matter what the establishment cause. This basically means we don't do very early assignment anymore. TC_exhaustion must be adapted to allocate all SDCCH and all TCH before failing. Change-Id: I9d8bbfca0deebc738385f2a1a20d4a17c3853082 --- M bsc/BSC_Tests.ttcn 1 file changed, 5 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index dacb630..84d0c38 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -46,6 +46,7 @@ /* make sure to sync this with the osmo-bts.cfg you're using */ const integer NUM_TCHF_PER_BTS := 5; +const integer NUM_SDCCH_PER_BTS := 4; /* per-BTS state which we keep */ @@ -386,13 +387,14 @@ chreq_nochan := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel"); /* expect 5xTCH/F to succeed */ - for (i := 0; i < NUM_TCHF_PER_BTS; i := i+1) { + for (i := 0; i < NUM_TCHF_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) { f_chreq_act_ack('23'O, i); } IPA_RSL[0].clear; - f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", chreq_total+NUM_TCHF_PER_BTS); + f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", + chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS); /* now expect additional channel activations to fail */ f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42)); @@ -408,7 +410,7 @@ rr := dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload); if (rr.header.message_type == IMMEDIATE_ASSIGNMENT_REJECT) { f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", - chreq_total+NUM_TCHF_PER_BTS+1); + chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS+1); f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:no_channel", chreq_nochan+1); setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6171 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9d8bbfca0deebc738385f2a1a20d4a17c3853082 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:16 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Don't test CTRL commands for old NITB parameters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Don't test CTRL commands for old NITB parameters ...................................................................... bsc: Don't test CTRL commands for old NITB parameters Change-Id: Ib6c6b24842d7ceb12a93200bd6208a6b392544b5 --- M bsc/BSC_Tests.ttcn 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 8766503..dacb630 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -872,8 +872,6 @@ f_ctrl_get_exp(IPA_CTRL, "mcc", "1"); f_ctrl_get_exp(IPA_CTRL, "mnc", "1"); - f_ctrl_get_exp(IPA_CTRL, "short-name", "OsmoBSC"); - f_ctrl_get_exp(IPA_CTRL, "long-name", "OsmoBSC"); f_ctrl_get_exp(IPA_CTRL, "number-of-bts", "3"); var integer bts_nr := 0; -- To view, visit https://gerrit.osmocom.org/6170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6c6b24842d7ceb12a93200bd6208a6b392544b5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:16 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Expect CRCX and send an ACK back In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Expect CRCX and send an ACK back ...................................................................... bsc: Expect CRCX and send an ACK back Change-Id: Ic4fabc2a2cf034a831e446697b3a22f4d1d0c6d6 --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 7 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index f763994..d619068 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -164,6 +164,7 @@ endpoint := omit, transid := omit }; + var SDP_Message sdp; mgcp_conn_id := f_mgcp_alloc_conn_id(); f_create_chan_and_exp(pars); @@ -172,10 +173,13 @@ BSSAP.receive(tr_BSSMAP_ComplL3); f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); + MGCP.receive(tr_CRCX) -> value cmd; + sdp := valueof(ts_SDP("127.0.0.1", "127.0.0.1", "foo", "21", 1000, { "98" }, + {valueof(ts_SDP_rtpmap(98, "AMR/8000")), + valueof(ts_SDP_ptime(20)) } )); + MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, sdp)) + alt { - [] MGCP.receive(tr_CRCX) -> value cmd { - MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, cmd.sdp)) - } /* if we receive exactly what we expected, always return + pass */ [] BSSAP.receive(exp_ass_cpl) -> value bssap { setverdict(pass); -- To view, visit https://gerrit.osmocom.org/6169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic4fabc2a2cf034a831e446697b3a22f4d1d0c6d6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:17 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Reply to CRCX with ACK In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Reply to CRCX with ACK ...................................................................... bsc: Reply to CRCX with ACK Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df --- M bsc/MSC_ConnectionHandler.ttcn M library/MGCP_Emulation.ttcn 2 files changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index e1fd35a..f763994 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -154,6 +154,7 @@ runs on MSC_ConnHdlr return PDU_BSSAP { var PDU_BSSAP bssap; var RSL_Message rsl; + var MgcpCommand cmd; timer T := 10.0; var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); var boolean crcx_seen := false; @@ -164,6 +165,7 @@ transid := omit }; + mgcp_conn_id := f_mgcp_alloc_conn_id(); f_create_chan_and_exp(pars); /* we should now have a COMPL_L3 at the MSC */ @@ -171,6 +173,9 @@ f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); alt { + [] MGCP.receive(tr_CRCX) -> value cmd { + MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, cmd.sdp)) + } /* if we receive exactly what we expected, always return + pass */ [] BSSAP.receive(exp_ass_cpl) -> value bssap { setverdict(pass); diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index df8e4b4..074385c 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -38,6 +38,7 @@ port MGCP_Conn_PT MGCP; /* procedure based port to register for incoming connections */ port MGCPEM_PROC_PT MGCP_PROC; + var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/6168 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieaea431a99241d8844b915e1b46b77c79fff24df Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:17 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Register expect criteria for MGCP CRCX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Register expect criteria for MGCP CRCX ...................................................................... bsc: Register expect criteria for MGCP CRCX Change-Id: I04afa663f4397d5d9b8dec06671aec84f4c4f80e --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 3dbb782..e1fd35a 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -158,11 +158,17 @@ var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); var boolean crcx_seen := false; var boolean rr_modify_seen := false; + var ExpectCriteria mgcpcrit := { + connid := omit, + endpoint := omit, + transid := omit + }; f_create_chan_and_exp(pars); /* we should now have a COMPL_L3 at the MSC */ BSSAP.receive(tr_BSSMAP_ComplL3); + f_create_mgcp_expect(mgcpcrit); BSSAP.send(ass_cmd); alt { /* if we receive exactly what we expected, always return + pass */ -- To view, visit https://gerrit.osmocom.org/6167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04afa663f4397d5d9b8dec06671aec84f4c4f80e Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:17 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler f... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler for MGCP ...................................................................... bsc: Start MGCP_Emulation and extend MSC_ConnectionHandler for MGCP forward-ported by Harald Welte Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn 2 files changed, 39 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 6b5ce24..8766503 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -31,6 +31,7 @@ import from IPA_Types all; import from RSL_Types all; import from RSL_Emulation all; +import from MGCP_Emulation all; import from Osmocom_CTRL_Functions all; import from Osmocom_CTRL_Types all; @@ -59,6 +60,8 @@ /* array of per-BTS RSL test ports */ port IPA_RSL_PT IPA_RSL[NUM_BTS]; + var MGCP_Emulation_CT vc_MGCP; + /* are we initialized yet */ var boolean g_initialized := false; @@ -74,6 +77,8 @@ integer mp_bsc_rsl_port := 3003; /* port number to which to establish the IPA CTRL connection */ integer mp_bsc_ctrl_port := 4249; + /* IP address at which the test binds */ + charstring mp_test_ip := "127.0.0.1"; } type record IPA_Client { @@ -176,6 +181,24 @@ } } +function f_init_mgcp(charstring id) runs on test_CT { + id := id & "-MGCP"; + + var MGCPOps ops := { + create_cb := refers(MGCP_Emulation.ExpectedCreateCallback), + unitdata_cb := refers(MGCP_Emulation.DummyUnitdataCallback) + }; + var MGCP_conn_parameters mgcp_pars := { + callagent_ip := mp_bsc_ip, + callagent_udp_port := 2727, + mgw_ip := mp_test_ip, + mgw_udp_port := 2427 + }; + + vc_MGCP := MGCP_Emulation_CT.create(id); + vc_MGCP.start(MGCP_Emulation.main(ops, mgcp_pars, id)); +} + /* global initialization function * \param nr_bts Number of BTSs we should start/bring up * \param handler_mode Start an RSL_Emulation_CT component (true) or not (false) */ @@ -195,6 +218,8 @@ f_bssap_init("VirtMSC", omit); } f_ipa_ctrl_start(mp_bsc_ip, mp_bsc_ctrl_port); + + f_init_mgcp("VirtMSC"); for (i := 0; i < nr_bts; i := i+1) { /* wait until osmo-bts-omldummy has respawned */ @@ -1197,8 +1222,10 @@ vc_conn := MSC_ConnHdlr.create(id); connect(vc_conn:BSSMAPEM, vc_BSSMAP:PROC); + connect(vc_conn:MGCP_PROC, vc_MGCP:MGCP_PROC); connect(vc_conn:RSL, bts[0].rsl.vc_RSL:CLIENT_PT); connect(vc_conn:BSSAP, vc_BSSMAP:CLIENT); + connect(vc_conn:MGCP, vc_MGCP:MGCP_CLIENT); vc_conn.start(derefers(fn)(id)); return vc_conn; } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index d1be0ef..3dbb782 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -10,6 +10,7 @@ import from MGCP_Types all; import from MGCP_Templates all; +import from MGCP_Emulation all; import from SDP_Types all; import from RSL_Emulation all; @@ -24,7 +25,7 @@ /* this component represents a single subscriber connection at the MSC. * There is a 1:1 mapping between SCCP connections and BSSAP_ConnHdlr components. * We inherit all component variables, ports, functions, ... from BSSAP_ConnHdlr */ -type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr { +type component MSC_ConnHdlr extends BSSAP_ConnHdlr, RSL_DchanHdlr, MGCP_ConnHdlr { /* SCCP Connecction Identifier for the underlying SCCP connection */ var integer g_sccp_conn_id; @@ -55,6 +56,10 @@ role_ms := false } +const MGCPOps MSC_MGCPOps := { + create_cb := refers(MGCP_Emulation.ExpectedCreateCallback) +} + type enumerated MSC_State { MSC_STATE_NONE, MSC_STATE_WAIT_ASS_COMPL, @@ -65,7 +70,7 @@ } /* register an expect with the BSSMAP core */ -private function f_create_exp(octetstring l3_enc) runs on MSC_ConnHdlr { +private function f_create_bssmap_exp(octetstring l3_enc) runs on MSC_ConnHdlr { BSSMAPEM.call(BSSMAPEM_register:{l3_enc, self}) { [] BSSMAPEM.getreply(BSSMAPEM_register:{?, ?}) {}; } @@ -92,7 +97,7 @@ /* call helper function for CHAN_RQD -> IMM ASS ->EST_IND */ RSL_Emulation.f_chan_est(pars.ra, l3_enc, pars.link_id, pars.fn); - f_create_exp(l3_enc); + f_create_bssmap_exp(l3_enc); } function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig) runs on MSC_ConnHdlr { @@ -184,10 +189,14 @@ crcx_seen := true; repeat; } + /* mgw CRCX goes here */ + [crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{ RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, 1, 1, 1, 1)); repeat; } + /* mgw MGCX goes here */ + [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { setverdict(fail, "Received non-matching ASSIGNMENT COMPLETE"); } -- To view, visit https://gerrit.osmocom.org/6166 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1f316a9ed5859670348ea7aa352604020d6b09f5 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:18 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSC_Tests: Add MGCP_Emulation to gen_links In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSC_Tests: Add MGCP_Emulation to gen_links ...................................................................... BSC_Tests: Add MGCP_Emulation to gen_links Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01 --- M bsc/gen_links.sh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index 01655c0..af747b3 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES -- To view, visit https://gerrit.osmocom.org/6165 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac24d8d3baf7e4ca6bdab6b0be7b55096e490d01 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:56 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: f_establish_fully(): Wait for release of old channel Message-ID: Review at https://gerrit.osmocom.org/6187 bsc: f_establish_fully(): Wait for release of old channel We shouldn't "pass" f_establish_fully() in the assignment case as long as the old RF channel hasn't been released via RSL. Change-Id: If7c7c8c4826feba47f8a0395c291157a0e48cd9d --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/87/6187/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 80bc1fb..6afeca2 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -375,19 +375,21 @@ boolean is_assignment, /* Assignment related bits */ boolean rr_ass_cmpl_seen, + boolean assignment_done, RslChannelNr old_chan_nr, /* Modify related bits */ boolean rr_modify_seen, - boolean rsl_modify_seen + boolean modify_done } template (value) AssignmentState ts_AssignmentStateInit := { voice_call := false, is_assignment := false, rr_ass_cmpl_seen := false, + assignment_done := false, old_chan_nr := -, rr_modify_seen := false, - rsl_modify_seen := false + modify_done := false } altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr { @@ -426,6 +428,7 @@ RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr)); /* FIXME: unregister for old channel number in RSL emulation */ //f_rslem_unregister(0, st.old_chan_nr); + st.assignment_done := true; repeat; } } @@ -446,7 +449,7 @@ } [st.voice_call and st.rr_modify_seen] RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl { RSL.send(ts_RSL_MODE_MODIFY_ACK(g_chan_nr)); - st.rsl_modify_seen := true; + st.modify_done := true; repeat; } } @@ -524,10 +527,13 @@ [st.voice_call] as_Media(); /* if we receive exactly what we expected, always return + pass */ - [] BSSAP.receive(exp_ass_cpl) -> value bssap { + [st.is_assignment and st.assignment_done or + (not st.is_assignment and st.modify_done)] BSSAP.receive(exp_ass_cpl) -> value bssap { setverdict(pass); } - [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { + [(st.is_assignment and st.assignment_done or + (not st.is_assignment and st.modify_done)) and + exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { setverdict(fail, "Received non-matching ASSIGNMENT COMPLETE"); } [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentFail) { -- To view, visit https://gerrit.osmocom.org/6187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If7c7c8c4826feba47f8a0395c291157a0e48cd9d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:35:56 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:35:56 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Unregister old RSL channel number after assignment Message-ID: Review at https://gerrit.osmocom.org/6188 bsc: Unregister old RSL channel number after assignment Change-Id: I27d113391094f938ff92c4d6514172ee634f695c --- M bsc/MSC_ConnectionHandler.ttcn M library/RSL_Emulation.ttcn 2 files changed, 20 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/88/6188/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 6afeca2..55cdb89 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -426,8 +426,9 @@ } [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_RF_CHAN_REL(st.old_chan_nr)) { RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr)); - /* FIXME: unregister for old channel number in RSL emulation */ - //f_rslem_unregister(0, st.old_chan_nr); + /* unregister for old channel number in RSL emulation */ + /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ + f_rslem_unregister(0, st.old_chan_nr); st.assignment_done := true; repeat; } diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index cbcff2c..d20718f 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -50,9 +50,10 @@ } with { extension "internal" }; signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); +signature RSLEM_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); type port RSLEM_PROC_PT procedure { - inout RSLEM_register; + inout RSLEM_register, RSLEM_unregister; } with { extension "internal" }; /*********************************************************************** @@ -379,6 +380,13 @@ RSL_PROC.reply(RSLEM_register:{trx_nr, chan_nr, vc_conn}); } + [] RSL_PROC.getcall(RSLEM_unregister:{?,?,?}) -> param(trx_nr, chan_nr, vc_conn) { + cid := f_cid_by_chan_nr(trx_nr, chan_nr); + f_cid_clear(cid); + RSL_PROC.reply(RSLEM_unregister:{trx_nr, chan_nr, vc_conn}); + } + + } } } @@ -400,4 +408,12 @@ } } +/* client/conn_hdlr side function to use procedure port to unregister stream_id/chan_nr */ +function f_rslem_unregister(uint8_t trx_nr, RslChannelNr chan_nr) runs on RSL_DchanHdlr { + RSL_PROC.call(RSLEM_unregister:{trx_nr, chan_nr, self}) { + [] RSL_PROC.getreply(RSLEM_unregister:{?,?,?}) {}; + } +} + + } -- To view, visit https://gerrit.osmocom.org/6188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I27d113391094f938ff92c4d6514172ee634f695c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:36:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:27 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Implement Assignment handling In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:36:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:29 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: f_establish_fully(): Wait for release of old channel In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If7c7c8c4826feba47f8a0395c291157a0e48cd9d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:36:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:32 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Unregister old RSL channel number after assignment In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I27d113391094f938ff92c4d6514172ee634f695c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:36:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:39 +0000 Subject: osmo-ttcn3-hacks[master]: MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If9eea3f665289a52915f114f0a69234aad28f322 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 29 21:36:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:41 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP_ConnHdlr ...................................................................... MGCP_Emulation: Remove bogus mgcp_conn_id variable from MGCP_ConnHdlr A given MGCP_ConnHdlr is handling multiple connections on one Endpoint anyway, and the variable is not set or used anywhere. Change-Id: If9eea3f665289a52915f114f0a69234aad28f322 --- M library/MGCP_Emulation.ttcn 1 file changed, 0 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index 074385c..df8e4b4 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -38,7 +38,6 @@ port MGCP_Conn_PT MGCP; /* procedure based port to register for incoming connections */ port MGCPEM_PROC_PT MGCP_PROC; - var MgcpConnectionId mgcp_conn_id; } /* port between individual per-connection components and this dispatcher */ -- To view, visit https://gerrit.osmocom.org/6185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If9eea3f665289a52915f114f0a69234aad28f322 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:36:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:41 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Unregister old RSL channel number after assignment In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Unregister old RSL channel number after assignment ...................................................................... bsc: Unregister old RSL channel number after assignment Change-Id: I27d113391094f938ff92c4d6514172ee634f695c --- M bsc/MSC_ConnectionHandler.ttcn M library/RSL_Emulation.ttcn 2 files changed, 20 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 6afeca2..55cdb89 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -426,8 +426,9 @@ } [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_RF_CHAN_REL(st.old_chan_nr)) { RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr)); - /* FIXME: unregister for old channel number in RSL emulation */ - //f_rslem_unregister(0, st.old_chan_nr); + /* unregister for old channel number in RSL emulation */ + /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ + f_rslem_unregister(0, st.old_chan_nr); st.assignment_done := true; repeat; } diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn index cbcff2c..d20718f 100644 --- a/library/RSL_Emulation.ttcn +++ b/library/RSL_Emulation.ttcn @@ -50,9 +50,10 @@ } with { extension "internal" }; signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); +signature RSLEM_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr hdlr); type port RSLEM_PROC_PT procedure { - inout RSLEM_register; + inout RSLEM_register, RSLEM_unregister; } with { extension "internal" }; /*********************************************************************** @@ -379,6 +380,13 @@ RSL_PROC.reply(RSLEM_register:{trx_nr, chan_nr, vc_conn}); } + [] RSL_PROC.getcall(RSLEM_unregister:{?,?,?}) -> param(trx_nr, chan_nr, vc_conn) { + cid := f_cid_by_chan_nr(trx_nr, chan_nr); + f_cid_clear(cid); + RSL_PROC.reply(RSLEM_unregister:{trx_nr, chan_nr, vc_conn}); + } + + } } } @@ -400,4 +408,12 @@ } } +/* client/conn_hdlr side function to use procedure port to unregister stream_id/chan_nr */ +function f_rslem_unregister(uint8_t trx_nr, RslChannelNr chan_nr) runs on RSL_DchanHdlr { + RSL_PROC.call(RSLEM_unregister:{trx_nr, chan_nr, self}) { + [] RSL_PROC.getreply(RSLEM_unregister:{?,?,?}) {}; + } +} + + } -- To view, visit https://gerrit.osmocom.org/6188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I27d113391094f938ff92c4d6514172ee634f695c Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:36:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:41 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: f_establish_fully(): Wait for release of old channel In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: f_establish_fully(): Wait for release of old channel ...................................................................... bsc: f_establish_fully(): Wait for release of old channel We shouldn't "pass" f_establish_fully() in the assignment case as long as the old RF channel hasn't been released via RSL. Change-Id: If7c7c8c4826feba47f8a0395c291157a0e48cd9d --- M bsc/MSC_ConnectionHandler.ttcn 1 file changed, 11 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 80bc1fb..6afeca2 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -375,19 +375,21 @@ boolean is_assignment, /* Assignment related bits */ boolean rr_ass_cmpl_seen, + boolean assignment_done, RslChannelNr old_chan_nr, /* Modify related bits */ boolean rr_modify_seen, - boolean rsl_modify_seen + boolean modify_done } template (value) AssignmentState ts_AssignmentStateInit := { voice_call := false, is_assignment := false, rr_ass_cmpl_seen := false, + assignment_done := false, old_chan_nr := -, rr_modify_seen := false, - rsl_modify_seen := false + modify_done := false } altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr { @@ -426,6 +428,7 @@ RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr)); /* FIXME: unregister for old channel number in RSL emulation */ //f_rslem_unregister(0, st.old_chan_nr); + st.assignment_done := true; repeat; } } @@ -446,7 +449,7 @@ } [st.voice_call and st.rr_modify_seen] RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl { RSL.send(ts_RSL_MODE_MODIFY_ACK(g_chan_nr)); - st.rsl_modify_seen := true; + st.modify_done := true; repeat; } } @@ -524,10 +527,13 @@ [st.voice_call] as_Media(); /* if we receive exactly what we expected, always return + pass */ - [] BSSAP.receive(exp_ass_cpl) -> value bssap { + [st.is_assignment and st.assignment_done or + (not st.is_assignment and st.modify_done)] BSSAP.receive(exp_ass_cpl) -> value bssap { setverdict(pass); } - [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { + [(st.is_assignment and st.assignment_done or + (not st.is_assignment and st.modify_done)) and + exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { setverdict(fail, "Received non-matching ASSIGNMENT COMPLETE"); } [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentFail) { -- To view, visit https://gerrit.osmocom.org/6187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If7c7c8c4826feba47f8a0395c291157a0e48cd9d Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Jan 29 21:36:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 29 Jan 2018 21:36:41 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Implement Assignment handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Implement Assignment handling ...................................................................... bsc: Implement Assignment handling This adds code for the rather intricated and nested transactions happening on RSL, BSSAP, MGCP and RSL-IPA. We use explicit invocation of altsteps to simplify the main function f_establish_fully. Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b --- M bsc/MSC_ConnectionHandler.ttcn M bsc/gen_links.sh M bsc/regen_makefile.sh 3 files changed, 379 insertions(+), 61 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index d619068..80bc1fb 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -8,6 +8,9 @@ import from BSSMAP_Emulation all; import from BSSMAP_Templates all; +import from IPL4asp_Types all; +import from Native_Functions all; + import from MGCP_Types all; import from MGCP_Templates all; import from MGCP_Emulation all; @@ -18,8 +21,197 @@ import from MobileL3_Types all; import from MobileL3_CommonIE_Types all; -//import from MobileL3_RRM_Types all; +import from MobileL3_RRM_Types all; import from L3_Templates all; + + +/*********************************************************************** + * Media related handling + ***********************************************************************/ + +/* Tuple containing host/ip and port */ +type record HostPort { + HostName host, + PortNumber port_nr +}; + +/* State encapsulating one MGCP Connection */ +type record MgcpConnState { + boolean crcx_seen, + MgcpConnectionId conn_id, + charstring mime_type, /* e.g. AMR */ + integer sample_rate, /* 8000 */ + integer ptime, /* 20 */ + uint7_t rtp_pt, /* RTP Payload Type */ + HostPort mgw, /* MGW side */ + HostPort peer /* CA side */ +}; + +/* BTS media state */ +type record BtsMediaState { + boolean ipa_crcx_seen, + uint16_t conn_id, + uint7_t rtp_pt, + HostPort bts, + HostPort peer +}; + +type record MediaState { + MgcpEndpoint mgcp_ep, + MgcpConnState mgcp_conn[2], + BtsMediaState bts +}; + +function f_MediaState_init(inout MediaState g_media, integer nr, HostName bts, HostName mgw) { + /* BTS Side */ + g_media.bts := { + ipa_crcx_seen := false, + conn_id := nr, + rtp_pt := 0, + bts := { + host := bts, + port_nr := 9000 + nr*2 + }, + peer := - + } + + //g_media.mgcp_ep := int2str(i) & "@mgw"; + + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + g_media.mgcp_conn[i].mime_type := "AMR"; + g_media.mgcp_conn[i].sample_rate := 8000; + g_media.mgcp_conn[i].ptime := 20; + g_media.mgcp_conn[i].rtp_pt := 98; + g_media.mgcp_conn[i].crcx_seen := false; + g_media.mgcp_conn[i].conn_id := f_mgcp_alloc_conn_id(); + } + + g_media.mgcp_conn[0].mgw := { + host := mgw, + port_nr := 10000 + nr*2 + } + g_media.mgcp_conn[1].mgw := { + host := mgw, + port_nr := 11000 + nr*2 + } +} + +private function f_get_free_mgcp_conn() runs on MSC_ConnHdlr return integer { + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + if (not g_media.mgcp_conn[i].crcx_seen) { + return i; + } + } + setverdict(fail, "Only 2 Connections per EP!"); + self.stop; + return -1; +} + +private function f_get_mgcp_conn(MgcpConnectionId cid) runs on MSC_ConnHdlr return integer { + for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { + if (g_media.mgcp_conn[i].conn_id == cid and g_media.mgcp_conn[i].crcx_seen) { + return i; + } + } + setverdict(fail, "No Connection for ID ", cid); + self.stop; + return -1; +} + + +/* altstep for handling of IPA + MGCP media related commands. Can be activated by a given + * test case if it expects to see media related handling (i.e. voice calls */ +altstep as_Media() runs on MSC_ConnHdlr { + var RSL_Message rsl; + var MgcpCommand mgcp_cmd; + var RSL_IE_Body ie; + [not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl { + /* Extract parameters from request + use in response */ + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt; + } + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt2; + } + RSL.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, g_media.bts.conn_id, + oct2int(f_inet_addr(g_media.bts.bts.host)), + g_media.bts.bts.port_nr, + g_media.bts.rtp_pt)); + g_media.bts.ipa_crcx_seen := true; + repeat; + } + [g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{ + /* Extract conn_id, ip, port, rtp_pt2 from request + use in response */ + f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie); + if (g_media.bts.conn_id != ie.ipa_conn_id) { + setverdict(fail, "IPA MDCX for unknown ConnId", rsl); + self.stop; + } + /* mandatory */ + f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie); + g_media.bts.peer.host := f_inet_ntoa(int2oct(ie.ipa_remote_ip, 4)); + f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie); + g_media.bts.peer.port_nr := ie.ipa_remote_port; + /* optional */ + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt; + } + if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD2, ie)) { + g_media.bts.rtp_pt := ie.ipa_rtp_pt2; + } + RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, g_media.bts.conn_id, + oct2int(f_inet_addr(g_media.bts.peer.host)), + g_media.bts.peer.port_nr, + g_media.bts.rtp_pt)); + //g_media.ipa_mdcx_seen := true; + repeat; + } + [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { + var SDP_Message sdp; + var integer cid := f_get_free_mgcp_conn(); + if (isvalue(mgcp_cmd.sdp)) { + sdp := mgcp_cmd.sdp; + g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr; + g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number; + } + var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid]; + sdp := valueof(ts_SDP(mgcp_conn.mgw.host, mgcp_conn.mgw.host, "foo", "21", + mgcp_conn.mgw.port_nr, { int2str(mgcp_conn.rtp_pt) }, + {valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt, + mgcp_conn.mime_type & "/" & + int2str(mgcp_conn.sample_rate))), + valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); + MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); + g_media.mgcp_conn[cid].crcx_seen := true; + repeat; + } + [] MGCP.receive(tr_MDCX) -> value mgcp_cmd { + var SDP_Message sdp; + var integer cid := f_get_mgcp_conn(f_MgcpCmd_extract_conn_id(mgcp_cmd)); + if (isvalue(mgcp_cmd.sdp)) { + sdp := mgcp_cmd.sdp; + g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr; + g_media.mgcp_conn[cid].peer.port_nr := sdp.media_list[0].media_field.ports.port_number; + } else { + setverdict(fail, "MDCX has no [recognizable] SDP"); + /* HACK HACK HACK */ + g_media.mgcp_conn[cid].peer.host := "8.8.8.8"; + g_media.mgcp_conn[cid].peer.port_nr := 2342; + } + var MgcpConnState mgcp_conn := g_media.mgcp_conn[cid]; + sdp := valueof(ts_SDP(mgcp_conn.peer.host, mgcp_conn.peer.host, "foo", "21", + mgcp_conn.peer.port_nr, { int2str(mgcp_conn.rtp_pt) }, + {valueof(ts_SDP_rtpmap(mgcp_conn.rtp_pt, + mgcp_conn.mime_type & "/" & + int2str(mgcp_conn.sample_rate))), + valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); + MGCP.send(ts_MDCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); + //mgcp_mdcx_seen := true; + repeat; + } +} + + /* this component represents a single subscriber connection at the MSC. @@ -32,7 +224,12 @@ /* procedure port back to our parent (BSSMAP_Emulation_CT) for control */ port BSSMAPEM_PROC_PT BSSMAPEM; - var MSC_State g_state := MSC_STATE_NONE; + var MediaState g_media; +} + +/* initialize all parameters */ +function f_MscConnHdlr_init(integer i, HostName bts, HostName mgw) runs on MSC_ConnHdlr { + f_MediaState_init(g_media, i, bts, mgw); } /* Callback function from general BSSMAP_Emulation whenever a connectionless @@ -58,15 +255,6 @@ const MGCPOps MSC_MGCPOps := { create_cb := refers(MGCP_Emulation.ExpectedCreateCallback) -} - -type enumerated MSC_State { - MSC_STATE_NONE, - MSC_STATE_WAIT_ASS_COMPL, - MSC_STATE_WAIT_CRCX_ACK, - MSC_STATE_WAIT_MDCX_ACK, - MSC_STATE_WAIT_CLEAR_COMPL, - MSC_STATE_WAIT_DLCX_ACK } /* register an expect with the BSSMAP core */ @@ -149,69 +337,196 @@ } } -/* establish a channel fully, expecting an assignment matching 'exp' */ -function f_establish_fully(TestHdlrParams pars, PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) -runs on MSC_ConnHdlr return PDU_BSSAP { - var PDU_BSSAP bssap; +/* Convert from Ericsson ChanDesc2 format to Osmocom RslChannelNr format */ +function f_ChDesc2RslChanNr(ChannelDescription2_V ch_desc, out RslChannelNr chan_nr, out GsmArfcn arfcn) { + var BIT5 inp := ch_desc.channelTypeandTDMAOffset; + + chan_nr.tn := bit2int(ch_desc.timeslotNumber); + + if (match(inp, '00001'B)) { /* TCH/F */ + chan_nr.u.ch0 := RSL_CHAN_NR_Bm_ACCH; + } + else if (match(inp, '0001?'B)) { /* TCH/H */ + chan_nr.u.lm.sub_chan := bit2int(substr(inp, 4, 1)); + } + else if (match(inp, '001??'B)) { /* SDCCH/4 */ + chan_nr.u.sdcch4.sub_chan := bit2int(substr(inp, 3, 2)); + } + else if (match(inp, '01???'B)) { /* SDCCH/8 */ + chan_nr.u.sdcch8.sub_chan := bit2int(substr(inp, 2, 3)); + } + else { + setverdict(fail, "Unknown ChDesc!"); + self.stop; + } + + if (ch_desc.octet3 and4b '10'O == '10'O) { + setverdict(fail, "No support for Hopping"); + self.stop; + } else { + var OCT2 concat := ch_desc.octet3 & ch_desc.octet4; + arfcn := oct2int(concat); + } +} + +type record AssignmentState { + /* global */ + boolean voice_call, + boolean is_assignment, + /* Assignment related bits */ + boolean rr_ass_cmpl_seen, + RslChannelNr old_chan_nr, + /* Modify related bits */ + boolean rr_modify_seen, + boolean rsl_modify_seen +} + +template (value) AssignmentState ts_AssignmentStateInit := { + voice_call := false, + is_assignment := false, + rr_ass_cmpl_seen := false, + old_chan_nr := -, + rr_modify_seen := false, + rsl_modify_seen := false +} + +altstep as_assignment(inout AssignmentState st) runs on MSC_ConnHdlr { var RSL_Message rsl; - var MgcpCommand cmd; - timer T := 10.0; - var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); - var boolean crcx_seen := false; - var boolean rr_modify_seen := false; - var ExpectCriteria mgcpcrit := { - connid := omit, - endpoint := omit, - transid := omit - }; - var SDP_Message sdp; + [not st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl { + var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload); + log("Rx L3 from net: ", l3); + if (ischosen(l3.msgs.rrm.assignmentCommand)) { + var RslChannelNr new_chan_nr; + var GsmArfcn arfcn; + f_ChDesc2RslChanNr(l3.msgs.rrm.assignmentCommand.descrOf1stChAfterTime, + new_chan_nr, arfcn); + /* FIXME: Determine TRX NR by ARFCN, instead of hard-coded TRX0! */ - mgcp_conn_id := f_mgcp_alloc_conn_id(); - f_create_chan_and_exp(pars); - /* we should now have a COMPL_L3 at the MSC */ - - BSSAP.receive(tr_BSSMAP_ComplL3); - f_create_mgcp_expect(mgcpcrit); - BSSAP.send(ass_cmd); - MGCP.receive(tr_CRCX) -> value cmd; - sdp := valueof(ts_SDP("127.0.0.1", "127.0.0.1", "foo", "21", 1000, { "98" }, - {valueof(ts_SDP_rtpmap(98, "AMR/8000")), - valueof(ts_SDP_ptime(20)) } )); - MGCP.send(ts_CRCX_ACK(cmd.line.trans_id, mgcp_conn_id, sdp)) - - alt { - /* if we receive exactly what we expected, always return + pass */ - [] BSSAP.receive(exp_ass_cpl) -> value bssap { - setverdict(pass); - return bssap; + /* register our component for this channel number at the RSL Emulation */ + f_rslem_register(0, new_chan_nr); + var PDU_ML3_MS_NW l3_tx := valueof(ts_RRM_AssignmentComplete('00'O)); + /* send assignment complete over the new channel */ + RSL.send(ts_RSL_DATA_IND(new_chan_nr, valueof(ts_RslLinkID_DCCH(0)), + enc_PDU_ML3_MS_NW(l3_tx))); + /* by default, send via the new channel from now */ + st.old_chan_nr := g_chan_nr; + g_chan_nr := new_chan_nr; + st.rr_ass_cmpl_seen := true; + repeat; + } else { + setverdict(fail, "Unexpected L3 received", l3); + self.stop; } - [rr_modify_seen == false] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl { + } + [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_REL_REQ(st.old_chan_nr, tr_RslLinkID_DCCH(0))) { + RSL.send(ts_RSL_REL_CONF(st.old_chan_nr, valueof(ts_RslLinkID_DCCH(0)))); + repeat; + } + [st.rr_ass_cmpl_seen] RSL.receive(tr_RSL_RF_CHAN_REL(st.old_chan_nr)) { + RSL.send(ts_RSL_RF_CHAN_REL_ACK(st.old_chan_nr)); + /* FIXME: unregister for old channel number in RSL emulation */ + //f_rslem_unregister(0, st.old_chan_nr); + repeat; + } +} + +altstep as_modify(inout AssignmentState st) runs on MSC_ConnHdlr { + /* no assignment, just mode modify */ + var RSL_Message rsl; + + [st.voice_call and not st.rr_modify_seen] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr)) -> value rsl { var PDU_ML3_NW_MS l3 := dec_PDU_ML3_NW_MS(rsl.ies[2].body.l3_info.payload); log("Rx L3 from net: ", l3); if (ischosen(l3.msgs.rrm.channelModeModify)) { f_rsl_reply(ts_RRM_ModeModifyAck(l3.msgs.rrm.channelModeModify.channelDescription, l3.msgs.rrm.channelModeModify.channelMode), rsl); - rr_modify_seen := true; + st.rr_modify_seen := true; } repeat; } - [rr_modify_seen] RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl { + [st.voice_call and st.rr_modify_seen] RSL.receive(tr_RSL_MsgTypeD(RSL_MT_MODE_MODIFY_REQ)) -> value rsl { RSL.send(ts_RSL_MODE_MODIFY_ACK(g_chan_nr)); + st.rsl_modify_seen := true; repeat; } - [crcx_seen == false] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) -> value rsl { - RSL.send(ts_RSL_IPA_CRCX_ACK(g_chan_nr, 1, 1, 1, 1)); - crcx_seen := true; - repeat; - } - /* mgw CRCX goes here */ +} - [crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) -> value rsl{ - RSL.send(ts_RSL_IPA_MDCX_ACK(g_chan_nr, 1, 1, 1, 1)); - repeat; +/* Determine if given rsl_chan_nr is compatible with given BSSMAP ChannelType */ +function f_channel_compatible(BSSMAP_IE_ChannelType bssmap, RslChannelNr rsl_chan_nr) +return boolean { + select (bssmap.speechOrDataIndicator) { + case ('0011'B) { /* Signalling */ + /* all channels support signalling */ + return true; + } + case else { /* Speech, Speech+CTM or CSD */ + select (bssmap.channelRateAndType) { + case ('08'O) { /* TCH/F */ + select (rsl_chan_nr) { + case (t_RslChanNr_Bm(?)) { return true; } + } + } + case ('09'O) { /* TCH/H */ + select (rsl_chan_nr) { + case (t_RslChanNr_Lm(?, ?)) { return true; } + } + } + case else { /* full or half-rate */ + select (rsl_chan_nr) { + case (t_RslChanNr_Bm(?)) { return true; } + case (t_RslChanNr_Lm(?, ?)) { return true; } + } + } + } } - /* mgw MGCX goes here */ + } + return false; +} +/* establish a channel fully, expecting an assignment matching 'exp' */ +function f_establish_fully(TestHdlrParams pars, PDU_BSSAP ass_cmd, template PDU_BSSAP exp_ass_cpl) +runs on MSC_ConnHdlr return PDU_BSSAP { + var PDU_BSSAP bssap; + timer T := 10.0; + var boolean exp_compl := ischosen(exp_ass_cpl.pdu.bssmap.assignmentComplete); + var ExpectCriteria mgcpcrit := { + connid := omit, + endpoint := omit, + transid := omit + }; + var AssignmentState st := valueof(ts_AssignmentStateInit); + /* if the channel type is SIGNAL, we're not handling a voice call */ + if (ass_cmd.pdu.bssmap.assignmentRequest.channelType.speechOrDataIndicator != '0011'B) { + st.voice_call := true; + } + /* determine if the current channel can support the given service or not */ + if (not f_channel_compatible(ass_cmd.pdu.bssmap.assignmentRequest.channelType, g_chan_nr)) { + st.is_assignment := true; + } + + f_MediaState_init(g_media, 1, "127.0.0.2", "127.0.0.3"); + + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + f_create_mgcp_expect(mgcpcrit); + BSSAP.send(ass_cmd); + + T.start; + alt { + /* assignment related bits */ + [st.is_assignment] as_assignment(st); + + /* modify related bits */ + [not st.is_assignment] as_modify(st); + + /* voice call related bits (IPA CRCX/MDCX + MGCP) */ + [st.voice_call] as_Media(); + + /* if we receive exactly what we expected, always return + pass */ + [] BSSAP.receive(exp_ass_cpl) -> value bssap { + setverdict(pass); + } [exp_compl] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { setverdict(fail, "Received non-matching ASSIGNMENT COMPLETE"); } @@ -228,8 +543,11 @@ setverdict(inconc, "Timeout waiting for ASSIGNMENT COMPLETE"); } } - - self.stop; + log("g_media ", g_media); + if (not isbound(bssap)) { + self.stop; + } + return bssap; } diff --git a/bsc/gen_links.sh b/bsc/gen_links.sh index af747b3..6417a3c 100755 --- a/bsc/gen_links.sh +++ b/bsc/gen_links.sh @@ -76,5 +76,5 @@ gen_links $DIR $FILES DIR=../library -FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" +FILES="General_Types.ttcn Osmocom_Types.ttcn GSM_Types.ttcn Native_Functions.ttcn Native_FunctionDefs.cc IPA_Types.ttcn IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc IPA_Emulation.ttcn L3_Templates.ttcn BSSMAP_Templates.ttcn BSSMAP_Emulation.ttcn RLCMAC_CSN1_Types.ttcn GSM_RR_Types.ttcn RSL_Types.ttcn RSL_Emulation.ttcn MGCP_Emulation.ttcn MGCP_Types.ttcn MGCP_Templates.ttcn MGCP_CodecPort.ttcn MGCP_CodecPort_CtrlFunct.ttcn MGCP_CodecPort_CtrlFunctDef.cc BSSAP_CodecPort.ttcn BSSAP_Adapter.ttcn Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn RTP_CodecPort.ttcn RTP_CodecPort_CtrlFunct.ttcn RTP_CodecPort_CtrlFunctDef.cc RTP_Emulation.ttcn IuUP_Types.ttcn IuUP_EncDec.cc IuUP_Emulation.ttcn GSUP_Types.ttcn" gen_links $DIR $FILES diff --git a/bsc/regen_makefile.sh b/bsc/regen_makefile.sh index 1d5b92b..08eaae4 100755 --- a/bsc/regen_makefile.sh +++ b/bsc/regen_makefile.sh @@ -2,6 +2,6 @@ MAIN=BSC_Tests.ttcn -FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc *.c" +FILES="*.ttcn IPA_CodecPort_CtrlFunctDef.cc IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc SCTPasp_PT.cc RTP_EncDec.cc SDP_EncDec.cc RTP_CodecPort_CtrlFunctDef.cc MGCP_CodecPort_CtrlFunctDef.cc IuUP_EncDec.cc Native_FunctionDefs.cc *.c" ../regen-makefile.sh $MAIN $FILES -- To view, visit https://gerrit.osmocom.org/6186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5f830b010ea1b466ae74fa810df86638a74a3b8b Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 07:05:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 07:05:44 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 1: > As described in the commit description, I'm still having some > issues due to the ICMP packets not being forwarded after arriving > to the tun device. The GGSN processing part seems to be working > fine but still it'd be better to solve it before merging them. might be worth creating a redmine issue with attached pcap? -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 07:16:19 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 07:16:19 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: msc: Disable t310 test for now (seems to never terminate on ... Message-ID: Review at https://gerrit.osmocom.org/6189 msc: Disable t310 test for now (seems to never terminate on TITAN 6.1.0) Change-Id: I1e8d1101cfea6d861f02cca52f3dc2d1453c33f8 --- M msc/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/89/6189/1 diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index f91ff38..0e59dcf 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1623,7 +1623,7 @@ execute( TC_mo_crcx_ran_timeout() ); execute( TC_mo_crcx_ran_reject() ); execute( TC_mt_crcx_ran_reject() ); - execute( TC_mt_t310() ); + //execute( TC_mt_t310() ); execute( TC_gsup_cancel() ); execute( TC_lu_imsi_auth_tmsi_encr_1_13() ); execute( TC_lu_imsi_auth_tmsi_encr_3_13() ); -- To view, visit https://gerrit.osmocom.org/6189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e8d1101cfea6d861f02cca52f3dc2d1453c33f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 30 07:33:35 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 07:33:35 +0000 Subject: osmo-ttcn3-hacks[master]: msc: Disable t310 test for now (seems to never terminate on ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e8d1101cfea6d861f02cca52f3dc2d1453c33f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 07:33:36 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 07:33:36 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: msc: Disable t310 test for now (seems to never terminate on ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msc: Disable t310 test for now (seems to never terminate on TITAN 6.1.0) ...................................................................... msc: Disable t310 test for now (seems to never terminate on TITAN 6.1.0) Change-Id: I1e8d1101cfea6d861f02cca52f3dc2d1453c33f8 --- M msc/MSC_Tests.ttcn 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/msc/MSC_Tests.ttcn b/msc/MSC_Tests.ttcn index f91ff38..0e59dcf 100644 --- a/msc/MSC_Tests.ttcn +++ b/msc/MSC_Tests.ttcn @@ -1623,7 +1623,7 @@ execute( TC_mo_crcx_ran_timeout() ); execute( TC_mo_crcx_ran_reject() ); execute( TC_mt_crcx_ran_reject() ); - execute( TC_mt_t310() ); + //execute( TC_mt_t310() ); execute( TC_gsup_cancel() ); execute( TC_lu_imsi_auth_tmsi_encr_1_13() ); execute( TC_lu_imsi_auth_tmsi_encr_3_13() ); -- To view, visit https://gerrit.osmocom.org/6189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e8d1101cfea6d861f02cca52f3dc2d1453c33f8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From admin at opensuse.org Tue Jan 30 08:42:13 2018 From: admin at opensuse.org (OBS Notification) Date: Tue, 30 Jan 2018 08:42:13 +0000 Subject: Build failure of network:osmocom:latest/openbsc in Debian_9.0/x86_64 In-Reply-To: References: Message-ID: <5a702fe7d0eb5_5f7a692f5825821f@build.opensuse.org> Visit https://build.opensuse.org/package/live_build_log/network:osmocom:latest/openbsc/Debian_9.0/x86_64 Package network:osmocom:latest/openbsc failed to build in Debian_9.0/x86_64 Check out the package for editing: osc checkout network:osmocom:latest openbsc Last lines of build log: [ 144s] [ 144s] Makefile:736: recipe for target 'check-local' failed [ 144s] make[5]: *** [check-local] Error 1 [ 144s] make[5]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 144s] Makefile:586: recipe for target 'check-am' failed [ 144s] make[4]: *** [check-am] Error 2 [ 144s] make[4]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 144s] Makefile:438: recipe for target 'check-recursive' failed [ 144s] make[3]: *** [check-recursive] Error 1 [ 144s] make[3]: Leaving directory '/usr/src/packages/BUILD/openbsc/tests' [ 144s] Makefile:520: recipe for target 'check-recursive' failed [ 144s] make[2]: *** [check-recursive] Error 1 [ 144s] make[2]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 144s] Makefile:811: recipe for target 'check' failed [ 144s] make[1]: *** [check] Error 2 [ 144s] make[1]: Leaving directory '/usr/src/packages/BUILD/openbsc' [ 144s] dh_auto_test: make -j1 check VERBOSE=1 returned exit code 2 [ 144s] debian/rules:13: recipe for target 'build' failed [ 144s] make: *** [build] Error 2 [ 144s] dpkg-buildpackage: error: debian/rules build gave error exit status 2 [ 144s] [ 144s] lamb20 failed "build openbsc_1.0.0.dsc" at Tue Jan 30 08:41:59 UTC 2018. [ 144s] [ 144s] ### VM INTERACTION START ### [ 147s] [ 138.964226] reboot: Power down [ 147s] ### VM INTERACTION END ### [ 147s] [ 147s] lamb20 failed "build openbsc_1.0.0.dsc" at Tue Jan 30 08:42:02 UTC 2018. [ 147s] -- 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 Jan 30 09:09:59 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 09:09:59 +0000 Subject: [PATCH] osmo-sgsn[master]: gtphub: check for gsn_addr_from_sockaddr() error Message-ID: Review at https://gerrit.osmocom.org/6190 gtphub: check for gsn_addr_from_sockaddr() error Change-Id: I2d80b5a488e7daa0bc8f57ea304e0e1f10f6c1f5 Fixes: CID182472 --- M src/gprs/gtphub.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/90/6190/1 diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 2ff1b7c..4ee20cd 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -2649,7 +2649,9 @@ { struct gsn_addr gsna; uint16_t port; - gsn_addr_from_sockaddr(&gsna, &port, addr); + if (gsn_addr_from_sockaddr(&gsna, &port, addr) != 0) + return NULL; + return gtphub_port_find(bind, &gsna, port); } -- To view, visit https://gerrit.osmocom.org/6190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d80b5a488e7daa0bc8f57ea304e0e1f10f6c1f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 10:47:18 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 30 Jan 2018 10:47:18 +0000 Subject: [PATCH] osmo-msc[master]: a_iface: correct data type for a.conn_id in gsm_subscriber_c... Message-ID: Review at https://gerrit.osmocom.org/6191 a_iface: correct data type for a.conn_id in gsm_subscriber_connection conn_id is modeled as int, but should be uint32_t. - change conn_id from int to uint32_t Change-Id: Ibf14d7c9a547c4eeb873975e7dcddef223e7df46 Related: OS#2769 --- M include/osmocom/msc/gsm_data.h 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/91/6191/1 diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index 27324d7..f50ebd6 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -209,7 +209,7 @@ /* The connection identifier that is used * to reference the SCCP connection that is * associated with this subscriber connection */ - int conn_id; + uint32_t conn_id; } a; }; -- To view, visit https://gerrit.osmocom.org/6191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf14d7c9a547c4eeb873975e7dcddef223e7df46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 30 11:23:04 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 30 Jan 2018 11:23:04 +0000 Subject: [PATCH] osmo-msc[master]: Make sending an SMS to an unknown subscriber B work over SMPP. Message-ID: Review at https://gerrit.osmocom.org/6192 Make sending an SMS to an unknown subscriber B work over SMPP. Make the submit_to_sms() funcion aware of the message mode. If the message does not require real-time "transactional/forward mode" we can store it in the SMS database even if subscriber B cannot be found in the VLR at this point in time. This should should make the esme_ms_sms_storeforward test in osmo-gsm-tester pass (a tweak to this test's expectations will be needed as well, because the test currently assumes that an invalid phone number for subscriber B will fail immediately, rather than cause the message to eventually expire). Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Related: OS#2354 --- M src/libmsc/smpp_openbsc.c 1 file changed, 9 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/92/6192/1 diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 4e2fb55..b0469f9 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -99,11 +99,12 @@ struct gsm_sms *sms; struct tlv_t *t; int mode; + int can_store_sms = ((submit->esm_class & SMPP34_MSG_MODE_MASK) != 2); /* != forward mode */ dest = subscr_by_dst(net, submit->dest_addr_npi, submit->dest_addr_ton, (const char *)submit->destination_addr); - if (!dest) { + if (!dest && !can_store_sms) { LOGP(DLSMS, LOGL_NOTICE, "SMPP SUBMIT-SM for unknown subscriber: " "%s (NPI=%u)\n", submit->destination_addr, submit->dest_addr_npi); @@ -115,7 +116,8 @@ case TLVID_message_payload: if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, &sms_msg_len) < 0) { - vlr_subscr_put(dest); + if (dest) + vlr_subscr_put(dest); return ESME_ROPTPARNOTALLWD; } break; @@ -149,7 +151,11 @@ sms->receiver = dest; sms->dst.ton = submit->dest_addr_ton; sms->dst.npi = submit->dest_addr_npi; - osmo_strlcpy(sms->dst.addr, dest->msisdn, sizeof(sms->dst.addr)); + if (dest) + osmo_strlcpy(sms->dst.addr, dest->msisdn, sizeof(sms->dst.addr)); + else + osmo_strlcpy(sms->dst.addr, (const char *)submit->destination_addr, + sizeof(sms->dst.addr)); /* fill in the source address */ sms->src.ton = submit->source_addr_ton; -- To view, visit https://gerrit.osmocom.org/6192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 30 11:24:29 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 11:24:29 +0000 Subject: [PATCH] osmo-pcu[master]: Update header includes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6100 to look at the new patch set (#3). Update header includes Many files include unnecessary headers and don't include headers which are actually used. Because of that combined with the fact that OsmoPCU is a mixture of C and C++, it makes it hard to modularize code. Fix this (using iwyu [1] tool): * add missing headers * remove unused headers [1] https://include-what-you-use.org/ Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 --- M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_ms.cpp M src/gprs_ms.h M src/gprs_ms_storage.cpp M src/gprs_rlcmac.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.h M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty_functions.cpp M src/poll_controller.cpp M src/poll_controller.h M src/rlc.cpp M src/sba.cpp M src/sba.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/edge/EdgeTest.cpp M tests/tbf/TbfTest.cpp 25 files changed, 118 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/00/6100/3 diff --git a/src/bts.cpp b/src/bts.cpp index 1669739..918f7a5 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -25,9 +25,10 @@ #include #include #include - +#include #include #include +#include extern "C" { #include @@ -37,6 +38,10 @@ #include #include #include + #include + #include + #include + #include } #include diff --git a/src/bts.h b/src/bts.h index 5679b98..5d143d2 100644 --- a/src/bts.h +++ b/src/bts.h @@ -26,17 +26,17 @@ #include #include #include -#include -#include #include #include } +#include #include "poll_controller.h" #include "sba.h" #include "tbf.h" #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" +#include #endif #include diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index a86e09d..e0d756a 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -21,8 +21,10 @@ #include #include #include +#include #include #include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 33d9cad..740ef6b 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -20,7 +20,7 @@ #include "gprs_ms.h" - +#include #include "bts.h" #include "tbf.h" #include "gprs_debug.h" @@ -33,6 +33,7 @@ #include #include #include + #include } #define GPRS_CODEL_SLOW_INTERVAL_MS 4000 diff --git a/src/gprs_ms.h b/src/gprs_ms.h index f094e96..857f0c9 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -22,13 +22,16 @@ struct gprs_codel; +#include #include "cxx_linuxlist.h" #include "llc.h" #include "tbf.h" #include "pcu_l1_if.h" +#include extern "C" { #include + #include } #include diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp index 6a7f336..c7de6d3 100644 --- a/src/gprs_ms_storage.cpp +++ b/src/gprs_ms_storage.cpp @@ -23,7 +23,10 @@ #include "tbf.h" #include "bts.h" -#include "gprs_debug.h" + +extern "C" { + #include +} #define GPRS_UNDEFINED_IMSI "000" diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index 06c5479..da5c541 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -24,7 +24,7 @@ #include #include #include - +#include extern void *tall_pcu_ctx; diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index ebf4714..e4e40b1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -22,9 +22,16 @@ #include #include #include - +#include +#include +#include +#include #include "pcu_utils.h" +extern "C" { + #include +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e394a6e..e555466 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -31,6 +31,9 @@ extern "C" { #include "mslot_class.h" +#include +#include +#include } /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ diff --git a/src/llc.h b/src/llc.h index 9d402c3..2e7229c 100644 --- a/src/llc.h +++ b/src/llc.h @@ -29,7 +29,6 @@ #define LLC_MAX_LEN 1543 struct BTS; -struct msgb; /** * I represent the LLC data to a MS diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 577d41e..f56332e 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -29,9 +29,11 @@ #include #include #include +#include +#include +#include } -#include #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b04..2a354d8 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -26,12 +26,18 @@ #include #include #include + extern "C" { #include #include #include #include #include +#include +#include +#include +#include +#include } #include @@ -40,7 +46,6 @@ #include #include #include -#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..0c3a414 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -17,22 +17,34 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include extern "C" { #include "pcu_vty.h" +#include +#include #include -#include +#include +#include #include +#include +#include +#include +#include #include #include #include diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index eb15aa6..d4162a9 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -27,11 +27,19 @@ #include "gprs_ms_storage.h" #include "gprs_ms.h" #include "cxx_linuxlist.h" +#include +#include +#include +#include +#include extern "C" { #include #include #include + #include + #include + #include } int pcu_vty_config_write_pcu_ext(struct vty *vty) diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index 5c5a717..744b612 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -23,6 +23,13 @@ #include #include #include +#include +#include + +extern "C" { +#include +#include +} PollController::PollController(BTS& bts) : m_bts(bts) diff --git a/src/poll_controller.h b/src/poll_controller.h index b9ae80e..65d1fee 100644 --- a/src/poll_controller.h +++ b/src/poll_controller.h @@ -21,8 +21,6 @@ #pragma once -struct gprs_rlcmac_bts; - struct BTS; /** diff --git a/src/rlc.cpp b/src/rlc.cpp index d7f0609..a82f550 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -18,11 +18,17 @@ #include "bts.h" #include "gprs_debug.h" +#include +#include -#include +#include +#include +#include extern "C" { #include +#include +#include } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..5dfdddb 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -20,14 +20,15 @@ */ #include -#include #include #include #include extern "C" { +#include #include #include +#include } #include diff --git a/src/sba.h b/src/sba.h index d2d3106..27dae21 100644 --- a/src/sba.h +++ b/src/sba.h @@ -27,7 +27,6 @@ } struct BTS; -class PollController; struct gprs_rlcmac_pdch; /* diff --git a/src/tbf.cpp b/src/tbf.cpp index 8cfca3a..74f2cd8 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -25,10 +25,13 @@ #include #include #include -#include #include -#include #include +#include +#include +#include +#include +#include extern "C" { #include @@ -36,6 +39,9 @@ #include #include #include + #include + #include + #include } #include diff --git a/src/tbf.h b/src/tbf.h index 803ea33..fbef20e 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -20,20 +20,23 @@ #ifdef __cplusplus -#include "gprs_rlcmac.h" #include "llc.h" #include "rlc.h" #include "cxx_linuxlist.h" #include - +#include +#include #include extern "C" { #include + #include + #include + #include } struct bssgp_bvc_ctx; -struct pcu_l1_meas; class GprsMs; +struct gprs_rlcmac_bts; /* * TBF instance diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index e8aec23..ae487c2 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -28,18 +28,28 @@ #include #include #include - +#include +#include +#include +#include #include "pcu_utils.h" extern "C" { #include #include #include + #include + #include + #include + #include + #include + #include + #include + #include } #include #include -#include /* After sending these frames, we poll for ack/nack. */ #define POLL_ACK_AFTER_FRAMES 20 diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1560eb0..6960ea9 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -28,12 +28,21 @@ #include #include #include - +#include +#include +#include #include "pcu_utils.h" extern "C" { #include #include + #include + #include + #include + #include + #include + #include + #include } #include diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 1abdcfd..eb9ef42 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -27,6 +27,8 @@ #include "rlc.h" #include "llc.h" #include "bts.h" +#include + extern "C" { #include "pcu_vty.h" diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index fbed45a..0a6be87 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -27,6 +27,7 @@ #include "gprs_bssgp_pcu.h" #include "pcu_l1_if.h" #include "decoding.h" +#include extern "C" { #include "pcu_vty.h" -- To view, visit https://gerrit.osmocom.org/6100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Tue Jan 30 11:24:33 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 11:24:33 +0000 Subject: [PATCH] osmo-pcu[master]: Move paging generation into PDCH Message-ID: Review at https://gerrit.osmocom.org/6193 Move paging generation into PDCH Previously paging was prepared inside BTS function and than handed over to PDCH function. Move the actual preparation into PDCH to better decouple PDCH from BTS. Change-Id: I389fb16b6e54040770c21f88edbcb8e045636928 --- M src/bts.cpp M src/bts.h 2 files changed, 14 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/93/6193/1 diff --git a/src/bts.cpp b/src/bts.cpp index 918f7a5..496dc4a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -308,7 +308,6 @@ uint8_t l, trx, ts, any_tbf = 0; struct gprs_rlcmac_tbf *tbf; LListHead *pos; - struct gprs_rlcmac_paging *pag; uint8_t slot_mask[8]; int8_t first_ts; /* must be signed */ @@ -364,16 +363,10 @@ for (ts = 0; ts < 8; ts++) { if ((slot_mask[trx] & (1 << ts))) { /* schedule */ - pag = talloc_zero(tall_pcu_ctx, - struct gprs_rlcmac_paging); - if (!pag) + if (!m_bts.trx[trx].pdch[ts].add_paging(chan_needed, identity_lv)) return -ENOMEM; - pag->chan_needed = chan_needed; - memcpy(pag->identity_lv, identity_lv, - identity_lv[0] + 1); - m_bts.trx[trx].pdch[ts].add_paging(pag); - LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of " - "TRX=%d TS=%d\n", trx, ts); + + LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of TRX=%d TS=%d\n", trx, ts); any_tbf = 1; } } @@ -976,9 +969,18 @@ return msg; } -void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag) +bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) { + struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); + if (!pag) + return false; + + pag->chan_needed = chan_needed; + memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); + llist_add(&pag->list, &paging_list); + + return true; } void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) diff --git a/src/bts.h b/src/bts.h index 5d143d2..c3bee12 100644 --- a/src/bts.h +++ b/src/bts.h @@ -73,7 +73,7 @@ struct gprs_rlcmac_paging *dequeue_paging(); struct msgb *packet_paging_request(); - void add_paging(struct gprs_rlcmac_paging *pag); + bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); void free_resources(); -- To view, visit https://gerrit.osmocom.org/6193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I389fb16b6e54040770c21f88edbcb8e045636928 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 11:39:32 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 11:39:32 +0000 Subject: [PATCH] osmo-gsm-tester[master]: aoip_smpp: Since recent osmo-msc, we accept all sms in store... Message-ID: Review at https://gerrit.osmocom.org/6194 aoip_smpp: Since recent osmo-msc, we accept all sms in store&forward mode Change-Id: Ieb5656f3ca93f4343441d90e30fbe904382c44e3 --- M suites/aoip_smpp/esme_ms_sms_storeforward.py 1 file changed, 8 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/94/6194/1 diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 543170e..74765bc 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -38,9 +38,11 @@ hlr.subscriber_add(ms) wrong_msisdn = ms.msisdn + esme.msisdn -print('sending sms with wrong msisdn %s, it will fail' % wrong_msisdn) +print('sending sms with wrong msisdn %s, it will be stored but not delivered' % wrong_msisdn) msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_STOREFORWARD) +# Since osmo-msc 1e67fea7ba5c6336, we accept all sms in store&forward mode without looking at HLR +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_STOREFORWARD) +umref_wrong = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) print('sending sms, it will be stored...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send not-yet-registered message') @@ -60,4 +62,8 @@ wait(ms.sms_was_received, msg) print('Waiting to receive and consume sms receipt with reference', umref) wait(esme.receipt_was_received, umref) + +print('Asserting the sms with wrong msisdn was not delivered', umref_wrong) +assert not esme.receipt_was_received(umref_wrong) + esme.disconnect() -- To view, visit https://gerrit.osmocom.org/6194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb5656f3ca93f4343441d90e30fbe904382c44e3 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 Jan 30 11:48:02 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 11:48:02 +0000 Subject: [PATCH] osmo-pcu[master]: Move PDCH-related functions into 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/6053 to look at the new patch set (#3). Move PDCH-related functions into separate file The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539 --- M src/Makefile.am M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_bssgp_pcu.h M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_vty_functions.cpp A src/pdch.cpp A src/pdch.h M src/sba.cpp M src/tbf.cpp 14 files changed, 1,119 insertions(+), 1,024 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/6053/3 diff --git a/src/Makefile.am b/src/Makefile.am index 7d2a62e..b2f64f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,6 +54,7 @@ tbf_ul.cpp \ tbf_dl.cpp \ bts.cpp \ + pdch.cpp \ poll_controller.cpp \ encoding.cpp \ sba.cpp \ @@ -85,6 +86,7 @@ mslot_class.h \ tbf.h \ bts.h \ + pdch.h \ poll_controller.h \ encoding.h \ sba.h \ diff --git a/src/bts.cpp b/src/bts.cpp index 496dc4a..096d3af 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -29,6 +29,7 @@ #include #include #include +#include extern "C" { #include @@ -43,8 +44,6 @@ #include #include } - -#include #include #include @@ -843,801 +842,6 @@ return ms; } -/* - * PDCH code below. TODO: move to a separate file - */ - -void gprs_rlcmac_pdch::enable() -{ - /* TODO: Check if there are still allocated resources.. */ - INIT_LLIST_HEAD(&paging_list); - m_is_enabled = 1; -} - -void gprs_rlcmac_pdch::disable() -{ - /* TODO.. kick free_resources once we know the TRX/TS we are on */ - m_is_enabled = 0; -} - -void gprs_rlcmac_pdch::free_resources() -{ - struct gprs_rlcmac_paging *pag; - - /* we are not enabled. there should be no resources */ - if (!is_enabled()) - return; - - /* kick all TBF on slot */ - gprs_rlcmac_tbf::free_all(this); - - /* flush all pending paging messages */ - while ((pag = dequeue_paging())) - talloc_free(pag); - - trx->bts->sba()->free_resources(this); -} - -struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() -{ - struct gprs_rlcmac_paging *pag; - - if (llist_empty(&paging_list)) - return NULL; - pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); - llist_del(&pag->list); - - return pag; -} - -struct msgb *gprs_rlcmac_pdch::packet_paging_request() -{ - struct gprs_rlcmac_paging *pag; - struct msgb *msg; - unsigned wp = 0, len; - - /* no paging, no message */ - pag = dequeue_paging(); - if (!pag) - return NULL; - - LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); - - /* alloc message */ - msg = msgb_alloc(23, "pag ctrl block"); - if (!msg) { - talloc_free(pag); - return NULL; - } - bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); - if (!pag_vec) { - msgb_free(msg); - talloc_free(pag); - return NULL; - } - wp = Encoding::write_packet_paging_request(pag_vec); - - /* loop until message is full */ - while (pag) { - /* try to add paging */ - if ((pag->identity_lv[1] & 0x07) == 4) { - /* TMSI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", - ntohl(*((uint32_t *)(pag->identity_lv + 1)))); - len = 1 + 1 + 1 + 32 + 2 + 1; - if (pag->identity_lv[0] != 5) { - LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " - "MI != 5 octets!\n"); - goto continue_next; - } - } else { - /* MI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", - osmo_hexdump(pag->identity_lv + 1, - pag->identity_lv[0])); - len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; - if (pag->identity_lv[0] > 8) { - LOGP(DRLCMAC, LOGL_ERROR, "Paging with " - "MI > 8 octets!\n"); - goto continue_next; - } - } - if (wp + len > 184) { - LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " - "next time\n"); - /* put back paging record, because does not fit */ - llist_add_tail(&pag->list, &paging_list); - break; - } - Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], - pag->identity_lv + 1, pag->chan_needed); - -continue_next: - talloc_free(pag); - pag = dequeue_paging(); - } - - bitvec_pack(pag_vec, msgb_put(msg, 23)); - RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); - bitvec_free(pag_vec); - talloc_free(mac_control_block); - - return msg; -} - -bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) -{ - struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); - if (!pag) - return false; - - pag->chan_needed = chan_needed; - memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); - - llist_add(&pag->list, &paging_list); - - return true; -} - -void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) -{ - struct gprs_rlcmac_tbf *tbf, *new_tbf; - uint32_t tlli = packet->TLLI; - GprsMs *ms = bts()->ms_by_tlli(tlli); - gprs_rlcmac_ul_tbf *ul_tbf; - - tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", - fn, tlli, trx_no(), ts_no); - if (ms) - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown TBF corresponds to MS with IMSI %s, TA %d, " - "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", - ms->imsi(), ms->ta(), - ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, - ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", - ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, - ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - TBF_POLL_SCHED_UNSET(tbf); - - /* check if this control ack belongs to packet uplink ack */ - ul_tbf = as_ul_tbf(tbf); - if (ul_tbf && ul_tbf->handle_ctrl_ack()) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); - if (ul_tbf->ctrl_ack_to_toggle()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); - - tbf_free(tbf); - return; - } - if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { - /* We now know that the PACCH really existed */ - LOGPTBF(new_tbf, LOGL_INFO, - "The TBF has been confirmed on the PACCH, " - "changed type from CCCH to PACCH\n"); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - } - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - /* stop pending assignment timer */ - new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - - tbf_assign_control_ts(new_tbf); - return; - } - if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - - tbf_assign_control_ts(new_tbf); - /* there might be LLC packets waiting in the queue, but the DL - * TBF might have been released while the UL TBF has been - * established */ - if (new_tbf->ms()->need_dl_tbf()) - new_tbf->establish_dl_tbf_on_pacch(); - - return; - } - LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " - "at no request\n"); -} - -static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) -{ - static const int16_t rx_qual_map[] = { - 0, /* 0,14 % */ - 0, /* 0,28 % */ - 1, /* 0,57 % */ - 1, /* 1,13 % */ - 2, /* 2,26 % */ - 5, /* 4,53 % */ - 9, /* 9,05 % */ - 18, /* 18,10 % */ - }; - - meas->set_ms_rx_qual(rx_qual_map[ - OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) - ]); -} - -static void get_meas(struct pcu_l1_meas *meas, - const Packet_Resource_Request_t *qr) -{ - unsigned i; - - meas->set_ms_c_value(qr->C_VALUE); - if (qr->Exist_SIGN_VAR) - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_INFO, - "Packet resource request: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); - } - } -} - -static void get_meas(struct pcu_l1_meas *meas, - const Channel_Quality_Report_t *qr) -{ - unsigned i; - - get_rx_qual_meas(meas, qr->RXQUAL); - meas->set_ms_c_value(qr->C_VALUE); - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_DEBUG, - "Channel quality report: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL_TN); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); - } - } -} - -static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) -{ - bts->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), - tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject */ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); - } -} - -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 */ - struct gprs_rlcmac_dl_tbf *tbf; - int rc; - struct pcu_l1_meas meas; - int num_blocks; - uint8_t bits_data[RLC_GPRS_WS/8]; - bitvec bits; - int bsn_begin, bsn_end; - char show_bits[RLC_GPRS_WS + 1]; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_gprs_acknack_bits( - &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits)); - - rc = tbf->rcvd_dl_ack( - ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - } -} - -void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) -{ - int8_t tfi = 0; /* must be signed */ - struct gprs_rlcmac_dl_tbf *tbf; - struct pcu_l1_meas meas; - int rc; - int num_blocks; - uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; - char show_bits[RLC_EGPRS_MAX_WS + 1]; - bitvec bits; - int bsn_begin, bsn_end; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, - "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); - - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " - "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " - "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", - (int)ack_nack->EGPRS_AckNack.UnionType, - (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, - (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, - (void *)&ack_nack->EGPRS_AckNack.UnionType, - (void *)&ack_nack->EGPRS_AckNack.Desc, - (int)offsetof(EGPRS_AckNack_t, Desc), - (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->window()->v_a(), - tbf->window()->v_s(), - osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, - sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_egprs_acknack_bits( - &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits) - ); - - rc = tbf->rcvd_dl_ack( - ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - - /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - /* TODO: Implement Measurements parsing for EGPRS */ - /* - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - */ - } -} - -void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - if (request->ID.UnionType) { - struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; - uint32_t tlli = request->ID.u.TLLI; - uint8_t ms_class = 0; - uint8_t egprs_ms_class = 0; - uint8_t ta = GSM48_TA_INVALID; - struct pcu_l1_meas meas; - - GprsMs *ms = bts()->ms_by_tlli(tlli); - /* Keep the ms, even if it gets idle temporarily */ - GprsMs::Guard guard(ms); - - if (ms) { - ul_tbf = ms->ul_tbf(); - dl_tbf = ms->dl_tbf(); - ta = ms->ta(); - } - - /* We got a RACH so the MS was in packet idle mode and thus - * didn't have any active TBFs */ - if (ul_tbf) { - LOGPTBFUL(ul_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", - tlli); - tbf_free(ul_tbf); - ul_tbf = NULL; - } - - if (dl_tbf) { - LOGPTBFUL(dl_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", - tlli); - tbf_free(dl_tbf); - dl_tbf = NULL; - } - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " - "in packet resource request of single " - "block, so we provide one:\n"); - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled!\n"); - } else { - ta = sba->ta; - bts()->sba()->free_sba(sba); - } - if (request->Exist_MS_Radio_Access_capability) { - ms_class = Decoding::get_ms_class_by_capability( - &request->MS_Radio_Access_capability); - egprs_ms_class = - Decoding::get_egprs_ms_class_by_capability( - &request->MS_Radio_Access_capability); - } - if (!ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); - if (egprs_ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, - "MS supports EGPRS multislot class %d.\n", - egprs_ms_class); - ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, - egprs_ms_class, tlli, ta, ms); - - if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); - return; - } - - /* set control ts to current MS's TS, until assignment complete */ - LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", - ul_tbf->control_ts, ts_no); - - ul_tbf->control_ts = ts_no; - /* schedule uplink assignment */ - TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - - /* get capabilities */ - if (ul_tbf->ms()) - ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); - - /* get measurements */ - if (ul_tbf->ms()) { - get_meas(&meas, request); - ul_tbf->ms()->update_l1_meas(&meas); - } - return; - } - - if (request->ID.u.Global_TFI.UnionType) { - struct gprs_rlcmac_dl_tbf *dl_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; - dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!dl_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); - return; - } - LOGPTBFDL(dl_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - dl_tbf->m_n3101 = 0; - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; - ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!ul_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); - return; - } - LOGPTBFUL(ul_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - ul_tbf->m_n3101 = 0; - } -} - -void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled! TLLI=0x%08x\n", report->TLLI); - } else { - GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); - if (!ms) - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "but TLLI 0x%08x is unknown\n", report->TLLI); - else - ms->set_ta(sba->ta); - - bts()->sba()->free_sba(sba); - } - gprs_rlcmac_meas_rep(report); -} - -/* Received Uplink RLC control block. */ -int gprs_rlcmac_pdch::rcv_control_block( - const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) -{ - RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); - - if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - else - bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - - bts()->rlc_rcvd_control(); - switch (ul_control_block->u.MESSAGE_TYPE) { - case MT_PACKET_CONTROL_ACK: - rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); - break; - case MT_PACKET_DOWNLINK_ACK_NACK: - rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); - break; - case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: - rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); - break; - case MT_PACKET_RESOURCE_REQUEST: - rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); - break; - case MT_PACKET_MEASUREMENT_REPORT: - rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); - break; - case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: - /* ignoring it. change the SI to not force sending these? */ - break; - default: - bts()->decode_error(); - LOGP(DRLCMAC, LOGL_NOTICE, - "RX: [PCU <- BTS] unknown control block(%d) received\n", - ul_control_block->u.MESSAGE_TYPE); - } - talloc_free(ul_control_block); - return 1; -} - - -/* received RLC/MAC block from L1 */ -int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas) -{ - GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); - if (!cs) { - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" - "length: %d)\n", len); - return -EINVAL; - } - - bts()->rlc_ul_bytes(len); - - LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " - "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); - - if (cs.isGprs()) - return rcv_block_gprs(data, len, fn, meas, cs); - - if (cs.isEgprs()) - return rcv_data_block(data, len, fn, meas, cs); - - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", - cs.name()); - return -EINVAL; -} - -/*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - int rc; - struct gprs_rlc_data_info rlc_dec; - struct gprs_rlcmac_ul_tbf *tbf; - unsigned len = cs.sizeUL(); - - /* These are always data blocks, since EGPRS still uses CS-1 for - * control blocks (see 44.060, section 10.3, 1st par.) - */ - if (cs.isEgprs()) { - if (!bts()->bts_data()->egprs_enabled) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not enabled\n", - cs.name()); - return -EINVAL; - } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } else { - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } - - LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); - - rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); - if (rc < 0) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but header parsing has failed\n", - cs.name()); - bts()->decode_error(); - return rc; - } - - LOGP(DRLCMACUL, LOGL_INFO, - "Got %s RLC block: " - "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " - "rc=%d\n", - cs.name(), - rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, - rc); - - /* find TBF inst from given TFI */ - tbf = ul_tbf_by_tfi(rlc_dec.tfi); - if (!tbf) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", - rlc_dec.tfi); - return 0; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); -} - -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - unsigned payload = data[0] >> 6; - bitvec *block; - int rc = 0; - unsigned len = cs.maxBytesUL(); - - switch (payload) { - case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, data_len, fn, meas, cs); - break; - case GPRS_RLCMAC_CONTROL_BLOCK: - block = bitvec_alloc(len, tall_pcu_ctx); - if (!block) - return -ENOMEM; - bitvec_unpack(block, data); - rc = rcv_control_block(data, data_len, block, fn); - bitvec_free(block); - break; - case GPRS_RLCMAC_CONTROL_BLOCK_OPT: - LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); - break; - default: - LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); - rc = -EINVAL; - } - - return rc; -} - /* update TA based on TA provided by PH-DATA-IND */ void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta) { @@ -1695,110 +899,6 @@ update_tbf_ta(tbf, ta); } -} - -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - gprs_rlcmac_tbf *tbf; - LListHead *pos; - - llist_for_each(pos, tbf_list) { - tbf = pos->entry(); - if (tbf->tfi() != tfi) - continue; - if (!tbf->pdch[ts_no]) - continue; - return tbf; - } - return NULL; -} - -gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) -{ - return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); -} - -gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) -{ - return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); -} - -/* lookup TBF Entity (by TFI) */ -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - struct gprs_rlcmac_tbf *tbf; - - if (tfi >= 32) - return NULL; - - tbf = m_tbfs[dir][tfi]; - - if (!tbf) - return NULL; - - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { - return tbf; - } - - return NULL; -} - -void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - if (m_tbfs[tbf->direction][tbf->tfi()]) - LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " - "%s has not been detached, overwriting it\n", - ts_no, trx_no(), - m_tbfs[tbf->direction][tbf->tfi()]->name()); - - m_num_tbfs[tbf->direction] += 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; - } - m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); - m_tbfs[tbf->direction][tbf->tfi()] = tbf; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); - - m_num_tbfs[tbf->direction] -= 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); - } - m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); - m_tbfs[tbf->direction][tbf->tfi()] = NULL; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) -{ - m_num_reserved[dir] += 1; -} - -void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) -{ - OSMO_ASSERT(m_num_reserved[dir] > 0); - m_num_reserved[dir] -= 1; } void gprs_rlcmac_trx::reserve_slots(enum gprs_rlcmac_tbf_direction dir, diff --git a/src/bts.h b/src/bts.h index c3bee12..5492770 100644 --- a/src/bts.h +++ b/src/bts.h @@ -37,6 +37,7 @@ #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" #include +#include #endif #include @@ -65,96 +66,16 @@ struct BTS; struct GprsMs; -/* - * PDCH instance - */ -struct gprs_rlcmac_pdch { -#ifdef __cplusplus - struct gprs_rlcmac_paging *dequeue_paging(); - struct msgb *packet_paging_request(); - - bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); - - void free_resources(); - - bool is_enabled() const; - - void enable(); - void disable(); - - /* dispatching of messages */ - int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas); - int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - - gprs_rlcmac_bts *bts_data() const; - BTS *bts() const; - uint8_t trx_no() const; - - struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); - struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); - - void attach_tbf(gprs_rlcmac_tbf *tbf); - void detach_tbf(gprs_rlcmac_tbf *tbf); - - unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; - - void reserve(enum gprs_rlcmac_tbf_direction dir); - void unreserve(enum gprs_rlcmac_tbf_direction dir); - unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; - - uint8_t assigned_usf() const; - uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; -#endif - - uint8_t m_is_enabled; /* TS is enabled */ - uint8_t tsc; /* TSC of this slot */ - uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ - uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ - uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ - struct llist_head paging_list; /* list of paging messages */ - uint32_t last_rts_fn; /* store last frame number of RTS */ - - /* back pointers */ - struct gprs_rlcmac_trx *trx; - uint8_t ts_no; - -#ifdef __cplusplus -private: - int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); - - void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); - void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); - void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); - void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); - void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); - gprs_rlcmac_tbf *tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); - gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); -#endif - - uint8_t m_num_tbfs[2]; - uint8_t m_num_reserved[2]; - uint8_t m_assigned_usf; /* bit set */ - uint32_t m_assigned_tfi[2]; /* bit set */ - struct gprs_rlcmac_tbf *m_tbfs[2][32]; -}; - struct gprs_rlcmac_trx { void *fl1h; uint16_t arfcn; - struct gprs_rlcmac_pdch pdch[8]; /* back pointers */ struct BTS *bts; uint8_t trx_no; #ifdef __cplusplus + struct gprs_rlcmac_pdch pdch[8]; void reserve_slots(enum gprs_rlcmac_tbf_direction dir, uint8_t slots); void unreserve_slots(enum gprs_rlcmac_tbf_direction dir, uint8_t slots); #endif @@ -539,33 +460,6 @@ return m_dl_tbfs; } -inline BTS *gprs_rlcmac_pdch::bts() const -{ - return trx->bts; -} - -inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const -{ - return m_num_tbfs[dir]; -} - -inline unsigned gprs_rlcmac_pdch::num_reserved( - enum gprs_rlcmac_tbf_direction dir) const -{ - return gprs_rlcmac_pdch::m_num_reserved[dir]; -} - -inline uint8_t gprs_rlcmac_pdch::assigned_usf() const -{ - return m_assigned_usf; -} - -inline uint32_t gprs_rlcmac_pdch::assigned_tfi( - enum gprs_rlcmac_tbf_direction dir) const -{ - return m_assigned_tfi[dir]; -} - inline struct rate_ctr_group *BTS::rate_counters() const { return m_ratectrs; @@ -686,15 +580,6 @@ #undef CREATE_STAT_INLINE -inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const -{ - return trx->bts->bts_data(); -} - -inline uint8_t gprs_rlcmac_pdch::trx_no() const -{ - return trx->trx_no; -} #endif #ifdef __cplusplus @@ -706,8 +591,4 @@ #ifdef __cplusplus } -inline bool gprs_rlcmac_pdch::is_enabled() const -{ - return m_is_enabled; -} #endif diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index e0d756a..3cc86e2 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h index bb44903..4eda57d 100644 --- a/src/gprs_bssgp_pcu.h +++ b/src/gprs_bssgp_pcu.h @@ -42,8 +42,6 @@ #define NS_HDR_LEN 4 #define IE_LLC_PDU 14 -struct gprs_rlcmac_bts; - struct gprs_bssgp_pcu { struct gprs_nsvc *nsvc; struct bssgp_bvc_ctx *bctx; diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index e4e40b1..57756e3 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "pcu_utils.h" extern "C" { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e555466..676eddc 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index f56332e..ef145f2 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -40,6 +40,7 @@ #include #include #include +#include extern void *tall_pcu_ctx; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 2a354d8..b94b09c 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -46,6 +46,7 @@ #include #include #include +#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index d4162a9..a7ad070 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -32,6 +32,7 @@ #include #include #include +#include extern "C" { #include diff --git a/src/pdch.cpp b/src/pdch.cpp new file mode 100644 index 0000000..c2af304 --- /dev/null +++ b/src/pdch.cpp @@ -0,0 +1,960 @@ +/* + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { + #include + #include + #include + #include + #include + #include + #include +} + +#include +#include + +extern void *tall_pcu_ctx; + +static void get_meas(struct pcu_l1_meas *meas, const Packet_Resource_Request_t *qr) +{ + unsigned i; + + meas->set_ms_c_value(qr->C_VALUE); + if (qr->Exist_SIGN_VAR) + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_INFO, + "Packet resource request: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); + } + } +} + +static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) +{ + static const int16_t rx_qual_map[] = { + 0, /* 0,14 % */ + 0, /* 0,28 % */ + 1, /* 0,57 % */ + 1, /* 1,13 % */ + 2, /* 2,26 % */ + 5, /* 4,53 % */ + 9, /* 9,05 % */ + 18, /* 18,10 % */ + }; + + meas->set_ms_rx_qual(rx_qual_map[ + OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) + ]); +} + +static void get_meas(struct pcu_l1_meas *meas, const Channel_Quality_Report_t *qr) +{ + unsigned i; + + get_rx_qual_meas(meas, qr->RXQUAL); + meas->set_ms_c_value(qr->C_VALUE); + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_DEBUG, + "Channel quality report: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL_TN); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); + } + } +} + +void gprs_rlcmac_pdch::enable() +{ + /* TODO: Check if there are still allocated resources.. */ + INIT_LLIST_HEAD(&paging_list); + m_is_enabled = 1; +} + +void gprs_rlcmac_pdch::disable() +{ + /* TODO.. kick free_resources once we know the TRX/TS we are on */ + m_is_enabled = 0; +} + +void gprs_rlcmac_pdch::free_resources() +{ + struct gprs_rlcmac_paging *pag; + + /* we are not enabled. there should be no resources */ + if (!is_enabled()) + return; + + /* kick all TBF on slot */ + gprs_rlcmac_tbf::free_all(this); + + /* flush all pending paging messages */ + while ((pag = dequeue_paging())) + talloc_free(pag); + + trx->bts->sba()->free_resources(this); +} + +struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() +{ + struct gprs_rlcmac_paging *pag; + + if (llist_empty(&paging_list)) + return NULL; + pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); + llist_del(&pag->list); + + return pag; +} + +struct msgb *gprs_rlcmac_pdch::packet_paging_request() +{ + struct gprs_rlcmac_paging *pag; + struct msgb *msg; + unsigned wp = 0, len; + + /* no paging, no message */ + pag = dequeue_paging(); + if (!pag) + return NULL; + + LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); + + /* alloc message */ + msg = msgb_alloc(23, "pag ctrl block"); + if (!msg) { + talloc_free(pag); + return NULL; + } + bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); + if (!pag_vec) { + msgb_free(msg); + talloc_free(pag); + return NULL; + } + wp = Encoding::write_packet_paging_request(pag_vec); + + /* loop until message is full */ + while (pag) { + /* try to add paging */ + if ((pag->identity_lv[1] & 0x07) == 4) { + /* TMSI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", + ntohl(*((uint32_t *)(pag->identity_lv + 1)))); + len = 1 + 1 + 1 + 32 + 2 + 1; + if (pag->identity_lv[0] != 5) { + LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " + "MI != 5 octets!\n"); + goto continue_next; + } + } else { + /* MI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", + osmo_hexdump(pag->identity_lv + 1, + pag->identity_lv[0])); + len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; + if (pag->identity_lv[0] > 8) { + LOGP(DRLCMAC, LOGL_ERROR, "Paging with " + "MI > 8 octets!\n"); + goto continue_next; + } + } + if (wp + len > 184) { + LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " + "next time\n"); + /* put back paging record, because does not fit */ + llist_add_tail(&pag->list, &paging_list); + break; + } + Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], + pag->identity_lv + 1, pag->chan_needed); + +continue_next: + talloc_free(pag); + pag = dequeue_paging(); + } + + bitvec_pack(pag_vec, msgb_put(msg, 23)); + RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); + bitvec_free(pag_vec); + talloc_free(mac_control_block); + + return msg; +} + +bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) +{ + struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); + if (!pag) + return false; + + pag->chan_needed = chan_needed; + memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); + + llist_add(&pag->list, &paging_list); + + return true; +} + +void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) +{ + struct gprs_rlcmac_tbf *tbf, *new_tbf; + uint32_t tlli = packet->TLLI; + GprsMs *ms = bts()->ms_by_tlli(tlli); + gprs_rlcmac_ul_tbf *ul_tbf; + + tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", + fn, tlli, trx_no(), ts_no); + if (ms) + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown TBF corresponds to MS with IMSI %s, TA %d, " + "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", + ms->imsi(), ms->ta(), + ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, + ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", + ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, + ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); + TBF_POLL_SCHED_UNSET(tbf); + + /* check if this control ack belongs to packet uplink ack */ + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); + if (ul_tbf->ctrl_ack_to_toggle()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); + + tbf_free(tbf); + return; + } + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { + /* We now know that the PACCH really existed */ + LOGPTBF(new_tbf, LOGL_INFO, + "The TBF has been confirmed on the PACCH, " + "changed type from CCCH to PACCH\n"); + new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + } + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + /* stop pending assignment timer */ + new_tbf->t_stop(T0, "control acked (DL-TBF)"); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); + + tbf_assign_control_ts(new_tbf); + return; + } + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); + + tbf_assign_control_ts(new_tbf); + /* there might be LLC packets waiting in the queue, but the DL + * TBF might have been released while the UL TBF has been + * established */ + if (new_tbf->ms()->need_dl_tbf()) + new_tbf->establish_dl_tbf_on_pacch(); + + return; + } + LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " + "at no request\n"); +} + +void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled! TLLI=0x%08x\n", report->TLLI); + } else { + GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); + if (!ms) + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "but TLLI 0x%08x is unknown\n", report->TLLI); + else + ms->set_ta(sba->ta); + + bts()->sba()->free_sba(sba); + } + gprs_rlcmac_meas_rep(report); +} + +/* Received Uplink RLC control block. */ +int gprs_rlcmac_pdch::rcv_control_block( + const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) +{ + RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + + if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + else + bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + + bts()->rlc_rcvd_control(); + switch (ul_control_block->u.MESSAGE_TYPE) { + case MT_PACKET_CONTROL_ACK: + rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); + break; + case MT_PACKET_DOWNLINK_ACK_NACK: + rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); + break; + case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: + rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); + break; + case MT_PACKET_RESOURCE_REQUEST: + rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); + break; + case MT_PACKET_MEASUREMENT_REPORT: + rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); + break; + case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: + /* ignoring it. change the SI to not force sending these? */ + break; + default: + bts()->decode_error(); + LOGP(DRLCMAC, LOGL_NOTICE, + "RX: [PCU <- BTS] unknown control block(%d) received\n", + ul_control_block->u.MESSAGE_TYPE); + } + talloc_free(ul_control_block); + return 1; +} + +/* received RLC/MAC block from L1 */ +int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas) +{ + GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); + if (!cs) { + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" + "length: %d)\n", len); + return -EINVAL; + } + + bts()->rlc_ul_bytes(len); + + LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " + "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); + + if (cs.isGprs()) + return rcv_block_gprs(data, len, fn, meas, cs); + + if (cs.isEgprs()) + return rcv_data_block(data, len, fn, meas, cs); + + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", + cs.name()); + return -EINVAL; +} + +/*! \brief process egprs and gprs data blocks */ +int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + int rc; + struct gprs_rlc_data_info rlc_dec; + struct gprs_rlcmac_ul_tbf *tbf; + unsigned len = cs.sizeUL(); + + /* These are always data blocks, since EGPRS still uses CS-1 for + * control blocks (see 44.060, section 10.3, 1st par.) + */ + if (cs.isEgprs()) { + if (!bts()->bts_data()->egprs_enabled) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but EGPRS is not enabled\n", + cs.name()); + return -EINVAL; + } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } + + LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); + + rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); + if (rc < 0) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but header parsing has failed\n", + cs.name()); + bts()->decode_error(); + return rc; + } + + LOGP(DRLCMACUL, LOGL_INFO, + "Got %s RLC block: " + "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " + "rc=%d\n", + cs.name(), + rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, + rc); + + /* find TBF inst from given TFI */ + tbf = ul_tbf_by_tfi(rlc_dec.tfi); + if (!tbf) { + LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", + rlc_dec.tfi); + return 0; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); +} + +int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + unsigned payload = data[0] >> 6; + bitvec *block; + int rc = 0; + unsigned len = cs.maxBytesUL(); + + switch (payload) { + case GPRS_RLCMAC_DATA_BLOCK: + rc = rcv_data_block(data, data_len, fn, meas, cs); + break; + case GPRS_RLCMAC_CONTROL_BLOCK: + block = bitvec_alloc(len, tall_pcu_ctx); + if (!block) + return -ENOMEM; + bitvec_unpack(block, data); + rc = rcv_control_block(data, data_len, block, fn); + bitvec_free(block); + break; + case GPRS_RLCMAC_CONTROL_BLOCK_OPT: + LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); + break; + default: + LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); + rc = -EINVAL; + } + + return rc; +} + +void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + if (request->ID.UnionType) { + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + uint32_t tlli = request->ID.u.TLLI; + uint8_t ms_class = 0; + uint8_t egprs_ms_class = 0; + uint8_t ta = GSM48_TA_INVALID; + struct pcu_l1_meas meas; + + GprsMs *ms = bts()->ms_by_tlli(tlli); + /* Keep the ms, even if it gets idle temporarily */ + GprsMs::Guard guard(ms); + + if (ms) { + ul_tbf = ms->ul_tbf(); + dl_tbf = ms->dl_tbf(); + ta = ms->ta(); + } + + /* We got a RACH so the MS was in packet idle mode and thus + * didn't have any active TBFs */ + if (ul_tbf) { + LOGPTBFUL(ul_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", + tlli); + tbf_free(ul_tbf); + ul_tbf = NULL; + } + + if (dl_tbf) { + LOGPTBFUL(dl_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", + tlli); + tbf_free(dl_tbf); + dl_tbf = NULL; + } + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " + "in packet resource request of single " + "block, so we provide one:\n"); + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled!\n"); + } else { + ta = sba->ta; + bts()->sba()->free_sba(sba); + } + if (request->Exist_MS_Radio_Access_capability) { + ms_class = Decoding::get_ms_class_by_capability( + &request->MS_Radio_Access_capability); + egprs_ms_class = + Decoding::get_egprs_ms_class_by_capability( + &request->MS_Radio_Access_capability); + } + if (!ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); + if (egprs_ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, + "MS supports EGPRS multislot class %d.\n", + egprs_ms_class); + ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, + egprs_ms_class, tlli, ta, ms); + + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); + return; + } + + /* set control ts to current MS's TS, until assignment complete */ + LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", + ul_tbf->control_ts, ts_no); + + ul_tbf->control_ts = ts_no; + /* schedule uplink assignment */ + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + + /* get capabilities */ + if (ul_tbf->ms()) + ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); + + /* get measurements */ + if (ul_tbf->ms()) { + get_meas(&meas, request); + ul_tbf->ms()->update_l1_meas(&meas); + } + return; + } + + if (request->ID.u.Global_TFI.UnionType) { + struct gprs_rlcmac_dl_tbf *dl_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; + dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!dl_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); + return; + } + LOGPTBFDL(dl_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + dl_tbf->m_n3101 = 0; + } else { + struct gprs_rlcmac_ul_tbf *ul_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; + ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!ul_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); + return; + } + LOGPTBFUL(ul_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + ul_tbf->m_n3101 = 0; + } +} + +static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) +{ + bts->channel_request_description(); + + /* This call will register the new TBF with the MS on success */ + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), + tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + + /* schedule uplink assignment or reject */ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); + } +} + +void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) +{ + int8_t tfi = 0; /* must be signed */ + struct gprs_rlcmac_dl_tbf *tbf; + struct pcu_l1_meas meas; + int rc; + int num_blocks; + uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; + char show_bits[RLC_EGPRS_MAX_WS + 1]; + bitvec bits; + int bsn_begin, bsn_end; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, + "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); + + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " + "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " + "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", + (int)ack_nack->EGPRS_AckNack.UnionType, + (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, + (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, + (void *)&ack_nack->EGPRS_AckNack.UnionType, + (void *)&ack_nack->EGPRS_AckNack.Desc, + (int)offsetof(EGPRS_AckNack_t, Desc), + (int)offsetof(EGPRS_AckNack_w_len_t, Desc), + tbf->window()->v_a(), + tbf->window()->v_s(), + osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, + sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_egprs_acknack_bits( + &ack_nack->EGPRS_AckNack.Desc, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits) + ); + + rc = tbf->rcvd_dl_ack( + ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + + /* check for channel request */ + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + /* TODO: Implement Measurements parsing for EGPRS */ + /* + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + */ + } +} + +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + gprs_rlcmac_tbf *tbf; + LListHead *pos; + + llist_for_each(pos, tbf_list) { + tbf = pos->entry(); + if (tbf->tfi() != tfi) + continue; + if (!tbf->pdch[ts_no]) + continue; + return tbf; + } + return NULL; +} + +gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) +{ + return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); +} + +gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) +{ + return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); +} + +/* lookup TBF Entity (by TFI) */ +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + struct gprs_rlcmac_tbf *tbf; + + if (tfi >= 32) + return NULL; + + tbf = m_tbfs[dir][tfi]; + + if (!tbf) + return NULL; + + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { + return tbf; + } + + return NULL; +} + +void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + if (m_tbfs[tbf->direction][tbf->tfi()]) + LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " + "%s has not been detached, overwriting it\n", + ts_no, trx_no(), + m_tbfs[tbf->direction][tbf->tfi()]->name()); + + m_num_tbfs[tbf->direction] += 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; + } + m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); + m_tbfs[tbf->direction][tbf->tfi()] = tbf; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); + + m_num_tbfs[tbf->direction] -= 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); + } + m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); + m_tbfs[tbf->direction][tbf->tfi()] = NULL; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) +{ + m_num_reserved[dir] += 1; +} + +void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) +{ + OSMO_ASSERT(m_num_reserved[dir] > 0); + m_num_reserved[dir] -= 1; +} + +inline BTS *gprs_rlcmac_pdch::bts() const +{ + return trx->bts; +} + +uint8_t gprs_rlcmac_pdch::trx_no() const +{ + return trx->trx_no; +} + +inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const +{ + return trx->bts->bts_data(); +} + +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 */ + struct gprs_rlcmac_dl_tbf *tbf; + int rc; + struct pcu_l1_meas meas; + int num_blocks; + uint8_t bits_data[RLC_GPRS_WS/8]; + bitvec bits; + int bsn_begin, bsn_end; + char show_bits[RLC_GPRS_WS + 1]; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_gprs_acknack_bits( + &ack_nack->Ack_Nack_Description, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits)); + + rc = tbf->rcvd_dl_ack( + ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + /* check for channel request */ + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + } +} diff --git a/src/pdch.h b/src/pdch.h new file mode 100644 index 0000000..82f0337 --- /dev/null +++ b/src/pdch.h @@ -0,0 +1,146 @@ +/* pdch.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#include +} +#endif + +#include +#include +#include +#include + +#include + +/* + * PDCH instance + */ +struct gprs_rlcmac_pdch { +#ifdef __cplusplus + struct gprs_rlcmac_paging *dequeue_paging(); + struct msgb *packet_paging_request(); + + bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); + + void free_resources(); + + bool is_enabled() const; + + void enable(); + void disable(); + + /* dispatching of messages */ + int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas); + int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + + gprs_rlcmac_bts *bts_data() const; + BTS *bts() const; + uint8_t trx_no() const; + + struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); + + void attach_tbf(gprs_rlcmac_tbf *tbf); + void detach_tbf(gprs_rlcmac_tbf *tbf); + + unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; + + void reserve(enum gprs_rlcmac_tbf_direction dir); + void unreserve(enum gprs_rlcmac_tbf_direction dir); + unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; + + uint8_t assigned_usf() const; + uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; +#endif + + uint8_t m_is_enabled; /* TS is enabled */ + uint8_t tsc; /* TSC of this slot */ + uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ + uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ + uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ + struct llist_head paging_list; /* list of paging messages */ + uint32_t last_rts_fn; /* store last frame number of RTS */ + + /* back pointers */ + struct gprs_rlcmac_trx *trx; + uint8_t ts_no; + +#ifdef __cplusplus +private: + int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); + + void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); + void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); + void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); + void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); + void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); + gprs_rlcmac_tbf *tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); + gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); +#endif + + uint8_t m_num_tbfs[2]; + uint8_t m_num_reserved[2]; + uint8_t m_assigned_usf; /* bit set */ + uint32_t m_assigned_tfi[2]; /* bit set */ + struct gprs_rlcmac_tbf *m_tbfs[2][32]; +}; + +#ifdef __cplusplus + +inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const +{ + return m_num_tbfs[dir]; +} + +inline unsigned gprs_rlcmac_pdch::num_reserved( + enum gprs_rlcmac_tbf_direction dir) const +{ + return gprs_rlcmac_pdch::m_num_reserved[dir]; +} + +inline uint8_t gprs_rlcmac_pdch::assigned_usf() const +{ + return m_assigned_usf; +} + +inline uint32_t gprs_rlcmac_pdch::assigned_tfi( + enum gprs_rlcmac_tbf_direction dir) const +{ + return m_assigned_tfi[dir]; +} + +inline bool gprs_rlcmac_pdch::is_enabled() const +{ + return m_is_enabled; +} + +#endif /* __cplusplus */ diff --git a/src/sba.cpp b/src/sba.cpp index 5dfdddb..567babe 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -23,6 +23,7 @@ #include #include #include +#include extern "C" { #include diff --git a/src/tbf.cpp b/src/tbf.cpp index 74f2cd8..72b39ec 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -32,6 +32,7 @@ #include #include #include +#include extern "C" { #include -- To view, visit https://gerrit.osmocom.org/6053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 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 Jan 30 11:51:40 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 11:51:40 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 1: Added pcap + description in https://osmocom.org/issues/2422#note-7 -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 12:02:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 12:02:03 +0000 Subject: osmo-msc[master]: Make sending an SMS to an unknown subscriber B work over SMPP. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Solves the issue in osmo-gsm-tester together with https://gerrit.osmocom.org/#/c/6194/ -- To view, visit https://gerrit.osmocom.org/6192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 12:55:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 12:55:52 +0000 Subject: [PATCH] osmo-pcu[master]: Move paging generation into PDCH In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6193 to look at the new patch set (#2). Move paging generation into PDCH Previously paging was prepared inside BTS function and than handed over to PDCH function. Move the actual preparation into PDCH to better decouple PDCH from BTS. Related: OS#1539 Change-Id: I389fb16b6e54040770c21f88edbcb8e045636928 --- M src/bts.cpp M src/bts.h 2 files changed, 14 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/93/6193/2 diff --git a/src/bts.cpp b/src/bts.cpp index 1669739..1d5b29f 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -303,7 +303,6 @@ uint8_t l, trx, ts, any_tbf = 0; struct gprs_rlcmac_tbf *tbf; LListHead *pos; - struct gprs_rlcmac_paging *pag; uint8_t slot_mask[8]; int8_t first_ts; /* must be signed */ @@ -359,16 +358,10 @@ for (ts = 0; ts < 8; ts++) { if ((slot_mask[trx] & (1 << ts))) { /* schedule */ - pag = talloc_zero(tall_pcu_ctx, - struct gprs_rlcmac_paging); - if (!pag) + if (!m_bts.trx[trx].pdch[ts].add_paging(chan_needed, identity_lv)) return -ENOMEM; - pag->chan_needed = chan_needed; - memcpy(pag->identity_lv, identity_lv, - identity_lv[0] + 1); - m_bts.trx[trx].pdch[ts].add_paging(pag); - LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of " - "TRX=%d TS=%d\n", trx, ts); + + LOGP(DRLCMAC, LOGL_INFO, "Paging on PACCH of TRX=%d TS=%d\n", trx, ts); any_tbf = 1; } } @@ -971,9 +964,18 @@ return msg; } -void gprs_rlcmac_pdch::add_paging(struct gprs_rlcmac_paging *pag) +bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) { + struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); + if (!pag) + return false; + + pag->chan_needed = chan_needed; + memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); + llist_add(&pag->list, &paging_list); + + return true; } void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) diff --git a/src/bts.h b/src/bts.h index 5679b98..173e6e8 100644 --- a/src/bts.h +++ b/src/bts.h @@ -73,7 +73,7 @@ struct gprs_rlcmac_paging *dequeue_paging(); struct msgb *packet_paging_request(); - void add_paging(struct gprs_rlcmac_paging *pag); + bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); void free_resources(); -- To view, visit https://gerrit.osmocom.org/6193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I389fb16b6e54040770c21f88edbcb8e045636928 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 Tue Jan 30 12:55:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 12:55:52 +0000 Subject: [PATCH] osmo-pcu[master]: Update header includes In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6100 to look at the new patch set (#4). Update header includes Many files include unnecessary headers and don't include headers which are actually used. Because of that combined with the fact that OsmoPCU is a mixture of C and C++, it makes it hard to modularize code. Fix this (using iwyu [1] tool): * add missing headers * remove unused headers [1] https://include-what-you-use.org/ Related: OS#1539 Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 --- M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_bssgp_pcu.h M src/gprs_ms.cpp M src/gprs_ms.h M src/gprs_ms_storage.cpp M src/gprs_rlcmac.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/llc.h M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_main.cpp M src/pcu_vty_functions.cpp M src/poll_controller.cpp M src/poll_controller.h M src/rlc.cpp M src/sba.cpp M src/sba.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp M tests/edge/EdgeTest.cpp M tests/tbf/TbfTest.cpp 26 files changed, 118 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/00/6100/4 diff --git a/src/bts.cpp b/src/bts.cpp index 1d5b29f..24be5d4 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -25,9 +25,10 @@ #include #include #include - +#include #include #include +#include extern "C" { #include @@ -37,9 +38,11 @@ #include #include #include + #include + #include + #include + #include } - -#include #include #include diff --git a/src/bts.h b/src/bts.h index 173e6e8..c3bee12 100644 --- a/src/bts.h +++ b/src/bts.h @@ -26,17 +26,17 @@ #include #include #include -#include -#include #include #include } +#include #include "poll_controller.h" #include "sba.h" #include "tbf.h" #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" +#include #endif #include diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index a86e09d..e0d756a 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -21,8 +21,10 @@ #include #include #include +#include #include #include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_bssgp_pcu.h b/src/gprs_bssgp_pcu.h index bb44903..4eda57d 100644 --- a/src/gprs_bssgp_pcu.h +++ b/src/gprs_bssgp_pcu.h @@ -42,8 +42,6 @@ #define NS_HDR_LEN 4 #define IE_LLC_PDU 14 -struct gprs_rlcmac_bts; - struct gprs_bssgp_pcu { struct gprs_nsvc *nsvc; struct bssgp_bvc_ctx *bctx; diff --git a/src/gprs_ms.cpp b/src/gprs_ms.cpp index 33d9cad..740ef6b 100644 --- a/src/gprs_ms.cpp +++ b/src/gprs_ms.cpp @@ -20,7 +20,7 @@ #include "gprs_ms.h" - +#include #include "bts.h" #include "tbf.h" #include "gprs_debug.h" @@ -33,6 +33,7 @@ #include #include #include + #include } #define GPRS_CODEL_SLOW_INTERVAL_MS 4000 diff --git a/src/gprs_ms.h b/src/gprs_ms.h index f094e96..857f0c9 100644 --- a/src/gprs_ms.h +++ b/src/gprs_ms.h @@ -22,13 +22,16 @@ struct gprs_codel; +#include #include "cxx_linuxlist.h" #include "llc.h" #include "tbf.h" #include "pcu_l1_if.h" +#include extern "C" { #include + #include } #include diff --git a/src/gprs_ms_storage.cpp b/src/gprs_ms_storage.cpp index 6a7f336..c7de6d3 100644 --- a/src/gprs_ms_storage.cpp +++ b/src/gprs_ms_storage.cpp @@ -23,7 +23,10 @@ #include "tbf.h" #include "bts.h" -#include "gprs_debug.h" + +extern "C" { + #include +} #define GPRS_UNDEFINED_IMSI "000" diff --git a/src/gprs_rlcmac.cpp b/src/gprs_rlcmac.cpp index 06c5479..da5c541 100644 --- a/src/gprs_rlcmac.cpp +++ b/src/gprs_rlcmac.cpp @@ -24,7 +24,7 @@ #include #include #include - +#include extern void *tall_pcu_ctx; diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index ebf4714..e4e40b1 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -22,9 +22,16 @@ #include #include #include - +#include +#include +#include +#include #include "pcu_utils.h" +extern "C" { + #include +} + static uint32_t sched_poll(BTS *bts, uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr, struct gprs_rlcmac_tbf **poll_tbf, diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e394a6e..e555466 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -31,6 +31,9 @@ extern "C" { #include "mslot_class.h" +#include +#include +#include } /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ diff --git a/src/llc.h b/src/llc.h index 9d402c3..2e7229c 100644 --- a/src/llc.h +++ b/src/llc.h @@ -29,7 +29,6 @@ #define LLC_MAX_LEN 1543 struct BTS; -struct msgb; /** * I represent the LLC data to a MS diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 577d41e..f56332e 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -29,9 +29,11 @@ #include #include #include +#include +#include +#include } -#include #include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 7112b04..2a354d8 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -26,12 +26,18 @@ #include #include #include + extern "C" { #include #include #include #include #include +#include +#include +#include +#include +#include } #include @@ -40,7 +46,6 @@ #include #include #include -#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index b7574f9..0c3a414 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -17,22 +17,34 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include #include #include +#include +#include extern "C" { #include "pcu_vty.h" +#include +#include #include -#include +#include +#include #include +#include +#include +#include +#include #include #include #include diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index eb15aa6..d4162a9 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -27,11 +27,19 @@ #include "gprs_ms_storage.h" #include "gprs_ms.h" #include "cxx_linuxlist.h" +#include +#include +#include +#include +#include extern "C" { #include #include #include + #include + #include + #include } int pcu_vty_config_write_pcu_ext(struct vty *vty) diff --git a/src/poll_controller.cpp b/src/poll_controller.cpp index 5c5a717..744b612 100644 --- a/src/poll_controller.cpp +++ b/src/poll_controller.cpp @@ -23,6 +23,13 @@ #include #include #include +#include +#include + +extern "C" { +#include +#include +} PollController::PollController(BTS& bts) : m_bts(bts) diff --git a/src/poll_controller.h b/src/poll_controller.h index b9ae80e..65d1fee 100644 --- a/src/poll_controller.h +++ b/src/poll_controller.h @@ -21,8 +21,6 @@ #pragma once -struct gprs_rlcmac_bts; - struct BTS; /** diff --git a/src/rlc.cpp b/src/rlc.cpp index d7f0609..a82f550 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -18,11 +18,17 @@ #include "bts.h" #include "gprs_debug.h" +#include +#include -#include +#include +#include +#include extern "C" { #include +#include +#include } diff --git a/src/sba.cpp b/src/sba.cpp index 56a7543..5dfdddb 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -20,14 +20,15 @@ */ #include -#include #include #include #include extern "C" { +#include #include #include +#include } #include diff --git a/src/sba.h b/src/sba.h index d2d3106..27dae21 100644 --- a/src/sba.h +++ b/src/sba.h @@ -27,7 +27,6 @@ } struct BTS; -class PollController; struct gprs_rlcmac_pdch; /* diff --git a/src/tbf.cpp b/src/tbf.cpp index 8cfca3a..74f2cd8 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -25,10 +25,13 @@ #include #include #include -#include #include -#include #include +#include +#include +#include +#include +#include extern "C" { #include @@ -36,6 +39,9 @@ #include #include #include + #include + #include + #include } #include diff --git a/src/tbf.h b/src/tbf.h index 803ea33..fbef20e 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -20,20 +20,23 @@ #ifdef __cplusplus -#include "gprs_rlcmac.h" #include "llc.h" #include "rlc.h" #include "cxx_linuxlist.h" #include - +#include +#include #include extern "C" { #include + #include + #include + #include } struct bssgp_bvc_ctx; -struct pcu_l1_meas; class GprsMs; +struct gprs_rlcmac_bts; /* * TBF instance diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index e8aec23..ae487c2 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -28,18 +28,28 @@ #include #include #include - +#include +#include +#include +#include #include "pcu_utils.h" extern "C" { #include #include #include + #include + #include + #include + #include + #include + #include + #include + #include } #include #include -#include /* After sending these frames, we poll for ack/nack. */ #define POLL_ACK_AFTER_FRAMES 20 diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1560eb0..6960ea9 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -28,12 +28,21 @@ #include #include #include - +#include +#include +#include #include "pcu_utils.h" extern "C" { #include #include + #include + #include + #include + #include + #include + #include + #include } #include diff --git a/tests/edge/EdgeTest.cpp b/tests/edge/EdgeTest.cpp index 1abdcfd..eb9ef42 100644 --- a/tests/edge/EdgeTest.cpp +++ b/tests/edge/EdgeTest.cpp @@ -27,6 +27,8 @@ #include "rlc.h" #include "llc.h" #include "bts.h" +#include + extern "C" { #include "pcu_vty.h" diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index fbed45a..0a6be87 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -27,6 +27,7 @@ #include "gprs_bssgp_pcu.h" #include "pcu_l1_if.h" #include "decoding.h" +#include extern "C" { #include "pcu_vty.h" -- To view, visit https://gerrit.osmocom.org/6100 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I8c9f488a43b099c72b2d30d3245e7ba50872fc00 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Tue Jan 30 12:55:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 12:55:52 +0000 Subject: [PATCH] osmo-pcu[master]: Move PDCH-related functions into 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/6053 to look at the new patch set (#4). Move PDCH-related functions into separate file The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539 --- M src/Makefile.am M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/osmo-bts-sysmo/sysmo_l1_if.c M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_vty.c M src/pcu_vty_functions.cpp A src/pdch.cpp A src/pdch.h M src/sba.cpp M src/tbf.cpp 15 files changed, 1,121 insertions(+), 1,020 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/6053/4 diff --git a/src/Makefile.am b/src/Makefile.am index 7d2a62e..b2f64f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,6 +54,7 @@ tbf_ul.cpp \ tbf_dl.cpp \ bts.cpp \ + pdch.cpp \ poll_controller.cpp \ encoding.cpp \ sba.cpp \ @@ -85,6 +86,7 @@ mslot_class.h \ tbf.h \ bts.h \ + pdch.h \ poll_controller.h \ encoding.h \ sba.h \ diff --git a/src/bts.cpp b/src/bts.cpp index 24be5d4..096d3af 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -29,6 +29,7 @@ #include #include #include +#include extern "C" { #include @@ -841,801 +842,6 @@ return ms; } -/* - * PDCH code below. TODO: move to a separate file - */ - -void gprs_rlcmac_pdch::enable() -{ - /* TODO: Check if there are still allocated resources.. */ - INIT_LLIST_HEAD(&paging_list); - m_is_enabled = 1; -} - -void gprs_rlcmac_pdch::disable() -{ - /* TODO.. kick free_resources once we know the TRX/TS we are on */ - m_is_enabled = 0; -} - -void gprs_rlcmac_pdch::free_resources() -{ - struct gprs_rlcmac_paging *pag; - - /* we are not enabled. there should be no resources */ - if (!is_enabled()) - return; - - /* kick all TBF on slot */ - gprs_rlcmac_tbf::free_all(this); - - /* flush all pending paging messages */ - while ((pag = dequeue_paging())) - talloc_free(pag); - - trx->bts->sba()->free_resources(this); -} - -struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() -{ - struct gprs_rlcmac_paging *pag; - - if (llist_empty(&paging_list)) - return NULL; - pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); - llist_del(&pag->list); - - return pag; -} - -struct msgb *gprs_rlcmac_pdch::packet_paging_request() -{ - struct gprs_rlcmac_paging *pag; - struct msgb *msg; - unsigned wp = 0, len; - - /* no paging, no message */ - pag = dequeue_paging(); - if (!pag) - return NULL; - - LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); - - /* alloc message */ - msg = msgb_alloc(23, "pag ctrl block"); - if (!msg) { - talloc_free(pag); - return NULL; - } - bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); - if (!pag_vec) { - msgb_free(msg); - talloc_free(pag); - return NULL; - } - wp = Encoding::write_packet_paging_request(pag_vec); - - /* loop until message is full */ - while (pag) { - /* try to add paging */ - if ((pag->identity_lv[1] & 0x07) == 4) { - /* TMSI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", - ntohl(*((uint32_t *)(pag->identity_lv + 1)))); - len = 1 + 1 + 1 + 32 + 2 + 1; - if (pag->identity_lv[0] != 5) { - LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " - "MI != 5 octets!\n"); - goto continue_next; - } - } else { - /* MI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", - osmo_hexdump(pag->identity_lv + 1, - pag->identity_lv[0])); - len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; - if (pag->identity_lv[0] > 8) { - LOGP(DRLCMAC, LOGL_ERROR, "Paging with " - "MI > 8 octets!\n"); - goto continue_next; - } - } - if (wp + len > 184) { - LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " - "next time\n"); - /* put back paging record, because does not fit */ - llist_add_tail(&pag->list, &paging_list); - break; - } - Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], - pag->identity_lv + 1, pag->chan_needed); - -continue_next: - talloc_free(pag); - pag = dequeue_paging(); - } - - bitvec_pack(pag_vec, msgb_put(msg, 23)); - RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); - bitvec_free(pag_vec); - talloc_free(mac_control_block); - - return msg; -} - -bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) -{ - struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); - if (!pag) - return false; - - pag->chan_needed = chan_needed; - memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); - - llist_add(&pag->list, &paging_list); - - return true; -} - -void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) -{ - struct gprs_rlcmac_tbf *tbf, *new_tbf; - uint32_t tlli = packet->TLLI; - GprsMs *ms = bts()->ms_by_tlli(tlli); - gprs_rlcmac_ul_tbf *ul_tbf; - - tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", - fn, tlli, trx_no(), ts_no); - if (ms) - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown TBF corresponds to MS with IMSI %s, TA %d, " - "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", - ms->imsi(), ms->ta(), - ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, - ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", - ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, - ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - TBF_POLL_SCHED_UNSET(tbf); - - /* check if this control ack belongs to packet uplink ack */ - ul_tbf = as_ul_tbf(tbf); - if (ul_tbf && ul_tbf->handle_ctrl_ack()) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); - if (ul_tbf->ctrl_ack_to_toggle()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); - - tbf_free(tbf); - return; - } - if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { - /* We now know that the PACCH really existed */ - LOGPTBF(new_tbf, LOGL_INFO, - "The TBF has been confirmed on the PACCH, " - "changed type from CCCH to PACCH\n"); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - } - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - /* stop pending assignment timer */ - new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - - tbf_assign_control_ts(new_tbf); - return; - } - if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - - tbf_assign_control_ts(new_tbf); - /* there might be LLC packets waiting in the queue, but the DL - * TBF might have been released while the UL TBF has been - * established */ - if (new_tbf->ms()->need_dl_tbf()) - new_tbf->establish_dl_tbf_on_pacch(); - - return; - } - LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " - "at no request\n"); -} - -static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) -{ - static const int16_t rx_qual_map[] = { - 0, /* 0,14 % */ - 0, /* 0,28 % */ - 1, /* 0,57 % */ - 1, /* 1,13 % */ - 2, /* 2,26 % */ - 5, /* 4,53 % */ - 9, /* 9,05 % */ - 18, /* 18,10 % */ - }; - - meas->set_ms_rx_qual(rx_qual_map[ - OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) - ]); -} - -static void get_meas(struct pcu_l1_meas *meas, - const Packet_Resource_Request_t *qr) -{ - unsigned i; - - meas->set_ms_c_value(qr->C_VALUE); - if (qr->Exist_SIGN_VAR) - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_INFO, - "Packet resource request: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); - } - } -} - -static void get_meas(struct pcu_l1_meas *meas, - const Channel_Quality_Report_t *qr) -{ - unsigned i; - - get_rx_qual_meas(meas, qr->RXQUAL); - meas->set_ms_c_value(qr->C_VALUE); - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_DEBUG, - "Channel quality report: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL_TN); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); - } - } -} - -static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) -{ - bts->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), - tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject */ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); - } -} - -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 */ - struct gprs_rlcmac_dl_tbf *tbf; - int rc; - struct pcu_l1_meas meas; - int num_blocks; - uint8_t bits_data[RLC_GPRS_WS/8]; - bitvec bits; - int bsn_begin, bsn_end; - char show_bits[RLC_GPRS_WS + 1]; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_gprs_acknack_bits( - &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits)); - - rc = tbf->rcvd_dl_ack( - ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - } -} - -void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) -{ - int8_t tfi = 0; /* must be signed */ - struct gprs_rlcmac_dl_tbf *tbf; - struct pcu_l1_meas meas; - int rc; - int num_blocks; - uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; - char show_bits[RLC_EGPRS_MAX_WS + 1]; - bitvec bits; - int bsn_begin, bsn_end; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, - "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); - - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " - "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " - "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", - (int)ack_nack->EGPRS_AckNack.UnionType, - (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, - (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, - (void *)&ack_nack->EGPRS_AckNack.UnionType, - (void *)&ack_nack->EGPRS_AckNack.Desc, - (int)offsetof(EGPRS_AckNack_t, Desc), - (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->window()->v_a(), - tbf->window()->v_s(), - osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, - sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_egprs_acknack_bits( - &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits) - ); - - rc = tbf->rcvd_dl_ack( - ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - - /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - /* TODO: Implement Measurements parsing for EGPRS */ - /* - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - */ - } -} - -void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - if (request->ID.UnionType) { - struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; - uint32_t tlli = request->ID.u.TLLI; - uint8_t ms_class = 0; - uint8_t egprs_ms_class = 0; - uint8_t ta = GSM48_TA_INVALID; - struct pcu_l1_meas meas; - - GprsMs *ms = bts()->ms_by_tlli(tlli); - /* Keep the ms, even if it gets idle temporarily */ - GprsMs::Guard guard(ms); - - if (ms) { - ul_tbf = ms->ul_tbf(); - dl_tbf = ms->dl_tbf(); - ta = ms->ta(); - } - - /* We got a RACH so the MS was in packet idle mode and thus - * didn't have any active TBFs */ - if (ul_tbf) { - LOGPTBFUL(ul_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", - tlli); - tbf_free(ul_tbf); - ul_tbf = NULL; - } - - if (dl_tbf) { - LOGPTBFUL(dl_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", - tlli); - tbf_free(dl_tbf); - dl_tbf = NULL; - } - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " - "in packet resource request of single " - "block, so we provide one:\n"); - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled!\n"); - } else { - ta = sba->ta; - bts()->sba()->free_sba(sba); - } - if (request->Exist_MS_Radio_Access_capability) { - ms_class = Decoding::get_ms_class_by_capability( - &request->MS_Radio_Access_capability); - egprs_ms_class = - Decoding::get_egprs_ms_class_by_capability( - &request->MS_Radio_Access_capability); - } - if (!ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); - if (egprs_ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, - "MS supports EGPRS multislot class %d.\n", - egprs_ms_class); - ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, - egprs_ms_class, tlli, ta, ms); - - if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); - return; - } - - /* set control ts to current MS's TS, until assignment complete */ - LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", - ul_tbf->control_ts, ts_no); - - ul_tbf->control_ts = ts_no; - /* schedule uplink assignment */ - TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - - /* get capabilities */ - if (ul_tbf->ms()) - ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); - - /* get measurements */ - if (ul_tbf->ms()) { - get_meas(&meas, request); - ul_tbf->ms()->update_l1_meas(&meas); - } - return; - } - - if (request->ID.u.Global_TFI.UnionType) { - struct gprs_rlcmac_dl_tbf *dl_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; - dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!dl_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); - return; - } - LOGPTBFDL(dl_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - dl_tbf->m_n3101 = 0; - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; - ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!ul_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); - return; - } - LOGPTBFUL(ul_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - ul_tbf->m_n3101 = 0; - } -} - -void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled! TLLI=0x%08x\n", report->TLLI); - } else { - GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); - if (!ms) - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "but TLLI 0x%08x is unknown\n", report->TLLI); - else - ms->set_ta(sba->ta); - - bts()->sba()->free_sba(sba); - } - gprs_rlcmac_meas_rep(report); -} - -/* Received Uplink RLC control block. */ -int gprs_rlcmac_pdch::rcv_control_block( - const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) -{ - RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); - - if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - else - bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - - bts()->rlc_rcvd_control(); - switch (ul_control_block->u.MESSAGE_TYPE) { - case MT_PACKET_CONTROL_ACK: - rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); - break; - case MT_PACKET_DOWNLINK_ACK_NACK: - rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); - break; - case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: - rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); - break; - case MT_PACKET_RESOURCE_REQUEST: - rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); - break; - case MT_PACKET_MEASUREMENT_REPORT: - rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); - break; - case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: - /* ignoring it. change the SI to not force sending these? */ - break; - default: - bts()->decode_error(); - LOGP(DRLCMAC, LOGL_NOTICE, - "RX: [PCU <- BTS] unknown control block(%d) received\n", - ul_control_block->u.MESSAGE_TYPE); - } - talloc_free(ul_control_block); - return 1; -} - - -/* received RLC/MAC block from L1 */ -int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas) -{ - GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); - if (!cs) { - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" - "length: %d)\n", len); - return -EINVAL; - } - - bts()->rlc_ul_bytes(len); - - LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " - "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); - - if (cs.isGprs()) - return rcv_block_gprs(data, len, fn, meas, cs); - - if (cs.isEgprs()) - return rcv_data_block(data, len, fn, meas, cs); - - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", - cs.name()); - return -EINVAL; -} - -/*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - int rc; - struct gprs_rlc_data_info rlc_dec; - struct gprs_rlcmac_ul_tbf *tbf; - unsigned len = cs.sizeUL(); - - /* These are always data blocks, since EGPRS still uses CS-1 for - * control blocks (see 44.060, section 10.3, 1st par.) - */ - if (cs.isEgprs()) { - if (!bts()->bts_data()->egprs_enabled) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not enabled\n", - cs.name()); - return -EINVAL; - } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } else { - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } - - LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); - - rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); - if (rc < 0) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but header parsing has failed\n", - cs.name()); - bts()->decode_error(); - return rc; - } - - LOGP(DRLCMACUL, LOGL_INFO, - "Got %s RLC block: " - "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " - "rc=%d\n", - cs.name(), - rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, - rc); - - /* find TBF inst from given TFI */ - tbf = ul_tbf_by_tfi(rlc_dec.tfi); - if (!tbf) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", - rlc_dec.tfi); - return 0; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); -} - -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - unsigned payload = data[0] >> 6; - bitvec *block; - int rc = 0; - unsigned len = cs.maxBytesUL(); - - switch (payload) { - case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, data_len, fn, meas, cs); - break; - case GPRS_RLCMAC_CONTROL_BLOCK: - block = bitvec_alloc(len, tall_pcu_ctx); - if (!block) - return -ENOMEM; - bitvec_unpack(block, data); - rc = rcv_control_block(data, data_len, block, fn); - bitvec_free(block); - break; - case GPRS_RLCMAC_CONTROL_BLOCK_OPT: - LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); - break; - default: - LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); - rc = -EINVAL; - } - - return rc; -} - /* update TA based on TA provided by PH-DATA-IND */ void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta) { @@ -1693,110 +899,6 @@ update_tbf_ta(tbf, ta); } -} - -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - gprs_rlcmac_tbf *tbf; - LListHead *pos; - - llist_for_each(pos, tbf_list) { - tbf = pos->entry(); - if (tbf->tfi() != tfi) - continue; - if (!tbf->pdch[ts_no]) - continue; - return tbf; - } - return NULL; -} - -gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) -{ - return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); -} - -gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) -{ - return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); -} - -/* lookup TBF Entity (by TFI) */ -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - struct gprs_rlcmac_tbf *tbf; - - if (tfi >= 32) - return NULL; - - tbf = m_tbfs[dir][tfi]; - - if (!tbf) - return NULL; - - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { - return tbf; - } - - return NULL; -} - -void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - if (m_tbfs[tbf->direction][tbf->tfi()]) - LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " - "%s has not been detached, overwriting it\n", - ts_no, trx_no(), - m_tbfs[tbf->direction][tbf->tfi()]->name()); - - m_num_tbfs[tbf->direction] += 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; - } - m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); - m_tbfs[tbf->direction][tbf->tfi()] = tbf; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); - - m_num_tbfs[tbf->direction] -= 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); - } - m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); - m_tbfs[tbf->direction][tbf->tfi()] = NULL; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) -{ - m_num_reserved[dir] += 1; -} - -void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) -{ - OSMO_ASSERT(m_num_reserved[dir] > 0); - m_num_reserved[dir] -= 1; } void gprs_rlcmac_trx::reserve_slots(enum gprs_rlcmac_tbf_direction dir, diff --git a/src/bts.h b/src/bts.h index c3bee12..8bbb7b7 100644 --- a/src/bts.h +++ b/src/bts.h @@ -37,6 +37,7 @@ #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" #include +#include #endif #include @@ -64,86 +65,6 @@ struct BTS; struct GprsMs; - -/* - * PDCH instance - */ -struct gprs_rlcmac_pdch { -#ifdef __cplusplus - struct gprs_rlcmac_paging *dequeue_paging(); - struct msgb *packet_paging_request(); - - bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); - - void free_resources(); - - bool is_enabled() const; - - void enable(); - void disable(); - - /* dispatching of messages */ - int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas); - int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - - gprs_rlcmac_bts *bts_data() const; - BTS *bts() const; - uint8_t trx_no() const; - - struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); - struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); - - void attach_tbf(gprs_rlcmac_tbf *tbf); - void detach_tbf(gprs_rlcmac_tbf *tbf); - - unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; - - void reserve(enum gprs_rlcmac_tbf_direction dir); - void unreserve(enum gprs_rlcmac_tbf_direction dir); - unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; - - uint8_t assigned_usf() const; - uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; -#endif - - uint8_t m_is_enabled; /* TS is enabled */ - uint8_t tsc; /* TSC of this slot */ - uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ - uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ - uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ - struct llist_head paging_list; /* list of paging messages */ - uint32_t last_rts_fn; /* store last frame number of RTS */ - - /* back pointers */ - struct gprs_rlcmac_trx *trx; - uint8_t ts_no; - -#ifdef __cplusplus -private: - int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); - - void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); - void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); - void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); - void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); - void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); - gprs_rlcmac_tbf *tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); - gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); -#endif - - uint8_t m_num_tbfs[2]; - uint8_t m_num_reserved[2]; - uint8_t m_assigned_usf; /* bit set */ - uint32_t m_assigned_tfi[2]; /* bit set */ - struct gprs_rlcmac_tbf *m_tbfs[2][32]; -}; struct gprs_rlcmac_trx { void *fl1h; @@ -539,33 +460,6 @@ return m_dl_tbfs; } -inline BTS *gprs_rlcmac_pdch::bts() const -{ - return trx->bts; -} - -inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const -{ - return m_num_tbfs[dir]; -} - -inline unsigned gprs_rlcmac_pdch::num_reserved( - enum gprs_rlcmac_tbf_direction dir) const -{ - return gprs_rlcmac_pdch::m_num_reserved[dir]; -} - -inline uint8_t gprs_rlcmac_pdch::assigned_usf() const -{ - return m_assigned_usf; -} - -inline uint32_t gprs_rlcmac_pdch::assigned_tfi( - enum gprs_rlcmac_tbf_direction dir) const -{ - return m_assigned_tfi[dir]; -} - inline struct rate_ctr_group *BTS::rate_counters() const { return m_ratectrs; @@ -686,15 +580,6 @@ #undef CREATE_STAT_INLINE -inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const -{ - return trx->bts->bts_data(); -} - -inline uint8_t gprs_rlcmac_pdch::trx_no() const -{ - return trx->trx_no; -} #endif #ifdef __cplusplus @@ -706,8 +591,4 @@ #ifdef __cplusplus } -inline bool gprs_rlcmac_pdch::is_enabled() const -{ - return m_is_enabled; -} #endif diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index e0d756a..3cc86e2 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index e4e40b1..57756e3 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "pcu_utils.h" extern "C" { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e555466..676eddc 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index dfef239..5d127dd 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -15,6 +15,7 @@ #include #include #include +#include #include extern void *tall_pcu_ctx; diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index f56332e..ef145f2 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -40,6 +40,7 @@ #include #include #include +#include extern void *tall_pcu_ctx; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 2a354d8..b94b09c 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -46,6 +46,7 @@ #include #include #include +#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index dff331f..b585745 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -12,9 +12,9 @@ #include #include "pcu_vty.h" #include "gprs_rlcmac.h" +#include #include "bts.h" #include "tbf.h" - #include "pcu_vty_functions.h" extern void *tall_pcu_ctx; diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index d4162a9..a7ad070 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -32,6 +32,7 @@ #include #include #include +#include extern "C" { #include diff --git a/src/pdch.cpp b/src/pdch.cpp new file mode 100644 index 0000000..c2af304 --- /dev/null +++ b/src/pdch.cpp @@ -0,0 +1,960 @@ +/* + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { + #include + #include + #include + #include + #include + #include + #include +} + +#include +#include + +extern void *tall_pcu_ctx; + +static void get_meas(struct pcu_l1_meas *meas, const Packet_Resource_Request_t *qr) +{ + unsigned i; + + meas->set_ms_c_value(qr->C_VALUE); + if (qr->Exist_SIGN_VAR) + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_INFO, + "Packet resource request: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); + } + } +} + +static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) +{ + static const int16_t rx_qual_map[] = { + 0, /* 0,14 % */ + 0, /* 0,28 % */ + 1, /* 0,57 % */ + 1, /* 1,13 % */ + 2, /* 2,26 % */ + 5, /* 4,53 % */ + 9, /* 9,05 % */ + 18, /* 18,10 % */ + }; + + meas->set_ms_rx_qual(rx_qual_map[ + OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) + ]); +} + +static void get_meas(struct pcu_l1_meas *meas, const Channel_Quality_Report_t *qr) +{ + unsigned i; + + get_rx_qual_meas(meas, qr->RXQUAL); + meas->set_ms_c_value(qr->C_VALUE); + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_DEBUG, + "Channel quality report: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL_TN); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); + } + } +} + +void gprs_rlcmac_pdch::enable() +{ + /* TODO: Check if there are still allocated resources.. */ + INIT_LLIST_HEAD(&paging_list); + m_is_enabled = 1; +} + +void gprs_rlcmac_pdch::disable() +{ + /* TODO.. kick free_resources once we know the TRX/TS we are on */ + m_is_enabled = 0; +} + +void gprs_rlcmac_pdch::free_resources() +{ + struct gprs_rlcmac_paging *pag; + + /* we are not enabled. there should be no resources */ + if (!is_enabled()) + return; + + /* kick all TBF on slot */ + gprs_rlcmac_tbf::free_all(this); + + /* flush all pending paging messages */ + while ((pag = dequeue_paging())) + talloc_free(pag); + + trx->bts->sba()->free_resources(this); +} + +struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() +{ + struct gprs_rlcmac_paging *pag; + + if (llist_empty(&paging_list)) + return NULL; + pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); + llist_del(&pag->list); + + return pag; +} + +struct msgb *gprs_rlcmac_pdch::packet_paging_request() +{ + struct gprs_rlcmac_paging *pag; + struct msgb *msg; + unsigned wp = 0, len; + + /* no paging, no message */ + pag = dequeue_paging(); + if (!pag) + return NULL; + + LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); + + /* alloc message */ + msg = msgb_alloc(23, "pag ctrl block"); + if (!msg) { + talloc_free(pag); + return NULL; + } + bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); + if (!pag_vec) { + msgb_free(msg); + talloc_free(pag); + return NULL; + } + wp = Encoding::write_packet_paging_request(pag_vec); + + /* loop until message is full */ + while (pag) { + /* try to add paging */ + if ((pag->identity_lv[1] & 0x07) == 4) { + /* TMSI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", + ntohl(*((uint32_t *)(pag->identity_lv + 1)))); + len = 1 + 1 + 1 + 32 + 2 + 1; + if (pag->identity_lv[0] != 5) { + LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " + "MI != 5 octets!\n"); + goto continue_next; + } + } else { + /* MI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", + osmo_hexdump(pag->identity_lv + 1, + pag->identity_lv[0])); + len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; + if (pag->identity_lv[0] > 8) { + LOGP(DRLCMAC, LOGL_ERROR, "Paging with " + "MI > 8 octets!\n"); + goto continue_next; + } + } + if (wp + len > 184) { + LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " + "next time\n"); + /* put back paging record, because does not fit */ + llist_add_tail(&pag->list, &paging_list); + break; + } + Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], + pag->identity_lv + 1, pag->chan_needed); + +continue_next: + talloc_free(pag); + pag = dequeue_paging(); + } + + bitvec_pack(pag_vec, msgb_put(msg, 23)); + RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); + bitvec_free(pag_vec); + talloc_free(mac_control_block); + + return msg; +} + +bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) +{ + struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); + if (!pag) + return false; + + pag->chan_needed = chan_needed; + memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); + + llist_add(&pag->list, &paging_list); + + return true; +} + +void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) +{ + struct gprs_rlcmac_tbf *tbf, *new_tbf; + uint32_t tlli = packet->TLLI; + GprsMs *ms = bts()->ms_by_tlli(tlli); + gprs_rlcmac_ul_tbf *ul_tbf; + + tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", + fn, tlli, trx_no(), ts_no); + if (ms) + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown TBF corresponds to MS with IMSI %s, TA %d, " + "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", + ms->imsi(), ms->ta(), + ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, + ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", + ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, + ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); + TBF_POLL_SCHED_UNSET(tbf); + + /* check if this control ack belongs to packet uplink ack */ + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); + if (ul_tbf->ctrl_ack_to_toggle()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); + + tbf_free(tbf); + return; + } + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { + /* We now know that the PACCH really existed */ + LOGPTBF(new_tbf, LOGL_INFO, + "The TBF has been confirmed on the PACCH, " + "changed type from CCCH to PACCH\n"); + new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + } + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + /* stop pending assignment timer */ + new_tbf->t_stop(T0, "control acked (DL-TBF)"); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); + + tbf_assign_control_ts(new_tbf); + return; + } + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); + + tbf_assign_control_ts(new_tbf); + /* there might be LLC packets waiting in the queue, but the DL + * TBF might have been released while the UL TBF has been + * established */ + if (new_tbf->ms()->need_dl_tbf()) + new_tbf->establish_dl_tbf_on_pacch(); + + return; + } + LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " + "at no request\n"); +} + +void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled! TLLI=0x%08x\n", report->TLLI); + } else { + GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); + if (!ms) + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "but TLLI 0x%08x is unknown\n", report->TLLI); + else + ms->set_ta(sba->ta); + + bts()->sba()->free_sba(sba); + } + gprs_rlcmac_meas_rep(report); +} + +/* Received Uplink RLC control block. */ +int gprs_rlcmac_pdch::rcv_control_block( + const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) +{ + RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + + if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + else + bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + + bts()->rlc_rcvd_control(); + switch (ul_control_block->u.MESSAGE_TYPE) { + case MT_PACKET_CONTROL_ACK: + rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); + break; + case MT_PACKET_DOWNLINK_ACK_NACK: + rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); + break; + case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: + rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); + break; + case MT_PACKET_RESOURCE_REQUEST: + rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); + break; + case MT_PACKET_MEASUREMENT_REPORT: + rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); + break; + case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: + /* ignoring it. change the SI to not force sending these? */ + break; + default: + bts()->decode_error(); + LOGP(DRLCMAC, LOGL_NOTICE, + "RX: [PCU <- BTS] unknown control block(%d) received\n", + ul_control_block->u.MESSAGE_TYPE); + } + talloc_free(ul_control_block); + return 1; +} + +/* received RLC/MAC block from L1 */ +int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas) +{ + GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); + if (!cs) { + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" + "length: %d)\n", len); + return -EINVAL; + } + + bts()->rlc_ul_bytes(len); + + LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " + "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); + + if (cs.isGprs()) + return rcv_block_gprs(data, len, fn, meas, cs); + + if (cs.isEgprs()) + return rcv_data_block(data, len, fn, meas, cs); + + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", + cs.name()); + return -EINVAL; +} + +/*! \brief process egprs and gprs data blocks */ +int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + int rc; + struct gprs_rlc_data_info rlc_dec; + struct gprs_rlcmac_ul_tbf *tbf; + unsigned len = cs.sizeUL(); + + /* These are always data blocks, since EGPRS still uses CS-1 for + * control blocks (see 44.060, section 10.3, 1st par.) + */ + if (cs.isEgprs()) { + if (!bts()->bts_data()->egprs_enabled) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but EGPRS is not enabled\n", + cs.name()); + return -EINVAL; + } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } + + LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); + + rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); + if (rc < 0) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but header parsing has failed\n", + cs.name()); + bts()->decode_error(); + return rc; + } + + LOGP(DRLCMACUL, LOGL_INFO, + "Got %s RLC block: " + "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " + "rc=%d\n", + cs.name(), + rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, + rc); + + /* find TBF inst from given TFI */ + tbf = ul_tbf_by_tfi(rlc_dec.tfi); + if (!tbf) { + LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", + rlc_dec.tfi); + return 0; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); +} + +int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + unsigned payload = data[0] >> 6; + bitvec *block; + int rc = 0; + unsigned len = cs.maxBytesUL(); + + switch (payload) { + case GPRS_RLCMAC_DATA_BLOCK: + rc = rcv_data_block(data, data_len, fn, meas, cs); + break; + case GPRS_RLCMAC_CONTROL_BLOCK: + block = bitvec_alloc(len, tall_pcu_ctx); + if (!block) + return -ENOMEM; + bitvec_unpack(block, data); + rc = rcv_control_block(data, data_len, block, fn); + bitvec_free(block); + break; + case GPRS_RLCMAC_CONTROL_BLOCK_OPT: + LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); + break; + default: + LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); + rc = -EINVAL; + } + + return rc; +} + +void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + if (request->ID.UnionType) { + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + uint32_t tlli = request->ID.u.TLLI; + uint8_t ms_class = 0; + uint8_t egprs_ms_class = 0; + uint8_t ta = GSM48_TA_INVALID; + struct pcu_l1_meas meas; + + GprsMs *ms = bts()->ms_by_tlli(tlli); + /* Keep the ms, even if it gets idle temporarily */ + GprsMs::Guard guard(ms); + + if (ms) { + ul_tbf = ms->ul_tbf(); + dl_tbf = ms->dl_tbf(); + ta = ms->ta(); + } + + /* We got a RACH so the MS was in packet idle mode and thus + * didn't have any active TBFs */ + if (ul_tbf) { + LOGPTBFUL(ul_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", + tlli); + tbf_free(ul_tbf); + ul_tbf = NULL; + } + + if (dl_tbf) { + LOGPTBFUL(dl_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", + tlli); + tbf_free(dl_tbf); + dl_tbf = NULL; + } + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " + "in packet resource request of single " + "block, so we provide one:\n"); + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled!\n"); + } else { + ta = sba->ta; + bts()->sba()->free_sba(sba); + } + if (request->Exist_MS_Radio_Access_capability) { + ms_class = Decoding::get_ms_class_by_capability( + &request->MS_Radio_Access_capability); + egprs_ms_class = + Decoding::get_egprs_ms_class_by_capability( + &request->MS_Radio_Access_capability); + } + if (!ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); + if (egprs_ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, + "MS supports EGPRS multislot class %d.\n", + egprs_ms_class); + ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, + egprs_ms_class, tlli, ta, ms); + + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); + return; + } + + /* set control ts to current MS's TS, until assignment complete */ + LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", + ul_tbf->control_ts, ts_no); + + ul_tbf->control_ts = ts_no; + /* schedule uplink assignment */ + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + + /* get capabilities */ + if (ul_tbf->ms()) + ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); + + /* get measurements */ + if (ul_tbf->ms()) { + get_meas(&meas, request); + ul_tbf->ms()->update_l1_meas(&meas); + } + return; + } + + if (request->ID.u.Global_TFI.UnionType) { + struct gprs_rlcmac_dl_tbf *dl_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; + dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!dl_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); + return; + } + LOGPTBFDL(dl_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + dl_tbf->m_n3101 = 0; + } else { + struct gprs_rlcmac_ul_tbf *ul_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; + ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!ul_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); + return; + } + LOGPTBFUL(ul_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + ul_tbf->m_n3101 = 0; + } +} + +static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) +{ + bts->channel_request_description(); + + /* This call will register the new TBF with the MS on success */ + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), + tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + + /* schedule uplink assignment or reject */ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); + } +} + +void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) +{ + int8_t tfi = 0; /* must be signed */ + struct gprs_rlcmac_dl_tbf *tbf; + struct pcu_l1_meas meas; + int rc; + int num_blocks; + uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; + char show_bits[RLC_EGPRS_MAX_WS + 1]; + bitvec bits; + int bsn_begin, bsn_end; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, + "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); + + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " + "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " + "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", + (int)ack_nack->EGPRS_AckNack.UnionType, + (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, + (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, + (void *)&ack_nack->EGPRS_AckNack.UnionType, + (void *)&ack_nack->EGPRS_AckNack.Desc, + (int)offsetof(EGPRS_AckNack_t, Desc), + (int)offsetof(EGPRS_AckNack_w_len_t, Desc), + tbf->window()->v_a(), + tbf->window()->v_s(), + osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, + sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_egprs_acknack_bits( + &ack_nack->EGPRS_AckNack.Desc, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits) + ); + + rc = tbf->rcvd_dl_ack( + ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + + /* check for channel request */ + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + /* TODO: Implement Measurements parsing for EGPRS */ + /* + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + */ + } +} + +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + gprs_rlcmac_tbf *tbf; + LListHead *pos; + + llist_for_each(pos, tbf_list) { + tbf = pos->entry(); + if (tbf->tfi() != tfi) + continue; + if (!tbf->pdch[ts_no]) + continue; + return tbf; + } + return NULL; +} + +gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) +{ + return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); +} + +gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) +{ + return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); +} + +/* lookup TBF Entity (by TFI) */ +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + struct gprs_rlcmac_tbf *tbf; + + if (tfi >= 32) + return NULL; + + tbf = m_tbfs[dir][tfi]; + + if (!tbf) + return NULL; + + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { + return tbf; + } + + return NULL; +} + +void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + if (m_tbfs[tbf->direction][tbf->tfi()]) + LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " + "%s has not been detached, overwriting it\n", + ts_no, trx_no(), + m_tbfs[tbf->direction][tbf->tfi()]->name()); + + m_num_tbfs[tbf->direction] += 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; + } + m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); + m_tbfs[tbf->direction][tbf->tfi()] = tbf; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); + + m_num_tbfs[tbf->direction] -= 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); + } + m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); + m_tbfs[tbf->direction][tbf->tfi()] = NULL; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) +{ + m_num_reserved[dir] += 1; +} + +void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) +{ + OSMO_ASSERT(m_num_reserved[dir] > 0); + m_num_reserved[dir] -= 1; +} + +inline BTS *gprs_rlcmac_pdch::bts() const +{ + return trx->bts; +} + +uint8_t gprs_rlcmac_pdch::trx_no() const +{ + return trx->trx_no; +} + +inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const +{ + return trx->bts->bts_data(); +} + +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 */ + struct gprs_rlcmac_dl_tbf *tbf; + int rc; + struct pcu_l1_meas meas; + int num_blocks; + uint8_t bits_data[RLC_GPRS_WS/8]; + bitvec bits; + int bsn_begin, bsn_end; + char show_bits[RLC_GPRS_WS + 1]; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_gprs_acknack_bits( + &ack_nack->Ack_Nack_Description, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits)); + + rc = tbf->rcvd_dl_ack( + ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + /* check for channel request */ + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + } +} diff --git a/src/pdch.h b/src/pdch.h new file mode 100644 index 0000000..cf9804d --- /dev/null +++ b/src/pdch.h @@ -0,0 +1,147 @@ +/* pdch.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#include +} + +#include +#include +#include +#endif + +#include + +#include + +/* + * PDCH instance + */ +struct gprs_rlcmac_pdch { +#ifdef __cplusplus + struct gprs_rlcmac_paging *dequeue_paging(); + struct msgb *packet_paging_request(); + + bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); + + void free_resources(); + + bool is_enabled() const; + + void enable(); + void disable(); + + /* dispatching of messages */ + int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas); + int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + + gprs_rlcmac_bts *bts_data() const; + BTS *bts() const; + uint8_t trx_no() const; + + struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); + + void attach_tbf(gprs_rlcmac_tbf *tbf); + void detach_tbf(gprs_rlcmac_tbf *tbf); + + unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; + + void reserve(enum gprs_rlcmac_tbf_direction dir); + void unreserve(enum gprs_rlcmac_tbf_direction dir); + unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; + + uint8_t assigned_usf() const; + uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; +#endif + + uint8_t m_is_enabled; /* TS is enabled */ + uint8_t tsc; /* TSC of this slot */ + uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ + uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ + uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ + struct llist_head paging_list; /* list of paging messages */ + uint32_t last_rts_fn; /* store last frame number of RTS */ + + /* back pointers */ + struct gprs_rlcmac_trx *trx; + uint8_t ts_no; + +#ifdef __cplusplus +private: + int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); + + void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); + void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); + void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); + void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); + void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); + gprs_rlcmac_tbf *tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); + gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); +#endif + + uint8_t m_num_tbfs[2]; + uint8_t m_num_reserved[2]; + uint8_t m_assigned_usf; /* bit set */ + uint32_t m_assigned_tfi[2]; /* bit set */ + struct gprs_rlcmac_tbf *m_tbfs[2][32]; +}; + +#ifdef __cplusplus + +inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const +{ + return m_num_tbfs[dir]; +} + +inline unsigned gprs_rlcmac_pdch::num_reserved( + enum gprs_rlcmac_tbf_direction dir) const +{ + return gprs_rlcmac_pdch::m_num_reserved[dir]; +} + +inline uint8_t gprs_rlcmac_pdch::assigned_usf() const +{ + return m_assigned_usf; +} + +inline uint32_t gprs_rlcmac_pdch::assigned_tfi( + enum gprs_rlcmac_tbf_direction dir) const +{ + return m_assigned_tfi[dir]; +} + +inline bool gprs_rlcmac_pdch::is_enabled() const +{ + return m_is_enabled; +} + +#endif /* __cplusplus */ diff --git a/src/sba.cpp b/src/sba.cpp index 5dfdddb..567babe 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -23,6 +23,7 @@ #include #include #include +#include extern "C" { #include diff --git a/src/tbf.cpp b/src/tbf.cpp index 74f2cd8..72b39ec 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -32,6 +32,7 @@ #include #include #include +#include extern "C" { #include -- To view, visit https://gerrit.osmocom.org/6053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 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 Jan 30 12:55:53 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 12:55:53 +0000 Subject: [PATCH] osmo-pcu[master]: Move include guard to the top Message-ID: Review at https://gerrit.osmocom.org/6195 Move include guard to the top Having explicit include above the douible-include guard defines is potential source for hard to track bugs. Let's move it inside the guard statement. Change-Id: I5114a63ce00b03c8eed23565d52969250bd505cc Related: OS#1539 --- M src/csn1.h M src/gsm_rlcmac.h 2 files changed, 6 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/6195/1 diff --git a/src/csn1.h b/src/csn1.h index 3f5b849..1015e69 100644 --- a/src/csn1.h +++ b/src/csn1.h @@ -25,15 +25,15 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef _PACKET_CSN1_H_ +#define _PACKET_CSN1_H_ + extern "C" { #include } #include #include -#ifndef _PACKET_CSN1_H_ -#define _PACKET_CSN1_H_ - #define MIN(a,b) (((a)<(b))?(a):(b)) //#define max(a,b) (((a)>(b))?(a):(b)) diff --git a/src/gsm_rlcmac.h b/src/gsm_rlcmac.h index 8f4039c..2ad1937 100644 --- a/src/gsm_rlcmac.h +++ b/src/gsm_rlcmac.h @@ -29,11 +29,12 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef __PACKET_GSM_RLCMAC_H__ +#define __PACKET_GSM_RLCMAC_H__ + #include "csn1.h" #include #include -#ifndef __PACKET_GSM_RLCMAC_H__ -#define __PACKET_GSM_RLCMAC_H__ #ifndef PRE_PACKED #define PRE_PACKED -- To view, visit https://gerrit.osmocom.org/6195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5114a63ce00b03c8eed23565d52969250bd505cc Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 13:23:01 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 13:23:01 +0000 Subject: [PATCH] osmo-pcu[master]: Move PDCH-related functions into separate files In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6053 to look at the new patch set (#5). Move PDCH-related functions into separate files The PDCH class and corresponding functions are rather self-contained and independent from BTS implementation. Let's move them into separate file to make bts.cpp more manageable. As additional benefit it allow us to somewhat untangle all the different cross-dependent includes. Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Related: OS#1539 --- M src/Makefile.am M src/bts.cpp M src/bts.h M src/gprs_bssgp_pcu.cpp M src/gprs_rlcmac_sched.cpp M src/gprs_rlcmac_ts_alloc.cpp M src/osmo-bts-litecell15/lc15_l1_if.c M src/osmo-bts-sysmo/sysmo_l1_if.c M src/osmobts_sock.cpp M src/pcu_l1_if.cpp M src/pcu_vty.c M src/pcu_vty_functions.cpp A src/pdch.cpp A src/pdch.h M src/sba.cpp M src/tbf.cpp 16 files changed, 1,122 insertions(+), 1,020 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/53/6053/5 diff --git a/src/Makefile.am b/src/Makefile.am index 7d2a62e..b2f64f2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -54,6 +54,7 @@ tbf_ul.cpp \ tbf_dl.cpp \ bts.cpp \ + pdch.cpp \ poll_controller.cpp \ encoding.cpp \ sba.cpp \ @@ -85,6 +86,7 @@ mslot_class.h \ tbf.h \ bts.h \ + pdch.h \ poll_controller.h \ encoding.h \ sba.h \ diff --git a/src/bts.cpp b/src/bts.cpp index 24be5d4..096d3af 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -29,6 +29,7 @@ #include #include #include +#include extern "C" { #include @@ -841,801 +842,6 @@ return ms; } -/* - * PDCH code below. TODO: move to a separate file - */ - -void gprs_rlcmac_pdch::enable() -{ - /* TODO: Check if there are still allocated resources.. */ - INIT_LLIST_HEAD(&paging_list); - m_is_enabled = 1; -} - -void gprs_rlcmac_pdch::disable() -{ - /* TODO.. kick free_resources once we know the TRX/TS we are on */ - m_is_enabled = 0; -} - -void gprs_rlcmac_pdch::free_resources() -{ - struct gprs_rlcmac_paging *pag; - - /* we are not enabled. there should be no resources */ - if (!is_enabled()) - return; - - /* kick all TBF on slot */ - gprs_rlcmac_tbf::free_all(this); - - /* flush all pending paging messages */ - while ((pag = dequeue_paging())) - talloc_free(pag); - - trx->bts->sba()->free_resources(this); -} - -struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() -{ - struct gprs_rlcmac_paging *pag; - - if (llist_empty(&paging_list)) - return NULL; - pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); - llist_del(&pag->list); - - return pag; -} - -struct msgb *gprs_rlcmac_pdch::packet_paging_request() -{ - struct gprs_rlcmac_paging *pag; - struct msgb *msg; - unsigned wp = 0, len; - - /* no paging, no message */ - pag = dequeue_paging(); - if (!pag) - return NULL; - - LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); - - /* alloc message */ - msg = msgb_alloc(23, "pag ctrl block"); - if (!msg) { - talloc_free(pag); - return NULL; - } - bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); - if (!pag_vec) { - msgb_free(msg); - talloc_free(pag); - return NULL; - } - wp = Encoding::write_packet_paging_request(pag_vec); - - /* loop until message is full */ - while (pag) { - /* try to add paging */ - if ((pag->identity_lv[1] & 0x07) == 4) { - /* TMSI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", - ntohl(*((uint32_t *)(pag->identity_lv + 1)))); - len = 1 + 1 + 1 + 32 + 2 + 1; - if (pag->identity_lv[0] != 5) { - LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " - "MI != 5 octets!\n"); - goto continue_next; - } - } else { - /* MI */ - LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", - osmo_hexdump(pag->identity_lv + 1, - pag->identity_lv[0])); - len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; - if (pag->identity_lv[0] > 8) { - LOGP(DRLCMAC, LOGL_ERROR, "Paging with " - "MI > 8 octets!\n"); - goto continue_next; - } - } - if (wp + len > 184) { - LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " - "next time\n"); - /* put back paging record, because does not fit */ - llist_add_tail(&pag->list, &paging_list); - break; - } - Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], - pag->identity_lv + 1, pag->chan_needed); - -continue_next: - talloc_free(pag); - pag = dequeue_paging(); - } - - bitvec_pack(pag_vec, msgb_put(msg, 23)); - RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); - bitvec_free(pag_vec); - talloc_free(mac_control_block); - - return msg; -} - -bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) -{ - struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); - if (!pag) - return false; - - pag->chan_needed = chan_needed; - memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); - - llist_add(&pag->list, &paging_list); - - return true; -} - -void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) -{ - struct gprs_rlcmac_tbf *tbf, *new_tbf; - uint32_t tlli = packet->TLLI; - GprsMs *ms = bts()->ms_by_tlli(tlli); - gprs_rlcmac_ul_tbf *ul_tbf; - - tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", - fn, tlli, trx_no(), ts_no); - if (ms) - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " - "unknown TBF corresponds to MS with IMSI %s, TA %d, " - "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", - ms->imsi(), ms->ta(), - ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, - ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", - ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, - ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); - TBF_POLL_SCHED_UNSET(tbf); - - /* check if this control ack belongs to packet uplink ack */ - ul_tbf = as_ul_tbf(tbf); - if (ul_tbf && ul_tbf->handle_ctrl_ack()) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); - if (ul_tbf->ctrl_ack_to_toggle()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); - - tbf_free(tbf); - return; - } - if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { - /* We now know that the PACCH really existed */ - LOGPTBF(new_tbf, LOGL_INFO, - "The TBF has been confirmed on the PACCH, " - "changed type from CCCH to PACCH\n"); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); - } - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - /* stop pending assignment timer */ - new_tbf->t_stop(T0, "control acked (DL-TBF)"); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); - - tbf_assign_control_ts(new_tbf); - return; - } - if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { - LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); - /* reset N3105 */ - tbf->n3105 = 0; - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); - - new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; - if (!new_tbf) { - LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " - "TBF is gone TLLI=0x%08x\n", tlli); - return; - } - if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && - tbf->direction == new_tbf->direction) - tbf_free(tbf); - - TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); - if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) - LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); - - tbf_assign_control_ts(new_tbf); - /* there might be LLC packets waiting in the queue, but the DL - * TBF might have been released while the UL TBF has been - * established */ - if (new_tbf->ms()->need_dl_tbf()) - new_tbf->establish_dl_tbf_on_pacch(); - - return; - } - LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " - "at no request\n"); -} - -static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) -{ - static const int16_t rx_qual_map[] = { - 0, /* 0,14 % */ - 0, /* 0,28 % */ - 1, /* 0,57 % */ - 1, /* 1,13 % */ - 2, /* 2,26 % */ - 5, /* 4,53 % */ - 9, /* 9,05 % */ - 18, /* 18,10 % */ - }; - - meas->set_ms_rx_qual(rx_qual_map[ - OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) - ]); -} - -static void get_meas(struct pcu_l1_meas *meas, - const Packet_Resource_Request_t *qr) -{ - unsigned i; - - meas->set_ms_c_value(qr->C_VALUE); - if (qr->Exist_SIGN_VAR) - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_INFO, - "Packet resource request: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); - } - } -} - -static void get_meas(struct pcu_l1_meas *meas, - const Channel_Quality_Report_t *qr) -{ - unsigned i; - - get_rx_qual_meas(meas, qr->RXQUAL); - meas->set_ms_c_value(qr->C_VALUE); - meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ - - for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) - { - if (qr->Slot[i].Exist) { - LOGP(DRLCMAC, LOGL_DEBUG, - "Channel quality report: i_level[%d] = %d\n", - i, qr->Slot[i].I_LEVEL_TN); - meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); - } - } -} - -static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) -{ - bts->channel_request_description(); - - /* This call will register the new TBF with the MS on success */ - gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), - tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - - /* schedule uplink assignment or reject */ - if (ul_tbf) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - } else { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); - TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); - } -} - -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 */ - struct gprs_rlcmac_dl_tbf *tbf; - int rc; - struct pcu_l1_meas meas; - int num_blocks; - uint8_t bits_data[RLC_GPRS_WS/8]; - bitvec bits; - int bsn_begin, bsn_end; - char show_bits[RLC_GPRS_WS + 1]; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_gprs_acknack_bits( - &ack_nack->Ack_Nack_Description, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits)); - - rc = tbf->rcvd_dl_ack( - ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - /* check for channel request */ - if (ack_nack->Exist_Channel_Request_Description) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - } -} - -void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) -{ - int8_t tfi = 0; /* must be signed */ - struct gprs_rlcmac_dl_tbf *tbf; - struct pcu_l1_meas meas; - int rc; - int num_blocks; - uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; - char show_bits[RLC_EGPRS_MAX_WS + 1]; - bitvec bits; - int bsn_begin, bsn_end; - - tfi = ack_nack->DOWNLINK_TFI; - tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); - if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "unknown FN=%u TFI=%d (TRX %d TS %d)\n", - fn, tfi, trx_no(), ts_no); - return; - } - if (tbf->tfi() != tfi) { - LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " - "wrong TFI=%d, ignoring!\n", tfi); - return; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - if (tbf->handle_ack_nack()) - LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); - - LOGPTBF(tbf, LOGL_DEBUG, - "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); - - LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " - "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " - "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", - (int)ack_nack->EGPRS_AckNack.UnionType, - (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, - (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, - (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, - (void *)&ack_nack->EGPRS_AckNack.UnionType, - (void *)&ack_nack->EGPRS_AckNack.Desc, - (int)offsetof(EGPRS_AckNack_t, Desc), - (int)offsetof(EGPRS_AckNack_w_len_t, Desc), - tbf->window()->v_a(), - tbf->window()->v_s(), - osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, - sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); - - bits.data = bits_data; - bits.data_len = sizeof(bits_data); - bits.cur_bit = 0; - - num_blocks = Decoding::decode_egprs_acknack_bits( - &ack_nack->EGPRS_AckNack.Desc, &bits, - &bsn_begin, &bsn_end, tbf->window()); - - LOGP(DRLCMAC, LOGL_DEBUG, - "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " - "\"%s\"\n", - ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, - bsn_begin, bsn_end, num_blocks, - (Decoding::extract_rbb(&bits, show_bits), show_bits) - ); - - rc = tbf->rcvd_dl_ack( - ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, - bsn_begin, &bits); - if (rc == 1) { - tbf_free(tbf); - return; - } - - /* check for channel request */ - if (ack_nack->Exist_ChannelRequestDescription) - sched_ul_ass_or_rej(bts(), bts_data(), tbf); - - /* get measurements */ - if (tbf->ms()) { - /* TODO: Implement Measurements parsing for EGPRS */ - /* - get_meas(&meas, &ack_nack->Channel_Quality_Report); - tbf->ms()->update_l1_meas(&meas); - */ - } -} - -void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - if (request->ID.UnionType) { - struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; - struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; - uint32_t tlli = request->ID.u.TLLI; - uint8_t ms_class = 0; - uint8_t egprs_ms_class = 0; - uint8_t ta = GSM48_TA_INVALID; - struct pcu_l1_meas meas; - - GprsMs *ms = bts()->ms_by_tlli(tlli); - /* Keep the ms, even if it gets idle temporarily */ - GprsMs::Guard guard(ms); - - if (ms) { - ul_tbf = ms->ul_tbf(); - dl_tbf = ms->dl_tbf(); - ta = ms->ta(); - } - - /* We got a RACH so the MS was in packet idle mode and thus - * didn't have any active TBFs */ - if (ul_tbf) { - LOGPTBFUL(ul_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", - tlli); - tbf_free(ul_tbf); - ul_tbf = NULL; - } - - if (dl_tbf) { - LOGPTBFUL(dl_tbf, LOGL_NOTICE, - "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", - tlli); - tbf_free(dl_tbf); - dl_tbf = NULL; - } - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " - "in packet resource request of single " - "block, so we provide one:\n"); - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled!\n"); - } else { - ta = sba->ta; - bts()->sba()->free_sba(sba); - } - if (request->Exist_MS_Radio_Access_capability) { - ms_class = Decoding::get_ms_class_by_capability( - &request->MS_Radio_Access_capability); - egprs_ms_class = - Decoding::get_egprs_ms_class_by_capability( - &request->MS_Radio_Access_capability); - } - if (!ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); - if (egprs_ms_class) - LOGP(DRLCMAC, LOGL_NOTICE, - "MS supports EGPRS multislot class %d.\n", - egprs_ms_class); - ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, - egprs_ms_class, tlli, ta, ms); - - if (!ul_tbf) { - handle_tbf_reject(bts_data(), ms, tlli, - trx_no(), ts_no); - return; - } - - /* set control ts to current MS's TS, until assignment complete */ - LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", - ul_tbf->control_ts, ts_no); - - ul_tbf->control_ts = ts_no; - /* schedule uplink assignment */ - TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); - - /* get capabilities */ - if (ul_tbf->ms()) - ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); - - /* get measurements */ - if (ul_tbf->ms()) { - get_meas(&meas, request); - ul_tbf->ms()->update_l1_meas(&meas); - } - return; - } - - if (request->ID.u.Global_TFI.UnionType) { - struct gprs_rlcmac_dl_tbf *dl_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; - dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!dl_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); - return; - } - LOGPTBFDL(dl_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - dl_tbf->m_n3101 = 0; - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf; - int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; - ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); - if (!ul_tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); - return; - } - LOGPTBFUL(ul_tbf, LOGL_ERROR, - "RX: [PCU <- BTS] FIXME: Packet resource request\n"); - - /* Reset N3101 counter: */ - ul_tbf->m_n3101 = 0; - } -} - -void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) -{ - struct gprs_rlcmac_sba *sba; - - sba = bts()->sba()->find(this, fn); - if (!sba) { - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "in packet resource request of single " - "block, but there is no resource request " - "scheduled! TLLI=0x%08x\n", report->TLLI); - } else { - GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); - if (!ms) - LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " - "but TLLI 0x%08x is unknown\n", report->TLLI); - else - ms->set_ta(sba->ta); - - bts()->sba()->free_sba(sba); - } - gprs_rlcmac_meas_rep(report); -} - -/* Received Uplink RLC control block. */ -int gprs_rlcmac_pdch::rcv_control_block( - const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) -{ - RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); - LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); - decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); - LOGPC(DCSN1, LOGL_NOTICE, "\n"); - LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); - - if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - else - bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); - - bts()->rlc_rcvd_control(); - switch (ul_control_block->u.MESSAGE_TYPE) { - case MT_PACKET_CONTROL_ACK: - rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); - break; - case MT_PACKET_DOWNLINK_ACK_NACK: - rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); - break; - case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: - rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); - break; - case MT_PACKET_RESOURCE_REQUEST: - rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); - break; - case MT_PACKET_MEASUREMENT_REPORT: - rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); - break; - case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: - /* ignoring it. change the SI to not force sending these? */ - break; - default: - bts()->decode_error(); - LOGP(DRLCMAC, LOGL_NOTICE, - "RX: [PCU <- BTS] unknown control block(%d) received\n", - ul_control_block->u.MESSAGE_TYPE); - } - talloc_free(ul_control_block); - return 1; -} - - -/* received RLC/MAC block from L1 */ -int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas) -{ - GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); - if (!cs) { - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" - "length: %d)\n", len); - return -EINVAL; - } - - bts()->rlc_ul_bytes(len); - - LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " - "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); - - if (cs.isGprs()) - return rcv_block_gprs(data, len, fn, meas, cs); - - if (cs.isEgprs()) - return rcv_data_block(data, len, fn, meas, cs); - - bts()->decode_error(); - LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", - cs.name()); - return -EINVAL; -} - -/*! \brief process egprs and gprs data blocks */ -int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - int rc; - struct gprs_rlc_data_info rlc_dec; - struct gprs_rlcmac_ul_tbf *tbf; - unsigned len = cs.sizeUL(); - - /* These are always data blocks, since EGPRS still uses CS-1 for - * control blocks (see 44.060, section 10.3, 1st par.) - */ - if (cs.isEgprs()) { - if (!bts()->bts_data()->egprs_enabled) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but EGPRS is not enabled\n", - cs.name()); - return -EINVAL; - } - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } else { - bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, data, data_len); - } - - LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); - - rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); - if (rc < 0) { - LOGP(DRLCMACUL, LOGL_ERROR, - "Got %s RLC block but header parsing has failed\n", - cs.name()); - bts()->decode_error(); - return rc; - } - - LOGP(DRLCMACUL, LOGL_INFO, - "Got %s RLC block: " - "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " - "rc=%d\n", - cs.name(), - rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, - rc); - - /* find TBF inst from given TFI */ - tbf = ul_tbf_by_tfi(rlc_dec.tfi); - if (!tbf) { - LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", - rlc_dec.tfi); - return 0; - } - - /* Reset N3101 counter: */ - tbf->m_n3101 = 0; - - return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); -} - -int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs) -{ - unsigned payload = data[0] >> 6; - bitvec *block; - int rc = 0; - unsigned len = cs.maxBytesUL(); - - switch (payload) { - case GPRS_RLCMAC_DATA_BLOCK: - rc = rcv_data_block(data, data_len, fn, meas, cs); - break; - case GPRS_RLCMAC_CONTROL_BLOCK: - block = bitvec_alloc(len, tall_pcu_ctx); - if (!block) - return -ENOMEM; - bitvec_unpack(block, data); - rc = rcv_control_block(data, data_len, block, fn); - bitvec_free(block); - break; - case GPRS_RLCMAC_CONTROL_BLOCK_OPT: - LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); - break; - default: - LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); - rc = -EINVAL; - } - - return rc; -} - /* update TA based on TA provided by PH-DATA-IND */ void update_tbf_ta(struct gprs_rlcmac_ul_tbf *tbf, int8_t ta_delta) { @@ -1693,110 +899,6 @@ update_tbf_ta(tbf, ta); } -} - -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - gprs_rlcmac_tbf *tbf; - LListHead *pos; - - llist_for_each(pos, tbf_list) { - tbf = pos->entry(); - if (tbf->tfi() != tfi) - continue; - if (!tbf->pdch[ts_no]) - continue; - return tbf; - } - return NULL; -} - -gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) -{ - return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); -} - -gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) -{ - return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); -} - -/* lookup TBF Entity (by TFI) */ -gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir) -{ - struct gprs_rlcmac_tbf *tbf; - - if (tfi >= 32) - return NULL; - - tbf = m_tbfs[dir][tfi]; - - if (!tbf) - return NULL; - - if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { - return tbf; - } - - return NULL; -} - -void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - if (m_tbfs[tbf->direction][tbf->tfi()]) - LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " - "%s has not been detached, overwriting it\n", - ts_no, trx_no(), - m_tbfs[tbf->direction][tbf->tfi()]->name()); - - m_num_tbfs[tbf->direction] += 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; - } - m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); - m_tbfs[tbf->direction][tbf->tfi()] = tbf; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) -{ - gprs_rlcmac_ul_tbf *ul_tbf; - - OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); - - m_num_tbfs[tbf->direction] -= 1; - if (tbf->direction == GPRS_RLCMAC_UL_TBF) { - ul_tbf = as_ul_tbf(tbf); - m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); - } - m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); - m_tbfs[tbf->direction][tbf->tfi()] = NULL; - - LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " - "USFs = %02x, TFIs = %08x.\n", - ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], - m_assigned_usf, m_assigned_tfi[tbf->direction]); -} - -void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) -{ - m_num_reserved[dir] += 1; -} - -void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) -{ - OSMO_ASSERT(m_num_reserved[dir] > 0); - m_num_reserved[dir] -= 1; } void gprs_rlcmac_trx::reserve_slots(enum gprs_rlcmac_tbf_direction dir, diff --git a/src/bts.h b/src/bts.h index c3bee12..8bbb7b7 100644 --- a/src/bts.h +++ b/src/bts.h @@ -37,6 +37,7 @@ #include "gprs_ms_storage.h" #include "gprs_coding_scheme.h" #include +#include #endif #include @@ -64,86 +65,6 @@ struct BTS; struct GprsMs; - -/* - * PDCH instance - */ -struct gprs_rlcmac_pdch { -#ifdef __cplusplus - struct gprs_rlcmac_paging *dequeue_paging(); - struct msgb *packet_paging_request(); - - bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); - - void free_resources(); - - bool is_enabled() const; - - void enable(); - void disable(); - - /* dispatching of messages */ - int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, - struct pcu_l1_meas *meas); - int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, - struct pcu_l1_meas *meas, GprsCodingScheme cs); - - gprs_rlcmac_bts *bts_data() const; - BTS *bts() const; - uint8_t trx_no() const; - - struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); - struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); - - void attach_tbf(gprs_rlcmac_tbf *tbf); - void detach_tbf(gprs_rlcmac_tbf *tbf); - - unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; - - void reserve(enum gprs_rlcmac_tbf_direction dir); - void unreserve(enum gprs_rlcmac_tbf_direction dir); - unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; - - uint8_t assigned_usf() const; - uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; -#endif - - uint8_t m_is_enabled; /* TS is enabled */ - uint8_t tsc; /* TSC of this slot */ - uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ - uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ - uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ - struct llist_head paging_list; /* list of paging messages */ - uint32_t last_rts_fn; /* store last frame number of RTS */ - - /* back pointers */ - struct gprs_rlcmac_trx *trx; - uint8_t ts_no; - -#ifdef __cplusplus -private: - int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); - - void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); - void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); - void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); - void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); - void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); - gprs_rlcmac_tbf *tbf_from_list_by_tfi( - LListHead *tbf_list, uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); - gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, - enum gprs_rlcmac_tbf_direction dir); -#endif - - uint8_t m_num_tbfs[2]; - uint8_t m_num_reserved[2]; - uint8_t m_assigned_usf; /* bit set */ - uint32_t m_assigned_tfi[2]; /* bit set */ - struct gprs_rlcmac_tbf *m_tbfs[2][32]; -}; struct gprs_rlcmac_trx { void *fl1h; @@ -539,33 +460,6 @@ return m_dl_tbfs; } -inline BTS *gprs_rlcmac_pdch::bts() const -{ - return trx->bts; -} - -inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const -{ - return m_num_tbfs[dir]; -} - -inline unsigned gprs_rlcmac_pdch::num_reserved( - enum gprs_rlcmac_tbf_direction dir) const -{ - return gprs_rlcmac_pdch::m_num_reserved[dir]; -} - -inline uint8_t gprs_rlcmac_pdch::assigned_usf() const -{ - return m_assigned_usf; -} - -inline uint32_t gprs_rlcmac_pdch::assigned_tfi( - enum gprs_rlcmac_tbf_direction dir) const -{ - return m_assigned_tfi[dir]; -} - inline struct rate_ctr_group *BTS::rate_counters() const { return m_ratectrs; @@ -686,15 +580,6 @@ #undef CREATE_STAT_INLINE -inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const -{ - return trx->bts->bts_data(); -} - -inline uint8_t gprs_rlcmac_pdch::trx_no() const -{ - return trx->trx_no; -} #endif #ifdef __cplusplus @@ -706,8 +591,4 @@ #ifdef __cplusplus } -inline bool gprs_rlcmac_pdch::is_enabled() const -{ - return m_is_enabled; -} #endif diff --git a/src/gprs_bssgp_pcu.cpp b/src/gprs_bssgp_pcu.cpp index e0d756a..3cc86e2 100644 --- a/src/gprs_bssgp_pcu.cpp +++ b/src/gprs_bssgp_pcu.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #define BSSGP_TIMER_T1 30 /* Guards the (un)blocking procedures */ #define BSSGP_TIMER_T2 30 /* Guards the reset procedure */ diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index e4e40b1..57756e3 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include "pcu_utils.h" extern "C" { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e555466..676eddc 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/src/osmo-bts-litecell15/lc15_l1_if.c b/src/osmo-bts-litecell15/lc15_l1_if.c index 8290a93..1df7941 100644 --- a/src/osmo-bts-litecell15/lc15_l1_if.c +++ b/src/osmo-bts-litecell15/lc15_l1_if.c @@ -34,6 +34,7 @@ #include #include #include +#include #include extern void *tall_pcu_ctx; diff --git a/src/osmo-bts-sysmo/sysmo_l1_if.c b/src/osmo-bts-sysmo/sysmo_l1_if.c index dfef239..5d127dd 100644 --- a/src/osmo-bts-sysmo/sysmo_l1_if.c +++ b/src/osmo-bts-sysmo/sysmo_l1_if.c @@ -15,6 +15,7 @@ #include #include #include +#include #include extern void *tall_pcu_ctx; diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index f56332e..ef145f2 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -40,6 +40,7 @@ #include #include #include +#include extern void *tall_pcu_ctx; diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index 2a354d8..b94b09c 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -46,6 +46,7 @@ #include #include #include +#include // FIXME: move this, when changed from c++ to c. extern "C" { diff --git a/src/pcu_vty.c b/src/pcu_vty.c index dff331f..b585745 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -12,9 +12,9 @@ #include #include "pcu_vty.h" #include "gprs_rlcmac.h" +#include #include "bts.h" #include "tbf.h" - #include "pcu_vty_functions.h" extern void *tall_pcu_ctx; diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index d4162a9..a7ad070 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -32,6 +32,7 @@ #include #include #include +#include extern "C" { #include diff --git a/src/pdch.cpp b/src/pdch.cpp new file mode 100644 index 0000000..c2af304 --- /dev/null +++ b/src/pdch.cpp @@ -0,0 +1,960 @@ +/* + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern "C" { + #include + #include + #include + #include + #include + #include + #include +} + +#include +#include + +extern void *tall_pcu_ctx; + +static void get_meas(struct pcu_l1_meas *meas, const Packet_Resource_Request_t *qr) +{ + unsigned i; + + meas->set_ms_c_value(qr->C_VALUE); + if (qr->Exist_SIGN_VAR) + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_INFO, + "Packet resource request: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL); + } + } +} + +static void get_rx_qual_meas(struct pcu_l1_meas *meas, uint8_t rx_qual_enc) +{ + static const int16_t rx_qual_map[] = { + 0, /* 0,14 % */ + 0, /* 0,28 % */ + 1, /* 0,57 % */ + 1, /* 1,13 % */ + 2, /* 2,26 % */ + 5, /* 4,53 % */ + 9, /* 9,05 % */ + 18, /* 18,10 % */ + }; + + meas->set_ms_rx_qual(rx_qual_map[ + OSMO_MIN(rx_qual_enc, ARRAY_SIZE(rx_qual_map)-1) + ]); +} + +static void get_meas(struct pcu_l1_meas *meas, const Channel_Quality_Report_t *qr) +{ + unsigned i; + + get_rx_qual_meas(meas, qr->RXQUAL); + meas->set_ms_c_value(qr->C_VALUE); + meas->set_ms_sign_var((qr->SIGN_VAR + 2) / 4); /* SIGN_VAR * 0.25 dB */ + + for (i = 0; i < OSMO_MIN(ARRAY_SIZE(qr->Slot), ARRAY_SIZE(meas->ts)); i++) + { + if (qr->Slot[i].Exist) { + LOGP(DRLCMAC, LOGL_DEBUG, + "Channel quality report: i_level[%d] = %d\n", + i, qr->Slot[i].I_LEVEL_TN); + meas->set_ms_i_level(i, -2 * qr->Slot[i].I_LEVEL_TN); + } + } +} + +void gprs_rlcmac_pdch::enable() +{ + /* TODO: Check if there are still allocated resources.. */ + INIT_LLIST_HEAD(&paging_list); + m_is_enabled = 1; +} + +void gprs_rlcmac_pdch::disable() +{ + /* TODO.. kick free_resources once we know the TRX/TS we are on */ + m_is_enabled = 0; +} + +void gprs_rlcmac_pdch::free_resources() +{ + struct gprs_rlcmac_paging *pag; + + /* we are not enabled. there should be no resources */ + if (!is_enabled()) + return; + + /* kick all TBF on slot */ + gprs_rlcmac_tbf::free_all(this); + + /* flush all pending paging messages */ + while ((pag = dequeue_paging())) + talloc_free(pag); + + trx->bts->sba()->free_resources(this); +} + +struct gprs_rlcmac_paging *gprs_rlcmac_pdch::dequeue_paging() +{ + struct gprs_rlcmac_paging *pag; + + if (llist_empty(&paging_list)) + return NULL; + pag = llist_entry(paging_list.next, struct gprs_rlcmac_paging, list); + llist_del(&pag->list); + + return pag; +} + +struct msgb *gprs_rlcmac_pdch::packet_paging_request() +{ + struct gprs_rlcmac_paging *pag; + struct msgb *msg; + unsigned wp = 0, len; + + /* no paging, no message */ + pag = dequeue_paging(); + if (!pag) + return NULL; + + LOGP(DRLCMAC, LOGL_DEBUG, "Scheduling paging\n"); + + /* alloc message */ + msg = msgb_alloc(23, "pag ctrl block"); + if (!msg) { + talloc_free(pag); + return NULL; + } + bitvec *pag_vec = bitvec_alloc(23, tall_pcu_ctx); + if (!pag_vec) { + msgb_free(msg); + talloc_free(pag); + return NULL; + } + wp = Encoding::write_packet_paging_request(pag_vec); + + /* loop until message is full */ + while (pag) { + /* try to add paging */ + if ((pag->identity_lv[1] & 0x07) == 4) { + /* TMSI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- TMSI=0x%08x\n", + ntohl(*((uint32_t *)(pag->identity_lv + 1)))); + len = 1 + 1 + 1 + 32 + 2 + 1; + if (pag->identity_lv[0] != 5) { + LOGP(DRLCMAC, LOGL_ERROR, "TMSI paging with " + "MI != 5 octets!\n"); + goto continue_next; + } + } else { + /* MI */ + LOGP(DRLCMAC, LOGL_DEBUG, "- MI=%s\n", + osmo_hexdump(pag->identity_lv + 1, + pag->identity_lv[0])); + len = 1 + 1 + 1 + 4 + (pag->identity_lv[0]<<3) + 2 + 1; + if (pag->identity_lv[0] > 8) { + LOGP(DRLCMAC, LOGL_ERROR, "Paging with " + "MI > 8 octets!\n"); + goto continue_next; + } + } + if (wp + len > 184) { + LOGP(DRLCMAC, LOGL_DEBUG, "- Does not fit, so schedule " + "next time\n"); + /* put back paging record, because does not fit */ + llist_add_tail(&pag->list, &paging_list); + break; + } + Encoding::write_repeated_page_info(pag_vec, wp, pag->identity_lv[0], + pag->identity_lv + 1, pag->chan_needed); + +continue_next: + talloc_free(pag); + pag = dequeue_paging(); + } + + bitvec_pack(pag_vec, msgb_put(msg, 23)); + RlcMacDownlink_t * mac_control_block = (RlcMacDownlink_t *)talloc_zero(tall_pcu_ctx, RlcMacDownlink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ TX : Packet Paging Request +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_downlink(pag_vec, mac_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Paging Request -------------------------\n"); + bitvec_free(pag_vec); + talloc_free(mac_control_block); + + return msg; +} + +bool gprs_rlcmac_pdch::add_paging(uint8_t chan_needed, uint8_t *identity_lv) +{ + struct gprs_rlcmac_paging *pag = talloc_zero(tall_pcu_ctx, struct gprs_rlcmac_paging); + if (!pag) + return false; + + pag->chan_needed = chan_needed; + memcpy(pag->identity_lv, identity_lv, identity_lv[0] + 1); + + llist_add(&pag->list, &paging_list); + + return true; +} + +void gprs_rlcmac_pdch::rcv_control_ack(Packet_Control_Acknowledgement_t *packet, uint32_t fn) +{ + struct gprs_rlcmac_tbf *tbf, *new_tbf; + uint32_t tlli = packet->TLLI; + GprsMs *ms = bts()->ms_by_tlli(tlli); + gprs_rlcmac_ul_tbf *ul_tbf; + + tbf = bts()->ul_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown FN=%u TLLI=0x%08x (TRX %d TS %d)\n", + fn, tlli, trx_no(), ts_no); + if (ms) + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET CONTROL ACK with " + "unknown TBF corresponds to MS with IMSI %s, TA %d, " + "uTBF (TFI=%d, state=%s), dTBF (TFI=%d, state=%s)\n", + ms->imsi(), ms->ta(), + ms->ul_tbf() ? ms->ul_tbf()->tfi() : 0, + ms->ul_tbf() ? ms->ul_tbf()->state_name() : "None", + ms->dl_tbf() ? ms->dl_tbf()->tfi() : 0, + ms->dl_tbf() ? ms->dl_tbf()->state_name() : "None"); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Control Ack\n"); + TBF_POLL_SCHED_UNSET(tbf); + + /* check if this control ack belongs to packet uplink ack */ + ul_tbf = as_ul_tbf(tbf); + if (ul_tbf && ul_tbf->handle_ctrl_ack()) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] END\n"); + if (ul_tbf->ctrl_ack_to_toggle()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered uplink ack for UL\n"); + + tbf_free(tbf); + return; + } + if (tbf->dl_ass_state_is(GPRS_RLCMAC_DL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] DOWNLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_DL(tbf, GPRS_RLCMAC_DL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->dl_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but DL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_CCCH)) { + /* We now know that the PACCH really existed */ + LOGPTBF(new_tbf, LOGL_INFO, + "The TBF has been confirmed on the PACCH, " + "changed type from CCCH to PACCH\n"); + new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + } + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + /* stop pending assignment timer */ + new_tbf->t_stop(T0, "control acked (DL-TBF)"); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_DL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered downlink assignment\n"); + + tbf_assign_control_ts(new_tbf); + return; + } + if (tbf->ul_ass_state_is(GPRS_RLCMAC_UL_ASS_WAIT_ACK)) { + LOGPTBF(tbf, LOGL_DEBUG, "[DOWNLINK] UPLINK ASSIGNED\n"); + /* reset N3105 */ + tbf->n3105 = 0; + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_NONE); + + new_tbf = tbf->ms() ? tbf->ms()->ul_tbf() : NULL; + if (!new_tbf) { + LOGP(DRLCMAC, LOGL_ERROR, "Got ACK, but UL " + "TBF is gone TLLI=0x%08x\n", tlli); + return; + } + if (tbf->state_is(GPRS_RLCMAC_WAIT_RELEASE) && + tbf->direction == new_tbf->direction) + tbf_free(tbf); + + TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); + if (new_tbf->check_n_clear(GPRS_RLCMAC_FLAG_TO_UL_ASS)) + LOGPTBF(new_tbf, LOGL_NOTICE, "Recovered uplink assignment for UL\n"); + + tbf_assign_control_ts(new_tbf); + /* there might be LLC packets waiting in the queue, but the DL + * TBF might have been released while the UL TBF has been + * established */ + if (new_tbf->ms()->need_dl_tbf()) + new_tbf->establish_dl_tbf_on_pacch(); + + return; + } + LOGP(DRLCMAC, LOGL_ERROR, "Error: received PACET CONTROL ACK " + "at no request\n"); +} + +void gprs_rlcmac_pdch::rcv_measurement_report(Packet_Measurement_Report_t *report, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled! TLLI=0x%08x\n", report->TLLI); + } else { + GprsMs *ms = bts()->ms_store().get_ms(report->TLLI); + if (!ms) + LOGP(DRLCMAC, LOGL_NOTICE, "MS send measurement " + "but TLLI 0x%08x is unknown\n", report->TLLI); + else + ms->set_ta(sba->ta); + + bts()->sba()->free_sba(sba); + } + gprs_rlcmac_meas_rep(report); +} + +/* Received Uplink RLC control block. */ +int gprs_rlcmac_pdch::rcv_control_block( + const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn) +{ + RlcMacUplink_t * ul_control_block = (RlcMacUplink_t *)talloc_zero(tall_pcu_ctx, RlcMacUplink_t); + LOGP(DRLCMAC, LOGL_DEBUG, "+++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++\n"); + decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); + LOGPC(DCSN1, LOGL_NOTICE, "\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + + if (ul_control_block->u.MESSAGE_TYPE == MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK) + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DUMMY, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + else + bts()->send_gsmtap(PCU_GSMTAP_C_UL_CTRL, true, trx_no(), ts_no, GSMTAP_CHANNEL_PACCH, fn, data, data_len); + + bts()->rlc_rcvd_control(); + switch (ul_control_block->u.MESSAGE_TYPE) { + case MT_PACKET_CONTROL_ACK: + rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); + break; + case MT_PACKET_DOWNLINK_ACK_NACK: + rcv_control_dl_ack_nack(&ul_control_block->u.Packet_Downlink_Ack_Nack, fn); + break; + case MT_EGPRS_PACKET_DOWNLINK_ACK_NACK: + rcv_control_egprs_dl_ack_nack(&ul_control_block->u.Egprs_Packet_Downlink_Ack_Nack, fn); + break; + case MT_PACKET_RESOURCE_REQUEST: + rcv_resource_request(&ul_control_block->u.Packet_Resource_Request, fn); + break; + case MT_PACKET_MEASUREMENT_REPORT: + rcv_measurement_report(&ul_control_block->u.Packet_Measurement_Report, fn); + break; + case MT_PACKET_UPLINK_DUMMY_CONTROL_BLOCK: + /* ignoring it. change the SI to not force sending these? */ + break; + default: + bts()->decode_error(); + LOGP(DRLCMAC, LOGL_NOTICE, + "RX: [PCU <- BTS] unknown control block(%d) received\n", + ul_control_block->u.MESSAGE_TYPE); + } + talloc_free(ul_control_block); + return 1; +} + +/* received RLC/MAC block from L1 */ +int gprs_rlcmac_pdch::rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas) +{ + GprsCodingScheme cs = GprsCodingScheme::getBySizeUL(len); + if (!cs) { + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Dropping data block with invalid" + "length: %d)\n", len); + return -EINVAL; + } + + bts()->rlc_ul_bytes(len); + + LOGP(DRLCMACUL, LOGL_DEBUG, "Got RLC block, coding scheme: %s, " + "length: %d (%d))\n", cs.name(), len, cs.usedSizeUL()); + + if (cs.isGprs()) + return rcv_block_gprs(data, len, fn, meas, cs); + + if (cs.isEgprs()) + return rcv_data_block(data, len, fn, meas, cs); + + bts()->decode_error(); + LOGP(DRLCMACUL, LOGL_ERROR, "Unsupported coding scheme %s\n", + cs.name()); + return -EINVAL; +} + +/*! \brief process egprs and gprs data blocks */ +int gprs_rlcmac_pdch::rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + int rc; + struct gprs_rlc_data_info rlc_dec; + struct gprs_rlcmac_ul_tbf *tbf; + unsigned len = cs.sizeUL(); + + /* These are always data blocks, since EGPRS still uses CS-1 for + * control blocks (see 44.060, section 10.3, 1st par.) + */ + if (cs.isEgprs()) { + if (!bts()->bts_data()->egprs_enabled) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but EGPRS is not enabled\n", + cs.name()); + return -EINVAL; + } + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_EGPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } else { + bts()->send_gsmtap(PCU_GSMTAP_C_UL_DATA_GPRS, true, trx_no(), ts_no, GSMTAP_CHANNEL_PDTCH, fn, + data, data_len); + } + + LOGP(DRLCMACUL, LOGL_DEBUG, " UL data: %s\n", osmo_hexdump(data, len)); + + rc = Decoding::rlc_parse_ul_data_header(&rlc_dec, data, cs); + if (rc < 0) { + LOGP(DRLCMACUL, LOGL_ERROR, + "Got %s RLC block but header parsing has failed\n", + cs.name()); + bts()->decode_error(); + return rc; + } + + LOGP(DRLCMACUL, LOGL_INFO, + "Got %s RLC block: " + "R=%d, SI=%d, TFI=%d, CPS=%d, RSB=%d, " + "rc=%d\n", + cs.name(), + rlc_dec.r, rlc_dec.si, rlc_dec.tfi, rlc_dec.cps, rlc_dec.rsb, + rc); + + /* find TBF inst from given TFI */ + tbf = ul_tbf_by_tfi(rlc_dec.tfi); + if (!tbf) { + LOGP(DRLCMACUL, LOGL_NOTICE, "UL DATA unknown TFI=%d\n", + rlc_dec.tfi); + return 0; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + return tbf->rcv_data_block_acknowledged(&rlc_dec, data, meas); +} + +int gprs_rlcmac_pdch::rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs) +{ + unsigned payload = data[0] >> 6; + bitvec *block; + int rc = 0; + unsigned len = cs.maxBytesUL(); + + switch (payload) { + case GPRS_RLCMAC_DATA_BLOCK: + rc = rcv_data_block(data, data_len, fn, meas, cs); + break; + case GPRS_RLCMAC_CONTROL_BLOCK: + block = bitvec_alloc(len, tall_pcu_ctx); + if (!block) + return -ENOMEM; + bitvec_unpack(block, data); + rc = rcv_control_block(data, data_len, block, fn); + bitvec_free(block); + break; + case GPRS_RLCMAC_CONTROL_BLOCK_OPT: + LOGP(DRLCMAC, LOGL_NOTICE, "GPRS_RLCMAC_CONTROL_BLOCK_OPT block payload is not supported.\n"); + break; + default: + LOGP(DRLCMAC, LOGL_NOTICE, "Unknown RLCMAC block payload(%u).\n", payload); + rc = -EINVAL; + } + + return rc; +} + +void gprs_rlcmac_pdch::rcv_resource_request(Packet_Resource_Request_t *request, uint32_t fn) +{ + struct gprs_rlcmac_sba *sba; + + if (request->ID.UnionType) { + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_dl_tbf *dl_tbf = NULL; + uint32_t tlli = request->ID.u.TLLI; + uint8_t ms_class = 0; + uint8_t egprs_ms_class = 0; + uint8_t ta = GSM48_TA_INVALID; + struct pcu_l1_meas meas; + + GprsMs *ms = bts()->ms_by_tlli(tlli); + /* Keep the ms, even if it gets idle temporarily */ + GprsMs::Guard guard(ms); + + if (ms) { + ul_tbf = ms->ul_tbf(); + dl_tbf = ms->dl_tbf(); + ta = ms->ta(); + } + + /* We got a RACH so the MS was in packet idle mode and thus + * didn't have any active TBFs */ + if (ul_tbf) { + LOGPTBFUL(ul_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Killing pending UL TBF\n", + tlli); + tbf_free(ul_tbf); + ul_tbf = NULL; + } + + if (dl_tbf) { + LOGPTBFUL(dl_tbf, LOGL_NOTICE, + "Got RACH from TLLI=0x%08x while TBF still exists. Release pending DL TBF\n", + tlli); + tbf_free(dl_tbf); + dl_tbf = NULL; + } + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF " + "in packet resource request of single " + "block, so we provide one:\n"); + sba = bts()->sba()->find(this, fn); + if (!sba) { + LOGP(DRLCMAC, LOGL_NOTICE, "MS requests UL TBF " + "in packet resource request of single " + "block, but there is no resource request " + "scheduled!\n"); + } else { + ta = sba->ta; + bts()->sba()->free_sba(sba); + } + if (request->Exist_MS_Radio_Access_capability) { + ms_class = Decoding::get_ms_class_by_capability( + &request->MS_Radio_Access_capability); + egprs_ms_class = + Decoding::get_egprs_ms_class_by_capability( + &request->MS_Radio_Access_capability); + } + if (!ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, "MS does not give us a class.\n"); + if (egprs_ms_class) + LOGP(DRLCMAC, LOGL_NOTICE, + "MS supports EGPRS multislot class %d.\n", + egprs_ms_class); + ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, + egprs_ms_class, tlli, ta, ms); + + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); + return; + } + + /* set control ts to current MS's TS, until assignment complete */ + LOGPTBF(ul_tbf, LOGL_DEBUG, "change control TS %d -> %d until assinment is complete.\n", + ul_tbf->control_ts, ts_no); + + ul_tbf->control_ts = ts_no; + /* schedule uplink assignment */ + TBF_SET_ASS_STATE_UL(ul_tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + + /* get capabilities */ + if (ul_tbf->ms()) + ul_tbf->ms()->set_egprs_ms_class(egprs_ms_class); + + /* get measurements */ + if (ul_tbf->ms()) { + get_meas(&meas, request); + ul_tbf->ms()->update_l1_meas(&meas); + } + return; + } + + if (request->ID.u.Global_TFI.UnionType) { + struct gprs_rlcmac_dl_tbf *dl_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.DOWNLINK_TFI; + dl_tbf = bts()->dl_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!dl_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown downlink TFI=%d\n", tfi); + return; + } + LOGPTBFDL(dl_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + dl_tbf->m_n3101 = 0; + } else { + struct gprs_rlcmac_ul_tbf *ul_tbf; + int8_t tfi = request->ID.u.Global_TFI.u.UPLINK_TFI; + ul_tbf = bts()->ul_tbf_by_tfi(tfi, trx_no(), ts_no); + if (!ul_tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET RESSOURCE REQ unknown uplink TFI=%d\n", tfi); + return; + } + LOGPTBFUL(ul_tbf, LOGL_ERROR, + "RX: [PCU <- BTS] FIXME: Packet resource request\n"); + + /* Reset N3101 counter: */ + ul_tbf->m_n3101 = 0; + } +} + +static inline void sched_ul_ass_or_rej(BTS *bts, gprs_rlcmac_bts *bts_data, struct gprs_rlcmac_dl_tbf *tbf) +{ + bts->channel_request_description(); + + /* This call will register the new TBF with the MS on success */ + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data, tbf->trx->trx_no, tbf->ms_class(), + tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); + + /* schedule uplink assignment or reject */ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we provide one:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS); + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack message, so we packet access reject:\n"); + TBF_SET_ASS_STATE_UL(tbf, GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ); + } +} + +void gprs_rlcmac_pdch::rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *ack_nack, uint32_t fn) +{ + int8_t tfi = 0; /* must be signed */ + struct gprs_rlcmac_dl_tbf *tbf; + struct pcu_l1_meas meas; + int rc; + int num_blocks; + uint8_t bits_data[RLC_EGPRS_MAX_WS/8]; + char show_bits[RLC_EGPRS_MAX_WS + 1]; + bitvec bits; + int bsn_begin, bsn_end; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "EGPRS PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered EGPRS downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, + "RX: [PCU <- BTS] EGPRS Packet Downlink Ack/Nack\n"); + + LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS ACK/NACK: " + "ut: %d, final: %d, bow: %d, eow: %d, ssn: %d, have_crbb: %d, " + "urbb_len:%d, %p, %p, %d, %d, win: %d-%d, urbb: %s\n", + (int)ack_nack->EGPRS_AckNack.UnionType, + (int)ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + (int)ack_nack->EGPRS_AckNack.Desc.BEGINNING_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.END_OF_WINDOW, + (int)ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + (int)ack_nack->EGPRS_AckNack.Desc.Exist_CRBB, + (int)ack_nack->EGPRS_AckNack.Desc.URBB_LENGTH, + (void *)&ack_nack->EGPRS_AckNack.UnionType, + (void *)&ack_nack->EGPRS_AckNack.Desc, + (int)offsetof(EGPRS_AckNack_t, Desc), + (int)offsetof(EGPRS_AckNack_w_len_t, Desc), + tbf->window()->v_a(), + tbf->window()->v_s(), + osmo_hexdump((const uint8_t *)&ack_nack->EGPRS_AckNack.Desc.URBB, + sizeof(ack_nack->EGPRS_AckNack.Desc.URBB))); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_egprs_acknack_bits( + &ack_nack->EGPRS_AckNack.Desc, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got EGPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->EGPRS_AckNack.Desc.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits) + ); + + rc = tbf->rcvd_dl_ack( + ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + + /* check for channel request */ + if (ack_nack->Exist_ChannelRequestDescription) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + /* TODO: Implement Measurements parsing for EGPRS */ + /* + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + */ + } +} + +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + gprs_rlcmac_tbf *tbf; + LListHead *pos; + + llist_for_each(pos, tbf_list) { + tbf = pos->entry(); + if (tbf->tfi() != tfi) + continue; + if (!tbf->pdch[ts_no]) + continue; + return tbf; + } + return NULL; +} + +gprs_rlcmac_ul_tbf *gprs_rlcmac_pdch::ul_tbf_by_tfi(uint8_t tfi) +{ + return as_ul_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_UL_TBF)); +} + +gprs_rlcmac_dl_tbf *gprs_rlcmac_pdch::dl_tbf_by_tfi(uint8_t tfi) +{ + return as_dl_tbf(tbf_by_tfi(tfi, GPRS_RLCMAC_DL_TBF)); +} + +/* lookup TBF Entity (by TFI) */ +gprs_rlcmac_tbf *gprs_rlcmac_pdch::tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir) +{ + struct gprs_rlcmac_tbf *tbf; + + if (tfi >= 32) + return NULL; + + tbf = m_tbfs[dir][tfi]; + + if (!tbf) + return NULL; + + if (tbf->state_is_not(GPRS_RLCMAC_RELEASING)) { + return tbf; + } + + return NULL; +} + +void gprs_rlcmac_pdch::attach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + if (m_tbfs[tbf->direction][tbf->tfi()]) + LOGP(DRLCMAC, LOGL_ERROR, "PDCH(TS %d, TRX %d): " + "%s has not been detached, overwriting it\n", + ts_no, trx_no(), + m_tbfs[tbf->direction][tbf->tfi()]->name()); + + m_num_tbfs[tbf->direction] += 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf |= 1 << ul_tbf->m_usf[ts_no]; + } + m_assigned_tfi[tbf->direction] |= 1UL << tbf->tfi(); + m_tbfs[tbf->direction][tbf->tfi()] = tbf; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Attaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::detach_tbf(gprs_rlcmac_tbf *tbf) +{ + gprs_rlcmac_ul_tbf *ul_tbf; + + OSMO_ASSERT(m_num_tbfs[tbf->direction] > 0); + + m_num_tbfs[tbf->direction] -= 1; + if (tbf->direction == GPRS_RLCMAC_UL_TBF) { + ul_tbf = as_ul_tbf(tbf); + m_assigned_usf &= ~(1 << ul_tbf->m_usf[ts_no]); + } + m_assigned_tfi[tbf->direction] &= ~(1UL << tbf->tfi()); + m_tbfs[tbf->direction][tbf->tfi()] = NULL; + + LOGP(DRLCMAC, LOGL_INFO, "PDCH(TS %d, TRX %d): Detaching %s, %d TBFs, " + "USFs = %02x, TFIs = %08x.\n", + ts_no, trx_no(), tbf->name(), m_num_tbfs[tbf->direction], + m_assigned_usf, m_assigned_tfi[tbf->direction]); +} + +void gprs_rlcmac_pdch::reserve(enum gprs_rlcmac_tbf_direction dir) +{ + m_num_reserved[dir] += 1; +} + +void gprs_rlcmac_pdch::unreserve(enum gprs_rlcmac_tbf_direction dir) +{ + OSMO_ASSERT(m_num_reserved[dir] > 0); + m_num_reserved[dir] -= 1; +} + +inline BTS *gprs_rlcmac_pdch::bts() const +{ + return trx->bts; +} + +uint8_t gprs_rlcmac_pdch::trx_no() const +{ + return trx->trx_no; +} + +inline gprs_rlcmac_bts *gprs_rlcmac_pdch::bts_data() const +{ + return trx->bts->bts_data(); +} + +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 */ + struct gprs_rlcmac_dl_tbf *tbf; + int rc; + struct pcu_l1_meas meas; + int num_blocks; + uint8_t bits_data[RLC_GPRS_WS/8]; + bitvec bits; + int bsn_begin, bsn_end; + char show_bits[RLC_GPRS_WS + 1]; + + tfi = ack_nack->DOWNLINK_TFI; + tbf = bts()->dl_tbf_by_poll_fn(fn, trx_no(), ts_no); + if (!tbf) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "unknown FN=%u TFI=%d (TRX %d TS %d)\n", + fn, tfi, trx_no(), ts_no); + return; + } + if (tbf->tfi() != tfi) { + LOGP(DRLCMAC, LOGL_NOTICE, "PACKET DOWNLINK ACK with " + "wrong TFI=%d, ignoring!\n", tfi); + return; + } + + /* Reset N3101 counter: */ + tbf->m_n3101 = 0; + + if (tbf->handle_ack_nack()) + LOGPTBF(tbf, LOGL_NOTICE, "Recovered downlink ack\n"); + + LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] Packet Downlink Ack/Nack\n"); + + bits.data = bits_data; + bits.data_len = sizeof(bits_data); + bits.cur_bit = 0; + + num_blocks = Decoding::decode_gprs_acknack_bits( + &ack_nack->Ack_Nack_Description, &bits, + &bsn_begin, &bsn_end, tbf->window()); + + LOGP(DRLCMAC, LOGL_DEBUG, + "Got GPRS DL ACK bitmap: SSN: %d, BSN %d to %d - 1 (%d blocks), " + "\"%s\"\n", + ack_nack->Ack_Nack_Description.STARTING_SEQUENCE_NUMBER, + bsn_begin, bsn_end, num_blocks, + (Decoding::extract_rbb(&bits, show_bits), show_bits)); + + rc = tbf->rcvd_dl_ack( + ack_nack->Ack_Nack_Description.FINAL_ACK_INDICATION, + bsn_begin, &bits); + if (rc == 1) { + tbf_free(tbf); + return; + } + /* check for channel request */ + if (ack_nack->Exist_Channel_Request_Description) + sched_ul_ass_or_rej(bts(), bts_data(), tbf); + + /* get measurements */ + if (tbf->ms()) { + get_meas(&meas, &ack_nack->Channel_Quality_Report); + tbf->ms()->update_l1_meas(&meas); + } +} diff --git a/src/pdch.h b/src/pdch.h new file mode 100644 index 0000000..cf9804d --- /dev/null +++ b/src/pdch.h @@ -0,0 +1,147 @@ +/* pdch.h + * + * Copyright (C) 2012 Ivan Klyuchnikov + * Copyright (C) 2013 by Holger Hans Peter Freyther + * Copyright (C) 2018 by sysmocom - s.f.m.c. GmbH + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#include +} + +#include +#include +#include +#endif + +#include + +#include + +/* + * PDCH instance + */ +struct gprs_rlcmac_pdch { +#ifdef __cplusplus + struct gprs_rlcmac_paging *dequeue_paging(); + struct msgb *packet_paging_request(); + + bool add_paging(uint8_t chan_needed, uint8_t *identity_lv); + + void free_resources(); + + bool is_enabled() const; + + void enable(); + void disable(); + + /* dispatching of messages */ + int rcv_block(uint8_t *data, uint8_t len, uint32_t fn, + struct pcu_l1_meas *meas); + int rcv_block_gprs(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + int rcv_data_block(uint8_t *data, uint8_t data_len, uint32_t fn, + struct pcu_l1_meas *meas, GprsCodingScheme cs); + + gprs_rlcmac_bts *bts_data() const; + BTS *bts() const; + uint8_t trx_no() const; + + struct gprs_rlcmac_ul_tbf *ul_tbf_by_tfi(uint8_t tfi); + struct gprs_rlcmac_dl_tbf *dl_tbf_by_tfi(uint8_t tfi); + + void attach_tbf(gprs_rlcmac_tbf *tbf); + void detach_tbf(gprs_rlcmac_tbf *tbf); + + unsigned num_tbfs(enum gprs_rlcmac_tbf_direction dir) const; + + void reserve(enum gprs_rlcmac_tbf_direction dir); + void unreserve(enum gprs_rlcmac_tbf_direction dir); + unsigned num_reserved(enum gprs_rlcmac_tbf_direction dir) const; + + uint8_t assigned_usf() const; + uint32_t assigned_tfi(enum gprs_rlcmac_tbf_direction dir) const; +#endif + + uint8_t m_is_enabled; /* TS is enabled */ + uint8_t tsc; /* TSC of this slot */ + uint8_t next_ul_tfi; /* next uplink TBF/TFI to schedule (0..31) */ + uint8_t next_dl_tfi; /* next downlink TBF/TFI to schedule (0..31) */ + uint8_t next_ctrl_prio; /* next kind of ctrl message to schedule */ + struct llist_head paging_list; /* list of paging messages */ + uint32_t last_rts_fn; /* store last frame number of RTS */ + + /* back pointers */ + struct gprs_rlcmac_trx *trx; + uint8_t ts_no; + +#ifdef __cplusplus +private: + int rcv_control_block(const uint8_t *data, uint8_t data_len, bitvec *rlc_block, uint32_t fn); + + void rcv_control_ack(Packet_Control_Acknowledgement_t *, uint32_t fn); + void rcv_control_dl_ack_nack(Packet_Downlink_Ack_Nack_t *, uint32_t fn); + void rcv_control_egprs_dl_ack_nack(EGPRS_PD_AckNack_t *, uint32_t fn); + void rcv_resource_request(Packet_Resource_Request_t *t, uint32_t fn); + void rcv_measurement_report(Packet_Measurement_Report_t *t, uint32_t fn); + gprs_rlcmac_tbf *tbf_from_list_by_tfi( + LListHead *tbf_list, uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); + gprs_rlcmac_tbf *tbf_by_tfi(uint8_t tfi, + enum gprs_rlcmac_tbf_direction dir); +#endif + + uint8_t m_num_tbfs[2]; + uint8_t m_num_reserved[2]; + uint8_t m_assigned_usf; /* bit set */ + uint32_t m_assigned_tfi[2]; /* bit set */ + struct gprs_rlcmac_tbf *m_tbfs[2][32]; +}; + +#ifdef __cplusplus + +inline unsigned gprs_rlcmac_pdch::num_tbfs(enum gprs_rlcmac_tbf_direction dir) const +{ + return m_num_tbfs[dir]; +} + +inline unsigned gprs_rlcmac_pdch::num_reserved( + enum gprs_rlcmac_tbf_direction dir) const +{ + return gprs_rlcmac_pdch::m_num_reserved[dir]; +} + +inline uint8_t gprs_rlcmac_pdch::assigned_usf() const +{ + return m_assigned_usf; +} + +inline uint32_t gprs_rlcmac_pdch::assigned_tfi( + enum gprs_rlcmac_tbf_direction dir) const +{ + return m_assigned_tfi[dir]; +} + +inline bool gprs_rlcmac_pdch::is_enabled() const +{ + return m_is_enabled; +} + +#endif /* __cplusplus */ diff --git a/src/sba.cpp b/src/sba.cpp index 5dfdddb..567babe 100644 --- a/src/sba.cpp +++ b/src/sba.cpp @@ -23,6 +23,7 @@ #include #include #include +#include extern "C" { #include diff --git a/src/tbf.cpp b/src/tbf.cpp index 74f2cd8..72b39ec 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -32,6 +32,7 @@ #include #include #include +#include extern "C" { #include -- To view, visit https://gerrit.osmocom.org/6053 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie05e25361e6741a81b024679f9675c98d4923683 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 13:47:51 2018 From: gerrit-no-reply at lists.osmocom.org (Viktor Tsymbalyuk) Date: Tue, 30 Jan 2018 13:47:51 +0000 Subject: [PATCH] osmo-ggsn[master]: sgsnemu: created "pinghost" and "createif" modes for mutual ... Message-ID: Review at https://gerrit.osmocom.org/6196 sgsnemu: created "pinghost" and "createif" modes for mutual exclusion No warnings when used options from "pinghost" and "createif" groups in a same time. sgsnemu created tun0 interface and send pings inside G-PDU, but didn't calculate replys. Added options modes to avoid mutual exclusion options. Change-Id: I196df7838212dcddecd64a64a6cba613b6cfced0 --- M sgsnemu/cmdline.c M sgsnemu/cmdline.ggo M sgsnemu/cmdline.h 3 files changed, 97 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/96/6196/1 diff --git a/sgsnemu/cmdline.c b/sgsnemu/cmdline.c index 1c02baa..412e484 100644 --- a/sgsnemu/cmdline.c +++ b/sgsnemu/cmdline.c @@ -65,12 +65,14 @@ " --charging=INT Charging characteristics (default=`0x0800')", " -u, --uid=STRING Login user ID (default=`mig')", " -p, --pwd=STRING Login password (default=`hemmelig')", + "\n Mode: createif\n any option of this mode is related to tun interface, all payload going in and\n out via tunN interface", " --createif Create local network interface (default=off)", " -n, --net=STRING Network address for local interface", " --defaultroute Create default route (default=off)", " --ipup=STRING Script to run after link-up", " --ipdown=STRING Script to run after link-down", " --tun-device=STRING Name of the local network interface", + "\n Mode: pinghost\n generate ICMP payload inside G-PDU without setting up tun interface", " --pinghost=STRING Ping remote host", " --pingrate=INT Number of ping req per second (default=`1')", " --pingsize=INT Number of ping data bytes (default=`56')", @@ -168,6 +170,8 @@ args_info->pingquiet_given = 0; args_info->no_tx_gpdu_seq_given = 0; args_info->pdp_type_given = 0; + args_info->createif_mode_counter = 0; + args_info->pinghost_mode_counter = 0; } static @@ -290,19 +294,19 @@ args_info->charging_help = gengetopt_args_info_help[28]; args_info->uid_help = gengetopt_args_info_help[29]; args_info->pwd_help = gengetopt_args_info_help[30]; - args_info->createif_help = gengetopt_args_info_help[31]; - args_info->net_help = gengetopt_args_info_help[32]; - args_info->defaultroute_help = gengetopt_args_info_help[33]; - args_info->ipup_help = gengetopt_args_info_help[34]; - args_info->ipdown_help = gengetopt_args_info_help[35]; - args_info->tun_device_help = gengetopt_args_info_help[36]; - args_info->pinghost_help = gengetopt_args_info_help[37]; - args_info->pingrate_help = gengetopt_args_info_help[38]; - args_info->pingsize_help = gengetopt_args_info_help[39]; - args_info->pingcount_help = gengetopt_args_info_help[40]; - args_info->pingquiet_help = gengetopt_args_info_help[41]; - args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[42]; - args_info->pdp_type_help = gengetopt_args_info_help[43]; + args_info->createif_help = gengetopt_args_info_help[32]; + args_info->net_help = gengetopt_args_info_help[33]; + args_info->defaultroute_help = gengetopt_args_info_help[34]; + args_info->ipup_help = gengetopt_args_info_help[35]; + args_info->ipdown_help = gengetopt_args_info_help[36]; + args_info->tun_device_help = gengetopt_args_info_help[37]; + args_info->pinghost_help = gengetopt_args_info_help[39]; + args_info->pingrate_help = gengetopt_args_info_help[40]; + args_info->pingsize_help = gengetopt_args_info_help[41]; + args_info->pingcount_help = gengetopt_args_info_help[42]; + args_info->pingquiet_help = gengetopt_args_info_help[43]; + args_info->no_tx_gpdu_seq_help = gengetopt_args_info_help[44]; + args_info->pdp_type_help = gengetopt_args_info_help[45]; } @@ -361,8 +365,7 @@ struct cmdline_parser_params *cmdline_parser_params_create(void) { - struct cmdline_parser_params *params = - (struct cmdline_parser_params *) + struct cmdline_parser_params *params = (struct cmdline_parser_params *) malloc(sizeof(struct cmdline_parser_params)); cmdline_parser_params_init(params); return params; @@ -853,6 +856,30 @@ return 0; /* OK */ } +static int check_modes(int given1[], const char *options1[], + int given2[], const char *options2[]) +{ + int i = 0, j = 0, errors = 0; + + while (given1[i] >= 0) { + if (given1[i]) { + while (given2[j] >= 0) { + if (given2[j]) { + ++errors; + fprintf(stderr, + "%s: option %s conflicts with option %s\n", + package_name, options1[i], + options2[j]); + } + ++j; + } + } + ++i; + } + + return errors; +} + int cmdline_parser_internal(int argc, char **argv, struct gengetopt_args_info *args_info, @@ -1073,6 +1100,7 @@ break; case 'n': /* Network address for local interface. */ + args_info->createif_mode_counter += 1; if (update_arg((void *)&(args_info->net_arg), &(args_info->net_orig), @@ -1391,6 +1419,7 @@ else if (strcmp (long_options[option_index].name, "createif") == 0) { + args_info->createif_mode_counter += 1; if (update_arg ((void *)&(args_info->createif_flag), 0, @@ -1405,6 +1434,7 @@ else if (strcmp (long_options[option_index].name, "defaultroute") == 0) { + args_info->createif_mode_counter += 1; if (update_arg ((void *)&(args_info->defaultroute_flag), 0, @@ -1419,6 +1449,7 @@ /* Script to run after link-up. */ else if (strcmp(long_options[option_index].name, "ipup") == 0) { + args_info->createif_mode_counter += 1; if (update_arg((void *)&(args_info->ipup_arg), &(args_info->ipup_orig), @@ -1434,6 +1465,7 @@ else if (strcmp (long_options[option_index].name, "ipdown") == 0) { + args_info->createif_mode_counter += 1; if (update_arg((void *)&(args_info->ipdown_arg), &(args_info->ipdown_orig), @@ -1449,6 +1481,7 @@ else if (strcmp (long_options[option_index].name, "tun-device") == 0) { + args_info->createif_mode_counter += 1; if (update_arg ((void *)&(args_info->tun_device_arg), @@ -1465,6 +1498,7 @@ else if (strcmp (long_options[option_index].name, "pinghost") == 0) { + args_info->pinghost_mode_counter += 1; if (update_arg ((void *)&(args_info->pinghost_arg), @@ -1481,6 +1515,7 @@ else if (strcmp (long_options[option_index].name, "pingrate") == 0) { + args_info->pinghost_mode_counter += 1; if (update_arg ((void *)&(args_info->pingrate_arg), @@ -1496,6 +1531,7 @@ else if (strcmp (long_options[option_index].name, "pingsize") == 0) { + args_info->pinghost_mode_counter += 1; if (update_arg ((void *)&(args_info->pingsize_arg), @@ -1512,6 +1548,7 @@ else if (strcmp (long_options[option_index].name, "pingcount") == 0) { + args_info->pinghost_mode_counter += 1; if (update_arg ((void *)&(args_info->pingcount_arg), @@ -1527,6 +1564,7 @@ else if (strcmp (long_options[option_index].name, "pingquiet") == 0) { + args_info->pinghost_mode_counter += 1; if (update_arg ((void *)&(args_info->pingquiet_flag), 0, @@ -1566,6 +1604,31 @@ } /* switch */ } /* while */ + if (args_info->createif_mode_counter + && args_info->pinghost_mode_counter) { + int createif_given[] = + { args_info->createif_given, args_info->net_given, + args_info->defaultroute_given, args_info->ipup_given, + args_info->ipdown_given, args_info->tun_device_given, -1 + }; + const char *createif_desc[] = + { "--createif", "--net", "--defaultroute", "--ipup", + "--ipdown", "--tun-device", 0 + }; + int pinghost_given[] = + { args_info->pinghost_given, args_info->pingrate_given, + args_info->pingsize_given, args_info->pingcount_given, + args_info->pingquiet_given, -1 + }; + const char *pinghost_desc[] = + { "--pinghost", "--pingrate", "--pingsize", "--pingcount", + "--pingquiet", 0 + }; + error_occurred += + check_modes(createif_given, createif_desc, pinghost_given, + pinghost_desc); + } + if (check_required) { error_occurred += cmdline_parser_required2(args_info, argv[0], diff --git a/sgsnemu/cmdline.ggo b/sgsnemu/cmdline.ggo index 8136d3a..dec19cd 100644 --- a/sgsnemu/cmdline.ggo +++ b/sgsnemu/cmdline.ggo @@ -15,6 +15,10 @@ package "sgsnemu" +defmode "createif" modedesc="any option of this mode is related to tun interface, \ +all payload going in and out via tunN interface" +defmode "pinghost" modedesc="generate ICMP payload inside G-PDU without setting up tun interface" + option "debug" d "Run in debug mode" flag off option "conf" c "Read configuration file" string no @@ -49,18 +53,18 @@ option "uid" u "Login user ID" string default="mig" no option "pwd" p "Login password" string default="hemmelig" no -option "createif" - "Create local network interface" flag off -option "net" n "Network address for local interface" string dependon="createif" no -option "defaultroute" - "Create default route" flag dependon="createif" off -option "ipup" - "Script to run after link-up" string dependon="createif" no -option "ipdown" - "Script to run after link-down" string dependon="createif" no -option "tun-device" - "Name of the local network interface" string dependon="createif" no +modeoption "createif" - "Create local network interface" flag off mode="createif" +modeoption "net" n "Network address for local interface" string dependon="createif" no mode="createif" +modeoption "defaultroute" - "Create default route" flag dependon="createif" off mode="createif" +modeoption "ipup" - "Script to run after link-up" string dependon="createif" no mode="createif" +modeoption "ipdown" - "Script to run after link-down" string dependon="createif" no mode="createif" +modeoption "tun-device" - "Name of the local network interface" string dependon="createif" no mode="createif" -option "pinghost" - "Ping remote host" string no -option "pingrate" - "Number of ping req per second" int default="1" dependon="pinghost" no -option "pingsize" - "Number of ping data bytes" int default="56" dependon="pinghost" no -option "pingcount" - "Number of ping req to send" int default="0" dependon="pinghost" no -option "pingquiet" - "Do not print ping packet info" flag dependon="pinghost" off +modeoption "pinghost" - "Ping remote host" string no mode="pinghost" +modeoption "pingrate" - "Number of ping req per second" int default="1" dependon="pinghost" no mode="pinghost" +modeoption "pingsize" - "Number of ping data bytes" int default="56" dependon="pinghost" no mode="pinghost" +modeoption "pingcount" - "Number of ping req to send" int default="0" dependon="pinghost" no mode="pinghost" +modeoption "pingquiet" - "Do not print ping packet info" flag dependon="pinghost" off mode="pinghost" option "no-tx-gpdu-seq" - "Don't transmit G-PDU sequence nums" flag off option "pdp-type" t "PDP Type" string default="v4" no typestr="(v4|v6)" diff --git a/sgsnemu/cmdline.h b/sgsnemu/cmdline.h index 9dc210e..31a2085 100644 --- a/sgsnemu/cmdline.h +++ b/sgsnemu/cmdline.h @@ -370,6 +370,10 @@ unsigned int pdp_type_given; /**< @brief Whether pdp-type was given. */ + int createif_mode_counter; + /**< @brief Counter for mode createif */ + int pinghost_mode_counter; + /**< @brief Counter for mode pinghost */ }; /** @brief The additional parameters to pass to parser functions */ -- To view, visit https://gerrit.osmocom.org/6196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I196df7838212dcddecd64a64a6cba613b6cfced0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk From gerrit-no-reply at lists.osmocom.org Tue Jan 30 14:07:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 14:07:20 +0000 Subject: [PATCH] libosmocore[master]: GSUP: add helper wrapper for setting IMSI Message-ID: Review at https://gerrit.osmocom.org/6197 GSUP: add helper wrapper for setting IMSI Related: OS#2864 Change-Id: I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b --- M include/osmocom/gsm/gsup.h 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/6197/1 diff --git a/include/osmocom/gsm/gsup.h b/include/osmocom/gsm/gsup.h index 1a8a3b2..f358ff8 100644 --- a/include/osmocom/gsm/gsup.h +++ b/include/osmocom/gsm/gsup.h @@ -115,6 +115,7 @@ #define OSMO_GSUP_IS_MSGT_REQUEST(msgt) (((msgt) & 0b00000011) == 0b00) #define OSMO_GSUP_IS_MSGT_ERROR(msgt) (((msgt) & 0b00000011) == 0b01) #define OSMO_GSUP_TO_MSGT_ERROR(msgt) (((msgt) & 0b11111100) | 0b01) +#define OSMO_GSUP_COPY_IMSI(msg, _imsi) osmo_strlcpy((msg)->imsi, _imsi, GSM23003_IMSI_MAX_DIGITS + 2) extern const struct value_string osmo_gsup_message_type_names[]; static inline const char * -- To view, visit https://gerrit.osmocom.org/6197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 14:10:14 2018 From: gerrit-no-reply at lists.osmocom.org (Viktor Tsymbalyuk) Date: Tue, 30 Jan 2018 14:10:14 +0000 Subject: osmo-ggsn[master]: sgsnemu: created "pinghost" and "createif" modes for mutual ... In-Reply-To: References: Message-ID: Patch Set 1: some cli output for understanding ## original ``` ubuntu at test:~/osmo-ggsn$ sudo sgsnemu --listen 10.121.0.18 --remote 93.124.95.120 --contexts 1 --apn internet.ge.beeline.net --imsi 282040234567890 --rai=282.04.0001.0001 --nsapi=5 --qos=34824735 --charging=2 --createif --defaultroute -d --pingcount=3 --pinghost=10.123.0.18 remote: 93.124.95.120 listen: 10.121.0.18 debug: 1 imsi: 282040234567890 qos: 0x213621f qose1: 0x9396404074f9ffff qose2: 0x11 qose3: 0x0101 qose4: 0x4040 charging: 0x02 apn: internet.ge.beeline.net msisdn: 46702123456 uid: mig pwd: hemmelig pidfile: ./sgsnemu.pid statedir: ./ contexts: 1 timelimit: 0 createif: 1 defaultroute: 1 pinghost: 10.123.0.18 pingrate: 1 pingsize: 56 pingcount: 3 pingquiet: 0 norecovery: 0 no-tx-gpdu-seq: 0 Using default DNS server Local IP address is: 10.121.0.18 (10.121.0.18) Remote IP address is: 93.124.95.120 (93.124.95.120) IMSI is: 282040234567890 (0xf098765432040282) Using NSAPI: 5 Using GTP version: 1 Using APN: internet Using selection mode: 1 Using RAI: 282.04.0001.0001 ->mcc : 282 ->mnc : 04 ->LAC: 0001 ->RAC : 0001 Using MSISDN: 46702123456 Using ping host: 10.123.0.18 (10.123.0.18) Initialising GTP library <000d> gtp.c:757 GTP: gtp_newgsn() started at 10.121.0.18 Setting up interface Done initialising GTP library Sending off echo request Setting up PDP context #0 Waiting for response from ggsn........ idletime.tv_sec 3, idleTime.tv_usec 0 Received echo response idletime.tv_sec 3, idleTime.tv_usec 0 Received create PDP context response. IP address: 10.16.0.2 Create_ping 0 idletime.tv_sec 0, idleTime.tv_usec 999952 Create_ping -1140 idletime.tv_sec 0, idleTime.tv_usec 998791 idletime.tv_sec 0, idleTime.tv_usec 998218 Create_ping -1039 idletime.tv_sec 10, idleTime.tv_usec 0 idletime.tv_sec 10, idleTime.tv_usec 0 Disconnecting PDP context #0 ----10.123.0.18 PING Statistics---- 3 packets transmitted in 12.012 seconds, 0 packets received, 100% packet loss 0 packets received in total 0 packets transmitted idletime.tv_sec 3, idleTime.tv_usec 0 Received delete PDP context response. Cause value: 128 ``` #### in tcptdump thereis gtp-u with icmp (requests and replys) # PATCH ## mutual exclusion ``` ubuntu at test:~/osmo-ggsn$ sudo sgsnemu --listen 10.121.0.18 --remote 93.124.95.120 --contexts 1 --apn internet.ge.beeline.net --imsi 282040234567890 --rai=282.04.0001.0001 --nsapi=5 --qos=34824735 --charging=2 --defaultroute -d --pingcount=3 --pinghost=10.123.0.18 sgsnemu: option --defaultroute conflicts with option --pinghost sgsnemu: option --defaultroute conflicts with option --pingcount sgsnemu: '--defaultroute' option depends on option 'createif' ``` ## replys calculated ``` ubuntu at test:~/osmo-ggsn$ sudo sgsnemu --listen 10.121.0.18 --remote 93.124.95.120 --contexts 1 --apn internet.ge.beeline.net --imsi 282040234567890 --rai=282.04.0001.0001 --nsapi=5 --qos=34824735 --charging=2 --pingcount=3 --pinghost=10.123.0.18 Using default DNS server Local IP address is: 10.121.0.18 (10.121.0.18) Remote IP address is: 93.124.95.120 (93.124.95.120) IMSI is: 282040234567890 (0xf098765432040282) Using NSAPI: 5 Using GTP version: 1 Using APN: internet Using selection mode: 1 Using RAI: 282.04.0001.0001 ->mcc : 282 ->mnc : 04 ->LAC: 0001 ->RAC : 0001 Using MSISDN: 46702123456 Using ping host: 10.123.0.18 (10.123.0.18) Initialising GTP library <000d> gtp.c:757 GTP: gtp_newgsn() started at 10.121.0.18 Done initialising GTP library Sending off echo request Setting up PDP context #0 Waiting for response from ggsn........ Received echo response Received create PDP context response. IP address: 10.16.0.1 84 bytes from 10.123.0.18: icmp_seq=1 time=0.665 ms 84 bytes from 10.123.0.18: icmp_seq=2 time=0.647 ms Disconnecting PDP context #0 ----10.123.0.18 PING Statistics---- 3 packets transmitted in 12.012 seconds, 2 packets received, 33% packet loss round-trip (ms) min/avg/max = 0.647/0.656/0.665 2 packets transmitted Received delete PDP context response. Cause value: 128 ubuntu at test:~/osmo-ggsn$ ``` -- To view, visit https://gerrit.osmocom.org/6196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I196df7838212dcddecd64a64a6cba613b6cfced0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Viktor Tsymbalyuk Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Viktor Tsymbalyuk Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 14:13:22 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 14:13:22 +0000 Subject: [PATCH] osmo-msc[master]: Use helper for adding IMSI to GSUP message Message-ID: Review at https://gerrit.osmocom.org/6198 Use helper for adding IMSI to GSUP message N. B: requires I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b in libosmocore. Change-Id: I67b482dedfa11237ac21894fc5930039e12434ab Related: OS#2864 --- M src/libcommon/gsup_test_client.c M src/libvlr/vlr.c 2 files changed, 7 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/98/6198/1 diff --git a/src/libcommon/gsup_test_client.c b/src/libcommon/gsup_test_client.c index ceac414..2f495c7 100644 --- a/src/libcommon/gsup_test_client.c +++ b/src/libcommon/gsup_test_client.c @@ -108,7 +108,7 @@ struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); int rc; - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup, io->imsi); gsup.message_type = OSMO_GSUP_MSGT_SEND_AUTH_INFO_REQUEST; rc = osmo_gsup_encode(msg, &gsup); @@ -128,7 +128,7 @@ struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); int rc; - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup, io->imsi); gsup.message_type = OSMO_GSUP_MSGT_UPDATE_LOCATION_REQUEST; rc = osmo_gsup_encode(msg, &gsup); @@ -146,7 +146,7 @@ struct msgb *msg = msgb_alloc_headroom(1200, 200, __func__); int rc; - osmo_strlcpy(gsup.imsi, io->imsi, sizeof(gsup.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup, io->imsi); gsup.message_type = OSMO_GSUP_MSGT_INSERT_DATA_RESULT; rc = osmo_gsup_encode(msg, &gsup); diff --git a/src/libvlr/vlr.c b/src/libvlr/vlr.c index a87c4b2..292edb0 100644 --- a/src/libvlr/vlr.c +++ b/src/libvlr/vlr.c @@ -156,7 +156,7 @@ struct vlr_instance *vlr = vsub->vlr; if (strlen(gsup_msg->imsi) == 0) - osmo_strlcpy(gsup_msg->imsi, vsub->imsi, sizeof(gsup_msg->imsi)); + OSMO_GSUP_COPY_IMSI(gsup_msg, vsub->imsi); return vlr_tx_gsup_message(vlr, gsup_msg); } @@ -168,7 +168,7 @@ { struct osmo_gsup_message gsup_reply = {0}; - osmo_strlcpy(gsup_reply.imsi, gsup_orig->imsi, sizeof(gsup_reply.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup_reply, gsup_orig->imsi); gsup_reply.cause = cause; gsup_reply.message_type = OSMO_GSUP_TO_MSGT_ERROR(gsup_orig->message_type); @@ -570,7 +570,8 @@ struct osmo_gsup_message gsup_msg = {0}; gsup_msg.message_type = OSMO_GSUP_MSGT_AUTH_FAIL_REPORT; - osmo_strlcpy(gsup_msg.imsi, vsub->imsi, sizeof(gsup_msg.imsi)); + OSMO_GSUP_COPY_IMSI(&gsup_msg, vsub->imsi); + return vlr_tx_gsup_message(vsub->vlr, &gsup_msg); } -- To view, visit https://gerrit.osmocom.org/6198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67b482dedfa11237ac21894fc5930039e12434ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:03:52 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 15:03:52 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: decrease logging verbosity for traffic Message-ID: Review at https://gerrit.osmocom.org/6199 TBF: decrease logging verbosity for traffic Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06 --- M src/tbf_dl.cpp M src/tbf_ul.cpp 2 files changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/99/6199/1 diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index e8aec23..0587a4a 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -517,7 +517,7 @@ if (!msg) return; - LOGPTBFDL(this, LOGL_INFO, "Dequeue next LLC (len=%d)\n", msg->len); + LOGPTBFDL(this, LOGL_DEBUG, "Dequeue next LLC (len=%d)\n", msg->len); m_llc.put_frame(msg->data, msg->len); bts->llc_frame_sched(); @@ -599,7 +599,7 @@ if (ar == Encoding::AR_NEED_MORE_BLOCKS) break; - LOGPTBFDL(this, LOGL_INFO, "Complete DL frame, len=%d\n", m_llc.frame_length()); + LOGPTBFDL(this, LOGL_DEBUG, "Complete DL frame, len=%d\n", m_llc.frame_length()); gprs_rlcmac_dl_bw(this, m_llc.frame_length()); bts->llc_dl_bytes(m_llc.frame_length()); m_llc.reset(); diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 1560eb0..46d4d12 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -84,7 +84,7 @@ if (frame->is_complete) { /* send frame to SGSN */ - LOGPTBFUL(this, LOGL_INFO, "complete UL frame len=%d\n", m_llc.frame_length()); + LOGPTBFUL(this, LOGL_DEBUG, "complete UL frame len=%d\n", m_llc.frame_length()); snd_ul_ud(); bts->llc_ul_bytes(m_llc.frame_length()); m_llc.reset(); -- To view, visit https://gerrit.osmocom.org/6199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If43aa9895abf58602556c986a633ff93a6f00b06 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:19:03 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 15:19:03 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn.c: cb_tun_ind: Convert ifelse to switch statement Message-ID: Review at https://gerrit.osmocom.org/6200 ggsn.c: cb_tun_ind: Convert ifelse to switch statement Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 --- M ggsn/ggsn.c 1 file changed, 7 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/00/6200/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index de8090b..37a2fca 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -726,13 +726,15 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; - if (iph->version == 4) { + switch (iph->version) { + case 4: if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; pool = apn->v4.pool; - } else if (iph->version == 6) { + break; + case 6: /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct * ippool_getip() below to match only the leading /64 @@ -740,7 +742,8 @@ dst.len = 8; dst.v6 = ip6h->ip6_dst; pool = apn->v6.pool; - } else { + break; + default: LOGP(DTUN, LOGL_NOTICE, "non-IPv%u packet received from tun\n", iph->version); return -1; } @@ -752,7 +755,7 @@ DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, tun->devname); if (ippool_getip(pool, &ipm, &dst)) { - DEBUGPC(DTUN, " with no PDP contex!!\n"); + DEBUGPC(DTUN, " with no PDP contex! (%s)\n", ); return 0; } DEBUGPC(DTUN, "\n"); -- To view, visit https://gerrit.osmocom.org/6200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:19:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 15:19:04 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx Message-ID: Review at https://gerrit.osmocom.org/6201 ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 --- M ggsn/ggsn.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/01/6201/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 37a2fca..fed8f73 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -725,6 +725,7 @@ struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; + char straddr[INET6_ADDRSTRLEN]; switch (iph->version) { case 4: @@ -755,7 +756,9 @@ DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, tun->devname); if (ippool_getip(pool, &ipm, &dst)) { - DEBUGPC(DTUN, " with no PDP contex! (%s)\n", ); + DEBUGPC(DTUN, " with no PDP contex! (%s)\n", iph->version == 4 ? + inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) : + inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr))); return 0; } DEBUGPC(DTUN, "\n"); -- To view, visit https://gerrit.osmocom.org/6201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:19:04 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 15:19:04 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll ... Message-ID: Review at https://gerrit.osmocom.org/6202 ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll addr Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 --- M ggsn/ggsn.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/02/6202/1 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index fed8f73..caf6151 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -726,6 +726,7 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; char straddr[INET6_ADDRSTRLEN]; + uint8_t pref_offset; switch (iph->version) { case 4: @@ -739,9 +740,12 @@ /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct * ippool_getip() below to match only the leading /64 - * prefix, i.e. the first 8 bytes of the address */ + * prefix, i.e. the first 8 bytes of the address. If the ll addr + * is used, then the match should be done on the trailing 64 + * bits. */ dst.len = 8; - dst.v6 = ip6h->ip6_dst; + pref_offset = IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_dst) ? 8 : 0; + memcpy(&dst.v6, ((uint8_t*)&ip6h->ip6_dst) + pref_offset, 8); pool = apn->v6.pool; break; default: -- To view, visit https://gerrit.osmocom.org/6202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:22:39 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 15:22:39 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6158 to look at the new patch set (#2). ggsn_tests: Add test case to validate packets forwarded vs dropped New dependency is required: titan.ProtocolModules.ICMP It tests that ICMP echo packets can be sent successfully (reply is received or otherwise dest unreachable if routing is not set up correctly during the test). It also tests some cases in which osmo-ggsn is required to drop the packets (eg. unknown src ip unrelated to pdp ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx and vice versa. Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M ggsn_tests/regen_makefile.sh 4 files changed, 262 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/6158/2 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index d8994df..bf82057 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -26,9 +26,11 @@ GGSN_Tests.TC_pdp4_act_deact GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns +GGSN_Tests.TC_pdp4_act_deact_gtpu_access GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 +GGSN_Tests.TC_pdp6_act_deact_gtpu_access GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index f7814db..a982e42 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -10,6 +10,7 @@ import from GTPU_Types all; import from IPCP_Types all; import from IP_Types all; + import from ICMP_Types all; import from ICMPv6_Types all; import from Native_Functions all; @@ -734,6 +735,63 @@ /* IPv6 neighbor solicitation fe80::2 -> ff02::1:ff00:2 from 02:88:b5:1f:25:59 */ const octetstring c_neigh_solicit:= '6000000000203afffe800000000000000000000000000002ff0200000000000000000001ff00000287009f9600000000fe80000000000000000000000000000201010288b51f2559'O; + /* template for an ICMPv6 echo request */ + template PDU_ICMP ts_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := '0000'O, + identifier := '0345'O, + sequence_number := '0001'O, + data := ''O + } + } + + /* template for an ICMPv4 echo reply */ + template PDU_ICMP tr_ICMPv4_ERP(octetstring data := ''O) := { + echo_reply := { + type_field := 0, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := data + } + } + + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMP tr_ICMPv4_DU := { + destination_unreachable := { + type_field := 1, + code := ?, + checksum := ?, + unused := ?, + original_ip_msg := ? + } + } + + /* template to construct IPv4_packet from input arguments, ready for use in f_IPv4_enc() */ + template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, LIN2_BO_LAST tlen, octetstring payload) := { + header := { + ver := 4, + hlen := 5, + tos := 0, + tlen := tlen, + id := 35902, + res := '0'B, + dfrag := '1'B, + mfrag := '0'B, + foffset := 0, + ttl := 64, + proto := proto, + cksum := 0, + srcaddr := srcaddr, + dstaddr := dstaddr + }, + ext_headers := omit, + payload := payload + } + /* template to generate a 'Prefix Information' ICMPv6 option */ template OptionField ts_ICMP6_OptPrefix(OCT16 prefix, INT1 prefix_len) := { prefixInformation := { @@ -747,6 +805,18 @@ preferredLifetime := oct2int('FFFFFFFF'O), reserved2 := '00000000'O, prefix := prefix + } + } + + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 ts_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := '0000'O, + identifier := 0, + sequenceNr := 0, + data := ''O } } @@ -829,6 +899,29 @@ } } + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMPv6 tr_ICMPv6_DU := { + destinationUnreachable := { + typeField := 1, + code := ?, + checksum := ?, + unused := ?, + originalIpMsg := ? + } + } + + /* template for receiving/matching an ICMPv6 echo reply */ + template PDU_ICMPv6 tr_ICMPv6_ERP(octetstring data := ''O) := { + echoReply := { + typeField := 129, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := data + } + } + /* template to construct IPv6_packet from input arguments, ready for use in f_IPv6_enc() */ template IPv6_packet ts_IP6(OCT16 srcaddr, OCT16 dstaddr, LIN1 nexthead, octetstring payload, LIN1 hlim := 255) := { header := { @@ -847,6 +940,21 @@ function f_ipv6_link_local(in OCT16 link_id) return OCT16 { return 'FE80000000000000'O & substr(link_id, 8, 8); + } + + function f_ipv6_global(in OCT16 link_id) return OCT16 { + return substr(link_id, 0, 8) & '1234123412341234'O; + } + + /* Create a new different IPv6 addr from input. Starts mangling at byte prefix. */ + function f_ipv6_mangle(in OCT16 addr, in integer prefix := 0) return OCT16 { + var integer i; + var octetstring res := substr(addr, 0, prefix); + for (i := prefix; i < lengthof(addr); i := i + 1) { + var octetstring a := addr[i] xor4b '11'O; + res := res & a; + } + return res; } /* Compute solicited-node multicast address as per RFC4291 2.7.1 */ @@ -889,6 +997,25 @@ return f_gen_icmpv6_neigh_solicit(link_local, daddr, link_local); } + /* Send an ICMPv4 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv4_echo(OCT4 saddr, OCT4 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + var IPv4_packet ip4 := valueof(ts_IP4(saddr, daddr, 1, 50, tmp)); + var octetstring data := f_IPv4_enc(ip4); + var OCT2 cksum := f_IPv4_checksum(data); + data[10] := cksum[0]; + data[11] := cksum[1]; + return data; + } + + /* Send an ICMPv6 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv6_echo(OCT16 saddr, OCT16 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr, daddr); + var IPv6_packet ip6 := valueof(ts_IP6(saddr, daddr, 58, tmp)); + var octetstring data := f_IPv6_enc(ip6); + return data; + } + /* wait for GGSN to send us an ICMPv6 router advertisement */ function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { var Gtp1uUnitdata ud; @@ -911,6 +1038,62 @@ [] GTPU.receive(tr_GTPU_GPDU(?, ?)) { repeat; } [] GTPU.receive { setverdict(fail); } [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, tr_ICMPv4_ERP()) and not match(icmp4, tr_ICMPv4_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv6_packet ip6 := f_IPv6_dec(gpdu); + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { + repeat; + } + var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); + if (not match(icmp6, tr_ICMPv6_ERP()) and not match(icmp6, tr_ICMPv6_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Assert we don't receive a ICMPv4/6 echo reply (or unreachable) from GTP */ + function f_wait_gtpu_fail(PdpContext ctx) runs on GT_CT { + T_default.start; + alt { + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { } } T_default.stop; } @@ -960,6 +1143,49 @@ f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); f_wait_rtr_adv(ctx); f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv6_DNS); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + var OCT16 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '0003'O); + + /* Check if we can use valid link-local src addr. */ + var OCT16 saddr_ll := f_ipv6_link_local(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_ll, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Check that attempting RA with another ll src addr won't work, packet dropped: */ + var OCT16 saddr_ll_wrong := f_ipv6_mangle(saddr_ll, 8); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_ll_wrong)); + f_wait_gtpu_fail(ctx); + + /* Check if we can use valid global src addr, should work */ + var OCT16 saddr_glob := f_ipv6_global(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_glob, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT16 saddr_wrong := f_ipv6_mangle(saddr_glob); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped) */ + var OCT4 saddr_v4 := f_inet_addr("192.168.10.2"); + var OCT4 daddr_v4 := f_inet_addr("8.8.8.8"); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_v4, daddr_v4)); + f_wait_gtpu_fail(ctx); f_pdp_ctx_del(ctx, '1'B); } @@ -1017,6 +1243,33 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp4_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); + f_pdp_ctx_act(ctx); + + var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); + + /* Check if we can use valid global src addr, should work */ + var OCT4 saddr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr)); + f_wait_icmp4_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT4 saddr_wrong := substr(saddr, 0, 3) & (saddr[3] xor4b '11'O); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv6 RA to APN4, should fail (packet dropped) */ + var OCT16 saddr_v6 := f_inet6_addr("fde4:8dba:82e1:2000:1:2:3:4"); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_v6)); + f_wait_gtpu_fail(ctx); + f_pdp_ctx_del(ctx, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1033,10 +1286,12 @@ execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); + execute(TC_pdp4_act_deact_gtpu_access()) execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_gtpu_access()) execute(TC_echo_req_resp()); } diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 8098f9b..58c681f 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -27,6 +27,10 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.ICMP/src +FILES="ICMP_EncDec.cc ICMP_Types.ttcn" +gen_links $DIR $FILES + DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh index 3970187..2fc74f7 100755 --- a/ggsn_tests/regen_makefile.sh +++ b/ggsn_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc" +FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc ICMP_EncDec.cc" ../regen-makefile.sh GGSN_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:28:52 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 15:28:52 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6158 to look at the new patch set (#3). ggsn_tests: Add test case to validate packets forwarded vs dropped New dependency is required: titan.ProtocolModules.ICMP It tests that ICMP echo packets can be sent successfully (reply is received or otherwise dest unreachable if routing is not set up correctly during the test). It also tests some cases in which osmo-ggsn is required to drop the packets (eg. unknown src ip unrelated to pdp ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx and vice versa. Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M ggsn_tests/regen_makefile.sh 4 files changed, 262 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/6158/3 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index d8994df..bf82057 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -26,9 +26,11 @@ GGSN_Tests.TC_pdp4_act_deact GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns +GGSN_Tests.TC_pdp4_act_deact_gtpu_access GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 +GGSN_Tests.TC_pdp6_act_deact_gtpu_access GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index f7814db..cf6bd79 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -10,6 +10,7 @@ import from GTPU_Types all; import from IPCP_Types all; import from IP_Types all; + import from ICMP_Types all; import from ICMPv6_Types all; import from Native_Functions all; @@ -734,6 +735,63 @@ /* IPv6 neighbor solicitation fe80::2 -> ff02::1:ff00:2 from 02:88:b5:1f:25:59 */ const octetstring c_neigh_solicit:= '6000000000203afffe800000000000000000000000000002ff0200000000000000000001ff00000287009f9600000000fe80000000000000000000000000000201010288b51f2559'O; + /* template for an ICMPv6 echo request */ + template PDU_ICMP ts_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := '0000'O, + identifier := '0345'O, + sequence_number := '0001'O, + data := ''O + } + } + + /* template for an ICMPv4 echo reply */ + template PDU_ICMP tr_ICMPv4_ERP(octetstring data := ''O) := { + echo_reply := { + type_field := 0, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := data + } + } + + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMP tr_ICMPv4_DU := { + destination_unreachable := { + type_field := 1, + code := ?, + checksum := ?, + unused := ?, + original_ip_msg := ? + } + } + + /* template to construct IPv4_packet from input arguments, ready for use in f_IPv4_enc() */ + template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, LIN2_BO_LAST tlen, octetstring payload) := { + header := { + ver := 4, + hlen := 5, + tos := 0, + tlen := tlen, + id := 35902, + res := '0'B, + dfrag := '1'B, + mfrag := '0'B, + foffset := 0, + ttl := 64, + proto := proto, + cksum := 0, + srcaddr := srcaddr, + dstaddr := dstaddr + }, + ext_headers := omit, + payload := payload + } + /* template to generate a 'Prefix Information' ICMPv6 option */ template OptionField ts_ICMP6_OptPrefix(OCT16 prefix, INT1 prefix_len) := { prefixInformation := { @@ -747,6 +805,18 @@ preferredLifetime := oct2int('FFFFFFFF'O), reserved2 := '00000000'O, prefix := prefix + } + } + + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 ts_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := '0000'O, + identifier := 0, + sequenceNr := 0, + data := ''O } } @@ -829,6 +899,29 @@ } } + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMPv6 tr_ICMPv6_DU := { + destinationUnreachable := { + typeField := 1, + code := ?, + checksum := ?, + unused := ?, + originalIpMsg := ? + } + } + + /* template for receiving/matching an ICMPv6 echo reply */ + template PDU_ICMPv6 tr_ICMPv6_ERP(octetstring data := ''O) := { + echoReply := { + typeField := 129, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := data + } + } + /* template to construct IPv6_packet from input arguments, ready for use in f_IPv6_enc() */ template IPv6_packet ts_IP6(OCT16 srcaddr, OCT16 dstaddr, LIN1 nexthead, octetstring payload, LIN1 hlim := 255) := { header := { @@ -847,6 +940,21 @@ function f_ipv6_link_local(in OCT16 link_id) return OCT16 { return 'FE80000000000000'O & substr(link_id, 8, 8); + } + + function f_ipv6_global(in OCT16 link_id) return OCT16 { + return substr(link_id, 0, 8) & '1234123412341234'O; + } + + /* Create a new different IPv6 addr from input. Starts mangling at byte prefix. */ + function f_ipv6_mangle(in OCT16 addr, in integer prefix := 0) return OCT16 { + var integer i; + var octetstring res := substr(addr, 0, prefix); + for (i := prefix; i < lengthof(addr); i := i + 1) { + var octetstring a := addr[i] xor4b '11'O; + res := res & a; + } + return res; } /* Compute solicited-node multicast address as per RFC4291 2.7.1 */ @@ -889,6 +997,25 @@ return f_gen_icmpv6_neigh_solicit(link_local, daddr, link_local); } + /* Send an ICMPv4 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv4_echo(OCT4 saddr, OCT4 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + var IPv4_packet ip4 := valueof(ts_IP4(saddr, daddr, 1, 50, tmp)); + var octetstring data := f_IPv4_enc(ip4); + var OCT2 cksum := f_IPv4_checksum(data); + data[10] := cksum[0]; + data[11] := cksum[1]; + return data; + } + + /* Send an ICMPv6 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv6_echo(OCT16 saddr, OCT16 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr, daddr); + var IPv6_packet ip6 := valueof(ts_IP6(saddr, daddr, 58, tmp)); + var octetstring data := f_IPv6_enc(ip6); + return data; + } + /* wait for GGSN to send us an ICMPv6 router advertisement */ function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { var Gtp1uUnitdata ud; @@ -911,6 +1038,62 @@ [] GTPU.receive(tr_GTPU_GPDU(?, ?)) { repeat; } [] GTPU.receive { setverdict(fail); } [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, tr_ICMPv4_ERP()) and not match(icmp4, tr_ICMPv4_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv6_packet ip6 := f_IPv6_dec(gpdu); + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { + repeat; + } + var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); + if (not match(icmp6, tr_ICMPv6_ERP()) and not match(icmp6, tr_ICMPv6_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Assert we don't receive a ICMPv4/6 echo reply (or unreachable) from GTP */ + function f_wait_gtpu_fail(PdpContext ctx) runs on GT_CT { + T_default.start; + alt { + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { } } T_default.stop; } @@ -960,6 +1143,49 @@ f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); f_wait_rtr_adv(ctx); f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv6_DNS); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + var OCT16 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '0003'O); + + /* Check if we can use valid link-local src addr. */ + var OCT16 saddr_ll := f_ipv6_link_local(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_ll, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Check that attempting RA with another ll src addr won't work, packet dropped: */ + var OCT16 saddr_ll_wrong := f_ipv6_mangle(saddr_ll, 8); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_ll_wrong)); + f_wait_gtpu_fail(ctx); + + /* Check if we can use valid global src addr, should work */ + var OCT16 saddr_glob := f_ipv6_global(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_glob, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT16 saddr_wrong := f_ipv6_mangle(saddr_glob); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped) */ + var OCT4 saddr_v4 := f_inet_addr("192.168.10.2"); + var OCT4 daddr_v4 := f_inet_addr("8.8.8.8"); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_v4, daddr_v4)); + f_wait_gtpu_fail(ctx); f_pdp_ctx_del(ctx, '1'B); } @@ -1017,6 +1243,33 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp4_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); + f_pdp_ctx_act(ctx); + + var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); + + /* Check if we can use valid global src addr, should work */ + var OCT4 saddr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr)); + f_wait_icmp4_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT4 saddr_wrong := substr(saddr, 0, 3) & (saddr[3] xor4b '11'O); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv6 RA to APN4, should fail (packet dropped) */ + var OCT16 saddr_v6 := f_inet6_addr("fde4:8dba:82e1:2000:1:2:3:4"); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_v6)); + f_wait_gtpu_fail(ctx); + f_pdp_ctx_del(ctx, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1033,10 +1286,12 @@ execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); + execute(TC_pdp4_act_deact_gtpu_access()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_gtpu_access()); execute(TC_echo_req_resp()); } diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 8098f9b..58c681f 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -27,6 +27,10 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.ICMP/src +FILES="ICMP_EncDec.cc ICMP_Types.ttcn" +gen_links $DIR $FILES + DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh index 3970187..2fc74f7 100755 --- a/ggsn_tests/regen_makefile.sh +++ b/ggsn_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc" +FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc ICMP_EncDec.cc" ../regen-makefile.sh GGSN_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 3 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:30:31 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:30:31 +0000 Subject: [PATCH] osmo-bsc[master]: abis-rsl: Send imm.ass messages via PCH Message-ID: Review at https://gerrit.osmocom.org/6203 abis-rsl: Send imm.ass messages via PCH It is possible to send immidiate assign messages through the paging channel. This commit adds the required functionality to the pcu socket interface and to the abis_rsl api Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 --- M include/osmocom/bsc/abis_rsl.h M include/osmocom/bsc/pcuif_proto.h M src/libbsc/abis_rsl.c M src/libbsc/pcu_sock.c 4 files changed, 61 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/03/6203/1 diff --git a/include/osmocom/bsc/abis_rsl.h b/include/osmocom/bsc/abis_rsl.h index b30702f..ae80879 100644 --- a/include/osmocom/bsc/abis_rsl.h +++ b/include/osmocom/bsc/abis_rsl.h @@ -60,7 +60,11 @@ int rsl_relase_request(struct gsm_lchan *lchan, uint8_t link_id); /* Ericcson vendor specific RSL extensions */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val); +int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val, + uint32_t tlli); +int rsl_ericsson_imm_assign_via_pch_cmd(struct gsm_bts *bts, uint8_t len, + uint8_t *val, uint32_t tlli, + uint8_t pag_grp); /* Siemens vendor-specific RSL extensions */ int rsl_siemens_mrpci(struct gsm_lchan *lchan, struct rsl_mrpci *mrpci); diff --git a/include/osmocom/bsc/pcuif_proto.h b/include/osmocom/bsc/pcuif_proto.h index eb28d66..0dbb6c2 100644 --- a/include/osmocom/bsc/pcuif_proto.h +++ b/include/osmocom/bsc/pcuif_proto.h @@ -23,7 +23,7 @@ #define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ #define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ #define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ -#define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on AGCH but with additional TLLI */ +#define PCU_IF_SAPI_AGCH_DT 0x08 /* assignment on PCH or AGCH but with additional TLLI */ /* flags */ #define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ @@ -61,6 +61,7 @@ struct gsm_pcu_if_data_cnf_dt { uint8_t sapi; uint32_t tlli; + uint8_t imsi[3]; uint32_t fn; uint16_t arfcn; uint8_t trx_nr; diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index eced0e2..de39f95 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1095,17 +1095,42 @@ return abis_rsl_sendmsg(msg); } -/* Chapter 8.5.6 */ -int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint32_t tlli, uint8_t len, uint8_t *val) +/* Append mobile idenitiy (tlli) to message buffer */ +static void rsl_ericsson_put_mi(struct msgb *msg, uint32_t tlli) +{ + /* NOTE: ericsson can handle a reference at the end of the message which is used in + * the confirm message. The confirm message is only sent if the trailer is present */ + msgb_put_u8(msg, RSL_IE_ERIC_MOBILE_ID); + msgb_put_u32(msg, tlli); +} + +/* Chapter 8.5.6 (Ericcson vendor specific RSL extension) */ +int rsl_ericsson_imm_assign_cmd(struct gsm_bts *bts, uint8_t len, uint8_t *val, + uint32_t tlli) { struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val); if (!msg) return 1; - /* ericsson can handle a reference at the end of the message which is used in - * the confirm message. The confirm message is only sent if the trailer is present */ - msgb_put_u8(msg, RSL_IE_ERIC_MOBILE_ID); - msgb_put_u32(msg, tlli); + /* Append ericsson propritary mobile identity field */ + rsl_ericsson_put_mi(msg, tlli); + + return abis_rsl_sendmsg(msg); +} + +/* Chapter 8.5.6 (Ericcson vendor specific RSL extension) */ +int rsl_ericsson_imm_assign_via_pch_cmd(struct gsm_bts *bts, uint8_t len, + uint8_t *val, uint32_t tlli, + uint8_t pag_grp) +{ + struct msgb *msg = rsl_imm_assign_cmd_common(bts, len, val); + + /* Append ericsson propritary paging group field */ + msgb_put_u8(msg, 0x0e); + msgb_put_u8(msg, pag_grp); + + /* Append ericsson propritary mobile identity field */ + rsl_ericsson_put_mi(msg, tlli); return abis_rsl_sendmsg(msg); } diff --git a/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c index 9f1c80c..88867af 100644 --- a/src/libbsc/pcu_sock.c +++ b/src/libbsc/pcu_sock.c @@ -325,9 +325,9 @@ mi_len = p1->data[0]; mi = p1->data+1; LOGP(DPCU, LOGL_ERROR, "PCU Sends paging " - "request type %02x (chan_needed=%02x, mi_len=%u, mi=%s)\n", + "request type %02x (chan_needed=0x%02x, mi_len=%u, mi=%s, paging_group=0x%02x)\n", p1->msg_type, chan_needed, mi_len, - osmo_hexdump_nospc(mi,mi_len)); + osmo_hexdump_nospc(mi,mi_len), paging_group); /* NOTE: We will have to add 2 to mi_len and subtract 2 from * the mi pointer because rsl_paging_cmd() will perform the * reverse operations. This is because rsl_paging_cmd() is @@ -389,6 +389,7 @@ msg->l3h = msgb_put(msg, data_req->len); memcpy(msg->l3h, data_req->data, data_req->len); + LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via AGCH\n"); if (rsl_imm_assign_cmd(bts, msg->len, msg->data)) { msgb_free(msg); rc = -EIO; @@ -404,18 +405,29 @@ } tlli = *((uint32_t *)data_req->data); - msg = msgb_alloc(data_req->len - 4, "pcu_agch"); + /* the first three bytes are the last three digits of + * the IMSI, which we need to compute the paging group */ + imsi_digit_buf[0] = data_req->data[4]; + imsi_digit_buf[1] = data_req->data[5]; + imsi_digit_buf[2] = data_req->data[6]; + imsi_digit_buf[3] = '\0'; + pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, + str_to_imsi(imsi_digit_buf)); + + msg = msgb_alloc(data_req->len - 7, "pcu_pch"); if (!msg) { rc = -ENOMEM; break; } - msg->l3h = msgb_put(msg, data_req->len - 4); - memcpy(msg->l3h, data_req->data + 4, data_req->len - 4); + msg->l3h = msgb_put(msg, data_req->len - 7); + memcpy(msg->l3h, data_req->data + 7, data_req->len - 7); - if (bts->type == GSM_BTS_TYPE_RBS2000) - rc = rsl_ericsson_imm_assign_cmd(bts, tlli, msg->len, msg->data); - else - rc = rsl_imm_assign_cmd(bts, msg->len, msg->data); + LOGP(DPCU, LOGL_DEBUG, "PCU Sends immediate assignment via PCH (tlli=0x%08x, pag_grp=0x%02x)\n", + tlli, pag_grp); + if (bts->type == GSM_BTS_TYPE_RBS2000) { + rc = rsl_ericsson_imm_assign_via_pch_cmd(bts, msg->len, msg->data, tlli, pag_grp); + } else + LOGP(DPCU, LOGL_ERROR, "This BTS does not support immediate via PCH, dropping message!\n"); if (rc) { msgb_free(msg); @@ -423,8 +435,8 @@ } break; default: - LOGP(DPCU, LOGL_ERROR, "Received PCU data request with " - "unsupported sapi %d\n", data_req->sapi); + LOGP(DPCU, LOGL_ERROR, "Received PCU data request for " + "unsupported channel (sapi=%d)\n", data_req->sapi); rc = -EINVAL; } -- To view, visit https://gerrit.osmocom.org/6203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:30:35 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:30:35 +0000 Subject: [PATCH] osmo-bsc[master]: pcu_sock: reorganize calculation of paging group Message-ID: Review at https://gerrit.osmocom.org/6204 pcu_sock: reorganize calculation of paging group pcu_sock.c:pcu_rx_data_req() needs to calculate the paging group at two positions, this commit adds a functions for that to avoid code duplication Change-Id: Iee8926d5bc017d912912916e4898e968bf4dd29b --- M src/libbsc/pcu_sock.c 1 file changed, 23 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/04/6204/1 diff --git a/src/libbsc/pcu_sock.c b/src/libbsc/pcu_sock.c index 88867af..bfb9c7b 100644 --- a/src/libbsc/pcu_sock.c +++ b/src/libbsc/pcu_sock.c @@ -353,11 +353,30 @@ return rc; } +/* Helper function for pcu_rx_data_req() to extract paging group info */ +static uint8_t extract_paging_group(struct gsm_bts *bts, uint8_t *data) +{ + char imsi_digit_buf[4]; + uint8_t pag_grp; + + /* the first three bytes are the last three digits of + * the IMSI, which we need to compute the paging group */ + imsi_digit_buf[0] = data[0]; + imsi_digit_buf[1] = data[1]; + imsi_digit_buf[2] = data[2]; + imsi_digit_buf[3] = '\0'; + + pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, + str_to_imsi(imsi_digit_buf)); + + return pag_grp; +} + + static int pcu_rx_data_req(struct gsm_bts *bts, uint8_t msg_type, struct gsm_pcu_if_data *data_req) { struct msgb *msg; - char imsi_digit_buf[4]; uint32_t tlli = -1; uint8_t pag_grp; int rc = 0; @@ -369,15 +388,7 @@ switch (data_req->sapi) { case PCU_IF_SAPI_PCH: - /* the first three bytes are the last three digits of - * the IMSI, which we need to compute the paging group */ - imsi_digit_buf[0] = data_req->data[0]; - imsi_digit_buf[1] = data_req->data[1]; - imsi_digit_buf[2] = data_req->data[2]; - imsi_digit_buf[3] = '\0'; - LOGP(DPCU, LOGL_DEBUG, "SAPI PCH imsi %s\n", imsi_digit_buf); - pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, - str_to_imsi(imsi_digit_buf)); + pag_grp = extract_paging_group(bts,data_req->data); pcu_rx_rr_paging(bts, pag_grp, data_req->data+3); break; case PCU_IF_SAPI_AGCH: @@ -403,16 +414,9 @@ "invalid/small length %d\n", data_req->len); break; } - tlli = *((uint32_t *)data_req->data); - /* the first three bytes are the last three digits of - * the IMSI, which we need to compute the paging group */ - imsi_digit_buf[0] = data_req->data[4]; - imsi_digit_buf[1] = data_req->data[5]; - imsi_digit_buf[2] = data_req->data[6]; - imsi_digit_buf[3] = '\0'; - pag_grp = gsm0502_calc_paging_group(&bts->si_common.chan_desc, - str_to_imsi(imsi_digit_buf)); + memcpy(&tlli, data_req->data, sizeof(tlli)); + pag_grp = extract_paging_group(bts,data_req->data+4); msg = msgb_alloc(data_req->len - 7, "pcu_pch"); if (!msg) { -- To view, visit https://gerrit.osmocom.org/6204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iee8926d5bc017d912912916e4898e968bf4dd29b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:31:13 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:31:13 +0000 Subject: [ABANDON] openbsc[master]: pcu_sock: reorganize calculation of paging group In-Reply-To: References: Message-ID: lynxis lazus has abandoned this change. Change subject: pcu_sock: reorganize calculation of paging group ...................................................................... Abandoned abondon in favor of the osmo-bsc patch set https://gerrit.osmocom.org/#/c/6204/ -- To view, visit https://gerrit.osmocom.org/2067 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Iee8926d5bc017d912912916e4898e968bf4dd29b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:31:33 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:31:33 +0000 Subject: [ABANDON] openbsc[master]: abis-rsl: Send imm.ass messages via PCH In-Reply-To: References: Message-ID: lynxis lazus has abandoned this change. Change subject: abis-rsl: Send imm.ass messages via PCH ...................................................................... Abandoned abandon in favor of the osmo-bsc patch set https://gerrit.osmocom.org/#/c/6203/ -- To view, visit https://gerrit.osmocom.org/2066 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:33:22 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:33:22 +0000 Subject: osmo-bsc[master]: abis-rsl: Send imm.ass messages via PCH In-Reply-To: References: Message-ID: Patch Set 1: https://gerrit.osmocom.org/#/c/2066/ missing TODO: openbsc/include/openbsc/pcuif_proto.h Line 64: this changes the layout of the PCU socket interface protocol, and hence should be accompaned by a version increment in the pcu interface protocol to ensure both sides of the socket have a common understanding. -- To view, visit https://gerrit.osmocom.org/6203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:33:52 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:33:52 +0000 Subject: osmo-bsc[master]: pcu_sock: reorganize calculation of paging group In-Reply-To: References: Message-ID: Patch Set 1: original review: https://gerrit.osmocom.org/#/c/2067/1 -- To view, visit https://gerrit.osmocom.org/6204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee8926d5bc017d912912916e4898e968bf4dd29b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:34:57 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:34:57 +0000 Subject: osmo-bsc[master]: abis-rsl: Send imm.ass messages via PCH In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6203/1/src/libbsc/abis_rsl.c File src/libbsc/abis_rsl.c: Line 1129: msgb_put_u8(msg, 0x0e); create a define for this field -- To view, visit https://gerrit.osmocom.org/6203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 15:38:06 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 15:38:06 +0000 Subject: osmo-bsc[master]: abis-rsl: Send imm.ass messages via PCH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 PCU protocol needs to be increased. -- To view, visit https://gerrit.osmocom.org/6203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 16:21:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 16:21:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6158 to look at the new patch set (#4). ggsn_tests: Add test case to validate packets forwarded vs dropped New dependency is required: titan.ProtocolModules.ICMP It tests that ICMP echo packets can be sent successfully (reply is received or otherwise dest unreachable if routing is not set up correctly during the test). It also tests some cases in which osmo-ggsn is required to drop the packets (eg. unknown src ip unrelated to pdp ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx and vice versa. Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M ggsn_tests/regen_makefile.sh 4 files changed, 262 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/6158/4 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index d8994df..bf82057 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -26,9 +26,11 @@ GGSN_Tests.TC_pdp4_act_deact GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns +GGSN_Tests.TC_pdp4_act_deact_gtpu_access GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 +GGSN_Tests.TC_pdp6_act_deact_gtpu_access GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index f7814db..aa20f25 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -10,6 +10,7 @@ import from GTPU_Types all; import from IPCP_Types all; import from IP_Types all; + import from ICMP_Types all; import from ICMPv6_Types all; import from Native_Functions all; @@ -734,6 +735,63 @@ /* IPv6 neighbor solicitation fe80::2 -> ff02::1:ff00:2 from 02:88:b5:1f:25:59 */ const octetstring c_neigh_solicit:= '6000000000203afffe800000000000000000000000000002ff0200000000000000000001ff00000287009f9600000000fe80000000000000000000000000000201010288b51f2559'O; + /* template for an ICMPv6 echo request */ + template PDU_ICMP ts_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := '0000'O, + identifier := '0345'O, + sequence_number := '0001'O, + data := ''O + } + } + + /* template for an ICMPv4 echo reply */ + template PDU_ICMP tr_ICMPv4_ERP(octetstring data := ''O) := { + echo_reply := { + type_field := 0, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := data + } + } + + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMP tr_ICMPv4_DU := { + destination_unreachable := { + type_field := 1, + code := ?, + checksum := ?, + unused := ?, + original_ip_msg := ? + } + } + + /* template to construct IPv4_packet from input arguments, ready for use in f_IPv4_enc() */ + template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, LIN2_BO_LAST tlen, octetstring payload) := { + header := { + ver := 4, + hlen := 5, + tos := 0, + tlen := tlen, + id := 35902, + res := '0'B, + dfrag := '1'B, + mfrag := '0'B, + foffset := 0, + ttl := 64, + proto := proto, + cksum := 0, + srcaddr := srcaddr, + dstaddr := dstaddr + }, + ext_headers := omit, + payload := payload + } + /* template to generate a 'Prefix Information' ICMPv6 option */ template OptionField ts_ICMP6_OptPrefix(OCT16 prefix, INT1 prefix_len) := { prefixInformation := { @@ -747,6 +805,18 @@ preferredLifetime := oct2int('FFFFFFFF'O), reserved2 := '00000000'O, prefix := prefix + } + } + + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 ts_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := '0000'O, + identifier := 0, + sequenceNr := 0, + data := ''O } } @@ -829,6 +899,29 @@ } } + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMPv6 tr_ICMPv6_DU := { + destinationUnreachable := { + typeField := 1, + code := ?, + checksum := ?, + unused := ?, + originalIpMsg := ? + } + } + + /* template for receiving/matching an ICMPv6 echo reply */ + template PDU_ICMPv6 tr_ICMPv6_ERP(octetstring data := ''O) := { + echoReply := { + typeField := 129, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := data + } + } + /* template to construct IPv6_packet from input arguments, ready for use in f_IPv6_enc() */ template IPv6_packet ts_IP6(OCT16 srcaddr, OCT16 dstaddr, LIN1 nexthead, octetstring payload, LIN1 hlim := 255) := { header := { @@ -847,6 +940,21 @@ function f_ipv6_link_local(in OCT16 link_id) return OCT16 { return 'FE80000000000000'O & substr(link_id, 8, 8); + } + + function f_ipv6_global(in OCT16 link_id) return OCT16 { + return substr(link_id, 0, 8) & '1234123412341234'O; + } + + /* Create a new different IPv6 addr from input. Starts mangling at byte prefix. */ + function f_ipv6_mangle(in OCT16 addr, in integer prefix := 0) return OCT16 { + var integer i; + var octetstring res := substr(addr, 0, prefix); + for (i := prefix; i < lengthof(addr); i := i + 1) { + var octetstring a := addr[i] xor4b '11'O; + res := res & a; + } + return res; } /* Compute solicited-node multicast address as per RFC4291 2.7.1 */ @@ -889,6 +997,25 @@ return f_gen_icmpv6_neigh_solicit(link_local, daddr, link_local); } + /* Send an ICMPv4 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv4_echo(OCT4 saddr, OCT4 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + var IPv4_packet ip4 := valueof(ts_IP4(saddr, daddr, 1, 50, tmp)); + var octetstring data := f_IPv4_enc(ip4); + var OCT2 cksum := f_IPv4_checksum(data); + data[10] := cksum[0]; + data[11] := cksum[1]; + return data; + } + + /* Send an ICMPv6 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv6_echo(OCT16 saddr, OCT16 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr, daddr); + var IPv6_packet ip6 := valueof(ts_IP6(saddr, daddr, 58, tmp)); + var octetstring data := f_IPv6_enc(ip6); + return data; + } + /* wait for GGSN to send us an ICMPv6 router advertisement */ function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { var Gtp1uUnitdata ud; @@ -911,6 +1038,62 @@ [] GTPU.receive(tr_GTPU_GPDU(?, ?)) { repeat; } [] GTPU.receive { setverdict(fail); } [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv4 echo reply (or unreachable) from GTP */ + function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, tr_ICMPv4_ERP()) and not match(icmp4, tr_ICMPv4_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv6_packet ip6 := f_IPv6_dec(gpdu); + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { + repeat; + } + var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); + if (not match(icmp6, tr_ICMPv6_ERP()) and not match(icmp6, tr_ICMPv6_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Assert we don't receive a ICMPv4/6 echo reply (or unreachable) from GTP */ + function f_wait_gtpu_fail(PdpContext ctx) runs on GT_CT { + T_default.start; + alt { + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { } } T_default.stop; } @@ -960,6 +1143,49 @@ f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); f_wait_rtr_adv(ctx); f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv6_DNS); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + var OCT16 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '0003'O); + + /* Check if we can use valid link-local src addr. */ + var OCT16 saddr_ll := f_ipv6_link_local(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_ll, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Check that attempting RA with another ll src addr won't work, packet dropped: */ + var OCT16 saddr_ll_wrong := f_ipv6_mangle(saddr_ll, 8); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_ll_wrong)); + f_wait_gtpu_fail(ctx); + + /* Check if we can use valid global src addr, should work */ + var OCT16 saddr_glob := f_ipv6_global(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_glob, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT16 saddr_wrong := f_ipv6_mangle(saddr_glob); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped) */ + var OCT4 saddr_v4 := f_inet_addr("192.168.10.2"); + var OCT4 daddr_v4 := f_inet_addr("8.8.8.8"); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_v4, daddr_v4)); + f_wait_gtpu_fail(ctx); f_pdp_ctx_del(ctx, '1'B); } @@ -1017,6 +1243,33 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp4_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); + f_pdp_ctx_act(ctx); + + var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); + + /* Check if we can use valid global src addr, should work */ + var OCT4 saddr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr)); + f_wait_icmp4_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT4 saddr_wrong := substr(saddr, 0, 3) & (saddr[3] xor4b '11'O); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv6 RA to APN4, should fail (packet dropped) */ + var OCT16 saddr_v6 := f_inet6_addr("fde4:8dba:82e1:2000:1:2:3:4"); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_v6)); + f_wait_gtpu_fail(ctx); + f_pdp_ctx_del(ctx, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1033,10 +1286,12 @@ execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); + execute(TC_pdp4_act_deact_gtpu_access()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_gtpu_access()); execute(TC_echo_req_resp()); } diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 8098f9b..58c681f 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -27,6 +27,10 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.ICMP/src +FILES="ICMP_EncDec.cc ICMP_Types.ttcn" +gen_links $DIR $FILES + DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh index 3970187..2fc74f7 100755 --- a/ggsn_tests/regen_makefile.sh +++ b/ggsn_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc" +FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc ICMP_EncDec.cc" ../regen-makefile.sh GGSN_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 16:21:45 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 16:21:45 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test to validate if different pdp ctx can ta... Message-ID: Review at https://gerrit.osmocom.org/6205 ggsn_tests: Add test to validate if different pdp ctx can talk each other It seems due to the current network configuration, pdp v4 ctx can talk each other while pdp v6 ctx cannot. Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 121 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/6205/1 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index bf82057..67fcbd4 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -27,10 +27,12 @@ GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns GGSN_Tests.TC_pdp4_act_deact_gtpu_access +GGSN_Tests.TC_pdp6_clients_interact GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 GGSN_Tests.TC_pdp6_act_deact_gtpu_access +GGSN_Tests.TC_pdp4_clients_interact GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index aa20f25..03437be 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -747,6 +747,18 @@ } } + /* template for an ICMPv6 echo request */ + template PDU_ICMP tr_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := ? + } + } + /* template for an ICMPv4 echo reply */ template PDU_ICMP tr_ICMPv4_ERP(octetstring data := ''O) := { echo_reply := { @@ -910,6 +922,18 @@ } } + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 tr_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := ? + } + } + /* template for receiving/matching an ICMPv6 echo reply */ template PDU_ICMPv6 tr_ICMPv6_ERP(octetstring data := ''O) := { echoReply := { @@ -1042,6 +1066,30 @@ T_default.stop; } + + /* Wait to ICMPv4 echo request from GTP */ + function f_wait_icmp4_echo_request(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, tr_ICMPv4_ERQ)) { + repeat; + } + log("Received echo resquest"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + /* Wait to ICMPv4 echo reply (or unreachable) from GTP */ function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { var Gtp1uUnitdata ud; @@ -1055,6 +1103,29 @@ } var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); if (not match(icmp4, tr_ICMPv4_ERP()) and not match(icmp4, tr_ICMPv4_DU)) { + repeat; + } + log("Received echo response"); + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait to ICMPv6 echo request from GTP */ + function f_wait_icmp6_echo_request(PdpContext ctx) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv6_packet ip6 := f_IPv6_dec(gpdu); + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { + repeat; + } + var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); + if (not match(icmp6, tr_ICMPv6_ERQ)) { repeat; } log("Received echo response"); @@ -1190,6 +1261,37 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Validate if different clients (pdp ctx) can reach one another through GGSN. */ + testcase TC_pdp6_clients_interact() runs on GT_CT { + f_init(); + var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + f_pdp_ctx_act(ctxA); + f_send_gtpu(ctxA, f_icmpv6_rs_for_pdp(ctxA)); + f_wait_rtr_adv(ctxA); + f_send_gtpu(ctxA, f_gen_icmpv6_neigh_solicit_for_pdp(ctxA)); + + f_pdp_ctx_act(ctxB); + f_send_gtpu(ctxB, f_icmpv6_rs_for_pdp(ctxB)); + f_wait_rtr_adv(ctxB); + f_send_gtpu(ctxB, f_gen_icmpv6_neigh_solicit_for_pdp(ctxB)); + + var OCT16 addrA_ll := f_ipv6_link_local(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrB_ll := f_ipv6_link_local(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrA_glob := f_ipv6_global(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrB_glob := f_ipv6_global(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + + /* Validate if clients can interact using ll addr. */ + f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_ll, addrB_ll)); + f_wait_gtpu_fail(ctxB); + + /* Validate if clients can interact using global addr. */ + f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_glob, addrB_glob)); + f_wait_gtpu_fail(ctxB); + + f_pdp_ctx_del(ctxA, '1'B); + } + /* Test PDP context activation for dynamic IPv4 EUA without DNS request */ testcase TC_pdp4_act_deact() runs on GT_CT { f_init(); @@ -1270,6 +1372,21 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Validate if different clients (pdp ctx) can reach one another through GGSN. */ + testcase TC_pdp4_clients_interact() runs on GT_CT { + f_init(); + var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + f_pdp_ctx_act(ctxA); + f_pdp_ctx_act(ctxB); + var OCT4 addrA := ctxA.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + var OCT4 addrB := ctxB.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctxA, f_gen_icmpv4_echo(addrA, addrB)); + f_wait_icmp4_echo_request(ctxB); + + f_pdp_ctx_del(ctxA, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1287,11 +1404,13 @@ execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); execute(TC_pdp4_act_deact_gtpu_access()); + execute(TC_pdp4_clients_interact()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); execute(TC_pdp6_act_deact_gtpu_access()); + execute(TC_pdp6_clients_interact()); execute(TC_echo_req_resp()); } -- To view, visit https://gerrit.osmocom.org/6205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Tue Jan 30 16:46:06 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 16:46:06 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: add helpers for assignment type handling Message-ID: Review at https://gerrit.osmocom.org/6206 TBF: add helpers for assignment type handling * add function to set/unset given assignment type * log assignment type flag changes * update tests output with additional logs This enables us to carefully track the TBF assignment type transitions. Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4 Related: OS#1759 --- M src/bts.cpp M src/tbf.h M src/tbf_dl.cpp M tests/tbf/TbfTest.err 4 files changed, 86 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/6206/1 diff --git a/src/bts.cpp b/src/bts.cpp index 1669739..9d913c1 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -759,7 +759,7 @@ } else { tbf->set_ta(ta); TBF_SET_STATE(tbf, GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + TBF_ASS_TYPE_SET(tbf, GPRS_RLCMAC_FLAG_CCCH); T_START(tbf, T3169, m_bts.t3169, 0, "RACH (new UL-TBF)", true); LOGPTBF(tbf, LOGL_DEBUG, "[UPLINK] START\n"); LOGPTBF(tbf, LOGL_DEBUG, "RX: [PCU <- BTS] RACH " @@ -1042,7 +1042,7 @@ LOGPTBF(new_tbf, LOGL_INFO, "The TBF has been confirmed on the PACCH, " "changed type from CCCH to PACCH\n"); - new_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + TBF_ASS_TYPE_SET(new_tbf, GPRS_RLCMAC_FLAG_PACCH); } TBF_SET_STATE(new_tbf, GPRS_RLCMAC_FLOW); /* stop pending assignment timer */ diff --git a/src/tbf.h b/src/tbf.h index 803ea33..2ed63f9 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -191,6 +191,8 @@ #define TBF_POLL_SCHED_SET(t) do { t->poll_sched_set(__FILE__, __LINE__); } while(0) #define TBF_POLL_SCHED_UNSET(t) do { t->poll_sched_unset(__FILE__, __LINE__); } while(0) #define TBF_SET_ASS_ON(t, fl, chk) do { t->set_assigned_on(fl, chk, __FILE__, __LINE__); } while(0) +#define TBF_ASS_TYPE_SET(t, kind) do { t->ass_type_mod(kind, false, __FILE__, __LINE__); } while(0) +#define TBF_ASS_TYPE_UNSET(t, kind) do { t->ass_type_mod(kind, true, __FILE__, __LINE__); } while(0) struct gprs_rlcmac_tbf { gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir); @@ -213,6 +215,7 @@ void check_pending_ass(); bool check_n_clear(uint8_t state_flag); void set_assigned_on(uint8_t state_flag, bool check_ccch, const char *file, int line); + void ass_type_mod(uint8_t t, bool unset, const char *file, int line); const char *state_name() const; const char *name() const; @@ -422,11 +425,57 @@ set_state(GPRS_RLCMAC_ASSIGN, file, line); if (check_ccch) { if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) - state_flags |= (1 << state_flag); + ass_type_mod(state_flag, false, file, line); } else state_flags |= (1 << state_flag); } +inline void gprs_rlcmac_tbf::ass_type_mod(uint8_t t, bool unset, const char *file, int line) +{ + const char *ch = "UNKNOWN"; + switch (t) { + case GPRS_RLCMAC_FLAG_CCCH: + if (unset) { + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH))) + return; + } else { + if (state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)) + LOGPSRC(DTBF, LOGL_ERROR, file, line, + "%s attempted to set ass. type CCCH which is already set.\n", + tbf_name(this)); + } + ch = "CCCH"; + break; + case GPRS_RLCMAC_FLAG_PACCH: + if (unset) { + if (!(state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH))) + return; + } else { + if (state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH)) + LOGPSRC(DTBF, LOGL_ERROR, file, line, + "%s attempted to set ass. type PACCH which is already set.\n", + tbf_name(this)); + } + ch = "PACCH"; + break; + default: + LOGPSRC(DTBF, LOGL_ERROR, file, line, "%s attempted to %sset unexpected ass. type %d - FIXME!\n", + tbf_name(this), unset ? "un" : "", t); + return; + } + + LOGPSRC(DTBF, LOGL_INFO, file, line, "%s %sset ass. type %s [prev CCCH:%u, PACCH:%u]\n", + tbf_name(this), unset ? "un" : "", ch, + state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH), + state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH)); + + if (unset) { + state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; /* keep to flags */ + state_flags &= ~(1 << t); + } else + state_flags |= (1 << t); +} + inline void gprs_rlcmac_tbf::set_state(enum gprs_rlcmac_tbf_state new_state, const char *file, int line) { LOGPSRC(DTBF, LOGL_DEBUG, file, line, "%s changes state from %s to %s\n", diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 0587a4a..dc4fa6a 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1104,9 +1104,7 @@ m_wait_confirm = 0; m_window.reset(); - /* keep to flags */ - state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + TBF_ASS_TYPE_UNSET(this, GPRS_RLCMAC_FLAG_CCCH); return 0; } @@ -1132,9 +1130,7 @@ /* reset rlc states */ m_window.reset(); - /* keep to flags */ - state_flags &= GPRS_RLCMAC_FLAG_TO_MASK; - state_flags &= ~(1 << GPRS_RLCMAC_FLAG_CCCH); + TBF_ASS_TYPE_UNSET(this, GPRS_RLCMAC_FLAG_CCCH); return 0; } diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index d207a1d..dd1c9e4 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -107,6 +107,7 @@ TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) exists TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes state from WAIT RELEASE to RELEASING @@ -194,6 +195,7 @@ TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) exists TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_WAIT_ACK to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_SEND_ASS to GPRS_RLCMAC_DL_ASS_NONE TBF(TFI=1 TLLI=0xffeeddcc DIR=DL STATE=ASSIGN) changes state from ASSIGN to RELEASING @@ -1363,6 +1365,7 @@ Modifying MS object, TLLI = 0xc0123456, TA 220 -> 0 TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) appending 19 bytes TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=ASSIGN) changes state from ASSIGN to RELEASING +TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING) unset ass. type CCCH [prev CCCH:1, PACCH:0] TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING) free PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING), 0 TBFs, USFs = 00, TFIs = 00000000. Detaching TBF from MS object, TLLI = 0xc0123456, TBF = TBF(TFI=0 TLLI=0xc0123456 DIR=DL STATE=RELEASING) @@ -1442,6 +1445,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) @@ -1568,6 +1572,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 4 bytes MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: @@ -1646,6 +1651,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 10 bytes Old MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 1 @@ -1840,6 +1846,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 20 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 20 bytes @@ -1918,6 +1925,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. Got CS-1 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=184 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) @@ -2005,6 +2013,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 20 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 20 bytes @@ -2037,6 +2046,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) @@ -2149,6 +2159,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 13 bytes TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) appending 13 bytes @@ -2780,12 +2791,13 @@ TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=NULL) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) exists TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=NULL) changes state from NULL to ASSIGN +TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=1 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. Received RTS for PDCH: TRX=0 TS=7 FN=2654400 block_nr=2 scheduling USF=0 for required uplink resource of UL TFI=0 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) Scheduled DL Assignment polling on UNKNOWN (FN=2654413, TS=7) +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) Scheduled DL Assignment polling on PACCH (FN=2654413, TS=7) Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) (TRX=0, TS=7) +++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ ------------------------- RX : Uplink Control Block ------------------------- @@ -3169,6 +3181,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes MS requests UL TBF on RACH, so we provide one: ra=0x73 Fn=2654167 qta=31 is_11bit=0: @@ -3388,6 +3401,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes Searching for first unallocated TFI: TRX=0 @@ -5887,6 +5901,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes ********** DL-TBF starts here ********** @@ -6041,6 +6056,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes Searching for first unallocated TFI: TRX=0 @@ -6102,6 +6118,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) @@ -6126,6 +6143,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) @@ -6150,6 +6168,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) @@ -6174,6 +6193,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) @@ -6198,6 +6218,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) @@ -6222,6 +6243,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) @@ -6246,6 +6268,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) @@ -6927,6 +6950,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) changes DL ASS state from GPRS_RLCMAC_DL_ASS_NONE to GPRS_RLCMAC_DL_ASS_SEND_ASS TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) set ass. type PACCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer T0 [assignment (PACCH)] with 2 sec. 0 microsec. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) appending 256 bytes Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 @@ -7715,6 +7739,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) @@ -7739,6 +7764,7 @@ TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) @@ -7763,6 +7789,7 @@ TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) @@ -7787,6 +7814,7 @@ TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) @@ -7811,6 +7839,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) @@ -7835,6 +7864,7 @@ TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) @@ -7859,6 +7889,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) set ass. type CCCH [prev CCCH:0, PACCH:0] TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer T3169 [RACH (new UL-TBF)] with 0 sec. 0 microsec. TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) -- To view, visit https://gerrit.osmocom.org/6206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3fe9d52472be8b7f257e8326b2f84e8e7d7bd1f4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 16:50:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 16:50:42 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: show assignment kind in vty Message-ID: Review at https://gerrit.osmocom.org/6207 TBF: show assignment kind in vty Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93 Related: OS#1759 --- M src/pcu_vty_functions.cpp 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/6207/1 diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index eb15aa6..31fffa9 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -49,9 +49,11 @@ tbf->ta(), tbf->direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL", tbf->imsi(), VTY_NEWLINE); - vty_out(vty, " created=%lu state=%08x 1st_TS=%d 1st_cTS=%d ctrl_TS=%d " - "MS_CLASS=%d/%d%s", - tbf->created_ts(), tbf->state_flags, tbf->first_ts, + vty_out(vty, " created=%lu state=%08x [CCCH:%u, PACCH:%u] 1st_TS=%d 1st_cTS=%d ctrl_TS=%d MS_CLASS=%d/%d%s", + tbf->created_ts(), tbf->state_flags, + state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH), + state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH), + tbf->first_ts, tbf->first_common_ts, tbf->control_ts, tbf->ms_class(), tbf->ms() ? tbf->ms()->egprs_ms_class() : -1, -- To view, visit https://gerrit.osmocom.org/6207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 16:53:25 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 16:53:25 +0000 Subject: [PATCH] osmo-pcu[master]: vty: drop unused function Message-ID: Review at https://gerrit.osmocom.org/6208 vty: drop unused function Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1 --- M src/pcu_vty.c M src/pcu_vty_functions.cpp M src/pcu_vty_functions.h 3 files changed, 1 insertion(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/08/6208/1 diff --git a/src/pcu_vty.c b/src/pcu_vty.c index dff331f..5c3f625 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -265,7 +265,7 @@ } } - return pcu_vty_config_write_pcu_ext(vty); + return CMD_SUCCESS; } /* per-BTS configuration */ diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index 31fffa9..252c922 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -34,11 +34,6 @@ #include } -int pcu_vty_config_write_pcu_ext(struct vty *vty) -{ - return CMD_SUCCESS; -} - static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf); diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h index 35acf64..470df0e 100644 --- a/src/pcu_vty_functions.h +++ b/src/pcu_vty_functions.h @@ -27,7 +27,6 @@ struct vty; struct gprs_rlcmac_bts; -int pcu_vty_config_write_pcu_ext(struct vty *vty); int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data); int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data); int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data, -- To view, visit https://gerrit.osmocom.org/6208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I01f3773ca6a9b6d4e28ca2f59c944c6d48918dd1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 16:57:58 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 16:57:58 +0000 Subject: [PATCH] osmo-pcu[master]: TBF: show assignment kind in vty In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6207 to look at the new patch set (#2). TBF: show assignment kind in vty Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93 Related: OS#1759 --- M src/pcu_vty_functions.cpp 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/07/6207/2 diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index eb15aa6..bb341f8 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -49,9 +49,11 @@ tbf->ta(), tbf->direction == GPRS_RLCMAC_UL_TBF ? "UL" : "DL", tbf->imsi(), VTY_NEWLINE); - vty_out(vty, " created=%lu state=%08x 1st_TS=%d 1st_cTS=%d ctrl_TS=%d " - "MS_CLASS=%d/%d%s", - tbf->created_ts(), tbf->state_flags, tbf->first_ts, + vty_out(vty, " created=%lu state=%08x [CCCH:%u, PACCH:%u] 1st_TS=%d 1st_cTS=%d ctrl_TS=%d MS_CLASS=%d/%d%s", + tbf->created_ts(), tbf->state_flags, + tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH), + tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH), + tbf->first_ts, tbf->first_common_ts, tbf->control_ts, tbf->ms_class(), tbf->ms() ? tbf->ms()->egprs_ms_class() : -1, -- To view, visit https://gerrit.osmocom.org/6207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic4e40d9c141ab7ee3f7c4dceec007dbe16359f93 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 Tue Jan 30 17:06:09 2018 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 30 Jan 2018 17:06:09 +0000 Subject: [PATCH] osmo-sgsn[master]: mandatory depend on libc-ares and libgtp Message-ID: Review at https://gerrit.osmocom.org/6209 mandatory depend on libc-ares and libgtp Both library are required to build osmo-sgsn. The optional dependency was correct when osmo-sgsn was part of openbsc. Change-Id: Id608165ae490cb6c84aac1fe70412b2cb2b2587b --- M configure.ac M src/gprs/Makefile.am M tests/Makefile.am M tests/gtphub/Makefile.am M tests/oap/Makefile.am 5 files changed, 2 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/09/6209/1 diff --git a/configure.ac b/configure.ac index ba82eb1..504157b 100644 --- a/configure.ac +++ b/configure.ac @@ -60,21 +60,8 @@ AC_SUBST(osmo_ac_iu) -found_libgtp=yes -PKG_CHECK_MODULES(LIBGTP, libgtp >= 1.0.0, , found_libgtp=no) -AM_CONDITIONAL(HAVE_LIBGTP, test "$found_libgtp" = yes) -AC_SUBST(found_libgtp) - -found_libcares=yes -PKG_CHECK_MODULES([LIBCARES], [libcares], [], [found_libcares=no]) -AM_CONDITIONAL(HAVE_LIBCARES, test "$found_libcares" = yes) -AC_SUBST(found_libcares) - -found_libgtp_and_libcares=no -if test "$found_libgtp" = "yes" -a "$found_libcares" = "yes"; then - found_libgtp_and_libcares=yes -fi -AC_SUBST(found_libgtp_and_libcares) +PKG_CHECK_MODULES(LIBGTP, libgtp >= 1.0.0) +PKG_CHECK_MODULES(LIBCARES, libcares) dnl checks for header files AC_HEADER_STDC diff --git a/src/gprs/Makefile.am b/src/gprs/Makefile.am index b0fca6f..4c7f730 100644 --- a/src/gprs/Makefile.am +++ b/src/gprs/Makefile.am @@ -36,15 +36,9 @@ bin_PROGRAMS = \ osmo-gbproxy \ - $(NULL) -if HAVE_LIBGTP -if HAVE_LIBCARES -bin_PROGRAMS += \ osmo-sgsn \ osmo-gtphub \ $(NULL) -endif -endif osmo_gbproxy_SOURCES = \ gb_proxy.c \ diff --git a/tests/Makefile.am b/tests/Makefile.am index 3cd8bff..f6a1efc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,15 +1,7 @@ SUBDIRS = \ gprs \ gbproxy \ - $(NULL) - -if HAVE_LIBGTP -SUBDIRS += \ gtphub \ - $(NULL) - -if HAVE_LIBCARES -SUBDIRS += \ sgsn \ oap \ xid \ @@ -17,8 +9,6 @@ slhc \ v42bis \ $(NULL) -endif -endif # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac diff --git a/tests/gtphub/Makefile.am b/tests/gtphub/Makefile.am index f2a6b88..523df61 100644 --- a/tests/gtphub/Makefile.am +++ b/tests/gtphub/Makefile.am @@ -16,13 +16,9 @@ gtphub_test.ok \ $(NULL) -if HAVE_LIBGTP -if HAVE_LIBCARES noinst_PROGRAMS = \ gtphub_test \ $(NULL) -endif -endif gtphub_test_SOURCES = \ gtphub_test.c \ diff --git a/tests/oap/Makefile.am b/tests/oap/Makefile.am index 5f8bbc5..ccc6d8c 100644 --- a/tests/oap/Makefile.am +++ b/tests/oap/Makefile.am @@ -15,13 +15,9 @@ oap_client_test.err \ $(NULL) -if HAVE_LIBGTP -if HAVE_LIBCARES noinst_PROGRAMS = \ oap_client_test \ $(NULL) -endif -endif oap_client_test_SOURCES = \ oap_client_test.c \ -- To view, visit https://gerrit.osmocom.org/6209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id608165ae490cb6c84aac1fe70412b2cb2b2587b Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jan 30 17:12:15 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 17:12:15 +0000 Subject: [PATCH] osmo-msc[master]: Remove unused code Message-ID: Review at https://gerrit.osmocom.org/6210 Remove unused code The socket.* is unused leftover from pre-split time. Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/socket.h M src/libcommon/Makefile.am D src/libcommon/socket.c 4 files changed, 0 insertions(+), 127 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/10/6210/1 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index ec231d0..88305db 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -29,7 +29,6 @@ silent_call.h \ smpp.h \ sms_queue.h \ - socket.h \ transaction.h \ ussd.h \ vlr.h \ diff --git a/include/osmocom/msc/socket.h b/include/osmocom/msc/socket.h deleted file mode 100644 index 0fd85f1..0000000 --- a/include/osmocom/msc/socket.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _BSC_SOCKET_H -#define _BSC_SOCKET_H - -#include - -#ifndef IPPROTO_GRE -#define IPPROTO_GRE 47 -#endif - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data); - -#endif /* _BSC_SOCKET_H */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 8f70da7..30f37d4 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -26,7 +26,6 @@ gsm_data.c \ gsup_client.c \ oap_client.c \ - socket.c \ talloc_ctx.c \ gsm_subscriber_base.c \ $(NULL) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c deleted file mode 100644 index 2793bcf..0000000 --- a/src/libcommon/socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* OpenBSC sokcet code, taken from Abis input driver for ip.access */ - -/* (C) 2009 by Harald Welte - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) -{ - struct sockaddr_in addr; - int ret, on = 1; - int type = SOCK_STREAM; - - switch (proto) { - case IPPROTO_TCP: - type = SOCK_STREAM; - break; - case IPPROTO_UDP: - type = SOCK_DGRAM; - break; -#ifdef IPPROTO_GRE - case IPPROTO_GRE: - type = SOCK_RAW; - break; -#endif - default: - return -EINVAL; - } - - bfd->fd = socket(AF_INET, type, proto); - bfd->cb = cb; - bfd->when = BSC_FD_READ; - bfd->data = data; - bfd->priv_nr = priv_nr; - - if (bfd->fd < 0) { - LOGP(DLINP, LOGL_ERROR, "could not create socket.\n"); - return -EIO; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (ip != INADDR_ANY) - addr.sin_addr.s_addr = htonl(ip); - else - addr.sin_addr.s_addr = INADDR_ANY; - - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "could not bind socket %s\n", - strerror(errno)); - close(bfd->fd); - return -EIO; - } - - if (proto == IPPROTO_TCP) { - ret = listen(bfd->fd, 1); - if (ret < 0) { - perror("listen"); - close(bfd->fd); - return ret; - } - } - - ret = osmo_fd_register(bfd); - if (ret < 0) { - perror("register_listen_fd"); - close(bfd->fd); - return ret; - } - return 0; -} -- To view, visit https://gerrit.osmocom.org/6210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Jan 30 17:13:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 17:13:17 +0000 Subject: [PATCH] osmo-msc[master]: Remove unused code In-Reply-To: References: Message-ID: Remove unused code The socket.* is unused leftover from pre-split time. Fixes: CID57645 Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/socket.h M src/libcommon/Makefile.am D src/libcommon/socket.c 4 files changed, 0 insertions(+), 127 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/10/6210/2 diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index ec231d0..88305db 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -29,7 +29,6 @@ silent_call.h \ smpp.h \ sms_queue.h \ - socket.h \ transaction.h \ ussd.h \ vlr.h \ diff --git a/include/osmocom/msc/socket.h b/include/osmocom/msc/socket.h deleted file mode 100644 index 0fd85f1..0000000 --- a/include/osmocom/msc/socket.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _BSC_SOCKET_H -#define _BSC_SOCKET_H - -#include - -#ifndef IPPROTO_GRE -#define IPPROTO_GRE 47 -#endif - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data); - -#endif /* _BSC_SOCKET_H */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 8f70da7..30f37d4 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -26,7 +26,6 @@ gsm_data.c \ gsup_client.c \ oap_client.c \ - socket.c \ talloc_ctx.c \ gsm_subscriber_base.c \ $(NULL) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c deleted file mode 100644 index 2793bcf..0000000 --- a/src/libcommon/socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* OpenBSC sokcet code, taken from Abis input driver for ip.access */ - -/* (C) 2009 by Harald Welte - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) -{ - struct sockaddr_in addr; - int ret, on = 1; - int type = SOCK_STREAM; - - switch (proto) { - case IPPROTO_TCP: - type = SOCK_STREAM; - break; - case IPPROTO_UDP: - type = SOCK_DGRAM; - break; -#ifdef IPPROTO_GRE - case IPPROTO_GRE: - type = SOCK_RAW; - break; -#endif - default: - return -EINVAL; - } - - bfd->fd = socket(AF_INET, type, proto); - bfd->cb = cb; - bfd->when = BSC_FD_READ; - bfd->data = data; - bfd->priv_nr = priv_nr; - - if (bfd->fd < 0) { - LOGP(DLINP, LOGL_ERROR, "could not create socket.\n"); - return -EIO; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (ip != INADDR_ANY) - addr.sin_addr.s_addr = htonl(ip); - else - addr.sin_addr.s_addr = INADDR_ANY; - - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "could not bind socket %s\n", - strerror(errno)); - close(bfd->fd); - return -EIO; - } - - if (proto == IPPROTO_TCP) { - ret = listen(bfd->fd, 1); - if (ret < 0) { - perror("listen"); - close(bfd->fd); - return ret; - } - } - - ret = osmo_fd_register(bfd); - if (ret < 0) { - perror("register_listen_fd"); - close(bfd->fd); - return ret; - } - return 0; -} -- To view, visit https://gerrit.osmocom.org/6210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 17:36:04 2018 From: gerrit-no-reply at lists.osmocom.org (Stefan Sperling) Date: Tue, 30 Jan 2018 17:36:04 +0000 Subject: [PATCH] osmo-bsc[master]: Make "waiting indicator" of IMMEDIATE ASSIGN REJECT dynamic. Message-ID: Review at https://gerrit.osmocom.org/6211 Make "waiting indicator" of IMMEDIATE ASSIGN REJECT dynamic. The IMMEDIATE ASSIGN REJECT message contains a wait indicator which tells an MS requesting a channel to wait for a specified amount of time before trying to request a channel again, i.e. the wait indicator controls the T3122 timeout value in the MS. Previously, the wait indicator was fixed to 10 seconds. This is not sufficient if there are a lot of MS requesting channels because the MS will retry too soon. Instead of using a fixed value, maintain a dynamic wait indicator value based on average channel load. The load (used vs. available channels on a BTS) is sampled once per second, and once 8 samples have been collected we update a BTS-specific T3122 wait indicator based on the measured load. While the wait indicator could go up to 255 seconds, this initial implementation keeps it in the range from 10 to 128 seconds. Further experimentation and testing will show whether higher wait indicator values are desirable, if the sampling rate needs to change, or if the function mapping the load measurement to a wait indicator value should change (currently we map the load average linearly into the range [10, 128] inclusive). Change-Id: I57e38f6d6ba3b23cc6e1f9520b90261dbb1f1cec Related: OS#2592 --- M include/osmocom/bsc/chan_alloc.h M include/osmocom/bsc/gsm_data.h M include/osmocom/bsc/gsm_data_shared.h M src/libbsc/abis_rsl.c M src/libbsc/bsc_init.c M src/libbsc/bsc_vty.c M src/libbsc/chan_alloc.c M src/libbsc/net_init.c M src/libcommon/gsm_data_shared.c M tests/channel/Makefile.am M tests/channel/channel_test.c 11 files changed, 134 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/11/6211/1 diff --git a/include/osmocom/bsc/chan_alloc.h b/include/osmocom/bsc/chan_alloc.h index 748e9cd..98568a5 100644 --- a/include/osmocom/bsc/chan_alloc.h +++ b/include/osmocom/bsc/chan_alloc.h @@ -37,17 +37,13 @@ /* Release the given lchan */ int lchan_release(struct gsm_lchan *lchan, int sacch_deact, enum rsl_rel_mode release_mode); -struct load_counter { - unsigned int total; - unsigned int used; -}; - struct pchan_load { struct load_counter pchan[_GSM_PCHAN_MAX]; }; void bts_chan_load(struct pchan_load *cl, const struct gsm_bts *bts); void network_chan_load(struct pchan_load *pl, struct gsm_network *net); +void bts_update_t3122_chan_load(struct gsm_bts *bts); bool trx_is_usable(const struct gsm_bts_trx *trx); bool ts_is_usable(const struct gsm_bts_trx_ts *ts); diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h index bdf7cfb..25dee78 100644 --- a/include/osmocom/bsc/gsm_data.h +++ b/include/osmocom/bsc/gsm_data.h @@ -308,6 +308,9 @@ /* Periodic location update default value */ uint8_t t3212; + /* Timer for periodic channel load measurements to maintain each BTS's T3122. */ + struct osmo_timer_list t3122_chan_load_timer; + struct { struct mgcp_client_conf *conf; struct mgcp_client *client; diff --git a/include/osmocom/bsc/gsm_data_shared.h b/include/osmocom/bsc/gsm_data_shared.h index 86c5ca9..504b42a 100644 --- a/include/osmocom/bsc/gsm_data_shared.h +++ b/include/osmocom/bsc/gsm_data_shared.h @@ -573,6 +573,12 @@ double height; }; +/* Channel load counter */ +struct load_counter { + unsigned int total; + unsigned int used; +}; + /* One BTS */ struct gsm_bts { /* list header in net->bts_list */ @@ -802,6 +808,13 @@ struct rate_ctr_group *bts_ctrs; struct handover_cfg *ho; + + /* BTS-specific overrides for timer values from struct gsm_network. */ + uint8_t T3122; /* ASSIGMENT REJECT wait indication */ + + /* Periodic channel load measurements are used to maintain T3122. */ + struct load_counter chan_load_samples[7]; + int chan_load_samples_idx; }; diff --git a/src/libbsc/abis_rsl.c b/src/libbsc/abis_rsl.c index eced0e2..3282591 100644 --- a/src/libbsc/abis_rsl.c +++ b/src/libbsc/abis_rsl.c @@ -1776,8 +1776,7 @@ /* Format an IMM ASS REJ according to 04.08 Chapter 9.1.20 */ static int rsl_send_imm_ass_rej(struct gsm_bts *bts, - unsigned int num_req_refs, - struct gsm48_req_ref *rqd_refs, + struct gsm48_req_ref *rqd_ref, uint8_t wait_ind) { uint8_t buf[GSM_MACBLOCK_LEN]; @@ -1789,25 +1788,15 @@ iar->msg_type = GSM48_MT_RR_IMM_ASS_REJ; iar->page_mode = GSM48_PM_SAME; - memcpy(&iar->req_ref1, &rqd_refs[0], sizeof(iar->req_ref1)); + /* Set all request references and wait indications to the same value. + * The BTS will aggregate up to 4 of our ASS REJ messages if possible. */ + memcpy(&iar->req_ref1, rqd_ref, sizeof(iar->req_ref1)); iar->wait_ind1 = wait_ind; - - if (num_req_refs >= 2) - memcpy(&iar->req_ref2, &rqd_refs[1], sizeof(iar->req_ref2)); - else - memcpy(&iar->req_ref2, &rqd_refs[0], sizeof(iar->req_ref2)); + memcpy(&iar->req_ref2, rqd_ref, sizeof(iar->req_ref2)); iar->wait_ind2 = wait_ind; - - if (num_req_refs >= 3) - memcpy(&iar->req_ref3, &rqd_refs[2], sizeof(iar->req_ref3)); - else - memcpy(&iar->req_ref3, &rqd_refs[0], sizeof(iar->req_ref3)); + memcpy(&iar->req_ref3, rqd_ref, sizeof(iar->req_ref3)); iar->wait_ind3 = wait_ind; - - if (num_req_refs >= 4) - memcpy(&iar->req_ref4, &rqd_refs[3], sizeof(iar->req_ref4)); - else - memcpy(&iar->req_ref4, &rqd_refs[0], sizeof(iar->req_ref4)); + memcpy(&iar->req_ref4, rqd_ref, sizeof(iar->req_ref4)); iar->wait_ind4 = wait_ind; /* we need to subtract 1 byte from sizeof(*iar) since ia includes the l2_plen field */ @@ -1913,12 +1902,18 @@ lchan = lchan_alloc(bts, lctype, 0); } if (!lchan) { + uint8_t wait_ind; LOGP(DRSL, LOGL_NOTICE, "BTS %d CHAN RQD: no resources for %s 0x%x\n", msg->lchan->ts->trx->bts->nr, gsm_lchant_name(lctype), rqd_ref->ra); rate_ctr_inc(&bts->bts_ctrs->ctr[BTS_CTR_CHREQ_NO_CHANNEL]); - /* FIXME gather multiple CHAN RQD and reject up to 4 at the same time */ - if (bts->network->T3122) - rsl_send_imm_ass_rej(bts, 1, rqd_ref, bts->network->T3122 & 0xff); + if (bts->T3122) + wait_ind = bts->T3122; + else if (bts->network->T3122) + wait_ind = bts->network->T3122 & 0xff; + else + wait_ind = GSM_T3122_DEFAULT; + /* The BTS will gather multiple CHAN RQD and reject up to 4 MS at the same time. */ + rsl_send_imm_ass_rej(bts, rqd_ref, wait_ind); return 0; } diff --git a/src/libbsc/bsc_init.c b/src/libbsc/bsc_init.c index c5a75aa..2b1d53b 100644 --- a/src/libbsc/bsc_init.c +++ b/src/libbsc/bsc_init.c @@ -523,6 +523,8 @@ bts->si_common.ncc_permitted = 0xff; + bts->chan_load_samples_idx = 0; + /* Initialize the BTS state */ gsm_bts_mo_reset(bts); diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c index b4a8e2d..2246349 100644 --- a/src/libbsc/bsc_vty.c +++ b/src/libbsc/bsc_vty.c @@ -1711,7 +1711,7 @@ DECLARE_TIMER(3115, "Currently not used") DECLARE_TIMER(3117, "Currently not used") DECLARE_TIMER(3119, "Currently not used") -DECLARE_TIMER(3122, "Waiting time (seconds) after IMM ASS REJECT") +DECLARE_TIMER(3122, "Default waiting time (seconds) after IMM ASS REJECT") DECLARE_TIMER(3141, "Currently not used") DEFUN_DEPRECATED(cfg_net_dtx, diff --git a/src/libbsc/chan_alloc.c b/src/libbsc/chan_alloc.c index 21c81aa..5e2c0ee 100644 --- a/src/libbsc/chan_alloc.c +++ b/src/libbsc/chan_alloc.c @@ -593,3 +593,78 @@ bts_chan_load(pl, bts); } +/* Update T3122 wait indicator based on samples of BTS channel load. */ +void +bts_update_t3122_chan_load(struct gsm_bts *bts) +{ + struct pchan_load pl; + uint64_t used = 0; + uint32_t total = 0; + uint64_t load; + uint64_t wait_ind; + static const uint8_t min_wait_ind = GSM_T3122_DEFAULT; + static const uint8_t max_wait_ind = 128; /* max wait ~2 minutes */ + int i; + + /* Sum up current load across all channels. */ + memset(&pl, 0, sizeof(pl)); + bts_chan_load(&pl, bts); + for (i = 0; i < ARRAY_SIZE(pl.pchan); i++) { + struct load_counter *lc = &pl.pchan[i]; + + /* Ignore samples too large for fixed-point calculations (shouldn't happen). */ + if (lc->used > UINT16_MAX || lc->total > UINT16_MAX) { + LOGP(DRLL, LOGL_NOTICE, "(bts=%d) numbers in channel load sample " + "too large (used=%u / total=%u)\n", bts->nr, lc->used, lc->total); + continue; + } + + used += lc->used; + total += lc->total; + } + + /* Check for invalid samples (shouldn't happen). */ + if (total == 0 || used > total) { + LOGP(DRLL, LOGL_NOTICE, "(bts=%d) bogus channel load sample (used=%lu / total=%u)\n", + bts->nr, used, total); + bts->T3122 = 0; /* disable override of network-wide default value */ + bts->chan_load_samples_idx = 0; /* invalidate other samples collected so far */ + return; + } + + /* If we haven't got enough samples yet, store measurement for later use. */ + if (bts->chan_load_samples_idx < ARRAY_SIZE(bts->chan_load_samples)) { + struct load_counter *sample = &bts->chan_load_samples[bts->chan_load_samples_idx++]; + sample->total = (unsigned int)total; + sample->used = (unsigned int)used; + return; + } + + /* We have enough samples and will overwrite our current samples later. */ + bts->chan_load_samples_idx = 0; + + /* Add all previous samples to the current sample. */ + for (i = 0; i < ARRAY_SIZE(bts->chan_load_samples); i++) { + struct load_counter *sample = &bts->chan_load_samples[i]; + total += sample->total; + used += sample->used; + } + + used <<= 8; /* convert to fixed-point */ + + /* Log channel load average. */ + load = ((used / total) * 100); + LOGP(DRLL, LOGL_DEBUG, "(bts=%d) channel load average is %lu.%.2lu%%\n", + bts->nr, (load & 0xffffff00) >> 8, (load & 0xff) / 10); + + /* Calculate new T3122 wait indicator. */ + wait_ind = ((used / total) * max_wait_ind); + wait_ind >>= 8; /* convert from fixed-point to integer */ + if (wait_ind < min_wait_ind) + wait_ind = min_wait_ind; + else if (wait_ind > max_wait_ind) + wait_ind = max_wait_ind; + + LOGP(DRLL, LOGL_DEBUG, "(bts=%d) T3122 wait indicator set to %lu seconds\n", bts->nr, wait_ind); + bts->T3122 = (uint8_t)wait_ind; +} diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c index 57d8241..ee47ccf 100644 --- a/src/libbsc/net_init.c +++ b/src/libbsc/net_init.c @@ -22,6 +22,22 @@ #include #include #include +#include + +/* XXX hard-coded for now */ +#define T3122_CHAN_LOAD_SAMPLE_INTERVAL 1 /* in seconds */ + +static void update_t3122_chan_load_timer(void *data) +{ + struct gsm_network *net = data; + struct gsm_bts *bts; + + llist_for_each_entry(bts, &net->bts_list, list) + bts_update_t3122_chan_load(bts); + + /* Keep this timer ticking. */ + osmo_timer_schedule(&net->t3122_chan_load_timer, T3122_CHAN_LOAD_SAMPLE_INTERVAL, 0); +} struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, @@ -60,6 +76,9 @@ INIT_LLIST_HEAD(&net->bts_list); + osmo_timer_setup(&net->t3122_chan_load_timer, update_t3122_chan_load_timer, net); + osmo_timer_schedule(&net->t3122_chan_load_timer, T3122_CHAN_LOAD_SAMPLE_INTERVAL, 0); + /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); if (!net->bsc_ctrs) { diff --git a/src/libcommon/gsm_data_shared.c b/src/libcommon/gsm_data_shared.c index e4ec594..3afc67e 100644 --- a/src/libcommon/gsm_data_shared.c +++ b/src/libcommon/gsm_data_shared.c @@ -377,6 +377,9 @@ bts->ho = ho_cfg_init(bts, net->ho); + /* timer overrides */ + bts->T3122 = 0; /* not overriden by default */ + return bts; } diff --git a/tests/channel/Makefile.am b/tests/channel/Makefile.am index 12f18f8..aae7a45 100644 --- a/tests/channel/Makefile.am +++ b/tests/channel/Makefile.am @@ -29,4 +29,5 @@ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ $(NULL) diff --git a/tests/channel/channel_test.c b/tests/channel/channel_test.c index 7957b14..933df9c 100644 --- a/tests/channel/channel_test.c +++ b/tests/channel/channel_test.c @@ -98,12 +98,9 @@ return EXIT_SUCCESS; } -void _abis_nm_sendmsg() {} void sms_alloc() {} void sms_free() {} -void gsm_net_update_ctype(struct gsm_network *network) {} void gsm48_secure_channel() {} -void paging_request_stop() {} void vty_out() {} void ipa_client_conn_clear_queue() {} -- To view, visit https://gerrit.osmocom.org/6211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I57e38f6d6ba3b23cc6e1f9520b90261dbb1f1cec Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 30 19:16:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 19:16:52 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Handle wildcard endpoint name in MGCP CRCX Message-ID: Review at https://gerrit.osmocom.org/6212 bsc: Handle wildcard endpoint name in MGCP CRCX MGCP permits for the CallAgent to send a wildcarded endpoint name, at which point the MGW itself must allocate an endpoint name and return it as SpecificEndpointId parameter in the CRCX response. Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34 --- M bsc/MSC_ConnectionHandler.ttcn M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn 3 files changed, 49 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/6212/1 diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 55cdb89..b6e6540 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -75,7 +75,7 @@ peer := - } - //g_media.mgcp_ep := int2str(i) & "@mgw"; + g_media.mgcp_ep := "rtpbridge/" & int2str(nr) & "@mgw"; for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { g_media.mgcp_conn[i].mime_type := "AMR"; @@ -169,6 +169,16 @@ [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { var SDP_Message sdp; var integer cid := f_get_free_mgcp_conn(); + if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { + if (cid != 0) { + setverdict(fail, "MGCP wildcard EP only works in first CRCX"); + self.stop; + } + /* we keep the endpoint name allocated during MediaState_init */ + } else { + /* Call Agent allocated endpoint, trust/use it always */ + g_media.mgcp_ep := mgcp_cmd.line.ep; + } if (isvalue(mgcp_cmd.sdp)) { sdp := mgcp_cmd.sdp; g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr; @@ -181,7 +191,10 @@ mgcp_conn.mime_type & "/" & int2str(mgcp_conn.sample_rate))), valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); + var template MgcpResponse mgcp_resp; + mgcp_resp := ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp); + f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(g_media.mgcp_ep)); + MGCP.send(mgcp_resp); g_media.mgcp_conn[cid].crcx_seen := true; repeat; } diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index df8e4b4..adcb8b5 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -208,8 +208,12 @@ if (ischosen(msg.command)) { return msg.command.line.ep; } else { - /* FIXME */ - return "null at none"; + var MgcpEndpoint ep; + if (f_mgcp_find_param(msg, "Z", ep) == false) { + setverdict(fail, "No SpecificEndpointName in MGCP response", msg); + self.stop; + } + return ep; } } @@ -273,7 +277,8 @@ } else { if (cmd.line.verb == "CRCX") { vc_conn := ops.create_cb.apply(cmd, id); - if (true /* non-wildcard EP */) { + if (not match(cmd.line.ep, t_MGCP_EP_wildcard)) { + /* non-wildcard EP, use directly */ f_ep_table_add(vc_conn, cmd.line.ep); } else { /* add this transaction to list of pending transactions */ diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 5a8d9b1..9e32a34 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -34,6 +34,12 @@ val := hex2str(rid) }; + /* 3.2.1.3 SpecificEndpointId */ + template MgcpParameter ts_MgcpParSpecEP(MgcpEndpoint ep) := { + code := "Z", + val := ep + }; + /* 3.2.2.10: LocalConnectionOptions (codec, packetization, bandwidth, ToS, eco, gain, silence, ...) */ template MgcpParameter t_MgcpParLocConnOpt(template charstring lco) := { "L", lco }; @@ -326,5 +332,25 @@ sdp := * } + function f_mgcp_find_param(MgcpMessage msg, MgcpInfoCode code, out charstring ret) + return boolean { + var MgcpParameterList pars; + if (ischosen(msg.command)) { + pars := msg.command.params; + } else { + pars := msg.response.params; + } + for (var integer i := 0; i < sizeof(pars); i := i+1) { + if (pars[i].code == code) { + ret := pars[i].val; + return true; + } + } + return false; + } + + /* template to determine if a MGCP endpoint is a wildcard endpoint */ + template charstring t_MGCP_EP_wildcard := (pattern "\*@*", pattern "rtpbridge/\*@*"); + } -- To view, visit https://gerrit.osmocom.org/6212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:17:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:17:00 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Handle wildcard endpoint name in MGCP CRCX In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:17:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:17:02 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Handle wildcard endpoint name in MGCP CRCX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Handle wildcard endpoint name in MGCP CRCX ...................................................................... bsc: Handle wildcard endpoint name in MGCP CRCX MGCP permits for the CallAgent to send a wildcarded endpoint name, at which point the MGW itself must allocate an endpoint name and return it as SpecificEndpointId parameter in the CRCX response. Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34 --- M bsc/MSC_ConnectionHandler.ttcn M library/MGCP_Emulation.ttcn M library/MGCP_Templates.ttcn 3 files changed, 49 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index 55cdb89..b6e6540 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -75,7 +75,7 @@ peer := - } - //g_media.mgcp_ep := int2str(i) & "@mgw"; + g_media.mgcp_ep := "rtpbridge/" & int2str(nr) & "@mgw"; for (var integer i:= 0; i < sizeof(g_media.mgcp_conn); i := i+1) { g_media.mgcp_conn[i].mime_type := "AMR"; @@ -169,6 +169,16 @@ [] MGCP.receive(tr_CRCX) -> value mgcp_cmd { var SDP_Message sdp; var integer cid := f_get_free_mgcp_conn(); + if (match(mgcp_cmd.line.ep, t_MGCP_EP_wildcard)) { + if (cid != 0) { + setverdict(fail, "MGCP wildcard EP only works in first CRCX"); + self.stop; + } + /* we keep the endpoint name allocated during MediaState_init */ + } else { + /* Call Agent allocated endpoint, trust/use it always */ + g_media.mgcp_ep := mgcp_cmd.line.ep; + } if (isvalue(mgcp_cmd.sdp)) { sdp := mgcp_cmd.sdp; g_media.mgcp_conn[cid].peer.host := sdp.connection.conn_addr.addr; @@ -181,7 +191,10 @@ mgcp_conn.mime_type & "/" & int2str(mgcp_conn.sample_rate))), valueof(ts_SDP_ptime(mgcp_conn.ptime)) } )); - MGCP.send(ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp)); + var template MgcpResponse mgcp_resp; + mgcp_resp := ts_CRCX_ACK(mgcp_cmd.line.trans_id, mgcp_conn.conn_id, sdp); + f_mgcp_par_append(mgcp_resp.params, ts_MgcpParSpecEP(g_media.mgcp_ep)); + MGCP.send(mgcp_resp); g_media.mgcp_conn[cid].crcx_seen := true; repeat; } diff --git a/library/MGCP_Emulation.ttcn b/library/MGCP_Emulation.ttcn index df8e4b4..adcb8b5 100644 --- a/library/MGCP_Emulation.ttcn +++ b/library/MGCP_Emulation.ttcn @@ -208,8 +208,12 @@ if (ischosen(msg.command)) { return msg.command.line.ep; } else { - /* FIXME */ - return "null at none"; + var MgcpEndpoint ep; + if (f_mgcp_find_param(msg, "Z", ep) == false) { + setverdict(fail, "No SpecificEndpointName in MGCP response", msg); + self.stop; + } + return ep; } } @@ -273,7 +277,8 @@ } else { if (cmd.line.verb == "CRCX") { vc_conn := ops.create_cb.apply(cmd, id); - if (true /* non-wildcard EP */) { + if (not match(cmd.line.ep, t_MGCP_EP_wildcard)) { + /* non-wildcard EP, use directly */ f_ep_table_add(vc_conn, cmd.line.ep); } else { /* add this transaction to list of pending transactions */ diff --git a/library/MGCP_Templates.ttcn b/library/MGCP_Templates.ttcn index 5a8d9b1..9e32a34 100644 --- a/library/MGCP_Templates.ttcn +++ b/library/MGCP_Templates.ttcn @@ -34,6 +34,12 @@ val := hex2str(rid) }; + /* 3.2.1.3 SpecificEndpointId */ + template MgcpParameter ts_MgcpParSpecEP(MgcpEndpoint ep) := { + code := "Z", + val := ep + }; + /* 3.2.2.10: LocalConnectionOptions (codec, packetization, bandwidth, ToS, eco, gain, silence, ...) */ template MgcpParameter t_MgcpParLocConnOpt(template charstring lco) := { "L", lco }; @@ -326,5 +332,25 @@ sdp := * } + function f_mgcp_find_param(MgcpMessage msg, MgcpInfoCode code, out charstring ret) + return boolean { + var MgcpParameterList pars; + if (ischosen(msg.command)) { + pars := msg.command.params; + } else { + pars := msg.response.params; + } + for (var integer i := 0; i < sizeof(pars); i := i+1) { + if (pars[i].code == code) { + ret := pars[i].val; + return true; + } + } + return false; + } + + /* template to determine if a MGCP endpoint is a wildcard endpoint */ + template charstring t_MGCP_EP_wildcard := (pattern "\*@*", pattern "rtpbridge/\*@*"); + } -- To view, visit https://gerrit.osmocom.org/6212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I704bbe4e11b27e83a6ae6a71aa6a715dc8301f34 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:22:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:22:59 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 4: (3 comments) https://gerrit.osmocom.org/#/c/6158/4/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: PS4, Line 751: ''O in a receive template you normally assign a default value of ? or in this case maybe even *, to make sure unless something is specified, it will match all ICMPv4 echo reply packets, not just those with zero-length data section (like in your case). PS4, Line 914: ''O same as above Line 1050: [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { the generally mroe elegant solution would be to "stack" a translation port or dual-faced ports (I call them *_CodecPort.ttcn) on top of the GTPU port. This port will simply do the encoding/decoding of the payload, so that you can directly match on the inner IP header rather than having to manually do this. TTCN-3 also has some syntactic sugar called "decmatch" which allows you to achive what is written here in much less lines of code, but there's no need to change it now, this is just a notice in case you end up with this problem again. -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:26:27 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:26:27 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test to validate if different pdp ctx can ta... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6205/1/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: Line 1071: function f_wait_icmp4_echo_request(PdpContext ctx) runs on GT_CT { rather than having these copy+pasted wait-for-... functions, one simple approach might be to have an template argument like "f_wait_icmp4(PdpContext ctx, template PDU_ICMP expected)" So the caller would then call "f_wait_icmp4(pdp_ctx, tr_ICMPv4_EQ)" and you only have one of those functions for v4 and one for v6, rather than many of them that look more or less the same. -- To view, visit https://gerrit.osmocom.org/6205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:27:06 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:27:06 +0000 Subject: osmo-msc[master]: Remove unused code In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:27:26 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:27:26 +0000 Subject: libosmo-abis[master]: cosmetic: update ipaccess_bts_handle_ccm() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/5683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifcf8baf4bf5670efaa8689ca7386597fe2797bda Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:27:29 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:27:29 +0000 Subject: [MERGED] libosmo-abis[master]: cosmetic: update ipaccess_bts_handle_ccm() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: update ipaccess_bts_handle_ccm() ...................................................................... cosmetic: update ipaccess_bts_handle_ccm() * mark internal function parameter as const * log unit IDs Change-Id: Ifcf8baf4bf5670efaa8689ca7386597fe2797bda --- M src/input/ipaccess.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Stefan Sperling: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index acb2db0..5eee57e 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -571,7 +571,7 @@ #define IPA_STRING_MAX 64 static struct msgb * -ipa_bts_id_resp(struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) +ipa_bts_id_resp(const struct ipaccess_unit *dev, uint8_t *data, int len, int trx_nr) { struct msgb *nmsg; char str[IPA_STRING_MAX]; @@ -704,7 +704,8 @@ if (link->ofd->priv_nr >= E1INP_SIGN_RSL) trx_nr = link->ofd->priv_nr - E1INP_SIGN_RSL; - LOGP(DLINP, LOGL_NOTICE, "received ID get\n"); + LOGP(DLINP, LOGL_NOTICE, "received ID get from %u/%u/%u\n", + dev->site_id, dev->bts_id, dev->trx_id); rmsg = ipa_bts_id_resp(dev, data + 1, len - 1, trx_nr); ret = ipa_send(link->ofd->fd, rmsg->data, rmsg->len); if (ret != rmsg->len) { -- To view, visit https://gerrit.osmocom.org/5683 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifcf8baf4bf5670efaa8689ca7386597fe2797bda Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Stefan Sperling From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:28:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:28:33 +0000 Subject: osmo-ggsn[master]: ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:28:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:28:47 +0000 Subject: osmo-ggsn[master]: ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:31:39 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:31:39 +0000 Subject: libosmocore[master]: GSUP: add helper wrapper for setting IMSI In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/6197/1/include/osmocom/gsm/gsup.h File include/osmocom/gsm/gsup.h: Line 118: #define OSMO_GSUP_COPY_IMSI(msg, _imsi) osmo_strlcpy((msg)->imsi, _imsi, GSM23003_IMSI_MAX_DIGITS + 2) why not a sizeof((msg)->imsi)? And why not actually a more generic helper that would work for any static array, unrelated to IMSIs or even unerlated to GSUP? something like OSMO_STRLCPY_ARRAY(array, source) which would automatically expand to an sizeof(array)? -- To view, visit https://gerrit.osmocom.org/6197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I03d0d3d32a8d572ad573d03c603e14cdc27a3f7b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:32:31 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:32:31 +0000 Subject: osmo-sgsn[master]: gtphub: check for gsn_addr_from_sockaddr() error In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d80b5a488e7daa0bc8f57ea304e0e1f10f6c1f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:32:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 21:32:33 +0000 Subject: [MERGED] osmo-sgsn[master]: gtphub: check for gsn_addr_from_sockaddr() error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gtphub: check for gsn_addr_from_sockaddr() error ...................................................................... gtphub: check for gsn_addr_from_sockaddr() error Change-Id: I2d80b5a488e7daa0bc8f57ea304e0e1f10f6c1f5 Fixes: CID182472 --- M src/gprs/gtphub.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c index 2ff1b7c..4ee20cd 100644 --- a/src/gprs/gtphub.c +++ b/src/gprs/gtphub.c @@ -2649,7 +2649,9 @@ { struct gsn_addr gsna; uint16_t port; - gsn_addr_from_sockaddr(&gsna, &port, addr); + if (gsn_addr_from_sockaddr(&gsna, &port, addr) != 0) + return NULL; + return gtphub_port_find(bind, &gsna, port); } -- To view, visit https://gerrit.osmocom.org/6190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d80b5a488e7daa0bc8f57ea304e0e1f10f6c1f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:37:28 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 21:37:28 +0000 Subject: osmo-msc[master]: Remove unused code In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/6210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:37:30 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 30 Jan 2018 21:37:30 +0000 Subject: [MERGED] osmo-msc[master]: Remove unused code In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Remove unused code ...................................................................... Remove unused code The socket.* is unused leftover from pre-split time. Fixes: CID57645 Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 --- M include/osmocom/msc/Makefile.am D include/osmocom/msc/socket.h M src/libcommon/Makefile.am D src/libcommon/socket.c 4 files changed, 0 insertions(+), 127 deletions(-) Approvals: Max: Verified Harald Welte: Looks good to me, approved diff --git a/include/osmocom/msc/Makefile.am b/include/osmocom/msc/Makefile.am index ec231d0..88305db 100644 --- a/include/osmocom/msc/Makefile.am +++ b/include/osmocom/msc/Makefile.am @@ -29,7 +29,6 @@ silent_call.h \ smpp.h \ sms_queue.h \ - socket.h \ transaction.h \ ussd.h \ vlr.h \ diff --git a/include/osmocom/msc/socket.h b/include/osmocom/msc/socket.h deleted file mode 100644 index 0fd85f1..0000000 --- a/include/osmocom/msc/socket.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _BSC_SOCKET_H -#define _BSC_SOCKET_H - -#include - -#ifndef IPPROTO_GRE -#define IPPROTO_GRE 47 -#endif - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data); - -#endif /* _BSC_SOCKET_H */ diff --git a/src/libcommon/Makefile.am b/src/libcommon/Makefile.am index 8f70da7..30f37d4 100644 --- a/src/libcommon/Makefile.am +++ b/src/libcommon/Makefile.am @@ -26,7 +26,6 @@ gsm_data.c \ gsup_client.c \ oap_client.c \ - socket.c \ talloc_ctx.c \ gsm_subscriber_base.c \ $(NULL) diff --git a/src/libcommon/socket.c b/src/libcommon/socket.c deleted file mode 100644 index 2793bcf..0000000 --- a/src/libcommon/socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* OpenBSC sokcet code, taken from Abis input driver for ip.access */ - -/* (C) 2009 by Harald Welte - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) -{ - struct sockaddr_in addr; - int ret, on = 1; - int type = SOCK_STREAM; - - switch (proto) { - case IPPROTO_TCP: - type = SOCK_STREAM; - break; - case IPPROTO_UDP: - type = SOCK_DGRAM; - break; -#ifdef IPPROTO_GRE - case IPPROTO_GRE: - type = SOCK_RAW; - break; -#endif - default: - return -EINVAL; - } - - bfd->fd = socket(AF_INET, type, proto); - bfd->cb = cb; - bfd->when = BSC_FD_READ; - bfd->data = data; - bfd->priv_nr = priv_nr; - - if (bfd->fd < 0) { - LOGP(DLINP, LOGL_ERROR, "could not create socket.\n"); - return -EIO; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (ip != INADDR_ANY) - addr.sin_addr.s_addr = htonl(ip); - else - addr.sin_addr.s_addr = INADDR_ANY; - - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "could not bind socket %s\n", - strerror(errno)); - close(bfd->fd); - return -EIO; - } - - if (proto == IPPROTO_TCP) { - ret = listen(bfd->fd, 1); - if (ret < 0) { - perror("listen"); - close(bfd->fd); - return ret; - } - } - - ret = osmo_fd_register(bfd); - if (ret < 0) { - perror("register_listen_fd"); - close(bfd->fd); - return ret; - } - return 0; -} -- To view, visit https://gerrit.osmocom.org/6210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf3b539fcbd7f311caa2291af23b8f18ebc6c2e0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:50:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 21:50:51 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn.c: cb_tun_ind: Convert ifelse to switch statement In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6200 to look at the new patch set (#2). ggsn.c: cb_tun_ind: Convert ifelse to switch statement Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 --- M ggsn/ggsn.c 1 file changed, 6 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/00/6200/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index de8090b..c7f6376 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -726,13 +726,15 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; - if (iph->version == 4) { + switch (iph->version) { + case 4: if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; pool = apn->v4.pool; - } else if (iph->version == 6) { + break; + case 6: /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct * ippool_getip() below to match only the leading /64 @@ -740,7 +742,8 @@ dst.len = 8; dst.v6 = ip6h->ip6_dst; pool = apn->v6.pool; - } else { + break; + default: LOGP(DTUN, LOGL_NOTICE, "non-IPv%u packet received from tun\n", iph->version); return -1; } -- To view, visit https://gerrit.osmocom.org/6200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:50:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 21:50:51 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx 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/6201 to look at the new patch set (#2). ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 --- M ggsn/ggsn.c 1 file changed, 4 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/01/6201/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c7f6376..fed8f73 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -725,6 +725,7 @@ struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; + char straddr[INET6_ADDRSTRLEN]; switch (iph->version) { case 4: @@ -755,7 +756,9 @@ DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, tun->devname); if (ippool_getip(pool, &ipm, &dst)) { - DEBUGPC(DTUN, " with no PDP contex!!\n"); + DEBUGPC(DTUN, " with no PDP contex! (%s)\n", iph->version == 4 ? + inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) : + inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr))); return 0; } DEBUGPC(DTUN, "\n"); -- To view, visit https://gerrit.osmocom.org/6201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 21:50:51 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Tue, 30 Jan 2018 21:50:51 +0000 Subject: [PATCH] osmo-ggsn[master]: ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll ... 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/6202 to look at the new patch set (#2). ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll addr Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 --- M ggsn/ggsn.c 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ggsn refs/changes/02/6202/2 diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index fed8f73..caf6151 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -726,6 +726,7 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; char straddr[INET6_ADDRSTRLEN]; + uint8_t pref_offset; switch (iph->version) { case 4: @@ -739,9 +740,12 @@ /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct * ippool_getip() below to match only the leading /64 - * prefix, i.e. the first 8 bytes of the address */ + * prefix, i.e. the first 8 bytes of the address. If the ll addr + * is used, then the match should be done on the trailing 64 + * bits. */ dst.len = 8; - dst.v6 = ip6h->ip6_dst; + pref_offset = IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_dst) ? 8 : 0; + memcpy(&dst.v6, ((uint8_t*)&ip6h->ip6_dst) + pref_offset, 8); pool = apn->v6.pool; break; default: -- To view, visit https://gerrit.osmocom.org/6202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:46:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:46:14 +0000 Subject: osmo-bsc[master]: Make "waiting indicator" of IMMEDIATE ASSIGN REJECT dynamic. In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) looks fine to me, besides having the value also listed in "show bts" so one can introspect the current value as a system administrator. It would also make sense to expose the value by other means. I myself haven't used the stasd exporter facilities in libosmocore, but exporting it as a "gauge" type sounds like the most logical way. From a quick glance it seems it supports the gauge "|g" type by means of OSMO_STAT_ITEM_NO_UNIT. The point here is that this is a value that you might want to plot on a per-bts basis over time. Could be a follow-up patch. https://gerrit.osmocom.org/#/c/6211/1/src/libbsc/abis_rsl.c File src/libbsc/abis_rsl.c: Line 1791: /* Set all request references and wait indications to the same value. it might make sense to state explicitly here that the spec requires entries to be duplicated if unused. This is highly unusual and deserves special mention. https://gerrit.osmocom.org/#/c/6211/1/src/libbsc/net_init.c File src/libbsc/net_init.c: Line 79: osmo_timer_setup(&net->t3122_chan_load_timer, update_t3122_chan_load_timer, net); I think it might make sense to have each BTS have its own timer, rather than handling all BTSs at once. Why? Becaus at large number of BTSs, we might introduce a load spike at one point in time which normally could be spred more evenly. But then, ignore that. The computation is not very expensive, so it most likely doesn't matter. And on those systems where it matters (deeply embedded) we only have 1-2 BTS anyway. Maybe add a comment here that if it ever becomes ac oncern, each BTS could be staggered. -- To view, visit https://gerrit.osmocom.org/6211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I57e38f6d6ba3b23cc6e1f9520b90261dbb1f1cec Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:47:23 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:47:23 +0000 Subject: osmo-bsc[master]: pcu_sock: reorganize calculation of paging group In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iee8926d5bc017d912912916e4898e968bf4dd29b Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:48:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:48:07 +0000 Subject: osmo-bsc[master]: abis-rsl: Send imm.ass messages via PCH In-Reply-To: References: Message-ID: Patch Set 1: let's clean it up and get merged. -- To view, visit https://gerrit.osmocom.org/6203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0a899d9c866ed09dc301694dbbcad304b1ed49e5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:51:11 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:51:11 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 6 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 Tue Jan 30 23:51:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:51:54 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: separate capacity computation In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/3934/6/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 683: } unrelated cosmetic change, but not enough reason to send a separate patch now. -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:52:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:52:40 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: split off RX mask computation In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 8 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 Tue Jan 30 23:52:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:52:59 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu 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 Tue Jan 30 23:53:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:53:33 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: split allocation In-Reply-To: References: Message-ID: Patch Set 12: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 12 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 Tue Jan 30 23:53:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:53:52 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: split USF/UL allocation In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu 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 Tue Jan 30 23:58:02 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:58:02 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: internalize TRX check In-Reply-To: References: Message-ID: Patch Set 20: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 20 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:59:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:59:32 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: improve readability In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/4086/3/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 651 I don't rally get you removing the debugging code. I think holger has raised a question why it was not helpful or what is your concern herre, but there was - AFAIK - no response. are you confident that you are not removing useful log output without having a functionally similarly complete replacement in your new code? -- To view, visit https://gerrit.osmocom.org/4086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Jan 30 23:59:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 30 Jan 2018 23:59:53 +0000 Subject: osmo-pcu[master]: TS alloc: print suggested TRX on allocation errors In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Gerrit-PatchSet: 7 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 Jan 31 00:00:33 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 00:00:33 +0000 Subject: osmo-pcu[master]: TS alloc: expand tests log In-Reply-To: References: Message-ID: Patch Set 20: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 20 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 09:24:41 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 09:24:41 +0000 Subject: osmo-pcu[master]: Simplify TS alloc: move slot check into functions In-Reply-To: References: Message-ID: Patch Set 5: (1 comment) https://gerrit.osmocom.org/#/c/3935/5/src/gprs_rlcmac_ts_alloc.cpp File src/gprs_rlcmac_ts_alloc.cpp: Line 712 > is it intentional that we loose those logging / debugging capabilities? Yes: this code was always disabled anyway because it produce way too much load on osmopcu during tests. It also hard to maintain and follow due to all the nested set-flag_chars() calls. -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:10:57 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: improve readability In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/4086 to look at the new patch set (#4). Simplify TS alloc: improve readability * consistently format log messages to make it possible to grep for test output in source code * remove dead code Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 6 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/86/4086/4 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57dedb2..b5579e0 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -211,8 +211,7 @@ tfi = find_free_tfi(pdch, dir); if (tfi < 0) { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no TFI available\n", ts); + "- Skipping TS %d, because no TFI available\n", ts); continue; } } @@ -221,25 +220,22 @@ usf = find_free_usf(pdch); if (usf < 0) { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "no USF available\n", ts); + "- Skipping TS %d, because no USF available\n", ts); continue; } } if (min_ts >= 0) LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d > %d\n", - min_ts, min_used, num_tbfs); + "- Skipping TS %d, because num TBFs %d > %d\n", + min_ts, min_used, num_tbfs); min_used = num_tbfs; min_ts = ts; min_tfi = tfi; min_usf = usf; } else { LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping TS %d, because " - "num TBFs %d >= %d\n", - ts, num_tbfs, min_used); + "- Skipping TS %d, because num TBFs %d >= %d\n", + ts, num_tbfs, min_used); } } @@ -645,19 +641,6 @@ /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); - -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Considering DL/UL slots: (TS=0)\"%s\"(TS=7), " - "capacity = %d\n", - set_flag_chars(set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - rx_window & tx_window, 'C'), - capacity); -#endif if (capacity <= max_capacity) continue; -- To view, visit https://gerrit.osmocom.org/4086 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I31600462e48d945bc8b7abf86a3718ac83e1dcbb Gerrit-PatchSet: 4 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 Wed Jan 31 10:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:10:57 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: expand tests log 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/3895 to look at the new patch set (#21). TS alloc: expand tests log * restructure code for easier reading * use consistent formatting for output * log essential allocation parameters on failure Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 3 files changed, 192 insertions(+), 184 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/21 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b5579e0..707aca5 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -393,13 +393,14 @@ const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx = ms->current_trx(); - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " - "%d\n", tbf->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class %d [%s]\n", + tbf->ms_class(), (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted) for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return trx_no; } if (!trx) @@ -427,14 +428,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } @@ -810,7 +813,7 @@ LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); } - LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7), %s\n", slot_info, single ? "single" : "multi"); return sl; } @@ -898,7 +901,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): failed to allocate a TFI for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return tfi; } @@ -942,23 +946,27 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first common slots available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } + if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first slot available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 562135d..b514b78 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -193,7 +193,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -305,7 +305,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -713,7 +713,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 10 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -931,7 +931,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -189959,7 +189959,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190155,7 +190155,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=12/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190351,7 +190351,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=12/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190547,7 +190547,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=9/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190743,7 +190743,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190939,7 +190939,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 @@ -190961,7 +190961,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -191176,7 +191176,7 @@ TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -191373,7 +191373,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -191569,11 +191569,11 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=10/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -192701,7 +192701,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -192932,7 +192932,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 @@ -193164,7 +193164,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -193666,7 +193666,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -193916,7 +193916,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194148,7 +194148,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194380,7 +194380,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194390,7 +194390,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194400,7 +194400,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194410,8 +194410,8 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = f0 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -194519,7 +194519,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194619,7 +194619,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194719,26 +194719,26 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -195225,7 +195225,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195325,7 +195325,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195425,7 +195425,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). @@ -195702,7 +195702,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -196829,7 +196829,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -196937,7 +196937,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0xc0000022 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 35 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -198415,7 +198415,7 @@ TBF(TFI=0 TLLI=0xc000009f DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -199218,7 +199218,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -199450,7 +199450,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 @@ -199845,7 +199845,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously 32) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free @@ -200010,7 +200010,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200242,7 +200242,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 40 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -200696,7 +200696,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=44/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 89 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200771,7 +200771,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0xc0000017 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=25/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 24 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -202026,7 +202026,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -202829,7 +202829,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating DL TBF: MS_CLASS=11/11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 98ec04b..a48487d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1,7 +1,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 4, because not enabled @@ -18,7 +18,7 @@ Modifying MS object, TLLI = 0x00002342, TA 220 -> 4 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 3, because need to reuse TS @@ -41,7 +41,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -90,7 +90,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -128,7 +128,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -177,7 +177,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -215,7 +215,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -468,7 +468,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -490,7 +490,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -531,7 +531,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -556,7 +556,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -581,7 +581,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -606,7 +606,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -631,7 +631,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -656,7 +656,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -681,7 +681,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -706,7 +706,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -731,7 +731,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -756,7 +756,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -781,7 +781,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -806,7 +806,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -831,7 +831,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -856,7 +856,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -881,7 +881,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -906,7 +906,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -931,7 +931,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -956,7 +956,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -981,7 +981,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1006,7 +1006,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1031,7 +1031,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1056,7 +1056,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1081,7 +1081,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1106,7 +1106,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1131,7 +1131,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1156,7 +1156,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1181,7 +1181,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1206,7 +1206,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1231,7 +1231,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1256,7 +1256,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1281,7 +1281,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1306,7 +1306,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1331,15 +1331,15 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +Slot Allocation (Algorithm A) for class 45 [DL] +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1369,7 +1369,7 @@ ********** DL-TBF ends here ********** ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1427,7 +1427,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1470,7 +1470,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1505,7 +1505,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1549,7 +1549,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1584,7 +1584,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1627,7 +1627,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1713,7 +1713,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1778,7 +1778,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1821,7 +1821,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1870,7 +1870,7 @@ MS requests UL TBF in packet resource request of single block, so we provide one: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1901,7 +1901,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1943,7 +1943,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1986,7 +1986,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2022,7 +2022,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2087,7 +2087,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2130,7 +2130,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2763,7 +2763,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3017,8 +3017,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3056,8 +3056,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3099,7 +3099,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3148,7 +3148,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3188,7 +3188,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3367,7 +3367,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3398,7 +3398,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3704,7 +3704,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3960,7 +3960,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4178,7 +4178,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4364,7 +4364,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4530,7 +4530,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4678,7 +4678,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4821,7 +4821,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4953,7 +4953,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5085,7 +5085,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5140,7 +5140,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5195,7 +5195,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5250,7 +5250,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5321,7 +5321,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5392,7 +5392,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5463,7 +5463,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5534,7 +5534,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5596,7 +5596,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5658,7 +5658,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5720,7 +5720,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5798,7 +5798,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5866,7 +5866,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5905,7 +5905,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -5919,8 +5919,8 @@ PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Searching for first unallocated TFI: TRX=0 Found TFI=0. -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -5958,7 +5958,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6020,7 +6020,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6051,7 +6051,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6087,7 +6087,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6111,7 +6111,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6135,7 +6135,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6159,7 +6159,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6183,7 +6183,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6207,7 +6207,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6231,7 +6231,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6255,7 +6255,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6264,7 +6264,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Destroying MS object, TLLI = 0x00000000 MS requests UL TBF on RACH, so we provide one: ra=0x70 Fn=2654167 qta=31 is_11bit=0: @@ -6288,7 +6288,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6906,7 +6906,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7678,7 +7678,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7700,7 +7700,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7724,7 +7724,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7748,7 +7748,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7772,7 +7772,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7796,7 +7796,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7820,7 +7820,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7844,7 +7844,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7874,7 +7874,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7883,7 +7883,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 21 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:10:57 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#9). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 3 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/9 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 707aca5..5cebed4 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -36,20 +36,6 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) -{ - int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) - buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } - - return buf; -} - static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; @@ -588,11 +574,9 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_format(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:10:57 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: print suggested TRX on allocation errors 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/3931 to look at the new patch set (#8). TS alloc: print suggested TRX on allocation errors If TS allocation fails due to unavailable TFI, print TRX which was suggested to allocator. This simplifies allocator debugging but requires cosmetic modifications to test output. Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Related: OS#2282 --- M src/bts.cpp M tests/alloc/AllocTest.err 2 files changed, 825 insertions(+), 825 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/31/3931/8 -- To view, visit https://gerrit.osmocom.org/3931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:10:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:10:57 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3932 to look at the new patch set (#8). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.ok 2 files changed, 2,163 insertions(+), 2,163 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/3932/8 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1c98e46..6ea8ff4 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -595,24 +596,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves " OSMO_BIT_SPEC " [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index d2d9be1..e950700 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -13181,2201 +13181,2201 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=44 Mass test: TS0(OOOOOOOO)TS7 MS_Class=45 Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL) Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DDC - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DDC.. - TBF[7] class 10 reserves .....DDC - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DDC.. - TBF[11] class 10 reserves .....DDC - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DDC.. - TBF[15] class 10 reserves .....DDC - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DDC.. - TBF[19] class 10 reserves .....DDC - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DDC.. - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DDCD. - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves .....DDC - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL) Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) - TBF[0] class 12 reserves ...DDCD. - TBF[1] class 12 reserves .....DCD - TBF[2] class 12 reserves ...DCD.. - TBF[3] class 12 reserves .....DDC - TBF[4] class 12 reserves ...DCD.. - TBF[5] class 12 reserves .....DCD - TBF[6] class 12 reserves ...DDC.. - TBF[7] class 12 reserves .....DDC - TBF[8] class 12 reserves ...DCD.. - TBF[9] class 12 reserves .....DCD - TBF[10] class 12 reserves ...DDC.. - TBF[11] class 12 reserves .....DDC - TBF[12] class 12 reserves ...DCD.. - TBF[13] class 12 reserves .....DCD - TBF[14] class 12 reserves ...DDC.. - TBF[15] class 12 reserves .....DDC - TBF[16] class 12 reserves ...DCD.. - TBF[17] class 12 reserves .....DCD - TBF[18] class 12 reserves ...DDC.. - TBF[19] class 12 reserves .....DDC - TBF[20] class 12 reserves ...DCD.. - TBF[21] class 12 reserves .....DCD - TBF[22] class 12 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 12 reserves ...DCD.. - TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...DDCD. - TBF[27] class 12 reserves ...CD... - TBF[28] class 12 reserves .....DDC - TBF[29] class 12 reserves ...CD... - TBF[30] class 12 reserves ...CD... - TBF[31] class 12 reserves ...CD... + TBF[ 0] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 12 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL) Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 1 reserves ...C.... - TBF[13] class 2 reserves ......DC - TBF[14] class 3 reserves ...DC... - TBF[15] class 4 reserves ....DCD. - TBF[16] class 5 reserves ......CD - TBF[17] class 6 reserves ...CD... - TBF[18] class 7 reserves ......DC - TBF[19] class 8 reserves ...DDCD. - TBF[20] class 9 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 11 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 1 reserves ...C.... - TBF[25] class 2 reserves ......DC - TBF[26] class 3 reserves ...DC... - TBF[27] class 4 reserves .....DCD - TBF[28] class 5 reserves ...CD... - TBF[29] class 6 reserves ......CD - TBF[30] class 7 reserves ...CD... - TBF[31] class 8 reserves ...DDCD. + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[14] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[15] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[16] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[17] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[18] class 7 reserves ......DC [ 1 / 2 / 0 ] + TBF[19] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 11 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[26] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[27] class 4 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 6 reserves ......CD [ 1 / 2 / 0 ] + TBF[30] class 7 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL) Going to test assignment with many TBF, algorithm B class 1..46 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDDC + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDDC [ 1 / 4 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 1..46 (UL and DL) Going to test assignment with many TBF, algorithm dynamic class 1..46 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDDC - TBF[1] class 33 reserves ...C.... - TBF[2] class 34 reserves ...C.... - TBF[3] class 35 reserves ...C.... + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDDC [ 1 / 4 / 0 ] + TBF[ 1] class 33 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 35 reserves ...C.... [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 1..46 (UL and DL) Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL) Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL) Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL) Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[2] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[4] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[14] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[27] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[16] class 10 reserves ......C. - TBF[26] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[18] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[31] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[20] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[22] class 10 reserves ......C. - TBF[25] class 10 reserves ....C... - TBF[24] class 10 reserves ......C. - TBF[27] class 10 reserves ....C... - TBF[26] class 10 reserves ......C. - TBF[29] class 10 reserves ....C... - TBF[28] class 10 reserves ......C. - TBF[31] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL) Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL) Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL) Going to test assignment with many TBF, algorithm A class 1..1 (UL only) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only) Going to test assignment with many TBF, algorithm B class 10..10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only) Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only) Going to test assignment with many TBF, algorithm A class 1..1 (DL only) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only) Going to test assignment with many TBF, algorithm B class 10..10 (DL only) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[2] class 10 reserves ......C. - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[4] class 10 reserves ......C. - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[22] class 10 reserves .....C.. - TBF[14] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[24] class 10 reserves .....C.. - TBF[16] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[25] class 10 reserves .....C.. - TBF[18] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[27] class 10 reserves .....C.. - TBF[20] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[26] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[30] class 10 reserves .....C.. - TBF[22] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[28] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[31] class 10 reserves .....C.. - TBF[24] class 10 reserves ......C. - TBF[25] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[25] class 10 reserves ......C. - TBF[27] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[27] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[26] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[29] class 10 reserves ....C... - TBF[31] class 10 reserves ......C. - TBF[31] class 10 reserves .......C + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only) Going to test assignment with many connections, algorithm A - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 1 reserves .......C - TBF[1] class 2 reserves ......DC - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...CD... - TBF[28] class 29 reserves ...DCD.. - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 29 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[5] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[6] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[8] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[19] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[21] class 17 reserves .......C - TBF[18] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[18] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[23] class 22 reserves .......C - TBF[20] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[20] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[22] class 28 reserves ...C.... - TBF[22] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[27] class 31 reserves .......C - TBF[24] class 32 reserves ...C.... - TBF[24] class 33 reserves ....C... - TBF[21] class 34 reserves ......C. - TBF[30] class 35 reserves .......C - TBF[26] class 36 reserves ...C.... - TBF[26] class 37 reserves ....C... - TBF[23] class 38 reserves ......C. - TBF[28] class 39 reserves ...C.... - TBF[28] class 40 reserves ....C... - TBF[25] class 41 reserves ......C. - TBF[31] class 42 reserves ...C.... - TBF[27] class 43 reserves ......C. - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[17] class 30 reserves ......C. - TBF[6] class 31 reserves .....C.. - TBF[18] class 32 reserves ......C. - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[4] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[5] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[6] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[7] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[8] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[9] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[10] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[15] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[11] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[16] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[12] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[13] class 31 reserves .......C - TBF[18] class 32 reserves ...C.... - TBF[18] class 33 reserves ....C... - TBF[20] class 34 reserves ......C. - TBF[14] class 35 reserves .......C - TBF[19] class 36 reserves ...C.... - TBF[19] class 37 reserves ....C... - TBF[21] class 38 reserves ......C. - TBF[20] class 39 reserves ...C.... - TBF[20] class 40 reserves ....C... - TBF[22] class 41 reserves ......C. - TBF[21] class 42 reserves ...C.... - TBF[23] class 43 reserves ......C. - TBF[7] class 44 reserves .....C.. - TBF[8] class 45 reserves .....C.. - TBF[9] class 46 reserves .....C.. - TBF[10] class 1 reserves .....C.. - TBF[11] class 2 reserves .....C.. - TBF[12] class 3 reserves .....C.. - TBF[13] class 4 reserves .....C.. - TBF[14] class 5 reserves .....C.. - TBF[15] class 6 reserves .....C.. - TBF[15] class 7 reserves .......C - TBF[16] class 8 reserves .....C.. - TBF[16] class 9 reserves .......C - TBF[17] class 10 reserves .....C.. - TBF[17] class 11 reserves .......C - TBF[18] class 12 reserves .....C.. - TBF[18] class 13 reserves .......C - TBF[19] class 14 reserves .....C.. - TBF[19] class 15 reserves .......C - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves .......C - TBF[21] class 18 reserves ....C... - TBF[21] class 19 reserves .....C.. - TBF[21] class 20 reserves .......C - TBF[22] class 21 reserves ...C.... - TBF[22] class 22 reserves ....C... - TBF[22] class 23 reserves .....C.. - TBF[22] class 24 reserves .......C - TBF[23] class 25 reserves ...C.... - TBF[23] class 26 reserves ....C... - TBF[23] class 27 reserves .....C.. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[17] class 30 reserves ......C. - TBF[6] class 31 reserves .....C.. - TBF[18] class 32 reserves ......C. - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[4] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[5] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[6] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[7] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[8] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[9] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[10] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[15] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[11] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[16] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[12] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[13] class 31 reserves .......C - TBF[18] class 32 reserves ...C.... - TBF[18] class 33 reserves ....C... - TBF[20] class 34 reserves ......C. - TBF[14] class 35 reserves .......C - TBF[19] class 36 reserves ...C.... - TBF[19] class 37 reserves ....C... - TBF[21] class 38 reserves ......C. - TBF[20] class 39 reserves ...C.... - TBF[20] class 40 reserves ....C... - TBF[22] class 41 reserves ......C. - TBF[21] class 42 reserves ...C.... - TBF[23] class 43 reserves ......C. - TBF[7] class 44 reserves .....C.. - TBF[8] class 45 reserves .....C.. - TBF[9] class 46 reserves .....C.. - TBF[10] class 1 reserves .....C.. - TBF[11] class 2 reserves .....C.. - TBF[12] class 3 reserves .....C.. - TBF[13] class 4 reserves .....C.. - TBF[14] class 5 reserves .....C.. - TBF[15] class 6 reserves .....C.. - TBF[15] class 7 reserves .......C - TBF[16] class 8 reserves .....C.. - TBF[16] class 9 reserves .......C - TBF[17] class 10 reserves .....C.. - TBF[17] class 11 reserves .......C - TBF[18] class 12 reserves .....C.. - TBF[18] class 13 reserves .......C - TBF[19] class 14 reserves .....C.. - TBF[19] class 15 reserves .......C - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves .......C - TBF[21] class 18 reserves ....C... - TBF[21] class 19 reserves .....C.. - TBF[21] class 20 reserves .......C - TBF[22] class 21 reserves ...C.... - TBF[22] class 22 reserves ....C... - TBF[22] class 23 reserves .....C.. - TBF[22] class 24 reserves .......C - TBF[23] class 25 reserves ...C.... - TBF[23] class 26 reserves ....C... - TBF[23] class 27 reserves .....C.. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 0] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 1] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 1] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 1] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[ 3] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[ 3] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 5] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 6] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 5] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 6] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 44 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 44 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) -- To view, visit https://gerrit.osmocom.org/3932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:21:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:21:57 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: expand tests log 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/3895 to look at the new patch set (#22). TS alloc: expand tests log * restructure code for easier reading * use consistent formatting for output * log essential allocation parameters on failure Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 3 files changed, 192 insertions(+), 184 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/22 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index b5579e0..707aca5 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -393,13 +393,14 @@ const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx = ms->current_trx(); - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " - "%d\n", tbf->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class %d [%s]\n", + tbf->ms_class(), (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted) for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return trx_no; } if (!trx) @@ -427,14 +428,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } @@ -810,7 +813,7 @@ LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); } - LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7), %s\n", slot_info, single ? "single" : "multi"); return sl; } @@ -898,7 +901,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): failed to allocate a TFI for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return tfi; } @@ -942,23 +946,27 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first common slots available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } + if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first slot available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 562135d..b514b78 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -193,7 +193,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -305,7 +305,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -713,7 +713,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 10 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -931,7 +931,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -189959,7 +189959,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190155,7 +190155,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=12/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190351,7 +190351,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=12/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190547,7 +190547,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=9/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190743,7 +190743,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190939,7 +190939,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 @@ -190961,7 +190961,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -191176,7 +191176,7 @@ TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -191373,7 +191373,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -191569,11 +191569,11 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=10/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -192701,7 +192701,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -192932,7 +192932,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 @@ -193164,7 +193164,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -193666,7 +193666,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -193916,7 +193916,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194148,7 +194148,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194380,7 +194380,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194390,7 +194390,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194400,7 +194400,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194410,8 +194410,8 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = f0 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -194519,7 +194519,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194619,7 +194619,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194719,26 +194719,26 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -195225,7 +195225,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195325,7 +195325,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195425,7 +195425,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). @@ -195702,7 +195702,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -196829,7 +196829,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -196937,7 +196937,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0xc0000022 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 35 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -198415,7 +198415,7 @@ TBF(TFI=0 TLLI=0xc000009f DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -199218,7 +199218,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -199450,7 +199450,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 @@ -199845,7 +199845,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously 32) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free @@ -200010,7 +200010,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200242,7 +200242,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 40 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -200696,7 +200696,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=44/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 89 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200771,7 +200771,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0xc0000017 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=25/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 24 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -202026,7 +202026,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -202829,7 +202829,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating DL TBF: MS_CLASS=11/11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 98ec04b..a48487d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1,7 +1,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 4, because not enabled @@ -18,7 +18,7 @@ Modifying MS object, TLLI = 0x00002342, TA 220 -> 4 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 3, because need to reuse TS @@ -41,7 +41,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -90,7 +90,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -128,7 +128,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -177,7 +177,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -215,7 +215,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -468,7 +468,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -490,7 +490,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -531,7 +531,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -556,7 +556,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -581,7 +581,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -606,7 +606,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -631,7 +631,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -656,7 +656,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -681,7 +681,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -706,7 +706,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -731,7 +731,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -756,7 +756,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -781,7 +781,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -806,7 +806,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -831,7 +831,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -856,7 +856,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -881,7 +881,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -906,7 +906,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -931,7 +931,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -956,7 +956,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -981,7 +981,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1006,7 +1006,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1031,7 +1031,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1056,7 +1056,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1081,7 +1081,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1106,7 +1106,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1131,7 +1131,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1156,7 +1156,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1181,7 +1181,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1206,7 +1206,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1231,7 +1231,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1256,7 +1256,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1281,7 +1281,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1306,7 +1306,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1331,15 +1331,15 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +Slot Allocation (Algorithm A) for class 45 [DL] +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1369,7 +1369,7 @@ ********** DL-TBF ends here ********** ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1427,7 +1427,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1470,7 +1470,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1505,7 +1505,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1549,7 +1549,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1584,7 +1584,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1627,7 +1627,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1713,7 +1713,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1778,7 +1778,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1821,7 +1821,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1870,7 +1870,7 @@ MS requests UL TBF in packet resource request of single block, so we provide one: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1901,7 +1901,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1943,7 +1943,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1986,7 +1986,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2022,7 +2022,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2087,7 +2087,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2130,7 +2130,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2763,7 +2763,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3017,8 +3017,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3056,8 +3056,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3099,7 +3099,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3148,7 +3148,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3188,7 +3188,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3367,7 +3367,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3398,7 +3398,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3704,7 +3704,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3960,7 +3960,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4178,7 +4178,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4364,7 +4364,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4530,7 +4530,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4678,7 +4678,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4821,7 +4821,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4953,7 +4953,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5085,7 +5085,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5140,7 +5140,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5195,7 +5195,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5250,7 +5250,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5321,7 +5321,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5392,7 +5392,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5463,7 +5463,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5534,7 +5534,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5596,7 +5596,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5658,7 +5658,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5720,7 +5720,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5798,7 +5798,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5866,7 +5866,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5905,7 +5905,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -5919,8 +5919,8 @@ PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Searching for first unallocated TFI: TRX=0 Found TFI=0. -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -5958,7 +5958,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6020,7 +6020,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6051,7 +6051,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6087,7 +6087,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6111,7 +6111,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6135,7 +6135,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6159,7 +6159,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6183,7 +6183,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6207,7 +6207,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6231,7 +6231,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6255,7 +6255,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6264,7 +6264,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Destroying MS object, TLLI = 0x00000000 MS requests UL TBF on RACH, so we provide one: ra=0x70 Fn=2654167 qta=31 is_11bit=0: @@ -6288,7 +6288,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6906,7 +6906,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7678,7 +7678,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7700,7 +7700,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7724,7 +7724,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7748,7 +7748,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7772,7 +7772,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7796,7 +7796,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7820,7 +7820,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7844,7 +7844,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7874,7 +7874,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7883,7 +7883,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 22 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:21:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:21:57 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#10). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 3 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/10 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 707aca5..5cebed4 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -36,20 +36,6 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) -{ - int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) - buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } - - return buf; -} - static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; @@ -588,11 +574,9 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_format(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:21:57 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:21:57 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: update tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3932 to look at the new patch set (#9). TS alloc: update tests * restructure code for easier reading * rearrange tests order to facilitate further UL alloc changes Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Related: OS#2282 --- M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.ok 2 files changed, 2,163 insertions(+), 2,163 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/32/3932/9 diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index 1c98e46..6ea8ff4 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -21,6 +21,7 @@ #include "gprs_debug.h" #include "tbf.h" #include "bts.h" +#include "pcu_utils.h" #include #include @@ -595,24 +596,23 @@ busy_slots |= 1 << i; } - printf(" TBF[%d] class %d reserves " OSMO_BIT_SPEC "\n", - tfi, ms_class, - get_dir_char(0x01, ul_slots, dl_slots, busy_slots), - get_dir_char(0x02, ul_slots, dl_slots, busy_slots), - get_dir_char(0x04, ul_slots, dl_slots, busy_slots), - get_dir_char(0x08, ul_slots, dl_slots, busy_slots), - get_dir_char(0x10, ul_slots, dl_slots, busy_slots), - get_dir_char(0x20, ul_slots, dl_slots, busy_slots), - get_dir_char(0x40, ul_slots, dl_slots, busy_slots), - get_dir_char(0x80, ul_slots, dl_slots, busy_slots)); + printf(" TBF[%2d] class %2d reserves " OSMO_BIT_SPEC " [%2u /%2u /%2u ]\n", + tfi, ms_class, + get_dir_char(0x01, ul_slots, dl_slots, busy_slots), + get_dir_char(0x02, ul_slots, dl_slots, busy_slots), + get_dir_char(0x04, ul_slots, dl_slots, busy_slots), + get_dir_char(0x08, ul_slots, dl_slots, busy_slots), + get_dir_char(0x10, ul_slots, dl_slots, busy_slots), + get_dir_char(0x20, ul_slots, dl_slots, busy_slots), + get_dir_char(0x40, ul_slots, dl_slots, busy_slots), + get_dir_char(0x80, ul_slots, dl_slots, busy_slots), + pcu_bitcount(ul_slots), pcu_bitcount(dl_slots), pcu_bitcount(busy_slots)); if (tfi >= 0) { OSMO_ASSERT(ms->current_trx()); - tfi2 = the_bts->tfi_find_free(dir, &trx_no2, - ms->current_trx()->trx_no); + tfi2 = the_bts->tfi_find_free(dir, &trx_no2, ms->current_trx()->trx_no); OSMO_ASSERT(tfi != tfi2); - OSMO_ASSERT(tfi2 < 0 || - trx_no2 == ms->current_trx()->trx_no); + OSMO_ASSERT(tfi2 < 0 || trx_no2 == ms->current_trx()->trx_no); } ms_class += 1; diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index d2d9be1..e950700 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -13181,2201 +13181,2201 @@ Mass test: TS0(OOOOOOOO)TS7 MS_Class=44 Mass test: TS0(OOOOOOOO)TS7 MS_Class=45 Going to test assignment with many TBF, algorithm A class 1..1 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL and DL) Going to test assignment with many TBF, algorithm B class 10..10 (UL and DL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DDC - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DDC.. - TBF[7] class 10 reserves .....DDC - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DDC.. - TBF[11] class 10 reserves .....DDC - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DDC.. - TBF[15] class 10 reserves .....DDC - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DDC.. - TBF[19] class 10 reserves .....DDC - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DDC.. - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DDCD. - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves .....DDC - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL and DL) Going to test assignment with many TBF, algorithm B class 12..12 (UL and DL) - TBF[0] class 12 reserves ...DDCD. - TBF[1] class 12 reserves .....DCD - TBF[2] class 12 reserves ...DCD.. - TBF[3] class 12 reserves .....DDC - TBF[4] class 12 reserves ...DCD.. - TBF[5] class 12 reserves .....DCD - TBF[6] class 12 reserves ...DDC.. - TBF[7] class 12 reserves .....DDC - TBF[8] class 12 reserves ...DCD.. - TBF[9] class 12 reserves .....DCD - TBF[10] class 12 reserves ...DDC.. - TBF[11] class 12 reserves .....DDC - TBF[12] class 12 reserves ...DCD.. - TBF[13] class 12 reserves .....DCD - TBF[14] class 12 reserves ...DDC.. - TBF[15] class 12 reserves .....DDC - TBF[16] class 12 reserves ...DCD.. - TBF[17] class 12 reserves .....DCD - TBF[18] class 12 reserves ...DDC.. - TBF[19] class 12 reserves .....DDC - TBF[20] class 12 reserves ...DCD.. - TBF[21] class 12 reserves .....DCD - TBF[22] class 12 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 12 reserves ...DCD.. - TBF[25] class 12 reserves .....DCD - TBF[26] class 12 reserves ...DDCD. - TBF[27] class 12 reserves ...CD... - TBF[28] class 12 reserves .....DDC - TBF[29] class 12 reserves ...CD... - TBF[30] class 12 reserves ...CD... - TBF[31] class 12 reserves ...CD... + TBF[ 0] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 4] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[ 7] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[ 8] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[12] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[15] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[16] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[19] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[20] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 12 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 12 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 12 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[27] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 12 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 12 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 12..12 (UL and DL) Going to test assignment with many TBF, algorithm B class 1..12 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 1 reserves ...C.... - TBF[13] class 2 reserves ......DC - TBF[14] class 3 reserves ...DC... - TBF[15] class 4 reserves ....DCD. - TBF[16] class 5 reserves ......CD - TBF[17] class 6 reserves ...CD... - TBF[18] class 7 reserves ......DC - TBF[19] class 8 reserves ...DDCD. - TBF[20] class 9 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 11 reserves ...DDC.. - TBF[23] class 12 reserves .....DDC - TBF[24] class 1 reserves ...C.... - TBF[25] class 2 reserves ......DC - TBF[26] class 3 reserves ...DC... - TBF[27] class 4 reserves .....DCD - TBF[28] class 5 reserves ...CD... - TBF[29] class 6 reserves ......CD - TBF[30] class 7 reserves ...CD... - TBF[31] class 8 reserves ...DDCD. + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[14] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[15] class 4 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[16] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[17] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[18] class 7 reserves ......DC [ 1 / 2 / 0 ] + TBF[19] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 11 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[23] class 12 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[26] class 3 reserves ...DC... [ 1 / 2 / 0 ] + TBF[27] class 4 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 6 reserves ......CD [ 1 / 2 / 0 ] + TBF[30] class 7 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 1..12 (UL and DL) Going to test assignment with many TBF, algorithm B class 1..46 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDDC + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDDC [ 1 / 4 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 1..46 (UL and DL) Going to test assignment with many TBF, algorithm dynamic class 1..46 (UL and DL) - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DDC - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....DCDD - TBF[14] class 15 reserves ...DDDDC - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...DCDDD - TBF[17] class 18 reserves ...DDCDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DDC - TBF[21] class 22 reserves ...DDC.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DDC - TBF[25] class 26 reserves ...DDC.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DDC - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDDC - TBF[1] class 33 reserves ...C.... - TBF[2] class 34 reserves ...C.... - TBF[3] class 35 reserves ...C.... + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....DCDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...DDDDC [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...DCDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...DDCDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DDC [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DDC.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DDC [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDDC [ 1 / 4 / 0 ] + TBF[ 1] class 33 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 35 reserves ...C.... [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 1..46 (UL and DL) Going to test assignment with many TBF, algorithm A class 1..1 (DL and UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (DL and UL) Going to test assignment with many TBF, algorithm B class 10..10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL and UL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL and UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves ...DDCD. - TBF[16] class 10 reserves ...DDCD. - TBF[17] class 10 reserves ...DDCD. - TBF[18] class 10 reserves ...DDCD. - TBF[19] class 10 reserves ...DDCD. - TBF[20] class 10 reserves ...DDCD. - TBF[21] class 10 reserves .....DDC - TBF[22] class 10 reserves .....DDC - TBF[23] class 10 reserves .....DDC - TBF[24] class 10 reserves .....DDC - TBF[25] class 10 reserves .....DDC - TBF[26] class 10 reserves ...CD... - TBF[27] class 10 reserves .....DDC - TBF[28] class 10 reserves ...CD... - TBF[29] class 10 reserves ...CD... - TBF[30] class 10 reserves .....DDC - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[16] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[17] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[18] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[19] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[20] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[21] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[22] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[24] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[27] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[29] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[30] class 10 reserves .....DDC [ 1 / 3 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm dynamic class 10..10 (DL and UL) Going to test assignment with many TBF, algorithm A class 1..1 (DL after UL) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL after UL) Going to test assignment with many TBF, algorithm B class 10..10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL after UL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL after UL) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...DCD.. - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...DCD.. - TBF[25] class 10 reserves .....DCD - TBF[26] class 10 reserves ...DCD.. - TBF[27] class 10 reserves .....DCD - TBF[28] class 10 reserves ...DCD.. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...DCD.. - TBF[31] class 10 reserves .....DCD - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[2] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[4] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[14] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[27] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[16] class 10 reserves ......C. - TBF[26] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[18] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[31] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[20] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[22] class 10 reserves ......C. - TBF[25] class 10 reserves ....C... - TBF[24] class 10 reserves ......C. - TBF[27] class 10 reserves ....C... - TBF[26] class 10 reserves ......C. - TBF[29] class 10 reserves ....C... - TBF[28] class 10 reserves ......C. - TBF[31] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[25] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[26] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[27] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[28] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[31] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] Successfully allocated 95 UL TBFs, algorithm dynamic class 10..10 (DL after UL) Going to test assignment with many TBF, algorithm A class 1..1 (UL after DL) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL after DL) Going to test assignment with many TBF, algorithm B class 10..10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL after DL) Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL after DL) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves ......U. - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves ....U... - TBF[7] class 10 reserves ......U. - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves ....U... - TBF[11] class 10 reserves ......U. - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves ....U... - TBF[15] class 10 reserves .....U.. - TBF[16] class 10 reserves .....U.. - TBF[17] class 10 reserves .....U.. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .....U.. - TBF[20] class 10 reserves .....U.. - TBF[21] class 10 reserves .......U - TBF[22] class 10 reserves .......U - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves .......U - TBF[25] class 10 reserves .......U - TBF[26] class 10 reserves ...U.... - TBF[27] class 10 reserves .......U - TBF[28] class 10 reserves ...U.... - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves .......U - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[11] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[16] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[17] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[20] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[21] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[25] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[26] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[27] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[28] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL after DL) Going to test assignment with many TBF, algorithm A class 1..1 (UL only) - TBF[0] class 1 reserves ...U.... - TBF[0] class 1 reserves ....U... - TBF[0] class 1 reserves .....U.. - TBF[0] class 1 reserves ......U. - TBF[0] class 1 reserves .......U - TBF[1] class 1 reserves ...U.... - TBF[1] class 1 reserves ....U... - TBF[1] class 1 reserves .....U.. - TBF[1] class 1 reserves ......U. - TBF[1] class 1 reserves .......U - TBF[2] class 1 reserves ...U.... - TBF[2] class 1 reserves ....U... - TBF[2] class 1 reserves .....U.. - TBF[2] class 1 reserves ......U. - TBF[2] class 1 reserves .......U - TBF[3] class 1 reserves ...U.... - TBF[3] class 1 reserves ....U... - TBF[3] class 1 reserves .....U.. - TBF[3] class 1 reserves ......U. - TBF[3] class 1 reserves .......U - TBF[4] class 1 reserves ...U.... - TBF[4] class 1 reserves ....U... - TBF[4] class 1 reserves .....U.. - TBF[4] class 1 reserves ......U. - TBF[4] class 1 reserves .......U - TBF[5] class 1 reserves ...U.... - TBF[5] class 1 reserves ....U... - TBF[5] class 1 reserves .....U.. - TBF[5] class 1 reserves ......U. - TBF[5] class 1 reserves .......U - TBF[6] class 1 reserves ...U.... - TBF[6] class 1 reserves ....U... - TBF[6] class 1 reserves .....U.. - TBF[6] class 1 reserves ......U. - TBF[6] class 1 reserves .......U + TBF[ 0] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 0] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 1] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 3] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 4] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 5] class 1 reserves .......U [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 1 reserves .......U [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm A class 1..1 (UL only) Going to test assignment with many TBF, algorithm B class 10..10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (UL only) Going to test assignment with many TBF, algorithm dynamic class 10..10 (UL only) - TBF[0] class 10 reserves .....U.. - TBF[1] class 10 reserves ......U. - TBF[2] class 10 reserves ....U... - TBF[3] class 10 reserves .......U - TBF[4] class 10 reserves ....U... - TBF[5] class 10 reserves ......U. - TBF[6] class 10 reserves .....U.. - TBF[7] class 10 reserves .......U - TBF[8] class 10 reserves ....U... - TBF[9] class 10 reserves ......U. - TBF[10] class 10 reserves .....U.. - TBF[11] class 10 reserves .......U - TBF[12] class 10 reserves ....U... - TBF[13] class 10 reserves ......U. - TBF[14] class 10 reserves .....U.. - TBF[15] class 10 reserves .......U - TBF[16] class 10 reserves ....U... - TBF[17] class 10 reserves ......U. - TBF[18] class 10 reserves .....U.. - TBF[19] class 10 reserves .......U - TBF[20] class 10 reserves ....U... - TBF[21] class 10 reserves ......U. - TBF[22] class 10 reserves .....U.. - TBF[23] class 10 reserves .......U - TBF[24] class 10 reserves ....U... - TBF[25] class 10 reserves ......U. - TBF[26] class 10 reserves .....U.. - TBF[27] class 10 reserves ...U.... - TBF[28] class 10 reserves .......U - TBF[29] class 10 reserves ...U.... - TBF[30] class 10 reserves ...U.... - TBF[31] class 10 reserves ...U.... - TBF[0] class 10 reserves ...U.... - TBF[1] class 10 reserves ...U.... - TBF[2] class 10 reserves ...U.... + TBF[ 0] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 3] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 4] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 5] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[ 6] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[ 7] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[ 8] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[ 9] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[10] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[11] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[12] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[13] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[14] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[15] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[16] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[17] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[18] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[19] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[20] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[21] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[22] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[23] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[24] class 10 reserves ....U... [ 1 / 0 / 0 ] + TBF[25] class 10 reserves ......U. [ 1 / 0 / 0 ] + TBF[26] class 10 reserves .....U.. [ 1 / 0 / 0 ] + TBF[27] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[28] class 10 reserves .......U [ 1 / 0 / 0 ] + TBF[29] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[30] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[31] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 0] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 1] class 10 reserves ...U.... [ 1 / 0 / 0 ] + TBF[ 2] class 10 reserves ...U.... [ 1 / 0 / 0 ] Successfully allocated 35 UL TBFs, algorithm dynamic class 10..10 (UL only) Going to test assignment with many TBF, algorithm A class 1..1 (DL only) - TBF[0] class 1 reserves ...C.... - TBF[0] class 1 reserves ....C... - TBF[0] class 1 reserves .....C.. - TBF[0] class 1 reserves ......C. - TBF[0] class 1 reserves .......C - TBF[1] class 1 reserves ...C.... - TBF[1] class 1 reserves ....C... - TBF[1] class 1 reserves .....C.. - TBF[1] class 1 reserves ......C. - TBF[1] class 1 reserves .......C - TBF[2] class 1 reserves ...C.... - TBF[2] class 1 reserves ....C... - TBF[2] class 1 reserves .....C.. - TBF[2] class 1 reserves ......C. - TBF[2] class 1 reserves .......C - TBF[3] class 1 reserves ...C.... - TBF[3] class 1 reserves ....C... - TBF[3] class 1 reserves .....C.. - TBF[3] class 1 reserves ......C. - TBF[3] class 1 reserves .......C - TBF[4] class 1 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[4] class 1 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[5] class 1 reserves ...C.... - TBF[5] class 1 reserves ....C... - TBF[5] class 1 reserves .....C.. - TBF[5] class 1 reserves ......C. - TBF[5] class 1 reserves .......C - TBF[6] class 1 reserves ...C.... - TBF[6] class 1 reserves ....C... - TBF[6] class 1 reserves .....C.. - TBF[6] class 1 reserves ......C. - TBF[6] class 1 reserves .......C - TBF[7] class 1 reserves ...C.... - TBF[7] class 1 reserves ....C... - TBF[7] class 1 reserves .....C.. - TBF[7] class 1 reserves ......C. - TBF[7] class 1 reserves .......C - TBF[8] class 1 reserves ...C.... - TBF[8] class 1 reserves ....C... - TBF[8] class 1 reserves .....C.. - TBF[8] class 1 reserves ......C. - TBF[8] class 1 reserves .......C - TBF[9] class 1 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 1 reserves .....C.. - TBF[9] class 1 reserves ......C. - TBF[9] class 1 reserves .......C - TBF[10] class 1 reserves ...C.... - TBF[10] class 1 reserves ....C... - TBF[10] class 1 reserves .....C.. - TBF[10] class 1 reserves ......C. - TBF[10] class 1 reserves .......C - TBF[11] class 1 reserves ...C.... - TBF[11] class 1 reserves ....C... - TBF[11] class 1 reserves .....C.. - TBF[11] class 1 reserves ......C. - TBF[11] class 1 reserves .......C - TBF[12] class 1 reserves ...C.... - TBF[12] class 1 reserves ....C... - TBF[12] class 1 reserves .....C.. - TBF[12] class 1 reserves ......C. - TBF[12] class 1 reserves .......C - TBF[13] class 1 reserves ...C.... - TBF[13] class 1 reserves ....C... - TBF[13] class 1 reserves .....C.. - TBF[13] class 1 reserves ......C. - TBF[13] class 1 reserves .......C - TBF[14] class 1 reserves ...C.... - TBF[14] class 1 reserves ....C... - TBF[14] class 1 reserves .....C.. - TBF[14] class 1 reserves ......C. - TBF[14] class 1 reserves .......C - TBF[15] class 1 reserves ...C.... - TBF[15] class 1 reserves ....C... - TBF[15] class 1 reserves .....C.. - TBF[15] class 1 reserves ......C. - TBF[15] class 1 reserves .......C - TBF[16] class 1 reserves ...C.... - TBF[16] class 1 reserves ....C... - TBF[16] class 1 reserves .....C.. - TBF[16] class 1 reserves ......C. - TBF[16] class 1 reserves .......C - TBF[17] class 1 reserves ...C.... - TBF[17] class 1 reserves ....C... - TBF[17] class 1 reserves .....C.. - TBF[17] class 1 reserves ......C. - TBF[17] class 1 reserves .......C - TBF[18] class 1 reserves ...C.... - TBF[18] class 1 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 1 reserves ......C. - TBF[18] class 1 reserves .......C - TBF[19] class 1 reserves ...C.... - TBF[19] class 1 reserves ....C... - TBF[19] class 1 reserves .....C.. - TBF[19] class 1 reserves ......C. - TBF[19] class 1 reserves .......C - TBF[20] class 1 reserves ...C.... - TBF[20] class 1 reserves ....C... - TBF[20] class 1 reserves .....C.. - TBF[20] class 1 reserves ......C. - TBF[20] class 1 reserves .......C - TBF[21] class 1 reserves ...C.... - TBF[21] class 1 reserves ....C... - TBF[21] class 1 reserves .....C.. - TBF[21] class 1 reserves ......C. - TBF[21] class 1 reserves .......C - TBF[22] class 1 reserves ...C.... - TBF[22] class 1 reserves ....C... - TBF[22] class 1 reserves .....C.. - TBF[22] class 1 reserves ......C. - TBF[22] class 1 reserves .......C - TBF[23] class 1 reserves ...C.... - TBF[23] class 1 reserves ....C... - TBF[23] class 1 reserves .....C.. - TBF[23] class 1 reserves ......C. - TBF[23] class 1 reserves .......C - TBF[24] class 1 reserves ...C.... - TBF[24] class 1 reserves ....C... - TBF[24] class 1 reserves .....C.. - TBF[24] class 1 reserves ......C. - TBF[24] class 1 reserves .......C - TBF[25] class 1 reserves ...C.... - TBF[25] class 1 reserves ....C... - TBF[25] class 1 reserves .....C.. - TBF[25] class 1 reserves ......C. - TBF[25] class 1 reserves .......C - TBF[26] class 1 reserves ...C.... - TBF[26] class 1 reserves ....C... - TBF[26] class 1 reserves .....C.. - TBF[26] class 1 reserves ......C. - TBF[26] class 1 reserves .......C - TBF[27] class 1 reserves ...C.... - TBF[27] class 1 reserves ....C... - TBF[27] class 1 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 1 reserves .......C - TBF[28] class 1 reserves ...C.... - TBF[28] class 1 reserves ....C... - TBF[28] class 1 reserves .....C.. - TBF[28] class 1 reserves ......C. - TBF[28] class 1 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 1 reserves ....C... - TBF[29] class 1 reserves .....C.. - TBF[29] class 1 reserves ......C. - TBF[29] class 1 reserves .......C - TBF[30] class 1 reserves ...C.... - TBF[30] class 1 reserves ....C... - TBF[30] class 1 reserves .....C.. - TBF[30] class 1 reserves ......C. - TBF[30] class 1 reserves .......C - TBF[31] class 1 reserves ...C.... - TBF[31] class 1 reserves ....C... - TBF[31] class 1 reserves .....C.. - TBF[31] class 1 reserves ......C. - TBF[31] class 1 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 1 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 UL TBFs, algorithm A class 1..1 (DL only) Going to test assignment with many TBF, algorithm B class 10..10 (DL only) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] Successfully allocated 32 UL TBFs, algorithm B class 10..10 (DL only) Going to test assignment with many TBF, algorithm dynamic class 10..10 (DL only) - TBF[0] class 10 reserves ...DDCD. - TBF[1] class 10 reserves .....DCD - TBF[2] class 10 reserves ...DCD.. - TBF[3] class 10 reserves .....DCD - TBF[4] class 10 reserves ...DCD.. - TBF[5] class 10 reserves .....DCD - TBF[6] class 10 reserves ...DCD.. - TBF[7] class 10 reserves .....DCD - TBF[8] class 10 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 10 reserves ...DCD.. - TBF[11] class 10 reserves .....DCD - TBF[12] class 10 reserves ...DCD.. - TBF[13] class 10 reserves .....DCD - TBF[14] class 10 reserves ...DCD.. - TBF[15] class 10 reserves .....DCD - TBF[16] class 10 reserves ...DCD.. - TBF[17] class 10 reserves .....DCD - TBF[18] class 10 reserves ...DCD.. - TBF[19] class 10 reserves .....DCD - TBF[20] class 10 reserves ...DCD.. - TBF[21] class 10 reserves .....DCD - TBF[22] class 10 reserves ...CD... - TBF[23] class 10 reserves .....DCD - TBF[24] class 10 reserves ...CD... - TBF[25] class 10 reserves ...CD... - TBF[26] class 10 reserves .....DCD - TBF[27] class 10 reserves ...CD... - TBF[28] class 10 reserves ....DCD. - TBF[29] class 10 reserves .....DCD - TBF[30] class 10 reserves ...CD... - TBF[31] class 10 reserves ...CD... - TBF[1] class 10 reserves ...C.... - TBF[0] class 10 reserves .......C - TBF[3] class 10 reserves ...C.... - TBF[2] class 10 reserves .......C - TBF[5] class 10 reserves ...C.... - TBF[2] class 10 reserves ......C. - TBF[4] class 10 reserves .......C - TBF[7] class 10 reserves ...C.... - TBF[4] class 10 reserves ......C. - TBF[6] class 10 reserves .......C - TBF[9] class 10 reserves ...C.... - TBF[1] class 10 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[8] class 10 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[3] class 10 reserves ....C... - TBF[8] class 10 reserves ......C. - TBF[10] class 10 reserves .......C - TBF[13] class 10 reserves ...C.... - TBF[5] class 10 reserves ....C... - TBF[10] class 10 reserves ......C. - TBF[12] class 10 reserves .......C - TBF[15] class 10 reserves ...C.... - TBF[7] class 10 reserves ....C... - TBF[12] class 10 reserves ......C. - TBF[14] class 10 reserves .......C - TBF[17] class 10 reserves ...C.... - TBF[9] class 10 reserves ....C... - TBF[22] class 10 reserves .....C.. - TBF[14] class 10 reserves ......C. - TBF[16] class 10 reserves .......C - TBF[19] class 10 reserves ...C.... - TBF[11] class 10 reserves ....C... - TBF[24] class 10 reserves .....C.. - TBF[16] class 10 reserves ......C. - TBF[18] class 10 reserves .......C - TBF[21] class 10 reserves ...C.... - TBF[13] class 10 reserves ....C... - TBF[25] class 10 reserves .....C.. - TBF[18] class 10 reserves ......C. - TBF[20] class 10 reserves .......C - TBF[23] class 10 reserves ...C.... - TBF[15] class 10 reserves ....C... - TBF[27] class 10 reserves .....C.. - TBF[20] class 10 reserves ......C. - TBF[22] class 10 reserves .......C - TBF[26] class 10 reserves ...C.... - TBF[17] class 10 reserves ....C... - TBF[30] class 10 reserves .....C.. - TBF[22] class 10 reserves ......C. - TBF[24] class 10 reserves .......C - TBF[28] class 10 reserves ...C.... - TBF[19] class 10 reserves ....C... - TBF[31] class 10 reserves .....C.. - TBF[24] class 10 reserves ......C. - TBF[25] class 10 reserves .......C - TBF[29] class 10 reserves ...C.... - TBF[21] class 10 reserves ....C... - TBF[25] class 10 reserves ......C. - TBF[27] class 10 reserves .......C - TBF[23] class 10 reserves ....C... - TBF[27] class 10 reserves ......C. - TBF[28] class 10 reserves .......C - TBF[26] class 10 reserves ....C... - TBF[30] class 10 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[29] class 10 reserves ....C... - TBF[31] class 10 reserves ......C. - TBF[31] class 10 reserves .......C + TBF[ 0] class 10 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 1] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 7] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 8] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[13] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[14] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[15] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[16] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[17] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[18] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[19] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[20] class 10 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[21] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[22] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[23] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[24] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[25] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[26] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 10 reserves ....DCD. [ 1 / 3 / 0 ] + TBF[29] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[30] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[31] class 10 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 10 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 101 UL TBFs, algorithm dynamic class 10..10 (DL only) Going to test assignment with many connections, algorithm A - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....C... - TBF[0] class 3 reserves .....C.. - TBF[0] class 4 reserves ......C. - TBF[0] class 5 reserves .......C - TBF[1] class 6 reserves ...C.... - TBF[1] class 7 reserves ....C... - TBF[1] class 8 reserves .....C.. - TBF[1] class 9 reserves ......C. - TBF[1] class 10 reserves .......C - TBF[2] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[2] class 13 reserves .....C.. - TBF[2] class 14 reserves ......C. - TBF[2] class 15 reserves .......C - TBF[3] class 16 reserves ...C.... - TBF[3] class 17 reserves ....C... - TBF[3] class 18 reserves .....C.. - TBF[3] class 19 reserves ......C. - TBF[3] class 20 reserves .......C - TBF[4] class 21 reserves ...C.... - TBF[4] class 22 reserves ....C... - TBF[4] class 23 reserves .....C.. - TBF[4] class 24 reserves ......C. - TBF[4] class 25 reserves .......C - TBF[5] class 26 reserves ...C.... - TBF[5] class 27 reserves ....C... - TBF[5] class 28 reserves .....C.. - TBF[5] class 29 reserves ......C. - TBF[5] class 30 reserves .......C - TBF[6] class 31 reserves ...C.... - TBF[6] class 32 reserves ....C... - TBF[6] class 33 reserves .....C.. - TBF[6] class 34 reserves ......C. - TBF[6] class 35 reserves .......C - TBF[7] class 36 reserves ...C.... - TBF[7] class 37 reserves ....C... - TBF[7] class 38 reserves .....C.. - TBF[7] class 39 reserves ......C. - TBF[7] class 40 reserves .......C - TBF[8] class 41 reserves ...C.... - TBF[8] class 42 reserves ....C... - TBF[8] class 43 reserves .....C.. - TBF[8] class 44 reserves ......C. - TBF[8] class 45 reserves .......C - TBF[9] class 46 reserves ...C.... - TBF[9] class 1 reserves ....C... - TBF[9] class 2 reserves .....C.. - TBF[9] class 3 reserves ......C. - TBF[9] class 4 reserves .......C - TBF[10] class 5 reserves ...C.... - TBF[10] class 6 reserves ....C... - TBF[10] class 7 reserves .....C.. - TBF[10] class 8 reserves ......C. - TBF[10] class 9 reserves .......C - TBF[11] class 10 reserves ...C.... - TBF[11] class 11 reserves ....C... - TBF[11] class 12 reserves .....C.. - TBF[11] class 13 reserves ......C. - TBF[11] class 14 reserves .......C - TBF[12] class 15 reserves ...C.... - TBF[12] class 16 reserves ....C... - TBF[12] class 17 reserves .....C.. - TBF[12] class 18 reserves ......C. - TBF[12] class 19 reserves .......C - TBF[13] class 20 reserves ...C.... - TBF[13] class 21 reserves ....C... - TBF[13] class 22 reserves .....C.. - TBF[13] class 23 reserves ......C. - TBF[13] class 24 reserves .......C - TBF[14] class 25 reserves ...C.... - TBF[14] class 26 reserves ....C... - TBF[14] class 27 reserves .....C.. - TBF[14] class 28 reserves ......C. - TBF[14] class 29 reserves .......C - TBF[15] class 30 reserves ...C.... - TBF[15] class 31 reserves ....C... - TBF[15] class 32 reserves .....C.. - TBF[15] class 33 reserves ......C. - TBF[15] class 34 reserves .......C - TBF[16] class 35 reserves ...C.... - TBF[16] class 36 reserves ....C... - TBF[16] class 37 reserves .....C.. - TBF[16] class 38 reserves ......C. - TBF[16] class 39 reserves .......C - TBF[17] class 40 reserves ...C.... - TBF[17] class 41 reserves ....C... - TBF[17] class 42 reserves .....C.. - TBF[17] class 43 reserves ......C. - TBF[17] class 44 reserves .......C - TBF[18] class 45 reserves ...C.... - TBF[18] class 46 reserves ....C... - TBF[18] class 1 reserves .....C.. - TBF[18] class 2 reserves ......C. - TBF[18] class 3 reserves .......C - TBF[19] class 4 reserves ...C.... - TBF[19] class 5 reserves ....C... - TBF[19] class 6 reserves .....C.. - TBF[19] class 7 reserves ......C. - TBF[19] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[20] class 11 reserves .....C.. - TBF[20] class 12 reserves ......C. - TBF[20] class 13 reserves .......C - TBF[21] class 14 reserves ...C.... - TBF[21] class 15 reserves ....C... - TBF[21] class 16 reserves .....C.. - TBF[21] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[22] class 19 reserves ...C.... - TBF[22] class 20 reserves ....C... - TBF[22] class 21 reserves .....C.. - TBF[22] class 22 reserves ......C. - TBF[22] class 23 reserves .......C - TBF[23] class 24 reserves ...C.... - TBF[23] class 25 reserves ....C... - TBF[23] class 26 reserves .....C.. - TBF[23] class 27 reserves ......C. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 0] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 0] class 4 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 5 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 7 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 1] class 9 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 1] class 10 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 11 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 12 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 13 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 2] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[ 3] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 17 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 18 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 3] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 4] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 24 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 4] class 25 reserves .......C [ 1 / 1 / 0 ] + TBF[ 5] class 26 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 27 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 28 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 5] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 30 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 32 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 33 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 6] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 38 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 7] class 39 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 40 reserves .......C [ 1 / 1 / 0 ] + TBF[ 8] class 41 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 8] class 42 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 43 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 44 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 9] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 3 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves .......C [ 1 / 1 / 0 ] + TBF[10] class 5 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 6 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 10 reserves ...C.... [ 1 / 1 / 0 ] + TBF[11] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 13 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 14 reserves .......C [ 1 / 1 / 0 ] + TBF[12] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 16 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 18 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 19 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 20 reserves ...C.... [ 1 / 1 / 0 ] + TBF[13] class 21 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 22 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 29 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 30 reserves ...C.... [ 1 / 1 / 0 ] + TBF[15] class 31 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 32 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[15] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 35 reserves ...C.... [ 1 / 1 / 0 ] + TBF[16] class 36 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 37 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[16] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[17] class 42 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 44 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 45 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 46 reserves ....C... [ 1 / 1 / 0 ] + TBF[18] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[18] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 7 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 8 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 9 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 11 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 14 reserves ...C.... [ 1 / 1 / 0 ] + TBF[21] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 18 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 19 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 21 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ......C. [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 24 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 1 reserves .......C - TBF[1] class 2 reserves ......DC - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...CD... - TBF[28] class 29 reserves ...DCD.. - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 1 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...CD... [ 1 / 2 / 0 ] + TBF[28] class 29 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 30 reserves ...DDDCD - TBF[30] class 31 reserves ...DDCD. - TBF[31] class 32 reserves ....DDCD - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[5] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[6] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[8] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[12] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[19] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[21] class 17 reserves .......C - TBF[18] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[18] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[23] class 22 reserves .......C - TBF[20] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[20] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[22] class 28 reserves ...C.... - TBF[22] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[27] class 31 reserves .......C - TBF[24] class 32 reserves ...C.... - TBF[24] class 33 reserves ....C... - TBF[21] class 34 reserves ......C. - TBF[30] class 35 reserves .......C - TBF[26] class 36 reserves ...C.... - TBF[26] class 37 reserves ....C... - TBF[23] class 38 reserves ......C. - TBF[28] class 39 reserves ...C.... - TBF[28] class 40 reserves ....C... - TBF[25] class 41 reserves ......C. - TBF[31] class 42 reserves ...C.... - TBF[27] class 43 reserves ......C. - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[17] class 30 reserves ......C. - TBF[6] class 31 reserves .....C.. - TBF[18] class 32 reserves ......C. - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[4] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[5] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[6] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[7] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[8] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[9] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[10] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[15] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[11] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[16] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[12] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[13] class 31 reserves .......C - TBF[18] class 32 reserves ...C.... - TBF[18] class 33 reserves ....C... - TBF[20] class 34 reserves ......C. - TBF[14] class 35 reserves .......C - TBF[19] class 36 reserves ...C.... - TBF[19] class 37 reserves ....C... - TBF[21] class 38 reserves ......C. - TBF[20] class 39 reserves ...C.... - TBF[20] class 40 reserves ....C... - TBF[22] class 41 reserves ......C. - TBF[21] class 42 reserves ...C.... - TBF[23] class 43 reserves ......C. - TBF[7] class 44 reserves .....C.. - TBF[8] class 45 reserves .....C.. - TBF[9] class 46 reserves .....C.. - TBF[10] class 1 reserves .....C.. - TBF[11] class 2 reserves .....C.. - TBF[12] class 3 reserves .....C.. - TBF[13] class 4 reserves .....C.. - TBF[14] class 5 reserves .....C.. - TBF[15] class 6 reserves .....C.. - TBF[15] class 7 reserves .......C - TBF[16] class 8 reserves .....C.. - TBF[16] class 9 reserves .......C - TBF[17] class 10 reserves .....C.. - TBF[17] class 11 reserves .......C - TBF[18] class 12 reserves .....C.. - TBF[18] class 13 reserves .......C - TBF[19] class 14 reserves .....C.. - TBF[19] class 15 reserves .......C - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves .......C - TBF[21] class 18 reserves ....C... - TBF[21] class 19 reserves .....C.. - TBF[21] class 20 reserves .......C - TBF[22] class 21 reserves ...C.... - TBF[22] class 22 reserves ....C... - TBF[22] class 23 reserves .....C.. - TBF[22] class 24 reserves .......C - TBF[23] class 25 reserves ...C.... - TBF[23] class 26 reserves ....C... - TBF[23] class 27 reserves .....C.. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[17] class 30 reserves ......C. - TBF[6] class 31 reserves .....C.. - TBF[18] class 32 reserves ......C. - TBF[0] class 33 reserves ......C. - TBF[0] class 34 reserves .......C - TBF[1] class 35 reserves .......C - TBF[1] class 36 reserves ...C.... - TBF[3] class 37 reserves .......C - TBF[2] class 38 reserves ...C.... - TBF[4] class 39 reserves .......C - TBF[4] class 40 reserves ...C.... - TBF[0] class 41 reserves ....C... - TBF[5] class 42 reserves .......C - TBF[6] class 43 reserves ...C.... - TBF[2] class 44 reserves ....C... - TBF[6] class 45 reserves .......C - TBF[7] class 46 reserves ...C.... - TBF[4] class 1 reserves ....C... - TBF[1] class 2 reserves ......C. - TBF[7] class 3 reserves .......C - TBF[9] class 4 reserves ...C.... - TBF[6] class 5 reserves ....C... - TBF[3] class 6 reserves ......C. - TBF[8] class 7 reserves .......C - TBF[11] class 8 reserves ...C.... - TBF[0] class 9 reserves .....C.. - TBF[9] class 10 reserves ....C... - TBF[5] class 11 reserves ......C. - TBF[9] class 12 reserves .......C - TBF[13] class 13 reserves ...C.... - TBF[2] class 14 reserves .....C.. - TBF[11] class 15 reserves ....C... - TBF[8] class 16 reserves ......C. - TBF[10] class 17 reserves .......C - TBF[15] class 18 reserves ...C.... - TBF[4] class 19 reserves .....C.. - TBF[15] class 20 reserves ....C... - TBF[10] class 21 reserves ......C. - TBF[11] class 22 reserves .......C - TBF[16] class 23 reserves ...C.... - TBF[5] class 24 reserves .....C.. - TBF[16] class 25 reserves ....C... - TBF[12] class 26 reserves ......C. - TBF[12] class 27 reserves .......C - TBF[17] class 28 reserves ...C.... - TBF[17] class 29 reserves ....C... - TBF[19] class 30 reserves ......C. - TBF[13] class 31 reserves .......C - TBF[18] class 32 reserves ...C.... - TBF[18] class 33 reserves ....C... - TBF[20] class 34 reserves ......C. - TBF[14] class 35 reserves .......C - TBF[19] class 36 reserves ...C.... - TBF[19] class 37 reserves ....C... - TBF[21] class 38 reserves ......C. - TBF[20] class 39 reserves ...C.... - TBF[20] class 40 reserves ....C... - TBF[22] class 41 reserves ......C. - TBF[21] class 42 reserves ...C.... - TBF[23] class 43 reserves ......C. - TBF[7] class 44 reserves .....C.. - TBF[8] class 45 reserves .....C.. - TBF[9] class 46 reserves .....C.. - TBF[10] class 1 reserves .....C.. - TBF[11] class 2 reserves .....C.. - TBF[12] class 3 reserves .....C.. - TBF[13] class 4 reserves .....C.. - TBF[14] class 5 reserves .....C.. - TBF[15] class 6 reserves .....C.. - TBF[15] class 7 reserves .......C - TBF[16] class 8 reserves .....C.. - TBF[16] class 9 reserves .......C - TBF[17] class 10 reserves .....C.. - TBF[17] class 11 reserves .......C - TBF[18] class 12 reserves .....C.. - TBF[18] class 13 reserves .......C - TBF[19] class 14 reserves .....C.. - TBF[19] class 15 reserves .......C - TBF[20] class 16 reserves .....C.. - TBF[20] class 17 reserves .......C - TBF[21] class 18 reserves ....C... - TBF[21] class 19 reserves .....C.. - TBF[21] class 20 reserves .......C - TBF[22] class 21 reserves ...C.... - TBF[22] class 22 reserves ....C... - TBF[22] class 23 reserves .....C.. - TBF[22] class 24 reserves .......C - TBF[23] class 25 reserves ...C.... - TBF[23] class 26 reserves ....C... - TBF[23] class 27 reserves .....C.. - TBF[23] class 28 reserves .......C - TBF[24] class 29 reserves ...C.... - TBF[24] class 30 reserves ....C... - TBF[24] class 31 reserves .....C.. - TBF[24] class 32 reserves ......C. - TBF[24] class 33 reserves .......C - TBF[25] class 34 reserves ...C.... - TBF[25] class 35 reserves ....C... - TBF[25] class 36 reserves .....C.. - TBF[25] class 37 reserves ......C. - TBF[25] class 38 reserves .......C - TBF[26] class 39 reserves ...C.... - TBF[26] class 40 reserves ....C... - TBF[26] class 41 reserves .....C.. - TBF[26] class 42 reserves ......C. - TBF[26] class 43 reserves .......C - TBF[27] class 44 reserves ...C.... - TBF[27] class 45 reserves ....C... - TBF[27] class 46 reserves .....C.. - TBF[27] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[28] class 3 reserves ...C.... - TBF[28] class 4 reserves ....C... - TBF[28] class 5 reserves .....C.. - TBF[28] class 6 reserves ......C. - TBF[28] class 7 reserves .......C - TBF[29] class 8 reserves ...C.... - TBF[29] class 9 reserves ....C... - TBF[29] class 10 reserves .....C.. - TBF[29] class 11 reserves ......C. - TBF[29] class 12 reserves .......C - TBF[30] class 13 reserves ...C.... - TBF[30] class 14 reserves ....C... - TBF[30] class 15 reserves .....C.. - TBF[30] class 16 reserves ......C. - TBF[30] class 17 reserves .......C - TBF[31] class 18 reserves ...C.... - TBF[31] class 19 reserves ....C... - TBF[31] class 20 reserves .....C.. - TBF[31] class 21 reserves ......C. - TBF[31] class 22 reserves .......C + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 2] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 3] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 4] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 5] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 6] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 7] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 8] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 9] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[10] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[11] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[12] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[13] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[14] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[15] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[16] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[17] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[18] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[19] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[20] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[21] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[22] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[23] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[24] class 25 reserves .....DCD [ 1 / 3 / 0 ] + TBF[25] class 26 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[26] class 27 reserves .....DCD [ 1 / 3 / 0 ] + TBF[27] class 28 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[28] class 29 reserves .....DCD [ 1 / 3 / 0 ] + TBF[29] class 30 reserves ...DDDCD [ 1 / 5 / 0 ] + TBF[30] class 31 reserves ...DDCD. [ 1 / 4 / 0 ] + TBF[31] class 32 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[19] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[23] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 2 reserves ....DC.. [ 1 / 2 / 0 ] + TBF[ 0] class 3 reserves ......DC [ 1 / 2 / 0 ] + TBF[ 0] class 4 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 5 reserves ......CD [ 1 / 2 / 0 ] + TBF[ 1] class 6 reserves ...CD... [ 1 / 2 / 0 ] + TBF[ 1] class 7 reserves .....CD. [ 1 / 2 / 0 ] + TBF[ 1] class 8 reserves ....DDCD [ 1 / 4 / 0 ] + TBF[ 1] class 9 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 2] class 10 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 11 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 3] class 12 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 2] class 13 reserves ...CDD.. [ 1 / 3 / 0 ] + TBF[ 3] class 14 reserves ....CDDD [ 1 / 4 / 0 ] + TBF[ 3] class 15 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 16 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 5] class 17 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 6] class 18 reserves ...CDDDD [ 1 / 5 / 0 ] + TBF[ 4] class 19 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 4] class 20 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 5] class 21 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 5] class 22 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 6] class 23 reserves .....DCD [ 1 / 3 / 0 ] + TBF[ 6] class 24 reserves ...DCD.. [ 1 / 3 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 44 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[ 0] class 1 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 2] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 2] class 5 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 7 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 4] class 8 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 3] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 10 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 7] class 12 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 5] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 7] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 15 reserves ...C.... [ 1 / 1 / 0 ] + TBF[10] class 16 reserves ...C.... [ 1 / 1 / 0 ] + TBF[12] class 17 reserves ...C.... [ 1 / 1 / 0 ] + TBF[14] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 9] class 19 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[11] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[13] class 23 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 24 reserves ....C... [ 1 / 1 / 0 ] + TBF[14] class 25 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[15] class 27 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 28 reserves ....C... [ 1 / 1 / 0 ] + TBF[16] class 29 reserves ......C. [ 1 / 1 / 0 ] + TBF[17] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 6] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 33 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 0] class 34 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[ 1] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 3] class 37 reserves .......C [ 1 / 1 / 0 ] + TBF[ 2] class 38 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 39 reserves .......C [ 1 / 1 / 0 ] + TBF[ 4] class 40 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 41 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 42 reserves .......C [ 1 / 1 / 0 ] + TBF[ 6] class 43 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 44 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 6] class 45 reserves .......C [ 1 / 1 / 0 ] + TBF[ 7] class 46 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 1 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 1] class 2 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 3 reserves .......C [ 1 / 1 / 0 ] + TBF[ 9] class 4 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 6] class 5 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 3] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 8] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[11] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 0] class 9 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 10 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 5] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 9] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[13] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 2] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 15 reserves ....C... [ 1 / 1 / 0 ] + TBF[ 8] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[10] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[15] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 4] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 20 reserves ....C... [ 1 / 1 / 0 ] + TBF[10] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[11] class 22 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 23 reserves ...C.... [ 1 / 1 / 0 ] + TBF[ 5] class 24 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 25 reserves ....C... [ 1 / 1 / 0 ] + TBF[12] class 26 reserves ......C. [ 1 / 1 / 0 ] + TBF[12] class 27 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 28 reserves ...C.... [ 1 / 1 / 0 ] + TBF[17] class 29 reserves ....C... [ 1 / 1 / 0 ] + TBF[19] class 30 reserves ......C. [ 1 / 1 / 0 ] + TBF[13] class 31 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 32 reserves ...C.... [ 1 / 1 / 0 ] + TBF[18] class 33 reserves ....C... [ 1 / 1 / 0 ] + TBF[20] class 34 reserves ......C. [ 1 / 1 / 0 ] + TBF[14] class 35 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 36 reserves ...C.... [ 1 / 1 / 0 ] + TBF[19] class 37 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 38 reserves ......C. [ 1 / 1 / 0 ] + TBF[20] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[20] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 41 reserves ......C. [ 1 / 1 / 0 ] + TBF[21] class 42 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 43 reserves ......C. [ 1 / 1 / 0 ] + TBF[ 7] class 44 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 8] class 45 reserves .....C.. [ 1 / 1 / 0 ] + TBF[ 9] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[10] class 1 reserves .....C.. [ 1 / 1 / 0 ] + TBF[11] class 2 reserves .....C.. [ 1 / 1 / 0 ] + TBF[12] class 3 reserves .....C.. [ 1 / 1 / 0 ] + TBF[13] class 4 reserves .....C.. [ 1 / 1 / 0 ] + TBF[14] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 6 reserves .....C.. [ 1 / 1 / 0 ] + TBF[15] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[16] class 8 reserves .....C.. [ 1 / 1 / 0 ] + TBF[16] class 9 reserves .......C [ 1 / 1 / 0 ] + TBF[17] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[17] class 11 reserves .......C [ 1 / 1 / 0 ] + TBF[18] class 12 reserves .....C.. [ 1 / 1 / 0 ] + TBF[18] class 13 reserves .......C [ 1 / 1 / 0 ] + TBF[19] class 14 reserves .....C.. [ 1 / 1 / 0 ] + TBF[19] class 15 reserves .......C [ 1 / 1 / 0 ] + TBF[20] class 16 reserves .....C.. [ 1 / 1 / 0 ] + TBF[20] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[21] class 18 reserves ....C... [ 1 / 1 / 0 ] + TBF[21] class 19 reserves .....C.. [ 1 / 1 / 0 ] + TBF[21] class 20 reserves .......C [ 1 / 1 / 0 ] + TBF[22] class 21 reserves ...C.... [ 1 / 1 / 0 ] + TBF[22] class 22 reserves ....C... [ 1 / 1 / 0 ] + TBF[22] class 23 reserves .....C.. [ 1 / 1 / 0 ] + TBF[22] class 24 reserves .......C [ 1 / 1 / 0 ] + TBF[23] class 25 reserves ...C.... [ 1 / 1 / 0 ] + TBF[23] class 26 reserves ....C... [ 1 / 1 / 0 ] + TBF[23] class 27 reserves .....C.. [ 1 / 1 / 0 ] + TBF[23] class 28 reserves .......C [ 1 / 1 / 0 ] + TBF[24] class 29 reserves ...C.... [ 1 / 1 / 0 ] + TBF[24] class 30 reserves ....C... [ 1 / 1 / 0 ] + TBF[24] class 31 reserves .....C.. [ 1 / 1 / 0 ] + TBF[24] class 32 reserves ......C. [ 1 / 1 / 0 ] + TBF[24] class 33 reserves .......C [ 1 / 1 / 0 ] + TBF[25] class 34 reserves ...C.... [ 1 / 1 / 0 ] + TBF[25] class 35 reserves ....C... [ 1 / 1 / 0 ] + TBF[25] class 36 reserves .....C.. [ 1 / 1 / 0 ] + TBF[25] class 37 reserves ......C. [ 1 / 1 / 0 ] + TBF[25] class 38 reserves .......C [ 1 / 1 / 0 ] + TBF[26] class 39 reserves ...C.... [ 1 / 1 / 0 ] + TBF[26] class 40 reserves ....C... [ 1 / 1 / 0 ] + TBF[26] class 41 reserves .....C.. [ 1 / 1 / 0 ] + TBF[26] class 42 reserves ......C. [ 1 / 1 / 0 ] + TBF[26] class 43 reserves .......C [ 1 / 1 / 0 ] + TBF[27] class 44 reserves ...C.... [ 1 / 1 / 0 ] + TBF[27] class 45 reserves ....C... [ 1 / 1 / 0 ] + TBF[27] class 46 reserves .....C.. [ 1 / 1 / 0 ] + TBF[27] class 1 reserves ......C. [ 1 / 1 / 0 ] + TBF[27] class 2 reserves .......C [ 1 / 1 / 0 ] + TBF[28] class 3 reserves ...C.... [ 1 / 1 / 0 ] + TBF[28] class 4 reserves ....C... [ 1 / 1 / 0 ] + TBF[28] class 5 reserves .....C.. [ 1 / 1 / 0 ] + TBF[28] class 6 reserves ......C. [ 1 / 1 / 0 ] + TBF[28] class 7 reserves .......C [ 1 / 1 / 0 ] + TBF[29] class 8 reserves ...C.... [ 1 / 1 / 0 ] + TBF[29] class 9 reserves ....C... [ 1 / 1 / 0 ] + TBF[29] class 10 reserves .....C.. [ 1 / 1 / 0 ] + TBF[29] class 11 reserves ......C. [ 1 / 1 / 0 ] + TBF[29] class 12 reserves .......C [ 1 / 1 / 0 ] + TBF[30] class 13 reserves ...C.... [ 1 / 1 / 0 ] + TBF[30] class 14 reserves ....C... [ 1 / 1 / 0 ] + TBF[30] class 15 reserves .....C.. [ 1 / 1 / 0 ] + TBF[30] class 16 reserves ......C. [ 1 / 1 / 0 ] + TBF[30] class 17 reserves .......C [ 1 / 1 / 0 ] + TBF[31] class 18 reserves ...C.... [ 1 / 1 / 0 ] + TBF[31] class 19 reserves ....C... [ 1 / 1 / 0 ] + TBF[31] class 20 reserves .....C.. [ 1 / 1 / 0 ] + TBF[31] class 21 reserves ......C. [ 1 / 1 / 0 ] + TBF[31] class 22 reserves .......C [ 1 / 1 / 0 ] Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) -- To view, visit https://gerrit.osmocom.org/3932 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I6d1df8e96e1dad04ab7cf2655b8363233d6e210f Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 10:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 10:36:07 +0000 Subject: [PATCH] osmo-trx[master]: tests: null-terminate buffer Message-ID: Review at https://gerrit.osmocom.org/6213 tests: null-terminate buffer Initialize temporary buffer with 0 to make sure that it's null-terminated. Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Fixes: CID149362 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/13/6213/1 diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index c4e31d8..eb92e25 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -47,7 +47,7 @@ readSocket->nonblocking(); int rc = 0; while (rcread(buf, MAX_UDP_LENGTH); if (count>0) { CERR("read: " << buf); -- To view, visit https://gerrit.osmocom.org/6213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 11:09:11 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 31 Jan 2018 11:09:11 +0000 Subject: osmo-trx[master]: tests: null-terminate buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/6213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 12:10:26 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 31 Jan 2018 12:10:26 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/6158/4/ggsn_tests/GGSN_Tests.ttcn File ggsn_tests/GGSN_Tests.ttcn: Line 1050: [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { > the generally mroe elegant solution would be to "stack" a translation port I spent some time looking at the different stuff you proposed here but couldn't find something which I could reasonably write. Stacking a new port: afaiu, I'd need to create a new GTPU_IP4+GTPU_IP6 and/or even a GTPU_ICMP4+GTPUICMP6, but anyway I'm mixing IPv4 and IPv6 in my tests (ie trying to send an IPv4 over an IPv6 pdp ctx) which would mean I'd need to create several ports instead of just having the GTPU port, so I don't think it's worth it in this case. decmatch: I couldn't find any good example from which I could clearly understand how it works. It seems we are neither using it yet in osmo-ttcn3-hacks. I think I'll fix the other comment and leave this as it is now. -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 4 Gerrit-Project: osmo-ttcn3-hacks 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 Wed Jan 31 12:52:17 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 12:52:17 +0000 Subject: [MERGED] osmo-pcu[master]: TS alloc: print suggested TRX on allocation errors In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: TS alloc: print suggested TRX on allocation errors ...................................................................... TS alloc: print suggested TRX on allocation errors If TS allocation fails due to unavailable TFI, print TRX which was suggested to allocator. This simplifies allocator debugging but requires cosmetic modifications to test output. Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Related: OS#2282 --- M src/bts.cpp M tests/alloc/AllocTest.err 2 files changed, 825 insertions(+), 825 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified -- To view, visit https://gerrit.osmocom.org/3931 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icaf97d71d71985d52dc0bda448c26b19fe5645e7 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 12:52:18 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 12:52:18 +0000 Subject: [MERGED] osmo-pcu[master]: Simplify TS alloc: internalize TRX check In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Simplify TS alloc: internalize TRX check ...................................................................... Simplify TS alloc: internalize TRX check Move TRX check inside local tfi_find_free() wrapper to make main algorithm easier to follow. Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 10 insertions(+), 11 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e394a6e..c45aa39 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -329,7 +329,7 @@ /*! Return free TFI * * \param[in] bts Pointer to BTS struct - * \param[in] trx Pointer to TRX struct + * \param[in] trx Optional pointer to TRX struct * \param[in] ms Pointer to MS object * \param[in] dir DL or UL direction * \param[in] use_trx which TRX to use or -1 if it should be selected based on what MS uses @@ -341,6 +341,15 @@ { int tfi; uint8_t trx_no; + + if (trx) { + if (use_trx >= 0 && use_trx != trx->trx_no) { + LOGP(DRLCMAC, LOGL_ERROR, "- Requested incompatible TRX %d (current is %d)\n", + use_trx, trx->trx_no); + return -EINVAL; + } + use_trx = trx->trx_no; + } if (use_trx == -1 && ms->current_trx()) use_trx = ms->current_trx()->trx_no; @@ -785,16 +794,6 @@ ul_slots = ms->reserved_ul_slots(); first_common_ts = ms->first_common_ts(); trx = ms->current_trx(); - - if (trx) { - if (use_trx >= 0 && use_trx != trx->trx_no) { - LOGP(DRLCMAC, LOGL_ERROR, - "- Requested incompatible TRX %d (current is %d)\n", - use_trx, trx->trx_no); - return -EINVAL; - } - use_trx = trx->trx_no; - } /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); -- To view, visit https://gerrit.osmocom.org/3760 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02da2b8ba8c9c8815dae0e39e1fed277ca0df171 Gerrit-PatchSet: 22 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Jan 31 13:49:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 31 Jan 2018 13:49:38 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test to validate if different pdp ctx can ta... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6205 to look at the new patch set (#2). ggsn_tests: Add test to validate if different pdp ctx can talk each other It seems due to the current network configuration, pdp v4 ctx can talk each other while pdp v6 ctx cannot. Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 84 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/6205/2 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index bf82057..67fcbd4 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -27,10 +27,12 @@ GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns GGSN_Tests.TC_pdp4_act_deact_gtpu_access +GGSN_Tests.TC_pdp6_clients_interact GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 GGSN_Tests.TC_pdp6_act_deact_gtpu_access +GGSN_Tests.TC_pdp4_clients_interact GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index b802564..28f461c 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -747,6 +747,18 @@ } } + /* template for an ICMPv6 echo request */ + template PDU_ICMP tr_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := ? + } + } + /* template for an ICMPv4 echo reply */ template PDU_ICMP tr_ICMPv4_ERP(template octetstring data := *) := { echo_reply := { @@ -910,6 +922,18 @@ } } + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 tr_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := ? + } + } + /* template for receiving/matching an ICMPv6 echo reply */ template PDU_ICMPv6 tr_ICMPv6_ERP(template octetstring data := *) := { echoReply := { @@ -1038,6 +1062,11 @@ T_default.stop; } + /* Wait for ICMPv4 echo request from GTP */ + function f_wait_icmp4_echo_request(PdpContext ctx) runs on GT_CT { + f_wait_icmp4(ctx, tr_ICMPv4_ERQ); + } + /* Wait for ICMPv4 echo reply (or unreachable) from GTP */ function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { f_wait_icmp4(ctx, (tr_ICMPv4_ERP, tr_ICMPv4_DU)); @@ -1074,6 +1103,11 @@ /* wait for GGSN to send us an ICMPv6 router advertisement */ function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { f_wait_icmp6(ctx, tr_ICMPv6_RA(?, 64)); + } + + /* Wait for ICMPv6 echo request from GTP */ + function f_wait_icmp6_echo_request(PdpContext ctx) runs on GT_CT { + f_wait_icmp6(ctx, tr_ICMPv6_ERQ); } /* Wait for ICMPv6 echo reply (or unreachable) from GTP */ @@ -1183,6 +1217,37 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Validate if different clients (pdp ctx) can reach one another through GGSN. */ + testcase TC_pdp6_clients_interact() runs on GT_CT { + f_init(); + var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + f_pdp_ctx_act(ctxA); + f_send_gtpu(ctxA, f_icmpv6_rs_for_pdp(ctxA)); + f_wait_rtr_adv(ctxA); + f_send_gtpu(ctxA, f_gen_icmpv6_neigh_solicit_for_pdp(ctxA)); + + f_pdp_ctx_act(ctxB); + f_send_gtpu(ctxB, f_icmpv6_rs_for_pdp(ctxB)); + f_wait_rtr_adv(ctxB); + f_send_gtpu(ctxB, f_gen_icmpv6_neigh_solicit_for_pdp(ctxB)); + + var OCT16 addrA_ll := f_ipv6_link_local(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrB_ll := f_ipv6_link_local(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrA_glob := f_ipv6_global(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrB_glob := f_ipv6_global(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + + /* Validate if clients can interact using ll addr. */ + f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_ll, addrB_ll)); + f_wait_gtpu_fail(ctxB); + + /* Validate if clients can interact using global addr. */ + f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_glob, addrB_glob)); + f_wait_gtpu_fail(ctxB); + + f_pdp_ctx_del(ctxA, '1'B); + } + /* Test PDP context activation for dynamic IPv4 EUA without DNS request */ testcase TC_pdp4_act_deact() runs on GT_CT { f_init(); @@ -1263,6 +1328,21 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Validate if different clients (pdp ctx) can reach one another through GGSN. */ + testcase TC_pdp4_clients_interact() runs on GT_CT { + f_init(); + var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + f_pdp_ctx_act(ctxA); + f_pdp_ctx_act(ctxB); + var OCT4 addrA := ctxA.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + var OCT4 addrB := ctxB.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctxA, f_gen_icmpv4_echo(addrA, addrB)); + f_wait_icmp4_echo_request(ctxB); + + f_pdp_ctx_del(ctxA, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1280,11 +1360,13 @@ execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); execute(TC_pdp4_act_deact_gtpu_access()); + execute(TC_pdp4_clients_interact()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); execute(TC_pdp6_act_deact_gtpu_access()); + execute(TC_pdp6_clients_interact()); execute(TC_echo_req_resp()); } -- To view, visit https://gerrit.osmocom.org/6205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 13:49:38 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 31 Jan 2018 13:49:38 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6158 to look at the new patch set (#5). ggsn_tests: Add test case to validate packets forwarded vs dropped New dependency is required: titan.ProtocolModules.ICMP It tests that ICMP echo packets can be sent successfully (reply is received or otherwise dest unreachable if routing is not set up correctly during the test). It also tests some cases in which osmo-ggsn is required to drop the packets (eg. unknown src ip unrelated to pdp ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx and vice versa. Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M ggsn_tests/regen_makefile.sh 4 files changed, 262 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/6158/5 diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index d8994df..bf82057 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -26,9 +26,11 @@ GGSN_Tests.TC_pdp4_act_deact GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns +GGSN_Tests.TC_pdp4_act_deact_gtpu_access GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 +GGSN_Tests.TC_pdp6_act_deact_gtpu_access GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index f7814db..b802564 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -10,6 +10,7 @@ import from GTPU_Types all; import from IPCP_Types all; import from IP_Types all; + import from ICMP_Types all; import from ICMPv6_Types all; import from Native_Functions all; @@ -734,6 +735,63 @@ /* IPv6 neighbor solicitation fe80::2 -> ff02::1:ff00:2 from 02:88:b5:1f:25:59 */ const octetstring c_neigh_solicit:= '6000000000203afffe800000000000000000000000000002ff0200000000000000000001ff00000287009f9600000000fe80000000000000000000000000000201010288b51f2559'O; + /* template for an ICMPv6 echo request */ + template PDU_ICMP ts_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := '0000'O, + identifier := '0345'O, + sequence_number := '0001'O, + data := ''O + } + } + + /* template for an ICMPv4 echo reply */ + template PDU_ICMP tr_ICMPv4_ERP(template octetstring data := *) := { + echo_reply := { + type_field := 0, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := data + } + } + + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMP tr_ICMPv4_DU := { + destination_unreachable := { + type_field := 1, + code := ?, + checksum := ?, + unused := ?, + original_ip_msg := ? + } + } + + /* template to construct IPv4_packet from input arguments, ready for use in f_IPv4_enc() */ + template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, LIN2_BO_LAST tlen, octetstring payload) := { + header := { + ver := 4, + hlen := 5, + tos := 0, + tlen := tlen, + id := 35902, + res := '0'B, + dfrag := '1'B, + mfrag := '0'B, + foffset := 0, + ttl := 64, + proto := proto, + cksum := 0, + srcaddr := srcaddr, + dstaddr := dstaddr + }, + ext_headers := omit, + payload := payload + } + /* template to generate a 'Prefix Information' ICMPv6 option */ template OptionField ts_ICMP6_OptPrefix(OCT16 prefix, INT1 prefix_len) := { prefixInformation := { @@ -747,6 +805,18 @@ preferredLifetime := oct2int('FFFFFFFF'O), reserved2 := '00000000'O, prefix := prefix + } + } + + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 ts_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := '0000'O, + identifier := 0, + sequenceNr := 0, + data := ''O } } @@ -829,6 +899,29 @@ } } + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMPv6 tr_ICMPv6_DU := { + destinationUnreachable := { + typeField := 1, + code := ?, + checksum := ?, + unused := ?, + originalIpMsg := ? + } + } + + /* template for receiving/matching an ICMPv6 echo reply */ + template PDU_ICMPv6 tr_ICMPv6_ERP(template octetstring data := *) := { + echoReply := { + typeField := 129, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := data + } + } + /* template to construct IPv6_packet from input arguments, ready for use in f_IPv6_enc() */ template IPv6_packet ts_IP6(OCT16 srcaddr, OCT16 dstaddr, LIN1 nexthead, octetstring payload, LIN1 hlim := 255) := { header := { @@ -847,6 +940,21 @@ function f_ipv6_link_local(in OCT16 link_id) return OCT16 { return 'FE80000000000000'O & substr(link_id, 8, 8); + } + + function f_ipv6_global(in OCT16 link_id) return OCT16 { + return substr(link_id, 0, 8) & '1234123412341234'O; + } + + /* Create a new different IPv6 addr from input. Starts mangling at byte prefix. */ + function f_ipv6_mangle(in OCT16 addr, in integer prefix := 0) return OCT16 { + var integer i; + var octetstring res := substr(addr, 0, prefix); + for (i := prefix; i < lengthof(addr); i := i + 1) { + var octetstring a := addr[i] xor4b '11'O; + res := res & a; + } + return res; } /* Compute solicited-node multicast address as per RFC4291 2.7.1 */ @@ -889,28 +997,96 @@ return f_gen_icmpv6_neigh_solicit(link_local, daddr, link_local); } - /* wait for GGSN to send us an ICMPv6 router advertisement */ - function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { + /* Send an ICMPv4 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv4_echo(OCT4 saddr, OCT4 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + var IPv4_packet ip4 := valueof(ts_IP4(saddr, daddr, 1, 50, tmp)); + var octetstring data := f_IPv4_enc(ip4); + var OCT2 cksum := f_IPv4_checksum(data); + data[10] := cksum[0]; + data[11] := cksum[1]; + return data; + } + + /* Send an ICMPv6 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv6_echo(OCT16 saddr, OCT16 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr, daddr); + var IPv6_packet ip6 := valueof(ts_IP6(saddr, daddr, 58, tmp)); + var octetstring data := f_IPv6_enc(ip6); + return data; + } + + /* Wait for ICMPv4 from GTP */ + function f_wait_icmp4(PdpContext ctx, template PDU_ICMP expected) runs on GT_CT { var Gtp1uUnitdata ud; T_default.start; alt { - //'6???????????3aff'O + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, expected)) { + repeat; + } + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait for ICMPv4 echo reply (or unreachable) from GTP */ + function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { + f_wait_icmp4(ctx, (tr_ICMPv4_ERP, tr_ICMPv4_DU)); + } + + /* Wait for ICMPv6 from GTP */ + function f_wait_icmp6(PdpContext ctx, template PDU_ICMPv6 expected) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; var IPv6_packet ip6 := f_IPv6_dec(gpdu); - if (ip6.header.ver != 6 or ip6.header.nexthead != 58 or ip6.header.hlim != 255) { + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { repeat; } var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); - if (not match(icmp6, tr_ICMPv6_RA(?, 64))) { + if (not match(icmp6, expected)) { repeat; } - ctx.ip6_prefix := icmp6.routerAdvertisement.options[0].prefixInformation.prefix; - log("RA with /64 prefix ", ctx.ip6_prefix); + /* We are waiting for RA, update ctx */ + if (match(icmp6, tr_ICMPv6_RA(?, 64))) { + ctx.ip6_prefix := icmp6.routerAdvertisement.options[0].prefixInformation.prefix; + log("RA with /64 prefix ", ctx.ip6_prefix); + } } [] GTPU.receive(tr_GTPU_GPDU(?, ?)) { repeat; } [] GTPU.receive { setverdict(fail); } [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* wait for GGSN to send us an ICMPv6 router advertisement */ + function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { + f_wait_icmp6(ctx, tr_ICMPv6_RA(?, 64)); + } + + /* Wait for ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT { + f_wait_icmp6(ctx, (tr_ICMPv6_ERP,tr_ICMPv6_DU)); + } + + /* Assert we don't receive a ICMPv4/6 echo reply (or unreachable) from GTP */ + function f_wait_gtpu_fail(PdpContext ctx) runs on GT_CT { + T_default.start; + alt { + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { } } T_default.stop; } @@ -960,6 +1136,49 @@ f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); f_wait_rtr_adv(ctx); f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv6_DNS); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + var OCT16 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '0003'O); + + /* Check if we can use valid link-local src addr. */ + var OCT16 saddr_ll := f_ipv6_link_local(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_ll, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Check that attempting RA with another ll src addr won't work, packet dropped: */ + var OCT16 saddr_ll_wrong := f_ipv6_mangle(saddr_ll, 8); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_ll_wrong)); + f_wait_gtpu_fail(ctx); + + /* Check if we can use valid global src addr, should work */ + var OCT16 saddr_glob := f_ipv6_global(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_glob, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT16 saddr_wrong := f_ipv6_mangle(saddr_glob); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped) */ + var OCT4 saddr_v4 := f_inet_addr("192.168.10.2"); + var OCT4 daddr_v4 := f_inet_addr("8.8.8.8"); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_v4, daddr_v4)); + f_wait_gtpu_fail(ctx); f_pdp_ctx_del(ctx, '1'B); } @@ -1017,6 +1236,33 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp4_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); + f_pdp_ctx_act(ctx); + + var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); + + /* Check if we can use valid global src addr, should work */ + var OCT4 saddr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr)); + f_wait_icmp4_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT4 saddr_wrong := substr(saddr, 0, 3) & (saddr[3] xor4b '11'O); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv6 RA to APN4, should fail (packet dropped) */ + var OCT16 saddr_v6 := f_inet6_addr("fde4:8dba:82e1:2000:1:2:3:4"); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_v6)); + f_wait_gtpu_fail(ctx); + f_pdp_ctx_del(ctx, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1033,10 +1279,12 @@ execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); + execute(TC_pdp4_act_deact_gtpu_access()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_gtpu_access()); execute(TC_echo_req_resp()); } diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 8098f9b..58c681f 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -27,6 +27,10 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.ICMP/src +FILES="ICMP_EncDec.cc ICMP_Types.ttcn" +gen_links $DIR $FILES + DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh index 3970187..2fc74f7 100755 --- a/ggsn_tests/regen_makefile.sh +++ b/ggsn_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc" +FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc ICMP_EncDec.cc" ../regen-makefile.sh GGSN_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 5 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:11:27 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 14:11:27 +0000 Subject: osmo-mgw[master]: mgcp: fix use-after-free and add callback for endpoint cleanup In-Reply-To: References: Message-ID: Patch Set 1: > Might make sense to permit cleanup_cb=NULL and not call it in that > case yes, makes sense. I have changed it now. -- To view, visit https://gerrit.osmocom.org/6006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:26:08 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:26:08 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 5: as I wrote: "but there's no need to change it now, this is just a notice in case you end up with this problem again." -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 5 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 31 14:26:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:26:54 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 5 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 31 14:27:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:27:16 +0000 Subject: osmo-ttcn3-hacks[master]: ggsn_tests: Add test to validate if different pdp ctx can ta... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks 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 Jan 31 14:27:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:27:18 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: ggsn_tests: Add test to validate if different pdp ctx can ta... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn_tests: Add test to validate if different pdp ctx can talk each other ...................................................................... ggsn_tests: Add test to validate if different pdp ctx can talk each other It seems due to the current network configuration, pdp v4 ctx can talk each other while pdp v6 ctx cannot. Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn 2 files changed, 84 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index bf82057..67fcbd4 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -27,10 +27,12 @@ GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns GGSN_Tests.TC_pdp4_act_deact_gtpu_access +GGSN_Tests.TC_pdp6_clients_interact GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 GGSN_Tests.TC_pdp6_act_deact_gtpu_access +GGSN_Tests.TC_pdp4_clients_interact GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index b802564..28f461c 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -747,6 +747,18 @@ } } + /* template for an ICMPv6 echo request */ + template PDU_ICMP tr_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := ? + } + } + /* template for an ICMPv4 echo reply */ template PDU_ICMP tr_ICMPv4_ERP(template octetstring data := *) := { echo_reply := { @@ -910,6 +922,18 @@ } } + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 tr_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := ? + } + } + /* template for receiving/matching an ICMPv6 echo reply */ template PDU_ICMPv6 tr_ICMPv6_ERP(template octetstring data := *) := { echoReply := { @@ -1038,6 +1062,11 @@ T_default.stop; } + /* Wait for ICMPv4 echo request from GTP */ + function f_wait_icmp4_echo_request(PdpContext ctx) runs on GT_CT { + f_wait_icmp4(ctx, tr_ICMPv4_ERQ); + } + /* Wait for ICMPv4 echo reply (or unreachable) from GTP */ function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { f_wait_icmp4(ctx, (tr_ICMPv4_ERP, tr_ICMPv4_DU)); @@ -1074,6 +1103,11 @@ /* wait for GGSN to send us an ICMPv6 router advertisement */ function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { f_wait_icmp6(ctx, tr_ICMPv6_RA(?, 64)); + } + + /* Wait for ICMPv6 echo request from GTP */ + function f_wait_icmp6_echo_request(PdpContext ctx) runs on GT_CT { + f_wait_icmp6(ctx, tr_ICMPv6_ERQ); } /* Wait for ICMPv6 echo reply (or unreachable) from GTP */ @@ -1183,6 +1217,37 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Validate if different clients (pdp ctx) can reach one another through GGSN. */ + testcase TC_pdp6_clients_interact() runs on GT_CT { + f_init(); + var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + f_pdp_ctx_act(ctxA); + f_send_gtpu(ctxA, f_icmpv6_rs_for_pdp(ctxA)); + f_wait_rtr_adv(ctxA); + f_send_gtpu(ctxA, f_gen_icmpv6_neigh_solicit_for_pdp(ctxA)); + + f_pdp_ctx_act(ctxB); + f_send_gtpu(ctxB, f_icmpv6_rs_for_pdp(ctxB)); + f_wait_rtr_adv(ctxB); + f_send_gtpu(ctxB, f_gen_icmpv6_neigh_solicit_for_pdp(ctxB)); + + var OCT16 addrA_ll := f_ipv6_link_local(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrB_ll := f_ipv6_link_local(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrA_glob := f_ipv6_global(ctxA.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + var OCT16 addrB_glob := f_ipv6_global(ctxB.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + + /* Validate if clients can interact using ll addr. */ + f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_ll, addrB_ll)); + f_wait_gtpu_fail(ctxB); + + /* Validate if clients can interact using global addr. */ + f_send_gtpu(ctxA, f_gen_icmpv6_echo(addrA_glob, addrB_glob)); + f_wait_gtpu_fail(ctxB); + + f_pdp_ctx_del(ctxA, '1'B); + } + /* Test PDP context activation for dynamic IPv4 EUA without DNS request */ testcase TC_pdp4_act_deact() runs on GT_CT { f_init(); @@ -1263,6 +1328,21 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Validate if different clients (pdp ctx) can reach one another through GGSN. */ + testcase TC_pdp4_clients_interact() runs on GT_CT { + f_init(); + var PdpContext ctxA := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + var PdpContext ctxB := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + f_pdp_ctx_act(ctxA); + f_pdp_ctx_act(ctxB); + var OCT4 addrA := ctxA.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + var OCT4 addrB := ctxB.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctxA, f_gen_icmpv4_echo(addrA, addrB)); + f_wait_icmp4_echo_request(ctxB); + + f_pdp_ctx_del(ctxA, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1280,11 +1360,13 @@ execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); execute(TC_pdp4_act_deact_gtpu_access()); + execute(TC_pdp4_clients_interact()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); execute(TC_pdp6_act_deact_gtpu_access()); + execute(TC_pdp6_clients_interact()); execute(TC_echo_req_resp()); } -- To view, visit https://gerrit.osmocom.org/6205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I67c04b056cc5c092d357abbb084b7665f59eaf3a Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:27:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:27:18 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: ggsn_tests: Add test case to validate packets forwarded vs d... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn_tests: Add test case to validate packets forwarded vs dropped ...................................................................... ggsn_tests: Add test case to validate packets forwarded vs dropped New dependency is required: titan.ProtocolModules.ICMP It tests that ICMP echo packets can be sent successfully (reply is received or otherwise dest unreachable if routing is not set up correctly during the test). It also tests some cases in which osmo-ggsn is required to drop the packets (eg. unknown src ip unrelated to pdp ctx). It also checks that IPv6 packets are dropped in IPv4 pdp ctx and viceversa It also checks that IPv6 packets are dropped in IPv4 pdp ctx and vice versa. Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba --- M ggsn_tests/GGSN_Tests.cfg M ggsn_tests/GGSN_Tests.ttcn M ggsn_tests/gen_links.sh M ggsn_tests/regen_makefile.sh 4 files changed, 262 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn_tests/GGSN_Tests.cfg b/ggsn_tests/GGSN_Tests.cfg index d8994df..bf82057 100644 --- a/ggsn_tests/GGSN_Tests.cfg +++ b/ggsn_tests/GGSN_Tests.cfg @@ -26,9 +26,11 @@ GGSN_Tests.TC_pdp4_act_deact GGSN_Tests.TC_pdp4_act_deact_ipcp GGSN_Tests.TC_pdp4_act_deact_pcodns +GGSN_Tests.TC_pdp4_act_deact_gtpu_access GGSN_Tests.TC_pdp6_act_deact GGSN_Tests.TC_pdp6_act_deact_pcodns GGSN_Tests.TC_pdp6_act_deact_icmp6 +GGSN_Tests.TC_pdp6_act_deact_gtpu_access GGSN_Tests.TC_echo_req_resp diff --git a/ggsn_tests/GGSN_Tests.ttcn b/ggsn_tests/GGSN_Tests.ttcn index f7814db..b802564 100644 --- a/ggsn_tests/GGSN_Tests.ttcn +++ b/ggsn_tests/GGSN_Tests.ttcn @@ -10,6 +10,7 @@ import from GTPU_Types all; import from IPCP_Types all; import from IP_Types all; + import from ICMP_Types all; import from ICMPv6_Types all; import from Native_Functions all; @@ -734,6 +735,63 @@ /* IPv6 neighbor solicitation fe80::2 -> ff02::1:ff00:2 from 02:88:b5:1f:25:59 */ const octetstring c_neigh_solicit:= '6000000000203afffe800000000000000000000000000002ff0200000000000000000001ff00000287009f9600000000fe80000000000000000000000000000201010288b51f2559'O; + /* template for an ICMPv6 echo request */ + template PDU_ICMP ts_ICMPv4_ERQ := { + echo := { + type_field := 8, + code := 0, + checksum := '0000'O, + identifier := '0345'O, + sequence_number := '0001'O, + data := ''O + } + } + + /* template for an ICMPv4 echo reply */ + template PDU_ICMP tr_ICMPv4_ERP(template octetstring data := *) := { + echo_reply := { + type_field := 0, + code := 0, + checksum := ?, + identifier := ?, + sequence_number := ?, + data := data + } + } + + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMP tr_ICMPv4_DU := { + destination_unreachable := { + type_field := 1, + code := ?, + checksum := ?, + unused := ?, + original_ip_msg := ? + } + } + + /* template to construct IPv4_packet from input arguments, ready for use in f_IPv4_enc() */ + template IPv4_packet ts_IP4(OCT4 srcaddr, OCT4 dstaddr, LIN1 proto, LIN2_BO_LAST tlen, octetstring payload) := { + header := { + ver := 4, + hlen := 5, + tos := 0, + tlen := tlen, + id := 35902, + res := '0'B, + dfrag := '1'B, + mfrag := '0'B, + foffset := 0, + ttl := 64, + proto := proto, + cksum := 0, + srcaddr := srcaddr, + dstaddr := dstaddr + }, + ext_headers := omit, + payload := payload + } + /* template to generate a 'Prefix Information' ICMPv6 option */ template OptionField ts_ICMP6_OptPrefix(OCT16 prefix, INT1 prefix_len) := { prefixInformation := { @@ -747,6 +805,18 @@ preferredLifetime := oct2int('FFFFFFFF'O), reserved2 := '00000000'O, prefix := prefix + } + } + + /* template for an ICMPv6 echo request */ + template PDU_ICMPv6 ts_ICMPv6_ERQ := { + echoRequest := { + typeField := 128, + code := 0, + checksum := '0000'O, + identifier := 0, + sequenceNr := 0, + data := ''O } } @@ -829,6 +899,29 @@ } } + /* template for receiving/matching an ICMPv6 Destination Unreachable */ + template PDU_ICMPv6 tr_ICMPv6_DU := { + destinationUnreachable := { + typeField := 1, + code := ?, + checksum := ?, + unused := ?, + originalIpMsg := ? + } + } + + /* template for receiving/matching an ICMPv6 echo reply */ + template PDU_ICMPv6 tr_ICMPv6_ERP(template octetstring data := *) := { + echoReply := { + typeField := 129, + code := 0, + checksum := ?, + identifier := ?, + sequenceNr := ?, + data := data + } + } + /* template to construct IPv6_packet from input arguments, ready for use in f_IPv6_enc() */ template IPv6_packet ts_IP6(OCT16 srcaddr, OCT16 dstaddr, LIN1 nexthead, octetstring payload, LIN1 hlim := 255) := { header := { @@ -847,6 +940,21 @@ function f_ipv6_link_local(in OCT16 link_id) return OCT16 { return 'FE80000000000000'O & substr(link_id, 8, 8); + } + + function f_ipv6_global(in OCT16 link_id) return OCT16 { + return substr(link_id, 0, 8) & '1234123412341234'O; + } + + /* Create a new different IPv6 addr from input. Starts mangling at byte prefix. */ + function f_ipv6_mangle(in OCT16 addr, in integer prefix := 0) return OCT16 { + var integer i; + var octetstring res := substr(addr, 0, prefix); + for (i := prefix; i < lengthof(addr); i := i + 1) { + var octetstring a := addr[i] xor4b '11'O; + res := res & a; + } + return res; } /* Compute solicited-node multicast address as per RFC4291 2.7.1 */ @@ -889,28 +997,96 @@ return f_gen_icmpv6_neigh_solicit(link_local, daddr, link_local); } - /* wait for GGSN to send us an ICMPv6 router advertisement */ - function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { + /* Send an ICMPv4 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv4_echo(OCT4 saddr, OCT4 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMP(valueof(ts_ICMPv4_ERQ)); + var IPv4_packet ip4 := valueof(ts_IP4(saddr, daddr, 1, 50, tmp)); + var octetstring data := f_IPv4_enc(ip4); + var OCT2 cksum := f_IPv4_checksum(data); + data[10] := cksum[0]; + data[11] := cksum[1]; + return data; + } + + /* Send an ICMPv6 echo msg through GTP given pdp ctx, and ip src and dst addr */ + function f_gen_icmpv6_echo(OCT16 saddr, OCT16 daddr) return octetstring { + var octetstring tmp := f_enc_PDU_ICMPv6(valueof(ts_ICMPv6_ERQ), saddr, daddr); + var IPv6_packet ip6 := valueof(ts_IP6(saddr, daddr, 58, tmp)); + var octetstring data := f_IPv6_enc(ip6); + return data; + } + + /* Wait for ICMPv4 from GTP */ + function f_wait_icmp4(PdpContext ctx, template PDU_ICMP expected) runs on GT_CT { var Gtp1uUnitdata ud; T_default.start; alt { - //'6???????????3aff'O + [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { + var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; + var IPv4_packet ip4 := f_IPv4_dec(gpdu); + if (ip4.header.ver != 4) { + repeat; + } + var PDU_ICMP icmp4 := f_dec_PDU_ICMP(ip4.payload); + if (not match(icmp4, expected)) { + repeat; + } + } + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* Wait for ICMPv4 echo reply (or unreachable) from GTP */ + function f_wait_icmp4_echo_reply(PdpContext ctx) runs on GT_CT { + f_wait_icmp4(ctx, (tr_ICMPv4_ERP, tr_ICMPv4_DU)); + } + + /* Wait for ICMPv6 from GTP */ + function f_wait_icmp6(PdpContext ctx, template PDU_ICMPv6 expected) runs on GT_CT { + var Gtp1uUnitdata ud; + T_default.start; + alt { [] GTPU.receive(tr_GTPU_GPDU(g_peer_u, ?)) -> value ud { var octetstring gpdu := ud.gtpu.gtpu_IEs.g_PDU_IEs.data; var IPv6_packet ip6 := f_IPv6_dec(gpdu); - if (ip6.header.ver != 6 or ip6.header.nexthead != 58 or ip6.header.hlim != 255) { + if (ip6.header.ver != 6 or ip6.header.nexthead != 58) { repeat; } var PDU_ICMPv6 icmp6 := f_dec_PDU_ICMPv6(ip6.payload); - if (not match(icmp6, tr_ICMPv6_RA(?, 64))) { + if (not match(icmp6, expected)) { repeat; } - ctx.ip6_prefix := icmp6.routerAdvertisement.options[0].prefixInformation.prefix; - log("RA with /64 prefix ", ctx.ip6_prefix); + /* We are waiting for RA, update ctx */ + if (match(icmp6, tr_ICMPv6_RA(?, 64))) { + ctx.ip6_prefix := icmp6.routerAdvertisement.options[0].prefixInformation.prefix; + log("RA with /64 prefix ", ctx.ip6_prefix); + } } [] GTPU.receive(tr_GTPU_GPDU(?, ?)) { repeat; } [] GTPU.receive { setverdict(fail); } [] T_default.timeout { setverdict(fail); } + } + T_default.stop; + } + + /* wait for GGSN to send us an ICMPv6 router advertisement */ + function f_wait_rtr_adv(PdpContext ctx) runs on GT_CT { + f_wait_icmp6(ctx, tr_ICMPv6_RA(?, 64)); + } + + /* Wait for ICMPv6 echo reply (or unreachable) from GTP */ + function f_wait_icmp6_echo_reply(PdpContext ctx) runs on GT_CT { + f_wait_icmp6(ctx, (tr_ICMPv6_ERP,tr_ICMPv6_DU)); + } + + /* Assert we don't receive a ICMPv4/6 echo reply (or unreachable) from GTP */ + function f_wait_gtpu_fail(PdpContext ctx) runs on GT_CT { + T_default.start; + alt { + [] GTPU.receive { setverdict(fail); } + [] T_default.timeout { } } T_default.stop; } @@ -960,6 +1136,49 @@ f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); f_wait_rtr_adv(ctx); f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + f_pdp_ctx_del(ctx, '1'B); + } + + /* Test PDP context activation for dynamic IPv6 EUA with IPv6 DNS in PCO and router solicitation/advertisement. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp6_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInet6, valueof(t_EuaIPv6Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv6_DNS); + f_pdp_ctx_act(ctx); + + f_send_gtpu(ctx, f_icmpv6_rs_for_pdp(ctx)); + f_wait_rtr_adv(ctx); + f_send_gtpu(ctx, f_gen_icmpv6_neigh_solicit_for_pdp(ctx)); + + var OCT16 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '0003'O); + + /* Check if we can use valid link-local src addr. */ + var OCT16 saddr_ll := f_ipv6_link_local(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_ll, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Check that attempting RA with another ll src addr won't work, packet dropped: */ + var OCT16 saddr_ll_wrong := f_ipv6_mangle(saddr_ll, 8); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_ll_wrong)); + f_wait_gtpu_fail(ctx); + + /* Check if we can use valid global src addr, should work */ + var OCT16 saddr_glob := f_ipv6_global(ctx.eua.endUserAddress.endUserAddressIPv6.ipv6_address); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_glob, dns1_addr)); + f_wait_icmp6_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT16 saddr_wrong := f_ipv6_mangle(saddr_glob); + f_send_gtpu(ctx, f_gen_icmpv6_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv4 ICMP ECHO REQUEST to APN6, should fail (packet dropped) */ + var OCT4 saddr_v4 := f_inet_addr("192.168.10.2"); + var OCT4 daddr_v4 := f_inet_addr("8.8.8.8"); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_v4, daddr_v4)); + f_wait_gtpu_fail(ctx); f_pdp_ctx_del(ctx, '1'B); } @@ -1017,6 +1236,33 @@ f_pdp_ctx_del(ctx, '1'B); } + /* Test PDP context activation for dynamic IPv4 EUA. + Test we can send ICMPv6 ping over GTPU to DNS server. */ + testcase TC_pdp4_act_deact_gtpu_access() runs on GT_CT { + f_init(); + var PdpContext ctx := valueof(t_DefinePDP(f_rnd_imsi('26242'H), '1234'O, c_ApnInternet, valueof(t_EuaIPv4Dyn))); + ctx.pco_req := valueof(ts_PCO_IPv4_DNS_CONT); + f_pdp_ctx_act(ctx); + + var OCT4 dns1_addr := f_PCO_extract_proto(ctx.pco_neg, '000d'O); + + /* Check if we can use valid global src addr, should work */ + var OCT4 saddr := ctx.eua.endUserAddress.endUserAddressIPv4.ipv4_address; + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr, dns1_addr)); + f_wait_icmp4_echo_reply(ctx); + + /* Assert that packets with wrong global src addr are dropped by GGSN */ + var OCT4 saddr_wrong := substr(saddr, 0, 3) & (saddr[3] xor4b '11'O); + f_send_gtpu(ctx, f_gen_icmpv4_echo(saddr_wrong, dns1_addr)); + f_wait_gtpu_fail(ctx); + + /* Send an IPv6 RA to APN4, should fail (packet dropped) */ + var OCT16 saddr_v6 := f_inet6_addr("fde4:8dba:82e1:2000:1:2:3:4"); + f_send_gtpu(ctx, f_gen_icmpv6_router_solicitation(saddr_v6)); + f_wait_gtpu_fail(ctx); + f_pdp_ctx_del(ctx, '1'B); + } + testcase TC_echo_req_resp() runs on GT_CT { f_init(); f_send_gtpc(ts_GTPC_PING(g_peer_c, g_c_seq_nr)); @@ -1033,10 +1279,12 @@ execute(TC_pdp4_act_deact()); execute(TC_pdp4_act_deact_ipcp()); execute(TC_pdp4_act_deact_pcodns()); + execute(TC_pdp4_act_deact_gtpu_access()); execute(TC_pdp6_act_deact()); execute(TC_pdp6_act_deact_pcodns()); execute(TC_pdp6_act_deact_icmp6()); + execute(TC_pdp6_act_deact_gtpu_access()); execute(TC_echo_req_resp()); } diff --git a/ggsn_tests/gen_links.sh b/ggsn_tests/gen_links.sh index 8098f9b..58c681f 100755 --- a/ggsn_tests/gen_links.sh +++ b/ggsn_tests/gen_links.sh @@ -27,6 +27,10 @@ FILES="IPL4asp_Functions.ttcn IPL4asp_PT.cc IPL4asp_PT.hh IPL4asp_PortType.ttcn IPL4asp_Types.ttcn IPL4asp_discovery.cc IPL4asp_protocol_L234.hh" gen_links $DIR $FILES +DIR=$BASEDIR/titan.ProtocolModules.ICMP/src +FILES="ICMP_EncDec.cc ICMP_Types.ttcn" +gen_links $DIR $FILES + DIR=$BASEDIR/titan.ProtocolModules.ICMPv6/src FILES="ICMPv6_EncDec.cc ICMPv6_Types.ttcn" gen_links $DIR $FILES diff --git a/ggsn_tests/regen_makefile.sh b/ggsn_tests/regen_makefile.sh index 3970187..2fc74f7 100755 --- a/ggsn_tests/regen_makefile.sh +++ b/ggsn_tests/regen_makefile.sh @@ -1,5 +1,5 @@ #!/bin/sh -FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc" +FILES="*.ttcn IPL4asp_PT.cc IPL4asp_discovery.cc TCCConversion.cc TCCInterface.cc GTPC_EncDec.cc GTPU_EncDec.cc GTP_CodecPort_CtrlFunctDef.cc ICMPv6_EncDec.cc IP_EncDec.cc Native_FunctionDefs.cc UDP_EncDec.cc ICMP_EncDec.cc" ../regen-makefile.sh GGSN_Tests.ttcn $FILES -- To view, visit https://gerrit.osmocom.org/6158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib9c6043a6cd3b6622782ec7e7fcd2815101755ba Gerrit-PatchSet: 5 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:27:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:27:54 +0000 Subject: osmo-trx[master]: tests: null-terminate buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:27:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:27:57 +0000 Subject: [MERGED] osmo-trx[master]: tests: null-terminate buffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: tests: null-terminate buffer ...................................................................... tests: null-terminate buffer Initialize temporary buffer with 0 to make sure that it's null-terminated. Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Fixes: CID149362 --- M tests/CommonLibs/SocketsTest.cpp 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp index c4e31d8..eb92e25 100644 --- a/tests/CommonLibs/SocketsTest.cpp +++ b/tests/CommonLibs/SocketsTest.cpp @@ -47,7 +47,7 @@ readSocket->nonblocking(); int rc = 0; while (rcread(buf, MAX_UDP_LENGTH); if (count>0) { CERR("read: " << buf); -- To view, visit https://gerrit.osmocom.org/6213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icdde701839e35d3131605ea5a11882af21c8939a Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:59:14 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:59:14 +0000 Subject: osmo-ggsn[master]: ggsn.c: cb_tun_ind: Convert ifelse to switch statement In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:59:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:59:17 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn.c: cb_tun_ind: Convert ifelse to switch statement In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn.c: cb_tun_ind: Convert ifelse to switch statement ...................................................................... ggsn.c: cb_tun_ind: Convert ifelse to switch statement Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 --- M ggsn/ggsn.c 1 file changed, 6 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index de8090b..c7f6376 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -726,13 +726,15 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; - if (iph->version == 4) { + switch (iph->version) { + case 4: if (len < sizeof(*iph) || len < 4*iph->ihl) return -1; dst.len = 4; dst.v4.s_addr = iph->daddr; pool = apn->v4.pool; - } else if (iph->version == 6) { + break; + case 6: /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct * ippool_getip() below to match only the leading /64 @@ -740,7 +742,8 @@ dst.len = 8; dst.v6 = ip6h->ip6_dst; pool = apn->v6.pool; - } else { + break; + default: LOGP(DTUN, LOGL_NOTICE, "non-IPv%u packet received from tun\n", iph->version); return -1; } -- To view, visit https://gerrit.osmocom.org/6200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4fc97f367ae615cdf0a9501f89419990c2fd4599 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:59:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:59:18 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx ...................................................................... ggsn.c: cb_tun_ind: log dst addr of packet without pdp ctx Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 --- M ggsn/ggsn.c 1 file changed, 4 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index c7f6376..fed8f73 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -725,6 +725,7 @@ struct iphdr *iph = (struct iphdr *)pack; struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; + char straddr[INET6_ADDRSTRLEN]; switch (iph->version) { case 4: @@ -755,7 +756,9 @@ DEBUGP(DTUN, "Received packet for APN(%s) from tun %s", apn->cfg.name, tun->devname); if (ippool_getip(pool, &ipm, &dst)) { - DEBUGPC(DTUN, " with no PDP contex!!\n"); + DEBUGPC(DTUN, " with no PDP contex! (%s)\n", iph->version == 4 ? + inet_ntop(AF_INET, &iph->saddr, straddr, sizeof(straddr)) : + inet_ntop(AF_INET6, &ip6h->ip6_src, straddr, sizeof(straddr))); return 0; } DEBUGPC(DTUN, "\n"); -- To view, visit https://gerrit.osmocom.org/6201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib3a87ec2b2d0014376295028a648750fa3124485 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 14:59:18 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 14:59:18 +0000 Subject: [MERGED] osmo-ggsn[master]: ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll addr ...................................................................... ggsn.c: cb_tun_ind: Don't drop packets targeting pdp ctx ll addr Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 --- M ggsn/ggsn.c 1 file changed, 6 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index fed8f73..caf6151 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -726,6 +726,7 @@ struct ip6_hdr *ip6h = (struct ip6_hdr *)pack; struct ippool_t *pool; char straddr[INET6_ADDRSTRLEN]; + uint8_t pref_offset; switch (iph->version) { case 4: @@ -739,9 +740,12 @@ /* Due to the fact that 3GPP requires an allocation of a * /64 prefix to each MS, we must instruct * ippool_getip() below to match only the leading /64 - * prefix, i.e. the first 8 bytes of the address */ + * prefix, i.e. the first 8 bytes of the address. If the ll addr + * is used, then the match should be done on the trailing 64 + * bits. */ dst.len = 8; - dst.v6 = ip6h->ip6_dst; + pref_offset = IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_dst) ? 8 : 0; + memcpy(&dst.v6, ((uint8_t*)&ip6h->ip6_dst) + pref_offset, 8); pool = apn->v6.pool; break; default: -- To view, visit https://gerrit.osmocom.org/6202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I72602a78baa2a7e3412d8b69c1bf1b3ac0efa434 Gerrit-PatchSet: 2 Gerrit-Project: osmo-ggsn Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 15:02:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 15:02:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#13). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/tbf/TbfTest.err 2 files changed, 90 insertions(+), 40 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/13 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index e290a14..655036c 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -58,6 +58,21 @@ return was_set; } +static inline void masked_override_with(char *buf, uint8_t mask, char set_char) +{ + int i; + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) + buf[i] = set_char; +} + +static void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); +} + static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) { uint8_t usf_map = 0; @@ -724,6 +739,75 @@ return 0; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + ts_format(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -897,50 +981,16 @@ /* Step 4: Update MS and TBF and really allocate the resources */ - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index c673af6..98ec04b 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -5906,7 +5906,7 @@ Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 13 Gerrit-Project: osmo-pcu 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 Wed Jan 31 15:02:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 15:02:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split off RX mask computation 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/3913 to look at the new patch set (#11). Simplify TS alloc: split off RX mask computation Move computation of RX mask into separate function and document it. This allows to significantly shrink find_multi_slot() function and overall improve code readability. Since the test output requires cosmetic adjustment anyway due to change in the sequence of log messages, use this opportunity to better group and format log message. Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/tbf/TbfTest.err 4 files changed, 55 insertions(+), 46 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/3913/11 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 1e70c6f..e290a14 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -498,11 +498,9 @@ */ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { - uint8_t Tx, Sum; /* Maximum Number of Slots: RX, Tx, Sum Rx+Tx */ - uint8_t Tta, Ttb, Tra, Trb; /* Minimum Number of Slots */ - uint8_t Type; /* Type of Mobile */ + uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ + Sum = mslot_class_get_sum(mslot_class); /* Max number of Tx + Rx slots */ int rx_window, tx_window, pdch_slots; - static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; int max_capacity = -1; uint8_t max_ul_slots = 0, max_dl_slots = 0; @@ -510,35 +508,17 @@ unsigned ul_ts, dl_ts; unsigned num_tx; - enum {MASK_TT, MASK_TR}; unsigned mask_sel; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", mslot_class); - Tx = mslot_class_get_tx(mslot_class); - Sum = mslot_class_get_sum(mslot_class); - Tta = mslot_class_get_ta(mslot_class); - Ttb = mslot_class_get_tb(mslot_class); - - /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly - see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ - Tra = mslot_class_get_ra(mslot_class, 0); - Trb = mslot_class_get_rb(mslot_class, 0); - - Type = mslot_class_get_type(mslot_class); - if (Tx == MS_NA) { LOGP(DRLCMAC, LOGL_NOTICE, "Multislot class %d not applicable.\n", mslot_class); return -EINVAL; } - - LOGP(DRLCMAC, LOGL_DEBUG, "- Rx=%d Tx=%d Sum Rx+Tx=%s Tta=%s Ttb=%d " - " Tra=%d Trb=%d Type=%d\n", mslot_class_get_rx(mslot_class), Tx, - (Sum == MS_NA) ? "N/A" : digit[Sum], - (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); max_slots = OSMO_MAX(mslot_class_get_rx(mslot_class), Tx); @@ -561,29 +541,12 @@ /* Check for each UL (TX) slot */ - max_capacity = -1; - max_ul_slots = 0; - max_dl_slots = 0; - /* Iterate through possible numbers of TX slots */ for (num_tx = 1; num_tx <= mslot_class_get_tx(mslot_class); num_tx += 1) { uint16_t tx_valid_win = (1 << num_tx) - 1; + uint8_t rx_mask[MASK_TR + 1]; - uint8_t rx_mask[MASK_TR+1]; - if (Type == 1) { - rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; - rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); - rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; - rx_mask[MASK_TR] &= - ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); - } else { - /* Class type 2 MS have independant RX and TX */ - rx_mask[MASK_TT] = 0xff; - rx_mask[MASK_TR] = 0xff; - } - - rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); - rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); + mslot_fill_rx_mask(mslot_class, num_tx, rx_mask); /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { @@ -651,7 +614,7 @@ /* Whether to skip this round doesn not only depend on the bit * sets but also on mask_sel. Therefore this check must be done * before doing the test_and_set_bit shortcut. */ - if (Type == 1) { + if (mslot_class_get_type(mslot_class) == 1) { unsigned slot_sum = rx_slot_count + tx_slot_count; /* Assume down+up/dynamic. * TODO: For ext-dynamic, down only, up only add more @@ -703,7 +666,7 @@ /* Check number of common slots according to TS 54.002, 6.4.2.2 */ common_slot_count = pcu_bitcount(tx_window & rx_window); req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (Type == 1) + if (mslot_class_get_type(mslot_class) == 1) req_common_slots = OSMO_MIN(req_common_slots, 2); if (req_common_slots != common_slot_count) { diff --git a/src/mslot_class.c b/src/mslot_class.c index 12d6d9e..1c79a21 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -21,6 +21,7 @@ */ #include +#include #include #include @@ -170,3 +171,44 @@ { return get_mslot_table(ms_cl)->type; } + +/*! Fill in RX mask table for a given MS Class + * + * \param[in] ms_cl MS Class pointer + * \param[in] num_tx Number of TX slots to consider + * \param[out] rx_mask RX mask table + */ +void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask) +{ + static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; + uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ + Sum = mslot_class_get_sum(mslot_class), /* Max number of Tx + Rx slots */ + Type = mslot_class_get_type(mslot_class), /* Type of Mobile */ + Tta = mslot_class_get_ta(mslot_class), /* Minimum number of slots */ + Ttb = mslot_class_get_tb(mslot_class), + /* FIXME: use actual TA offset for computation - make sure to adjust "1 + MS_TO" accordingly + see also "Offset required" bit in 3GPP TS 24.008 ?10.5.1.7 */ + Tra = mslot_class_get_ra(mslot_class, 0), + Trb = mslot_class_get_rb(mslot_class, 0); + + if (num_tx == 1) /* it's enough to log this once per TX slot set iteration */ + LOGP(DRLCMAC, LOGL_DEBUG, + "Rx=%d Tx=%d Sum Rx+Tx=%s, Tta=%s Ttb=%d, Tra=%d Trb=%d, Type=%d\n", + mslot_class_get_rx(mslot_class), Tx, + (Sum == MS_NA) ? "N/A" : digit[Sum], + (Tta == MS_NA) ? "N/A" : digit[Tta], Ttb, Tra, Trb, Type); + + if (Type == 1) { + rx_mask[MASK_TT] = (0x100 >> OSMO_MAX(Ttb, Tta)) - 1; + rx_mask[MASK_TT] &= ~((1 << (Trb + num_tx)) - 1); + rx_mask[MASK_TR] = (0x100 >> Ttb) - 1; + rx_mask[MASK_TR] &= ~((1 << (OSMO_MAX(Trb, Tra) + num_tx)) - 1); + } else { + /* Class type 2 MS have independant RX and TX */ + rx_mask[MASK_TT] = 0xff; + rx_mask[MASK_TR] = 0xff; + } + + rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); + rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); +} diff --git a/src/mslot_class.h b/src/mslot_class.h index a6366fc..4f5a7ff 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -36,6 +36,8 @@ #define DEFAULT_MSLOT_CLASS 12 +enum { MASK_TT = 0, MASK_TR = 1 }; + /* multislot class selection routines */ uint8_t mslot_class_get_ta(uint8_t ms_cl); uint8_t mslot_class_get_tb(uint8_t ms_cl); @@ -46,3 +48,5 @@ uint8_t mslot_class_get_sum(uint8_t ms_cl); uint8_t mslot_class_get_type(uint8_t ms_cl); uint8_t mslot_class_max(); + +void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index d207a1d..c673af6 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3011,12 +3011,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -3050,12 +3050,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 12 -- Rx=4 Tx=4 Sum Rx+Tx=5 Tta=2 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..DDDD.."(TS=7) Using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) @@ -5898,12 +5898,12 @@ Searching for first unallocated TFI: TRX=0 Found TFI=0. Slot Allocation (Algorithm B) for class 11 -- Rx=4 Tx=3 Sum Rx+Tx=5 Tta=3 Ttb=1 Tra=2 Trb=1 Type=1 - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) +Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single Using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"....C..."(TS=7) -- To view, visit https://gerrit.osmocom.org/3913 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I731726a096bba7ee97499e5cbe3e7401869d7392 Gerrit-PatchSet: 11 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 Wed Jan 31 15:02:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 15:02:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: separate capacity computation 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/3934 to look at the new patch set (#9). Simplify TS alloc: separate capacity computation Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 34 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/3934/9 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index c45aa39..1e70c6f 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -461,6 +461,33 @@ return 0; } +/*! Compute capacity of a given TRX + * + * \param[in] trx Pointer to TRX object + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \returns non-negative capacity + */ +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +{ + const struct gprs_rlcmac_pdch *pdch; + unsigned ts, capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF), 1); + + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch) >= 0) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF), 1); + } + } + + return capacity; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -477,9 +504,8 @@ int rx_window, tx_window, pdch_slots; static const char *digit[10] = { "0","1","2","3","4","5","6","7","8","9" }; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; + int max_capacity = -1; + uint8_t max_ul_slots = 0, max_dl_slots = 0; unsigned max_slots; unsigned ul_ts, dl_ts; @@ -599,7 +625,6 @@ unsigned rx_slot_count; uint16_t rx_bad; uint8_t rx_good; - unsigned ts; int capacity; /* Filter out bad slots */ @@ -698,25 +723,7 @@ } /* Compute capacity */ - capacity = 0; - - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - } - } + capacity = compute_capacity(trx, rx_window, tx_window); #ifdef ENABLE_TS_ALLOC_DEBUG LOGP(DRLCMAC, LOGL_DEBUG, @@ -737,7 +744,10 @@ max_capacity = capacity; max_ul_slots = tx_window; max_dl_slots = rx_window; - }}}} + } + } + } + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 9 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 Wed Jan 31 15:02:20 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 15:02:20 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions 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/3935 to look at the new patch set (#9). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. Add corresponding tests. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/MslotTest.cpp M tests/alloc/MslotTest.ok 5 files changed, 627 insertions(+), 123 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/9 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 8759cf0..1caf599 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -50,14 +50,6 @@ return buf; } -static bool test_and_set_bit(uint32_t *bits, size_t elem) -{ - bool was_set = bits[elem/32] & (1 << (elem % 32)); - bits[elem/32] |= (1 << (elem % 32)); - - return was_set; -} - static inline void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; @@ -108,11 +100,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -399,7 +391,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -506,6 +498,58 @@ return capacity; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(uint8_t mslot_class, bool check_tr, + int16_t rx_window, int16_t tx_window, + uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots, + rx_slot_count = pcu_bitcount(rx_window), + tx_slot_count = pcu_bitcount(tx_window); + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the mslot_test_and_set_bit shortcut. */ + if (mslot_class_get_type(mslot_class) == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (mslot_test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (mslot_class_get_type(mslot_class) == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -517,16 +561,12 @@ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ - Sum = mslot_class_get_sum(mslot_class); /* Max number of Tx + Rx slots */ - int rx_window, tx_window, pdch_slots; + Sum = mslot_class_get_sum(mslot_class), /* Max number of Tx + Rx slots */ + max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; char slot_info[9] = {0}; int max_capacity = -1; uint8_t max_ul_slots = 0, max_dl_slots = 0; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; - unsigned mask_sel; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", @@ -568,13 +608,11 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = mslot_wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -589,10 +627,7 @@ if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) continue; - tx_slot_count = pcu_bitcount(tx_window); - - max_rx = OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { @@ -601,107 +636,14 @@ /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; - - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); - -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (mslot_class_get_type(mslot_class) == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) + rx_window = mslot_filter_bad(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) continue; - if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (mslot_class_get_type(mslot_class) == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif - continue; - } + if (skip_slot(mslot_class, mask_sel != MASK_TT, rx_window, tx_window, checked_rx)) + continue; /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); diff --git a/src/mslot_class.c b/src/mslot_class.c index 1c79a21..318870e 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -212,3 +212,38 @@ rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); } + +uint16_t mslot_wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + +bool mslot_test_and_set_bit(uint32_t *bits, size_t elem) +{ + bool was_set = bits[elem/32] & (1 << (elem % 32)); + bits[elem/32] |= (1 << (elem % 32)); + + return was_set; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xFF & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xFF; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} diff --git a/src/mslot_class.h b/src/mslot_class.h index 4f5a7ff..0c23afd 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -49,4 +49,8 @@ uint8_t mslot_class_get_type(uint8_t ms_cl); uint8_t mslot_class_max(); +/* multislot allocation helper routines */ +uint16_t mslot_wrap_window(uint16_t win); +bool mslot_test_and_set_bit(uint32_t *bits, size_t elem); +int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win); void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp index 1fa28bf..92f92fa 100644 --- a/tests/alloc/MslotTest.cpp +++ b/tests/alloc/MslotTest.cpp @@ -27,6 +27,7 @@ #include extern "C" { + #include "mslot_class.h" #include #include #include @@ -137,6 +138,13 @@ test_all_classes(trx, seq); } +static inline void test_window_wrapper() +{ + uint16_t i; + for (i = 0; i < 256 * 2 + 1; i++) + printf("W[%03u] -> %3u %s\n", + i, mslot_wrap_window(i), mslot_wrap_window(i) < 256 ? "OK" : "FAIL"); +} int main(int argc, char **argv) { @@ -163,6 +171,8 @@ test_multislot_ends(true); test_multislot_ends(false); + test_window_wrapper(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok index 86526bf..a47cf57 100644 --- a/tests/alloc/MslotTest.ok +++ b/tests/alloc/MslotTest.ok @@ -1730,3 +1730,516 @@ [ACC] multislot class 44 - UL: .......1 DL: .......1 [0] [ACC] multislot class 45 - UL: .......1 DL: .......1 [0] [ACC] multislot class 46 - UL: .......1 DL: .......1 [-22] +W[000] -> 0 OK +W[001] -> 1 OK +W[002] -> 2 OK +W[003] -> 3 OK +W[004] -> 4 OK +W[005] -> 5 OK +W[006] -> 6 OK +W[007] -> 7 OK +W[008] -> 8 OK +W[009] -> 9 OK +W[010] -> 10 OK +W[011] -> 11 OK +W[012] -> 12 OK +W[013] -> 13 OK +W[014] -> 14 OK +W[015] -> 15 OK +W[016] -> 16 OK +W[017] -> 17 OK +W[018] -> 18 OK +W[019] -> 19 OK +W[020] -> 20 OK +W[021] -> 21 OK +W[022] -> 22 OK +W[023] -> 23 OK +W[024] -> 24 OK +W[025] -> 25 OK +W[026] -> 26 OK +W[027] -> 27 OK +W[028] -> 28 OK +W[029] -> 29 OK +W[030] -> 30 OK +W[031] -> 31 OK +W[032] -> 32 OK +W[033] -> 33 OK +W[034] -> 34 OK +W[035] -> 35 OK +W[036] -> 36 OK +W[037] -> 37 OK +W[038] -> 38 OK +W[039] -> 39 OK +W[040] -> 40 OK +W[041] -> 41 OK +W[042] -> 42 OK +W[043] -> 43 OK +W[044] -> 44 OK +W[045] -> 45 OK +W[046] -> 46 OK +W[047] -> 47 OK +W[048] -> 48 OK +W[049] -> 49 OK +W[050] -> 50 OK +W[051] -> 51 OK +W[052] -> 52 OK +W[053] -> 53 OK +W[054] -> 54 OK +W[055] -> 55 OK +W[056] -> 56 OK +W[057] -> 57 OK +W[058] -> 58 OK +W[059] -> 59 OK +W[060] -> 60 OK +W[061] -> 61 OK +W[062] -> 62 OK +W[063] -> 63 OK +W[064] -> 64 OK +W[065] -> 65 OK +W[066] -> 66 OK +W[067] -> 67 OK +W[068] -> 68 OK +W[069] -> 69 OK +W[070] -> 70 OK +W[071] -> 71 OK +W[072] -> 72 OK +W[073] -> 73 OK +W[074] -> 74 OK +W[075] -> 75 OK +W[076] -> 76 OK +W[077] -> 77 OK +W[078] -> 78 OK +W[079] -> 79 OK +W[080] -> 80 OK +W[081] -> 81 OK +W[082] -> 82 OK +W[083] -> 83 OK +W[084] -> 84 OK +W[085] -> 85 OK +W[086] -> 86 OK +W[087] -> 87 OK +W[088] -> 88 OK +W[089] -> 89 OK +W[090] -> 90 OK +W[091] -> 91 OK +W[092] -> 92 OK +W[093] -> 93 OK +W[094] -> 94 OK +W[095] -> 95 OK +W[096] -> 96 OK +W[097] -> 97 OK +W[098] -> 98 OK +W[099] -> 99 OK +W[100] -> 100 OK +W[101] -> 101 OK +W[102] -> 102 OK +W[103] -> 103 OK +W[104] -> 104 OK +W[105] -> 105 OK +W[106] -> 106 OK +W[107] -> 107 OK +W[108] -> 108 OK +W[109] -> 109 OK +W[110] -> 110 OK +W[111] -> 111 OK +W[112] -> 112 OK +W[113] -> 113 OK +W[114] -> 114 OK +W[115] -> 115 OK +W[116] -> 116 OK +W[117] -> 117 OK +W[118] -> 118 OK +W[119] -> 119 OK +W[120] -> 120 OK +W[121] -> 121 OK +W[122] -> 122 OK +W[123] -> 123 OK +W[124] -> 124 OK +W[125] -> 125 OK +W[126] -> 126 OK +W[127] -> 127 OK +W[128] -> 128 OK +W[129] -> 129 OK +W[130] -> 130 OK +W[131] -> 131 OK +W[132] -> 132 OK +W[133] -> 133 OK +W[134] -> 134 OK +W[135] -> 135 OK +W[136] -> 136 OK +W[137] -> 137 OK +W[138] -> 138 OK +W[139] -> 139 OK +W[140] -> 140 OK +W[141] -> 141 OK +W[142] -> 142 OK +W[143] -> 143 OK +W[144] -> 144 OK +W[145] -> 145 OK +W[146] -> 146 OK +W[147] -> 147 OK +W[148] -> 148 OK +W[149] -> 149 OK +W[150] -> 150 OK +W[151] -> 151 OK +W[152] -> 152 OK +W[153] -> 153 OK +W[154] -> 154 OK +W[155] -> 155 OK +W[156] -> 156 OK +W[157] -> 157 OK +W[158] -> 158 OK +W[159] -> 159 OK +W[160] -> 160 OK +W[161] -> 161 OK +W[162] -> 162 OK +W[163] -> 163 OK +W[164] -> 164 OK +W[165] -> 165 OK +W[166] -> 166 OK +W[167] -> 167 OK +W[168] -> 168 OK +W[169] -> 169 OK +W[170] -> 170 OK +W[171] -> 171 OK +W[172] -> 172 OK +W[173] -> 173 OK +W[174] -> 174 OK +W[175] -> 175 OK +W[176] -> 176 OK +W[177] -> 177 OK +W[178] -> 178 OK +W[179] -> 179 OK +W[180] -> 180 OK +W[181] -> 181 OK +W[182] -> 182 OK +W[183] -> 183 OK +W[184] -> 184 OK +W[185] -> 185 OK +W[186] -> 186 OK +W[187] -> 187 OK +W[188] -> 188 OK +W[189] -> 189 OK +W[190] -> 190 OK +W[191] -> 191 OK +W[192] -> 192 OK +W[193] -> 193 OK +W[194] -> 194 OK +W[195] -> 195 OK +W[196] -> 196 OK +W[197] -> 197 OK +W[198] -> 198 OK +W[199] -> 199 OK +W[200] -> 200 OK +W[201] -> 201 OK +W[202] -> 202 OK +W[203] -> 203 OK +W[204] -> 204 OK +W[205] -> 205 OK +W[206] -> 206 OK +W[207] -> 207 OK +W[208] -> 208 OK +W[209] -> 209 OK +W[210] -> 210 OK +W[211] -> 211 OK +W[212] -> 212 OK +W[213] -> 213 OK +W[214] -> 214 OK +W[215] -> 215 OK +W[216] -> 216 OK +W[217] -> 217 OK +W[218] -> 218 OK +W[219] -> 219 OK +W[220] -> 220 OK +W[221] -> 221 OK +W[222] -> 222 OK +W[223] -> 223 OK +W[224] -> 224 OK +W[225] -> 225 OK +W[226] -> 226 OK +W[227] -> 227 OK +W[228] -> 228 OK +W[229] -> 229 OK +W[230] -> 230 OK +W[231] -> 231 OK +W[232] -> 232 OK +W[233] -> 233 OK +W[234] -> 234 OK +W[235] -> 235 OK +W[236] -> 236 OK +W[237] -> 237 OK +W[238] -> 238 OK +W[239] -> 239 OK +W[240] -> 240 OK +W[241] -> 241 OK +W[242] -> 242 OK +W[243] -> 243 OK +W[244] -> 244 OK +W[245] -> 245 OK +W[246] -> 246 OK +W[247] -> 247 OK +W[248] -> 248 OK +W[249] -> 249 OK +W[250] -> 250 OK +W[251] -> 251 OK +W[252] -> 252 OK +W[253] -> 253 OK +W[254] -> 254 OK +W[255] -> 255 OK +W[256] -> 1 OK +W[257] -> 1 OK +W[258] -> 3 OK +W[259] -> 3 OK +W[260] -> 5 OK +W[261] -> 5 OK +W[262] -> 7 OK +W[263] -> 7 OK +W[264] -> 9 OK +W[265] -> 9 OK +W[266] -> 11 OK +W[267] -> 11 OK +W[268] -> 13 OK +W[269] -> 13 OK +W[270] -> 15 OK +W[271] -> 15 OK +W[272] -> 17 OK +W[273] -> 17 OK +W[274] -> 19 OK +W[275] -> 19 OK +W[276] -> 21 OK +W[277] -> 21 OK +W[278] -> 23 OK +W[279] -> 23 OK +W[280] -> 25 OK +W[281] -> 25 OK +W[282] -> 27 OK +W[283] -> 27 OK +W[284] -> 29 OK +W[285] -> 29 OK +W[286] -> 31 OK +W[287] -> 31 OK +W[288] -> 33 OK +W[289] -> 33 OK +W[290] -> 35 OK +W[291] -> 35 OK +W[292] -> 37 OK +W[293] -> 37 OK +W[294] -> 39 OK +W[295] -> 39 OK +W[296] -> 41 OK +W[297] -> 41 OK +W[298] -> 43 OK +W[299] -> 43 OK +W[300] -> 45 OK +W[301] -> 45 OK +W[302] -> 47 OK +W[303] -> 47 OK +W[304] -> 49 OK +W[305] -> 49 OK +W[306] -> 51 OK +W[307] -> 51 OK +W[308] -> 53 OK +W[309] -> 53 OK +W[310] -> 55 OK +W[311] -> 55 OK +W[312] -> 57 OK +W[313] -> 57 OK +W[314] -> 59 OK +W[315] -> 59 OK +W[316] -> 61 OK +W[317] -> 61 OK +W[318] -> 63 OK +W[319] -> 63 OK +W[320] -> 65 OK +W[321] -> 65 OK +W[322] -> 67 OK +W[323] -> 67 OK +W[324] -> 69 OK +W[325] -> 69 OK +W[326] -> 71 OK +W[327] -> 71 OK +W[328] -> 73 OK +W[329] -> 73 OK +W[330] -> 75 OK +W[331] -> 75 OK +W[332] -> 77 OK +W[333] -> 77 OK +W[334] -> 79 OK +W[335] -> 79 OK +W[336] -> 81 OK +W[337] -> 81 OK +W[338] -> 83 OK +W[339] -> 83 OK +W[340] -> 85 OK +W[341] -> 85 OK +W[342] -> 87 OK +W[343] -> 87 OK +W[344] -> 89 OK +W[345] -> 89 OK +W[346] -> 91 OK +W[347] -> 91 OK +W[348] -> 93 OK +W[349] -> 93 OK +W[350] -> 95 OK +W[351] -> 95 OK +W[352] -> 97 OK +W[353] -> 97 OK +W[354] -> 99 OK +W[355] -> 99 OK +W[356] -> 101 OK +W[357] -> 101 OK +W[358] -> 103 OK +W[359] -> 103 OK +W[360] -> 105 OK +W[361] -> 105 OK +W[362] -> 107 OK +W[363] -> 107 OK +W[364] -> 109 OK +W[365] -> 109 OK +W[366] -> 111 OK +W[367] -> 111 OK +W[368] -> 113 OK +W[369] -> 113 OK +W[370] -> 115 OK +W[371] -> 115 OK +W[372] -> 117 OK +W[373] -> 117 OK +W[374] -> 119 OK +W[375] -> 119 OK +W[376] -> 121 OK +W[377] -> 121 OK +W[378] -> 123 OK +W[379] -> 123 OK +W[380] -> 125 OK +W[381] -> 125 OK +W[382] -> 127 OK +W[383] -> 127 OK +W[384] -> 129 OK +W[385] -> 129 OK +W[386] -> 131 OK +W[387] -> 131 OK +W[388] -> 133 OK +W[389] -> 133 OK +W[390] -> 135 OK +W[391] -> 135 OK +W[392] -> 137 OK +W[393] -> 137 OK +W[394] -> 139 OK +W[395] -> 139 OK +W[396] -> 141 OK +W[397] -> 141 OK +W[398] -> 143 OK +W[399] -> 143 OK +W[400] -> 145 OK +W[401] -> 145 OK +W[402] -> 147 OK +W[403] -> 147 OK +W[404] -> 149 OK +W[405] -> 149 OK +W[406] -> 151 OK +W[407] -> 151 OK +W[408] -> 153 OK +W[409] -> 153 OK +W[410] -> 155 OK +W[411] -> 155 OK +W[412] -> 157 OK +W[413] -> 157 OK +W[414] -> 159 OK +W[415] -> 159 OK +W[416] -> 161 OK +W[417] -> 161 OK +W[418] -> 163 OK +W[419] -> 163 OK +W[420] -> 165 OK +W[421] -> 165 OK +W[422] -> 167 OK +W[423] -> 167 OK +W[424] -> 169 OK +W[425] -> 169 OK +W[426] -> 171 OK +W[427] -> 171 OK +W[428] -> 173 OK +W[429] -> 173 OK +W[430] -> 175 OK +W[431] -> 175 OK +W[432] -> 177 OK +W[433] -> 177 OK +W[434] -> 179 OK +W[435] -> 179 OK +W[436] -> 181 OK +W[437] -> 181 OK +W[438] -> 183 OK +W[439] -> 183 OK +W[440] -> 185 OK +W[441] -> 185 OK +W[442] -> 187 OK +W[443] -> 187 OK +W[444] -> 189 OK +W[445] -> 189 OK +W[446] -> 191 OK +W[447] -> 191 OK +W[448] -> 193 OK +W[449] -> 193 OK +W[450] -> 195 OK +W[451] -> 195 OK +W[452] -> 197 OK +W[453] -> 197 OK +W[454] -> 199 OK +W[455] -> 199 OK +W[456] -> 201 OK +W[457] -> 201 OK +W[458] -> 203 OK +W[459] -> 203 OK +W[460] -> 205 OK +W[461] -> 205 OK +W[462] -> 207 OK +W[463] -> 207 OK +W[464] -> 209 OK +W[465] -> 209 OK +W[466] -> 211 OK +W[467] -> 211 OK +W[468] -> 213 OK +W[469] -> 213 OK +W[470] -> 215 OK +W[471] -> 215 OK +W[472] -> 217 OK +W[473] -> 217 OK +W[474] -> 219 OK +W[475] -> 219 OK +W[476] -> 221 OK +W[477] -> 221 OK +W[478] -> 223 OK +W[479] -> 223 OK +W[480] -> 225 OK +W[481] -> 225 OK +W[482] -> 227 OK +W[483] -> 227 OK +W[484] -> 229 OK +W[485] -> 229 OK +W[486] -> 231 OK +W[487] -> 231 OK +W[488] -> 233 OK +W[489] -> 233 OK +W[490] -> 235 OK +W[491] -> 235 OK +W[492] -> 237 OK +W[493] -> 237 OK +W[494] -> 239 OK +W[495] -> 239 OK +W[496] -> 241 OK +W[497] -> 241 OK +W[498] -> 243 OK +W[499] -> 243 OK +W[500] -> 245 OK +W[501] -> 245 OK +W[502] -> 247 OK +W[503] -> 247 OK +W[504] -> 249 OK +W[505] -> 249 OK +W[506] -> 251 OK +W[507] -> 251 OK +W[508] -> 253 OK +W[509] -> 253 OK +W[510] -> 255 OK +W[511] -> 255 OK +W[512] -> 2 OK -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 15:08:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 15:08:34 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSC_Tests: fix f_pageing_helper() in case no paging was expe... Message-ID: Review at https://gerrit.osmocom.org/6214 BSC_Tests: fix f_pageing_helper() in case no paging was expected We have to wait for sime time until some RSL paging command would have arrived, rather than continuing too quickly. Change-Id: I63827aa3c42f77648ecad401b3cc4bae927b3b94 --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/14/6214/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 9da5b65..528b1c7 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -949,6 +949,7 @@ setverdict(fail, "RSL Channel Needed != BSSMAP Channel Needed"); } } + f_sleep(2.0); /* do a quick check on all not-included BTSs if they received paging */ for (i := 0; i < NUM_BTS; i := i + 1) { timer T := 0.1; -- To view, visit https://gerrit.osmocom.org/6214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63827aa3c42f77648ecad401b3cc4bae927b3b94 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 15:08:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 15:08:37 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: BSC_Tests: Implement remaining missing paging tests Message-ID: Review at https://gerrit.osmocom.org/6215 BSC_Tests: Implement remaining missing paging tests We now test all of the cell identification types specified in BSSMAP, and also lists with a length != 1 entry. Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b --- M bsc/BSC_Tests.ttcn M library/BSSMAP_Templates.ttcn 2 files changed, 50 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/15/6215/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 528b1c7..467ce4f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -970,6 +970,7 @@ } const BtsIdList c_BtsId_all := { 0, 1, 2 }; +const BtsIdList c_BtsId_none := { }; const BtsIdList c_BtsId_LAC1 := { 0, 1 }; const BtsIdList c_BtsId_LAC2 := { 2 }; @@ -1077,11 +1078,40 @@ } /* Paging by PLMN+LAC+RNC */ -/* Paging by RNC */ -/* Paging by LAC+RNC */ +testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; + f_pageing_helper('001010000000012'H, cid_list, c_BtsId_none); +} -/* Paging on multiple cells (multiple in one LAC): Verify all of them page */ +/* Paging by RNC */ +testcase TC_paging_imsi_nochan_rnc() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_RNC := { int2oct(13, 2) } }; + f_pageing_helper('001010000000013'H, cid_list, c_BtsId_none); +} + +/* Paging by LAC+RNC */ +testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; + f_pageing_helper('001010000000014'H, cid_list, c_BtsId_none); +} + /* Paging on multiple cells (multiple entries in list): Verify all of them page */ +testcase TC_paging_imsi_nochan_lacs() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(1), ts_BSSMAP_CI_LAC(2) } }; + f_pageing_helper('001010000000015'H, cid_list, c_BtsId_all); +} + +/* Paging on empty list: Verify none of them page */ +testcase TC_paging_imsi_nochan_lacs_empty() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_LAC := { } }; + f_pageing_helper('001010000000016'H, cid_list, c_BtsId_none); +} + /* Verify paging retransmission interval + count */ /* Verify paging stops after channel establishment */ /* Test behavior under paging overload */ @@ -1421,6 +1451,11 @@ execute( TC_paging_imsi_nochan_lai() ); execute( TC_paging_imsi_nochan_lac() ); execute( TC_paging_imsi_nochan_all() ); + execute( TC_paging_imsi_nochan_plmn_lac_rnc() ); + execute( TC_paging_imsi_nochan_rnc() ); + execute( TC_paging_imsi_nochan_lac_rnc() ); + execute( TC_paging_imsi_nochan_lacs() ); + execute( TC_paging_imsi_nochan_lacs_empty() ); execute( TC_paging_imsi_a_reset() ); execute( TC_paging_imsi_load() ); diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index c98f5eb..f0a8a08 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -695,6 +695,18 @@ template OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); template OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); +template BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC +ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := { + mcc_mnc := f_enc_mcc_mnc(mcc, mnc), + lac := int2oct(lac, 2), + rncId := int2oct(rnc_id, 2) +} + +template BSSMAP_FIELD_CellIdentification_LAC_RNC ts_BSSMAP_CI_LAC_RNC(GsmLac lac, uint16_t rnc_id) := { + lac := int2oct(lac, 2), + rncId := int2oct(rnc_id, 2) +} + template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { elementIdentifier := '24'O, channel := chneed, -- To view, visit https://gerrit.osmocom.org/6215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 15:08:37 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 15:08:37 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Change expectation in paging tets Message-ID: Review at https://gerrit.osmocom.org/6216 bsc: Change expectation in paging tets When we page an unknown/unsupported CellIdentifier format, OsmoBSC decides to page on all BTSs to be safe. This way we have a chance of making communication happen, rather than breaking it. Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea --- M bsc/BSC_Tests.ttcn 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/6216/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 467ce4f..8b44a25 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1081,21 +1081,21 @@ testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; - f_pageing_helper('001010000000012'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000012'H, cid_list, c_BtsId_all); } /* Paging by RNC */ testcase TC_paging_imsi_nochan_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_RNC := { int2oct(13, 2) } }; - f_pageing_helper('001010000000013'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000013'H, cid_list, c_BtsId_all); } /* Paging by LAC+RNC */ testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; - f_pageing_helper('001010000000014'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000014'H, cid_list, c_BtsId_all); } /* Paging on multiple cells (multiple entries in list): Verify all of them page */ -- To view, visit https://gerrit.osmocom.org/6216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot assignment In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3905 to look at the new patch set (#14). Simplify TS alloc: move slot assignment Move into separate functions: * move timeslot reservation * move UL timeslot assignment * move DL timeslot assignment Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/tbf/TbfTest.err 4 files changed, 84 insertions(+), 42 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/3905/14 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 6883cb0..77c76f9 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -828,6 +828,75 @@ return ul_slots; } +/*! Update MS' reserved timeslots + * + * \param[in,out] trx Pointer to TRX struct + * \param[in,out] ms_ Pointer to MS object + * \param[in] tbf_ Pointer to TBF struct + * \param[in] res_ul_slots Newly reserved UL slots + * \param[in] res_dl_slots Newly reserved DL slots + * \param[in] ul_slots available UL slots (for logging only) + * \param[in] dl_slots available DL slots (for logging only) + */ +static void update_ms_reserved_slots(gprs_rlcmac_trx *trx, GprsMs *ms, uint8_t res_ul_slots, uint8_t res_dl_slots, + uint8_t ul_slots, uint8_t dl_slots) +{ + char slot_info[9] = { 0 }; + + if (res_ul_slots == ms->reserved_ul_slots() && res_dl_slots == ms->reserved_dl_slots()) + return; + + /* The reserved slots have changed, update the MS */ + ms->set_reserved_slots(trx, res_ul_slots, res_dl_slots); + + ts_format(slot_info, dl_slots, ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); +} + +/*! Assign given UL timeslots to UL TBF + * + * \param[in,out] ul_tbf Pointer to UL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + * \param[in] usf selected USF + */ +static void assign_ul_tbf_slots(struct gprs_rlcmac_ul_tbf *ul_tbf, gprs_rlcmac_trx *trx, uint8_t ul_slots, int tfi, + int *usf) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(ul_slots & (1 << ts))) + continue; + + OSMO_ASSERT(usf[ts] >= 0); + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS %u\n", ts); + assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, tfi, usf[ts]); + } +} + +/*! Assign given DL timeslots to DL TBF + * + * \param[in,out] dl_tbf Pointer to DL TBF struct + * \param[in,out] trx Pointer to TRX object + * \param[in] ul_slots Set of slots to be assigned + * \param[in] tfi selected TFI + */ +static void assign_dl_tbf_slots(struct gprs_rlcmac_dl_tbf *dl_tbf, gprs_rlcmac_trx *trx, uint8_t dl_slots, int tfi) +{ + uint8_t ts; + + for (ts = 0; ts < 8; ts++) { + if (!(dl_slots & (1 << ts))) + continue; + + LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS %u\n", ts); + assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); + } +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -850,8 +919,6 @@ int8_t first_common_ts; uint8_t slotcount = 0; uint8_t avail_count = 0, trx_no; - char slot_info[9] = {0}; - int ts; int first_ts = -1; int usf[8] = {-1, -1, -1, -1, -1, -1, -1, -1}; int rc; @@ -948,50 +1015,16 @@ /* Step 4: Update MS and TBF and really allocate the resources */ - /* The reserved slots have changed, update the MS */ - if (reserved_ul_slots != ms->reserved_ul_slots() || - reserved_dl_slots != ms->reserved_dl_slots()) - { - ms_->set_reserved_slots(trx, - reserved_ul_slots, reserved_dl_slots); - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Reserved DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - dl_slots, 'D', '.'), - ul_slots, 'U'), - ul_slots & dl_slots, 'C')); - } + update_ms_reserved_slots(trx, ms_, reserved_ul_slots, reserved_dl_slots, ul_slots, dl_slots); tbf_->trx = trx; tbf_->first_common_ts = first_common_ts; tbf_->first_ts = first_ts; - if (tbf->direction == GPRS_RLCMAC_DL_TBF) { - struct gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf_); - for (ts = 0; ts < 8; ts++) { - if (!(dl_slots & (1 << ts))) - continue; - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning DL TS " - "%d\n", ts); - assign_dlink_tbf(&trx->pdch[ts], dl_tbf, tfi); - } - } else { - struct gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf_); - - for (ts = 0; ts < 8; ts++) { - if (!(ul_slots & (1 << ts))) - continue; - - OSMO_ASSERT(usf[ts] >= 0); - - LOGP(DRLCMAC, LOGL_DEBUG, "- Assigning UL TS " - "%d\n", ts); - assign_uplink_tbf_usf(&trx->pdch[ts], ul_tbf, - tfi, usf[ts]); - } - } + if (tbf->direction == GPRS_RLCMAC_DL_TBF) + assign_dl_tbf_slots(as_dl_tbf(tbf_), trx, dl_slots, tfi); + else + assign_ul_tbf_slots(as_ul_tbf(tbf_), trx, ul_slots, tfi, usf); bts->bts->tbf_alloc_algo_b(); diff --git a/src/mslot_class.c b/src/mslot_class.c index 6a7e25b..dad94ae 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -236,3 +237,10 @@ if (mask & 1) buf[i] = set_char; } + +void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask) +{ + snprintf(buf, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(dl_mask, 'D')); + masked_override_with(buf, ul_mask, 'U'); + masked_override_with(buf, ul_mask & dl_mask, 'C'); +} diff --git a/src/mslot_class.h b/src/mslot_class.h index c274337..d8b024b 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -53,3 +53,4 @@ void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); int8_t find_free_usf(uint8_t usf_map); void masked_override_with(char *buf, uint8_t mask, char set_char); +void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 98604e2..a48487d 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -5906,7 +5906,7 @@ Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL -- Reserved DL/UL slots: (TS=0)"....C..."(TS=7) +- Reserved DL/UL slots: (TS=0)"...DC..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Setting Control TS 4 -- To view, visit https://gerrit.osmocom.org/3905 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I64cf78c5cfc78664766f9769dd5cde632dab92b0 Gerrit-PatchSet: 14 Gerrit-Project: osmo-pcu 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 Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split allocation 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/3906 to look at the new patch set (#16). Simplify TS alloc: split allocation * generalize TS allocation and move it into separate function * move single-slot allocation into separate function * use common functions for TS allocation on both UL and DL Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h 3 files changed, 105 insertions(+), 57 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/06/3906/16 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 622342c..80693b5 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -706,6 +706,87 @@ return 0; } +/*! Count used bits in slots and reserved_slots bitmasks + * + * \param[in] slots Timeslots in use + * \param[in] reserved_slots Reserved timeslots + * \param[out] slotcount Number of TS in use + * \param[out] avail_count Number of reserved TS + */ +static void update_slot_counters(uint8_t slots, uint8_t reserved_slots, uint8_t *slotcount, uint8_t *avail_count) +{ + (*slotcount) = pcu_bitcount(slots); + (*avail_count) = pcu_bitcount(reserved_slots); +} + +/*! Return slot mask with single TS from a given UL/DL set according to TBF's direction, ts pointer is set to that TS + * number or to negative value on error + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] dl_slots set of DL timeslots + * \param[in] ul_slots set of UL timeslots + * \param[in] ts corresponding TS or -1 for autoselection + * \returns slot mask with single UL or DL timeslot number if possible + */ +static uint8_t get_single_ts(const gprs_rlcmac_trx *trx, const gprs_rlcmac_tbf *tbf, uint8_t dl_slots, uint8_t ul_slots, + int ts) +{ + uint8_t ret = dl_slots & ul_slots; /* Make sure to consider the first common slot only */ + + if (ts < 0) + ts = find_least_busy_pdch(trx, tbf->direction, ret, compute_usage_by_num_tbfs, NULL, NULL); + + if (ts < 0) + return ffs(ret); + + return ret & (1 << ts); +} + +/*! Find set of timeslots available for allocation + * + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] single Flag to force the single TS allocation + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] reserved_ul_slots set of reserved UL timeslots + * \param[in] reserved_dl_slots set of reserved DL timeslots + * \param[in] first_common_ts First TS common for both UL and DL or -1 if unknown + * \returns negative error code or selected TS on success + */ +static int tbf_select_slot_set(const gprs_rlcmac_tbf *tbf, const gprs_rlcmac_trx *trx, bool single, + uint8_t ul_slots, uint8_t dl_slots, + uint8_t reserved_ul_slots, uint8_t reserved_dl_slots, + int8_t first_common_ts) +{ + uint8_t sl = tbf->direction != GPRS_RLCMAC_DL_TBF ? ul_slots : dl_slots; + char slot_info[9] = { 0 }; + + if (single) + sl = get_single_ts(trx, tbf, dl_slots, ul_slots, first_common_ts); + + if (!sl) { + LOGP(DRLCMAC, LOGL_NOTICE, "No %s slots available\n", + tbf->direction != GPRS_RLCMAC_DL_TBF ? "uplink" : "downlink"); + return -EINVAL; + } + + if (tbf->direction != GPRS_RLCMAC_DL_TBF) { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_ul_slots, 'u')); + masked_override_with(slot_info, sl, 'U'); + LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected UL"); + } else { + snprintf(slot_info, 9, OSMO_BIT_SPEC, OSMO_BIT_PRINT_EX(reserved_dl_slots, 'd')); + masked_override_with(slot_info, sl, 'D'); + LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); + } + + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + + return sl; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -770,86 +851,43 @@ reserved_dl_slots = dl_slots; reserved_ul_slots = ul_slots; - /* Step 3: Derive the slot set for the current TBF */ - if (single) { - /* Make sure to consider the first common slot only */ - ul_slots = dl_slots = dl_slots & ul_slots; - - ts = first_common_ts; - - if (ts < 0) - ts = find_least_busy_pdch(trx, tbf->direction, - dl_slots & ul_slots, compute_usage_by_num_tbfs, - NULL, NULL); - if (ts < 0) - ul_slots = dl_slots = pcu_lsb(dl_slots & ul_slots); - else - ul_slots = dl_slots = (dl_slots & ul_slots) & (1<direction == GPRS_RLCMAC_DL_TBF) { - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected DL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_dl_slots, 'd', '.'), - dl_slots, 'D'), - single ? ", single" : ""); - - /* assign downlink */ - if (dl_slots == 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No downlink slots " - "available\n"); - return -EINVAL; - } - slotcount = pcu_bitcount(dl_slots); - first_ts = ffs(dl_slots) - 1; - avail_count = pcu_bitcount(reserved_dl_slots); - + dl_slots = rc; + update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { int free_usf = -1; + + ul_slots = rc; if (first_common_ts >= 0) ul_slots = 1 << first_common_ts; else ul_slots = ul_slots & dl_slots; - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, - ul_slots, compute_usage_by_num_tbfs, - NULL, &free_usf); + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); if (free_usf < 0) { LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); return -EBUSY; } + OSMO_ASSERT(ts >= 0 && ts <= 8); + /* We will stick to that single UL slot, unreserve the others */ ul_slots = 1 << ts; usf[ts] = free_usf; - - LOGP(DRLCMAC, LOGL_DEBUG, - "- Selected UL slots: (TS=0)\"%s\"(TS=7)%s\n", - set_flag_chars(set_flag_chars(slot_info, - reserved_ul_slots, 'u', '.'), - ul_slots, 'U'), - single ? ", single" : ""); - - slotcount++; - first_ts = ts; - - /* We will stick to that single UL slot, unreserve the others */ reserved_ul_slots = ul_slots; - avail_count = pcu_bitcount(reserved_ul_slots); + update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); } first_common_ts = ffs(dl_slots & ul_slots) - 1; diff --git a/src/mslot_class.c b/src/mslot_class.c index 87e37ca..6a7e25b 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -228,3 +228,11 @@ return -1; } + +void masked_override_with(char *buf, uint8_t mask, char set_char) +{ + int i; + for (i = 0; mask; i++, mask >>= 1) + if (mask & 1) + buf[i] = set_char; +} diff --git a/src/mslot_class.h b/src/mslot_class.h index d248526..c274337 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -49,5 +49,7 @@ uint8_t mslot_class_get_type(uint8_t ms_cl); uint8_t mslot_class_max(); +/* multislot allocation helper routines */ void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); int8_t find_free_usf(uint8_t usf_map); +void masked_override_with(char *buf, uint8_t mask, char set_char); -- To view, visit https://gerrit.osmocom.org/3906 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ied45ae380c345bc76fe9d6fd9a6184d1109f83f2 Gerrit-PatchSet: 16 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 Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: TS alloc: expand tests log 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/3895 to look at the new patch set (#24). TS alloc: expand tests log * restructure code for easier reading * use consistent formatting for output * log essential allocation parameters on failure Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M tests/alloc/AllocTest.err M tests/tbf/TbfTest.err 3 files changed, 192 insertions(+), 184 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/95/3895/24 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index a891c40..6883cb0 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -372,13 +372,14 @@ const gprs_rlcmac_tbf *tbf = tbf_; gprs_rlcmac_trx *trx = ms->current_trx(); - LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class " - "%d\n", tbf->ms_class()); + LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm A) for class %d [%s]\n", + tbf->ms_class(), (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); trx_no = find_trx(bts, ms, use_trx); if (trx_no < 0) { LOGP(DRLCMAC, LOGL_NOTICE, - "- Failed to find a usable TRX (TFI exhausted)\n"); + "algo A [%s] (suggested TRX: %d): failed to find a usable TRX (TFI exhausted) for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return trx_no; } if (!trx) @@ -406,14 +407,16 @@ &tfi, &usf); if (tbf->direction == GPRS_RLCMAC_UL_TBF && usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no USF available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no USF available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } if (ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed " - "to allocate a TS, no TFI available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, + "algo A [%s] (suggested TRX: %d): failed to allocate a TS, no TFI available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EBUSY; } @@ -782,7 +785,7 @@ LOGPC(DRLCMAC, LOGL_DEBUG, "- Selected DL"); } - LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7)%s\n", slot_info, single ? ", single" : ""); + LOGPC(DRLCMAC, LOGL_DEBUG, " slots: (TS=0)\"%s\"(TS=7), %s\n", slot_info, single ? "single" : "multi"); return sl; } @@ -872,7 +875,8 @@ /* Step 2a: Find usable TRX and TFI */ tfi = tfi_find_free(bts->bts, trx, ms, tbf->direction, use_trx, &trx_no); if (tfi < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "- Failed to allocate a TFI\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): failed to allocate a TFI for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return tfi; } @@ -916,23 +920,27 @@ first_common_ts = ffs(dl_slots & ul_slots) - 1; if (first_common_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first common slots available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first common slots available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } + if (first_ts < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No first slot available\n"); + LOGP(DRLCMAC, LOGL_NOTICE, "algo B [%s] (suggested TRX: %d): no first slot available for %s\n", + single ? "single" : "multi", use_trx, (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); return -EINVAL; } if (single && slotcount) { tbf_->upgrade_to_multislot = (avail_count > slotcount); - LOGP(DRLCMAC, LOGL_INFO, "Using single slot at TS %d for %s\n", - first_ts, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using single slot at TS %d for %s\n", + single ? "single" : "multi", use_trx, first_ts, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } else { tbf_->upgrade_to_multislot = 0; - LOGP(DRLCMAC, LOGL_INFO, "Using %d slots for %s\n", slotcount, - (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); + LOGP(DRLCMAC, LOGL_INFO, "algo B [%s] (suggested TRX: %d): using %d slots for %s\n", + single ? "single" : "multi", use_trx, slotcount, + (tbf->direction == GPRS_RLCMAC_DL_TBF) ? "DL" : "UL"); } /* The allocation will be successful, so the system state and tbf_/ms_ diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index 562135d..b514b78 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -193,7 +193,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -305,7 +305,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -713,7 +713,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 10 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=0/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -931,7 +931,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=0/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -189959,7 +189959,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190155,7 +190155,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=12/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -190351,7 +190351,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=12/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190547,7 +190547,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=9/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190743,7 +190743,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -190939,7 +190939,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 @@ -190961,7 +190961,7 @@ TBF(TFI=4 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -191176,7 +191176,7 @@ TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=7 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -191373,7 +191373,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -191569,11 +191569,11 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 7 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 Allocating UL TBF: MS_CLASS=10/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -192701,7 +192701,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -192932,7 +192932,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 @@ -193164,7 +193164,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -193666,7 +193666,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -193916,7 +193916,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194148,7 +194148,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 @@ -194380,7 +194380,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194390,7 +194390,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194400,7 +194400,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 18 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free @@ -194410,8 +194410,8 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = f0 Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING) free Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -194519,7 +194519,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=1/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194619,7 +194619,7 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL Allocating UL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 00 @@ -194719,26 +194719,26 @@ No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI -- Failed to allocate a TS, no USF available +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for UL +algo A [multi] (suggested TRX: -1): failed to allocate a TS, no USF available for UL Allocating DL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 @@ -195225,7 +195225,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=1/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195325,7 +195325,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocating DL TBF: MS_CLASS=10/0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 5 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 20, dl_slots = 78 @@ -195425,7 +195425,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 3 TBF(TFI=1 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 08 No TFI available (suggested TRX: 0). @@ -195702,7 +195702,7 @@ TBF(TFI=31 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=10/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 08, dl_slots = 00 @@ -196829,7 +196829,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -196937,7 +196937,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 7 TBF(TFI=6 TLLI=0xc0000022 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 00 Allocating UL TBF: MS_CLASS=36/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 35 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -198415,7 +198415,7 @@ TBF(TFI=0 TLLI=0xc000009f DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 160) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -199218,7 +199218,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -199450,7 +199450,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 @@ -199845,7 +199845,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free Allocated 32 TBFs (previously 32) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free @@ -200010,7 +200010,7 @@ No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: -1). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: -1): failed to allocate a TFI for DL Allocated 32 TBFs (previously 32) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200242,7 +200242,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 00 Allocating DL TBF: MS_CLASS=33/0 No TFI available (suggested TRX: 0). -- Failed to allocate a TFI +algo B [multi] (suggested TRX: 0): failed to allocate a TFI for DL TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 40, dl_slots = 40 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free @@ -200696,7 +200696,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=44/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 89 TBFs (previously -1) Allocating UL TBF: MS_CLASS=1/0 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 3 @@ -200771,7 +200771,7 @@ TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) Setting Control TS 4 TBF(TFI=6 TLLI=0xc0000017 DIR=UL STATE=NULL) Allocated: trx = 0, ul_slots = 10, dl_slots = 00 Allocating UL TBF: MS_CLASS=25/0 -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL Allocated 24 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=UL STATE=NULL) free Allocating UL TBF: MS_CLASS=1/0 @@ -202026,7 +202026,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) free No TFI available (suggested TRX: 0). Allocating UL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for UL Allocated 160 TBFs (previously 89) TBF(TFI=0 TLLI=0xc0000000 DIR=DL STATE=RELEASING) free Allocating DL TBF: MS_CLASS=1/0 @@ -202829,7 +202829,7 @@ TBF(TFI=31 TLLI=0xc000009f DIR=DL STATE=NULL) Allocated: trx = 0, ul_slots = 80, dl_slots = 80 No TFI available (suggested TRX: 0). Allocating DL TBF: MS_CLASS=23/0 -- Failed to find a usable TRX (TFI exhausted) +algo A [multi] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL Allocated 160 TBFs (previously 160) Allocating DL TBF: MS_CLASS=11/11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) Setting Control TS 6 diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index c673af6..98604e2 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1,7 +1,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 4, because not enabled @@ -18,7 +18,7 @@ Modifying MS object, TLLI = 0x00002342, TA 220 -> 4 ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 3, because need to reuse TS @@ -41,7 +41,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -90,7 +90,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -128,7 +128,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -177,7 +177,7 @@ TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -215,7 +215,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -468,7 +468,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -490,7 +490,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -531,7 +531,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -556,7 +556,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -581,7 +581,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -606,7 +606,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -631,7 +631,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -656,7 +656,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -681,7 +681,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -706,7 +706,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -731,7 +731,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -756,7 +756,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -781,7 +781,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -806,7 +806,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -831,7 +831,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -856,7 +856,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -881,7 +881,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -906,7 +906,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -931,7 +931,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -956,7 +956,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -981,7 +981,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1006,7 +1006,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1031,7 +1031,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1056,7 +1056,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1081,7 +1081,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1106,7 +1106,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1131,7 +1131,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1156,7 +1156,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1181,7 +1181,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1206,7 +1206,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1231,7 +1231,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1256,7 +1256,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1281,7 +1281,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1306,7 +1306,7 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1331,15 +1331,15 @@ Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 -- Failed to find a usable TRX (TFI exhausted) +Slot Allocation (Algorithm A) for class 45 [DL] +algo A [single] (suggested TRX: -1): failed to find a usable TRX (TFI exhausted) for DL No PDCH resource Destroying MS object, TLLI = 0x00000000 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 45 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1369,7 +1369,7 @@ ********** DL-TBF ends here ********** ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=45/0 -Slot Allocation (Algorithm A) for class 45 +Slot Allocation (Algorithm A) for class 45 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1427,7 +1427,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1470,7 +1470,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=0/0 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1505,7 +1505,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1549,7 +1549,7 @@ Got MS: TLLI = 0xf1223344, TA = 7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1584,7 +1584,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1627,7 +1627,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1713,7 +1713,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1778,7 +1778,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1821,7 +1821,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1870,7 +1870,7 @@ MS requests UL TBF in packet resource request of single block, so we provide one: ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1901,7 +1901,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN) changes state from ASSIGN to FLOW ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1943,7 +1943,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -1986,7 +1986,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2022,7 +2022,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2087,7 +2087,7 @@ Allocating UL TBF: MS_CLASS=1/0 Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2130,7 +2130,7 @@ Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW)', TA=7 ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -2763,7 +2763,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=WAIT RELEASE) starting timer T3193 [release (DL-TBF)] with 0 sec. 0 microsec. ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/0 -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3017,8 +3017,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3056,8 +3056,8 @@ - Skipping TS 7, because not enabled - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=4 Sum Rx+Tx=5, Tta=2 Ttb=1, Tra=2 Trb=1, Type=1 -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: 0): using 4 slots for DL - Reserved DL/UL slots: (TS=0)"..DDCD.."(TS=7) - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -3099,7 +3099,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3148,7 +3148,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3188,7 +3188,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3367,7 +3367,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3398,7 +3398,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3704,7 +3704,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -3960,7 +3960,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4178,7 +4178,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4364,7 +4364,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4530,7 +4530,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4678,7 +4678,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4821,7 +4821,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -4953,7 +4953,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5085,7 +5085,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5140,7 +5140,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5195,7 +5195,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5250,7 +5250,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5321,7 +5321,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5392,7 +5392,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5463,7 +5463,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5534,7 +5534,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5596,7 +5596,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5658,7 +5658,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5720,7 +5720,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5798,7 +5798,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5866,7 +5866,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -5905,7 +5905,7 @@ - Possible DL/UL slots: (TS=0)"..CCCC.."(TS=7) Rx=4 Tx=3 Sum Rx+Tx=5, Tta=3 Ttb=1, Tra=2 Trb=1, Type=1 - Selected DL slots: (TS=0)"..ddDd.."(TS=7), single -Using single slot at TS 4 for DL +algo B [single] (suggested TRX: 0): using single slot at TS 4 for DL - Reserved DL/UL slots: (TS=0)"....C..."(TS=7) - Assigning DL TS 4 PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. @@ -5919,8 +5919,8 @@ PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. Searching for first unallocated TFI: TRX=0 Found TFI=0. -- Selected DL slots: (TS=0)"..DDDD.."(TS=7) -Using 4 slots for DL +- Selected DL slots: (TS=0)"..DDDD.."(TS=7), multi +algo B [multi] (suggested TRX: -1): using 4 slots for DL - Assigning DL TS 2 PDCH(TS 2, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. - Assigning DL TS 3 @@ -5958,7 +5958,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6020,7 +6020,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6051,7 +6051,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6087,7 +6087,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6111,7 +6111,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6135,7 +6135,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6159,7 +6159,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6183,7 +6183,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6207,7 +6207,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6231,7 +6231,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6255,7 +6255,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6264,7 +6264,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [single] (suggested TRX: -1): failed to allocate a TS, no USF available for UL No PDCH resource sending Immediate Assignment Uplink (AGCH) reject Destroying MS object, TLLI = 0x00000000 MS requests UL TBF on RACH, so we provide one: ra=0x70 Fn=2654167 qta=31 is_11bit=0: @@ -6288,7 +6288,7 @@ Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 1 +Slot Allocation (Algorithm A) for class 1 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -6906,7 +6906,7 @@ ********** DL-TBF starts here ********** Allocating DL TBF: MS_CLASS=1/1 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Enabled EGPRS, mode EGPRS -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7678,7 +7678,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [DL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7700,7 +7700,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7724,7 +7724,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7748,7 +7748,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7772,7 +7772,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7796,7 +7796,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7820,7 +7820,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7844,7 +7844,7 @@ ********** UL-TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 -Slot Allocation (Algorithm A) for class 0 +Slot Allocation (Algorithm A) for class 0 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7874,7 +7874,7 @@ Creating MS object, TLLI = 0x00000000 Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 -Slot Allocation (Algorithm A) for class 11 +Slot Allocation (Algorithm A) for class 11 [UL] - Skipping TS 0, because not enabled - Skipping TS 1, because not enabled - Skipping TS 2, because not enabled @@ -7883,7 +7883,7 @@ - Skipping TS 5, because not enabled - Skipping TS 6, because not enabled - Skipping TS 7, because no USF available -- Failed to allocate a TS, no USF available +algo A [multi] (suggested TRX: 0): failed to allocate a TS, no USF available for UL No PDCH resource Creating MS object, TLLI = 0x00000000 Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed -- To view, visit https://gerrit.osmocom.org/3895 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b78951a79ddbc0745b39d091080a4e0e247d3c5 Gerrit-PatchSet: 24 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: replace debug printer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/3929 to look at the new patch set (#12). Simplify TS alloc: replace debug printer Replace unreadable recursive debug printer with simpler functions. Note: the new printer also correctly handle reserved TS so Control slot overrides TS for the bits set for both Uplink and Downlink slots. This does not change the allocation semantics of course but requires cosmetic adjustement to TBF tests output. Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 3 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/3929/12 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 06e8200..3579f55 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -36,20 +36,6 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -static char *set_flag_chars(char *buf, uint8_t val, char set_char, char unset_char = 0) -{ - int i; - - for (i = 0; i < 8; i += 1, val = val >> 1) { - if (val & 1) - buf[i] = set_char; - else if (unset_char) - buf[i] = unset_char; - } - - return buf; -} - static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { uint32_t tfi_map = pdch->assigned_tfi(dir); @@ -554,11 +540,9 @@ *dl_slots &= pdch_slots; *ul_slots &= pdch_slots; - LOGP(DRLCMAC, LOGL_DEBUG, "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", - set_flag_chars(set_flag_chars(set_flag_chars(slot_info, - *dl_slots, 'D', '.'), - *ul_slots, 'U'), - *ul_slots & *dl_slots, 'C')); + ts_format(slot_info, *dl_slots, *ul_slots); + LOGP(DRLCMAC, LOGL_DEBUG, + "- Possible DL/UL slots: (TS=0)\"%s\"(TS=7)\n", slot_info); /* Check for each UL (TX) slot */ -- To view, visit https://gerrit.osmocom.org/3929 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia13855877b2145cb57b1646f5562b2af3b87bcfb Gerrit-PatchSet: 12 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: split USF/UL allocation 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/3930 to look at the new patch set (#11). Simplify TS alloc: split USF/UL allocation * move USF allocation into separate function * document USF allocation This allows to clearly see where selected UL TS is forced into single TS in algorithm B allocator. Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp 1 file changed, 42 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/30/3930/11 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 80693b5..a891c40 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -787,6 +787,44 @@ return sl; } +/*! Allocate USF according to a given UL TS mapping + * + * N. B: this is legacy implementation which ignores given selected_ul_slots + * \param[in] trx Pointer to TRX object + * \param[in] tbf Pointer to TBF object + * \param[in] first_common_ts First TS which is common to both UL and DL + * \param[in] selected_ul_slots set of UL timeslots selected for allocation + * \param[in] dl_slots set of DL timeslots + * \param[out] usf array for allocated USF + * \returns updated UL TS or negative on error + */ +static int allocate_usf(const gprs_rlcmac_trx *trx, int8_t first_common_ts, uint8_t selected_ul_slots, uint8_t dl_slots, + int *usf) +{ + int free_usf = -1, ts; + uint8_t ul_slots = selected_ul_slots; + + if (first_common_ts >= 0) + ul_slots = 1 << first_common_ts; + else + ul_slots = ul_slots & dl_slots; + + ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); + + if (free_usf < 0 || ts < 0) { + LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); + return -EBUSY; + } + + OSMO_ASSERT(ts >= 0 && ts <= 8); + + /* We will stick to that single UL slot, unreserve the others */ + ul_slots = 1 << ts; + usf[ts] = free_usf; + + return ul_slots; +} + /*! Slot Allocation: Algorithm B * * Assign as many downlink slots as possible. @@ -864,27 +902,12 @@ dl_slots = rc; update_slot_counters(dl_slots, reserved_dl_slots, &slotcount, &avail_count); } else { - int free_usf = -1; - - ul_slots = rc; - - if (first_common_ts >= 0) - ul_slots = 1 << first_common_ts; - else - ul_slots = ul_slots & dl_slots; - - ts = find_least_busy_pdch(trx, GPRS_RLCMAC_UL_TBF, ul_slots, compute_usage_by_num_tbfs, NULL, &free_usf); - - if (free_usf < 0) { - LOGP(DRLCMAC, LOGL_NOTICE, "No USF available\n"); - return -EBUSY; - } - - OSMO_ASSERT(ts >= 0 && ts <= 8); + rc = allocate_usf(trx, first_common_ts, rc, dl_slots, usf); + if (rc < 0) + return rc; /* We will stick to that single UL slot, unreserve the others */ - ul_slots = 1 << ts; - usf[ts] = free_usf; + ul_slots = rc; reserved_ul_slots = ul_slots; update_slot_counters(ul_slots, reserved_ul_slots, &slotcount, &avail_count); -- To view, visit https://gerrit.osmocom.org/3930 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I563dc10827ce68295553f88f3bf2e1fc0ba595c1 Gerrit-PatchSet: 11 Gerrit-Project: osmo-pcu 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 Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: separate capacity computation 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/3934 to look at the new patch set (#10). Simplify TS alloc: separate capacity computation Move TRX capacity computation into separate function and document it. Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h 3 files changed, 52 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/34/3934/10 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 07b7c21..622342c 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -58,24 +58,6 @@ return was_set; } -static inline int8_t find_free_usf(const struct gprs_rlcmac_pdch *pdch) -{ - uint8_t usf_map = 0; - uint8_t usf; - - usf_map = pdch->assigned_usf(); - if (usf_map == (1 << 7) - 1) - return -1; - - /* look for USF, don't use USF=7 */ - for (usf = 0; usf < 7; usf++) { - if (!(usf_map & (1 << usf))) - return usf; - } - - return -1; -} - static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { uint32_t tfi_map = pdch->assigned_tfi(dir); @@ -211,7 +193,7 @@ } /* Make sure that an USF is available */ if (dir == GPRS_RLCMAC_UL_TBF) { - usf = find_free_usf(pdch); + usf = find_free_usf(pdch->assigned_usf()); if (usf < 0) { LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because " @@ -461,6 +443,33 @@ return 0; } +/*! Compute capacity of a given TRX + * + * \param[in] trx Pointer to TRX object + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \returns non-negative capacity + */ +static inline unsigned compute_capacity(const struct gprs_rlcmac_trx *trx, int rx_window, int tx_window) +{ + const struct gprs_rlcmac_pdch *pdch; + unsigned ts, capacity = 0; + + for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { + pdch = &trx->pdch[ts]; + if (rx_window & (1 << ts)) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF), 1); + + /* Only consider common slots for UL */ + if (tx_window & rx_window & (1 << ts)) { + if (find_free_usf(pdch->assigned_usf()) >= 0) + capacity += OSMO_MAX(32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF), 1); + } + } + + return capacity; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -475,9 +484,8 @@ Sum = mslot_class_get_sum(mslot_class); /* Max number of Tx + Rx slots */ int rx_window, tx_window, pdch_slots; char slot_info[9] = {0}; - int max_capacity; - uint8_t max_ul_slots; - uint8_t max_dl_slots; + int max_capacity = -1; + uint8_t max_ul_slots = 0, max_dl_slots = 0; unsigned max_slots; unsigned ul_ts, dl_ts; @@ -562,7 +570,6 @@ unsigned rx_slot_count; uint16_t rx_bad; uint8_t rx_good; - unsigned ts; int capacity; /* Filter out bad slots */ @@ -661,25 +668,7 @@ } /* Compute capacity */ - capacity = 0; - - for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { - int c; - const struct gprs_rlcmac_pdch *pdch = &trx->pdch[ts]; - if (rx_window & (1 << ts)) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_DL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - /* Only consider common slots for UL */ - if (tx_window & rx_window & (1 << ts)) { - if (find_free_usf(pdch) >= 0) { - c = 32 - pdch->num_reserved(GPRS_RLCMAC_UL_TBF); - c = OSMO_MAX(c, 1); - capacity += c; - } - } - } + capacity = compute_capacity(trx, rx_window, tx_window); #ifdef ENABLE_TS_ALLOC_DEBUG LOGP(DRLCMAC, LOGL_DEBUG, @@ -700,7 +689,10 @@ max_capacity = capacity; max_ul_slots = tx_window; max_dl_slots = rx_window; - }}}} + } + } + } + } if (!max_ul_slots || !max_dl_slots) { LOGP(DRLCMAC, LOGL_NOTICE, diff --git a/src/mslot_class.c b/src/mslot_class.c index 1c79a21..87e37ca 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -212,3 +212,19 @@ rx_mask[MASK_TT] = (rx_mask[MASK_TT] << 3) | (rx_mask[MASK_TT] >> 5); rx_mask[MASK_TR] = (rx_mask[MASK_TR] << 3) | (rx_mask[MASK_TR] >> 5); } + +/* look for USF, don't use USF=7 */ +int8_t find_free_usf(uint8_t usf_map) +{ + uint8_t usf; + + if (usf_map == (1 << 7) - 1) + return -1; + + for (usf = 0; usf < 7; usf++) { + if (!(usf_map & (1 << usf))) + return usf; + } + + return -1; +} diff --git a/src/mslot_class.h b/src/mslot_class.h index 4f5a7ff..d248526 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -50,3 +50,4 @@ uint8_t mslot_class_max(); void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); +int8_t find_free_usf(uint8_t usf_map); -- To view, visit https://gerrit.osmocom.org/3934 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifd88fc7ff818ea2a041eae61c5d457926a0df0f2 Gerrit-PatchSet: 10 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 Wed Jan 31 16:38:42 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:38:42 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: move slot check into functions 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/3935 to look at the new patch set (#10). Simplify TS alloc: move slot check into functions Move timeslot applicability check outside of nested for loop into separate functions and document them. Add corresponding tests. This allows us to clarify types used in TS-related computations. Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Related: OS#2282 --- M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h M tests/alloc/MslotTest.cpp M tests/alloc/MslotTest.ok 5 files changed, 626 insertions(+), 123 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/35/3935/10 diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 77c76f9..c19f891 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -50,14 +50,6 @@ return buf; } -static bool test_and_set_bit(uint32_t *bits, size_t elem) -{ - bool was_set = bits[elem/32] & (1 << (elem % 32)); - bits[elem/32] |= (1 << (elem % 32)); - - return was_set; -} - static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) { uint32_t tfi_map = pdch->assigned_tfi(dir); @@ -75,11 +67,11 @@ return -1; } -static int find_possible_pdchs(const struct gprs_rlcmac_trx *trx, size_t max_slots, uint8_t mask, - const char *mask_reason = NULL) +static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, + const char *mask_reason = NULL) { unsigned ts; - int valid_ts_set = 0; + uint8_t valid_ts_set = 0; int8_t last_tsc = -1; /* must be signed */ for (ts = 0; ts < ARRAY_SIZE(trx->pdch); ts++) { @@ -366,7 +358,7 @@ int trx_no; int tfi = -1; int usf = -1; - int mask = 0xff; + uint8_t mask = 0xff; const char *mask_reason = NULL; const GprsMs *ms = ms_; const gprs_rlcmac_tbf *tbf = tbf_; @@ -473,6 +465,58 @@ return capacity; } +/*! Decide if a given slot should be skipped by multislot allocator + * + * \param[in] ms_class Pointer to MS Class object + * \param[in] check_tr Flag indicating whether we should check for Tra or Tta parameters for a given MS class + * \param[in] rx_window Receive window + * \param[in] tx_window Transmit window + * \param[in,out] checked_rx array with already checked RX timeslots + * \returns true if the slot should be skipped, false otherwise + */ +static bool skip_slot(uint8_t mslot_class, bool check_tr, + int16_t rx_window, int16_t tx_window, + uint32_t *checked_rx) +{ + uint8_t common_slot_count, req_common_slots, + rx_slot_count = pcu_bitcount(rx_window), + tx_slot_count = pcu_bitcount(tx_window); + + /* Check compliance with TS 45.002, table 6.4.2.2.1 */ + /* Whether to skip this round doesn not only depend on the bit + * sets but also on check_tr. Therefore this check must be done + * before doing the mslot_test_and_set_bit shortcut. */ + if (mslot_class_get_type(mslot_class) == 1) { + uint16_t slot_sum = rx_slot_count + tx_slot_count; + /* Assume down + up / dynamic. + * TODO: For ext-dynamic, down only, up only add more cases. + */ + if (slot_sum <= 6 && tx_slot_count < 3) { + if (!check_tr) + return true; /* Skip Tta */ + } else if (slot_sum > 6 && tx_slot_count < 3) { + if (check_tr) + return true; /* Skip Tra */ + } else + return true; /* No supported row in TS 45.002, table 6.4.2.2.1. */ + } + + /* Avoid repeated RX combination check */ + if (mslot_test_and_set_bit(checked_rx, rx_window)) + return true; + + /* Check number of common slots according to TS 45.002, ?6.4.2.2 */ + common_slot_count = pcu_bitcount(tx_window & rx_window); + req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); + if (mslot_class_get_type(mslot_class) == 1) + req_common_slots = OSMO_MIN(req_common_slots, 2); + + if (req_common_slots != common_slot_count) + return true; + + return false; +} + /*! Find set of slots available for allocation while taking MS class into account * * \param[in] trx Pointer to TRX object @@ -484,16 +528,12 @@ int find_multi_slots(struct gprs_rlcmac_trx *trx, uint8_t mslot_class, uint8_t *ul_slots, uint8_t *dl_slots) { uint8_t Tx = mslot_class_get_tx(mslot_class), /* Max number of Tx slots */ - Sum = mslot_class_get_sum(mslot_class); /* Max number of Tx + Rx slots */ - int rx_window, tx_window, pdch_slots; + Sum = mslot_class_get_sum(mslot_class), /* Max number of Tx + Rx slots */ + max_slots, num_tx, mask_sel, pdch_slots, ul_ts, dl_ts; + int16_t rx_window, tx_window; char slot_info[9] = {0}; int max_capacity = -1; uint8_t max_ul_slots = 0, max_dl_slots = 0; - unsigned max_slots; - - unsigned ul_ts, dl_ts; - unsigned num_tx; - unsigned mask_sel; if (mslot_class) LOGP(DRLCMAC, LOGL_DEBUG, "Slot Allocation (Algorithm B) for class %d\n", @@ -535,13 +575,11 @@ /* Rotate group of TX slots: UUU-----, -UUU----, ..., UU-----U */ for (ul_ts = 0; ul_ts < 8; ul_ts += 1, tx_valid_win <<= 1) { - unsigned tx_slot_count; - int max_rx; uint16_t rx_valid_win; uint32_t checked_rx[256/32] = {0}; /* Wrap valid window */ - tx_valid_win = (tx_valid_win | tx_valid_win >> 8) & 0xff; + tx_valid_win = mslot_wrap_window(tx_valid_win); tx_window = tx_valid_win; @@ -556,10 +594,7 @@ if ((tx_window & (1 << ((ul_ts+num_tx-1) % 8))) == 0) continue; - tx_slot_count = pcu_bitcount(tx_window); - - max_rx = OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx); - rx_valid_win = (1 << max_rx) - 1; + rx_valid_win = (1 << OSMO_MIN(mslot_class_get_rx(mslot_class), Sum - num_tx)) - 1; /* Rotate group of RX slots: DDD-----, -DDD----, ..., DD-----D */ for (dl_ts = 0; dl_ts < 8; dl_ts += 1, rx_valid_win <<= 1) { @@ -568,107 +603,14 @@ /* Validate with both Tta/Ttb/Trb and Ttb/Tra/Trb */ for (mask_sel = MASK_TT; mask_sel <= MASK_TR; mask_sel += 1) { - unsigned common_slot_count; - unsigned req_common_slots; - unsigned rx_slot_count; - uint16_t rx_bad; - uint8_t rx_good; int capacity; - /* Filter out bad slots */ - rx_bad = (uint16_t)(0xff & ~rx_mask[mask_sel]) << ul_ts; - rx_bad = (rx_bad | (rx_bad >> 8)) & 0xff; - rx_good = *dl_slots & ~rx_bad; - - /* TODO: CHECK this calculation -> separate function for unit - * testing */ - - rx_window = rx_good & rx_valid_win; - rx_slot_count = pcu_bitcount(rx_window); - -#if 0 - LOGP(DRLCMAC, LOGL_DEBUG, "n_tx=%d, n_rx=%d, mask_sel=%d, " - "tx=%02x, rx=%02x, mask=%02x, bad=%02x, good=%02x, " - "ul=%02x, dl=%02x\n", - tx_slot_count, rx_slot_count, mask_sel, - tx_window, rx_window, rx_mask[mask_sel], rx_bad, rx_good, - *ul_slots, *dl_slots); -#endif - - /* Check compliance with TS 45.002, table 6.4.2.2.1 */ - /* Whether to skip this round doesn not only depend on the bit - * sets but also on mask_sel. Therefore this check must be done - * before doing the test_and_set_bit shortcut. */ - if (mslot_class_get_type(mslot_class) == 1) { - unsigned slot_sum = rx_slot_count + tx_slot_count; - /* Assume down+up/dynamic. - * TODO: For ext-dynamic, down only, up only add more - * cases. - */ - if (slot_sum <= 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TR) - /* Skip Tta */ - continue; - } else if (slot_sum > 6 && tx_slot_count < 3) { - if (mask_sel != MASK_TT) - /* Skip Tra */ - continue; - } else { - /* No supported row in table 6.4.2.2.1. */ -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "combination not supported\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U')); -#endif - continue; - } - } - - /* Avoid repeated RX combination check */ - if (test_and_set_bit(checked_rx, rx_window)) + rx_window = mslot_filter_bad(rx_mask[mask_sel], ul_ts, *dl_slots, rx_valid_win); + if (rx_window < 0) continue; - if (!rx_good) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "no DL slots available\n", - set_flag_chars(set_flag_chars(slot_info, - rx_bad, 'x', '.'), - tx_window, 'U')); -#endif - continue; - } - - if (!rx_window) - continue; - - /* Check number of common slots according to TS 54.002, 6.4.2.2 */ - common_slot_count = pcu_bitcount(tx_window & rx_window); - req_common_slots = OSMO_MIN(tx_slot_count, rx_slot_count); - if (mslot_class_get_type(mslot_class) == 1) - req_common_slots = OSMO_MIN(req_common_slots, 2); - - if (req_common_slots != common_slot_count) { -#ifdef ENABLE_TS_ALLOC_DEBUG - LOGP(DRLCMAC, LOGL_DEBUG, - "- Skipping DL/UL slots: (TS=0)\"%s\"(TS=7), " - "invalid number of common TS: %d (expected %d)\n", - set_flag_chars(set_flag_chars(set_flag_chars( - slot_info, - rx_bad, 'x', '.'), - rx_window, 'D'), - tx_window, 'U'), - common_slot_count, - req_common_slots); -#endif - continue; - } + if (skip_slot(mslot_class, mask_sel != MASK_TT, rx_window, tx_window, checked_rx)) + continue; /* Compute capacity */ capacity = compute_capacity(trx, rx_window, tx_window); diff --git a/src/mslot_class.c b/src/mslot_class.c index dad94ae..8a0dd93 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -244,3 +244,38 @@ masked_override_with(buf, ul_mask, 'U'); masked_override_with(buf, ul_mask & dl_mask, 'C'); } + +uint16_t mslot_wrap_window(uint16_t win) +{ + return (win | win >> 8) & 0xFF; +} + +bool mslot_test_and_set_bit(uint32_t *bits, size_t elem) +{ + bool was_set = bits[elem/32] & (1 << (elem % 32)); + bits[elem/32] |= (1 << (elem % 32)); + + return was_set; +} + +/*! Filter out bad slots + * + * \param[in] mask TS selection mask + * \param[in] ul_slots set of UL timeslots + * \param[in] dl_slots set of DL timeslots + * \param[in] rx_valid_win Mask for valid RX window value + * \returns negative error code or RX window on success + */ +int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win) +{ + uint8_t rx_good; + uint16_t rx_bad = (uint16_t)(0xFF & ~mask) << ul_slots; + + /* TODO: CHECK this calculation -> separate function for unit testing */ + rx_bad = (rx_bad | (rx_bad >> 8)) & 0xFF; + rx_good = dl_slots & ~rx_bad; + if (!rx_good) + return -1; + + return rx_good & rx_valid_win; +} diff --git a/src/mslot_class.h b/src/mslot_class.h index d8b024b..80b2ef6 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -54,3 +54,6 @@ int8_t find_free_usf(uint8_t usf_map); void masked_override_with(char *buf, uint8_t mask, char set_char); void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask); +uint16_t mslot_wrap_window(uint16_t win); +bool mslot_test_and_set_bit(uint32_t *bits, size_t elem); +int16_t mslot_filter_bad(uint8_t mask, uint8_t ul_slots, uint8_t dl_slots, uint16_t rx_valid_win); diff --git a/tests/alloc/MslotTest.cpp b/tests/alloc/MslotTest.cpp index 1fa28bf..92f92fa 100644 --- a/tests/alloc/MslotTest.cpp +++ b/tests/alloc/MslotTest.cpp @@ -27,6 +27,7 @@ #include extern "C" { + #include "mslot_class.h" #include #include #include @@ -137,6 +138,13 @@ test_all_classes(trx, seq); } +static inline void test_window_wrapper() +{ + uint16_t i; + for (i = 0; i < 256 * 2 + 1; i++) + printf("W[%03u] -> %3u %s\n", + i, mslot_wrap_window(i), mslot_wrap_window(i) < 256 ? "OK" : "FAIL"); +} int main(int argc, char **argv) { @@ -163,6 +171,8 @@ test_multislot_ends(true); test_multislot_ends(false); + test_window_wrapper(); + return EXIT_SUCCESS; } diff --git a/tests/alloc/MslotTest.ok b/tests/alloc/MslotTest.ok index 86526bf..a47cf57 100644 --- a/tests/alloc/MslotTest.ok +++ b/tests/alloc/MslotTest.ok @@ -1730,3 +1730,516 @@ [ACC] multislot class 44 - UL: .......1 DL: .......1 [0] [ACC] multislot class 45 - UL: .......1 DL: .......1 [0] [ACC] multislot class 46 - UL: .......1 DL: .......1 [-22] +W[000] -> 0 OK +W[001] -> 1 OK +W[002] -> 2 OK +W[003] -> 3 OK +W[004] -> 4 OK +W[005] -> 5 OK +W[006] -> 6 OK +W[007] -> 7 OK +W[008] -> 8 OK +W[009] -> 9 OK +W[010] -> 10 OK +W[011] -> 11 OK +W[012] -> 12 OK +W[013] -> 13 OK +W[014] -> 14 OK +W[015] -> 15 OK +W[016] -> 16 OK +W[017] -> 17 OK +W[018] -> 18 OK +W[019] -> 19 OK +W[020] -> 20 OK +W[021] -> 21 OK +W[022] -> 22 OK +W[023] -> 23 OK +W[024] -> 24 OK +W[025] -> 25 OK +W[026] -> 26 OK +W[027] -> 27 OK +W[028] -> 28 OK +W[029] -> 29 OK +W[030] -> 30 OK +W[031] -> 31 OK +W[032] -> 32 OK +W[033] -> 33 OK +W[034] -> 34 OK +W[035] -> 35 OK +W[036] -> 36 OK +W[037] -> 37 OK +W[038] -> 38 OK +W[039] -> 39 OK +W[040] -> 40 OK +W[041] -> 41 OK +W[042] -> 42 OK +W[043] -> 43 OK +W[044] -> 44 OK +W[045] -> 45 OK +W[046] -> 46 OK +W[047] -> 47 OK +W[048] -> 48 OK +W[049] -> 49 OK +W[050] -> 50 OK +W[051] -> 51 OK +W[052] -> 52 OK +W[053] -> 53 OK +W[054] -> 54 OK +W[055] -> 55 OK +W[056] -> 56 OK +W[057] -> 57 OK +W[058] -> 58 OK +W[059] -> 59 OK +W[060] -> 60 OK +W[061] -> 61 OK +W[062] -> 62 OK +W[063] -> 63 OK +W[064] -> 64 OK +W[065] -> 65 OK +W[066] -> 66 OK +W[067] -> 67 OK +W[068] -> 68 OK +W[069] -> 69 OK +W[070] -> 70 OK +W[071] -> 71 OK +W[072] -> 72 OK +W[073] -> 73 OK +W[074] -> 74 OK +W[075] -> 75 OK +W[076] -> 76 OK +W[077] -> 77 OK +W[078] -> 78 OK +W[079] -> 79 OK +W[080] -> 80 OK +W[081] -> 81 OK +W[082] -> 82 OK +W[083] -> 83 OK +W[084] -> 84 OK +W[085] -> 85 OK +W[086] -> 86 OK +W[087] -> 87 OK +W[088] -> 88 OK +W[089] -> 89 OK +W[090] -> 90 OK +W[091] -> 91 OK +W[092] -> 92 OK +W[093] -> 93 OK +W[094] -> 94 OK +W[095] -> 95 OK +W[096] -> 96 OK +W[097] -> 97 OK +W[098] -> 98 OK +W[099] -> 99 OK +W[100] -> 100 OK +W[101] -> 101 OK +W[102] -> 102 OK +W[103] -> 103 OK +W[104] -> 104 OK +W[105] -> 105 OK +W[106] -> 106 OK +W[107] -> 107 OK +W[108] -> 108 OK +W[109] -> 109 OK +W[110] -> 110 OK +W[111] -> 111 OK +W[112] -> 112 OK +W[113] -> 113 OK +W[114] -> 114 OK +W[115] -> 115 OK +W[116] -> 116 OK +W[117] -> 117 OK +W[118] -> 118 OK +W[119] -> 119 OK +W[120] -> 120 OK +W[121] -> 121 OK +W[122] -> 122 OK +W[123] -> 123 OK +W[124] -> 124 OK +W[125] -> 125 OK +W[126] -> 126 OK +W[127] -> 127 OK +W[128] -> 128 OK +W[129] -> 129 OK +W[130] -> 130 OK +W[131] -> 131 OK +W[132] -> 132 OK +W[133] -> 133 OK +W[134] -> 134 OK +W[135] -> 135 OK +W[136] -> 136 OK +W[137] -> 137 OK +W[138] -> 138 OK +W[139] -> 139 OK +W[140] -> 140 OK +W[141] -> 141 OK +W[142] -> 142 OK +W[143] -> 143 OK +W[144] -> 144 OK +W[145] -> 145 OK +W[146] -> 146 OK +W[147] -> 147 OK +W[148] -> 148 OK +W[149] -> 149 OK +W[150] -> 150 OK +W[151] -> 151 OK +W[152] -> 152 OK +W[153] -> 153 OK +W[154] -> 154 OK +W[155] -> 155 OK +W[156] -> 156 OK +W[157] -> 157 OK +W[158] -> 158 OK +W[159] -> 159 OK +W[160] -> 160 OK +W[161] -> 161 OK +W[162] -> 162 OK +W[163] -> 163 OK +W[164] -> 164 OK +W[165] -> 165 OK +W[166] -> 166 OK +W[167] -> 167 OK +W[168] -> 168 OK +W[169] -> 169 OK +W[170] -> 170 OK +W[171] -> 171 OK +W[172] -> 172 OK +W[173] -> 173 OK +W[174] -> 174 OK +W[175] -> 175 OK +W[176] -> 176 OK +W[177] -> 177 OK +W[178] -> 178 OK +W[179] -> 179 OK +W[180] -> 180 OK +W[181] -> 181 OK +W[182] -> 182 OK +W[183] -> 183 OK +W[184] -> 184 OK +W[185] -> 185 OK +W[186] -> 186 OK +W[187] -> 187 OK +W[188] -> 188 OK +W[189] -> 189 OK +W[190] -> 190 OK +W[191] -> 191 OK +W[192] -> 192 OK +W[193] -> 193 OK +W[194] -> 194 OK +W[195] -> 195 OK +W[196] -> 196 OK +W[197] -> 197 OK +W[198] -> 198 OK +W[199] -> 199 OK +W[200] -> 200 OK +W[201] -> 201 OK +W[202] -> 202 OK +W[203] -> 203 OK +W[204] -> 204 OK +W[205] -> 205 OK +W[206] -> 206 OK +W[207] -> 207 OK +W[208] -> 208 OK +W[209] -> 209 OK +W[210] -> 210 OK +W[211] -> 211 OK +W[212] -> 212 OK +W[213] -> 213 OK +W[214] -> 214 OK +W[215] -> 215 OK +W[216] -> 216 OK +W[217] -> 217 OK +W[218] -> 218 OK +W[219] -> 219 OK +W[220] -> 220 OK +W[221] -> 221 OK +W[222] -> 222 OK +W[223] -> 223 OK +W[224] -> 224 OK +W[225] -> 225 OK +W[226] -> 226 OK +W[227] -> 227 OK +W[228] -> 228 OK +W[229] -> 229 OK +W[230] -> 230 OK +W[231] -> 231 OK +W[232] -> 232 OK +W[233] -> 233 OK +W[234] -> 234 OK +W[235] -> 235 OK +W[236] -> 236 OK +W[237] -> 237 OK +W[238] -> 238 OK +W[239] -> 239 OK +W[240] -> 240 OK +W[241] -> 241 OK +W[242] -> 242 OK +W[243] -> 243 OK +W[244] -> 244 OK +W[245] -> 245 OK +W[246] -> 246 OK +W[247] -> 247 OK +W[248] -> 248 OK +W[249] -> 249 OK +W[250] -> 250 OK +W[251] -> 251 OK +W[252] -> 252 OK +W[253] -> 253 OK +W[254] -> 254 OK +W[255] -> 255 OK +W[256] -> 1 OK +W[257] -> 1 OK +W[258] -> 3 OK +W[259] -> 3 OK +W[260] -> 5 OK +W[261] -> 5 OK +W[262] -> 7 OK +W[263] -> 7 OK +W[264] -> 9 OK +W[265] -> 9 OK +W[266] -> 11 OK +W[267] -> 11 OK +W[268] -> 13 OK +W[269] -> 13 OK +W[270] -> 15 OK +W[271] -> 15 OK +W[272] -> 17 OK +W[273] -> 17 OK +W[274] -> 19 OK +W[275] -> 19 OK +W[276] -> 21 OK +W[277] -> 21 OK +W[278] -> 23 OK +W[279] -> 23 OK +W[280] -> 25 OK +W[281] -> 25 OK +W[282] -> 27 OK +W[283] -> 27 OK +W[284] -> 29 OK +W[285] -> 29 OK +W[286] -> 31 OK +W[287] -> 31 OK +W[288] -> 33 OK +W[289] -> 33 OK +W[290] -> 35 OK +W[291] -> 35 OK +W[292] -> 37 OK +W[293] -> 37 OK +W[294] -> 39 OK +W[295] -> 39 OK +W[296] -> 41 OK +W[297] -> 41 OK +W[298] -> 43 OK +W[299] -> 43 OK +W[300] -> 45 OK +W[301] -> 45 OK +W[302] -> 47 OK +W[303] -> 47 OK +W[304] -> 49 OK +W[305] -> 49 OK +W[306] -> 51 OK +W[307] -> 51 OK +W[308] -> 53 OK +W[309] -> 53 OK +W[310] -> 55 OK +W[311] -> 55 OK +W[312] -> 57 OK +W[313] -> 57 OK +W[314] -> 59 OK +W[315] -> 59 OK +W[316] -> 61 OK +W[317] -> 61 OK +W[318] -> 63 OK +W[319] -> 63 OK +W[320] -> 65 OK +W[321] -> 65 OK +W[322] -> 67 OK +W[323] -> 67 OK +W[324] -> 69 OK +W[325] -> 69 OK +W[326] -> 71 OK +W[327] -> 71 OK +W[328] -> 73 OK +W[329] -> 73 OK +W[330] -> 75 OK +W[331] -> 75 OK +W[332] -> 77 OK +W[333] -> 77 OK +W[334] -> 79 OK +W[335] -> 79 OK +W[336] -> 81 OK +W[337] -> 81 OK +W[338] -> 83 OK +W[339] -> 83 OK +W[340] -> 85 OK +W[341] -> 85 OK +W[342] -> 87 OK +W[343] -> 87 OK +W[344] -> 89 OK +W[345] -> 89 OK +W[346] -> 91 OK +W[347] -> 91 OK +W[348] -> 93 OK +W[349] -> 93 OK +W[350] -> 95 OK +W[351] -> 95 OK +W[352] -> 97 OK +W[353] -> 97 OK +W[354] -> 99 OK +W[355] -> 99 OK +W[356] -> 101 OK +W[357] -> 101 OK +W[358] -> 103 OK +W[359] -> 103 OK +W[360] -> 105 OK +W[361] -> 105 OK +W[362] -> 107 OK +W[363] -> 107 OK +W[364] -> 109 OK +W[365] -> 109 OK +W[366] -> 111 OK +W[367] -> 111 OK +W[368] -> 113 OK +W[369] -> 113 OK +W[370] -> 115 OK +W[371] -> 115 OK +W[372] -> 117 OK +W[373] -> 117 OK +W[374] -> 119 OK +W[375] -> 119 OK +W[376] -> 121 OK +W[377] -> 121 OK +W[378] -> 123 OK +W[379] -> 123 OK +W[380] -> 125 OK +W[381] -> 125 OK +W[382] -> 127 OK +W[383] -> 127 OK +W[384] -> 129 OK +W[385] -> 129 OK +W[386] -> 131 OK +W[387] -> 131 OK +W[388] -> 133 OK +W[389] -> 133 OK +W[390] -> 135 OK +W[391] -> 135 OK +W[392] -> 137 OK +W[393] -> 137 OK +W[394] -> 139 OK +W[395] -> 139 OK +W[396] -> 141 OK +W[397] -> 141 OK +W[398] -> 143 OK +W[399] -> 143 OK +W[400] -> 145 OK +W[401] -> 145 OK +W[402] -> 147 OK +W[403] -> 147 OK +W[404] -> 149 OK +W[405] -> 149 OK +W[406] -> 151 OK +W[407] -> 151 OK +W[408] -> 153 OK +W[409] -> 153 OK +W[410] -> 155 OK +W[411] -> 155 OK +W[412] -> 157 OK +W[413] -> 157 OK +W[414] -> 159 OK +W[415] -> 159 OK +W[416] -> 161 OK +W[417] -> 161 OK +W[418] -> 163 OK +W[419] -> 163 OK +W[420] -> 165 OK +W[421] -> 165 OK +W[422] -> 167 OK +W[423] -> 167 OK +W[424] -> 169 OK +W[425] -> 169 OK +W[426] -> 171 OK +W[427] -> 171 OK +W[428] -> 173 OK +W[429] -> 173 OK +W[430] -> 175 OK +W[431] -> 175 OK +W[432] -> 177 OK +W[433] -> 177 OK +W[434] -> 179 OK +W[435] -> 179 OK +W[436] -> 181 OK +W[437] -> 181 OK +W[438] -> 183 OK +W[439] -> 183 OK +W[440] -> 185 OK +W[441] -> 185 OK +W[442] -> 187 OK +W[443] -> 187 OK +W[444] -> 189 OK +W[445] -> 189 OK +W[446] -> 191 OK +W[447] -> 191 OK +W[448] -> 193 OK +W[449] -> 193 OK +W[450] -> 195 OK +W[451] -> 195 OK +W[452] -> 197 OK +W[453] -> 197 OK +W[454] -> 199 OK +W[455] -> 199 OK +W[456] -> 201 OK +W[457] -> 201 OK +W[458] -> 203 OK +W[459] -> 203 OK +W[460] -> 205 OK +W[461] -> 205 OK +W[462] -> 207 OK +W[463] -> 207 OK +W[464] -> 209 OK +W[465] -> 209 OK +W[466] -> 211 OK +W[467] -> 211 OK +W[468] -> 213 OK +W[469] -> 213 OK +W[470] -> 215 OK +W[471] -> 215 OK +W[472] -> 217 OK +W[473] -> 217 OK +W[474] -> 219 OK +W[475] -> 219 OK +W[476] -> 221 OK +W[477] -> 221 OK +W[478] -> 223 OK +W[479] -> 223 OK +W[480] -> 225 OK +W[481] -> 225 OK +W[482] -> 227 OK +W[483] -> 227 OK +W[484] -> 229 OK +W[485] -> 229 OK +W[486] -> 231 OK +W[487] -> 231 OK +W[488] -> 233 OK +W[489] -> 233 OK +W[490] -> 235 OK +W[491] -> 235 OK +W[492] -> 237 OK +W[493] -> 237 OK +W[494] -> 239 OK +W[495] -> 239 OK +W[496] -> 241 OK +W[497] -> 241 OK +W[498] -> 243 OK +W[499] -> 243 OK +W[500] -> 245 OK +W[501] -> 245 OK +W[502] -> 247 OK +W[503] -> 247 OK +W[504] -> 249 OK +W[505] -> 249 OK +W[506] -> 251 OK +W[507] -> 251 OK +W[508] -> 253 OK +W[509] -> 253 OK +W[510] -> 255 OK +W[511] -> 255 OK +W[512] -> 2 OK -- To view, visit https://gerrit.osmocom.org/3935 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic39e848da47dc11357782362fdf6206d2c1457c2 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:30 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:30 +0000 Subject: [PATCH] osmo-mgw[master]: mgcp: fix use-after-free and add callback for endpoint cleanup In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6006 to look at the new patch set (#2). mgcp: fix use-after-free and add callback for endpoint cleanup Since we will support multiple different types of endpoints in the future, all these endpoints will handle connections slightly different and there will be possibly state that needs to be kept consistant when a connection is deleted. In mgcp_network.c where we implement the callback that is used to create an rtp-bride-endpoint. In that callback we cache the pointer of the connection we where we want to bride to (opposite connection). When one of the connections is deleted using a DLCX operation, the pointer is still there and the next incoming packet causes a use- after-free segfault. - introduce an endpoint specific callback function that is executed before removing the connection. - implement the endpoint specific callback for rtp bridge endpoints, so that the use-after-free is prevented. Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f --- M include/osmocom/mgcp/mgcp_ep.h M include/osmocom/mgcp/mgcp_internal.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_ep.c M src/libosmo-mgcp/mgcp_network.c 5 files changed, 39 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/06/6006/2 diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h index 3b5facb..7b4ccee 100644 --- a/include/osmocom/mgcp/mgcp_ep.h +++ b/include/osmocom/mgcp/mgcp_ep.h @@ -25,12 +25,20 @@ struct sockaddr_in; struct mgcp_conn; +struct mgcp_endpoint; /* Callback type for RTP dispatcher functions (e.g mgcp_dispatch_rtp_bridge_cb, see below) */ typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in *addr, char *buf, unsigned int buf_size, struct mgcp_conn *conn); + +/* Callback type for endpoint specific cleanup actions. This function + * is automatically executed when a connection is freed (see mgcp_conn_free() + * in mgcp_conn.c). Depending on the type of the endpoint there may be endpoint + * specific things to take care of once a connection has been removed. */ +typedef void (*mgcp_cleanup_cp) (struct mgcp_endpoint *endp, + struct mgcp_conn *conn); /*! MGCP endpoint properties */ struct mgcp_endpoint_type { @@ -39,6 +47,9 @@ /*!< callback that defines how to dispatch incoming RTP data */ mgcp_dispatch_rtp_cb dispatch_rtp_cb; + + /*!< callback that implements endpoint specific cleanup actions */ + mgcp_cleanup_cp cleanup_cb; }; /*! MGCP endpoint typeset */ diff --git a/include/osmocom/mgcp/mgcp_internal.h b/include/osmocom/mgcp/mgcp_internal.h index c0ee556..5de28ee 100644 --- a/include/osmocom/mgcp/mgcp_internal.h +++ b/include/osmocom/mgcp/mgcp_internal.h @@ -285,6 +285,7 @@ int mgcp_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn); int mgcp_dispatch_rtp_bridge_cb(int proto, struct sockaddr_in *addr, char *buf, unsigned int buf_size, struct mgcp_conn *conn); +void mgcp_cleanup_rtp_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn); int mgcp_bind_net_rtp_port(struct mgcp_endpoint *endp, int rtp_port, struct mgcp_conn_rtp *conn); void mgcp_free_rtp_port(struct mgcp_rtp_end *end); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index a136fda..33c4165 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -201,6 +201,12 @@ if (!conn) return; + /* Run endpoint cleanup action. By this we inform the endpoint about + * the removal of the connection and allow it to clean up its inner + * state accordingly */ + if (endp->type->cleanup_cb) + endp->type->cleanup_cb(endp, conn); + switch (conn->type) { case MGCP_CONN_TYPE_RTP: osmux_disable_conn(&conn->u.rtp); diff --git a/src/libosmo-mgcp/mgcp_ep.c b/src/libosmo-mgcp/mgcp_ep.c index 68e36da..e23d0f1 100644 --- a/src/libosmo-mgcp/mgcp_ep.c +++ b/src/libosmo-mgcp/mgcp_ep.c @@ -28,7 +28,8 @@ const struct mgcp_endpoint_typeset ep_typeset = { /* Specify endpoint properties for RTP endpoint */ .rtp.max_conns = 2, - .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb + .rtp.dispatch_rtp_cb = mgcp_dispatch_rtp_bridge_cb, + .rtp.cleanup_cb = mgcp_cleanup_rtp_bridge_cb }; /*! release endpoint, all open connections are closed. diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 6cecbb0..4e22e63 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -1043,6 +1043,25 @@ } +/*! cleanup an endpoint when a connection on an RTP bridge endpoint is removed. + * \param[in] endp Endpoint on which the connection resides. + * \param[in] conn Connection that is about to be removed (ignored). + * \returns 0 on success, -1 on ERROR. */ +void mgcp_cleanup_rtp_bridge_cb(struct mgcp_endpoint *endp, struct mgcp_conn *conn) +{ + struct mgcp_conn *conn_cleanup; + + /* In mgcp_dispatch_rtp_bridge_cb() we use conn->priv to cache the + * pointer to the destination connection, so that we do not have + * to go through the list every time an RTP packet arrives. To prevent + * a use-after-free situation we invalidate this information for all + * connections present when one connection is removed from the + * endpoint. */ + llist_for_each_entry(conn_cleanup, &endp->conns, entry) { + conn_cleanup->priv = NULL; + } +} + /* Handle incoming RTP data from NET */ static int rtp_data_net(struct osmo_fd *fd, unsigned int what) { -- To view, visit https://gerrit.osmocom.org/6006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw 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 Wed Jan 31 16:42:30 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:30 +0000 Subject: [PATCH] osmo-mgw[master]: cosmetic: remove spaces from pointer symbol In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6007 to look at the new patch set (#2). cosmetic: remove spaces from pointer symbol Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 --- M include/osmocom/mgcp/mgcp_ep.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/07/6007/2 diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h index e477a47..74b3a9e 100644 --- a/include/osmocom/mgcp/mgcp_ep.h +++ b/include/osmocom/mgcp/mgcp_ep.h @@ -28,9 +28,9 @@ /* Callback type for RTP dispatcher functions (e.g mgcp_dispatch_rtp_bridge_cb, see below) */ -typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in * addr, +typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in *addr, char *buf, unsigned int buf_size, - struct mgcp_conn * conn); + struct mgcp_conn *conn); /*! MGCP endpoint properties */ struct mgcp_endpoint_type { -- To view, visit https://gerrit.osmocom.org/6007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:30 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:30 +0000 Subject: [PATCH] osmo-mgw[master]: client: fix sdp parameter ordering Message-ID: Review at https://gerrit.osmocom.org/6217 client: fix sdp parameter ordering The parameter ordering of the client responses does not match the ordering as proposed by by RFC2327, Chapter 6. SDP Specification - reorder generated SDP parameters so that they match RFC2327 Change-Id: I63cac2ebc982ffead92703c22bf68c7aafa7936c --- M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.ok 2 files changed, 9 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/17/6217/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 97f12c0..771de45 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -889,9 +889,6 @@ /* Add SDP protocol version */ rc += msgb_printf(msg, "v=0\r\n"); - /* Add session name (none) */ - rc += msgb_printf(msg, "s=-\r\n"); - /* Determine local IP-Address */ if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) < 0) { LOGP(DLMGCP, LOGL_ERROR, @@ -903,6 +900,9 @@ /* Add owner/creator (SDP) */ rc += msgb_printf(msg, "o=- %x 23 IN IP4 %s\r\n", mgcp_msg->call_id, local_ip); + + /* Add session name (none) */ + rc += msgb_printf(msg, "s=-\r\n"); /* Add RTP address and port */ if (mgcp_msg->audio_port == 0) { @@ -918,12 +918,13 @@ return NULL; } rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); - rc += - msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", - mgcp_msg->audio_port); /* Add time description, active time (SDP) */ rc += msgb_printf(msg, "t=0 0\r\n"); + + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); } if (rc != 0) { diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 00c7f7c..4dc89b8 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -44,11 +44,11 @@ M: sendrecv v=0 -s=- o=- 2f 23 IN IP4 127.0.0.1 +s=- c=IN IP4 192.168.100.23 -m=audio 1234 RTP/AVP 255 t=0 0 +m=audio 1234 RTP/AVP 255 Generated DLCX message: DLCX 3 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/6217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I63cac2ebc982ffead92703c22bf68c7aafa7936c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:30 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:30 +0000 Subject: [PATCH] osmo-mgw[master]: protocol: check the packetization in local cx options Message-ID: Review at https://gerrit.osmocom.org/6218 protocol: check the packetization in local cx options When the local connection options in an MDCX or CRCX request are parsed, then the packetization interval is not checked. - Check if the packetization is a multiple of 20ms see also TTCN3 test: MGCP_Test.TC_crcx_unsupp_packet_intv Change-Id: I02aaa3042f2a0e32eb4ec6b8753deab7082947a0 Related: OS#2654 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 28 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/18/6218/1 diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 73d7f5e..709c04a 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -396,7 +396,7 @@ * The string is stored in the 'string' field. A NULL string is handled exactly * like an empty string, the 'string' field is never NULL after this function * has been called. */ -static void set_local_cx_options(void *ctx, struct mgcp_lco *lco, +static int set_local_cx_options(void *ctx, struct mgcp_lco *lco, const char *options) { char *p_opt, *a_opt; @@ -420,6 +420,15 @@ LOGP(DLMGCP, LOGL_DEBUG, "local CX options: lco->pkt_period_max: %i, lco->codec: %s\n", lco->pkt_period_max, lco->codec); + + /* Check if the packetization fits the 20ms raster */ + if (lco->pkt_period_min % 20 && lco->pkt_period_max % 20) { + LOGP(DLMGCP, LOGL_ERROR, + "local CX options: packetization interval is not a multiple of 20ms!\n"); + return 535; + } + + return 0; } void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change, @@ -486,6 +495,7 @@ struct mgcp_conn_rtp *conn = NULL; struct mgcp_conn *_conn = NULL; char conn_name[512]; + int rc; LOGP(DLMGCP, LOGL_NOTICE, "CRCX: creating new connection ...\n"); @@ -587,8 +597,14 @@ endp->callid = talloc_strdup(tcfg->endpoints, callid); /* Extract audio codec information */ - set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, - local_options); + rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, + local_options); + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "CRCX: endpoint:%x inavlid local connection options!\n", + ENDPOINT_NUMBER(endp)); + return create_err_response(endp, rc, "CRCX", p->trans); + } snprintf(conn_name, sizeof(conn_name), "%s", callid); _conn = mgcp_conn_alloc(NULL, endp, MGCP_CONN_TYPE_RTP, conn_name); @@ -706,6 +722,7 @@ const char *mode = NULL; struct mgcp_conn_rtp *conn = NULL; const char *conn_id = NULL; + int rc; LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); @@ -778,8 +795,14 @@ if (have_sdp) mgcp_parse_sdp_data(endp, conn, p); - set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, - local_options); + rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, + local_options); + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "MDCX: endpoint:%x inavlid local connection options!\n", + ENDPOINT_NUMBER(endp)); + return create_err_response(endp, rc, "MDCX", p->trans); + } if (!have_sdp && endp->local_options.codec) mgcp_set_audio_info(p->cfg, &conn->end.codec, -- To view, visit https://gerrit.osmocom.org/6218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I02aaa3042f2a0e32eb4ec6b8753deab7082947a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:31 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:31 +0000 Subject: [PATCH] osmo-mgw[master]: client: Do not accept endpoint ids with wildcards in responses Message-ID: Review at https://gerrit.osmocom.org/6219 client: Do not accept endpoint ids with wildcards in responses When the client gets a specific endpoint identifier (Z) in a MGCP response it just accepts the identifier even when it is not specific (contsins wildcard characters). In those cases, the client should refuse to parse the response. - Check for wildcards in endpoint identifiers and stop parsing when check is positive. Change-Id: Ic94bd8c025b7b3eb006b639fecfd7282194e504a --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/19/6219/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 771de45..d868c7f 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -356,6 +356,13 @@ 'Z', line); if (rc) goto exit; + + /* A specific endpoint identifier returned by the MGW + * must not contain any wildcard characters */ + if (strstr(r->head.endpoint, "*") != NULL) { + rc = -EINVAL; + goto exit; + } break; case 'I': rc = mgcp_parse_head_param(r->head.conn_id, -- To view, visit https://gerrit.osmocom.org/6219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic94bd8c025b7b3eb006b639fecfd7282194e504a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:31 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:31 +0000 Subject: [PATCH] osmo-mgw[master]: client: do not accept endpoint ids without @ character in re... Message-ID: Review at https://gerrit.osmocom.org/6220 client: do not accept endpoint ids without @ character in responses At the moment the client does not check if the endpoint identifier that is returned from the MGW actually contains an @ character. - Check if the endpoint id in the response contains an @ character. Change-Id: I6073419a4b6cdcd31880672564f0861cb4bd02f5 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/20/6220/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index d868c7f..593d305 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -363,6 +363,13 @@ rc = -EINVAL; goto exit; } + + /* A specific endpoint identifier returned by the MGW + * must contain an @ character */ + if (strstr(r->head.endpoint, "@") == NULL) { + rc = -EINVAL; + goto exit; + } break; case 'I': rc = mgcp_parse_head_param(r->head.conn_id, -- To view, visit https://gerrit.osmocom.org/6220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6073419a4b6cdcd31880672564f0861cb4bd02f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:31 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:31 +0000 Subject: [PATCH] osmo-mgw[master]: client: prohibit endpoint ids without @ character Message-ID: Review at https://gerrit.osmocom.org/6221 client: prohibit endpoint ids without @ character The function mgcp_msg_gen() does only check if the user supplied an endpoint name or not. The user may still supply an endpoint name that does not contain the separator (@) character. - Refuse to generate the message if the endpoint name does not contain any @ character. Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 8 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/21/6221/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 593d305..efe1d1f 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -862,6 +862,14 @@ msgb_free(msg); return NULL; } + + if (strstr(mgcp_msg->endpoint, "@") == NULL) { + LOGP(DLMGCP, LOGL_ERROR, + "Endpoint name (%s) lacks separator (@), can not generate MGCP message\n", + mgcp_msg->endpoint); + msgb_free(msg); + } + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); } -- To view, visit https://gerrit.osmocom.org/6221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:42:31 2018 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 31 Jan 2018 16:42:31 +0000 Subject: [PATCH] osmo-mgw[master]: client: use heap to store mgcp_response Message-ID: Review at https://gerrit.osmocom.org/6222 client: use heap to store mgcp_response The struct that holds the parsing results of the MGCP response is allocated on the stack. However, it would make sense to allocate the struct dynamically on the heap. This also would provide a talloc context that is in reach on most places of the code. - Allocate struct mgcp_response dynamically in mgcp_client_rx() - Use struct mgcp_response as talloc context for temporary allocated memory while parsing the response. Change-Id: I5099abe68b580c75b47bc797bf93f01084f0c4db --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 22 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/22/6222/1 diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index efe1d1f..ea7ac36 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -257,7 +257,7 @@ /* Since this functions performs a destructive parsing, we create a * local copy of the body data */ - data = talloc_zero_size(NULL, strlen(r->body)+1); + data = talloc_zero_size(r, strlen(r->body)+1); OSMO_ASSERT(data); data_ptr = data; osmo_strlcpy(data, r->body, strlen(r->body)); @@ -336,7 +336,7 @@ /* Since this functions performs a destructive parsing, we create a * local copy of the body data */ - data = talloc_zero_size(NULL, strlen(r->body)+1); + data = talloc_zero_size(r, strlen(r->body)+1); OSMO_ASSERT(data); data_ptr = data; osmo_strlcpy(data, r->body, strlen(r->body)); @@ -410,32 +410,42 @@ */ int mgcp_client_rx(struct mgcp_client *mgcp, struct msgb *msg) { - struct mgcp_response r = { 0 }; + struct mgcp_response *r; struct mgcp_response_pending *pending; int rc; - rc = mgcp_response_parse_head(&r, msg); + r = talloc_zero(mgcp, struct mgcp_response); + OSMO_ASSERT(r); + + rc = mgcp_response_parse_head(r, msg); if (rc) { LOGP(DLMGCP, LOGL_ERROR, "Cannot parse MGCP response (head)\n"); - return -1; + rc = 1; + goto error; } - rc = parse_head_params(&r); + rc = parse_head_params(r); if (rc) { LOGP(DLMGCP, LOGL_ERROR, "Cannot parse MGCP response (head parameters)\n"); - return -1; + rc = 1; + goto error; } - pending = mgcp_client_response_pending_get(mgcp, r.head.trans_id); + pending = mgcp_client_response_pending_get(mgcp, r->head.trans_id); if (!pending) { LOGP(DLMGCP, LOGL_ERROR, "Cannot find matching MGCP transaction for trans_id %d\n", - r.head.trans_id); - return -ENOENT; + r->head.trans_id); + rc = -ENOENT; + goto error; } - mgcp_client_handle_response(mgcp, pending, &r); - return 0; + mgcp_client_handle_response(mgcp, pending, r); + rc = 0; + +error: + talloc_free(r); + return rc; } static int mgcp_do_read(struct osmo_fd *fd) -- To view, visit https://gerrit.osmocom.org/6222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5099abe68b580c75b47bc797bf93f01084f0c4db Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Jan 31 16:50:51 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 16:50:51 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: don't use PDCH for free TFI Message-ID: Review at https://gerrit.osmocom.org/6223 Simplify TS alloc: don't use PDCH for free TFI Don't use PDCH from free TFI lookup routine. This allows for simpler function which can be moved to mslot_class.c alongside with other similar helpers. Change-Id: Ie154866900453d232a890f7b9a30911b451525a1 Related: OS#2282 --- M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M src/mslot_class.c M src/mslot_class.h 4 files changed, 21 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/23/6223/1 diff --git a/src/bts.h b/src/bts.h index 5679b98..f69f738 100644 --- a/src/bts.h +++ b/src/bts.h @@ -30,6 +30,7 @@ #include #include #include + #include } #include "poll_controller.h" @@ -44,7 +45,6 @@ #define LLC_CODEL_DISABLE 0 #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 -#define NO_FREE_TFI 0xffffffff /* see bts->gsmtap_categ_mask */ enum pcu_gsmtap_category { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 3579f55..1f08e92 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -36,23 +36,6 @@ /* Consider a PDCH as idle if has at most this number of TBFs assigned to it */ #define PDCH_IDLE_TBF_THRESH 1 -static inline int8_t find_free_tfi(const struct gprs_rlcmac_pdch *pdch, enum gprs_rlcmac_tbf_direction dir) -{ - uint32_t tfi_map = pdch->assigned_tfi(dir); - int8_t tfi; - - if (tfi_map == NO_FREE_TFI) - return -1; - - /* look for USF, don't use USF=7 */ - for (tfi = 0; tfi < 32; tfi++) { - if (!(tfi_map & (1 << tfi))) - return tfi; - } - - return -1; -} - static uint8_t find_possible_pdchs(const struct gprs_rlcmac_trx *trx, uint8_t max_slots, uint8_t mask, const char *mask_reason = NULL) { @@ -161,7 +144,7 @@ /* We have found a candidate */ /* Make sure that a TFI is available */ if (free_tfi) { - tfi = find_free_tfi(pdch, dir); + tfi = find_free_tfi(pdch->assigned_tfi(dir)); if (tfi < 0) { LOGP(DRLCMAC, LOGL_DEBUG, "- Skipping TS %d, because no TFI available\n", ts); diff --git a/src/mslot_class.c b/src/mslot_class.c index 8a0dd93..2a482f1 100644 --- a/src/mslot_class.c +++ b/src/mslot_class.c @@ -230,6 +230,22 @@ return -1; } +/* look for USF, don't use USF=7 */ +int8_t find_free_tfi(uint32_t tfi_map) +{ + int8_t tfi; + + if (tfi_map == NO_FREE_TFI) + return -1; + + for (tfi = 0; tfi < 32; tfi++) { + if (!(tfi_map & (1 << tfi))) + return tfi; + } + + return -1; +} + void masked_override_with(char *buf, uint8_t mask, char set_char) { int i; diff --git a/src/mslot_class.h b/src/mslot_class.h index 80b2ef6..045fb31 100644 --- a/src/mslot_class.h +++ b/src/mslot_class.h @@ -36,6 +36,8 @@ #define DEFAULT_MSLOT_CLASS 12 +#define NO_FREE_TFI 0xffffffff + enum { MASK_TT = 0, MASK_TR = 1 }; /* multislot class selection routines */ @@ -52,6 +54,7 @@ /* multislot allocation helper routines */ void mslot_fill_rx_mask(uint8_t mslot_class, uint8_t num_tx, uint8_t *rx_mask); int8_t find_free_usf(uint8_t usf_map); +int8_t find_free_tfi(uint32_t tfi_map); void masked_override_with(char *buf, uint8_t mask, char set_char); void ts_format(char *buf, uint8_t dl_mask, uint8_t ul_mask); uint16_t mslot_wrap_window(uint16_t win); -- To view, visit https://gerrit.osmocom.org/6223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie154866900453d232a890f7b9a30911b451525a1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 17:05:54 2018 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 31 Jan 2018 17:05:54 +0000 Subject: [PATCH] osmo-pcu[master]: Simplify TS alloc: constify max dl slot func Message-ID: Review at https://gerrit.osmocom.org/6224 Simplify TS alloc: constify max dl slot func Constify parameters of gprs_alloc_max_dl_slots_per_ms(). Change-Id: Ic90930d98560459eab0054cb9e1625cb99db61c8 Related: OS#2282 --- M src/gprs_rlcmac.h M src/gprs_rlcmac_ts_alloc.cpp 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/24/6224/1 diff --git a/src/gprs_rlcmac.h b/src/gprs_rlcmac.h index 33dd9fd..8ff3c90 100644 --- a/src/gprs_rlcmac.h +++ b/src/gprs_rlcmac.h @@ -97,7 +97,7 @@ uint8_t trx, uint8_t ts, uint32_t fn, uint8_t block_nr); -int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, +int gprs_alloc_max_dl_slots_per_ms(const struct gprs_rlcmac_bts *bts, uint8_t ms_class = 0); extern "C" { diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 1f08e92..852027b 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -963,7 +963,7 @@ return alloc_algorithm_a(bts, ms_, tbf_, single, use_trx); } -int gprs_alloc_max_dl_slots_per_ms(struct gprs_rlcmac_bts *bts, uint8_t ms_class) +int gprs_alloc_max_dl_slots_per_ms(const struct gprs_rlcmac_bts *bts, uint8_t ms_class) { int rx = mslot_class_get_rx(ms_class); -- To view, visit https://gerrit.osmocom.org/6224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic90930d98560459eab0054cb9e1625cb99db61c8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Jan 31 17:50:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 17:50:52 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Change expectation in paging tests In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/6216 to look at the new patch set (#2). bsc: Change expectation in paging tests When we page an unknown/unsupported CellIdentifier format, OsmoBSC decides to page on all BTSs to be safe. This way we have a chance of making communication happen, rather than breaking it. Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea --- M bsc/BSC_Tests.ttcn 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/16/6216/2 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 467ce4f..8b44a25 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1081,21 +1081,21 @@ testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; - f_pageing_helper('001010000000012'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000012'H, cid_list, c_BtsId_all); } /* Paging by RNC */ testcase TC_paging_imsi_nochan_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_RNC := { int2oct(13, 2) } }; - f_pageing_helper('001010000000013'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000013'H, cid_list, c_BtsId_all); } /* Paging by LAC+RNC */ testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; - f_pageing_helper('001010000000014'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000014'H, cid_list, c_BtsId_all); } /* Paging on multiple cells (multiple entries in list): Verify all of them page */ -- To view, visit https://gerrit.osmocom.org/6216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 17:50:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 17:50:52 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMA... Message-ID: Review at https://gerrit.osmocom.org/6225 bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMARK conversion Related: OS#2902 Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn M library/BSSMAP_Templates.ttcn M library/L3_Templates.ttcn 4 files changed, 154 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/25/6225/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 8b44a25..b9d61dd 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1404,12 +1404,64 @@ vc_conn.done; } +/* test if L3 RR CLASSMARK CHANGE is translated to BSSMAP CLASSMARK UPDATE */ +private function f_tc_classmark(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_CM_CHG(valueof(ts_CM2))); + BSSAP.receive(tr_BSSMAP_ClassmarkUpd(?, omit)); + setverdict(pass); +} +testcase TC_classmark() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_classmark), testcasename()); + vc_conn.done; +} + +/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_AssignmentFailure('00'O)); + timer T := 5.0; + T.start; + alt { + [] BSSAP.receive(tr_BSSMAP_AssignmentFail) { + setverdict(fail, "Unexpeted BSSMAP Assignment Failure"); + } + [] BSSAP.receive(tr_BSSMAP_ClearRequest) { + setverdict(fail, "Unexpected BSSMAP Clear Requst"); + } + [] T.timeout { + setverdict(pass); + } + } +} + +testcase TC_unsol_ass_fail() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_unsol_ass_fail), testcasename()); + vc_conn.done; +} control { + /* CTRL interface testing */ execute( TC_ctrl_msc_connection_status() ); execute( TC_ctrl_msc0_connection_status() ); execute( TC_ctrl() ); + + /* RSL DCHAN Channel ACtivation / Deactivation */ execute( TC_chan_act_noreply() ); execute( TC_chan_act_counter() ); execute( TC_chan_act_ack_noest() ); @@ -1424,6 +1476,8 @@ execute( TC_chan_rel_a_reset() ); execute( TC_outbound_connect() ); + + /* Assignment related */ execute( TC_assignment_cic_only() ); execute( TC_assignment_csd() ); execute( TC_assignment_ctm() ); @@ -1434,11 +1488,13 @@ execute( TC_assignment_fr_a5_3() ); execute( TC_assignment_fr_a5_4() ); + /* RLL Establish Indication on inactive DCHAN / SAPI */ execute( TC_rll_est_ind_inact_lchan() ); execute( TC_rll_est_ind_inval_sapi1() ); execute( TC_rll_est_ind_inval_sapi3() ); execute( TC_rll_est_ind_inval_sacch() ); + /* Paging related tests */ execute( TC_paging_imsi_nochan() ); execute( TC_paging_tmsi_nochan() ); execute( TC_paging_tmsi_any() ); @@ -1460,6 +1516,9 @@ execute( TC_paging_imsi_load() ); execute( TC_rsl_drop_counter() ); + + execute( TC_classmark() ); + execute( TC_unsol_ass_fail() ); } } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index b6e6540..a7f4d71 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -301,6 +301,17 @@ f_create_bssmap_exp(l3_enc); } +function f_rsl_send_l3(template PDU_ML3_MS_NW l3, template (omit) RslLinkId link_id := omit, + template (omit) RslChannelNr chan_nr := omit) runs on MSC_ConnHdlr { + if (not isvalue(link_id)) { + link_id := ts_RslLinkID_DCCH(0); + } + if (not isvalue(chan_nr)) { + chan_nr := g_chan_nr; + } + RSL.send(ts_RSL_DATA_IND(valueof(chan_nr), valueof(link_id), enc_PDU_ML3_MS_NW(valueof(l3)))); +} + function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig) runs on MSC_ConnHdlr { var RslChannelNr chan_nr := orig.ies[0].body.chan_nr; var RslLinkId link_id; @@ -309,7 +320,7 @@ } else { link_id := orig.ies[1].body.link_id; } - RSL.send(ts_RSL_DATA_IND(chan_nr, link_id, enc_PDU_ML3_MS_NW(valueof(l3)))); + f_rsl_send_l3(l3, link_id, chan_nr); } function f_cipher_mode(OCT1 alg, OCT8 key, template OCT16 kc128 := omit, boolean exp_fail := false) diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index f0a8a08..d4e278b 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -906,6 +906,23 @@ } } +template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *, + template BSSMAP_IE_ClassmarkInformationType3 cm3 := *) +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + classmarkUpdate := { + messageType := '54'O, + classmarkInformationType2 := cm2, + classmarkInformationType3 := cm3, + talkerPriority := * + } + } + } +} + + + } with { encode "RAW" }; diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ed477d5..ad4e575 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -102,8 +102,25 @@ esind := '1'B, revisionLevel := '10'B, spare1_1 := '0'B, - mobileStationClassmark2_oct4 := omit, - mobileStationClassmark2_oct5 := omit + mobileStationClassmark2_oct4 := { + fc := '1'B, + vgcs := '0'B, + vbs := '0'B, + sm_Capability := '1'B, + ss_ScreenIndicator := '01'B, + ps_Capability := '1'B, + spare2_1 := '0'B + }, + mobileStationClassmark2_oct5 := { + a5_2 := '0'B, + a5_3 := '1'B, + cmsp := '0'B, + solsa := '0'B, + ucs2 := '0'B, + lcsva_cap := '0'B, + spare5_7 :='0'B, + cm3 := '0'B + } }; /* Send template for CM SERVICE REQUEST */ @@ -268,6 +285,53 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + assignmentFailure := { + messageType := '00101111'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} + + +function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { + if (not isvalue(cm3)) { + return omit; + } + var template MobileStationClassmark3_TLV ret := { + elementIdentifier := '20'O, + lengthIndicator := 0, /* overwritten */ + valuePart := cm3 + } + return ret; +} + +template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2, + template (omit) MobileStationClassmark3_TLV cm3 := omit) := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + classmarkChange := { + messageType := '00010110'B, + mobileStationClassmark2 := cm2, + mobileStationClassmark3 := cm3 + } + } + } +} + template PDU_ML3_MS_NW ts_ML3_MO := { discriminator := '0000'B, tiOrSkip := { -- To view, visit https://gerrit.osmocom.org/6225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 18:39:49 2018 From: gerrit-no-reply at lists.osmocom.org (Pau Espin Pedrol) Date: Wed, 31 Jan 2018 18:39:49 +0000 Subject: osmo-msc[master]: Make sending an SMS to an unknown subscriber B work over SMPP. In-Reply-To: References: Message-ID: Patch Set 1: Can we get a +2 to this one? Otherwise osmo-gsm-tester is failing in one test after it was re-enabled. It was verified that when this commit is used together with 6914, test passes fine. -- To view, visit https://gerrit.osmocom.org/6192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:47:16 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:47:16 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Add TC_unsol_ho_fail test case for unsolicited handover... Message-ID: Review at https://gerrit.osmocom.org/6226 bsc: Add TC_unsol_ho_fail test case for unsolicited handover failure Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea --- M bsc/BSC_Tests.ttcn M library/L3_Templates.ttcn 2 files changed, 47 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/26/6226/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b9d61dd..7d4a140 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1454,6 +1454,35 @@ vc_conn.done; } +/* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_HandoverFailure('00'O)); + timer T := 5.0; + T.start; + alt { + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSMAP"); + } + [] T.timeout { + setverdict(pass); + } + } +} + +testcase TC_unsol_ho_fail() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_unsol_ho_fail), testcasename()); + vc_conn.done; +} + + control { /* CTRL interface testing */ @@ -1519,6 +1548,7 @@ execute( TC_classmark() ); execute( TC_unsol_ass_fail() ); + execute( TC_unsol_ho_fail() ); } } diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ad4e575..948565d 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -302,6 +302,23 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + handoverFailure := { + messageType := '00101000'B, + rRCause := { + valuePart := cause + }, + pSCause := omit + } + } + } +} function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { if (not isvalue(cm3)) { -- To view, visit https://gerrit.osmocom.org/6226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:47:17 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:47:17 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Add TC_unsol_ass_compl / unsolicited assignment complete Message-ID: Review at https://gerrit.osmocom.org/6227 bsc: Add TC_unsol_ass_compl / unsolicited assignment complete Change-Id: Ib025ee51df54804e9a4241d4fa6107ce49270a5f --- M bsc/BSC_Tests.ttcn 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/27/6227/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 7d4a140..08a5510 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1454,6 +1454,38 @@ vc_conn.done; } + +/* unsolicited ASSIGNMENT COMPLETE (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ass_compl(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_AssignmentComplete('00'O)); + timer T := 5.0; + T.start; + alt { + [] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { + setverdict(fail, "Unexpeted BSSMAP Assignment Complet"); + } + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSAP"); + } + [] T.timeout { + setverdict(pass); + } + } +} +testcase TC_unsol_ass_compl() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_unsol_ass_compl), testcasename()); + vc_conn.done; +} + + /* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); @@ -1548,6 +1580,7 @@ execute( TC_classmark() ); execute( TC_unsol_ass_fail() ); + execute( TC_unsol_ass_compl() ); execute( TC_unsol_ho_fail() ); } -- To view, visit https://gerrit.osmocom.org/6227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib025ee51df54804e9a4241d4fa6107ce49270a5f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:47 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:47 +0000 Subject: osmo-ttcn3-hacks[master]: BSC_Tests: fix f_pageing_helper() in case no paging was expe... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63827aa3c42f77648ecad401b3cc4bae927b3b94 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:49 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:49 +0000 Subject: osmo-ttcn3-hacks[master]: BSC_Tests: Implement remaining missing paging tests In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:50 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:50 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Change expectation in paging tests In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:52 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMA... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:54 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:54 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Add TC_unsol_ho_fail test case for unsolicited handover... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:57 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:57 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Add TC_unsol_ass_compl / unsolicited assignment complete In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib025ee51df54804e9a4241d4fa6107ce49270a5f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:58 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:58 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Add TC_unsol_ass_compl / unsolicited assignment complete In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Add TC_unsol_ass_compl / unsolicited assignment complete ...................................................................... bsc: Add TC_unsol_ass_compl / unsolicited assignment complete Change-Id: Ib025ee51df54804e9a4241d4fa6107ce49270a5f --- M bsc/BSC_Tests.ttcn 1 file changed, 33 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 7d4a140..08a5510 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1454,6 +1454,38 @@ vc_conn.done; } + +/* unsolicited ASSIGNMENT COMPLETE (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ass_compl(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_AssignmentComplete('00'O)); + timer T := 5.0; + T.start; + alt { + [] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { + setverdict(fail, "Unexpeted BSSMAP Assignment Complet"); + } + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSAP"); + } + [] T.timeout { + setverdict(pass); + } + } +} +testcase TC_unsol_ass_compl() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_unsol_ass_compl), testcasename()); + vc_conn.done; +} + + /* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); @@ -1548,6 +1580,7 @@ execute( TC_classmark() ); execute( TC_unsol_ass_fail() ); + execute( TC_unsol_ass_compl() ); execute( TC_unsol_ho_fail() ); } -- To view, visit https://gerrit.osmocom.org/6227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib025ee51df54804e9a4241d4fa6107ce49270a5f Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:48:59 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:48:59 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Add TC_unsol_ho_fail test case for unsolicited handover... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Add TC_unsol_ho_fail test case for unsolicited handover failure ...................................................................... bsc: Add TC_unsol_ho_fail test case for unsolicited handover failure Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea --- M bsc/BSC_Tests.ttcn M library/L3_Templates.ttcn 2 files changed, 47 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index b9d61dd..7d4a140 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1454,6 +1454,35 @@ vc_conn.done; } +/* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_HandoverFailure('00'O)); + timer T := 5.0; + T.start; + alt { + [] BSSAP.receive { + setverdict(fail, "Unexpected BSSMAP"); + } + [] T.timeout { + setverdict(pass); + } + } +} + +testcase TC_unsol_ho_fail() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_unsol_ho_fail), testcasename()); + vc_conn.done; +} + + control { /* CTRL interface testing */ @@ -1519,6 +1548,7 @@ execute( TC_classmark() ); execute( TC_unsol_ass_fail() ); + execute( TC_unsol_ho_fail() ); } } diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ad4e575..948565d 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -302,6 +302,23 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_HandoverFailure(OCT1 cause) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + handoverFailure := { + messageType := '00101000'B, + rRCause := { + valuePart := cause + }, + pSCause := omit + } + } + } +} function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { if (not isvalue(cm3)) { -- To view, visit https://gerrit.osmocom.org/6226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3bd71d77d03cb7eebabdf98ba0bfbafd24ec0ea Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:00 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMA... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMARK conversion ...................................................................... bsc: Add TC_classmark to test RR CLASSMARK -> BSSMAP CLASSMARK conversion Related: OS#2902 Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93 --- M bsc/BSC_Tests.ttcn M bsc/MSC_ConnectionHandler.ttcn M library/BSSMAP_Templates.ttcn M library/L3_Templates.ttcn 4 files changed, 154 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 8b44a25..b9d61dd 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1404,12 +1404,64 @@ vc_conn.done; } +/* test if L3 RR CLASSMARK CHANGE is translated to BSSMAP CLASSMARK UPDATE */ +private function f_tc_classmark(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_CM_CHG(valueof(ts_CM2))); + BSSAP.receive(tr_BSSMAP_ClassmarkUpd(?, omit)); + setverdict(pass); +} +testcase TC_classmark() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_classmark), testcasename()); + vc_conn.done; +} + +/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + f_rsl_send_l3(ts_RRM_AssignmentFailure('00'O)); + timer T := 5.0; + T.start; + alt { + [] BSSAP.receive(tr_BSSMAP_AssignmentFail) { + setverdict(fail, "Unexpeted BSSMAP Assignment Failure"); + } + [] BSSAP.receive(tr_BSSMAP_ClearRequest) { + setverdict(fail, "Unexpected BSSMAP Clear Requst"); + } + [] T.timeout { + setverdict(pass); + } + } +} + +testcase TC_unsol_ass_fail() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_unsol_ass_fail), testcasename()); + vc_conn.done; +} control { + /* CTRL interface testing */ execute( TC_ctrl_msc_connection_status() ); execute( TC_ctrl_msc0_connection_status() ); execute( TC_ctrl() ); + + /* RSL DCHAN Channel ACtivation / Deactivation */ execute( TC_chan_act_noreply() ); execute( TC_chan_act_counter() ); execute( TC_chan_act_ack_noest() ); @@ -1424,6 +1476,8 @@ execute( TC_chan_rel_a_reset() ); execute( TC_outbound_connect() ); + + /* Assignment related */ execute( TC_assignment_cic_only() ); execute( TC_assignment_csd() ); execute( TC_assignment_ctm() ); @@ -1434,11 +1488,13 @@ execute( TC_assignment_fr_a5_3() ); execute( TC_assignment_fr_a5_4() ); + /* RLL Establish Indication on inactive DCHAN / SAPI */ execute( TC_rll_est_ind_inact_lchan() ); execute( TC_rll_est_ind_inval_sapi1() ); execute( TC_rll_est_ind_inval_sapi3() ); execute( TC_rll_est_ind_inval_sacch() ); + /* Paging related tests */ execute( TC_paging_imsi_nochan() ); execute( TC_paging_tmsi_nochan() ); execute( TC_paging_tmsi_any() ); @@ -1460,6 +1516,9 @@ execute( TC_paging_imsi_load() ); execute( TC_rsl_drop_counter() ); + + execute( TC_classmark() ); + execute( TC_unsol_ass_fail() ); } } diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn index b6e6540..a7f4d71 100644 --- a/bsc/MSC_ConnectionHandler.ttcn +++ b/bsc/MSC_ConnectionHandler.ttcn @@ -301,6 +301,17 @@ f_create_bssmap_exp(l3_enc); } +function f_rsl_send_l3(template PDU_ML3_MS_NW l3, template (omit) RslLinkId link_id := omit, + template (omit) RslChannelNr chan_nr := omit) runs on MSC_ConnHdlr { + if (not isvalue(link_id)) { + link_id := ts_RslLinkID_DCCH(0); + } + if (not isvalue(chan_nr)) { + chan_nr := g_chan_nr; + } + RSL.send(ts_RSL_DATA_IND(valueof(chan_nr), valueof(link_id), enc_PDU_ML3_MS_NW(valueof(l3)))); +} + function f_rsl_reply(template PDU_ML3_MS_NW l3, RSL_Message orig) runs on MSC_ConnHdlr { var RslChannelNr chan_nr := orig.ies[0].body.chan_nr; var RslLinkId link_id; @@ -309,7 +320,7 @@ } else { link_id := orig.ies[1].body.link_id; } - RSL.send(ts_RSL_DATA_IND(chan_nr, link_id, enc_PDU_ML3_MS_NW(valueof(l3)))); + f_rsl_send_l3(l3, link_id, chan_nr); } function f_cipher_mode(OCT1 alg, OCT8 key, template OCT16 kc128 := omit, boolean exp_fail := false) diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index f0a8a08..d4e278b 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -906,6 +906,23 @@ } } +template PDU_BSSAP tr_BSSMAP_ClassmarkUpd(template BSSMAP_IE_ClassmarkInformationType2 cm2 := *, + template BSSMAP_IE_ClassmarkInformationType3 cm3 := *) +modifies tr_BSSAP_BSSMAP := { + pdu := { + bssmap := { + classmarkUpdate := { + messageType := '54'O, + classmarkInformationType2 := cm2, + classmarkInformationType3 := cm3, + talkerPriority := * + } + } + } +} + + + } with { encode "RAW" }; diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index ed477d5..ad4e575 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -102,8 +102,25 @@ esind := '1'B, revisionLevel := '10'B, spare1_1 := '0'B, - mobileStationClassmark2_oct4 := omit, - mobileStationClassmark2_oct5 := omit + mobileStationClassmark2_oct4 := { + fc := '1'B, + vgcs := '0'B, + vbs := '0'B, + sm_Capability := '1'B, + ss_ScreenIndicator := '01'B, + ps_Capability := '1'B, + spare2_1 := '0'B + }, + mobileStationClassmark2_oct5 := { + a5_2 := '0'B, + a5_3 := '1'B, + cmsp := '0'B, + solsa := '0'B, + ucs2 := '0'B, + lcsva_cap := '0'B, + spare5_7 :='0'B, + cm3 := '0'B + } }; /* Send template for CM SERVICE REQUEST */ @@ -268,6 +285,53 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_AssignmentFailure(OCT1 cause) := { + discriminator := '0000'B, /* overwritten */ + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + assignmentFailure := { + messageType := '00101111'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} + + +function ts_CM3_TLV(template (omit) OCTN cm3) return template MobileStationClassmark3_TLV { + if (not isvalue(cm3)) { + return omit; + } + var template MobileStationClassmark3_TLV ret := { + elementIdentifier := '20'O, + lengthIndicator := 0, /* overwritten */ + valuePart := cm3 + } + return ret; +} + +template (value) PDU_ML3_MS_NW ts_RRM_CM_CHG(MobileStationClassmark2_LV cm2, + template (omit) MobileStationClassmark3_TLV cm3 := omit) := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + classmarkChange := { + messageType := '00010110'B, + mobileStationClassmark2 := cm2, + mobileStationClassmark3 := cm3 + } + } + } +} + template PDU_ML3_MS_NW ts_ML3_MO := { discriminator := '0000'B, tiOrSkip := { -- To view, visit https://gerrit.osmocom.org/6225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idd86b5505e1a4fee666287680a20dc235970be93 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:00 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Change expectation in paging tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Change expectation in paging tests ...................................................................... bsc: Change expectation in paging tests When we page an unknown/unsupported CellIdentifier format, OsmoBSC decides to page on all BTSs to be safe. This way we have a chance of making communication happen, rather than breaking it. Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea --- M bsc/BSC_Tests.ttcn 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 467ce4f..8b44a25 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1081,21 +1081,21 @@ testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; - f_pageing_helper('001010000000012'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000012'H, cid_list, c_BtsId_all); } /* Paging by RNC */ testcase TC_paging_imsi_nochan_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_RNC := { int2oct(13, 2) } }; - f_pageing_helper('001010000000013'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000013'H, cid_list, c_BtsId_all); } /* Paging by LAC+RNC */ testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { var template BSSMAP_FIELD_CellIdentificationList cid_list; cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; - f_pageing_helper('001010000000014'H, cid_list, c_BtsId_none); + f_pageing_helper('001010000000014'H, cid_list, c_BtsId_all); } /* Paging on multiple cells (multiple entries in list): Verify all of them page */ -- To view, visit https://gerrit.osmocom.org/6216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibd0ba986d9e18758b519e852c36f4dbbb6b367ea Gerrit-PatchSet: 2 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:00 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:00 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSC_Tests: Implement remaining missing paging tests In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSC_Tests: Implement remaining missing paging tests ...................................................................... BSC_Tests: Implement remaining missing paging tests We now test all of the cell identification types specified in BSSMAP, and also lists with a length != 1 entry. Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b --- M bsc/BSC_Tests.ttcn M library/BSSMAP_Templates.ttcn 2 files changed, 50 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 528b1c7..467ce4f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -970,6 +970,7 @@ } const BtsIdList c_BtsId_all := { 0, 1, 2 }; +const BtsIdList c_BtsId_none := { }; const BtsIdList c_BtsId_LAC1 := { 0, 1 }; const BtsIdList c_BtsId_LAC2 := { 2 }; @@ -1077,11 +1078,40 @@ } /* Paging by PLMN+LAC+RNC */ -/* Paging by RNC */ -/* Paging by LAC+RNC */ +testcase TC_paging_imsi_nochan_plmn_lac_rnc() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_PLMN_LAC_RNC := { ts_BSSMAP_CI_PLMN_LAC_RNC(cid.mcc, cid.mnc, cid.lac, 12) } }; + f_pageing_helper('001010000000012'H, cid_list, c_BtsId_none); +} -/* Paging on multiple cells (multiple in one LAC): Verify all of them page */ +/* Paging by RNC */ +testcase TC_paging_imsi_nochan_rnc() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_RNC := { int2oct(13, 2) } }; + f_pageing_helper('001010000000013'H, cid_list, c_BtsId_none); +} + +/* Paging by LAC+RNC */ +testcase TC_paging_imsi_nochan_lac_rnc() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_LAC_RNC := { ts_BSSMAP_CI_LAC_RNC(cid.lac, 14) } }; + f_pageing_helper('001010000000014'H, cid_list, c_BtsId_none); +} + /* Paging on multiple cells (multiple entries in list): Verify all of them page */ +testcase TC_paging_imsi_nochan_lacs() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_LAC := { ts_BSSMAP_CI_LAC(1), ts_BSSMAP_CI_LAC(2) } }; + f_pageing_helper('001010000000015'H, cid_list, c_BtsId_all); +} + +/* Paging on empty list: Verify none of them page */ +testcase TC_paging_imsi_nochan_lacs_empty() runs on test_CT { + var template BSSMAP_FIELD_CellIdentificationList cid_list; + cid_list := { cIl_LAC := { } }; + f_pageing_helper('001010000000016'H, cid_list, c_BtsId_none); +} + /* Verify paging retransmission interval + count */ /* Verify paging stops after channel establishment */ /* Test behavior under paging overload */ @@ -1421,6 +1451,11 @@ execute( TC_paging_imsi_nochan_lai() ); execute( TC_paging_imsi_nochan_lac() ); execute( TC_paging_imsi_nochan_all() ); + execute( TC_paging_imsi_nochan_plmn_lac_rnc() ); + execute( TC_paging_imsi_nochan_rnc() ); + execute( TC_paging_imsi_nochan_lac_rnc() ); + execute( TC_paging_imsi_nochan_lacs() ); + execute( TC_paging_imsi_nochan_lacs_empty() ); execute( TC_paging_imsi_a_reset() ); execute( TC_paging_imsi_load() ); diff --git a/library/BSSMAP_Templates.ttcn b/library/BSSMAP_Templates.ttcn index c98f5eb..f0a8a08 100644 --- a/library/BSSMAP_Templates.ttcn +++ b/library/BSSMAP_Templates.ttcn @@ -695,6 +695,18 @@ template OCT2 ts_BSSMAP_CI_CI(GsmCellId ci) := int2oct(ci, 2); template OCT2 ts_BSSMAP_CI_LAC(GsmLac lac) := int2oct(lac, 2); +template BSSMAP_FIELD_CellIdentification_PLMN_LAC_RNC +ts_BSSMAP_CI_PLMN_LAC_RNC(GsmMcc mcc, GsmMnc mnc, GsmLac lac, uint16_t rnc_id) := { + mcc_mnc := f_enc_mcc_mnc(mcc, mnc), + lac := int2oct(lac, 2), + rncId := int2oct(rnc_id, 2) +} + +template BSSMAP_FIELD_CellIdentification_LAC_RNC ts_BSSMAP_CI_LAC_RNC(GsmLac lac, uint16_t rnc_id) := { + lac := int2oct(lac, 2), + rncId := int2oct(rnc_id, 2) +} + template BSSMAP_IE_ChannelNeeded ts_BSSMAP_IE_ChanNeeded(BIT2 chneed) := { elementIdentifier := '24'O, channel := chneed, -- To view, visit https://gerrit.osmocom.org/6215 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I261f948d6054d0c90078c1dd0b2785a967b0a49b Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:01 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: BSC_Tests: fix f_pageing_helper() in case no paging was expe... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: BSC_Tests: fix f_pageing_helper() in case no paging was expected ...................................................................... BSC_Tests: fix f_pageing_helper() in case no paging was expected We have to wait for sime time until some RSL paging command would have arrived, rather than continuing too quickly. Change-Id: I63827aa3c42f77648ecad401b3cc4bae927b3b94 --- M bsc/BSC_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 9da5b65..528b1c7 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -949,6 +949,7 @@ setverdict(fail, "RSL Channel Needed != BSSMAP Channel Needed"); } } + f_sleep(2.0); /* do a quick check on all not-included BTSs if they received paging */ for (i := 0; i < NUM_BTS; i := i + 1) { timer T := 0.1; -- To view, visit https://gerrit.osmocom.org/6214 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63827aa3c42f77648ecad401b3cc4bae927b3b94 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:32 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:32 +0000 Subject: osmo-msc[master]: Make sending an SMS to an unknown subscriber B work over SMPP. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling 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 Jan 31 19:49:41 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:41 +0000 Subject: osmo-gsm-tester[master]: aoip_smpp: Since recent osmo-msc, we accept all sms in store... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb5656f3ca93f4343441d90e30fbe904382c44e3 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-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:44 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:44 +0000 Subject: [MERGED] osmo-gsm-tester[master]: aoip_smpp: Since recent osmo-msc, we accept all sms in store... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: aoip_smpp: Since recent osmo-msc, we accept all sms in store&forward mode ...................................................................... aoip_smpp: Since recent osmo-msc, we accept all sms in store&forward mode Change-Id: Ieb5656f3ca93f4343441d90e30fbe904382c44e3 --- M suites/aoip_smpp/esme_ms_sms_storeforward.py 1 file changed, 8 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/suites/aoip_smpp/esme_ms_sms_storeforward.py b/suites/aoip_smpp/esme_ms_sms_storeforward.py index 543170e..74765bc 100755 --- a/suites/aoip_smpp/esme_ms_sms_storeforward.py +++ b/suites/aoip_smpp/esme_ms_sms_storeforward.py @@ -38,9 +38,11 @@ hlr.subscriber_add(ms) wrong_msisdn = ms.msisdn + esme.msisdn -print('sending sms with wrong msisdn %s, it will fail' % wrong_msisdn) +print('sending sms with wrong msisdn %s, it will be stored but not delivered' % wrong_msisdn) msg = Sms(esme.msisdn, wrong_msisdn, 'smpp message with wrong dest') -esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_STOREFORWARD) +# Since osmo-msc 1e67fea7ba5c6336, we accept all sms in store&forward mode without looking at HLR +# esme.run_method_expect_failure(SMPP_ESME_RINVDSTADR, esme.sms_send_wait_resp, msg, esme.MSGMODE_STOREFORWARD) +umref_wrong = esme.sms_send_wait_resp(msg, esme.MSGMODE_STOREFORWARD, receipt=True) print('sending sms, it will be stored...') msg = Sms(esme.msisdn, ms.msisdn, 'smpp send not-yet-registered message') @@ -60,4 +62,8 @@ wait(ms.sms_was_received, msg) print('Waiting to receive and consume sms receipt with reference', umref) wait(esme.receipt_was_received, umref) + +print('Asserting the sms with wrong msisdn was not delivered', umref_wrong) +assert not esme.receipt_was_received(umref_wrong) + esme.disconnect() -- To view, visit https://gerrit.osmocom.org/6194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb5656f3ca93f4343441d90e30fbe904382c44e3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Pau Espin Pedrol Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 19:49:48 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 19:49:48 +0000 Subject: [MERGED] osmo-msc[master]: Make sending an SMS to an unknown subscriber B work over SMPP. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Make sending an SMS to an unknown subscriber B work over SMPP. ...................................................................... Make sending an SMS to an unknown subscriber B work over SMPP. Make the submit_to_sms() funcion aware of the message mode. If the message does not require real-time "transactional/forward mode" we can store it in the SMS database even if subscriber B cannot be found in the VLR at this point in time. This should should make the esme_ms_sms_storeforward test in osmo-gsm-tester pass (a tweak to this test's expectations will be needed as well, because the test currently assumes that an invalid phone number for subscriber B will fail immediately, rather than cause the message to eventually expire). Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Related: OS#2354 --- M src/libmsc/smpp_openbsc.c 1 file changed, 9 insertions(+), 3 deletions(-) Approvals: Pau Espin Pedrol: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libmsc/smpp_openbsc.c b/src/libmsc/smpp_openbsc.c index 4e2fb55..b0469f9 100644 --- a/src/libmsc/smpp_openbsc.c +++ b/src/libmsc/smpp_openbsc.c @@ -99,11 +99,12 @@ struct gsm_sms *sms; struct tlv_t *t; int mode; + int can_store_sms = ((submit->esm_class & SMPP34_MSG_MODE_MASK) != 2); /* != forward mode */ dest = subscr_by_dst(net, submit->dest_addr_npi, submit->dest_addr_ton, (const char *)submit->destination_addr); - if (!dest) { + if (!dest && !can_store_sms) { LOGP(DLSMS, LOGL_NOTICE, "SMPP SUBMIT-SM for unknown subscriber: " "%s (NPI=%u)\n", submit->destination_addr, submit->dest_addr_npi); @@ -115,7 +116,8 @@ case TLVID_message_payload: if (smpp34_submit_tlv_msg_payload(t, submit, &sms_msg, &sms_msg_len) < 0) { - vlr_subscr_put(dest); + if (dest) + vlr_subscr_put(dest); return ESME_ROPTPARNOTALLWD; } break; @@ -149,7 +151,11 @@ sms->receiver = dest; sms->dst.ton = submit->dest_addr_ton; sms->dst.npi = submit->dest_addr_npi; - osmo_strlcpy(sms->dst.addr, dest->msisdn, sizeof(sms->dst.addr)); + if (dest) + osmo_strlcpy(sms->dst.addr, dest->msisdn, sizeof(sms->dst.addr)); + else + osmo_strlcpy(sms->dst.addr, (const char *)submit->destination_addr, + sizeof(sms->dst.addr)); /* fill in the source address */ sms->src.ton = submit->source_addr_ton; -- To view, visit https://gerrit.osmocom.org/6192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic3d78919568ad9252b4d19c3ddab5068d1c52db2 Gerrit-PatchSet: 2 Gerrit-Project: osmo-msc Gerrit-Branch: master Gerrit-Owner: Stefan Sperling Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Pau Espin Pedrol From gerrit-no-reply at lists.osmocom.org Wed Jan 31 22:37:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 22:37:28 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: reduce code duplication; add new test case on too short... Message-ID: Review at https://gerrit.osmocom.org/6228 bsc: reduce code duplication; add new test case on too short messages Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185 --- M bsc/BSC_Tests.ttcn M library/L3_Templates.ttcn 2 files changed, 78 insertions(+), 45 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/28/6228/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 08a5510..dee41d2 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -38,6 +38,7 @@ import from Osmocom_CTRL_Adapter all; import from MobileL3_CommonIE_Types all; +import from MobileL3_Types all; import from L3_Templates all; import from GSM_RR_Types all; @@ -1423,22 +1424,24 @@ vc_conn.done; } -/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ -private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { +private function f_est_single_l3(template PDU_ML3_MS_NW l3) runs on MSC_ConnHdlr { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); f_create_chan_and_exp(pars); /* we should now have a COMPL_L3 at the MSC */ BSSAP.receive(tr_BSSMAP_ComplL3); - f_rsl_send_l3(ts_RRM_AssignmentFailure('00'O)); - timer T := 5.0; + /* send the single message we want to send */ + f_rsl_send_l3(l3); +} + +private function f_bssap_expect_nothing(float sec := 5.00) runs on MSC_ConnHdlr { + timer T := sec; + var PDU_BSSAP bssap; T.start; alt { - [] BSSAP.receive(tr_BSSMAP_AssignmentFail) { - setverdict(fail, "Unexpeted BSSMAP Assignment Failure"); - } - [] BSSAP.receive(tr_BSSMAP_ClearRequest) { - setverdict(fail, "Unexpected BSSMAP Clear Requst"); + [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { + setverdict(fail, "Unexpected BSSMAP ", bssap); + self.stop; } [] T.timeout { setverdict(pass); @@ -1446,6 +1449,11 @@ } } +/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { + f_est_single_l3(ts_RRM_AssignmentFailure('00'O)); + f_bssap_expect_nothing(); +} testcase TC_unsol_ass_fail() runs on test_CT { var MSC_ConnHdlr vc_conn; f_init(1, true); @@ -1457,25 +1465,8 @@ /* unsolicited ASSIGNMENT COMPLETE (without ASSIGN) from MS shouldn't bring BSC down */ private function f_tc_unsol_ass_compl(charstring id) runs on MSC_ConnHdlr { - var TestHdlrParams pars := valueof(t_def_TestHdlrPars); - f_create_chan_and_exp(pars); - /* we should now have a COMPL_L3 at the MSC */ - BSSAP.receive(tr_BSSMAP_ComplL3); - - f_rsl_send_l3(ts_RRM_AssignmentComplete('00'O)); - timer T := 5.0; - T.start; - alt { - [] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { - setverdict(fail, "Unexpeted BSSMAP Assignment Complet"); - } - [] BSSAP.receive { - setverdict(fail, "Unexpected BSSAP"); - } - [] T.timeout { - setverdict(pass); - } - } + f_est_single_l3(ts_RRM_AssignmentComplete('00'O)); + f_bssap_expect_nothing(); } testcase TC_unsol_ass_compl() runs on test_CT { var MSC_ConnHdlr vc_conn; @@ -1488,29 +1479,34 @@ /* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { - var TestHdlrParams pars := valueof(t_def_TestHdlrPars); - f_create_chan_and_exp(pars); - /* we should now have a COMPL_L3 at the MSC */ - BSSAP.receive(tr_BSSMAP_ComplL3); - - f_rsl_send_l3(ts_RRM_HandoverFailure('00'O)); - timer T := 5.0; - T.start; - alt { - [] BSSAP.receive { - setverdict(fail, "Unexpected BSSMAP"); - } - [] T.timeout { - setverdict(pass); - } - } + f_est_single_l3(ts_RRM_HandoverFailure('00'O)); + f_bssap_expect_nothing(); } - testcase TC_unsol_ho_fail() runs on test_CT { var MSC_ConnHdlr vc_conn; f_init(1, true); f_sleep(1.0); vc_conn := f_start_handler(refers(f_tc_unsol_ho_fail), testcasename()); + vc_conn.done; +} + + +/* short message from MS should be ignored */ +private function f_tc_err_82_short_msg(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + /* send short message */ + RSL.send(ts_RSL_DATA_IND(g_chan_nr, valueof(ts_RslLinkID_DCCH(0)), ''O)); + f_bssap_expect_nothing(); +} +testcase TC_err_82_short_msg() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_err_82_short_msg), testcasename()); vc_conn.done; } @@ -1582,6 +1578,7 @@ execute( TC_unsol_ass_fail() ); execute( TC_unsol_ass_compl() ); execute( TC_unsol_ho_fail() ); + execute( TC_err_82_short_msg() ); } } diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 948565d..47e1f62 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -349,6 +349,42 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + uplinkRelease := { + messageType := '00001110'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} + +template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + rR_Status := { + messageType := '00010010'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} + + + template PDU_ML3_MS_NW ts_ML3_MO := { discriminator := '0000'B, tiOrSkip := { -- To view, visit https://gerrit.osmocom.org/6228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 22:37:28 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 22:37:28 +0000 Subject: [PATCH] osmo-ttcn3-hacks[master]: bsc: Add TC_err_84_unknown_msg to check if unknown RR messag... Message-ID: Review at https://gerrit.osmocom.org/6229 bsc: Add TC_err_84_unknown_msg to check if unknown RR message triggers RR STATUS ... as declared in TS 24.008 Section 8.4 Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a --- M bsc/BSC_Tests.ttcn 1 file changed, 22 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/29/6229/1 diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index dee41d2..24df03f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1511,6 +1511,27 @@ } +/* 24.008 8.4 Unknown message must trigger RR STATUS */ +private function f_tc_err_84_unknown_msg(charstring id) runs on MSC_ConnHdlr { + f_est_single_l3(ts_RRM_UL_REL('00'O)); + timer T := 3.0 + alt { + [] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, decmatch tr_RRM_RR_STATUS)) { + setverdict(pass); + } + [] BSSAP.receive { setverdict(fail, "unexpected BSSAP"); } + [] T.timeout { setverdict(inconc); } + } +} +testcase TC_err_84_unknown_msg() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_err_84_unknown_msg), testcasename()); + vc_conn.done; +} + + control { /* CTRL interface testing */ @@ -1579,6 +1600,7 @@ execute( TC_unsol_ass_compl() ); execute( TC_unsol_ho_fail() ); execute( TC_err_82_short_msg() ); + execute( TC_err_84_unknown_msg() ); } } -- To view, visit https://gerrit.osmocom.org/6229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:16:58 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 31 Jan 2018 23:16:58 +0000 Subject: [PATCH] osmo-gsm-tester[master]: Create a cumulative distribution function class Message-ID: Review at https://gerrit.osmocom.org/6230 Create a cumulative distribution function class We are using the CDF to decide which percentage of the jobs should be running at a given point. The x-axis is time and the y-axis the percentage of how many jobs should be running. There are three functions to do this. The first one is a constant which would result in everything being started right now, one to start them linearly and the last (formula from Qt/3rdparty) to first accelerate and decelerate slowly. Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3 --- A src/osmo_ms_driver/__init__.py A src/osmo_ms_driver/cdf.py 2 files changed, 197 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/30/6230/1 diff --git a/src/osmo_ms_driver/__init__.py b/src/osmo_ms_driver/__init__.py new file mode 100644 index 0000000..d3c1590 --- /dev/null +++ b/src/osmo_ms_driver/__init__.py @@ -0,0 +1,29 @@ +# osmo_gsm_tester: automated cellular network hardware tests +# +# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH +# +# Authors: D. Lazlo Sitzer +# 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 . + +__version__ = 'UNKNOWN' + +try: + from ._version import _version + __version__ = _version +except: + pass + +# vim: expandtab tabstop=4 shiftwidth=4 diff --git a/src/osmo_ms_driver/cdf.py b/src/osmo_ms_driver/cdf.py new file mode 100644 index 0000000..fbdc05f --- /dev/null +++ b/src/osmo_ms_driver/cdf.py @@ -0,0 +1,168 @@ +# osmo_ms_driver: A cumululative distribution function class. +# Help to start processes over time. +# +# Copyright (C) 2018 by Holger Hans Peter Freyther +# +# 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 . + + +from datetime import timedelta + +import math + +class DistributionFunctionHandler(object): + """ + The goal is to start n "mobile" processes. We like to see some + conflicts (RACH bursts being ignored) but starting n processes + at the same time is not a realistic model. + We use the concept of cumulative distribution function here. On + the x-axis we have time (maybe in steps of 10ms) and on the + y-axis we have the percentage (from 0.0 to 1.0) of how many + processes should run at the given time. + """ + + def __init__(self, step, fun): + self._step = step + self._fun = fun + self._x = 0.0 + self._y = self._fun(self._x) + + def is_done(self): + return self._y >= 1.0 + + def current_value(self): + return self._y + + def step_once(self): + self._x = self._x + self._step.total_seconds() + self._y = self._fun(self._x) + + +def immediate(step_size=timedelta(milliseconds=20)): + """ + Reaches 100% at the first step. + + Example: + >>> a = immediate() + >>> a.is_done() + True + >>> a.current_value() + 1 + """ + return DistributionFunctionHandler(step_size, lambda x: 1) + +def linear_with_slope(slope, step_size=timedelta(milliseconds=20)): + """ + Use the slope and step size you want + """ + return DistributionFunctionHandler(step_size, lambda x: slope*x) + +def linear_with_duration(duration, step_size=timedelta(milliseconds=20)): + """ + Linear progression that reaches 100% after duration.total_seconds() + >>> a = linear_with_duration(timedelta(seconds=10), step_size=timedelta(seconds=2)) + >>> a.is_done() + False + >>> a.current_value() + 0.0 + >>> a.step_once() + >>> a.current_value() + 0.2 + >>> a.step_once() + >>> a.current_value() + 0.4 + >>> a.step_once() + >>> a.current_value() + 0.6... + >>> a.step_once() + >>> a.current_value() + 0.8... + >>> a.is_done() + False + >>> a.step_once() + >>> a.current_value() + 1.0... + >>> a.is_done() + True + """ + slope = 1.0/duration.total_seconds() + return linear_with_slope(slope, step_size) + +def _in_out(x): + """ + Internal in/out function inspired by Qt + + >>> _in_out(0.5) + 0.5... + >>> _in_out(0.75) + 0.875... + >>> _in_out(0.8) + 0.92... + >>> _in_out(0.85) + 0.955... + >>> _in_out(1.0) + 1.0... + """ + assert x <= 1.0 + # Needs to be between 0..1 and increase first + if x < 0.5: + return (x*x) * 2 + # deaccelerate now. in_out(0.5) == 0.5, in_out(1.0) == 1.0 + x = x * 2 - 1 + return -0.5 * (x*(x-2)- 1) + +def ease_in_out_duration(duration, step_size=timedelta(milliseconds=20)): + """ + Example invocation + + >>> a = ease_in_out_duration(duration=timedelta(seconds=20), step_size=timedelta(seconds=5)) + >>> a.is_done() + False + >>> a.current_value() + 0.0 + + >>> a.step_once() + >>> a._x + 5.0 + >>> a.current_value() + 0.125 + >>> a.is_done() + False + + >>> a.step_once() + >>> a._x + 10.0 + >>> a.current_value() + 0.5 + >>> a.is_done() + False + + >>> a.step_once() + >>> a._x + 15.0 + >>> a.current_value() + 0.875 + >>> a.is_done() + False + + >>> a.step_once() + >>> a._x + 20.0 + >>> a.current_value() + 1.0 + >>> a.is_done() + True + """ + scale = 1.0/duration.total_seconds() + return DistributionFunctionHandler(step_size, lambda x: _in_out(x*scale)) -- To view, visit https://gerrit.osmocom.org/6230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:16:58 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 31 Jan 2018 23:16:58 +0000 Subject: [PATCH] osmo-gsm-tester[master]: cdf: Add API to scale percent to target value Message-ID: Review at https://gerrit.osmocom.org/6231 cdf: Add API to scale percent to target value We want to start 10k of instances and it is easier to have the necessary conversion from percent to number in the CDF function. Change-Id: I9d5b63909eef3d592aec6d51452f3b1811d8cc07 --- M src/osmo_ms_driver/cdf.py 1 file changed, 48 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/31/6231/1 diff --git a/src/osmo_ms_driver/cdf.py b/src/osmo_ms_driver/cdf.py index fbdc05f..e84d9c7 100644 --- a/src/osmo_ms_driver/cdf.py +++ b/src/osmo_ms_driver/cdf.py @@ -37,12 +37,22 @@ self._fun = fun self._x = 0.0 self._y = self._fun(self._x) + self._target = 1.0 + + def set_target(self, scale): + """ + Scale the percentage to the target value.. + """ + self._target = scale def is_done(self): return self._y >= 1.0 def current_value(self): return self._y + + def current_scaled_value(self): + return self._y * self._target def step_once(self): self._x = self._x + self._step.total_seconds() @@ -95,6 +105,44 @@ 1.0... >>> a.is_done() True + + >>> a = linear_with_duration(timedelta(seconds=10), step_size=timedelta(seconds=2)) + >>> a.set_target(1000) + >>> a.is_done() + False + >>> a.current_value() + 0.0 + >>> a.current_scaled_value() + 0.0 + >>> a.step_once() + >>> a.current_value() + 0.2 + >>> a.current_scaled_value() + 200.0 + >>> a.step_once() + >>> a.current_value() + 0.4 + >>> a.current_scaled_value() + 400.0 + >>> a.step_once() + >>> a.current_value() + 0.6... + >>> a.current_scaled_value() + 600.0... + >>> a.step_once() + >>> a.current_value() + 0.8... + >>> a.current_scaled_value() + 800.0... + >>> a.is_done() + False + >>> a.step_once() + >>> a.current_value() + 1.0... + >>> a.current_scaled_value() + 1000.0... + >>> a.is_done() + True """ slope = 1.0/duration.total_seconds() return linear_with_slope(slope, step_size) -- To view, visit https://gerrit.osmocom.org/6231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9d5b63909eef3d592aec6d51452f3b1811d8cc07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:16:59 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 31 Jan 2018 23:16:59 +0000 Subject: [PATCH] osmo-gsm-tester[master]: WIP.. add example test script and support library Message-ID: Review at https://gerrit.osmocom.org/6232 WIP.. add example test script and support library Change-Id: Ica5aa0c2f86d0e5d8a2bc4dc0652de18762dd156 --- A src/osmo_ms_driver/lua/json.lua A src/osmo_ms_driver/lua/ms_support.lua A src/osmo_ms_driver/templates/ms_lu_test.lua.tmpl 3 files changed, 426 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/32/6232/1 diff --git a/src/osmo_ms_driver/lua/json.lua b/src/osmo_ms_driver/lua/json.lua new file mode 100644 index 0000000..dda6193 --- /dev/null +++ b/src/osmo_ms_driver/lua/json.lua @@ -0,0 +1,380 @@ +-- +-- json.lua +-- +-- Copyright (c) 2015 rxi +-- +-- This library is free software; you can redistribute it and/or modify it +-- under the terms of the MIT license. See LICENSE for details. +-- + +local json = { _version = "0.1.0" } + +------------------------------------------------------------------------------- +-- Encode +------------------------------------------------------------------------------- + +local encode + +local escape_char_map = { + [ "\\" ] = "\\\\", + [ "\"" ] = "\\\"", + [ "\b" ] = "\\b", + [ "\f" ] = "\\f", + [ "\n" ] = "\\n", + [ "\r" ] = "\\r", + [ "\t" ] = "\\t", +} + +local escape_char_map_inv = { [ "\\/" ] = "/" } +for k, v in pairs(escape_char_map) do + escape_char_map_inv[v] = k +end + + +local function escape_char(c) + return escape_char_map[c] or string.format("\\u%04x", c:byte()) +end + + +local function encode_nil(val) + return "null" +end + + +local function encode_table(val, stack) + local res = {} + stack = stack or {} + + -- Circular reference? + if stack[val] then error("circular reference") end + + stack[val] = true + + if val[1] ~= nil or next(val) == nil then + -- Treat as array -- check keys are valid and it is not sparse + local n = 0 + for k in pairs(val) do + if type(k) ~= "number" then + error("invalid table: mixed or invalid key types") + end + n = n + 1 + end + if n ~= #val then + error("invalid table: sparse array") + end + -- Encode + for i, v in ipairs(val) do + table.insert(res, encode(v, stack)) + end + stack[val] = nil + return "[" .. table.concat(res, ",") .. "]" + + else + -- Treat as an object + for k, v in pairs(val) do + if type(k) ~= "string" then + error("invalid table: mixed or invalid key types") + end + table.insert(res, encode(k, stack) .. ":" .. encode(v, stack)) + end + stack[val] = nil + return "{" .. table.concat(res, ",") .. "}" + end +end + + +local function encode_string(val) + return '"' .. val:gsub('[%z\1-\31\\"]', escape_char) .. '"' +end + + +local function encode_number(val) + -- Check for NaN, -inf and inf + if val ~= val or val <= -math.huge or val >= math.huge then + error("unexpected number value '" .. tostring(val) .. "'") + end + return string.format("%.14g", val) +end + + +local type_func_map = { + [ "nil" ] = encode_nil, + [ "table" ] = encode_table, + [ "string" ] = encode_string, + [ "number" ] = encode_number, + [ "boolean" ] = tostring, +} + + +encode = function(val, stack) + local t = type(val) + local f = type_func_map[t] + if f then + return f(val, stack) + end + error("unexpected type '" .. t .. "'") +end + + +function json.encode(val) + return ( encode(val) ) +end + + +------------------------------------------------------------------------------- +-- Decode +------------------------------------------------------------------------------- + +local parse + +local function create_set(...) + local res = {} + for i = 1, select("#", ...) do + res[ select(i, ...) ] = true + end + return res +end + +local space_chars = create_set(" ", "\t", "\r", "\n") +local delim_chars = create_set(" ", "\t", "\r", "\n", "]", "}", ",") +local escape_chars = create_set("\\", "/", '"', "b", "f", "n", "r", "t", "u") +local literals = create_set("true", "false", "null") + +local literal_map = { + [ "true" ] = true, + [ "false" ] = false, + [ "null" ] = nil, +} + + +local function next_char(str, idx, set, negate) + for i = idx, #str do + if set[str:sub(i, i)] ~= negate then + return i + end + end + return #str + 1 +end + + +local function decode_error(str, idx, msg) + local line_count = 1 + local col_count = 1 + for i = 1, idx - 1 do + col_count = col_count + 1 + if str:sub(i, i) == "\n" then + line_count = line_count + 1 + col_count = 1 + end + end + error( string.format("%s at line %d col %d", msg, line_count, col_count) ) +end + + +local function codepoint_to_utf8(n) + -- http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=iws-appendixa + local f = math.floor + if n <= 0x7f then + return string.char(n) + elseif n <= 0x7ff then + return string.char(f(n / 64) + 192, n % 64 + 128) + elseif n <= 0xffff then + return string.char(f(n / 4096) + 224, f(n % 4096 / 64) + 128, n % 64 + 128) + elseif n <= 0x10ffff then + return string.char(f(n / 262144) + 240, f(n % 262144 / 4096) + 128, + f(n % 4096 / 64) + 128, n % 64 + 128) + end + error( string.format("invalid unicode codepoint '%x'", n) ) +end + + +local function parse_unicode_escape(s) + local n1 = tonumber( s:sub(3, 6), 16 ) + local n2 = tonumber( s:sub(9, 12), 16 ) + -- Surrogate pair? + if n2 then + return codepoint_to_utf8((n1 - 0xd800) * 0x400 + (n2 - 0xdc00) + 0x10000) + else + return codepoint_to_utf8(n1) + end +end + + +local function parse_string(str, i) + local has_unicode_escape = false + local has_surrogate_escape = false + local has_escape = false + local last + for j = i + 1, #str do + local x = str:byte(j) + + if x < 32 then + decode_error(str, j, "control character in string") + end + + if last == 92 then -- "\\" (escape char) + if x == 117 then -- "u" (unicode escape sequence) + local hex = str:sub(j + 1, j + 5) + if not hex:find("%x%x%x%x") then + decode_error(str, j, "invalid unicode escape in string") + end + if hex:find("^[dD][89aAbB]") then + has_surrogate_escape = true + else + has_unicode_escape = true + end + else + local c = string.char(x) + if not escape_chars[c] then + decode_error(str, j, "invalid escape char '" .. c .. "' in string") + end + has_escape = true + end + last = nil + + elseif x == 34 then -- '"' (end of string) + local s = str:sub(i + 1, j - 1) + if has_surrogate_escape then + s = s:gsub("\\u[dD][89aAbB]..\\u....", parse_unicode_escape) + end + if has_unicode_escape then + s = s:gsub("\\u....", parse_unicode_escape) + end + if has_escape then + s = s:gsub("\\.", escape_char_map_inv) + end + return s, j + 1 + + else + last = x + end + end + decode_error(str, i, "expected closing quote for string") +end + + +local function parse_number(str, i) + local x = next_char(str, i, delim_chars) + local s = str:sub(i, x - 1) + local n = tonumber(s) + if not n then + decode_error(str, i, "invalid number '" .. s .. "'") + end + return n, x +end + + +local function parse_literal(str, i) + local x = next_char(str, i, delim_chars) + local word = str:sub(i, x - 1) + if not literals[word] then + decode_error(str, i, "invalid literal '" .. word .. "'") + end + return literal_map[word], x +end + + +local function parse_array(str, i) + local res = {} + local n = 1 + i = i + 1 + while 1 do + local x + i = next_char(str, i, space_chars, true) + -- Empty / end of array? + if str:sub(i, i) == "]" then + i = i + 1 + break + end + -- Read token + x, i = parse(str, i) + res[n] = x + n = n + 1 + -- Next token + i = next_char(str, i, space_chars, true) + local chr = str:sub(i, i) + i = i + 1 + if chr == "]" then break end + if chr ~= "," then decode_error(str, i, "expected ']' or ','") end + end + return res, i +end + + +local function parse_object(str, i) + local res = {} + i = i + 1 + while 1 do + local key, val + i = next_char(str, i, space_chars, true) + -- Empty / end of object? + if str:sub(i, i) == "}" then + i = i + 1 + break + end + -- Read key + if str:sub(i, i) ~= '"' then + decode_error(str, i, "expected string for key") + end + key, i = parse(str, i) + -- Read ':' delimiter + i = next_char(str, i, space_chars, true) + if str:sub(i, i) ~= ":" then + decode_error(str, i, "expected ':' after key") + end + i = next_char(str, i + 1, space_chars, true) + -- Read value + val, i = parse(str, i) + -- Set + res[key] = val + -- Next token + i = next_char(str, i, space_chars, true) + local chr = str:sub(i, i) + i = i + 1 + if chr == "}" then break end + if chr ~= "," then decode_error(str, i, "expected '}' or ','") end + end + return res, i +end + + +local char_func_map = { + [ '"' ] = parse_string, + [ "0" ] = parse_number, + [ "1" ] = parse_number, + [ "2" ] = parse_number, + [ "3" ] = parse_number, + [ "4" ] = parse_number, + [ "5" ] = parse_number, + [ "6" ] = parse_number, + [ "7" ] = parse_number, + [ "8" ] = parse_number, + [ "9" ] = parse_number, + [ "-" ] = parse_number, + [ "t" ] = parse_literal, + [ "f" ] = parse_literal, + [ "n" ] = parse_literal, + [ "[" ] = parse_array, + [ "{" ] = parse_object, +} + + +parse = function(str, idx) + local chr = str:sub(idx, idx) + local f = char_func_map[chr] + if f then + return f(str, idx) + end + decode_error(str, idx, "unexpected character '" .. chr .. "'") +end + + +function json.decode(str) + if type(str) ~= "string" then + error("expected argument of type string, got " .. type(str)) + end + return ( parse(str, next_char(str, 1, space_chars, true)) ) +end + + +return json diff --git a/src/osmo_ms_driver/lua/ms_support.lua b/src/osmo_ms_driver/lua/ms_support.lua new file mode 100644 index 0000000..f050b1b --- /dev/null +++ b/src/osmo_ms_driver/lua/ms_support.lua @@ -0,0 +1,31 @@ +require("json") +socket = require("socket") +socket.unix = require("socket.unix") + +local g_c = socket.unix.dgram() +local g_ms = nil + +local mod = {} + +-- Register the MS instance with the system +function mod.register(ms, path) + g_ms = ms + + g_c:connect(path) + + local event = {} + event['ms'] = g_ms + event['type'] = 'register' + g_c:write(json.encode(event)) +end + +-- Send an event +function mod.send(data) + local event = {} + event['ms'] = g_ms + event['type'] = 'event' + event['data'] = data + c:write(json.encode(event)) +end + +return mod diff --git a/src/osmo_ms_driver/templates/ms_lu_test.lua.tmpl b/src/osmo_ms_driver/templates/ms_lu_test.lua.tmpl new file mode 100644 index 0000000..39072bb --- /dev/null +++ b/src/osmo_ms_driver/templates/ms_lu_test.lua.tmpl @@ -0,0 +1,15 @@ +event = require('ms_support') + +function mm_cb(new_state, new_substate, old_substate) + if new_state == 19 and new_substate == 1 then + event.send({"lu_done"=1}) + end +end + +local cbs = { + Mm=mm_cb +} +osmo.ms():register(cbs) +osmo.ms().start() + +event.register(osmo.ms():number(), "${test.event_path}") -- To view, visit https://gerrit.osmocom.org/6232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ica5aa0c2f86d0e5d8a2bc4dc0652de18762dd156 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:16:59 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 31 Jan 2018 23:16:59 +0000 Subject: [PATCH] osmo-gsm-tester[master]: WIP.. use gerrit as backup Message-ID: Review at https://gerrit.osmocom.org/6233 WIP.. use gerrit as backup Change-Id: Ifff16c72e301236636f80de44a8564f772966ab7 --- A src/osmo_ms_driver/README A src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/cdf.py A src/osmo_ms_driver/event_server.py A src/osmo_ms_driver/server.py A src/osmo_ms_driver/starter.py A src/osmo_ms_driver/ul_test.py 7 files changed, 230 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/33/6233/1 diff --git a/src/osmo_ms_driver/README b/src/osmo_ms_driver/README new file mode 100644 index 0000000..0b3a010 --- /dev/null +++ b/src/osmo_ms_driver/README @@ -0,0 +1,6 @@ + +* Test. E.g. LU test + * Test lua script repeated n-times + * Success criteria definition + * Event handling + diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py new file mode 100644 index 0000000..e6bc45f --- /dev/null +++ b/src/osmo_ms_driver/__main__.py @@ -0,0 +1,60 @@ +# osmo_ms_driver: Main test runner +# +# Copyright (C) 2018 by Holger Hans Peter Freyther +# +# 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 . + +# Local modules +from .event_server import EventServer +from .ul_test import MassUpdateLocationTest +from .cdf import ease_in_out_duration + +# System modules +import datetime +import asyncio + + +# TODO: Parse parameters and test composition. Right now we test +# with a single set of values. + +num_ms = 10 + +# How long should starting all apps take +time_start=datetime.timedelta(seconds=60) +# In which steps to start processes +time_step=datetime.timedelta(milliseconds=100) +# Event server path +event_server_path="osmo_ms_driver.unix" + + +# The function that decides when to start something +cdf = ease_in_out_duration(time_start, time_step) + +ev_loop = asyncio.get_event_loop() + +# Event server to handle MS->test events +ev_server = EventServer("ev_server", event_server_path) +ev_server.listen(ev_loop) + +# Just a single test for now. +test = MassUpdateLocationTest("lu_test", num_ms, cdf, ev_server) + +# Run until everything has been launched +ev_loop.run_until_complete(test.run(ev_loop)) + +# Wait for it to complete +ev_loop.run_until_complete(test.complete()) +test.stop_all() + +# TODO: do the analysis diff --git a/src/osmo_ms_driver/cdf.py b/src/osmo_ms_driver/cdf.py index e84d9c7..8aa06e9 100644 --- a/src/osmo_ms_driver/cdf.py +++ b/src/osmo_ms_driver/cdf.py @@ -19,8 +19,6 @@ from datetime import timedelta -import math - class DistributionFunctionHandler(object): """ The goal is to start n "mobile" processes. We like to see some @@ -39,6 +37,9 @@ self._y = self._fun(self._x) self._target = 1.0 + def step_size(self): + return self._step + def set_target(self, scale): """ Scale the percentage to the target value.. diff --git a/src/osmo_ms_driver/event_server.py b/src/osmo_ms_driver/event_server.py new file mode 100644 index 0000000..41aa94d --- /dev/null +++ b/src/osmo_ms_driver/event_server.py @@ -0,0 +1,31 @@ + +import socket +import os + +from osmo_gsm_tester import log + +import asyncio + +class MSConnection(asyncio.Protocol, log.Origin): + def __init__(self): + super().__init__(log.C_RUN, "MSConnection") + + def connection_made(self, transport): + # TODO: Update the name once we know the MS. + pass + + def data_received(self, read): + # TODO: Update the name once we know the MS. + pass + +class EventServer(log.Origin): + def __init__(self, name, path): + super().__init__(log.C_RUN, name) + self._path = path + self._handlers = [] + + def register(self, cb): + self._handlers.append(cb) + + def listen(self, loop): + self._server = loop.create_unix_server(lambda: MSConnection(self), self._path) diff --git a/src/osmo_ms_driver/server.py b/src/osmo_ms_driver/server.py new file mode 100644 index 0000000..7486d20 --- /dev/null +++ b/src/osmo_ms_driver/server.py @@ -0,0 +1,3 @@ +# WIP... + +import asyncio diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py new file mode 100644 index 0000000..28b2cc8 --- /dev/null +++ b/src/osmo_ms_driver/starter.py @@ -0,0 +1,48 @@ +# osmo_ms_driver: Starter for processes +# Help to start processes over time. +# +# Copyright (C) 2018 by Holger Hans Peter Freyther +# +# 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 . + +from osmo_gsm_tester import log, template, process + +import asyncio + +class Launcher(log.Origin): + """ + I launch an OsmocomBB mobile and the virtphy. In the future we + might want to test with real phones and then don't launch the + virtphy. This needs to be handled once we move to bare iron. + + >>> Launcher("osmo-ms/0000", "mobile", "mobile.tmpl", {}) + osmo-ms/0000 + """ + def __init__(self, name, lua_tmpl, cfg_tmpl, options): + super().__init__(log.C_RUN, name) + self._lua_template = lua_tmpl + self._cfg_template = cfg_tmpl + self._options = options + + def start(self, loop): + self.log("Starting mobile and virtphy") + #process = asyncio.create_subprocess_exec([binary]) + pass + + def kill(self): + """Clean up things.""" + if self._vphy_proc: + self._vphy_proc.kill() + if self._omob_proc: + self._omob_proc.kill() diff --git a/src/osmo_ms_driver/ul_test.py b/src/osmo_ms_driver/ul_test.py new file mode 100644 index 0000000..ebbcb87 --- /dev/null +++ b/src/osmo_ms_driver/ul_test.py @@ -0,0 +1,79 @@ +# osmo_ms_driver: Starter for processes +# Help to start processes over time. +# +# Copyright (C) 2018 by Holger Hans Peter Freyther +# +# 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 . + + +from osmo_gsm_tester import log +from .starter import Launcher + +import asyncio + +class MassUpdateLocationTest(log.Origin): + """ + A test to launch a configurable amount of MS and make them + execute a Location Updating Procedure. + + Configure the number of MS to be tested and a function that + decides how quickly to start them and a timeout. + """ + + TEMPLATE_LUA = "ms_lu_test.lua.tmpl" + TEMPLATE_CFG = "ms_lu_test.cfg.tmpl" + + def __init__(self, name, number_of_ms, cdf_function, event_server): + super().__init__(log.C_RUN, name) + self._number_of_ms = number_of_ms + self._cdf = cdf_function + self._cdf.set_target(number_of_ms) + self._unstarted = [] + options = {} + for i in range(0, number_of_ms): + ms_name = "osmo-ms-lu-test/%.5d" % i + launcher = Launcher(ms_name, self.TEMPLATE_LUA, + self.TEMPLATE_CFG, options) + self._unstarted.append(launcher) + self._event_server = event_server + self._event_server.register(self) + + async def run(self, loop): + self._started = [] + + while len(self._unstarted) > 0: + # Check for timeout + # start pending MS + while len(self._started) < self._cdf.current_scaled_value(): + ms = self._unstarted.pop(0) + ms.start(loop) + self._started.append(ms) + + # Progress and sleep + self._cdf.step_once() + await asyncio.sleep(self._cdf.step_size().total_seconds()) + + print("All started...") + + def stop_all(self): + for launcher in self._started: + launcher.kill() + + def on_event(self, launcher, status): + # We got a message from the MS + pass + + def on_process_end(self, launcher): + pass + -- To view, visit https://gerrit.osmocom.org/6233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifff16c72e301236636f80de44a8564f772966ab7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:16:59 2018 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 31 Jan 2018 23:16:59 +0000 Subject: [PATCH] osmo-gsm-tester[master]: WIP.. figure out asyncio.. Message-ID: Review at https://gerrit.osmocom.org/6234 WIP.. figure out asyncio.. Change-Id: If00263c251d7f5ff3b33bf4fadbfcc4bf53bb0f2 --- A TODO M src/osmo_ms_driver/__main__.py M src/osmo_ms_driver/event_server.py M src/osmo_ms_driver/starter.py M src/osmo_ms_driver/ul_test.py 5 files changed, 29 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-tester refs/changes/34/6234/1 diff --git a/TODO b/TODO new file mode 100644 index 0000000..67238c3 --- /dev/null +++ b/TODO @@ -0,0 +1,3 @@ +* Somehow even if it should take 60s.. it takes 120s to start. +Maybe my math is wrong.. or it is clock drift.. + diff --git a/src/osmo_ms_driver/__main__.py b/src/osmo_ms_driver/__main__.py index e6bc45f..aa537f0 100644 --- a/src/osmo_ms_driver/__main__.py +++ b/src/osmo_ms_driver/__main__.py @@ -18,7 +18,7 @@ # Local modules from .event_server import EventServer from .ul_test import MassUpdateLocationTest -from .cdf import ease_in_out_duration +from .cdf import ease_in_out_duration, linear_with_duration # System modules import datetime @@ -28,24 +28,25 @@ # TODO: Parse parameters and test composition. Right now we test # with a single set of values. -num_ms = 10 +num_ms = 1000 # How long should starting all apps take -time_start=datetime.timedelta(seconds=60) +time_start=datetime.timedelta(seconds=120) # In which steps to start processes -time_step=datetime.timedelta(milliseconds=100) +time_step=datetime.timedelta(milliseconds=50) # Event server path -event_server_path="osmo_ms_driver.unix" +event_server_path="/tmp/osmo_ms_driver.unix" # The function that decides when to start something cdf = ease_in_out_duration(time_start, time_step) +cdf = linear_with_duration(time_start, time_step) ev_loop = asyncio.get_event_loop() # Event server to handle MS->test events ev_server = EventServer("ev_server", event_server_path) -ev_server.listen(ev_loop) +asyncio.ensure_future(ev_server.listen(ev_loop)) # Just a single test for now. test = MassUpdateLocationTest("lu_test", num_ms, cdf, ev_server) @@ -55,6 +56,6 @@ # Wait for it to complete ev_loop.run_until_complete(test.complete()) -test.stop_all() +ev_loop.run_until_complete(test.stop_all()) # TODO: do the analysis diff --git a/src/osmo_ms_driver/event_server.py b/src/osmo_ms_driver/event_server.py index 41aa94d..60d526b 100644 --- a/src/osmo_ms_driver/event_server.py +++ b/src/osmo_ms_driver/event_server.py @@ -1,22 +1,22 @@ +from osmo_gsm_tester import log +from functools import partial + +import asyncio import socket import os -from osmo_gsm_tester import log - -import asyncio class MSConnection(asyncio.Protocol, log.Origin): - def __init__(self): + def __init__(self, parent): super().__init__(log.C_RUN, "MSConnection") def connection_made(self, transport): # TODO: Update the name once we know the MS. - pass + self._transport = transport def data_received(self, read): - # TODO: Update the name once we know the MS. - pass + print("Data...") class EventServer(log.Origin): def __init__(self, name, path): @@ -27,5 +27,6 @@ def register(self, cb): self._handlers.append(cb) + @asyncio.coroutine def listen(self, loop): - self._server = loop.create_unix_server(lambda: MSConnection(self), self._path) + self._server = yield from loop.create_unix_server(partial(MSConnection, self), self._path) diff --git a/src/osmo_ms_driver/starter.py b/src/osmo_ms_driver/starter.py index 28b2cc8..da2774f 100644 --- a/src/osmo_ms_driver/starter.py +++ b/src/osmo_ms_driver/starter.py @@ -35,10 +35,11 @@ self._cfg_template = cfg_tmpl self._options = options + @asyncio.coroutine def start(self, loop): self.log("Starting mobile and virtphy") - #process = asyncio.create_subprocess_exec([binary]) - pass + self._vphy_proc = yield from asyncio.create_subprocess_exec("sleep", "90") + self._omob_proc = yield from asyncio.create_subprocess_exec("sleep", "110") def kill(self): """Clean up things.""" diff --git a/src/osmo_ms_driver/ul_test.py b/src/osmo_ms_driver/ul_test.py index ebbcb87..ca70670 100644 --- a/src/osmo_ms_driver/ul_test.py +++ b/src/osmo_ms_driver/ul_test.py @@ -55,13 +55,17 @@ while len(self._unstarted) > 0: # Check for timeout # start pending MS - while len(self._started) < self._cdf.current_scaled_value(): + #print(self._cdf.current_value()) + while len(self._started) < self._cdf.current_scaled_value() and len(self._unstarted) > 0: + print("Starting...", len(self._started)) ms = self._unstarted.pop(0) - ms.start(loop) + await ms.start(loop) self._started.append(ms) # Progress and sleep self._cdf.step_once() + # The above all took time. So the wall clock and this + # time will tick at different speed. await asyncio.sleep(self._cdf.step_size().total_seconds()) print("All started...") -- To view, visit https://gerrit.osmocom.org/6234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If00263c251d7f5ff3b33bf4fadbfcc4bf53bb0f2 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:36:03 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:36:03 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: reduce code duplication; add new test case on too short... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:36:04 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:36:04 +0000 Subject: osmo-ttcn3-hacks[master]: bsc: Add TC_err_84_unknown_msg to check if unknown RR messag... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:36:07 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: Add TC_err_84_unknown_msg to check if unknown RR messag... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: Add TC_err_84_unknown_msg to check if unknown RR message triggers RR STATUS ...................................................................... bsc: Add TC_err_84_unknown_msg to check if unknown RR message triggers RR STATUS ... as declared in TS 24.008 Section 8.4 Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a --- M bsc/BSC_Tests.ttcn 1 file changed, 22 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index dee41d2..24df03f 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -1511,6 +1511,27 @@ } +/* 24.008 8.4 Unknown message must trigger RR STATUS */ +private function f_tc_err_84_unknown_msg(charstring id) runs on MSC_ConnHdlr { + f_est_single_l3(ts_RRM_UL_REL('00'O)); + timer T := 3.0 + alt { + [] RSL.receive(tr_RSL_DATA_REQ(g_chan_nr, ?, decmatch tr_RRM_RR_STATUS)) { + setverdict(pass); + } + [] BSSAP.receive { setverdict(fail, "unexpected BSSAP"); } + [] T.timeout { setverdict(inconc); } + } +} +testcase TC_err_84_unknown_msg() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_err_84_unknown_msg), testcasename()); + vc_conn.done; +} + + control { /* CTRL interface testing */ @@ -1579,6 +1600,7 @@ execute( TC_unsol_ass_compl() ); execute( TC_unsol_ho_fail() ); execute( TC_err_82_short_msg() ); + execute( TC_err_84_unknown_msg() ); } } -- To view, visit https://gerrit.osmocom.org/6229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4f81b955567d2a33ead350ed312c4c4f6dd7ed8a Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:36:07 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:36:07 +0000 Subject: [MERGED] osmo-ttcn3-hacks[master]: bsc: reduce code duplication; add new test case on too short... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc: reduce code duplication; add new test case on too short messages ...................................................................... bsc: reduce code duplication; add new test case on too short messages Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185 --- M bsc/BSC_Tests.ttcn M library/L3_Templates.ttcn 2 files changed, 78 insertions(+), 45 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn index 08a5510..dee41d2 100644 --- a/bsc/BSC_Tests.ttcn +++ b/bsc/BSC_Tests.ttcn @@ -38,6 +38,7 @@ import from Osmocom_CTRL_Adapter all; import from MobileL3_CommonIE_Types all; +import from MobileL3_Types all; import from L3_Templates all; import from GSM_RR_Types all; @@ -1423,22 +1424,24 @@ vc_conn.done; } -/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ -private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { +private function f_est_single_l3(template PDU_ML3_MS_NW l3) runs on MSC_ConnHdlr { var TestHdlrParams pars := valueof(t_def_TestHdlrPars); f_create_chan_and_exp(pars); /* we should now have a COMPL_L3 at the MSC */ BSSAP.receive(tr_BSSMAP_ComplL3); - f_rsl_send_l3(ts_RRM_AssignmentFailure('00'O)); - timer T := 5.0; + /* send the single message we want to send */ + f_rsl_send_l3(l3); +} + +private function f_bssap_expect_nothing(float sec := 5.00) runs on MSC_ConnHdlr { + timer T := sec; + var PDU_BSSAP bssap; T.start; alt { - [] BSSAP.receive(tr_BSSMAP_AssignmentFail) { - setverdict(fail, "Unexpeted BSSMAP Assignment Failure"); - } - [] BSSAP.receive(tr_BSSMAP_ClearRequest) { - setverdict(fail, "Unexpected BSSMAP Clear Requst"); + [] BSSAP.receive(PDU_BSSAP:?) -> value bssap { + setverdict(fail, "Unexpected BSSMAP ", bssap); + self.stop; } [] T.timeout { setverdict(pass); @@ -1446,6 +1449,11 @@ } } +/* unsolicited ASSIGNMENT FAIL (without ASSIGN) from MS shouldn't bring BSC down */ +private function f_tc_unsol_ass_fail(charstring id) runs on MSC_ConnHdlr { + f_est_single_l3(ts_RRM_AssignmentFailure('00'O)); + f_bssap_expect_nothing(); +} testcase TC_unsol_ass_fail() runs on test_CT { var MSC_ConnHdlr vc_conn; f_init(1, true); @@ -1457,25 +1465,8 @@ /* unsolicited ASSIGNMENT COMPLETE (without ASSIGN) from MS shouldn't bring BSC down */ private function f_tc_unsol_ass_compl(charstring id) runs on MSC_ConnHdlr { - var TestHdlrParams pars := valueof(t_def_TestHdlrPars); - f_create_chan_and_exp(pars); - /* we should now have a COMPL_L3 at the MSC */ - BSSAP.receive(tr_BSSMAP_ComplL3); - - f_rsl_send_l3(ts_RRM_AssignmentComplete('00'O)); - timer T := 5.0; - T.start; - alt { - [] BSSAP.receive(tr_BSSMAP_AssignmentComplete) { - setverdict(fail, "Unexpeted BSSMAP Assignment Complet"); - } - [] BSSAP.receive { - setverdict(fail, "Unexpected BSSAP"); - } - [] T.timeout { - setverdict(pass); - } - } + f_est_single_l3(ts_RRM_AssignmentComplete('00'O)); + f_bssap_expect_nothing(); } testcase TC_unsol_ass_compl() runs on test_CT { var MSC_ConnHdlr vc_conn; @@ -1488,29 +1479,34 @@ /* unsolicited HANDOVER FAIL (without ASSIGN) from MS shouldn't bring BSC down */ private function f_tc_unsol_ho_fail(charstring id) runs on MSC_ConnHdlr { - var TestHdlrParams pars := valueof(t_def_TestHdlrPars); - f_create_chan_and_exp(pars); - /* we should now have a COMPL_L3 at the MSC */ - BSSAP.receive(tr_BSSMAP_ComplL3); - - f_rsl_send_l3(ts_RRM_HandoverFailure('00'O)); - timer T := 5.0; - T.start; - alt { - [] BSSAP.receive { - setverdict(fail, "Unexpected BSSMAP"); - } - [] T.timeout { - setverdict(pass); - } - } + f_est_single_l3(ts_RRM_HandoverFailure('00'O)); + f_bssap_expect_nothing(); } - testcase TC_unsol_ho_fail() runs on test_CT { var MSC_ConnHdlr vc_conn; f_init(1, true); f_sleep(1.0); vc_conn := f_start_handler(refers(f_tc_unsol_ho_fail), testcasename()); + vc_conn.done; +} + + +/* short message from MS should be ignored */ +private function f_tc_err_82_short_msg(charstring id) runs on MSC_ConnHdlr { + var TestHdlrParams pars := valueof(t_def_TestHdlrPars); + f_create_chan_and_exp(pars); + /* we should now have a COMPL_L3 at the MSC */ + BSSAP.receive(tr_BSSMAP_ComplL3); + + /* send short message */ + RSL.send(ts_RSL_DATA_IND(g_chan_nr, valueof(ts_RslLinkID_DCCH(0)), ''O)); + f_bssap_expect_nothing(); +} +testcase TC_err_82_short_msg() runs on test_CT { + var MSC_ConnHdlr vc_conn; + f_init(1, true); + f_sleep(1.0); + vc_conn := f_start_handler(refers(f_tc_err_82_short_msg), testcasename()); vc_conn.done; } @@ -1582,6 +1578,7 @@ execute( TC_unsol_ass_fail() ); execute( TC_unsol_ass_compl() ); execute( TC_unsol_ho_fail() ); + execute( TC_err_82_short_msg() ); } } diff --git a/library/L3_Templates.ttcn b/library/L3_Templates.ttcn index 948565d..47e1f62 100644 --- a/library/L3_Templates.ttcn +++ b/library/L3_Templates.ttcn @@ -349,6 +349,42 @@ } } +template (value) PDU_ML3_MS_NW ts_RRM_UL_REL(OCT1 cause) := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + uplinkRelease := { + messageType := '00001110'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} + +template PDU_ML3_MS_NW tr_RRM_RR_STATUS(template OCT1 cause := ?) := { + discriminator := '0110'B, + tiOrSkip := { + skipIndicator := '0000'B + }, + msgs := { + rrm := { + rR_Status := { + messageType := '00010010'B, + rR_Cause := { + valuePart := cause + } + } + } + } +} + + + template PDU_ML3_MS_NW ts_ML3_MO := { discriminator := '0000'B, tiOrSkip := { -- To view, visit https://gerrit.osmocom.org/6228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8232ee58c14a4358a01b5428ff2b4e559491b185 Gerrit-PatchSet: 1 Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:36:40 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:36:40 +0000 Subject: osmo-mgw[master]: client: fix sdp parameter ordering In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63cac2ebc982ffead92703c22bf68c7aafa7936c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:36:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:36:53 +0000 Subject: osmo-mgw[master]: protocol: check the packetization in local cx options In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I02aaa3042f2a0e32eb4ec6b8753deab7082947a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:01 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:01 +0000 Subject: osmo-mgw[master]: cosmetic: remove spaces from pointer symbol In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:25 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:25 +0000 Subject: osmo-mgw[master]: client: Do not accept endpoint ids with wildcards in responses In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic94bd8c025b7b3eb006b639fecfd7282194e504a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:34 +0000 Subject: osmo-mgw[master]: client: do not accept endpoint ids without @ character in re... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6073419a4b6cdcd31880672564f0861cb4bd02f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:46 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:46 +0000 Subject: osmo-mgw[master]: client: prohibit endpoint ids without @ character In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:51 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:51 +0000 Subject: [MERGED] osmo-mgw[master]: client: prohibit endpoint ids without @ character In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: prohibit endpoint ids without @ character ...................................................................... client: prohibit endpoint ids without @ character The function mgcp_msg_gen() does only check if the user supplied an endpoint name or not. The user may still supply an endpoint name that does not contain the separator (@) character. - Refuse to generate the message if the endpoint name does not contain any @ character. Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 8 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 593d305..efe1d1f 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -862,6 +862,14 @@ msgb_free(msg); return NULL; } + + if (strstr(mgcp_msg->endpoint, "@") == NULL) { + LOGP(DLMGCP, LOGL_ERROR, + "Endpoint name (%s) lacks separator (@), can not generate MGCP message\n", + mgcp_msg->endpoint); + msgb_free(msg); + } + rc += msgb_printf(msg, " %s", mgcp_msg->endpoint); } -- To view, visit https://gerrit.osmocom.org/6221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I92dd1556e4a26b4bef8e1c8c57141552abf988ca Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:52 +0000 Subject: [MERGED] osmo-mgw[master]: client: do not accept endpoint ids without @ character in re... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: do not accept endpoint ids without @ character in responses ...................................................................... client: do not accept endpoint ids without @ character in responses At the moment the client does not check if the endpoint identifier that is returned from the MGW actually contains an @ character. - Check if the endpoint id in the response contains an @ character. Change-Id: I6073419a4b6cdcd31880672564f0861cb4bd02f5 --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index d868c7f..593d305 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -363,6 +363,13 @@ rc = -EINVAL; goto exit; } + + /* A specific endpoint identifier returned by the MGW + * must contain an @ character */ + if (strstr(r->head.endpoint, "@") == NULL) { + rc = -EINVAL; + goto exit; + } break; case 'I': rc = mgcp_parse_head_param(r->head.conn_id, -- To view, visit https://gerrit.osmocom.org/6220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6073419a4b6cdcd31880672564f0861cb4bd02f5 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:52 +0000 Subject: [MERGED] osmo-mgw[master]: client: Do not accept endpoint ids with wildcards in responses In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: Do not accept endpoint ids with wildcards in responses ...................................................................... client: Do not accept endpoint ids with wildcards in responses When the client gets a specific endpoint identifier (Z) in a MGCP response it just accepts the identifier even when it is not specific (contsins wildcard characters). In those cases, the client should refuse to parse the response. - Check for wildcards in endpoint identifiers and stop parsing when check is positive. Change-Id: Ic94bd8c025b7b3eb006b639fecfd7282194e504a --- M src/libosmo-mgcp-client/mgcp_client.c 1 file changed, 7 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 771de45..d868c7f 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -356,6 +356,13 @@ 'Z', line); if (rc) goto exit; + + /* A specific endpoint identifier returned by the MGW + * must not contain any wildcard characters */ + if (strstr(r->head.endpoint, "*") != NULL) { + rc = -EINVAL; + goto exit; + } break; case 'I': rc = mgcp_parse_head_param(r->head.conn_id, -- To view, visit https://gerrit.osmocom.org/6219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic94bd8c025b7b3eb006b639fecfd7282194e504a Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:52 +0000 Subject: [MERGED] osmo-mgw[master]: cosmetic: remove spaces from pointer symbol In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: remove spaces from pointer symbol ...................................................................... cosmetic: remove spaces from pointer symbol Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 --- M include/osmocom/mgcp/mgcp_ep.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/mgcp/mgcp_ep.h b/include/osmocom/mgcp/mgcp_ep.h index e477a47..74b3a9e 100644 --- a/include/osmocom/mgcp/mgcp_ep.h +++ b/include/osmocom/mgcp/mgcp_ep.h @@ -28,9 +28,9 @@ /* Callback type for RTP dispatcher functions (e.g mgcp_dispatch_rtp_bridge_cb, see below) */ -typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in * addr, +typedef int (*mgcp_dispatch_rtp_cb) (int proto, struct sockaddr_in *addr, char *buf, unsigned int buf_size, - struct mgcp_conn * conn); + struct mgcp_conn *conn); /*! MGCP endpoint properties */ struct mgcp_endpoint_type { -- To view, visit https://gerrit.osmocom.org/6007 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id778181a40638bce15c6f085841c35c1895d2602 Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:52 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:52 +0000 Subject: [MERGED] osmo-mgw[master]: protocol: check the packetization in local cx options In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: protocol: check the packetization in local cx options ...................................................................... protocol: check the packetization in local cx options When the local connection options in an MDCX or CRCX request are parsed, then the packetization interval is not checked. - Check if the packetization is a multiple of 20ms see also TTCN3 test: MGCP_Test.TC_crcx_unsupp_packet_intv Change-Id: I02aaa3042f2a0e32eb4ec6b8753deab7082947a0 Related: OS#2654 --- M src/libosmo-mgcp/mgcp_protocol.c 1 file changed, 28 insertions(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 73d7f5e..709c04a 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -396,7 +396,7 @@ * The string is stored in the 'string' field. A NULL string is handled exactly * like an empty string, the 'string' field is never NULL after this function * has been called. */ -static void set_local_cx_options(void *ctx, struct mgcp_lco *lco, +static int set_local_cx_options(void *ctx, struct mgcp_lco *lco, const char *options) { char *p_opt, *a_opt; @@ -420,6 +420,15 @@ LOGP(DLMGCP, LOGL_DEBUG, "local CX options: lco->pkt_period_max: %i, lco->codec: %s\n", lco->pkt_period_max, lco->codec); + + /* Check if the packetization fits the 20ms raster */ + if (lco->pkt_period_min % 20 && lco->pkt_period_max % 20) { + LOGP(DLMGCP, LOGL_ERROR, + "local CX options: packetization interval is not a multiple of 20ms!\n"); + return 535; + } + + return 0; } void mgcp_rtp_end_config(struct mgcp_endpoint *endp, int expect_ssrc_change, @@ -486,6 +495,7 @@ struct mgcp_conn_rtp *conn = NULL; struct mgcp_conn *_conn = NULL; char conn_name[512]; + int rc; LOGP(DLMGCP, LOGL_NOTICE, "CRCX: creating new connection ...\n"); @@ -587,8 +597,14 @@ endp->callid = talloc_strdup(tcfg->endpoints, callid); /* Extract audio codec information */ - set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, - local_options); + rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, + local_options); + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "CRCX: endpoint:%x inavlid local connection options!\n", + ENDPOINT_NUMBER(endp)); + return create_err_response(endp, rc, "CRCX", p->trans); + } snprintf(conn_name, sizeof(conn_name), "%s", callid); _conn = mgcp_conn_alloc(NULL, endp, MGCP_CONN_TYPE_RTP, conn_name); @@ -706,6 +722,7 @@ const char *mode = NULL; struct mgcp_conn_rtp *conn = NULL; const char *conn_id = NULL; + int rc; LOGP(DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); @@ -778,8 +795,14 @@ if (have_sdp) mgcp_parse_sdp_data(endp, conn, p); - set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, - local_options); + rc = set_local_cx_options(endp->tcfg->endpoints, &endp->local_options, + local_options); + if (rc != 0) { + LOGP(DLMGCP, LOGL_ERROR, + "MDCX: endpoint:%x inavlid local connection options!\n", + ENDPOINT_NUMBER(endp)); + return create_err_response(endp, rc, "MDCX", p->trans); + } if (!have_sdp && endp->local_options.codec) mgcp_set_audio_info(p->cfg, &conn->end.codec, -- To view, visit https://gerrit.osmocom.org/6218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I02aaa3042f2a0e32eb4ec6b8753deab7082947a0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:37:53 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:37:53 +0000 Subject: [MERGED] osmo-mgw[master]: client: fix sdp parameter ordering In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: client: fix sdp parameter ordering ...................................................................... client: fix sdp parameter ordering The parameter ordering of the client responses does not match the ordering as proposed by by RFC2327, Chapter 6. SDP Specification - reorder generated SDP parameters so that they match RFC2327 Change-Id: I63cac2ebc982ffead92703c22bf68c7aafa7936c --- M src/libosmo-mgcp-client/mgcp_client.c M tests/mgcp_client/mgcp_client_test.ok 2 files changed, 9 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index 97f12c0..771de45 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -889,9 +889,6 @@ /* Add SDP protocol version */ rc += msgb_printf(msg, "v=0\r\n"); - /* Add session name (none) */ - rc += msgb_printf(msg, "s=-\r\n"); - /* Determine local IP-Address */ if (osmo_sock_local_ip(local_ip, mgcp->actual.remote_addr) < 0) { LOGP(DLMGCP, LOGL_ERROR, @@ -903,6 +900,9 @@ /* Add owner/creator (SDP) */ rc += msgb_printf(msg, "o=- %x 23 IN IP4 %s\r\n", mgcp_msg->call_id, local_ip); + + /* Add session name (none) */ + rc += msgb_printf(msg, "s=-\r\n"); /* Add RTP address and port */ if (mgcp_msg->audio_port == 0) { @@ -918,12 +918,13 @@ return NULL; } rc += msgb_printf(msg, "c=IN IP4 %s\r\n", mgcp_msg->audio_ip); - rc += - msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", - mgcp_msg->audio_port); /* Add time description, active time (SDP) */ rc += msgb_printf(msg, "t=0 0\r\n"); + + rc += + msgb_printf(msg, "m=audio %u RTP/AVP 255\r\n", + mgcp_msg->audio_port); } if (rc != 0) { diff --git a/tests/mgcp_client/mgcp_client_test.ok b/tests/mgcp_client/mgcp_client_test.ok index 00c7f7c..4dc89b8 100644 --- a/tests/mgcp_client/mgcp_client_test.ok +++ b/tests/mgcp_client/mgcp_client_test.ok @@ -44,11 +44,11 @@ M: sendrecv v=0 -s=- o=- 2f 23 IN IP4 127.0.0.1 +s=- c=IN IP4 192.168.100.23 -m=audio 1234 RTP/AVP 255 t=0 0 +m=audio 1234 RTP/AVP 255 Generated DLCX message: DLCX 3 23 at mgw MGCP 1.0 -- To view, visit https://gerrit.osmocom.org/6217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63cac2ebc982ffead92703c22bf68c7aafa7936c Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:39:24 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:39:24 +0000 Subject: osmo-mgw[master]: mgcp: fix use-after-free and add callback for endpoint cleanup In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6006 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I921d9bbe58be1c3298e164a37f3c974880b3759f Gerrit-PatchSet: 2 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:40:34 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:40:34 +0000 Subject: osmo-mgw[master]: client: use heap to store mgcp_response In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5099abe68b580c75b47bc797bf93f01084f0c4db Gerrit-PatchSet: 1 Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:42:09 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:42:09 +0000 Subject: osmo-gsm-tester[master]: Create a cumulative distribution function class In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Jan 31 23:42:21 2018 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 31 Jan 2018 23:42:21 +0000 Subject: osmo-gsm-tester[master]: cdf: Add API to scale percent to target value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/6231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9d5b63909eef3d592aec6d51452f3b1811d8cc07 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-tester Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No